mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-18 00:25:37 +01:00
1044eb572a
Updated WordPress packages necessary for releasing WordPress 6.1 Beta 1: - @wordpress/a11y@3.17.1 - @wordpress/annotations@2.17.2 - @wordpress/api-fetch@6.14.1 - @wordpress/autop@3.17.1 - @wordpress/babel-plugin-import-jsx-pragma@4.0.1 - @wordpress/babel-plugin-makepot@5.1.1 - @wordpress/babel-preset-default@7.1.1 - @wordpress/base-styles@4.8.1 - @wordpress/blob@3.17.1 - @wordpress/block-directory@3.15.2 - @wordpress/block-editor@10.0.2 - @wordpress/block-library@7.14.2 - @wordpress/block-serialization-default-parser@4.17.1 - @wordpress/block-serialization-spec-parser@4.17.1 - @wordpress/blocks@11.16.2 - @wordpress/browserslist-config@5.0.1 - @wordpress/components@21.0.2 - @wordpress/compose@5.15.2 - @wordpress/core-data@5.0.2 - @wordpress/create-block-tutorial-template@2.5.1 - @wordpress/create-block@4.1.1 - @wordpress/custom-templated-path-webpack-plugin@2.1.3 - @wordpress/customize-widgets@3.14.2 - @wordpress/data-controls@2.17.2 - @wordpress/data@7.1.2 - @wordpress/date@4.17.1 - @wordpress/dependency-extraction-webpack-plugin@4.0.2 - @wordpress/deprecated@3.17.1 - @wordpress/docgen@1.26.1 - @wordpress/dom-ready@3.17.1 - @wordpress/dom@3.17.2 - @wordpress/e2e-test-utils@8.1.1 - @wordpress/e2e-tests@5.1.2 - @wordpress/edit-post@6.14.2 - @wordpress/edit-site@4.14.2 - @wordpress/edit-widgets@4.14.2 - @wordpress/editor@12.16.2 - @wordpress/element@4.15.1 - @wordpress/env@5.2.1 - @wordpress/escape-html@2.17.1 - @wordpress/eslint-plugin@13.1.1 - @wordpress/format-library@3.15.2 - @wordpress/hooks@3.17.1 - @wordpress/html-entities@3.17.1 - @wordpress/i18n@4.17.1 - @wordpress/icons@9.8.1 - @wordpress/interface@4.16.2 - @wordpress/is-shallow-equal@4.17.1 - @wordpress/jest-console@6.0.1 - @wordpress/jest-preset-default@9.0.1 - @wordpress/jest-puppeteer-axe@5.0.1 - @wordpress/keyboard-shortcuts@3.15.2 - @wordpress/keycodes@3.17.1 - @wordpress/lazy-import@1.4.3 - @wordpress/library-export-default-webpack-plugin@2.3.3 - @wordpress/list-reusable-blocks@3.15.2 - @wordpress/media-utils@4.8.1 - @wordpress/notices@3.17.2 - @wordpress/npm-package-json-lint-config@4.2.1 - @wordpress/nux@5.15.2 - @wordpress/plugins@4.15.2 - @wordpress/postcss-plugins-preset@4.1.1 - @wordpress/postcss-themes@5.0.1 - @wordpress/preferences-persistence@1.9.1 - @wordpress/preferences@2.9.2 - @wordpress/prettier-config@2.0.1 - @wordpress/primitives@3.15.1 - @wordpress/priority-queue@2.17.2 - @wordpress/project-management-automation@1.16.1 - @wordpress/react-i18n@3.15.1 - @wordpress/readable-js-assets-webpack-plugin@2.0.1 - @wordpress/redux-routine@4.17.1 - @wordpress/reusable-blocks@3.15.2 - @wordpress/rich-text@5.15.2 - @wordpress/scripts@24.1.2 - @wordpress/server-side-render@3.15.2 - @wordpress/shortcode@3.17.1 - @wordpress/style-engine@1.0.1 - @wordpress/stylelint-config@21.0.1 - @wordpress/token-list@2.17.1 - @wordpress/url@3.18.1 - @wordpress/viewport@4.15.2 - @wordpress/warning@2.17.1 - @wordpress/widgets@2.15.2 - @wordpress/wordcount@3.17.1 Props bernhard-reiter, cbravobernal, czapla, oandregal, isabel_brison, andrewserong, mciampini. See #56467. Built from https://develop.svn.wordpress.org/trunk@54257 git-svn-id: http://core.svn.wordpress.org/trunk@53816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
12 lines
201 KiB
JavaScript
12 lines
201 KiB
JavaScript
/*! This file is auto-generated */
|
||
!function(){var e={6411:function(e,t){var n,l,a;
|
||
/*!
|
||
autosize 4.0.4
|
||
license: MIT
|
||
http://www.jacklmoore.com/autosize
|
||
*/l=[e,t],n=function(e,t){"use strict";var n,l,a="function"==typeof Map?new Map:(n=[],l=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return l[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),l.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),l.splice(t,1))}}),r=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){r=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function o(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!a.has(e)){var t=null,n=null,l=null,o=function(){e.clientWidth!==n&&d()},i=function(t){window.removeEventListener("resize",o,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",i,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),a.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",i,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",o,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",a.set(e,{destroy:i,update:d}),s()}function s(){var n=window.getComputedStyle(e,null);"vertical"===n.resize?e.style.resize="none":"both"===n.resize&&(e.style.resize="horizontal"),t="content-box"===n.boxSizing?-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),isNaN(t)&&(t=0),d()}function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function m(){if(0!==e.scrollHeight){var l=u(e),a=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,l.forEach((function(e){e.node.scrollTop=e.scrollTop})),a&&(document.documentElement.scrollTop=a)}}function d(){m();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),a="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(a<t?"hidden"===n.overflowY&&(c("scroll"),m(),a="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),m(),a="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),l!==a){l=a;var o=r("autosize:resized");try{e.dispatchEvent(o)}catch(e){}}}}function i(e){var t=a.get(e);t&&t.destroy()}function s(e){var t=a.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return o(e,t)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e}),t.default=c,e.exports=t.default},void 0===(a="function"==typeof n?n.apply(t,l):n)||(e.exports=a)},4403:function(e,t){var n;
|
||
/*!
|
||
Copyright (c) 2018 Jed Watson.
|
||
Licensed under the MIT License (MIT), see
|
||
http://jedwatson.github.io/classnames
|
||
*/!function(){"use strict";var l={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e.push(n);else if(Array.isArray(n)){if(n.length){var o=a.apply(null,n);o&&e.push(o)}}else if("object"===r){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var i in n)l.call(n,i)&&n[i]&&e.push(i)}}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},4827:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},8981:function(e,t){var n,l,a;l=[],void 0===(a="function"==typeof(n=function(){return function e(t,n,l){var a,r,o=window,i="application/octet-stream",s=l||i,c=t,u=!n&&!l&&c,m=document.createElement("a"),d=function(e){return String(e)},p=o.Blob||o.MozBlob||o.WebKitBlob||d,g=n||"download";if(p=p.call?p.bind(o):Blob,"true"===String(this)&&(s=(c=[c,s])[0],c=c[1]),u&&u.length<2048&&(g=u.split("/").pop().split("?")[0],m.href=u,-1!==m.href.indexOf(u))){var _=new XMLHttpRequest;return _.open("GET",u,!0),_.responseType="blob",_.onload=function(t){e(t.target.response,g,i)},setTimeout((function(){_.send()}),0),_}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(c)){if(!(c.length>2096103.424&&p!==d))return navigator.msSaveBlob?navigator.msSaveBlob(v(c),g):y(c);s=(c=v(c)).type||i}else if(/([\x80-\xff])/.test(c)){for(var h=0,f=new Uint8Array(c.length),E=f.length;h<E;++h)f[h]=c.charCodeAt(h);c=new p([f],{type:s})}function v(e){for(var t=e.split(/[:;,]/),n=t[1],l=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),a=l.length,r=0,o=new Uint8Array(a);r<a;++r)o[r]=l.charCodeAt(r);return new p([o],{type:n})}function y(e,t){if("download"in m)return m.href=e,m.setAttribute("download",g),m.className="download-js-link",m.innerHTML="downloading...",m.style.display="none",document.body.appendChild(m),setTimeout((function(){m.click(),document.body.removeChild(m),!0===t&&setTimeout((function(){o.URL.revokeObjectURL(m.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,i)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var n=document.createElement("iframe");document.body.appendChild(n),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,i)),n.src=e,setTimeout((function(){document.body.removeChild(n)}),333)}if(a=c instanceof p?c:new p([c],{type:s}),navigator.msSaveBlob)return navigator.msSaveBlob(a,g);if(o.URL)y(o.URL.createObjectURL(a),!0);else{if("string"==typeof a||a.constructor===d)try{return y("data:"+s+";base64,"+o.btoa(a))}catch(e){return y("data:"+s+","+encodeURIComponent(a))}(r=new FileReader).onload=function(e){y(this.result)},r.readAsDataURL(a)}return!0}})?n.apply(t,l):n)||(e.exports=a)},9894:function(e,t,n){var l=n(4827);e.exports=function(e){var t=l(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var a=e.style.lineHeight;e.style.lineHeight=t+"em",t=l(e,"line-height"),n=parseFloat(t,10),a?e.style.lineHeight=a:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var r=e.nodeName,o=document.createElement(r);o.innerHTML=" ","TEXTAREA"===r.toUpperCase()&&o.setAttribute("rows","1");var i=l(e,"font-size");o.style.fontSize=i,o.style.padding="0px",o.style.border="0px";var s=document.body;s.appendChild(o),n=o.offsetHeight,s.removeChild(o)}return n}},5372:function(e,t,n){"use strict";var l=n(9567);function a(){}function r(){}r.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,r,o){if(o!==l){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:r,resetWarningCache:a};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 l,a=this&&this.__extends||(l=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}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,l=arguments.length;n<l;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},o=this&&this.__rest||function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(l=Object.getOwnPropertySymbols(e);a<l.length;a++)t.indexOf(l[a])<0&&(n[l[a]]=e[l[a]])}return n};t.__esModule=!0;var i=n(9196),s=n(2652),c=n(6411),u=n(9894),m="autosize:resized",d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return a(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,l=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||l?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(m,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(m,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),l=(t.onChange,t.style),a=(t.innerRef,t.children),s=o(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return i.createElement("textarea",r({},s,{onChange:this.onChange,style:u?r({},l,{maxHeight:u}):l,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),a)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:s.number,maxRows:s.number,onResize:s.func,innerRef:s.any,async:s.bool},t}(i.Component);t.TextareaAutosize=i.forwardRef((function(e,t){return i.createElement(d,r({},e,{innerRef:t}))}))},773:function(e,t,n){"use strict";var l=n(5438);t.Z=l.TextareaAutosize},9196:function(e){"use strict";e.exports=window.React}},t={};function n(l){var a=t[l];if(void 0!==a)return a.exports;var r=t[l]={exports:{}};return e[l].call(r.exports,r,r.exports,n),r.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var l in t)n.o(t,l)&&!n.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};!function(){"use strict";n.r(l),n.d(l,{PluginMoreMenuItem:function(){return Zo},PluginSidebar:function(){return Xo},PluginSidebarMoreMenuItem:function(){return Ko},__experimentalMainDashboardButton:function(){return er},__experimentalNavigationToggle:function(){return rr},initializeEditor:function(){return Jo},reinitializeEditor:function(){return Qo}});var e={};n.r(e),n.d(e,{disableComplementaryArea:function(){return N},enableComplementaryArea:function(){return T},pinItem:function(){return I},setDefaultComplementaryArea:function(){return C},setFeatureDefaults:function(){return z},setFeatureValue:function(){return V},toggleFeature:function(){return P},unpinItem:function(){return M}});var t={};n.r(t),n.d(t,{getActiveComplementaryArea:function(){return A},isFeatureActive:function(){return R},isItemPinned:function(){return B}});var a={};n.r(a),n.d(a,{__experimentalSetPreviewDeviceType:function(){return tt},addTemplate:function(){return lt},closeGeneralSidebar:function(){return ht},openGeneralSidebar:function(){return _t},openNavigationPanelToMenu:function(){return ct},removeTemplate:function(){return at},revertTemplate:function(){return gt},setHomeTemplateId:function(){return ot},setIsInserterOpened:function(){return mt},setIsListViewOpened:function(){return pt},setIsNavigationPanelOpened:function(){return ut},setNavigationPanelActiveMenu:function(){return st},setPage:function(){return it},setTemplate:function(){return nt},setTemplatePart:function(){return rt},switchEditorMode:function(){return ft},toggleFeature:function(){return et},updateSettings:function(){return dt}});var r={};n.r(r),n.d(r,{__experimentalGetInsertionPoint:function(){return Dt},__experimentalGetPreviewDeviceType:function(){return Ct},__unstableGetPreference:function(){return St},getCanUserCreateMedia:function(){return Tt},getCurrentTemplateNavigationPanelSubMenu:function(){return Rt},getCurrentTemplateTemplateParts:function(){return Ft},getEditedPostId:function(){return zt},getEditedPostType:function(){return Vt},getEditorMode:function(){return Ht},getHomeTemplateId:function(){return Mt},getNavigationPanelActiveMenu:function(){return Bt},getPage:function(){return At},getReusableBlocks:function(){return Nt},getSettings:function(){return It},isFeatureActive:function(){return kt},isInserterOpened:function(){return Ot},isListViewOpened:function(){return Gt},isNavigationOpened:function(){return Lt}});var o=window.wp.element,i=window.wp.blocks,s=window.wp.blockLibrary,c=window.wp.data,u=window.wp.coreData,m=window.wp.editor;function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},d.apply(this,arguments)}var p=n(4403),g=n.n(p),_=window.wp.components,h=window.wp.i18n,f=window.wp.primitives;var E=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));var v=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"}));var y=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})),b=window.wp.viewport;var w=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.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"})),x=window.wp.deprecated,S=n.n(x),k=window.wp.preferences;const C=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),T=(e,t)=>n=>{let{registry:l,dispatch:a}=n;if(!t)return;l.select(k.store).get(e,"isComplementaryAreaVisible")||l.dispatch(k.store).set(e,"isComplementaryAreaVisible",!0),a({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},N=e=>t=>{let{registry:n}=t;n.select(k.store).get(e,"isComplementaryAreaVisible")&&n.dispatch(k.store).set(e,"isComplementaryAreaVisible",!1)},I=(e,t)=>n=>{let{registry:l}=n;if(!t)return;const a=l.select(k.store).get(e,"pinnedItems");!0!==(null==a?void 0:a[t])&&l.dispatch(k.store).set(e,"pinnedItems",{...a,[t]:!0})},M=(e,t)=>n=>{let{registry:l}=n;if(!t)return;const a=l.select(k.store).get(e,"pinnedItems");l.dispatch(k.store).set(e,"pinnedItems",{...a,[t]:!1})};function P(e,t){return function(n){let{registry:l}=n;S()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),l.dispatch(k.store).toggle(e,t)}}function V(e,t,n){return function(l){let{registry:a}=l;S()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),a.dispatch(k.store).set(e,t,!!n)}}function z(e,t){return function(n){let{registry:l}=n;S()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),l.dispatch(k.store).setDefaults(e,t)}}const A=(0,c.createRegistrySelector)((e=>(t,n)=>{var l;const a=e(k.store).get(n,"isComplementaryAreaVisible");if(void 0!==a)return a?null==t||null===(l=t.complementaryAreas)||void 0===l?void 0:l[n]:null})),B=(0,c.createRegistrySelector)((e=>(t,n,l)=>{var a;const r=e(k.store).get(n,"pinnedItems");return null===(a=null==r?void 0:r[l])||void 0===a||a})),R=(0,c.createRegistrySelector)((e=>(t,n,l)=>(S()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(k.store).get(n,l))));var L=(0,c.combineReducers)({complementaryAreas:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:n,area:l}=t;return e[n]?e:{...e,[n]:l}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:l}=t;return{...e,[n]:l}}}return e}});const O=(0,c.createReduxStore)("core/interface",{reducer:L,actions:e,selectors:t});(0,c.register)(O);var D=window.wp.plugins,G=(0,D.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));var F=G((function(e){let{as:t=_.Button,scope:n,identifier:l,icon:a,selectedIcon:r,name:i,...s}=e;const u=t,m=(0,c.useSelect)((e=>e(O).getActiveComplementaryArea(n)===l),[l]),{enableComplementaryArea:p,disableComplementaryArea:g}=(0,c.useDispatch)(O);return(0,o.createElement)(u,d({icon:r&&m?r:a,onClick:()=>{m?g(n):p(n,l)}},s))}));var H=e=>{let{smallScreenTitle:t,children:n,className:l,toggleButtonProps:a}=e;const r=(0,o.createElement)(F,d({icon:w},a));return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},t&&(0,o.createElement)("span",{className:"interface-complementary-area-header__small-title"},t),r),(0,o.createElement)("div",{className:g()("components-panel__header","interface-complementary-area-header",l),tabIndex:-1},n,r))};const $=()=>{};function U(e){let{name:t,as:n=_.Button,onClick:l,...a}=e;return(0,o.createElement)(_.Fill,{name:t},(e=>{let{onClick:t}=e;return(0,o.createElement)(n,d({onClick:l||t?function(){(l||$)(...arguments),(t||$)(...arguments)}:void 0},a))}))}U.Slot=function(e){let{name:t,as:n=_.ButtonGroup,fillProps:l={},bubblesVirtually:a,...r}=e;return(0,o.createElement)(_.Slot,{name:t,bubblesVirtually:a,fillProps:l},(e=>{if(!o.Children.toArray(e).length)return null;const t=[];o.Children.forEach(e,(e=>{let{props:{__unstableExplicitMenuItem:n,__unstableTarget:l}}=e;l&&n&&t.push(l)}));const l=o.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&t.includes(e.props.__unstableTarget)?null:e));return(0,o.createElement)(n,r,l)}))};var W=U;const j=e=>{let{__unstableExplicitMenuItem:t,__unstableTarget:n,...l}=e;return(0,o.createElement)(_.MenuItem,l)};function Y(e){let{scope:t,target:n,__unstableExplicitMenuItem:l,...a}=e;return(0,o.createElement)(F,d({as:e=>(0,o.createElement)(W,d({__unstableExplicitMenuItem:l,__unstableTarget:`${t}/${n}`,as:j,name:`${t}/plugin-more-menu`},e)),role:"menuitemcheckbox",selectedIcon:E,name:n,scope:t},a))}function q(e){let{scope:t,...n}=e;return(0,o.createElement)(_.Fill,d({name:`PinnedItems/${t}`},n))}q.Slot=function(e){let{scope:t,className:n,...l}=e;return(0,o.createElement)(_.Slot,d({name:`PinnedItems/${t}`},l),(e=>(null==e?void 0:e.length)>0&&(0,o.createElement)("div",{className:g()(n,"interface-pinned-items")},e)))};var X=q;function K(e){let{scope:t,children:n,className:l}=e;return(0,o.createElement)(_.Fill,{name:`ComplementaryArea/${t}`},(0,o.createElement)("div",{className:l},n))}const Z=G((function(e){let{children:t,className:n,closeLabel:l=(0,h.__)("Close plugin"),identifier:a,header:r,headerClassName:i,icon:s,isPinnable:u=!0,panelClassName:m,scope:d,name:p,smallScreenTitle:f,title:w,toggleShortcut:x,isActiveByDefault:S,showIconLabels:k=!1}=e;const{isActive:C,isPinned:T,activeArea:N,isSmall:I,isLarge:M}=(0,c.useSelect)((e=>{const{getActiveComplementaryArea:t,isItemPinned:n}=e(O),l=t(d);return{isActive:l===a,isPinned:n(d,a),activeArea:l,isSmall:e(b.store).isViewportMatch("< medium"),isLarge:e(b.store).isViewportMatch("large")}}),[a,d]);!function(e,t,n,l,a){const r=(0,o.useRef)(!1),i=(0,o.useRef)(!1),{enableComplementaryArea:s,disableComplementaryArea:u}=(0,c.useDispatch)(O);(0,o.useEffect)((()=>{l&&a&&!r.current?(u(e),i.current=!0):i.current&&!a&&r.current?(i.current=!1,s(e,t)):i.current&&n&&n!==t&&(i.current=!1),a!==r.current&&(r.current=a)}),[l,a,e,t,n])}(d,a,N,C,I);const{enableComplementaryArea:P,disableComplementaryArea:V,pinItem:z,unpinItem:A}=(0,c.useDispatch)(O);return(0,o.useEffect)((()=>{S&&void 0===N&&!I&&P(d,a)}),[N,S,d,a,I]),(0,o.createElement)(o.Fragment,null,u&&(0,o.createElement)(X,{scope:d},T&&(0,o.createElement)(F,{scope:d,identifier:a,isPressed:C&&(!k||M),"aria-expanded":C,label:w,icon:k?E:s,showTooltip:!k,variant:k?"tertiary":void 0})),p&&u&&(0,o.createElement)(Y,{target:p,scope:d,icon:s},w),C&&(0,o.createElement)(K,{className:g()("interface-complementary-area",n),scope:d},(0,o.createElement)(H,{className:i,closeLabel:l,onClose:()=>V(d),smallScreenTitle:f,toggleButtonProps:{label:l,shortcut:x,scope:d,identifier:a}},r||(0,o.createElement)(o.Fragment,null,(0,o.createElement)("strong",null,w),u&&(0,o.createElement)(_.Button,{className:"interface-complementary-area__pin-unpin-item",icon:T?v:y,label:T?(0,h.__)("Unpin from toolbar"):(0,h.__)("Pin to toolbar"),onClick:()=>(T?A:z)(d,a),isPressed:T,"aria-expanded":T}))),(0,o.createElement)(_.Panel,{className:m},t)))}));Z.Slot=function(e){let{scope:t,...n}=e;return(0,o.createElement)(_.Slot,d({name:`ComplementaryArea/${t}`},n))};var Q=Z,J=window.wp.compose;var ee=(0,o.forwardRef)((function(e,t){let{footer:n,header:l,sidebar:a,secondarySidebar:r,notices:i,content:s,drawer:c,actions:u,labels:m,className:p,shortcuts:f}=e;const E=(0,_.__unstableUseNavigateRegions)(f);!function(e){(0,o.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const v={...{drawer:(0,h.__)("Drawer"),header:(0,h.__)("Header"),body:(0,h.__)("Content"),secondarySidebar:(0,h.__)("Block Library"),sidebar:(0,h.__)("Settings"),actions:(0,h.__)("Publish"),footer:(0,h.__)("Footer")},...m};return(0,o.createElement)("div",d({},E,{ref:(0,J.useMergeRefs)([t,E.ref]),className:g()(p,"interface-interface-skeleton",E.className,!!n&&"has-footer")}),!!c&&(0,o.createElement)("div",{className:"interface-interface-skeleton__drawer",role:"region","aria-label":v.drawer,tabIndex:"-1"},c),(0,o.createElement)("div",{className:"interface-interface-skeleton__editor"},!!l&&(0,o.createElement)("div",{className:"interface-interface-skeleton__header",role:"region","aria-label":v.header,tabIndex:"-1"},l),(0,o.createElement)("div",{className:"interface-interface-skeleton__body"},!!r&&(0,o.createElement)("div",{className:"interface-interface-skeleton__secondary-sidebar",role:"region","aria-label":v.secondarySidebar,tabIndex:"-1"},r),!!i&&(0,o.createElement)("div",{className:"interface-interface-skeleton__notices"},i),(0,o.createElement)("div",{className:"interface-interface-skeleton__content",role:"region","aria-label":v.body,tabIndex:"-1"},s),!!a&&(0,o.createElement)("div",{className:"interface-interface-skeleton__sidebar",role:"region","aria-label":v.sidebar,tabIndex:"-1"},a),!!u&&(0,o.createElement)("div",{className:"interface-interface-skeleton__actions",role:"region","aria-label":v.actions,tabIndex:"-1"},u))),!!n&&(0,o.createElement)("div",{className:"interface-interface-skeleton__footer",role:"region","aria-label":v.footer,tabIndex:"-1"},n))}));var te=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function ne(e){let{as:t=_.DropdownMenu,className:n,label:l=(0,h.__)("Options"),popoverProps:a,toggleProps:r,children:i}=e;return(0,o.createElement)(t,{className:g()("interface-more-menu-dropdown",n),icon:te,label:l,popoverProps:{position:"bottom left",...a,className:g()("interface-more-menu-dropdown__content",null==a?void 0:a.className)},toggleProps:{tooltipPosition:"bottom",...r}},(e=>i(e)))}function le(e){let{closeModal:t,children:n}=e;return(0,o.createElement)(_.Modal,{className:"interface-preferences-modal",title:(0,h.__)("Preferences"),closeLabel:(0,h.__)("Close"),onRequestClose:t},n)}var ae=function(e){let{icon:t,size:n=24,...l}=e;return(0,o.cloneElement)(t,{width:n,height:n,...l})};var re=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var oe=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));const ie="preferences-menu";function se(e){let{sections:t}=e;const n=(0,J.useViewportMatch)("medium"),[l,a]=(0,o.useState)(ie),{tabs:r,sectionsContentMap:i}=(0,o.useMemo)((()=>{let e={tabs:[],sectionsContentMap:{}};return t.length&&(e=t.reduce(((e,t)=>{let{name:n,tabLabel:l,content:a}=t;return e.tabs.push({name:n,title:l}),e.sectionsContentMap[n]=a,e}),{tabs:[],sectionsContentMap:{}})),e}),[t]),s=(0,o.useCallback)((e=>i[e.name]||null),[i]);let c;return c=n?(0,o.createElement)(_.TabPanel,{className:"interface-preferences__tabs",tabs:r,initialTabName:l!==ie?l:void 0,onSelect:a,orientation:"vertical"},s):(0,o.createElement)(_.__experimentalNavigatorProvider,{initialPath:"/",className:"interface-preferences__provider"},(0,o.createElement)(_.__experimentalNavigatorScreen,{path:"/"},(0,o.createElement)(_.Card,{isBorderless:!0,size:"small"},(0,o.createElement)(_.CardBody,null,(0,o.createElement)(_.__experimentalItemGroup,null,r.map((e=>(0,o.createElement)(_.__experimentalNavigatorButton,{key:e.name,path:e.name,as:_.__experimentalItem,isAction:!0},(0,o.createElement)(_.__experimentalHStack,{justify:"space-between"},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.__experimentalTruncate,null,e.title)),(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(ae,{icon:(0,h.isRTL)()?re:oe})))))))))),t.length&&t.map((e=>(0,o.createElement)(_.__experimentalNavigatorScreen,{key:`${e.name}-menu`,path:e.name},(0,o.createElement)(_.Card,{isBorderless:!0,size:"large"},(0,o.createElement)(_.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6"},(0,o.createElement)(_.__experimentalNavigatorBackButton,{icon:(0,h.isRTL)()?oe:re,"aria-label":(0,h.__)("Navigate to the previous view")}),(0,o.createElement)(_.__experimentalText,{size:"16"},e.tabLabel)),(0,o.createElement)(_.CardBody,null,e.content)))))),c}var ce=e=>{let{description:t,title:n,children:l}=e;return(0,o.createElement)("fieldset",{className:"interface-preferences-modal__section"},(0,o.createElement)("legend",{className:"interface-preferences-modal__section-legend"},(0,o.createElement)("h2",{className:"interface-preferences-modal__section-title"},n),t&&(0,o.createElement)("p",{className:"interface-preferences-modal__section-description"},t)),l)};var ue=function(e){let{help:t,label:n,isChecked:l,onChange:a,children:r}=e;return(0,o.createElement)("div",{className:"interface-preferences-modal__option"},(0,o.createElement)(_.ToggleControl,{__nextHasNoMarginBottom:!0,help:t,label:n,checked:l,onChange:a}),r)},me=window.wp.url,de=window.wp.hooks,pe=window.wp.mediaUtils;(0,de.addFilter)("editor.MediaUpload","core/edit-site/components/media-upload",(()=>pe.MediaUpload));var ge,_e=window.wp.blockEditor;!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(ge||(ge={}));var he=function(e){return e};var fe="beforeunload",Ee="popstate";function ve(e){e.preventDefault(),e.returnValue=""}function ye(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function be(){return Math.random().toString(36).substr(2,8)}function we(e){var t=e.pathname,n=void 0===t?"/":t,l=e.search,a=void 0===l?"":l,r=e.hash,o=void 0===r?"":r;return a&&"?"!==a&&(n+="?"===a.charAt(0)?a:"?"+a),o&&"#"!==o&&(n+="#"===o.charAt(0)?o:"#"+o),n}function xe(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var l=e.indexOf("?");l>=0&&(t.search=e.substr(l),e=e.substr(0,l)),e&&(t.pathname=e)}return t}const Se=function(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,l=n.history;function a(){var e=n.location,t=e.pathname,a=e.search,r=e.hash,o=l.state||{};return[o.idx,he({pathname:t,search:a,hash:r,state:o.usr||null,key:o.key||"default"})]}var r=null;n.addEventListener(Ee,(function(){if(r)m.call(r),r=null;else{var e=ge.Pop,t=a(),n=t[0],l=t[1];if(m.length){if(null!=n){var o=s-n;o&&(r={action:e,location:l,retry:function(){E(-1*o)}},E(o))}}else f(e)}}));var o=ge.Pop,i=a(),s=i[0],c=i[1],u=ye(),m=ye();function p(e){return"string"==typeof e?e:we(e)}function g(e,t){return void 0===t&&(t=null),he(d({pathname:c.pathname,hash:"",search:""},"string"==typeof e?xe(e):e,{state:t,key:be()}))}function _(e,t){return[{usr:e.state,key:e.key,idx:t},p(e)]}function h(e,t,n){return!m.length||(m.call({action:e,location:t,retry:n}),!1)}function f(e){o=e;var t=a();s=t[0],c=t[1],u.call({action:o,location:c})}function E(e){l.go(e)}null==s&&(s=0,l.replaceState(d({},l.state,{idx:s}),""));var v={get action(){return o},get location(){return c},createHref:p,push:function e(t,a){var r=ge.Push,o=g(t,a);if(h(r,o,(function(){e(t,a)}))){var i=_(o,s+1),c=i[0],u=i[1];try{l.pushState(c,"",u)}catch(e){n.location.assign(u)}f(r)}},replace:function e(t,n){var a=ge.Replace,r=g(t,n);if(h(a,r,(function(){e(t,n)}))){var o=_(r,s),i=o[0],c=o[1];l.replaceState(i,"",c),f(a)}},go:E,back:function(){E(-1)},forward:function(){E(1)},listen:function(e){return u.push(e)},block:function(e){var t=m.push(e);return 1===m.length&&n.addEventListener(fe,ve),function(){t(),m.length||n.removeEventListener(fe,ve)}}};return v}(),ke=Se.push,Ce=Se.replace;Se.push=function(e,t){return ke.call(Se,(0,me.addQueryArgs)(window.location.href,e),t)},Se.replace=function(e,t){return Ce.call(Se,(0,me.addQueryArgs)(window.location.href,e),t)};var Te=Se;const Ne=(0,o.createContext)(),Ie=(0,o.createContext)();function Me(){return(0,o.useContext)(Ne)}function Pe(){return(0,o.useContext)(Ie)}function Ve(e){const t=new URLSearchParams(e.search);return{...e,params:Object.fromEntries(t.entries())}}function ze(e){let{children:t}=e;const[n,l]=(0,o.useState)((()=>Ve(Te.location)));return(0,o.useEffect)((()=>Te.listen((e=>{let{location:t}=e;l(Ve(t))}))),[]),(0,o.createElement)(Ie.Provider,{value:Te},(0,o.createElement)(Ne.Provider,{value:n},t(n)))}function Ae(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const l=Pe();function a(a){a.preventDefault(),n?l.replace(e,t):l.push(e,t)}return{href:(0,me.addQueryArgs)(window.location.href,e),onClick:a}}function Be(e){let{params:t={},state:n,replace:l=!1,children:a,...r}=e;const{href:i,onClick:s}=Ae(t,n,l);return(0,o.createElement)("a",d({href:i,onClick:s},r),a)}function Re(e){let{attributes:t}=e;const{theme:n,slug:l}=t,{params:a}=Me(),r=(0,c.useSelect)((e=>e(u.store).getEntityRecord("postType","wp_template_part",`${n}//${l}`)),[n,l]),i=Ae({postId:null==r?void 0:r.id,postType:null==r?void 0:r.type},{fromTemplateId:a.postId});return r?(0,o.createElement)(_e.BlockControls,{group:"other"},(0,o.createElement)(_.ToolbarButton,d({},i,{onClick:e=>{i.onClick(e)}}),(0,h.__)("Edit"))):null}const Le=(0,J.createHigherOrderComponent)((e=>t=>{const{attributes:n,name:l}=t,a="core/template-part"===l&&n.slug;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(e,t),a&&(0,o.createElement)(Re,{attributes:n}))}),"withEditBlockControls");(0,de.addFilter)("editor.BlockEdit","core/edit-site/template-part-edit-button",Le);const Oe="core/edit-site",De="uncategorized",Ge=["index","singular","archive","single","page","home","404","search","author","category","taxonomy","date","tag","attachment","single","front-page"],Fe=["page-home"],He=["post-","author-","single-","tag-"],$e=["page-"],Ue={singular:["single","page"],index:["archive","404","search","singular","home"],home:["front-page"]},We="root",je="templates-general",Ye=[{area:"header",menu:"template-parts-headers",title:(0,h.__)("headers")},{area:"footer",menu:"template-parts-footers",title:(0,h.__)("footers")},{area:"sidebar",menu:"template-parts-sidebars",title:(0,h.__)("sidebars")},{area:De,menu:"template-parts-general",title:(0,h.__)("general")}];var qe=(0,c.combineReducers)({deviceType:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Desktop",t=arguments.length>1?arguments[1]:void 0;return"SET_PREVIEW_DEVICE_TYPE"===t.type?t.deviceType:e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},editedPost:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE":case"SET_PAGE":return{type:"wp_template",id:t.templateId,page:t.page};case"SET_TEMPLATE_PART":return{type:"wp_template_part",id:t.templatePartId}}return e},homeTemplateId:function(e,t){return"SET_HOME_TEMPLATE"===t.type?t.homeTemplateId:e},navigationPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{menu:We,isOpen:!1},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_NAVIGATION_PANEL_ACTIVE_MENU":return{...e,menu:t.menu};case"OPEN_NAVIGATION_PANEL_TO_MENU":return{...e,isOpen:!0,menu:t.menu};case"SET_IS_NAVIGATION_PANEL_OPENED":return{...e,menu:t.isOpen?e.menu:We,isOpen:t.isOpen};case"SET_IS_LIST_VIEW_OPENED":return{...e,menu:e.isOpen&&t.isOpen?We:e.menu,isOpen:!t.isOpen&&e.isOpen};case"SET_IS_INSERTER_OPENED":return{...e,menu:e.isOpen&&t.value?We:e.menu,isOpen:!t.value&&e.isOpen}}return e},blockInserterPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_NAVIGATION_PANEL_TO_MENU":return!1;case"SET_IS_NAVIGATION_PANEL_OPENED":case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},listViewPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_NAVIGATION_PANEL_TO_MENU":return!1;case"SET_IS_NAVIGATION_PANEL_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e}}),Xe=window.wp.apiFetch,Ke=n.n(Xe),Ze=window.wp.notices,Qe=window.wp.a11y;function Je(e){return!!e&&("custom"===(null==e?void 0:e.source)&&(null==e?void 0:e.has_theme_file))}function et(e){return function(t){let{registry:n}=t;S()("select( 'core/edit-site' ).toggleFeature( featureName )",{since:"6.0",alternative:"select( 'core/preferences').toggle( 'core/edit-site', featureName )"}),n.dispatch(k.store).toggle("core/edit-site",e)}}function tt(e){return{type:"SET_PREVIEW_DEVICE_TYPE",deviceType:e}}const nt=(e,t)=>async n=>{let{dispatch:l,registry:a}=n;if(!t){const n=await a.resolveSelect(u.store).getEntityRecord("postType","wp_template",e);t=null==n?void 0:n.slug}l({type:"SET_TEMPLATE",templateId:e,page:{context:{templateSlug:t}}})},lt=e=>async t=>{let{dispatch:n,registry:l}=t;const a=await l.dispatch(u.store).saveEntityRecord("postType","wp_template",e);e.content&&l.dispatch(u.store).editEntityRecord("postType","wp_template",a.id,{blocks:(0,i.parse)(e.content)},{undoIgnore:!0}),n({type:"SET_TEMPLATE",templateId:a.id,page:{context:{templateSlug:a.slug}}})},at=e=>async t=>{let{registry:n}=t;try{await n.dispatch(u.store).deleteEntityRecord("postType",e.type,e.id,{force:!0});const t=n.select(u.store).getLastEntityDeleteError("postType",e.type,e.id);if(t)throw t;n.dispatch(Ze.store).createSuccessNotice((0,h.sprintf)((0,h.__)('"%s" deleted.'),e.title.rendered),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("An error occurred while deleting the template.");n.dispatch(Ze.store).createErrorNotice(t,{type:"snackbar"})}};function rt(e){return{type:"SET_TEMPLATE_PART",templatePartId:e}}function ot(e){return{type:"SET_HOME_TEMPLATE",homeTemplateId:e}}const it=e=>async t=>{var n;let{dispatch:l,registry:a}=t;if(!e.path&&null!==(n=e.context)&&void 0!==n&&n.postId){const t=await a.resolveSelect(u.store).getEntityRecord("postType",e.context.postType||"post",e.context.postId);e.path=(0,me.getPathAndQueryString)(null==t?void 0:t.link)}const r=await a.resolveSelect(u.store).__experimentalGetTemplateForLink(e.path);if(r)return l({type:"SET_PAGE",page:r.slug?{...e,context:{...e.context,templateSlug:r.slug}}:e,templateId:r.id}),r.id};function st(e){return{type:"SET_NAVIGATION_PANEL_ACTIVE_MENU",menu:e}}function ct(e){return{type:"OPEN_NAVIGATION_PANEL_TO_MENU",menu:e}}function ut(e){return{type:"SET_IS_NAVIGATION_PANEL_OPENED",isOpen:e}}function mt(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function dt(e){return{type:"UPDATE_SETTINGS",settings:e}}function pt(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const gt=function(e){let{allowUndo:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async n=>{let{registry:l}=n;if(Je(e))try{var a;const n=l.select(u.store).getEntityConfig("postType",e.type);if(!n)return void l.dispatch(Ze.store).createErrorNotice((0,h.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const r=(0,me.addQueryArgs)(`${n.baseURL}/${e.id}`,{context:"edit",source:"theme"}),o=await Ke()({path:r});if(!o)return void l.dispatch(Ze.store).createErrorNotice((0,h.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const s=e=>{let{blocks:t=[]}=e;return(0,i.__unstableSerializeAndClean)(t)},c=l.select(u.store).getEditedEntityRecord("postType",e.type,e.id);l.dispatch(u.store).editEntityRecord("postType",e.type,e.id,{content:s,blocks:c.blocks,source:"custom"},{undoIgnore:!0});const m=(0,i.parse)(null==o||null===(a=o.content)||void 0===a?void 0:a.raw);if(l.dispatch(u.store).editEntityRecord("postType",e.type,o.id,{content:s,blocks:m,source:"theme"}),t){const t=()=>{l.dispatch(u.store).editEntityRecord("postType",e.type,c.id,{content:s,blocks:c.blocks,source:"custom"})};l.dispatch(Ze.store).createSuccessNotice((0,h.__)("Template reverted."),{type:"snackbar",actions:[{label:(0,h.__)("Undo"),onClick:t}]})}else l.dispatch(Ze.store).createSuccessNotice((0,h.__)("Template reverted."))}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("Template revert failed. Please reload.");l.dispatch(Ze.store).createErrorNotice(t,{type:"snackbar"})}else l.dispatch(Ze.store).createErrorNotice((0,h.__)("This template is not revertable."),{type:"snackbar"})}},_t=e=>t=>{let{registry:n}=t;n.dispatch(O).enableComplementaryArea(Oe,e)},ht=()=>e=>{let{registry:t}=e;t.dispatch(O).disableComplementaryArea(Oe)},ft=e=>t=>{let{registry:n}=t;n.dispatch("core/preferences").set("core/edit-site","editorMode",e),"visual"!==e&&n.dispatch(_e.store).clearSelectedBlock(),"visual"===e?(0,Qe.speak)((0,h.__)("Visual editor selected"),"assertive"):"mosaic"===e&&(0,Qe.speak)((0,h.__)("Mosaic view selected"),"assertive")};var Et=window.lodash,vt={};function yt(e){return[e]}function bt(e,t,n){var l;if(e.length!==t.length)return!1;for(l=n;l<e.length;l++)if(e[l]!==t[l])return!1;return!0}function wt(e,t,n){return!!Ue[e]&&("home"===e&&"posts"!==n||Ue[e].every((e=>t.includes(e)||wt(e,t,n))))}function xt(e){if(Ge.includes(e))return"templates";if(Fe.includes(e))return je;if(He.some((t=>e.startsWith(t))))return"templates-posts";return $e.some((t=>e.startsWith(t)))?"templates-pages":je}const St=(0,c.createRegistrySelector)((e=>(t,n)=>e(k.store).get("core/edit-site",n)));function kt(e,t){return S()("select( 'core/interface' ).isFeatureActive",{since:"6.0",alternative:"select( 'core/preferences' ).get"}),!!St(e,t)}function Ct(e){return e.deviceType}const Tt=(0,c.createRegistrySelector)((e=>()=>e(u.store).canUser("create","media"))),Nt=(0,c.createRegistrySelector)((e=>()=>"web"===o.Platform.OS?e(u.store).getEntityRecords("postType","wp_block",{per_page:-1}):[])),It=function(e,t){var n,l=t||yt;function a(e){var t,l,a,r,o,i=n,s=!0;for(t=0;t<e.length;t++){if(l=e[t],!(o=l)||"object"!=typeof o){s=!1;break}i.has(l)?i=i.get(l):(a=new WeakMap,i.set(l,a),i=a)}return i.has(vt)||((r=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=s,i.set(vt,r)),i.get(vt)}function r(){n=new WeakMap}function o(){var t,n,r,o,i,s=arguments.length;for(o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];for((t=a(i=l.apply(null,o))).isUniqueByDependants||(t.lastDependants&&!bt(i,t.lastDependants,0)&&t.clear(),t.lastDependants=i),n=t.head;n;){if(bt(n.args,o,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,o)},o[0]=null,n.args=o,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return o.getDependants=l,o.clear=r,r(),o}(((e,t)=>{const n={...e.settings,outlineMode:!0,focusMode:!!St(e,"focusMode"),hasFixedToolbar:!!St(e,"fixedToolbar"),keepCaretInsideBlock:!!St(e,"keepCaretInsideBlock"),showIconLabels:!!St(e,"showIconLabels"),__experimentalSetIsInserterOpened:t,__experimentalReusableBlocks:Nt(e),__experimentalPreferPatternsOnRoot:"wp_template"===Vt(e)};return Tt(e)?(n.mediaUpload=t=>{let{onError:n,...l}=t;(0,pe.uploadMedia)({wpAllowedMimeTypes:e.settings.allowedMimeTypes,onError:e=>{let{message:t}=e;return n(t)},...l})},n):n}),(e=>[Tt(e),e.settings,St(e,"focusMode"),St(e,"fixedToolbar"),St(e,"keepCaretInsideBlock"),St(e,"showIconLabels"),Nt(e),Vt(e)]));function Mt(e){return e.homeTemplateId}function Pt(e){return e.editedPost}function Vt(e){return Pt(e).type}function zt(e){return Pt(e).id}function At(e){return Pt(e).page}function Bt(e){return e.navigationPanel.menu}const Rt=(0,c.createRegistrySelector)((e=>t=>{const n=Vt(t),l=zt(t),a=l?e(u.store).getEntityRecord("postType",n,l):null;if(!a)return We;var r;if("wp_template_part"===n)return(null===(r=Ye.find((e=>e.area===(null==a?void 0:a.area))))||void 0===r?void 0:r.menu)||"template-parts";const o=e(u.store).getEntityRecords("postType","wp_template"),i=e(u.store).getEditedEntityRecord("root","site").show_on_front;return wt(a.slug,(0,Et.map)(o,"slug"),i)?"templates-unused":xt(a.slug)}));function Lt(e){return e.navigationPanel.isOpen}function Ot(e){return!!e.blockInserterPanel}function Dt(e){const{rootClientId:t,insertionIndex:n,filterValue:l}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:n,filterValue:l}}function Gt(e){return e.listViewPanel}const Ft=(0,c.createRegistrySelector)((e=>t=>{var n;const l=Vt(t),a=zt(t),r=e(u.store).getEditedEntityRecord("postType",l,a),o=e(u.store).getEntityRecords("postType","wp_template_part",{per_page:-1}),s=o?o.reduce(((e,t)=>({...e,[t.id]:t})),{}):{};return(null!==(n=r.blocks)&&void 0!==n?n:[]).filter((e=>(0,i.isTemplatePart)(e))).map((e=>{const{attributes:{theme:t,slug:n}}=e;return{templatePart:s[`${t}//${n}`],block:e}})).filter((e=>{let{templatePart:t}=e;return!!t}))}));function Ht(e){return St(e,"editorMode")}const $t={reducer:qe,actions:a,selectors:r},Ut=(0,c.createReduxStore)(Oe,$t);(0,c.register)(Ut);var Wt=window.wp.keyboardShortcuts;var jt=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));var Yt=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));var qt=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"m12 20-4.5-3.6-.9 1.2L12 22l5.5-4.4-.9-1.2L12 20zm0-16 4.5 3.6.9-1.2L12 2 6.5 6.4l.9 1.2L12 4z"}));var Xt=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.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"})),Kt=window.wp.keycodes;const Zt=[{keyCombination:{modifier:"primary",character:"b"},description:(0,h.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,h.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,h.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,h.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,h.__)("Insert a link to a post or page")},{keyCombination:{modifier:"primary",character:"u"},description:(0,h.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,h.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,h.__)("Make the selected text inline code.")}];function Qt(e){let{keyCombination:t,forceAriaLabel:n}=e;const l=t.modifier?Kt.displayShortcutList[t.modifier](t.character):t.character,a=t.modifier?Kt.shortcutAriaLabel[t.modifier](t.character):t.character;return(0,o.createElement)("kbd",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":n||a},(0,Et.castArray)(l).map(((e,t)=>"+"===e?(0,o.createElement)(o.Fragment,{key:t},e):(0,o.createElement)("kbd",{key:t,className:"edit-site-keyboard-shortcut-help-modal__shortcut-key"},e))))}function Jt(e){let{description:t,keyCombination:n,aliases:l=[],ariaLabel:a}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-description"},t),(0,o.createElement)("div",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-term"},(0,o.createElement)(Qt,{keyCombination:n,forceAriaLabel:a}),l.map(((e,t)=>(0,o.createElement)(Qt,{keyCombination:e,forceAriaLabel:a,key:t})))))}function en(e){let{name:t}=e;const{keyCombination:n,description:l,aliases:a}=(0,c.useSelect)((e=>{const{getShortcutKeyCombination:n,getShortcutDescription:l,getShortcutAliases:a}=e(Wt.store);return{keyCombination:n(t),aliases:a(t),description:l(t)}}),[t]);return n?(0,o.createElement)(Jt,{keyCombination:n,description:l,aliases:a}):null}const tn=e=>{let{shortcuts:t}=e;return(0,o.createElement)("ul",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-list",role:"list"},t.map(((e,t)=>(0,o.createElement)("li",{className:"edit-site-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,o.createElement)(en,{name:e}):(0,o.createElement)(Jt,e)))))},nn=e=>{let{title:t,shortcuts:n,className:l}=e;return(0,o.createElement)("section",{className:g()("edit-site-keyboard-shortcut-help-modal__section",l)},!!t&&(0,o.createElement)("h2",{className:"edit-site-keyboard-shortcut-help-modal__section-title"},t),(0,o.createElement)(tn,{shortcuts:n}))},ln=e=>{let{title:t,categoryName:n,additionalShortcuts:l=[]}=e;const a=(0,c.useSelect)((e=>e(Wt.store).getCategoryShortcuts(n)),[n]);return(0,o.createElement)(nn,{title:t,shortcuts:a.concat(l)})};function an(e){let{isModalActive:t,toggleModal:n}=e;return t?(0,o.createElement)(_.Modal,{className:"edit-site-keyboard-shortcut-help-modal",title:(0,h.__)("Keyboard shortcuts"),closeLabel:(0,h.__)("Close"),onRequestClose:n},(0,o.createElement)(nn,{className:"edit-site-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-site/keyboard-shortcuts"]}),(0,o.createElement)(ln,{title:(0,h.__)("Global shortcuts"),categoryName:"global"}),(0,o.createElement)(ln,{title:(0,h.__)("Selection shortcuts"),categoryName:"selection"}),(0,o.createElement)(ln,{title:(0,h.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,h.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,h.__)("Forward-slash")}]}),(0,o.createElement)(nn,{title:(0,h.__)("Text formatting"),shortcuts:Zt})):null}function rn(e){const{featureName:t,...n}=e,l=(0,c.useSelect)((e=>!!e(k.store).get("core/edit-site",t)),[t]),{toggle:a}=(0,c.useDispatch)(k.store);return(0,o.createElement)(ue,d({onChange:()=>a("core/edit-site",t),isChecked:l},n))}function on(e){let{isModalActive:t,toggleModal:n}=e;const l=(0,o.useMemo)((()=>[{name:"general",tabLabel:(0,h.__)("General"),content:(0,o.createElement)(ce,{title:(0,h.__)("Appearance"),description:(0,h.__)("Customize options related to the block editor interface and editing flow.")},(0,o.createElement)(rn,{featureName:"focusMode",help:(0,h.__)("Highlights the current block and fades other content."),label:(0,h.__)("Spotlight mode")}),(0,o.createElement)(rn,{featureName:"showIconLabels",label:(0,h.__)("Show button text labels"),help:(0,h.__)("Show text instead of icons on buttons.")}),(0,o.createElement)(rn,{featureName:"showListViewByDefault",help:(0,h.__)("Opens the block list view sidebar by default."),label:(0,h.__)("Always open list view")}))},{name:"blocks",tabLabel:(0,h.__)("Blocks"),content:(0,o.createElement)(ce,{title:(0,h.__)("Block interactions"),description:(0,h.__)("Customize how you interact with blocks in the block library and editing canvas.")},(0,o.createElement)(rn,{featureName:"keepCaretInsideBlock",help:(0,h.__)("Aids screen readers by stopping text caret from leaving blocks."),label:(0,h.__)("Contain text cursor inside block")}))}]));return t?(0,o.createElement)(le,{closeModal:n},(0,o.createElement)(se,{sections:l})):null}const{Fill:sn,Slot:cn}=(0,_.createSlotFill)("EditSiteToolsMoreMenuGroup");sn.Slot=e=>{let{fillProps:t}=e;return(0,o.createElement)(cn,{fillProps:t},(e=>!(0,Et.isEmpty)(e)&&e))};var un=sn,mn=n(8981),dn=n.n(mn);var pn=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"}));function gn(){const{createErrorNotice:e}=(0,c.useDispatch)(Ze.store);return(0,o.createElement)(_.MenuItem,{role:"menuitem",icon:pn,onClick:async function(){try{const e=await Ke()({path:"/wp-block-editor/v1/export",parse:!1,headers:{Accept:"application/zip"}}),t=await e.blob(),n=e.headers.get("content-disposition").match(/=(.+)\.zip/),l=n[1]?n[1]:"edit-site-export";dn()(t,l+".zip","application/zip")}catch(t){let n={};try{n=await t.json()}catch(e){}const l=n.message&&"unknown_error"!==n.code?n.message:(0,h.__)("An error occurred while creating the site export.");e(l,{type:"snackbar"})}},info:(0,h.__)("Download your theme with updated templates and styles.")},(0,h._x)("Export","site exporter menu item"))}function _n(){const{toggle:e}=(0,c.useDispatch)(k.store);return(0,o.createElement)(_.MenuItem,{onClick:()=>e("core/edit-site","welcomeGuide")},(0,h.__)("Welcome Guide"))}function hn(){const{createNotice:e}=(0,c.useDispatch)(Ze.store),t=(0,c.useSelect)((e=>()=>{const{getEditedPostId:t,getEditedPostType:n}=e(Ut),{getEditedEntityRecord:l}=e(u.store),a=l("postType",n(),t());if(a){if("function"==typeof a.content)return a.content(a);if(a.blocks)return(0,i.__unstableSerializeAndClean)(a.blocks);if(a.content)return a.content}return""}),[]);const n=(0,J.useCopyToClipboard)(t,(function(){e("info",(0,h.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,o.createElement)(_.MenuItem,{ref:n},(0,h.__)("Copy all blocks"))}const fn=[{value:"visual",label:(0,h.__)("Visual editor")},{value:"text",label:(0,h.__)("Code editor")}];var En=function(){const{shortcut:e,mode:t}=(0,c.useSelect)((e=>({shortcut:e(Wt.store).getShortcutRepresentation("core/edit-site/toggle-mode"),isRichEditingEnabled:e(Ut).getSettings().richEditingEnabled,isCodeEditingEnabled:e(Ut).getSettings().codeEditingEnabled,mode:e(Ut).getEditorMode()})),[]),{switchEditorMode:n}=(0,c.useDispatch)(Ut),l=fn.map((n=>n.value!==t?{...n,shortcut:e}:n));return(0,o.createElement)(_.MenuGroup,{label:(0,h.__)("Editor")},(0,o.createElement)(_.MenuItemsChoice,{choices:l,value:t,onSelect:n}))};function vn(e){let{showIconLabels:t}=e;const[n,l]=(0,o.useReducer)((e=>!e),!1),[a,r]=(0,o.useReducer)((e=>!e),!1);return(0,Wt.useShortcut)("core/edit-site/keyboard-shortcuts",l),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ne,{toggleProps:{showTooltip:!t,...t&&{variant:"tertiary"}}},(e=>{let{onClose:t}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.MenuGroup,{label:(0,h._x)("View","noun")},(0,o.createElement)(k.PreferenceToggleMenuItem,{scope:"core/edit-site",name:"fixedToolbar",label:(0,h.__)("Top toolbar"),info:(0,h.__)("Access all block and document tools in a single place"),messageActivated:(0,h.__)("Top toolbar activated"),messageDeactivated:(0,h.__)("Top toolbar deactivated")}),(0,o.createElement)(k.PreferenceToggleMenuItem,{scope:"core/edit-site",name:"focusMode",label:(0,h.__)("Spotlight mode"),info:(0,h.__)("Focus on one block at a time"),messageActivated:(0,h.__)("Spotlight mode activated"),messageDeactivated:(0,h.__)("Spotlight mode deactivated")}),(0,o.createElement)(En,null),(0,o.createElement)(W.Slot,{name:"core/edit-site/plugin-more-menu",label:(0,h.__)("Plugins"),as:_.MenuGroup,fillProps:{onClick:t}})),(0,o.createElement)(_.MenuGroup,{label:(0,h.__)("Tools")},(0,o.createElement)(gn,null),(0,o.createElement)(_.MenuItem,{onClick:l,shortcut:Kt.displayShortcut.access("h")},(0,h.__)("Keyboard shortcuts")),(0,o.createElement)(_n,null),(0,o.createElement)(hn,null),(0,o.createElement)(_.MenuItem,{icon:Xt,role:"menuitem",href:(0,h.__)("https://wordpress.org/support/article/site-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,h.__)("Help"),(0,o.createElement)(_.VisuallyHidden,{as:"span"},(0,h.__)("(opens in a new tab)"))),(0,o.createElement)(un.Slot,{fillProps:{onClose:t}})),(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,{onClick:r},(0,h.__)("Preferences"))))})),(0,o.createElement)(an,{isModalActive:n,toggleModal:l}),(0,o.createElement)(on,{isModalActive:a,toggleModal:r}))}function yn(e){let{openEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n}=e;const{isDirty:l,isSaving:a}=(0,c.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,isSavingEntityRecord:n}=e(u.store),l=t();return{isDirty:l.length>0,isSaving:(0,Et.some)(l,(e=>n(e.kind,e.name,e.key)))}}),[]),r=!l||a;return(0,o.createElement)(_.Button,{variant:"primary",className:"edit-site-save-button__button","aria-disabled":r,"aria-expanded":n,isBusy:a,onClick:r?void 0:t},(0,h.__)("Save"))}var bn=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"}));var wn=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"}));var xn=(0,o.forwardRef)((function(e,t){const n=(0,c.useSelect)((e=>e(u.store).hasUndo()),[]),{undo:l}=(0,c.useDispatch)(u.store);return(0,o.createElement)(_.Button,d({},e,{ref:t,icon:(0,h.isRTL)()?wn:bn,label:(0,h.__)("Undo"),shortcut:Kt.displayShortcut.primary("z"),"aria-disabled":!n,onClick:n?l:void 0}))}));var Sn=(0,o.forwardRef)((function(e,t){const n=(0,Kt.isAppleOS)()?Kt.displayShortcut.primaryShift("z"):Kt.displayShortcut.primary("y"),l=(0,c.useSelect)((e=>e(u.store).hasRedo()),[]),{redo:a}=(0,c.useDispatch)(u.store);return(0,o.createElement)(_.Button,d({},e,{ref:t,icon:(0,h.isRTL)()?bn:wn,label:(0,h.__)("Redo"),shortcut:n,"aria-disabled":!l,onClick:l?a:void 0}))}));var kn=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function Cn(e){if(e){const t=(0,i.getBlockType)(e.name);return t?(0,i.__experimentalGetBlockLabel)(t,e.attributes):null}return null}function Tn(e){let{entityTitle:t,entityLabel:n,isLoaded:l,children:a,showIconLabels:r}=e;const{label:i}=function(){const{getBlock:e}=(0,c.useSelect)(_e.store),t=(0,c.useSelect)((e=>e(_e.store).__experimentalGetActiveBlockIdByBlockNames(["core/template-part"])),[]);return t?{label:Cn(e(t)),isActive:!0}:{}}(),[s,u]=(0,o.useState)(null),m=(0,o.useMemo)((()=>({anchor:s})),[s]);return l?t?(0,o.createElement)("div",{className:g()("edit-site-document-actions",{"has-secondary-label":!!i})},(0,o.createElement)("div",{ref:u,className:"edit-site-document-actions__title-wrapper"},(0,o.createElement)(_.__experimentalText,{size:"body",className:"edit-site-document-actions__title",as:"h1"},(0,o.createElement)(_.VisuallyHidden,{as:"span"},(0,h.sprintf)((0,h.__)("Editing %s: "),n)),t),(0,o.createElement)(_.__experimentalText,{size:"body",className:"edit-site-document-actions__secondary-item"},null!=i?i:""),a&&(0,o.createElement)(_.Dropdown,{popoverProps:m,position:"bottom center",renderToggle:e=>{let{isOpen:t,onToggle:l}=e;return(0,o.createElement)(_.Button,{className:"edit-site-document-actions__get-info",icon:kn,"aria-expanded":t,"aria-haspopup":"true",onClick:l,variant:r?"tertiary":void 0,label:(0,h.sprintf)((0,h.__)("Show %s details"),n)},r&&(0,h.__)("Details"))},contentClassName:"edit-site-document-actions__info-dropdown",renderContent:a}))):(0,o.createElement)("div",{className:"edit-site-document-actions"},(0,h.__)("Template not found")):(0,o.createElement)("div",{className:"edit-site-document-actions"},(0,h.__)("Loading…"))}function Nn(e){var t;let{onClose:n,templatePart:l,closeTemplateDetailsDropdown:a}=e;const{revertTemplate:r}=(0,c.useDispatch)(Ut),{params:i}=Me(),s=Ae({postId:l.id,postType:l.type},{fromTemplateId:i.postId});return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,d({},s,{onClick:function(e){s.onClick(e),n(),a()}}),(0,h.sprintf)((0,h.__)("Edit %s"),null===(t=l.title)||void 0===t?void 0:t.rendered))),Je(l)&&(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,{info:(0,h.__)("Use the template part as supplied by the theme."),onClick:function(){r(l),n(),a()}},(0,h.__)("Clear customizations"))))}function In(e){let{templatePart:t,clientId:n,closeTemplateDetailsDropdown:l}=e;const{selectBlock:a,toggleBlockHighlight:r}=(0,c.useDispatch)(_e.store),i=(0,c.useSelect)((e=>e(m.store).__experimentalGetDefaultTemplatePartAreas().find((e=>e.area===t.area))),[t.area]),s=()=>r(n,!0),u=()=>r(n,!1);return(0,o.createElement)("div",{role:"menuitem",className:"edit-site-template-details__template-areas-item"},(0,o.createElement)(_.MenuItem,{role:"button",icon:null==i?void 0:i.icon,iconPosition:"left",onClick:()=>{a(n)},onMouseOver:s,onMouseLeave:u,onFocus:s,onBlur:u},null==i?void 0:i.label),(0,o.createElement)(_.DropdownMenu,{icon:te,label:(0,h.__)("More options"),className:"edit-site-template-details__template-areas-item-more"},(e=>{let{onClose:n}=e;return(0,o.createElement)(Nn,{onClose:n,templatePart:t,closeTemplateDetailsDropdown:l})})))}function Mn(e){let{closeTemplateDetailsDropdown:t}=e;const n=(0,c.useSelect)((e=>e(Ut).getCurrentTemplateTemplateParts()),[]);return n.length?(0,o.createElement)(_.MenuGroup,{label:(0,h.__)("Areas"),className:"edit-site-template-details__group edit-site-template-details__template-areas"},n.map((e=>{let{templatePart:n,block:l}=e;return(0,o.createElement)(In,{key:n.slug,clientId:l.clientId,templatePart:n,closeTemplateDetailsDropdown:t})}))):null}function Pn(e){let{template:t}=e;const[n,l]=(0,o.useState)(!1),[a,r]=(0,u.useEntityProp)("postType",t.type,"title",t.id);return(0,o.createElement)(_.TextControl,{label:(0,h.__)("Title"),value:n?"":a,help:"wp_template_part"!==t.type?(0,h.__)('Give the template a title that indicates its purpose, e.g. "Full Width".'):null,onChange:e=>{e||n?(l(!1),r(e)):l(!0)},onBlur:()=>l(!1)})}function Vn(e){let{id:t}=e;const[n,l]=(0,u.useEntityProp)("postType","wp_template_part","area",t),a=(0,c.useSelect)((e=>e(m.store).__experimentalGetDefaultTemplatePartAreas()),[]).map((e=>{let{label:t,area:n}=e;return{label:t,value:n}}));return(0,o.createElement)(_.SelectControl,{label:(0,h.__)("Area"),labelPosition:"top",options:a,value:n,onChange:l})}function zn(e){let{template:t,onClose:n}=e;const{title:l,description:a}=(0,c.useSelect)((e=>e(m.store).__experimentalGetTemplateInfo(t)),[]),{revertTemplate:r}=(0,c.useDispatch)(Ut),i=Ae({postType:t.type,postId:void 0}),s="wp_template_part"===t.type,u=(s||t.is_custom)&&!t.has_theme_file;if(!t)return null;return(0,o.createElement)("div",{className:"edit-site-template-details"},(0,o.createElement)(_.__experimentalVStack,{className:"edit-site-template-details__group",spacing:3},u?(0,o.createElement)(Pn,{template:t}):(0,o.createElement)(_.__experimentalText,{size:16,weight:600,className:"edit-site-template-details__title",as:"p"},l),a&&(0,o.createElement)(_.__experimentalText,{size:"body",className:"edit-site-template-details__description",as:"p"},a)),s&&(0,o.createElement)("div",{className:"edit-site-template-details__group"},(0,o.createElement)(Vn,{id:t.id})),(0,o.createElement)(Mn,{closeTemplateDetailsDropdown:n}),Je(t)&&(0,o.createElement)(_.MenuGroup,{className:"edit-site-template-details__group edit-site-template-details__revert"},(0,o.createElement)(_.MenuItem,{className:"edit-site-template-details__revert-button",info:(0,h.__)("Use the template as supplied by the theme."),onClick:()=>{r(t),n()}},(0,h.__)("Clear customizations"))),(0,o.createElement)(_.Button,d({className:"edit-site-template-details__show-all-button"},i),"wp_template"===(null==t?void 0:t.type)?(0,h.__)("Browse all templates"):(0,h.__)("Browse all template parts")))}const An=e=>{e.preventDefault()};function Bn(e){var t;let{openEntitiesSavedStates:n,isEntitiesSavedStatesOpen:l,showIconLabels:a}=e;const r=(0,o.useRef)(),{deviceType:i,entityTitle:s,template:d,templateType:p,isInserterOpen:f,isListViewOpen:E,listViewShortcut:v,isLoaded:y,isVisualMode:b,settings:w,blockEditorMode:x}=(0,c.useSelect)((e=>{const{__experimentalGetPreviewDeviceType:t,getEditedPostType:n,getEditedPostId:l,isInserterOpened:a,isListViewOpened:r,getEditorMode:o,getSettings:i}=e(Ut),{getEditedEntityRecord:s}=e(u.store),{__experimentalGetTemplateInfo:c}=e(m.store),{getShortcutRepresentation:d}=e(Wt.store),{__unstableGetEditorMode:p}=e(_e.store),g=n(),_=l(),h=s("postType",g,_),f=!!_;return{deviceType:t(),entityTitle:c(h).title,isLoaded:f,template:h,templateType:g,isInserterOpen:a(),isListViewOpen:r(),listViewShortcut:d("core/edit-site/toggle-list-view"),isVisualMode:"visual"===o(),settings:i(),blockEditorMode:p()}}),[]),{__experimentalSetPreviewDeviceType:S,setIsInserterOpened:k,setIsListViewOpened:C}=(0,c.useDispatch)(Ut),{__unstableSetEditorMode:T}=(0,c.useDispatch)(_e.store),N=(0,J.useViewportMatch)("medium"),I=(0,o.useCallback)((()=>{f?r.current.focus():k(!0)}),[f,k]),M=(0,o.useCallback)((()=>C(!E)),[C,E]),P="wp_template_part"===p,V=(0,h._x)("Toggle block inserter","Generic label for block inserter button"),z=f?(0,h.__)("Close"):(0,h.__)("Add"),A=(null===(t=window)||void 0===t?void 0:t.__experimentalEnableZoomedOutView)&&b,B="zoom-out"===x;return(0,o.createElement)("div",{className:"edit-site-header"},(0,o.createElement)(_e.NavigableToolbar,{className:"edit-site-header_start","aria-label":(0,h.__)("Document tools")},(0,o.createElement)("div",{className:"edit-site-header__toolbar"},(0,o.createElement)(_.ToolbarItem,{ref:r,as:_.Button,className:"edit-site-header-toolbar__inserter-toggle",variant:"primary",isPressed:f,onMouseDown:An,onClick:I,disabled:!b,icon:jt,label:a?z:V,showTooltip:!a}),N&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.ToolbarItem,{as:_e.ToolSelector,showTooltip:!a,variant:a?"tertiary":void 0,disabled:!b}),(0,o.createElement)(_.ToolbarItem,{as:xn,showTooltip:!a,variant:a?"tertiary":void 0}),(0,o.createElement)(_.ToolbarItem,{as:Sn,showTooltip:!a,variant:a?"tertiary":void 0}),(0,o.createElement)(_.ToolbarItem,{as:_.Button,className:"edit-site-header-toolbar__list-view-toggle",disabled:!b&&B,icon:Yt,isPressed:E,label:(0,h.__)("List View"),onClick:M,shortcut:v,showTooltip:!a,variant:a?"tertiary":void 0}),A&&(0,o.createElement)(_.ToolbarItem,{as:_.Button,className:"edit-site-header-toolbar__zoom-out-view-toggle",icon:qt,isPressed:B,label:(0,h.__)("Zoom-out View"),onClick:()=>{S("desktop"),C(!1),T(B?"edit":"zoom-out")}})))),(0,o.createElement)("div",{className:"edit-site-header_center"},(0,o.createElement)(Tn,{entityTitle:s,entityLabel:"wp_template_part"===p?"template part":"template",isLoaded:y,showIconLabels:a},(e=>{let{onClose:t}=e;return(0,o.createElement)(zn,{template:d,onClose:t})}))),(0,o.createElement)("div",{className:"edit-site-header_end"},(0,o.createElement)("div",{className:"edit-site-header__actions"},!P&&(0,o.createElement)("div",{className:g()("edit-site-header__actions__preview-options",{"is-zoomed-out":B})},(0,o.createElement)(_e.__experimentalPreviewOptions,{deviceType:i,setDeviceType:S},(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,{href:null==w?void 0:w.siteUrl,target:"_blank",icon:Xt},(0,h.__)("View site"),(0,o.createElement)(_.VisuallyHidden,{as:"span"},(0,h.__)("(opens in a new tab)")))))),(0,o.createElement)(yn,{openEntitiesSavedStates:n,isEntitiesSavedStatesOpen:l}),(0,o.createElement)(X.Slot,{scope:"core/edit-site"}),(0,o.createElement)(vn,{showIconLabels:a}))))}var Rn=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"}));function Ln(e){let{className:t,identifier:n,title:l,icon:a,children:r,closeLabel:i,header:s,headerClassName:u,panelClassName:m}=e;const d=(0,c.useSelect)((e=>e(Ut).getSettings().showIconLabels),[]);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Q,{className:t,scope:"core/edit-site",identifier:n,title:l,icon:a,closeLabel:i,header:s,headerClassName:u,panelClassName:m,showIconLabels:d},r),(0,o.createElement)(Y,{scope:"core/edit-site",identifier:n,icon:a},l))}var On=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"}));function Dn(e){let{className:t,...n}=e;return(0,o.createElement)(_.Icon,d({className:g()(t,"edit-site-global-styles-icon-with-current-color")},n))}function Gn(e){let{icon:t,children:n,...l}=e;return(0,o.createElement)(_.__experimentalItem,l,t&&(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(Dn,{icon:t,size:24}),(0,o.createElement)(_.FlexItem,null,n)),!t&&n)}function Fn(e){return(0,o.createElement)(_.__experimentalNavigatorButton,d({as:Gn},e))}var Hn=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M6.9 7L3 17.8h1.7l1-2.8h4.1l1 2.8h1.7L8.6 7H6.9zm-.7 6.6l1.5-4.3 1.5 4.3h-3zM21.6 17c-.1.1-.2.2-.3.2-.1.1-.2.1-.4.1s-.3-.1-.4-.2c-.1-.1-.1-.3-.1-.6V12c0-.5 0-1-.1-1.4-.1-.4-.3-.7-.5-1-.2-.2-.5-.4-.9-.5-.4 0-.8-.1-1.3-.1s-1 .1-1.4.2c-.4.1-.7.3-1 .4-.2.2-.4.3-.6.5-.1.2-.2.4-.2.7 0 .3.1.5.2.8.2.2.4.3.8.3.3 0 .6-.1.8-.3.2-.2.3-.4.3-.7 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.6-.4.2-.2.4-.3.7-.4.3-.1.6-.1.8-.1.3 0 .6 0 .8.1.2.1.4.3.5.5.1.2.2.5.2.9v1.1c0 .3-.1.5-.3.6-.2.2-.5.3-.9.4-.3.1-.7.3-1.1.4-.4.1-.8.3-1.1.5-.3.2-.6.4-.8.7-.2.3-.3.7-.3 1.2 0 .6.2 1.1.5 1.4.3.4.9.5 1.6.5.5 0 1-.1 1.4-.3.4-.2.8-.6 1.1-1.1 0 .4.1.7.3 1 .2.3.6.4 1.2.4.4 0 .7-.1.9-.2.2-.1.5-.3.7-.4h-.3zm-3-.9c-.2.4-.5.7-.8.8-.3.2-.6.2-.8.2-.4 0-.6-.1-.9-.3-.2-.2-.3-.6-.3-1.1 0-.5.1-.9.3-1.2s.5-.5.8-.7c.3-.2.7-.3 1-.5.3-.1.6-.3.7-.6v3.4z"}));var $n=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"}));var Un=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.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"}));function Wn(e,t){const{size:n}=e;if(!0!==(null==t?void 0:t.fluid))return n;if(!1===(null==e?void 0:e.fluid))return n;const l=(null==e?void 0:e.fluid)||{};let a=null==l?void 0:l.min,r=null==l?void 0:l.max;const o=jn(n);if(null==o||!o.unit)return n;a||(a=.75*o.value+o.unit),r||(r=1.5*o.value+o.unit);const i=function(e){let{maximumViewPortWidth:t,minimumViewPortWidth:n,maximumFontSize:l,minimumFontSize:a,scaleFactor:r}=e;const o=jn(a),i=(null==o?void 0:o.unit)||"rem",s=jn(l,{coerceTo:i});if(!o||!s)return null;const c=jn(a,{coerceTo:"rem"}),u=jn(t,{coerceTo:i}),m=jn(n,{coerceTo:i});if(!u||!m||!c)return null;const d=Yn(m.value/100,3)+i;let p=(s.value-o.value)/(u.value-m.value)*100;p=Yn(p,3)||1;const g=p*r,_=`${c.value}${c.unit} + ((1vw - ${d}) * ${g})`;return`clamp(${a}, ${_}, ${l})`}({maximumViewPortWidth:"1600px",minimumViewPortWidth:"768px",maximumFontSize:r,minimumFontSize:a,scaleFactor:1});return i||n}function jn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return null;const{coerceTo:n,rootSizeValue:l,acceptableUnits:a}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},r=null==a?void 0:a.join("|"),o=new RegExp(`^(\\d*\\.?\\d+)(${r}){1,1}$`),i=e.match(o);if(!i||i.length<3)return null;let[,s,c]=i,u=parseFloat(s);return"px"!==n||"em"!==c&&"rem"!==c||(u*=l,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=l,c=n),{value:u,unit:c}}function Yn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Number.isFinite(e)?parseFloat(e.toFixed(t)):void 0}const qn="body",Xn=[{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"],cssVarInfix:"duotone",valueFunc:e=>{let{slug:t}=e;return`url( '#wp-duotone-${t}' )`},classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>{let{typography:n}=t;return Wn(e,n)},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:e=>{let{size:t}=e;return t},classes:[]}],Kn={"color.background":"color","color.text":"color","elements.link.color.text":"color","elements.button.color.text":"color","elements.button.backgroundColor":"background-color","elements.heading.color":"color","elements.heading.backgroundColor":"background-color","elements.heading.gradient":"gradient","color.gradient":"gradient","typography.fontSize":"font-size","typography.fontFamily":"font-family"};function Zn(e,t,n,l,a){const r=[(0,Et.get)(e,["blocks",t,...n]),(0,Et.get)(e,n)];for(const o of r)if(o){const r=["custom","theme","default"];for(const i of r){const r=o[i];if(r){const o=(0,Et.find)(r,(e=>e[l]===a));if(o){if("slug"===l)return o;return Zn(e,t,n,"slug",o.slug)[l]===o[l]?o:void 0}}}}}function Qn(e,t,n,l){if(!l)return l;const a=Kn[n],r=(0,Et.find)(Xn,["cssVarInfix",a]);if(!r)return l;const{valueKey:o,path:i}=r,s=Zn(e,t,i,o,l);return s?`var:preset|${a}|${s.slug}`:l}function Jn(e,t,n){if(!n||"string"!=typeof n){var l,a;if(null===(l=n)||void 0===l||!l.ref||"string"!=typeof(null===(a=n)||void 0===a?void 0:a.ref))return n;{var r;const t=n.ref.split(".");if(!(n=(0,Et.get)(e,t))||null!==(r=n)&&void 0!==r&&r.ref)return n}}const o="var:",i="var(--wp--";let s;if(n.startsWith(o))s=n.slice(o.length).split("|");else{if(!n.startsWith(i)||!n.endsWith(")"))return n;s=n.slice(i.length,-")".length).split("--")}const[c,...u]=s;return"preset"===c?function(e,t,n,l){let[a,r]=l;const o=(0,Et.find)(Xn,["cssVarInfix",a]);if(!o)return n;const i=Zn(e.settings,t,o.path,"slug",r);if(i){const{valueKey:n}=o;return Jn(e,t,i[n])}return n}(e,t,n,u):"custom"===c?function(e,t,n,l){var a;const r=null!==(a=(0,Et.get)(e.settings,["blocks",t,"custom",...l]))&&void 0!==a?a:(0,Et.get)(e.settings,["custom",...l]);return r?Jn(e,t,r):n}(e,t,n,u):n}const el=(0,o.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),tl={settings:{},styles:{}};function nl(e,t){var n;let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:a,base:r,user:s,setUserConfig:c}=(0,o.useContext)(el),u=t?`settings.blocks.${t}.${e}`:`settings.${e}`,m=t=>{c((n=>{const l=JSON.parse(JSON.stringify(n)),a=i.__EXPERIMENTAL_PATHS_WITH_MERGE[e]?u+".custom":u;return(0,Et.set)(l,a,t),l}))},d=t=>{const n=t?`settings.blocks.${t}.${e}`:`settings.${e}`,o=t=>{const l=(0,Et.get)(t,n);var a,r;return i.__EXPERIMENTAL_PATHS_WITH_MERGE[e]?null!==(a=null!==(r=null==l?void 0:l.custom)&&void 0!==r?r:null==l?void 0:l.theme)&&void 0!==a?a:null==l?void 0:l.default:l};let c;switch(l){case"all":c=o(a);break;case"user":c=o(s);break;case"base":c=o(r);break;default:throw"Unsupported source"}return c},p=null!==(n=d(t))&&void 0!==n?n:d();return[p,m]}function ll(e,t){var n;let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:a,base:r,user:i,setUserConfig:s}=(0,o.useContext)(el),c=t?`styles.blocks.${t}.${e}`:`styles.${e}`,u=n=>{s((l=>{const r=JSON.parse(JSON.stringify(l));return(0,Et.set)(r,c,Qn(a.settings,t,e,n)),r}))};let m;switch(l){case"all":m=Jn(a,t,null!==(n=(0,Et.get)(i,c))&&void 0!==n?n:(0,Et.get)(r,c));break;case"user":m=Jn(a,t,(0,Et.get)(i,c));break;case"base":m=Jn(r,t,(0,Et.get)(r,c));break;default:throw"Unsupported source"}return[m,u]}const al=["background","backgroundColor","color","linkColor","buttonColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","textDecoration","padding","contentSize","wideSize","blockGap"];function rl(e){var t,n,l,a,r,o,s,c;if(!e)return al;const u=(0,i.getBlockType)(e);if(!u)return[];const m=[];return null==u||null===(t=u.supports)||void 0===t||null===(n=t.spacing)||void 0===n||!n.blockGap||!0===(null==u||null===(l=u.supports)||void 0===l||null===(a=l.spacing)||void 0===a?void 0:a.__experimentalSkipSerialization)||null!=u&&null!==(r=u.supports)&&void 0!==r&&null!==(o=r.spacing)&&void 0!==o&&null!==(s=o.__experimentalSkipSerialization)&&void 0!==s&&null!==(c=s.some)&&void 0!==c&&c.call(s,(e=>"blockGap"===e))||m.push("blockGap"),Object.keys(i.__EXPERIMENTAL_STYLE_PROPERTY).forEach((e=>{if(i.__EXPERIMENTAL_STYLE_PROPERTY[e].support)return i.__EXPERIMENTAL_STYLE_PROPERTY[e].requiresOptOut&&i.__EXPERIMENTAL_STYLE_PROPERTY[e].support[0]in u.supports&&!1!==(0,Et.get)(u.supports,i.__EXPERIMENTAL_STYLE_PROPERTY[e].support)||(0,Et.get)(u.supports,i.__EXPERIMENTAL_STYLE_PROPERTY[e].support,!1)?m.push(e):void 0})),m}function ol(e){const[t]=nl("color.palette.custom",e),[n]=nl("color.palette.theme",e),[l]=nl("color.palette.default",e),[a]=nl("color.defaultPalette");return(0,o.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),colors:n}),a&&l&&l.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),colors:l}),t&&t.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,l])}function il(e){const[t]=nl("color.gradients.custom",e),[n]=nl("color.gradients.theme",e),[l]=nl("color.gradients.default",e),[a]=nl("color.defaultGradients");return(0,o.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),a&&l&&l.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),gradients:l}),t&&t.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,l])}function sl(e){return[cl(e),ul(e),ml(e),dl(e)].some(Boolean)}function cl(e){const t=rl(e);return nl("border.color",e)[0]&&t.includes("borderColor")}function ul(e){const t=rl(e);return nl("border.radius",e)[0]&&t.includes("borderRadius")}function ml(e){const t=rl(e);return nl("border.style",e)[0]&&t.includes("borderStyle")}function dl(e){const t=rl(e);return nl("border.width",e)[0]&&t.includes("borderWidth")}function pl(e){return e?e.style||!e.color&&!e.width?e:{...e,style:"solid"}:e}function gl(e){let{name:t}=e;const[n]=ll("border",t,"user"),[l,a]=ll("border",t),r=ol(t),i=cl(t),s=ml(t),c=dl(t),u=ul(t),[m,d]=ll("border.radius",t),p=()=>{const e=null==n?void 0:n.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},g=(0,o.useCallback)((()=>a(void 0)),[a]),f=(0,o.useCallback)((e=>{const t=function(e){return e?(0,_.__experimentalHasSplitBorders)(e)?{top:pl(e.top),right:pl(e.right),bottom:pl(e.bottom),left:pl(e.left)}:pl(e):e}(e),n=(0,_.__experimentalHasSplitBorders)(t)?{color:null,style:null,width:null,...t}:{top:t,right:t,bottom:t,left:t};a({radius:null==l?void 0:l.radius,...n})}),[a]);return(0,o.createElement)(_.__experimentalToolsPanel,{label:(0,h.__)("Border"),resetAll:g},(c||i)&&(0,o.createElement)(_.__experimentalToolsPanelItem,{hasValue:()=>(0,_.__experimentalIsDefinedBorder)(n),label:(0,h.__)("Border"),onDeselect:()=>(()=>{if(p())return a({radius:n.radius});a(void 0)})(),isShownByDefault:!0},(0,o.createElement)(_.__experimentalBorderBoxControl,{colors:r,enableAlpha:!0,enableStyle:s,onChange:f,popoverOffset:40,popoverPlacement:"left-start",value:l,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})),u&&(0,o.createElement)(_.__experimentalToolsPanelItem,{hasValue:p,label:(0,h.__)("Radius"),onDeselect:()=>d(void 0),isShownByDefault:!0},(0,o.createElement)(_e.__experimentalBorderRadiusControl,{values:m,onChange:e=>{d(e||void 0)}})))}function _l(e){const t=rl(e);return t.includes("color")||t.includes("backgroundColor")||t.includes("background")||t.includes("linkColor")}var hl=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));var fl=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"}));const El=["horizontal","vertical"];function vl(e){const t=yl(e),n=bl(e),l=wl(e),a=xl(e),r=Sl(e);return t||n||l||a||r}function yl(e){const t=rl(e),[n]=nl("layout.contentSize",e);return n&&t.includes("contentSize")}function bl(e){const t=rl(e),[n]=nl("layout.wideSize",e);return n&&t.includes("wideSize")}function wl(e){const t=rl(e),[n]=nl("spacing.padding",e);return n&&t.includes("padding")}function xl(e){const t=rl(e),[n]=nl("spacing.margin",e);return n&&t.includes("margin")}function Sl(e){const t=rl(e),[n]=nl("spacing.blockGap",e);return n&&t.includes("blockGap")}function kl(e,t){if(!t)return e;const n={};return t.forEach((t=>{"vertical"===t&&(n.top=e.top,n.bottom=e.bottom),"horizontal"===t&&(n.left=e.left,n.right=e.right),n[t]=e[t]})),n}function Cl(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function Tl(e){let{name:t}=e;const n=yl(t),l=bl(t),a=wl(t),r=xl(t),i=Sl(t),s=function(){const[e]=nl("spacing.spacingSizes");return e&&e.length>0}(),c=(0,_.__experimentalUseCustomUnits)({availableUnits:nl("spacing.units",t)[0]||["%","px","em","rem","vw"]}),{contentSizeValue:u,setContentSizeValue:m,hasUserSetContentSizeValue:d,resetContentSizeValue:p}=function(e){const[t,n]=nl("layout.contentSize",e),[l]=nl("layout.contentSize",e,"user");return{contentSizeValue:t,setContentSizeValue:n,hasUserSetContentSizeValue:()=>!!l,resetContentSizeValue:()=>n("")}}(t),{wideSizeValue:f,setWideSizeValue:E,hasUserSetWideSizeValue:v,resetWideSizeValue:y}=function(e){const[t,n]=nl("layout.wideSize",e),[l]=nl("layout.wideSize",e,"user");return{wideSizeValue:t,setWideSizeValue:n,hasUserSetWideSizeValue:()=>!!l,resetWideSizeValue:()=>n("")}}(t),{paddingValues:b,paddingSides:w,isAxialPadding:x,setPaddingValues:S,resetPaddingValue:k,hasPaddingValue:C}=function(e){const[t,n]=ll("spacing.padding",e),l=Cl(t),a=(0,_e.__experimentalUseCustomSides)(e,"padding"),r=a&&a.some((e=>El.includes(e))),o=e=>{const t=kl(e,a);n(t)},[i]=ll("spacing.padding",e,"user");return{paddingValues:l,paddingSides:a,isAxialPadding:r,setPaddingValues:o,resetPaddingValue:()=>o({}),hasPaddingValue:()=>!!i}}(t),{marginValues:T,marginSides:N,isAxialMargin:I,setMarginValues:M,resetMarginValue:P,hasMarginValue:V}=function(e){const[t,n]=ll("spacing.margin",e),l=Cl(t),a=(0,_e.__experimentalUseCustomSides)(e,"margin"),r=a&&a.some((e=>El.includes(e))),o=e=>{const t=kl(e,a);n(t)};return{marginValues:l,marginSides:a,isAxialMargin:r,setMarginValues:o,resetMarginValue:()=>o({}),hasMarginValue:()=>!!l&&Object.keys(l).length}}(t),{gapValue:z,gapValues:A,gapSides:B,isAxialGap:R,setGapValue:L,setGapValues:O,resetGapValue:D,hasGapValue:G}=function(e){const[t,n]=ll("spacing.blockGap",e),l=(a=t)&&"string"==typeof a?{top:a}:a?{...a,right:null==a?void 0:a.left,bottom:null==a?void 0:a.top}:a;var a;const r=(0,_e.__experimentalUseCustomSides)(e,"blockGap"),o=r&&r.some((e=>El.includes(e))),[i]=ll("spacing.blockGap",e,"user");return{gapValue:t,gapValues:l,gapSides:r,isAxialGap:o,setGapValue:n,setGapValues:e=>{e||n(null),!o&&null!=e&&e.hasOwnProperty("top")?n(e.top):n({top:null==e?void 0:e.top,left:null==e?void 0:e.left})},resetGapValue:()=>n(void 0),hasGapValue:()=>!!i}}(t);return(0,o.createElement)(_.__experimentalToolsPanel,{label:(0,h.__)("Dimensions"),resetAll:()=>{k(),P(),D(),p(),y()}},(n||l)&&(0,o.createElement)("span",{className:"span-columns"},(0,h.__)("Set the width of the main content area.")),n&&(0,o.createElement)(_.__experimentalToolsPanelItem,{className:"single-column",label:(0,h.__)("Content size"),hasValue:d,onDeselect:p,isShownByDefault:!0},(0,o.createElement)(_.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,o.createElement)(_.__experimentalUnitControl,{label:(0,h.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:u||"",onChange:e=>{m(e)},units:c}),(0,o.createElement)(_.__experimentalView,null,(0,o.createElement)(ae,{icon:hl})))),l&&(0,o.createElement)(_.__experimentalToolsPanelItem,{className:"single-column",label:(0,h.__)("Wide size"),hasValue:v,onDeselect:y,isShownByDefault:!0},(0,o.createElement)(_.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,o.createElement)(_.__experimentalUnitControl,{label:(0,h.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:f||"",onChange:e=>{E(e)},units:c}),(0,o.createElement)(_.__experimentalView,null,(0,o.createElement)(ae,{icon:fl})))),a&&(0,o.createElement)(_.__experimentalToolsPanelItem,{hasValue:C,label:(0,h.__)("Padding"),onDeselect:k,isShownByDefault:!0,className:g()({"tools-panel-item-spacing":s})},!s&&(0,o.createElement)(_.__experimentalBoxControl,{values:b,onChange:S,label:(0,h.__)("Padding"),sides:w,units:c,allowReset:!1,splitOnAxis:x}),s&&(0,o.createElement)(_e.__experimentalSpacingSizesControl,{values:b,onChange:S,label:(0,h.__)("Padding"),sides:w,units:c,allowReset:!1,splitOnAxis:x})),r&&(0,o.createElement)(_.__experimentalToolsPanelItem,{hasValue:V,label:(0,h.__)("Margin"),onDeselect:P,isShownByDefault:!0,className:g()({"tools-panel-item-spacing":s})},!s&&(0,o.createElement)(_.__experimentalBoxControl,{values:T,onChange:M,label:(0,h.__)("Margin"),sides:N,units:c,allowReset:!1,splitOnAxis:I}),s&&(0,o.createElement)(_e.__experimentalSpacingSizesControl,{values:T,onChange:M,label:(0,h.__)("Margin"),sides:N,units:c,allowReset:!1,splitOnAxis:I})),i&&(0,o.createElement)(_.__experimentalToolsPanelItem,{hasValue:G,label:(0,h.__)("Block spacing"),onDeselect:D,isShownByDefault:!0,className:g()({"tools-panel-item-spacing":s})},!s&&(R?(0,o.createElement)(_.__experimentalBoxControl,{label:(0,h.__)("Block spacing"),min:0,onChange:O,units:c,sides:B,values:A,allowReset:!1,splitOnAxis:R}):(0,o.createElement)(_.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:L,units:c,value:z})),s&&(0,o.createElement)(_e.__experimentalSpacingSizesControl,{label:(0,h.__)("Block spacing"),min:0,onChange:O,sides:R?B:["top"],values:A,allowReset:!1,splitOnAxis:R})))}function Nl(e){const t=Il(e),n=Ml(e),l=Pl(e),a=rl(e);return t||n||l||a.includes("fontSize")}function Il(e){const t=rl(e);return nl("typography.lineHeight",e)[0]&&t.includes("lineHeight")}function Ml(e){const t=rl(e),n=nl("typography.fontStyle",e)[0]&&t.includes("fontStyle"),l=nl("typography.fontWeight",e)[0]&&t.includes("fontWeight");return n||l}function Pl(e,t){if(!nl("typography.letterSpacing",e)[0])return!1;if(!e&&"heading"===t)return!0;return rl(e).includes("letterSpacing")}function Vl(e){let{name:t,element:n}=e;const[l,a]=(0,o.useState)("heading"),r=rl(t);let i="";"heading"===n?i=`elements.${l}.`:n&&"text"!==n&&(i=`elements.${n}.`);const[s]=nl("typography.fontSizes",t),c=!nl("typography.customFontSize",t)[0],[u]=nl("typography.fontFamilies",t),m=nl("typography.fontStyle",t)[0]&&r.includes("fontStyle"),d=nl("typography.fontWeight",t)[0]&&r.includes("fontWeight"),p=Il(t),g=Ml(t),f=Pl(t,n),E=function(e,t){return!!nl("typography.textTransform",e)[0]&&(!e&&"heading"===t||rl(e).includes("textTransform"))}(t,n);let v=r.includes("fontSize");"heading"===n&&"heading"===l&&(v=!1);const[y,b]=ll(i+"typography.fontFamily",t),[w,x]=ll(i+"typography.fontSize",t),[S,k]=ll(i+"typography.fontStyle",t),[C,T]=ll(i+"typography.fontWeight",t),[N,I]=ll(i+"typography.lineHeight",t),[M,P]=ll(i+"typography.letterSpacing",t),[V,z]=ll(i+"typography.textTransform",t),[A]=ll(i+"color.background",t),[B]=ll(i+"color.gradient",t),[R]=ll(i+"color.text",t),L="link"===n?{textDecoration:"underline"}:{};return(0,o.createElement)(_.PanelBody,{className:"edit-site-typography-panel",initialOpen:!0},(0,o.createElement)("div",{className:"edit-site-typography-panel__preview",style:{fontFamily:null!=y?y:"serif",background:null!=B?B:A,color:R,fontSize:w,fontStyle:S,fontWeight:C,letterSpacing:M,...L}},"Aa"),(0,o.createElement)(_.__experimentalGrid,{columns:2,rowGap:16,columnGap:8},"heading"===n&&(0,o.createElement)("div",{className:"edit-site-typography-panel__full-width-control"},(0,o.createElement)(_.__experimentalToggleGroupControl,{label:(0,h.__)("Select heading level"),hideLabelFromVision:!0,value:l,onChange:a,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0},(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"heading",label:(0,h.__)("All")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h1",label:(0,h.__)("H1")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h2",label:(0,h.__)("H2")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h3",label:(0,h.__)("H3")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h4",label:(0,h.__)("H4")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h5",label:(0,h.__)("H5")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h6",label:(0,h.__)("H6")}))),r.includes("fontFamily")&&(0,o.createElement)("div",{className:"edit-site-typography-panel__full-width-control"},(0,o.createElement)(_e.__experimentalFontFamilyControl,{fontFamilies:u,value:y,onChange:b,size:"__unstable-large",__nextHasNoMarginBottom:!0})),v&&(0,o.createElement)("div",{className:"edit-site-typography-panel__full-width-control"},(0,o.createElement)(_.FontSizePicker,{value:w,onChange:x,fontSizes:s,disableCustomFontSizes:c,size:"__unstable-large",__nextHasNoMarginBottom:!0})),g&&(0,o.createElement)(_e.__experimentalFontAppearanceControl,{value:{fontStyle:S,fontWeight:C},onChange:e=>{let{fontStyle:t,fontWeight:n}=e;k(t),T(n)},hasFontStyles:m,hasFontWeights:d,size:"__unstable-large",__nextHasNoMarginBottom:!0}),p&&(0,o.createElement)(_e.LineHeightControl,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:N,onChange:I,size:"__unstable-large"}),f&&(0,o.createElement)(_e.__experimentalLetterSpacingControl,{value:M,onChange:P,size:"__unstable-large",__unstableInputWidth:"auto"}),E&&(0,o.createElement)("div",{className:"edit-site-typography-panel__full-width-control"},(0,o.createElement)(_e.__experimentalTextTransformControl,{value:V,onChange:z,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0}))))}var zl=function(e){let{name:t,parentMenu:n=""}=e;const l=Nl(t),a=_l(t),r=sl(t),i=vl(t),s=r||i;return(0,o.createElement)(_.__experimentalItemGroup,null,l&&(0,o.createElement)(Fn,{icon:Hn,path:n+"/typography","aria-label":(0,h.__)("Typography styles")},(0,h.__)("Typography")),a&&(0,o.createElement)(Fn,{icon:$n,path:n+"/colors","aria-label":(0,h.__)("Colors styles")},(0,h.__)("Colors")),s&&(0,o.createElement)(Fn,{icon:Un,path:n+"/layout","aria-label":(0,h.__)("Layout styles")},(0,h.__)("Layout")))},Al=window.wp.styleEngine;const Bl={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"};function Rl(e){var t;const n="var:";if(null!=e&&null!==(t=e.startsWith)&&void 0!==t&&t.call(e,n)){return`var(--wp--${e.slice(n.length).split("|").join("--")})`}return e}function Ll(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,Et.reduce)(Xn,((n,l)=>{let{path:a,cssVarInfix:r,classes:o}=l;if(!o)return n;const i=(0,Et.get)(t,a,[]);return["default","theme","custom"].forEach((t=>{i[t]&&i[t].forEach((t=>{let{slug:l}=t;o.forEach((t=>{let{classSuffix:a,propertyName:o}=t;const i=`.has-${(0,Et.kebabCase)(l)}-${a}`,s=e.split(",").map((e=>`${e}${i}`)).join(","),c=`var(--wp--preset--${r}--${(0,Et.kebabCase)(l)})`;n+=`${s}{${o}: ${c} !important;}`}))}))})),n}),"")}function Ol(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,l=[];return Object.keys(e).forEach((a=>{const r=t+(0,Et.kebabCase)(a.replace("/","-")),o=e[a];if(o instanceof Object){const e=r+n;l=[...l,...Ol(o,e,n)]}else l.push(`${r}: ${o}`)})),l}function Dl(){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?arguments[2]:void 0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const a=qn===t,r=(0,Et.reduce)(i.__EXPERIMENTAL_STYLE_PROPERTY,((t,l,r)=>{let{value:o,properties:i,useEngine:s,rootOnly:c}=l;if(c&&!a)return t;const u=o;if("elements"===u[0]||s)return t;const m=(0,Et.get)(e,u);if("--wp--style--root--padding"===r&&("string"==typeof m||!n))return t;if(i&&"string"!=typeof m)Object.entries(i).forEach((e=>{const[n,l]=e;if(!(0,Et.get)(m,[l],!1))return;const a=n.startsWith("--")?n:(0,Et.kebabCase)(n);t.push(`${a}: ${Rl((0,Et.get)(m,[l]))}`)}));else if((0,Et.get)(e,u,!1)){const n=r.startsWith("--")?r:(0,Et.kebabCase)(r);t.push(`${n}: ${Rl((0,Et.get)(e,u))}`)}return t}),[]),o=(0,Al.getCSSRules)(e);return o.forEach((e=>{var t;if(a&&n&&e.key.startsWith("padding"))return;const o=e.key.startsWith("--")?e.key:(0,Et.kebabCase)(e.key);let i=e.value;if("string"!=typeof i&&null!==(t=i)&&void 0!==t&&t.ref){var s;const e=i.ref.split(".");if(i=(0,Et.get)(l,e),!i||null!==(s=i)&&void 0!==s&&s.ref)return}r.push(`${o}: ${i}`)})),r}function Gl(e){var t,n,l,a,r;let{tree:o,style:i,selector:s,hasBlockGapSupport:c,hasFallbackGapSupport:u,fallbackGapValue:m}=e,d="",p=c?(0,_e.__experimentalGetGapCSSValue)(null==i||null===(t=i.spacing)||void 0===t?void 0:t.blockGap):"";if(u&&(s===qn?p=p||"0.5em":!c&&m&&(p=m)),p&&null!=o&&null!==(n=o.settings)&&void 0!==n&&null!==(l=n.layout)&&void 0!==l&&l.definitions&&(Object.values(o.settings.layout.definitions).forEach((e=>{let{className:t,name:n,spacingStyles:l}=e;(c||"flex"===n)&&null!=l&&l.length&&l.forEach((e=>{const n=[];if(e.rules&&Object.entries(e.rules).forEach((e=>{let[t,l]=e;n.push(`${t}: ${l||p}`)})),n.length){let l="";l=c?s===qn?`${s} .${t}${(null==e?void 0:e.selector)||""}`:`${s}.${t}${(null==e?void 0:e.selector)||""}`:s===qn?`:where(.${t}${(null==e?void 0:e.selector)||""})`:`:where(${s}.${t}${(null==e?void 0:e.selector)||""})`,d+=`${l} { ${n.join("; ")}; }`}}))})),s===qn&&c&&(d+=`${s} { --wp--style--block-gap: ${p}; }`)),s===qn&&null!=o&&null!==(a=o.settings)&&void 0!==a&&null!==(r=a.layout)&&void 0!==r&&r.definitions){const e=["block","flex","grid"];Object.values(o.settings.layout.definitions).forEach((t=>{let{className:n,displayMode:l,baseStyles:a}=t;l&&e.includes(l)&&(d+=`${s} .${n} { display:${l}; }`),null!=a&&a.length&&a.forEach((e=>{const t=[];if(e.rules&&Object.entries(e.rules).forEach((e=>{let[n,l]=e;t.push(`${n}: ${l}`)})),t.length){const l=`${s} .${n}${(null==e?void 0:e.selector)||""}`;d+=`${l} { ${t.join("; ")}; }`}}))}))}return d}const Fl=(e,t)=>{var n,l;const a=[];if(null==e||!e.styles)return a;const r=e=>(0,Et.pickBy)(e,((e,t)=>["border","color","spacing","typography","filter"].includes(t))),o=r(e.styles);return o&&a.push({styles:o,selector:qn}),Object.entries(i.__EXPERIMENTAL_ELEMENTS).forEach((t=>{var n;let[l,r]=t;var o;null!==(n=e.styles)&&void 0!==n&&n.elements[l]&&a.push({styles:null===(o=e.styles)||void 0===o?void 0:o.elements[l],selector:r})})),Object.entries(null!==(n=null===(l=e.styles)||void 0===l?void 0:l.blocks)&&void 0!==n?n:{}).forEach((e=>{var n,l;let[o,s]=e;const c=r(s);c&&null!=t&&null!==(n=t[o])&&void 0!==n&&n.selector&&a.push({duotoneSelector:t[o].duotoneSelector,fallbackGapValue:t[o].fallbackGapValue,hasLayoutSupport:t[o].hasLayoutSupport,selector:t[o].selector,styles:c,featureSelectors:t[o].featureSelectors}),Object.entries(null!==(l=null==s?void 0:s.elements)&&void 0!==l?l:{}).forEach((e=>{let[n,l]=e;l&&null!=t&&t[o]&&null!==i.__EXPERIMENTAL_ELEMENTS&&void 0!==i.__EXPERIMENTAL_ELEMENTS&&i.__EXPERIMENTAL_ELEMENTS[n]&&a.push({styles:l,selector:t[o].selector.split(",").map((e=>i.__EXPERIMENTAL_ELEMENTS[n].split(",").map((t=>e+" "+t)))).join(",")})}))})),a},Hl=(e,t)=>{var n,l,a;const r=[];if(null==e||!e.settings)return r;const o=e=>{const t={};return Xn.forEach((n=>{let{path:l}=n;const a=(0,Et.get)(e,l,!1);!1!==a&&(0,Et.set)(t,l,a)})),t},i=o(e.settings),s=null===(n=e.settings)||void 0===n?void 0:n.custom;return(0,Et.isEmpty)(i)&&!s||r.push({presets:i,custom:s,selector:qn}),Object.entries(null!==(l=null===(a=e.settings)||void 0===a?void 0:a.blocks)&&void 0!==l?l:{}).forEach((e=>{let[n,l]=e;const a=o(l),i=l.custom;(0,Et.isEmpty)(a)&&!i||r.push({presets:a,custom:i,selector:t[n].selector})})),r},$l=(e,t)=>{const n=Hl(e,t);let l="";return n.forEach((t=>{let{presets:n,custom:a,selector:r}=t;const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return(0,Et.reduce)(Xn,((n,l)=>{let{path:a,valueKey:r,valueFunc:o,cssVarInfix:i}=l;const s=(0,Et.get)(e,a,[]);return["default","theme","custom"].forEach((e=>{s[e]&&s[e].forEach((e=>{r&&!o?n.push(`--wp--preset--${i}--${(0,Et.kebabCase)(e.slug)}: ${e[r]}`):o&&"function"==typeof o&&n.push(`--wp--preset--${i}--${(0,Et.kebabCase)(e.slug)}: ${o(e,t)}`)}))})),n}),[])}(n,null==e?void 0:e.settings),i=Ol(a,"--wp--custom--","--");i.length>0&&o.push(...i),o.length>0&&(l+=`${r}{${o.join(";")};}`)})),l};function Ul(e,t){return Hl(e,t).flatMap((e=>{let{presets:t}=e;return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Xn.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=(0,Et.get)(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>(0,o.createElement)(_e.__unstablePresetDuotoneFilter,{preset:e,key:e.slug})))))}))}(t)}))}function Wl(){const{merged:e}=(0,o.useContext)(el),[t]=nl("spacing.blockGap"),n=null!==t,l=!n,a=(0,c.useSelect)((e=>{const{getSettings:t}=e(_e.store);return!!t().disableLayoutStyles}));return(0,o.useMemo)((()=>{if(null==e||!e.styles||null==e||!e.settings)return[];const t=(e=>{const t={};return e.forEach((e=>{var n,l,a,r,o,i,s,c,u;const m=e.name,d=null!==(n=null==e||null===(l=e.supports)||void 0===l?void 0:l.__experimentalSelector)&&void 0!==n?n:".wp-block-"+m.replace("core/","").replace("/","-"),p=null!==(a=null==e||null===(r=e.supports)||void 0===r||null===(o=r.color)||void 0===o?void 0:o.__experimentalDuotone)&&void 0!==a?a:null,g=!(null==e||null===(i=e.supports)||void 0===i||!i.__experimentalLayout),_=null==e||null===(s=e.supports)||void 0===s||null===(c=s.spacing)||void 0===c||null===(u=c.blockGap)||void 0===u?void 0:u.__experimentalDefault,h={};Object.entries(Bl).forEach((t=>{var n,l;let[a,r]=t;const o=null==e||null===(n=e.supports)||void 0===n||null===(l=n[a])||void 0===l?void 0:l.__experimentalSelector;o&&(h[r]=function(e,t){const n=e.split(","),l=t.split(","),a=[];return n.forEach((e=>{l.forEach((t=>{a.push(`${e.trim()} ${t.trim()}`)}))})),a.join(", ")}(d,o))})),t[m]={duotoneSelector:p,fallbackGapValue:_,featureSelectors:Object.keys(h).length?h:void 0,hasLayoutSupport:g,name:m,selector:d}})),t})((0,i.getBlockTypes)()),r=$l(e,t),o=function(e,t,n,l){var a,r;let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const i=Fl(e,t),s=Hl(e,t),c=null==e||null===(a=e.settings)||void 0===a?void 0:a.useRootPaddingAwareAlignments,{contentSize:u,wideSize:m}=(null==e||null===(r=e.settings)||void 0===r?void 0:r.layout)||{};let d="body {margin: 0;";if(u&&(d+=` --wp--style--global--content-size: ${u};`),m&&(d+=` --wp--style--global--wide-size: ${m};`),c&&(d+='padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) } \n\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); } \n\t\t\t.has-global-padding :where(.has-global-padding) { padding-right: 0; padding-left: 0; } \n\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); } \n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull { margin-right: 0; margin-left: 0; } \n\t\t\t.has-global-padding > .alignfull:where(:not(.has-global-padding)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); } \n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;'),d+="}",i.forEach((t=>{let{selector:a,duotoneSelector:r,styles:i,fallbackGapValue:s,hasLayoutSupport:u,featureSelectors:m}=t;m&&Object.entries(m).forEach((e=>{let[t,n]=e;if(null!=i&&i[t]){const e=Dl({[t]:i[t]});delete i[t],e.length&&(d+=`${n}{${e.join(";")} }`)}}));const p={};if(null!=i&&i.filter&&(p.filter=i.filter,delete i.filter),r){const e=Dl(p);e.length>0&&(d+=`${r}{${e.join(";")};}`)}o||qn!==a&&!u||(d+=Gl({tree:e,style:i,selector:a,hasBlockGapSupport:n,hasFallbackGapSupport:l,fallbackGapValue:s}));const g=Dl(i,a,c,e);null!=g&&g.length&&(d+=`${a}{${g.join(";")};}`);const _=Object.entries(i).filter((e=>{let[t]=e;return t.startsWith(":")}));null!=_&&_.length&&_.forEach((e=>{let[t,n]=e;const l=Dl(n);if(null==l||!l.length)return;const r=`${a.split(",").map((e=>e+t)).join(",")}{${l.join(";")};}`;d+=r}))})),d+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",d+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",d+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }",n){var p,g;const t=(0,_e.__experimentalGetGapCSSValue)(null==e||null===(p=e.styles)||void 0===p||null===(g=p.spacing)||void 0===g?void 0:g.blockGap)||"0.5em";d+=".wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }",d+=`.wp-site-blocks > * + * { margin-block-start: ${t}; }`}return s.forEach((e=>{let{selector:t,presets:n}=e;qn===t&&(t="");const l=Ll(t,n);(0,Et.isEmpty)(l)||(d+=l)})),d}(e,t,n,l,a),s=Ul(e,t);return[[{css:r,isGlobalStyles:!0},{css:o,isGlobalStyles:!0}],e.settings,s]}),[n,l,e,a])}const jl={start:{opacity:1,display:"block"},hover:{opacity:0,display:"none"}},Yl={hover:{opacity:1,display:"block"},start:{opacity:0,display:"none"}};var ql=e=>{let{label:t,isFocused:n}=e;const[l]=ll("typography.fontWeight"),[a="serif"]=ll("typography.fontFamily"),[r=a]=ll("elements.h1.typography.fontFamily"),[i=l]=ll("elements.h1.typography.fontWeight"),[s="black"]=ll("color.text"),[c=s]=ll("elements.h1.color.text"),[u="blue"]=ll("elements.link.color.text"),[m="white"]=ll("color.background"),[d]=ll("color.gradient"),[p]=Wl(),g=(0,J.useReducedMotion)(),[h]=nl("color.palette.core"),[f]=nl("color.palette.theme"),[E]=nl("color.palette.custom"),[v,y]=(0,o.useState)(!1),[b,{width:w}]=(0,J.useResizeObserver)(),x=w?w/248:1,S=(null!=f?f:[]).concat(null!=E?E:[]).concat(null!=h?h:[]),k=S.filter((e=>{let{color:t}=e;return t!==m&&t!==c})).slice(0,2),C=(0,o.useMemo)((()=>p?[...p,{css:"body{min-width: 0;padding: 0;}",isGlobalStyles:!0}]:p),[p]);return(0,o.createElement)(_e.__unstableIframe,{className:"edit-site-global-styles-preview__iframe",head:(0,o.createElement)(_e.__unstableEditorStyles,{styles:C}),style:{height:152*x,visibility:w?"visible":"hidden"},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),tabIndex:-1},b,(0,o.createElement)(_.__unstableMotion.div,{style:{height:152*x,width:"100%",background:null!=d?d:m,cursor:"pointer"},initial:"start",animate:!v&&!n||g?"start":"hover"},(0,o.createElement)(_.__unstableMotion.div,{variants:jl,style:{height:"100%",overflow:"hidden"}},(0,o.createElement)(_.__experimentalHStack,{spacing:10*x,justify:"center",style:{height:"100%",overflow:"hidden"}},(0,o.createElement)("div",{style:{fontFamily:r,fontSize:65*x,color:c,fontWeight:i}},"Aa"),(0,o.createElement)(_.__experimentalVStack,{spacing:4*x},k.map((e=>{let{slug:t,color:n}=e;return(0,o.createElement)("div",{key:t,style:{height:32*x,width:32*x,background:n,borderRadius:32*x/2}})}))))),(0,o.createElement)(_.__unstableMotion.div,{variants:Yl,style:{height:"100%",overflow:"hidden"}},(0,o.createElement)(_.__experimentalVStack,{spacing:3*x,justify:"center",style:{height:"100%",overflow:"hidden",padding:10*x,boxSizing:"border-box"}},t&&(0,o.createElement)("div",{style:{fontSize:35*x,fontFamily:r,color:c,fontWeight:i,lineHeight:"1em"}},t),(0,o.createElement)(_.__experimentalHStack,{spacing:2*x,justify:"flex-start"},(0,o.createElement)("div",{style:{fontFamily:a,fontSize:24*x,color:s}},"Aa"),(0,o.createElement)("div",{style:{fontFamily:a,fontSize:24*x,color:u}},"Aa")),S&&(0,o.createElement)(_.__experimentalHStack,{spacing:0},S.slice(0,4).map(((e,t)=>{let{color:n}=e;return(0,o.createElement)("div",{key:t,style:{height:10*x,width:30*x,background:n,flexGrow:1}})})))))))};var Xl=function(){const{variations:e}=(0,c.useSelect)((e=>({variations:e(u.store).__experimentalGetCurrentThemeGlobalStylesVariations()})),[]);return(0,o.createElement)(_.Card,{size:"small"},(0,o.createElement)(_.CardBody,null,(0,o.createElement)(_.__experimentalVStack,{spacing:4},(0,o.createElement)(_.Card,null,(0,o.createElement)(_.CardMedia,null,(0,o.createElement)(ql,null))),!(null==e||!e.length)&&(0,o.createElement)(_.__experimentalItemGroup,null,(0,o.createElement)(Fn,{path:"/variations","aria-label":(0,h.__)("Browse styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"space-between"},(0,o.createElement)(_.FlexItem,null,(0,h.__)("Browse styles")),(0,o.createElement)(Dn,{icon:(0,h.isRTL)()?re:oe})))),(0,o.createElement)(zl,null))),(0,o.createElement)(_.CardDivider,null),(0,o.createElement)(_.CardBody,null,(0,o.createElement)(_.__experimentalSpacer,{as:"p",paddingTop:2,paddingX:"13px",marginBottom:4},(0,h.__)("Customize the appearance of specific blocks for the whole site.")),(0,o.createElement)(_.__experimentalItemGroup,null,(0,o.createElement)(Fn,{path:"/blocks","aria-label":(0,h.__)("Blocks styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"space-between"},(0,o.createElement)(_.FlexItem,null,(0,h.__)("Blocks")),(0,o.createElement)(Dn,{icon:(0,h.isRTL)()?re:oe}))))))};var Kl=function(e){let{title:t,description:n}=e;return(0,o.createElement)(_.__experimentalVStack,{spacing:0},(0,o.createElement)(_.__experimentalView,null,(0,o.createElement)(_.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3},(0,o.createElement)(_.__experimentalHStack,{spacing:2},(0,o.createElement)(_.__experimentalNavigatorBackButton,{style:{minWidth:24,padding:0},icon:(0,h.isRTL)()?oe:re,isSmall:!0,"aria-label":(0,h.__)("Navigate to the previous view")}),(0,o.createElement)(_.__experimentalSpacer,null,(0,o.createElement)(_.__experimentalHeading,{level:5},t))))),n&&(0,o.createElement)("p",{className:"edit-site-global-styles-header__description"},n))};function Zl(e){let{block:t}=e;const n=Nl(t.name),l=_l(t.name),a=sl(t.name),r=vl(t.name);if(!(n||l||(a||r)))return null;const i=(0,h.sprintf)((0,h.__)("%s block styles"),t.title);return(0,o.createElement)(Fn,{path:"/blocks/"+t.name,"aria-label":i},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(_e.BlockIcon,{icon:t.icon}),(0,o.createElement)(_.FlexItem,null,t.title)))}var Ql=function(){const e=function(){const e=(0,c.useSelect)((e=>e(i.store).getBlockTypes()),[]),{core:t,noncore:n}=e.reduce(((e,t)=>{const{core:n,noncore:l}=e;return(t.name.startsWith("core/")?n:l).push(t),e}),{core:[],noncore:[]});return[...t,...n]}(),[t,n]=(0,o.useState)(""),l=(0,J.useDebounce)(Qe.speak,500),a=(0,c.useSelect)((e=>e(i.store).isMatchingSearchTerm),[]),r=(0,o.useMemo)((()=>t?e.filter((e=>a(e,t))):e),[t,e,a]),s=(0,o.useRef)();return(0,o.useEffect)((()=>{if(!t)return;const e=s.current.childElementCount,n=(0,h.sprintf)((0,h._n)("%d result found.","%d results found.",e),e);l(n,e)}),[t,l]),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Kl,{title:(0,h.__)("Blocks"),description:(0,h.__)("Customize the appearance of specific blocks and for the whole site.")}),(0,o.createElement)(_.SearchControl,{className:"edit-site-block-types-search",onChange:n,value:t,label:(0,h.__)("Search for blocks"),placeholder:(0,h.__)("Search")}),(0,o.createElement)("div",{ref:s,className:"edit-site-block-types-item-list"},r.map((e=>(0,o.createElement)(Zl,{block:e,key:"menu-itemblock-"+e.name})))))};var Jl=function(e){let{name:t}=e;const n=(0,i.getBlockType)(t);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Kl,{title:n.title}),(0,o.createElement)(zl,{parentMenu:"/blocks/"+t,name:t}))};var ea=function(e){let{children:t}=e;return(0,o.createElement)(_.__experimentalHeading,{className:"edit-site-global-styles-subtitle",level:2},t)};function ta(e){let{name:t,parentMenu:n,element:l,label:a}=e;const r=!t,i="text"!==l&&l?`elements.${l}.`:"",s="link"===l?{textDecoration:"underline"}:{},[c]=ll(i+"typography.fontFamily",t),[u]=ll(i+"typography.fontStyle",t),[m]=ll(i+"typography.fontWeight",t),[d]=ll(i+"typography.letterSpacing",t),[p]=ll(i+"color.background",t),[g]=ll(i+"color.gradient",t),[f]=ll(i+"color.text",t);if(!r)return null;const E=(0,h.sprintf)((0,h.__)("Typography %s styles"),a);return(0,o.createElement)(Fn,{path:n+"/typography/"+l,"aria-label":E},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(_.FlexItem,{className:"edit-site-global-styles-screen-typography__indicator",style:{fontFamily:null!=c?c:"serif",background:null!=g?g:p,color:f,fontStyle:u,fontWeight:m,letterSpacing:d,...s}},(0,h.__)("Aa")),(0,o.createElement)(_.FlexItem,null,a)))}var na=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Kl,{title:(0,h.__)("Typography"),description:(0,h.__)("Manage the typography settings for different elements.")}),!t&&(0,o.createElement)("div",{className:"edit-site-global-styles-screen-typography"},(0,o.createElement)(_.__experimentalVStack,{spacing:3},(0,o.createElement)(ea,null,(0,h.__)("Elements")),(0,o.createElement)(_.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,o.createElement)(ta,{name:t,parentMenu:n,element:"text",label:(0,h.__)("Text")}),(0,o.createElement)(ta,{name:t,parentMenu:n,element:"link",label:(0,h.__)("Links")}),(0,o.createElement)(ta,{name:t,parentMenu:n,element:"heading",label:(0,h.__)("Headings")}),(0,o.createElement)(ta,{name:t,parentMenu:n,element:"button",label:(0,h.__)("Buttons")})))),!!t&&(0,o.createElement)(Vl,{name:t,element:"text"}))};const la={text:{description:(0,h.__)("Manage the fonts used on the site."),title:(0,h.__)("Text")},link:{description:(0,h.__)("Manage the fonts and typography used on the links."),title:(0,h.__)("Links")},heading:{description:(0,h.__)("Manage the fonts and typography used on headings."),title:(0,h.__)("Headings")},button:{description:(0,h.__)("Manage the fonts and typography used on buttons."),title:(0,h.__)("Buttons")}};var aa=function(e){let{name:t,element:n}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Kl,{title:la[n].title,description:la[n].description}),(0,o.createElement)(Vl,{name:t,element:n}))};var ra=function(e){let{className:t,...n}=e;return(0,o.createElement)(_.Flex,d({className:g()("edit-site-global-styles__color-indicator-wrapper",t)},n))};const oa=[];var ia=function(e){let{name:t}=e;const[n]=nl("color.palette.custom"),[l]=nl("color.palette.theme"),[a]=nl("color.palette.default"),[r]=nl("color.defaultPalette",t),i=(0,o.useMemo)((()=>[...n||oa,...l||oa,...a&&r?a:oa]),[n,l,a,r]),s=t?"/blocks/"+t+"/colors/palette":"/colors/palette",c=i.length>0?(0,h.sprintf)((0,h._n)("%d color","%d colors",i.length),i.length):(0,h.__)("Add custom colors");return(0,o.createElement)(_.__experimentalVStack,{spacing:3},(0,o.createElement)(ea,null,(0,h.__)("Palette")),(0,o.createElement)(_.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,o.createElement)(Fn,{path:s,"aria-label":(0,h.__)("Color palettes")},(0,o.createElement)(_.__experimentalHStack,{direction:0===i.length?"row-reverse":"row"},(0,o.createElement)(_.__experimentalZStack,{isLayered:!1,offset:-8},i.slice(0,5).map((e=>{let{color:t}=e;return(0,o.createElement)(ra,{key:t},(0,o.createElement)(_.ColorIndicator,{colorValue:t}))}))),(0,o.createElement)(_.FlexItem,null,c)))))};function sa(e){let{name:t,parentMenu:n}=e;const l=rl(t),a=l.includes("backgroundColor")||l.includes("background"),[r]=ll("color.background",t),[i]=ll("color.gradient",t);return a?(0,o.createElement)(Fn,{path:n+"/colors/background","aria-label":(0,h.__)("Colors background styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(ra,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:null!=i?i:r,"data-testid":"background-color-indicator"})),(0,o.createElement)(_.FlexItem,{className:"edit-site-global-styles__color-label"},(0,h.__)("Background")))):null}function ca(e){let{name:t,parentMenu:n}=e;const l=rl(t).includes("color"),[a]=ll("color.text",t);return l?(0,o.createElement)(Fn,{path:n+"/colors/text","aria-label":(0,h.__)("Colors text styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(ra,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:a,"data-testid":"text-color-indicator"})),(0,o.createElement)(_.FlexItem,{className:"edit-site-global-styles__color-label"},(0,h.__)("Text")))):null}function ua(e){let{name:t,parentMenu:n}=e;const l=rl(t).includes("linkColor"),[a]=ll("elements.link.color.text",t),[r]=ll("elements.link.:hover.color.text",t);return l?(0,o.createElement)(Fn,{path:n+"/colors/link","aria-label":(0,h.__)("Colors link styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(_.__experimentalZStack,{isLayered:!1,offset:-8},(0,o.createElement)(ra,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:a})),(0,o.createElement)(ra,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:r}))),(0,o.createElement)(_.FlexItem,{className:"edit-site-global-styles__color-label"},(0,h.__)("Links")))):null}function ma(e){let{name:t,parentMenu:n}=e;const l=rl(t).includes("color"),[a]=ll("elements.heading.color.text",t),[r]=ll("elements.heading.color.background",t);return l?(0,o.createElement)(Fn,{path:n+"/colors/heading","aria-label":(0,h.__)("Colors heading styles")},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(_.__experimentalZStack,{isLayered:!1,offset:-8},(0,o.createElement)(ra,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:r})),(0,o.createElement)(ra,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:a}))),(0,o.createElement)(_.FlexItem,null,(0,h.__)("Headings")))):null}function da(e){let{name:t,parentMenu:n}=e;const l=rl(t).includes("buttonColor"),[a]=ll("elements.button.color.text",t),[r]=ll("elements.button.color.background",t);return l?(0,o.createElement)(Fn,{path:n+"/colors/button"},(0,o.createElement)(_.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(_.__experimentalZStack,{isLayered:!1,offset:-8},(0,o.createElement)(ra,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:r})),(0,o.createElement)(ra,{expanded:!1},(0,o.createElement)(_.ColorIndicator,{colorValue:a}))),(0,o.createElement)(_.FlexItem,{className:"edit-site-global-styles__color-label"},(0,h.__)("Buttons")))):null}var pa=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Kl,{title:(0,h.__)("Colors"),description:(0,h.__)("Manage palettes and the default color of different global elements on the site.")}),(0,o.createElement)("div",{className:"edit-site-global-styles-screen-colors"},(0,o.createElement)(_.__experimentalVStack,{spacing:10},(0,o.createElement)(ia,{name:t}),(0,o.createElement)(_.__experimentalVStack,{spacing:3},(0,o.createElement)(ea,null,(0,h.__)("Elements")),(0,o.createElement)(_.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,o.createElement)(sa,{name:t,parentMenu:n}),(0,o.createElement)(ca,{name:t,parentMenu:n}),(0,o.createElement)(ua,{name:t,parentMenu:n}),(0,o.createElement)(ma,{name:t,parentMenu:n}),(0,o.createElement)(da,{name:t,parentMenu:n}))))))};function ga(e){let{name:t}=e;const[n,l]=nl("color.palette.theme",t),[a]=nl("color.palette.theme",t,"base"),[r,i]=nl("color.palette.default",t),[s]=nl("color.palette.default",t,"base"),[c,u]=nl("color.palette.custom",t),[m]=nl("color.defaultPalette",t);return(0,o.createElement)(_.__experimentalVStack,{className:"edit-site-global-styles-color-palette-panel",spacing:10},!!n&&!!n.length&&(0,o.createElement)(_.__experimentalPaletteEdit,{canReset:n!==a,canOnlyChangeValues:!0,colors:n,onChange:l,paletteLabel:(0,h.__)("Theme")}),!!r&&!!r.length&&!!m&&(0,o.createElement)(_.__experimentalPaletteEdit,{canReset:r!==s,canOnlyChangeValues:!0,colors:r,onChange:i,paletteLabel:(0,h.__)("Default")}),(0,o.createElement)(_.__experimentalPaletteEdit,{colors:c,onChange:u,paletteLabel:(0,h.__)("Custom"),emptyMessage:(0,h.__)("Custom colors are empty! Add some colors to create your own color palette."),slugPrefix:"custom-"}))}const _a=()=>{};function ha(e){let{name:t}=e;const[n,l]=nl("color.gradients.theme",t),[a]=nl("color.gradients.theme",t,"base"),[r,i]=nl("color.gradients.default",t),[s]=nl("color.gradients.default",t,"base"),[c,u]=nl("color.gradients.custom",t),[m]=nl("color.defaultGradients",t),[d]=nl("color.duotone.custom")||[],[p]=nl("color.duotone.default")||[],[g]=nl("color.duotone.theme")||[],[f]=nl("color.defaultDuotone"),E=[...d||[],...g||[],...p&&f?p:[]];return(0,o.createElement)(_.__experimentalVStack,{className:"edit-site-global-styles-gradient-palette-panel",spacing:10},!!n&&!!n.length&&(0,o.createElement)(_.__experimentalPaletteEdit,{canReset:n!==a,canOnlyChangeValues:!0,gradients:n,onChange:l,paletteLabel:(0,h.__)("Theme")}),!!r&&!!r.length&&!!m&&(0,o.createElement)(_.__experimentalPaletteEdit,{canReset:r!==s,canOnlyChangeValues:!0,gradients:r,onChange:i,paletteLabel:(0,h.__)("Default")}),(0,o.createElement)(_.__experimentalPaletteEdit,{gradients:c,onChange:u,paletteLabel:(0,h.__)("Custom"),emptyMessage:(0,h.__)("Custom gradients are empty! Add some gradients to create your own palette."),slugPrefix:"custom-"}),!!E&&!!E.length&&(0,o.createElement)("div",null,(0,o.createElement)(ea,null,(0,h.__)("Duotone")),(0,o.createElement)(_.__experimentalSpacer,{margin:3}),(0,o.createElement)(_.DuotonePicker,{duotonePalette:E,disableCustomDuotone:!0,disableCustomColors:!0,clearable:!1,onChange:_a})))}var fa=function(e){let{name:t}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Kl,{title:(0,h.__)("Palette"),description:(0,h.__)("Palettes are used to provide default color options for blocks and various design tools. Here you can edit the colors with their labels.")}),(0,o.createElement)(_.TabPanel,{tabs:[{name:"solid",title:"Solid",value:"solid"},{name:"gradient",title:"Gradient",value:"gradient"}]},(e=>(0,o.createElement)(o.Fragment,null,"solid"===e.value&&(0,o.createElement)(ga,{name:t}),"gradient"===e.value&&(0,o.createElement)(ha,{name:t})))))};var Ea=function(e){let{name:t}=e;const n=rl(t),[l]=nl("color.palette",t),[a]=nl("color.gradients",t),[r]=nl("color.custom",t),[i]=nl("color.customGradient",t),s=ol(t),c=il(t),[u]=nl("color.background",t),m=n.includes("backgroundColor")&&u&&(l.length>0||r),p=n.includes("background")&&(a.length>0||i),[g,_]=ll("color.background",t),[f]=ll("color.background",t,"user"),[E,v]=ll("color.gradient",t),[y]=ll("color.gradient",t,"user");if(!m&&!p)return null;let b={};m&&(b={colorValue:g,onColorChange:_},g&&(b.clearable=g===f));let w={};p&&(w={gradientValue:E,onGradientChange:v},E&&(w.clearable=E===y));const x={...b,...w};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Kl,{title:(0,h.__)("Background"),description:(0,h.__)("Set a background color or gradient for the whole site.")}),(0,o.createElement)(_e.__experimentalColorGradientControl,d({className:"edit-site-screen-background-color__control",colors:s,gradients:c,disableCustomColors:!r,disableCustomGradients:!i,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0},x)))};var va=function(e){let{name:t}=e;const n=rl(t),[l]=nl("color.palette",t),[a]=nl("color.custom",t),[r]=nl("color.text",t),i=ol(t),s=n.includes("color")&&r&&(l.length>0||a),[c,u]=ll("color.text",t),[m]=ll("color.text",t,"user");return s?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Kl,{title:(0,h.__)("Text"),description:(0,h.__)("Set the default color used for text across the site.")}),(0,o.createElement)(_e.__experimentalColorGradientControl,{className:"edit-site-screen-text-color__control",colors:i,disableCustomColors:!a,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:c,onColorChange:u,clearable:c===m})):null};var ya=function(e){let{name:t}=e;const n=rl(t),[l]=nl("color.palette",t),[a]=nl("color.custom",t),r=ol(t),[i]=nl("color.link",t),s=n.includes("linkColor")&&i&&(l.length>0||a),c={default:{label:(0,h.__)("Default"),value:ll("elements.link.color.text",t)[0],handler:ll("elements.link.color.text",t)[1],userValue:ll("elements.link.color.text",t,"user")[0]},hover:{label:(0,h.__)("Hover"),value:ll("elements.link.:hover.color.text",t)[0],handler:ll("elements.link.:hover.color.text",t)[1],userValue:ll("elements.link.:hover.color.text",t,"user")[0]}};if(!s)return null;const u=Object.entries(c).map((e=>{let[t,n]=e;return{name:t,title:n.label,className:`color-text-${t}`}}));return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Kl,{title:(0,h.__)("Links"),description:(0,h.__)("Set the colors used for links across the site.")}),(0,o.createElement)(_.TabPanel,{tabs:u},(e=>{var t;const n=null!==(t=c[e.name])&&void 0!==t?t:null;return n?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_e.__experimentalColorGradientControl,{className:"edit-site-screen-link-color__control",colors:r,disableCustomColors:!a,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:n.value,onColorChange:n.handler,clearable:n.value===n.userValue})):null})))};var ba=function(e){let{name:t}=e;const[n,l]=(0,o.useState)("heading"),a=rl(t),[r]=nl("color.palette",t),[i]=nl("color.gradients",t),[s]=nl("color.custom",t),[c]=nl("color.customGradient",t),[u]=nl("color.text",t),[m]=nl("color.background",t),p=ol(t),g=il(t),f=a.includes("color")&&u&&(r.length>0||s),E=a.includes("backgroundColor")&&m&&(r.length>0||s),v=a.includes("background")&&(i.length>0||c),[y,b]=ll("elements."+n+".color.text",t),[w]=ll("elements."+n+".color.text",t,"user"),[x,S]=ll("elements."+n+".color.background",t),[k]=ll("elements."+n+".color.background",t,"user"),[C,T]=ll("elements."+n+".color.gradient",t),[N]=ll("elements."+n+".color.gradient",t,"user");if(!f&&!E&&!v)return null;let I={};E&&(I={colorValue:x,onColorChange:S},x&&(I.clearable=x===k));let M={};v&&(M={gradientValue:C,onGradientChange:T},C&&(M.clearable=C===N));const P={...I,...M};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Kl,{title:(0,h.__)("Headings"),description:(0,h.__)("Set the default color used for headings across the site.")}),(0,o.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,o.createElement)("h4",null,(0,h.__)("Select heading level")),(0,o.createElement)(_.__experimentalToggleGroupControl,{label:(0,h.__)("Select heading level"),hideLabelFromVision:!0,value:n,onChange:l,isBlock:!0},(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"heading",label:(0,h.__)("All")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h1",label:(0,h.__)("H1")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h2",label:(0,h.__)("H2")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h3",label:(0,h.__)("H3")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h4",label:(0,h.__)("H4")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h5",label:(0,h.__)("H5")}),(0,o.createElement)(_.__experimentalToggleGroupControlOption,{value:"h6",label:(0,h.__)("H6")}))),f&&(0,o.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,o.createElement)("h4",null,"heading"===n?(0,h.__)("Text color for all heading levels"):(0,h.sprintf)((0,h.__)("Text color for %s"),n.toUpperCase())),(0,o.createElement)(_e.__experimentalColorGradientControl,{className:"edit-site-screen-heading-text-color__control",colors:p,disableCustomColors:!s,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:y,onColorChange:b,clearable:y===w})),E&&(0,o.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,o.createElement)("h4",null,"heading"===n?(0,h.__)("Background color for all heading levels"):(0,h.sprintf)((0,h.__)("Background color for %s"),n.toUpperCase())),(0,o.createElement)(_e.__experimentalColorGradientControl,d({className:"edit-site-screen-heading-background-color__control",colors:p,gradients:g,disableCustomColors:!s,disableCustomGradients:!c,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0},P))))};var wa=function(e){let{name:t}=e;const n=rl(t),[l]=nl("color.palette",t),[a]=nl("color.custom",t),r=ol(t),[i]=nl("color.background",t),s=n.includes("buttonColor")&&i&&(l.length>0||a),[c,u]=ll("elements.button.color.text",t),[m]=ll("elements.button.color.text",t,"user"),[d,p]=ll("elements.button.color.background",t),[g]=ll("elements.button.color.background",t,"user");return s?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Kl,{title:(0,h.__)("Buttons"),description:(0,h.__)("Set the default colors used for buttons across the site.")}),(0,o.createElement)("h4",{className:"edit-site-global-styles-section-title"},(0,h.__)("Text color")),(0,o.createElement)(_e.__experimentalColorGradientControl,{className:"edit-site-screen-button-color__control",colors:r,disableCustomColors:!a,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:c,onColorChange:u,clearable:c===m}),(0,o.createElement)("h4",{className:"edit-site-global-styles-section-title"},(0,h.__)("Background color")),(0,o.createElement)(_e.__experimentalColorGradientControl,{className:"edit-site-screen-button-color__control",colors:r,disableCustomColors:!a,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:d,onColorChange:p,clearable:d===g})):null};var xa=function(e){let{name:t}=e;const n=sl(t),l=vl(t);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Kl,{title:(0,h.__)("Layout")}),l&&(0,o.createElement)(Tl,{name:t}),n&&(0,o.createElement)(gl,{name:t}))};const Sa=e=>e;function ka(e,t){if(Array.isArray(t))return t}function Ca(e,t){return(0,Et.mergeWith)({},e,t,ka)}const Ta=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=(0,Et.pickBy)((0,Et.mapValues)(e,Ta),Sa);return(0,Et.isEmpty)(t)?void 0:t};function Na(){const[e,t,n]=function(){const{globalStylesId:e,settings:t,styles:n}=(0,c.useSelect)((e=>{const t=e(u.store).__experimentalGetCurrentGlobalStylesId(),n=t?e(u.store).getEditedEntityRecord("root","globalStyles",t):void 0;return{globalStylesId:t,settings:null==n?void 0:n.settings,styles:null==n?void 0:n.styles}}),[]),{getEditedEntityRecord:l}=(0,c.useSelect)(u.store),{editEntityRecord:a}=(0,c.useDispatch)(u.store),r=(0,o.useMemo)((()=>({settings:null!=t?t:{},styles:null!=n?n:{}})),[t,n]),i=(0,o.useCallback)((t=>{var n,r;const o=l("root","globalStyles",e),i=t({styles:null!==(n=null==o?void 0:o.styles)&&void 0!==n?n:{},settings:null!==(r=null==o?void 0:o.settings)&&void 0!==r?r:{}});a("root","globalStyles",e,{styles:Ta(i.styles)||{},settings:Ta(i.settings)||{}})}),[e]);return[!!t||!!n,r,i]}(),[l,a]=function(){const e=(0,c.useSelect)((e=>e(u.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),r=(0,o.useMemo)((()=>a&&t?Ca(a,t):{}),[t,a]);return(0,o.useMemo)((()=>({isReady:e&&l,user:t,base:a,merged:r,setUserConfig:n})),[r,t,a,n,e,l])}function Ia(e){let{children:t}=e;const n=Na();return n.isReady?(0,o.createElement)(el.Provider,{value:n},t):null}function Ma(e){let{variation:t}=e;const[n,l]=(0,o.useState)(!1),{base:a,user:r,setUserConfig:i}=(0,o.useContext)(el),s=(0,o.useMemo)((()=>{var e,n;return{user:{settings:null!==(e=t.settings)&&void 0!==e?e:{},styles:null!==(n=t.styles)&&void 0!==n?n:{}},base:a,merged:Ca(a,t),setUserConfig:()=>{}}}),[t,a]),c=()=>{i((()=>({settings:t.settings,styles:t.styles})))},u=(0,o.useMemo)((()=>{return e=r,n=t,(0,Et.isEqual)(e.styles,n.styles)&&(0,Et.isEqual)(e.settings,n.settings);var e,n}),[r,t]);return(0,o.createElement)(el.Provider,{value:s},(0,o.createElement)("div",{className:g()("edit-site-global-styles-variations_item",{"is-active":u}),role:"button",onClick:c,onKeyDown:e=>{e.keyCode===Kt.ENTER&&(e.preventDefault(),c())},tabIndex:"0","aria-label":null==t?void 0:t.title,"aria-current":u,onFocus:()=>l(!0),onBlur:()=>l(!1)},(0,o.createElement)("div",{className:"edit-site-global-styles-variations_item-preview"},(0,o.createElement)(ql,{label:null==t?void 0:t.title,isFocused:n}))))}var Pa=function(){const{variations:e}=(0,c.useSelect)((e=>({variations:e(u.store).__experimentalGetCurrentThemeGlobalStylesVariations()})),[]),t=(0,o.useMemo)((()=>[{title:(0,h.__)("Default"),settings:{},styles:{}},...e.map((e=>{var t,n;return{...e,settings:null!==(t=e.settings)&&void 0!==t?t:{},styles:null!==(n=e.styles)&&void 0!==n?n:{}}}))]),[e]);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Kl,{back:"/",title:(0,h.__)("Browse styles"),description:(0,h.__)("Choose a different style combination for the theme styles")}),(0,o.createElement)(_.Card,{size:"small",isBorderless:!0},(0,o.createElement)(_.CardBody,null,(0,o.createElement)(_.__experimentalGrid,{columns:2},null==t?void 0:t.map(((e,t)=>(0,o.createElement)(Ma,{key:t,variation:e})))))))};function Va(e){let{className:t,...n}=e;return(0,o.createElement)(_.__experimentalNavigatorScreen,d({className:["edit-site-global-styles-sidebar__navigator-screen",t].filter(Boolean).join(" ")},n))}function za(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Va,{path:n+"/typography"},(0,o.createElement)(na,{name:t})),(0,o.createElement)(Va,{path:n+"/typography/text"},(0,o.createElement)(aa,{name:t,element:"text"})),(0,o.createElement)(Va,{path:n+"/typography/link"},(0,o.createElement)(aa,{name:t,element:"link"})),(0,o.createElement)(Va,{path:n+"/typography/heading"},(0,o.createElement)(aa,{name:t,element:"heading"})),(0,o.createElement)(Va,{path:n+"/typography/button"},(0,o.createElement)(aa,{name:t,element:"button"})),(0,o.createElement)(Va,{path:n+"/colors"},(0,o.createElement)(pa,{name:t})),(0,o.createElement)(Va,{path:n+"/colors/palette"},(0,o.createElement)(fa,{name:t})),(0,o.createElement)(Va,{path:n+"/colors/background"},(0,o.createElement)(Ea,{name:t})),(0,o.createElement)(Va,{path:n+"/colors/text"},(0,o.createElement)(va,{name:t})),(0,o.createElement)(Va,{path:n+"/colors/link"},(0,o.createElement)(ya,{name:t})),(0,o.createElement)(Va,{path:n+"/colors/heading"},(0,o.createElement)(ba,{name:t})),(0,o.createElement)(Va,{path:n+"/colors/button"},(0,o.createElement)(wa,{name:t})),(0,o.createElement)(Va,{path:n+"/layout"},(0,o.createElement)(xa,{name:t})))}var Aa=function(){const e=(0,i.getBlockTypes)();return(0,o.createElement)(_.__experimentalNavigatorProvider,{className:"edit-site-global-styles-sidebar__navigator-provider",initialPath:"/"},(0,o.createElement)(Va,{path:"/"},(0,o.createElement)(Xl,null)),(0,o.createElement)(Va,{path:"/variations"},(0,o.createElement)(Pa,null)),(0,o.createElement)(Va,{path:"/blocks"},(0,o.createElement)(Ql,null)),e.map((e=>(0,o.createElement)(Va,{key:"menu-block-"+e.name,path:"/blocks/"+e.name},(0,o.createElement)(Jl,{name:e.name})))),(0,o.createElement)(za,null),e.map((e=>(0,o.createElement)(za,{key:"screens-block-"+e.name,name:e.name}))))};function Ba(){const[e,t]=(()=>{const{user:e,setUserConfig:t}=(0,o.useContext)(el);return[!!e&&!(0,Et.isEqual)(e,tl),(0,o.useCallback)((()=>t((()=>tl))),[t])]})(),{toggle:n}=(0,c.useDispatch)(k.store);return(0,o.createElement)(Ln,{className:"edit-site-global-styles-sidebar",identifier:"edit-site/global-styles",title:(0,h.__)("Styles"),icon:On,closeLabel:(0,h.__)("Close global styles sidebar"),panelClassName:"edit-site-global-styles-sidebar__panel",header:(0,o.createElement)(_.Flex,null,(0,o.createElement)(_.FlexBlock,null,(0,o.createElement)("strong",null,(0,h.__)("Styles")),(0,o.createElement)("span",{className:"edit-site-global-styles-sidebar__beta"},(0,h.__)("Beta"))),(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.DropdownMenu,{icon:te,label:(0,h.__)("More Global Styles Actions"),controls:[{title:(0,h.__)("Reset to defaults"),onClick:t,isDisabled:!e},{title:(0,h.__)("Welcome Guide"),onClick:()=>n("core/edit-site","welcomeGuideStyles")}]})))},(0,o.createElement)(Aa,null))}const Ra="edit-site/template",La="edit-site/block-inspector";var Oa=e=>{let{sidebarName:t}=e;const{enableComplementaryArea:n}=(0,c.useDispatch)(O),[l,a]=t===Ra?[(0,h.__)("Template (selected)"),"is-active"]:[(0,h.__)("Template"),""],[r,i]=t===La?[(0,h.__)("Block (selected)"),"is-active"]:[(0,h.__)("Block"),""];return(0,o.createElement)("ul",null,(0,o.createElement)("li",null,(0,o.createElement)(_.Button,{onClick:()=>n(Oe,Ra),className:`edit-site-sidebar__panel-tab ${a}`,"aria-label":l,"data-label":(0,h.__)("Template")},(0,h.__)("Template"))),(0,o.createElement)("li",null,(0,o.createElement)(_.Button,{onClick:()=>n(Oe,La),className:`edit-site-sidebar__panel-tab ${i}`,"aria-label":r,"data-label":(0,h.__)("Block")},(0,h.__)("Block"))))};function Da(e){let{template:t}=e;const{revertTemplate:n}=(0,c.useDispatch)(Ut);return Je(t)?(0,o.createElement)(_.DropdownMenu,{icon:te,label:(0,h.__)("Actions"),className:"edit-site-template-card__actions",toggleProps:{isSmall:!0}},(e=>{let{onClose:l}=e;return(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,{info:(0,h.__)("Use the template as supplied by the theme."),onClick:()=>{n(t),l()}},(0,h.__)("Clear customizations")))})):null}function Ga(e){let{area:t,clientId:n}=e;const{selectBlock:l,toggleBlockHighlight:a}=(0,c.useDispatch)(_e.store),r=(0,c.useSelect)((e=>e(m.store).__experimentalGetDefaultTemplatePartAreas().find((e=>e.area===t))),[t]),i=()=>a(n,!0),s=()=>a(n,!1);return(0,o.createElement)(_.Button,{className:"edit-site-template-card__template-areas-item",icon:null==r?void 0:r.icon,onMouseOver:i,onMouseLeave:s,onFocus:i,onBlur:s,onClick:()=>{l(n)}},null==r?void 0:r.label)}function Fa(){const e=(0,c.useSelect)((e=>e(Ut).getCurrentTemplateTemplateParts()),[]);return e.length?(0,o.createElement)("section",{className:"edit-site-template-card__template-areas"},(0,o.createElement)(_.__experimentalHeading,{level:3,className:"edit-site-template-card__template-areas-title"},(0,h.__)("Areas")),(0,o.createElement)("ul",{className:"edit-site-template-card__template-areas-list"},e.map((e=>{let{templatePart:t,block:n}=e;return(0,o.createElement)("li",{key:t.slug},(0,o.createElement)(Ga,{area:t.area,clientId:n.clientId}))})))):null}function Ha(){const{info:{title:e,description:t,icon:n},template:l}=(0,c.useSelect)((e=>{const{getEditedPostType:t,getEditedPostId:n}=e(Ut),{getEditedEntityRecord:l}=e(u.store),{__experimentalGetTemplateInfo:a}=e(m.store),r=l("postType",t(),n());return{info:r?a(r):{},template:r}}),[]);return e||t?(0,o.createElement)("div",{className:"edit-site-template-card"},(0,o.createElement)(_.Icon,{className:"edit-site-template-card__icon",icon:n}),(0,o.createElement)("div",{className:"edit-site-template-card__content"},(0,o.createElement)("div",{className:"edit-site-template-card__header"},(0,o.createElement)("h2",{className:"edit-site-template-card__title"},e),(0,o.createElement)(Da,{template:l})),(0,o.createElement)("div",{className:"edit-site-template-card__description"},t),(0,o.createElement)(Fa,null))):null}const{Slot:$a,Fill:Ua}=(0,_.createSlotFill)("EditSiteSidebarInspector"),Wa=Ua;function ja(){const{sidebar:e,isEditorSidebarOpened:t,hasBlockSelection:n,supportsGlobalStyles:l}=(0,c.useSelect)((e=>{const t=e(O).getActiveComplementaryArea(Oe),n=[La,Ra].includes(t),l=e(Ut).getSettings();return{sidebar:t,isEditorSidebarOpened:n,hasBlockSelection:!!e(_e.store).getBlockSelectionStart(),supportsGlobalStyles:!(null!=l&&l.supportsTemplatePartsMode)}}),[]),{enableComplementaryArea:a}=(0,c.useDispatch)(O);(0,o.useEffect)((()=>{t&&a(Oe,n?La:Ra)}),[n,t]);let r=e;t||(r=n?La:Ra);let i=o.Fragment;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Ln,{identifier:r,title:(0,h.__)("Settings"),icon:Rn,closeLabel:(0,h.__)("Close settings sidebar"),header:(0,o.createElement)(Oa,{sidebarName:r}),headerClassName:"edit-site-sidebar__panel-tabs"},r===Ra&&(0,o.createElement)(_.PanelBody,null,(0,o.createElement)(Ha,null)),r===La&&(0,o.createElement)($a,{bubblesVirtually:!0})),l&&(0,o.createElement)(Ba,null),(0,o.createElement)(i,null))}var Ya=window.wp.htmlEntities;var qa=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"}));var Xa=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.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-17.6 1L10 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"}));const Ka="__experimentalMainDashboardButton",{Fill:Za,Slot:Qa}=(0,_.createSlotFill)(Ka),Ja=Za;Ja.Slot=e=>{let{children:t}=e;const n=(0,_.__experimentalUseSlot)(Ka);return Boolean(n.fills&&n.fills.length)?(0,o.createElement)(Qa,{bubblesVirtually:!0}):t};var er=Ja;const tr="site-editor";function nr(e){let{params:t,replace:n,...l}=e;const a=Ae(t,n);return(0,o.createElement)(_.__experimentalNavigationItem,d({},a,l))}var lr=e=>{let{activeItem:t=tr}=e;const{homeTemplate:n,isNavigationOpen:l,isTemplatePartsMode:a,siteTitle:r}=(0,c.useSelect)((e=>{const{getEntityRecord:t}=e(u.store),{getSettings:n,isNavigationOpened:l}=e(Ut),a=t("root","__unstableBase",void 0)||{},{supportsTemplatePartsMode:r,__unstableHomeTemplate:o}=n();return{siteTitle:a.name,homeTemplate:o,isNavigationOpen:l(),isTemplatePartsMode:!!r}}),[]),{setIsNavigationPanelOpened:i}=(0,c.useDispatch)(Ut);return(0,o.createElement)("div",{className:g()("edit-site-navigation-panel",{"is-open":l}),onKeyDown:e=>{e.keyCode!==Kt.ESCAPE||e.defaultPrevented||(e.preventDefault(),i(!1))}},(0,o.createElement)("div",{className:"edit-site-navigation-panel__inner"},(0,o.createElement)("div",{className:"edit-site-navigation-panel__site-title-container"},(0,o.createElement)("div",{className:"edit-site-navigation-panel__site-title"},(0,Ya.decodeEntities)(r))),(0,o.createElement)("div",{className:"edit-site-navigation-panel__scroll-container"},(0,o.createElement)(_.__experimentalNavigation,{activeItem:t},(0,o.createElement)(er.Slot,null,(0,o.createElement)(_.__experimentalNavigationBackButton,{backButtonLabel:(0,h.__)("Dashboard"),className:"edit-site-navigation-panel__back-to-dashboard",href:"index.php"})),(0,o.createElement)(_.__experimentalNavigationMenu,null,(0,o.createElement)(_.__experimentalNavigationGroup,{title:(0,h.__)("Editor")},!a&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(nr,{icon:qa,title:(0,h.__)("Site"),item:tr,params:{postId:null==n?void 0:n.postId,postType:null==n?void 0:n.postType}}),(0,o.createElement)(nr,{icon:Un,title:(0,h.__)("Templates"),item:"wp_template",params:{postId:void 0,postType:"wp_template"}})),(0,o.createElement)(nr,{icon:Xa,title:(0,h.__)("Template Parts"),item:"wp_template_part",params:{postId:void 0,postType:"wp_template_part"}})))))))};var ar=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,o.createElement)(f.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"}));var rr=function(e){let{icon:t}=e;const{isNavigationOpen:n,isRequestingSiteIcon:l,siteIconUrl:a}=(0,c.useSelect)((e=>{const{getEntityRecord:t,isResolving:n}=e(u.store),l=t("root","__unstableBase",void 0)||{};return{isNavigationOpen:e(Ut).isNavigationOpened(),isRequestingSiteIcon:n("core","getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:l.site_icon_url}}),[]),{setIsNavigationPanelOpened:r}=(0,c.useDispatch)(Ut),i=(0,J.useReducedMotion)(),s=(0,o.useRef)();(0,o.useEffect)((()=>{n||s.current.focus()}),[n]);let m=(0,o.createElement)(_.Icon,{size:"36px",icon:ar});const d={expand:{scale:1.25,transition:{type:"tween",duration:"0.3"}}};a?m=(0,o.createElement)(_.__unstableMotion.img,{variants:!i&&d,alt:(0,h.__)("Site Icon"),className:"edit-site-navigation-toggle__site-icon",src:a}):l?m=null:t&&(m=(0,o.createElement)(_.Icon,{size:"36px",icon:t}));const p=g()({"edit-site-navigation-toggle__button":!0,"has-icon":a});return(0,o.createElement)(_.__unstableMotion.div,{className:"edit-site-navigation-toggle"+(n?" is-open":""),whileHover:"expand"},(0,o.createElement)(_.Button,{className:p,label:(0,h.__)("Toggle navigation"),ref:s,"aria-pressed":n,onClick:()=>r(!n),showTooltip:!0},m))};const{Fill:or,Slot:ir}=(0,_.createSlotFill)("EditSiteNavigationPanelPreview"),{Fill:sr,Slot:cr}=(0,_.createSlotFill)("EditSiteNavigationSidebar");function ur(e){let{isDefaultOpen:t=!1,activeTemplateType:n}=e;const l=(0,J.useViewportMatch)("medium"),{setIsNavigationPanelOpened:a}=(0,c.useDispatch)(Ut);return(0,o.useEffect)((function(){a(t&&l)}),[t,l,a]),(0,o.createElement)(sr,null,(0,o.createElement)(rr,null),(0,o.createElement)(lr,{activeItem:n}),(0,o.createElement)(ir,null))}ur.Slot=cr;var mr=ur,dr=window.wp.reusableBlocks;function pr(e){let{clientId:t}=e;const{getBlocks:n}=(0,c.useSelect)(_e.store),{replaceBlocks:l}=(0,c.useDispatch)(_e.store);return(0,c.useSelect)((e=>e(_e.store).canRemoveBlock(t)),[t])?(0,o.createElement)(_e.BlockSettingsMenuControls,null,(e=>{let{onClose:a}=e;return(0,o.createElement)(_.MenuItem,{onClick:()=>{l(t,n(t)),a()}},(0,h.__)("Detach blocks from template part"))})):null}function gr(e){let{closeModal:t,onCreate:n}=e;const[l,a]=(0,o.useState)(""),[r,i]=(0,o.useState)(De),[s,u]=(0,o.useState)(!1),d=(0,J.useInstanceId)(gr),p=(0,c.useSelect)((e=>e(m.store).__experimentalGetDefaultTemplatePartAreas()),[]);return(0,o.createElement)(_.Modal,{title:(0,h.__)("Create a template part"),closeLabel:(0,h.__)("Close"),onRequestClose:t,overlayClassName:"edit-site-create-template-part-modal"},(0,o.createElement)("form",{onSubmit:async e=>{e.preventDefault(),l&&(u(!0),await n({title:l,area:r}))}},(0,o.createElement)(_.TextControl,{label:(0,h.__)("Name"),value:l,onChange:a,required:!0}),(0,o.createElement)(_.BaseControl,{label:(0,h.__)("Area"),id:`edit-site-create-template-part-modal__area-selection-${d}`,className:"edit-site-create-template-part-modal__area-base-control"},(0,o.createElement)(_.__experimentalRadioGroup,{label:(0,h.__)("Area"),className:"edit-site-create-template-part-modal__area-radio-group",id:`edit-site-create-template-part-modal__area-selection-${d}`,onChange:i,checked:r},p.map((e=>{let{icon:t,label:n,area:l,description:a}=e;return(0,o.createElement)(_.__experimentalRadio,{key:n,value:l,className:"edit-site-create-template-part-modal__area-radio"},(0,o.createElement)(_.Flex,{align:"start",justify:"start"},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Icon,{icon:t})),(0,o.createElement)(_.FlexBlock,{className:"edit-site-create-template-part-modal__option-label"},n,(0,o.createElement)("div",null,a)),(0,o.createElement)(_.FlexItem,{className:"edit-site-create-template-part-modal__checkbox"},r===l&&(0,o.createElement)(_.Icon,{icon:E}))))})))),(0,o.createElement)(_.Flex,{className:"edit-site-create-template-part-modal__modal-actions",justify:"flex-end"},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"secondary",onClick:()=>{t()}},(0,h.__)("Cancel"))),(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"primary",type:"submit",disabled:!l,isBusy:s},(0,h.__)("Create"))))))}function _r(e){let{clientIds:t,blocks:n}=e;const[l,a]=(0,o.useState)(!1),{replaceBlocks:r}=(0,c.useDispatch)(_e.store),{saveEntityRecord:s}=(0,c.useDispatch)(u.store),{createSuccessNotice:m}=(0,c.useDispatch)(Ze.store),{canCreate:d}=(0,c.useSelect)((e=>{const{supportsTemplatePartsMode:t}=e(Ut).getSettings();return{canCreate:!t}}),[]);if(!d)return null;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_e.BlockSettingsMenuControls,null,(()=>(0,o.createElement)(_.MenuItem,{icon:Xa,onClick:()=>{a(!0)}},(0,h.__)("Create Template part")))),l&&(0,o.createElement)(gr,{closeModal:()=>{a(!1)},onCreate:async e=>{let{title:l,area:a}=e;const o=(0,Et.kebabCase)(l).replace(/[^\w-]+/g,"")||"wp-custom-part",c=await s("postType","wp_template_part",{slug:o,title:l,content:(0,i.serialize)(n),area:a});r(t,(0,i.createBlock)("core/template-part",{slug:c.slug,theme:c.theme})),m((0,h.__)("Template part created."),{type:"snackbar"})}}))}function hr(){var e;const{clientIds:t,blocks:n}=(0,c.useSelect)((e=>{const{getSelectedBlockClientIds:t,getBlocksByClientId:n}=e(_e.store),l=t();return{clientIds:l,blocks:n(l)}}),[]);return 1===n.length&&"core/template-part"===(null===(e=n[0])||void 0===e?void 0:e.name)?(0,o.createElement)(pr,{clientId:t[0]}):(0,o.createElement)(_r,{clientIds:t,blocks:n})}var fr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.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"}));function Er(e){let{type:t,id:n,activePage:l,onActivePageChange:a}=e;const r=(0,c.useSelect)((e=>t&&n&&"URL"!==t&&e(u.store).getEntityRecord("postType",t,n)),[t,n]),i=(0,o.useMemo)((()=>{if(null==r||!r.link)return null;const e=(0,me.getPathAndQueryString)(r.link);return e===(null==l?void 0:l.path)?null:()=>a({type:t,slug:r.slug,path:e,context:{postType:r.type,postId:r.id}})}),[r,null==l?void 0:l.path,a]);return i&&(0,o.createElement)(_.Button,{icon:fr,label:(0,h.__)("Edit Page Template"),onClick:i})}function vr(e){let{onClick:t=(()=>{})}=e;const{shortcut:n,isBlockInspectorOpen:l}=(0,c.useSelect)((e=>({shortcut:e(Wt.store).getShortcutRepresentation("core/edit-site/toggle-block-settings-sidebar"),isBlockInspectorOpen:e(O).getActiveComplementaryArea(Ut.name)===La})),[]),{enableComplementaryArea:a,disableComplementaryArea:r}=(0,c.useDispatch)(O),i=l?(0,h.__)("Hide more settings"):(0,h.__)("Show more settings");return(0,o.createElement)(_.MenuItem,{onClick:()=>{l?(r(Oe),(0,Qe.speak)((0,h.__)("Block settings closed"))):(a(Oe,La),(0,Qe.speak)((0,h.__)("Additional settings are now available in the Editor block settings sidebar"))),t()},shortcut:n},i)}var yr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.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"}));var br=function(){var e;const t=Me(),n=Pe(),l="wp_template_part"===t.params.postType,a=null===(e=t.state)||void 0===e?void 0:e.fromTemplateId;return l&&a?(0,o.createElement)(_.Button,{className:"edit-site-visual-editor__back-button",icon:yr,onClick:()=>{n.back()}},(0,h.__)("Back")):null};function wr(e){let{direction:t,resizeWidthBy:n}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("button",{className:`resizable-editor__drag-handle is-${t}`,"aria-label":(0,h.__)("Drag to resize"),"aria-describedby":`resizable-editor__resize-help-${t}`,onKeyDown:function(e){const{keyCode:l}=e;"left"===t&&l===Kt.LEFT||"right"===t&&l===Kt.RIGHT?n(20):("left"===t&&l===Kt.RIGHT||"right"===t&&l===Kt.LEFT)&&n(-20)}}),(0,o.createElement)(_.VisuallyHidden,{id:`resizable-editor__resize-help-${t}`},(0,h.__)("Use left and right arrow keys to resize the canvas.")))}const xr="100%",Sr="100%",kr={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};var Cr=function(e){let{enableResizing:t,settings:n,children:l,...a}=e;const{deviceType:r,isZoomOutMode:i}=(0,c.useSelect)((e=>({deviceType:e(Ut).__experimentalGetPreviewDeviceType(),isZoomOutMode:"zoom-out"===e(_e.store).__unstableGetEditorMode()})),[]),s=(0,_e.__experimentalUseResizeCanvas)(r),[u,m]=(0,o.useState)(xr),[p,g]=(0,o.useState)(Sr),h=(0,o.useRef)(),f=(0,_e.__unstableUseMouseMoveTypingReset)(),E=(0,J.useMergeRefs)([h,f]);(0,o.useEffect)((function(){const e=h.current;if(!e||!t)return;let n,l=null;function a(){l||(l=e.contentWindow.setTimeout((()=>{const{readyState:t}=e.contentDocument;"interactive"===t||"complete"===t?(g(e.contentDocument.body.scrollHeight),l=null):a()}),1e3/30))}function r(){var t;null===(t=n)||void 0===t||t.disconnect(),n=new e.contentWindow.ResizeObserver(a),n.observe(e.contentDocument.body),a()}return e.addEventListener("load",r),r(),()=>{var t,a;null===(t=e.contentWindow)||void 0===t||t.clearTimeout(l),null===(a=n)||void 0===a||a.disconnect(),e.removeEventListener("load",r)}}),[t]);const v=(0,o.useCallback)((e=>{h.current&&m(h.current.offsetWidth+e)}),[]);return(0,o.createElement)(_.ResizableBox,{size:{width:u,height:p},onResizeStop:(e,t,n)=>{m(n.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{right:t,left:t},showHandle:t,resizeRatio:2,handleComponent:{left:(0,o.createElement)(wr,{direction:"left",resizeWidthBy:v}),right:(0,o.createElement)(wr,{direction:"right",resizeWidthBy:v})},handleClasses:void 0,handleStyles:{left:kr,right:kr}},(0,o.createElement)(_e.__unstableIframe,d({isZoomedOut:i,style:t?{height:p}:s,head:(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_e.__unstableEditorStyles,{styles:n.styles}),(0,o.createElement)("style",null,".is-root-container { display: flow-root; }"),t&&(0,o.createElement)("style",null,"html, body { height: -moz-fit-content !important; height: fit-content !important; min-height: 0 !important; }",".is-root-container { min-height: 0 !important; }")),assets:n.__unstableResolvedAssets,ref:E,name:"editor-canvas",className:"edit-site-visual-editor__editor-canvas"},a),n.svgFilters,l))};const Tr={type:"default",alignments:[]};function Nr(e){var t,n;let{setIsInserterOpen:l}=e;const{storedSettings:a,templateType:r,templateId:i,page:s}=(0,c.useSelect)((e=>{const{getSettings:t,getEditedPostType:n,getEditedPostId:a,getPage:r}=e(Ut);return{storedSettings:t(l),templateType:n(),templateId:a(),page:r()}}),[l]),m=null!==(t=a.__experimentalAdditionalBlockPatterns)&&void 0!==t?t:a.__experimentalBlockPatterns,p=null!==(n=a.__experimentalAdditionalBlockPatternCategories)&&void 0!==n?n:a.__experimentalBlockPatternCategories,{restBlockPatterns:_,restBlockPatternCategories:h}=(0,c.useSelect)((e=>({restBlockPatterns:e(u.store).getBlockPatterns(),restBlockPatternCategories:e(u.store).getBlockPatternCategories()})),[]),f=(0,o.useMemo)((()=>[...m||[],..._||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name)))).filter((e=>{let{postTypes:t}=e;return!t||Array.isArray(t)&&t.includes(r)}))),[m,_,r]),E=(0,o.useMemo)((()=>[...p||[],...h||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))),[p,h]),v=(0,o.useMemo)((()=>{const{__experimentalAdditionalBlockPatterns:e,__experimentalAdditionalBlockPatternCategories:t,...n}=a;return{...n,__experimentalBlockPatterns:f,__experimentalBlockPatternCategories:E}}),[a,f,E]),[y,b,w]=(0,u.useEntityBlockEditor)("postType",r),{setPage:x}=(0,c.useDispatch)(Ut),{enableComplementaryArea:S}=(0,c.useDispatch)(O),k=((0,o.useCallback)((()=>{S("core/edit-site","edit-site/navigation-menu")}),[S]),(0,o.useRef)()),C=(0,J.useMergeRefs)([k,(0,_e.__unstableUseTypingObserver)()]),T=(0,J.useViewportMatch)("small","<"),{clearSelectedBlock:N}=(0,c.useDispatch)(_e.store),I="wp_template_part"===r,M=0!==y.length;let P=o.Fragment;return(0,o.createElement)(_e.BlockEditorProvider,{settings:v,value:y,onInput:b,onChange:w,useSubRegistry:!1},(0,o.createElement)(hr,null),(0,o.createElement)(_e.__experimentalLinkControl.ViewerFill,null,(0,o.useCallback)((e=>(0,o.createElement)(Er,d({},e,{activePage:s,onActivePageChange:x}))),[s])),(0,o.createElement)(Wa,null,(0,o.createElement)(_e.BlockInspector,null)),(0,o.createElement)(_e.BlockTools,{className:g()("edit-site-visual-editor",{"is-focus-mode":I}),__unstableContentRef:k,onClick:e=>{e.target===e.currentTarget&&N()}},(0,o.createElement)(_e.BlockEditorKeyboardShortcuts.Register,null),(0,o.createElement)(br,null),(0,o.createElement)(Cr,{key:i,enableResizing:I&&!T,settings:v,contentRef:C},(0,o.createElement)(_e.BlockList,{className:"edit-site-block-editor__block-list wp-site-blocks",__experimentalLayout:Tr,renderAppender:(!I||!M)&&void 0})),(0,o.createElement)(_e.__unstableBlockSettingsMenuFirstItem,null,(e=>{let{onClose:t}=e;return(0,o.createElement)(vr,{onClick:t})})),(0,o.createElement)(_e.__unstableBlockToolbarLastItem,null,(0,o.createElement)(_e.__unstableBlockNameContext.Consumer,null,(e=>"core/navigation"===e&&(0,o.createElement)(P,null))))),(0,o.createElement)(dr.ReusableBlocksMenuItems,null))}var Ir=n(773);function Mr(e){let{value:t,onChange:n,onInput:l}=e;const[a,r]=(0,o.useState)(t),[i,s]=(0,o.useState)(!1),c=(0,J.useInstanceId)(Mr),u=(0,o.useRef)();i||a===t||r(t);return(0,o.useEffect)((()=>()=>{u.current&&n(u.current)}),[]),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.VisuallyHidden,{as:"label",htmlFor:`code-editor-text-area-${c}`},(0,h.__)("Type text or HTML")),(0,o.createElement)(Ir.Z,{autoComplete:"off",dir:"auto",value:a,onChange:e=>{const t=e.target.value;l(t),r(t),s(!0),u.current=t},onBlur:()=>{i&&(n(a),s(!1))},className:"edit-site-code-editor-text-area",id:`code-editor-text-area-${c}`,placeholder:(0,h.__)("Start writing with text or HTML")}))}function Pr(){const{templateType:e,shortcut:t}=(0,c.useSelect)((e=>{const{getEditedPostType:t}=e(Ut),{getShortcutRepresentation:n}=e(Wt.store);return{templateType:t(),shortcut:n("core/edit-site/toggle-mode")}}),[]),[n,l]=(0,u.useEntityProp)("postType",e,"content"),[a,,r]=(0,u.useEntityBlockEditor)("postType",e);let s;s=n instanceof Function?n({blocks:a}):a?(0,i.__unstableSerializeAndClean)(a):n;const{switchEditorMode:m}=(0,c.useDispatch)(Ut);return(0,o.createElement)("div",{className:"edit-site-code-editor"},(0,o.createElement)("div",{className:"edit-site-code-editor__toolbar"},(0,o.createElement)("h2",null,(0,h.__)("Editing code")),(0,o.createElement)(_.Button,{variant:"tertiary",onClick:()=>m("visual"),shortcut:t},(0,h.__)("Exit code editor"))),(0,o.createElement)("div",{className:"edit-site-code-editor__body"},(0,o.createElement)(Mr,{value:s,onChange:e=>{r((0,i.parse)(e),{selection:void 0})},onInput:l})))}function Vr(e){let{openEntitiesSavedStates:t}=e;const{__experimentalGetDirtyEntityRecords:n,isSavingEntityRecord:l}=(0,c.useSelect)(u.store),{getEditorMode:a}=(0,c.useSelect)(Ut),r=(0,c.useSelect)((e=>e(Ut).isListViewOpened()),[]),o=(0,c.useSelect)((e=>e(O).getActiveComplementaryArea(Ut.name)===La),[]),{redo:i,undo:s}=(0,c.useDispatch)(u.store),{setIsListViewOpened:m,switchEditorMode:d}=(0,c.useDispatch)(Ut),{enableComplementaryArea:p,disableComplementaryArea:g}=(0,c.useDispatch)(O);return(0,Wt.useShortcut)("core/edit-site/save",(e=>{e.preventDefault();const a=n(),r=!!a.length;!a.some((e=>l(e.kind,e.name,e.key)))&&r&&t()})),(0,Wt.useShortcut)("core/edit-site/undo",(e=>{s(),e.preventDefault()})),(0,Wt.useShortcut)("core/edit-site/redo",(e=>{i(),e.preventDefault()})),(0,Wt.useShortcut)("core/edit-site/toggle-list-view",(()=>{m(!r)})),(0,Wt.useShortcut)("core/edit-site/toggle-block-settings-sidebar",(e=>{e.preventDefault(),o?g(Oe):p(Oe,La)})),(0,Wt.useShortcut)("core/edit-site/toggle-mode",(()=>{d("visual"===a()?"text":"visual")})),null}Vr.Register=function(){const{registerShortcut:e}=(0,c.useDispatch)(Wt.store);return(0,o.useEffect)((()=>{e({name:"core/edit-site/save",category:"global",description:(0,h.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-site/undo",category:"global",description:(0,h.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-site/redo",category:"global",description:(0,h.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}}),e({name:"core/edit-site/toggle-list-view",category:"global",description:(0,h.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/edit-site/toggle-block-settings-sidebar",category:"global",description:(0,h.__)("Show or hide the block settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/edit-site/keyboard-shortcuts",category:"main",description:(0,h.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/edit-site/next-region",category:"global",description:(0,h.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-site/previous-region",category:"global",description:(0,h.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"}]}),e({name:"core/edit-site/toggle-mode",category:"global",description:(0,h.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}})}),[e]),null};var zr=Vr;function Ar(){const{setTemplate:e,setTemplatePart:t,setPage:n}=(0,c.useDispatch)(Ut),{params:{postId:l,postType:a}}=Me();return(0,o.useEffect)((()=>{"page"===a||"post"===a?n({context:{postType:a,postId:l}}):"wp_template"===a?e(l):"wp_template_part"===a&&t(l)}),[l,a]),null}var Br=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.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"}));function Rr(){const{setIsInserterOpened:e}=(0,c.useDispatch)(Ut),t=(0,c.useSelect)((e=>e(Ut).__experimentalGetInsertionPoint()),[]),n=(0,J.useViewportMatch)("medium","<"),l=n?"div":_.VisuallyHidden,[a,r]=(0,J.__experimentalUseDialog)({onClose:()=>e(!1),focusOnMount:null}),i=(0,o.useRef)();return(0,o.useEffect)((()=>{i.current.focusSearch()}),[]),(0,o.createElement)("div",d({ref:a},r,{className:"edit-site-editor__inserter-panel"}),(0,o.createElement)(l,{className:"edit-site-editor__inserter-panel-header"},(0,o.createElement)(_.Button,{icon:Br,label:(0,h.__)("Close block inserter"),onClick:()=>e(!1)})),(0,o.createElement)("div",{className:"edit-site-editor__inserter-panel-content"},(0,o.createElement)(_e.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:n,rootClientId:t.rootClientId,__experimentalInsertionIndex:t.insertionIndex,__experimentalFilterValue:t.filterValue,ref:i})))}function Lr(){const{setIsListViewOpened:e}=(0,c.useDispatch)(Ut),t=(0,J.useFocusOnMount)("firstElement"),n=(0,J.useFocusReturn)(),l=(0,J.useFocusReturn)();const a=`edit-site-editor__list-view-panel-label-${(0,J.useInstanceId)(Lr)}`;return(0,o.createElement)("div",{"aria-labelledby":a,className:"edit-site-editor__list-view-panel",onKeyDown:function(t){t.keyCode!==Kt.ESCAPE||t.defaultPrevented||e(!1)}},(0,o.createElement)("div",{className:"edit-site-editor__list-view-panel-header",ref:n},(0,o.createElement)("strong",{id:a},(0,h.__)("List View")),(0,o.createElement)(_.Button,{icon:w,label:(0,h.__)("Close List View Sidebar"),onClick:()=>e(!1)})),(0,o.createElement)("div",{className:"edit-site-editor__list-view-panel-content",ref:(0,J.useMergeRefs)([l,t])},(0,o.createElement)(_e.__experimentalListView,null)))}function Or(e){let{text:t,children:n}=e;const l=(0,J.useCopyToClipboard)(t);return(0,o.createElement)(_.Button,{variant:"secondary",ref:l},n)}function Dr(e){let{message:t,error:n,reboot:l,dashboardLink:a}=e;const r=[];return l&&r.push((0,o.createElement)(_.Button,{key:"recovery",onClick:l,variant:"secondary"},(0,h.__)("Attempt Recovery"))),n&&r.push((0,o.createElement)(Or,{key:"copy-error",text:n.stack},(0,h.__)("Copy Error"))),a&&r.push((0,o.createElement)(_.Button,{key:"back-to-dashboard",variant:"secondary",href:a},(0,h.__)("Back to dashboard"))),(0,o.createElement)(_e.Warning,{className:"editor-error-boundary",actions:r},t)}class Gr extends o.Component{constructor(){super(...arguments),this.reboot=this.reboot.bind(this),this.state={error:null}}componentDidCatch(e){(0,de.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}reboot(){this.props.onError()}render(){const{error:e}=this.state;return e?(0,o.createElement)(Dr,{message:(0,h.__)("The editor has encountered an unexpected error."),error:e,reboot:this.reboot}):this.props.children}}function Fr(e){let{nonAnimatedSrc:t,animatedSrc:n}=e;return(0,o.createElement)("picture",{className:"edit-site-welcome-guide__image"},(0,o.createElement)("source",{srcSet:t,media:"(prefers-reduced-motion: reduce)"}),(0,o.createElement)("img",{src:n,width:"312",height:"240",alt:""}))}function Hr(){const{toggle:e}=(0,c.useDispatch)(k.store);return(0,c.useSelect)((e=>!!e(k.store).get("core/edit-site","welcomeGuide")),[])?(0,o.createElement)(_.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,h.__)("Welcome to the site editor"),finishButtonText:(0,h.__)("Get Started"),onFinish:()=>e("core/edit-site","welcomeGuide"),pages:[{image:(0,o.createElement)(Fr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/edit-your-site.svg?1",animatedSrc:"https://s.w.org/images/block-editor/edit-your-site.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,h.__)("Edit your site")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,h.__)("Design everything on your site — from the header right down to the footer — using blocks.")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,o.createInterpolateElement)((0,h.__)("Click <StylesIconImage /> to start designing your blocks, and choose your typography, layout, and colors."),{StylesIconImage:(0,o.createElement)("img",{alt:(0,h.__)("styles"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A"})})))}]}):null}function $r(){const{toggle:e}=(0,c.useDispatch)(k.store),{isActive:t,isStylesOpen:n}=(0,c.useSelect)((e=>{const t=e(O).getActiveComplementaryArea(Ut.name);return{isActive:!!e(k.store).get("core/edit-site","welcomeGuideStyles"),isStylesOpen:"edit-site/global-styles"===t}}),[]);return t&&n?(0,o.createElement)(_.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,h.__)("Welcome to styles"),finishButtonText:(0,h.__)("Get Started"),onFinish:()=>e("core/edit-site","welcomeGuideStyles"),pages:[{image:(0,o.createElement)(Fr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.svg?1",animatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,h.__)("Welcome to Styles")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,h.__)("Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.")))},{image:(0,o.createElement)(Fr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/set-the-design.svg?1",animatedSrc:"https://s.w.org/images/block-editor/set-the-design.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,h.__)("Set the design")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,h.__)("You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle! ")))},{image:(0,o.createElement)(Fr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.svg?1",animatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,h.__)("Personalize blocks")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,h.__)("You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.")))},{image:(0,o.createElement)(Fr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,h.__)("Learn more")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,h.__)("New to block themes and styling your site? "),(0,o.createElement)(_.ExternalLink,{href:(0,h.__)("https://wordpress.org/support/article/styles-overview/")},(0,h.__)("Here’s a detailed guide to learn how to make the most of it."))))}]}):null}function Ur(){return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Hr,null),(0,o.createElement)($r,null))}function Wr(){return function(){const[e,t,n]=Wl(),{getSettings:l}=(0,c.useSelect)(Ut),{updateSettings:a}=(0,c.useDispatch)(Ut);(0,o.useEffect)((()=>{if(!e||!t)return;const r=l(),o=(0,Et.filter)(r.styles,(e=>!e.isGlobalStyles));a({...r,styles:[...o,...e],svgFilters:n,__experimentalFeatures:t})}),[e,t])}(),null}function jr(e){const t=Me(),n=(0,c.useSelect)((e=>{var t;return null===(t=e(u.store).getEntityRecord("root","site"))||void 0===t?void 0:t.title}),[]),l=(0,o.useRef)(!0);(0,o.useEffect)((()=>{l.current=!1}),[t]),(0,o.useEffect)((()=>{if(!l.current&&e&&n){const t=(0,h.sprintf)((0,h.__)("%1$s ‹ %2$s — WordPress"),(0,Ya.decodeEntities)(e),(0,Ya.decodeEntities)(n));document.title=t,(0,Qe.speak)((0,h.sprintf)((0,h.__)("Now displaying: %s"),document.title),"assertive")}}),[e,n,t])}const Yr={header:(0,h.__)("Editor top bar"),body:(0,h.__)("Editor content"),sidebar:(0,h.__)("Editor settings"),actions:(0,h.__)("Editor publish"),footer:(0,h.__)("Editor footer"),drawer:(0,h.__)("Navigation Sidebar")};var qr=function(e){let{onError:t}=e;const{isInserterOpen:n,isListViewOpen:l,sidebarIsOpened:a,settings:r,entityId:i,templateType:s,page:d,template:p,templateResolved:g,isNavigationOpen:f,previousShortcut:E,nextShortcut:v,editorMode:y,showIconLabels:b,blockEditorMode:w}=(0,c.useSelect)((e=>{const{isInserterOpened:t,isListViewOpened:n,getSettings:l,getEditedPostType:a,getEditedPostId:r,getPage:o,isNavigationOpened:i,getEditorMode:s}=e(Ut),{hasFinishedResolution:c,getEntityRecord:m}=e(u.store),{__unstableGetEditorMode:d}=e(_e.store),p=a(),g=r();return{isInserterOpen:t(),isListViewOpen:n(),sidebarIsOpened:!!e(O).getActiveComplementaryArea(Ut.name),settings:l(),templateType:p,page:o(),template:g?m("postType",p,g):null,templateResolved:!!g&&c("getEntityRecord",["postType",p,g]),entityId:g,isNavigationOpen:i(),previousShortcut:e(Wt.store).getAllShortcutKeyCombinations("core/edit-site/previous-region"),nextShortcut:e(Wt.store).getAllShortcutKeyCombinations("core/edit-site/next-region"),editorMode:s(),showIconLabels:e(k.store).get("core/edit-site","showIconLabels"),blockEditorMode:d()}}),[]),{setPage:x,setIsInserterOpened:S}=(0,c.useDispatch)(Ut),{enableComplementaryArea:C}=(0,c.useDispatch)(O),[T,N]=(0,o.useState)(!1),I=(0,o.useCallback)((()=>N(!0)),[]),M=(0,o.useCallback)((()=>{N(!1)}),[]),P=(0,o.useMemo)((()=>({...null==d?void 0:d.context,queryContext:[(null==d?void 0:d.context.queryContext)||{page:1},e=>x({...d,context:{...null==d?void 0:d.context,queryContext:{...null==d?void 0:d.context.queryContext,...e}}})]})),[null==d?void 0:d.context]);(0,o.useEffect)((()=>{f?document.body.classList.add("is-navigation-sidebar-open"):document.body.classList.remove("is-navigation-sidebar-open")}),[f]),(0,o.useEffect)((function(){"open"===new URLSearchParams(window.location.search).get("styles")&&C("core/edit-site","edit-site/global-styles")}),[C]);const V=(null==r?void 0:r.siteUrl)&&void 0!==s&&void 0!==i,z=l?(0,h.__)("List View"):(0,h.__)("Block Library");return jr(V&&(0,h.__)("Editor (beta)")),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Ar,null),V&&(0,o.createElement)(Wt.ShortcutProvider,null,(0,o.createElement)(u.EntityProvider,{kind:"root",type:"site"},(0,o.createElement)(u.EntityProvider,{kind:"postType",type:s,id:i},(0,o.createElement)(Ia,null,(0,o.createElement)(_e.BlockContextProvider,{value:P},(0,o.createElement)(Wr,null),(0,o.createElement)(Gr,{onError:t},(0,o.createElement)(zr.Register,null),(0,o.createElement)(ja,null),(0,o.createElement)(ee,{labels:{...Yr,secondarySidebar:z},className:b&&"show-icon-labels",secondarySidebar:"visual"===y&&n?(0,o.createElement)(Rr,null):"visual"===y&&l?(0,o.createElement)(Lr,null):null,sidebar:a&&(0,o.createElement)(Q.Slot,{scope:"core/edit-site"}),drawer:(0,o.createElement)(mr.Slot,null),header:(0,o.createElement)(Bn,{openEntitiesSavedStates:I,showIconLabels:b}),notices:(0,o.createElement)(m.EditorSnackbars,null),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)(m.EditorNotices,null),(0,o.createElement)(_e.BlockStyles.Slot,{scope:"core/block-inspector"}),"visual"===y&&p&&(0,o.createElement)(Nr,{setIsInserterOpen:S}),"text"===y&&p&&(0,o.createElement)(Pr,null),g&&!p&&(null==r?void 0:r.siteUrl)&&i&&(0,o.createElement)(_.Notice,{status:"warning",isDismissible:!1},(0,h.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")),(0,o.createElement)(zr,{openEntitiesSavedStates:I})),actions:(0,o.createElement)(o.Fragment,null,T?(0,o.createElement)(m.EntitiesSavedStates,{close:M}):(0,o.createElement)("div",{className:"edit-site-editor__toggle-save-panel"},(0,o.createElement)(_.Button,{variant:"secondary",className:"edit-site-editor__toggle-save-panel-button",onClick:I,"aria-expanded":!1},(0,h.__)("Open save panel")))),footer:"zoom-out"!==w?(0,o.createElement)(_e.BlockBreadcrumb,{rootLabelText:(0,h.__)("Template")}):void 0,shortcuts:{previous:E,next:v}}),(0,o.createElement)(Ur,null),(0,o.createElement)(_.Popover.Slot,null))))))))};var Xr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.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 Kr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.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 Zr=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.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.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z"}));var Qr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.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"}));var Jr=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm.5 12c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v10zm-11-7.6h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-.9 3.5H6.3l1.2-1.7v1.7zm5.6-3.2c-.4-.2-.8-.4-1.2-.4-.5 0-.9.1-1.2.4-.4.2-.6.6-.8 1-.2.4-.3.9-.3 1.5s.1 1.1.3 1.6c.2.4.5.8.8 1 .4.2.8.4 1.2.4.5 0 .9-.1 1.2-.4.4-.2.6-.6.8-1 .2-.4.3-1 .3-1.6 0-.6-.1-1.1-.3-1.5-.1-.5-.4-.8-.8-1zm0 3.6c-.1.3-.3.5-.5.7-.2.1-.4.2-.7.2-.3 0-.5-.1-.7-.2-.2-.1-.4-.4-.5-.7-.1-.3-.2-.7-.2-1.2 0-.7.1-1.2.4-1.5.3-.3.6-.5 1-.5s.7.2 1 .5c.3.3.4.8.4 1.5-.1.5-.1.9-.2 1.2zm5-3.9h-.7l-3.1 4.3h2.8V15h1v-1.3h.7v-.8h-.7V9.4zm-1 3.5H16l1.2-1.7v1.7z"}));var eo=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"}));var to=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.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 no=(0,o.createElement)(f.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(f.Path,{d:"M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z",fillRule:"evenodd",clipRule:"evenodd"}));var lo=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{fillRule:"evenodd",d:"M8.95 11.25H4v1.5h4.95v4.5H13V18c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75h-2.55v-7.5H13V9c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75H8.95v4.5ZM14.5 15v3c0 .3.2.5.5.5h3c.3 0 .5-.2.5-.5v-3c0-.3-.2-.5-.5-.5h-3c-.3 0-.5.2-.5.5Zm0-6V6c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5Z",clipRule:"evenodd"}));var ao=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"}),(0,o.createElement)(f.Path,{d:"M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"}));var ro=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.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"}));const oo=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.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"}));const io=()=>(0,c.useSelect)((e=>e(u.store).getEntityRecords("postType","wp_template",{per_page:-1})),[]),so=()=>(0,c.useSelect)((e=>e(m.store).__experimentalGetDefaultTemplateTypes()),[]),co=()=>{const e=(0,c.useSelect)((e=>e(u.store).getPostTypes({per_page:-1})),[]);return(0,o.useMemo)((()=>{const t=["attachment"];return null==e?void 0:e.filter((e=>{let{viewable:n,slug:l}=e;return n&&!t.includes(l)}))}),[e])};function uo(e){const t=(0,o.useMemo)((()=>null==e?void 0:e.reduce(((e,t)=>{let{labels:n}=t;const l=n.singular_name.toLowerCase();return e[l]=(e[l]||0)+1,e}),{})));return(0,o.useCallback)((e=>{let{labels:n,slug:l}=e;const a=n.singular_name.toLowerCase();return t[a]>1&&a!==l}),[t])}function mo(){const e=co(),t=(0,o.useMemo)((()=>null==e?void 0:e.filter((e=>e.has_archive))),[e]),n=io(),l=uo(t);return(0,o.useMemo)((()=>(null==t?void 0:t.filter((e=>!(n||[]).some((t=>t.slug==="archive-"+e.slug)))).map((e=>{var t;let n;return n=l(e)?(0,h.sprintf)((0,h.__)("Archive: %1$s (%2$s)"),e.labels.singular_name,e.slug):(0,h.sprintf)((0,h.__)("Archive: %s"),e.labels.singular_name),{slug:"archive-"+e.slug,description:(0,h.sprintf)((0,h.__)("Displays an archive with the latests posts of type: %s."),e.labels.singular_name),title:n,icon:null!==(t=e.icon)&&void 0!==t&&t.startsWith("dashicons-")?e.icon.slice(10):Zr,templatePrefix:"archive"}})))||[]),[t,n,l])}const po=e=>{const t=(()=>{const e=(0,c.useSelect)((e=>e(u.store).getTaxonomies({per_page:-1})),[]);return(0,o.useMemo)((()=>null==e?void 0:e.filter((e=>{let{visibility:t}=e;return null==t?void 0:t.publicly_queryable}))),[e])})(),n=io(),l=so(),a=(0,o.useMemo)((()=>null==t?void 0:t.reduce(((e,t)=>{let{slug:n}=t,l=n;return["category","post_tag"].includes(n)||(l=`taxonomy-${l}`),"post_tag"===n&&(l="tag"),e[n]=l,e}),{})),[t]),r=null==t?void 0:t.reduce(((e,t)=>{let{labels:n}=t;const l=n.singular_name.toLowerCase();return e[l]=(e[l]||0)+1,e}),{}),i=vo("taxonomy",a),s=(n||[]).map((e=>{let{slug:t}=e;return t})),m=(t||[]).reduce(((t,n)=>{var o;const{slug:c,labels:u}=n,m=a[c],d=null==l?void 0:l.find((e=>{let{slug:t}=e;return t===m})),p=null==s?void 0:s.includes(m),g=((e,t)=>{if(["category","post_tag"].includes(t))return!1;const n=e.singular_name.toLowerCase();return r[n]>1&&n!==t})(u,c);let _=u.singular_name;g&&(_=(0,h.sprintf)((0,h.__)("%1$s (%2$s)"),u.singular_name,c));const f=d?{...d,templatePrefix:a[c]}:{slug:m,title:_,description:(0,h.sprintf)((0,h.__)("Displays taxonomy: %s."),u.singular_name),icon:lo,templatePrefix:a[c]},E=null==i||null===(o=i[c])||void 0===o?void 0:o.hasEntities;return E&&(f.onClick=t=>{e({type:"taxonomy",slug:c,config:{queryArgs:e=>{let{search:t}=e;return{_fields:"id,name,slug,link",orderBy:t?"name":"count",exclude:i[c].existingEntitiesIds}},getSpecificTemplate:e=>{let t=(0,h.sprintf)((0,h.__)("%1$s: %2$s"),u.singular_name,e.name);const n=(0,h.sprintf)((0,h.__)("Template for %1$s"),t);return g&&(t=(0,h.sprintf)((0,h.__)("%1$s (%2$s)"),t,c)),{title:t,description:n,slug:`${a[c]}-${e.slug}`,templatePrefix:a[c]}}},labels:u,hasGeneralTemplate:p,template:t})}),p&&!E||t.push(f),t}),[]);return(0,o.useMemo)((()=>m.reduce(((e,t)=>{const{slug:n}=t;let l="taxonomiesMenuItems";return["category","tag"].includes(n)&&(l="defaultTaxonomiesMenuItems"),e[l].push(t),e}),{defaultTaxonomiesMenuItems:[],taxonomiesMenuItems:[]})),[m])};const go={user:"author"},_o={user:{who:"authors"}};function ho(e){var t,n;const l=io(),a=so(),r=vo("root",go,_o),i=function(){const e=(0,c.useSelect)((e=>e(u.store).getUsers({who:"authors",per_page:-1})),[]),t=(0,o.useMemo)((()=>(e||[]).reduce(((e,t)=>{let{name:n}=t;return e[n]=(e[n]||0)+1,e}),{})),[e]);return(0,o.useCallback)((e=>t[e]>1),[t])}();let s=null==a?void 0:a.find((e=>{let{slug:t}=e;return"author"===t}));s||(s={description:(0,h.__)("Displays latest posts written by a single author."),slug:"author",title:"Author"});const m=!(null==l||!l.find((e=>{let{slug:t}=e;return"author"===t})));if(null!==(t=r.user)&&void 0!==t&&t.hasEntities&&(s={...s,templatePrefix:"author"},s.onClick=t=>{e({type:"root",slug:"user",config:{queryArgs:e=>{let{search:t}=e;return{_fields:"id,name,slug,link",orderBy:t?"name":"registered_date",exclude:r.user.existingEntitiesIds,who:"authors"}},getSpecificTemplate:e=>({title:i(e.name)?(0,h.sprintf)((0,h.__)("Author: %1$s (%2$s)"),e.name,e.slug):(0,h.sprintf)((0,h.__)("Author: %s"),e.name),description:(0,h.sprintf)((0,h.__)("Template for Author: %s"),e.name),slug:`author-${e.slug}`,templatePrefix:"author"})},labels:{singular_name:(0,h.__)("Author"),search_items:(0,h.__)("Search Authors"),not_found:(0,h.__)("No authors found."),all_items:(0,h.__)("All Authors")},hasGeneralTemplate:m,template:t})}),!m||null!==(n=r.user)&&void 0!==n&&n.hasEntities)return s}const fo=e=>{const t=io();return(0,o.useMemo)((()=>Object.entries(e||{}).reduce(((e,n)=>{let[l,a]=n;const r=(t||[]).reduce(((e,t)=>{const n=`${a}-`;return t.slug.startsWith(n)&&e.push(t.slug.substring(n.length)),e}),[]);return r.length&&(e[l]=r),e}),{})),[e,t])},Eo=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const l=fo(t),a=(0,c.useSelect)((t=>Object.entries(l||{}).reduce(((l,a)=>{let[r,o]=a;const i=t(u.store).getEntityRecords(e,r,{_fields:"id",context:"view",slug:o,...n[r]});return null!=i&&i.length&&(l[r]=i),l}),{})),[l]);return a},vo=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const l=Eo(e,t,n),a=(0,c.useSelect)((a=>Object.keys(t||{}).reduce(((t,r)=>{var o,i;const s=(null==l||null===(o=l[r])||void 0===o?void 0:o.map((e=>{let{id:t}=e;return t})))||[];return t[r]={hasEntities:!(null===(i=a(u.store).getEntityRecords(e,r,{per_page:1,_fields:"id",context:"view",exclude:s,...n[r]}))||void 0===i||!i.length),existingEntitiesIds:s},t}),{})),[t,l]);return a},yo=[];function bo(e){let{suggestion:t,search:n,onSelect:l,entityForSuggestions:a,composite:r}=e;const i="edit-site-custom-template-modal__suggestions_list__list-item";return(0,o.createElement)(_.__unstableCompositeItem,d({role:"option",as:_.Button},r,{className:i,onClick:()=>l(a.config.getSpecificTemplate(t))}),(0,o.createElement)("span",{className:`${i}__title`},(0,o.createElement)(_.TextHighlight,{text:t.name,highlight:n})),t.link&&(0,o.createElement)("span",{className:`${i}__info`},t.link))}function wo(e,t){const{config:n}=e,l=(0,o.useMemo)((()=>({order:"asc",context:"view",search:t,per_page:t?20:10,...n.queryArgs(t)})),[t,n]),{records:a,hasResolved:r}=(0,u.useEntityRecords)(e.type,e.slug,l),[i,s]=(0,o.useState)(yo);return(0,o.useEffect)((()=>{if(!r)return;let e=yo;var t,l;null!=a&&a.length&&(e=a,n.recordNamePath&&(t=e,l=n.recordNamePath,e=(t||[]).map((e=>({...e,name:(0,Ya.decodeEntities)((0,Et.get)(e,l))}))))),s(e)}),[a,r]),i}function xo(e){let{entityForSuggestions:t,onSelect:n}=e;const l=(0,_.__unstableUseCompositeState)({orientation:"vertical"}),[a,r,i]=function(){const[e,t]=(0,o.useState)(""),[n,l]=(0,o.useState)(""),a=(0,J.useDebounce)(l,250);return(0,o.useEffect)((()=>{n!==e&&a(e)}),[n,e]),[e,t,n]}(),s=wo(t,i),{labels:c}=t,[u,m]=(0,o.useState)(!1);return!u&&(null==s?void 0:s.length)>9&&m(!0),(0,o.createElement)(o.Fragment,null,u&&(0,o.createElement)(_.SearchControl,{onChange:r,value:a,label:c.search_items,placeholder:c.search_items}),!(null==s||!s.length)&&(0,o.createElement)(_.__unstableComposite,d({},l,{role:"listbox",className:"edit-site-custom-template-modal__suggestions_list","aria-label":(0,h.__)("Suggestions list")}),s.map((e=>(0,o.createElement)(bo,{key:e.slug,suggestion:e,search:i,onSelect:n,entityForSuggestions:t,composite:l})))),i&&!(null!=s&&s.length)&&(0,o.createElement)("p",{className:"edit-site-custom-template-modal__no-results"},c.not_found))}var So=function(e){let{onClose:t,onSelect:n,entityForSuggestions:l}=e;const[a,r]=(0,o.useState)(l.hasGeneralTemplate),i="edit-site-custom-template-modal";return(0,o.createElement)(_.Modal,{title:(0,h.sprintf)((0,h.__)("Add template: %s"),l.labels.singular_name),className:i,closeLabel:(0,h.__)("Close"),onRequestClose:t},!a&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("p",null,(0,h.__)("Select whether to create a single template for all items or a specific one.")),(0,o.createElement)(_.Flex,{className:`${i}__contents`,gap:"4",align:"initial"},(0,o.createElement)(_.FlexItem,{isBlock:!0,as:_.Button,onClick:()=>{const{slug:e,title:t,description:a,templatePrefix:r}=l.template;n({slug:e,title:t,description:a,templatePrefix:r})}},(0,o.createElement)(_.__experimentalText,{as:"span",weight:600},l.labels.all_items),(0,o.createElement)(_.__experimentalText,{as:"span"},(0,h.__)("For all items"))),(0,o.createElement)(_.FlexItem,{isBlock:!0,as:_.Button,onClick:()=>{r(!0)}},(0,o.createElement)(_.__experimentalText,{as:"span",weight:600},l.labels.singular_name),(0,o.createElement)(_.__experimentalText,{as:"span"},(0,h.__)("For a specific item"))))),a&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("p",null,(0,h.__)("This template will be used only for the specific item chosen.")),(0,o.createElement)(xo,{entityForSuggestions:l,onSelect:n})))};var ko=function(e){let{onClose:t,createTemplate:n}=e;const[l,a]=(0,o.useState)(""),r=(0,h.__)("Custom Template"),[i,s]=(0,o.useState)(!1);return(0,o.createElement)(_.Modal,{title:(0,h.__)("Create custom template"),closeLabel:(0,h.__)("Close"),onRequestClose:()=>{t()},overlayClassName:"edit-site-custom-generic-template__modal"},(0,o.createElement)("form",{onSubmit:async function(e){e.preventDefault(),i||(s(!0),n({slug:"wp-custom-template-"+(0,Et.kebabCase)(l||r),title:l||r},!1))}},(0,o.createElement)(_.Flex,{align:"flex-start",gap:8},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.TextControl,{label:(0,h.__)("Name"),value:l,onChange:a,placeholder:r,disabled:i,help:(0,h.__)('Describe the template, e.g. "Post with sidebar".')}))),(0,o.createElement)(_.Flex,{className:"edit-site-custom-generic-template__modal-actions",justify:"flex-end",expanded:!1},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"tertiary",onClick:()=>{t()}},(0,h.__)("Cancel"))),(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"primary",type:"submit",isBusy:i,"aria-disabled":i},(0,h.__)("Create"))))))};const Co=["front-page","single","page","index","archive","author","category","date","tag","taxonomy","search","404"],To={"front-page":qa,single:Xr,page:Kr,archive:Zr,search:Qr,404:Jr,index:eo,category:to,author:no,taxonomy:lo,date:ao,tag:ro,attachment:oo};function No(e){let{postType:t}=e;const[n,l]=(0,o.useState)(!1),[a,r]=(0,o.useState)(!1),[i,s]=(0,o.useState)({}),m=Pe(),{saveEntityRecord:d}=(0,c.useDispatch)(u.store),{createErrorNotice:p,createSuccessNotice:g}=(0,c.useDispatch)(Ze.store),{setTemplate:f}=(0,c.useDispatch)(Ut);async function E(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{const{title:n,description:l,slug:a,templatePrefix:r}=e;let o=e.content;if(!o){o=(await Ke()({path:(0,me.addQueryArgs)("/wp/v2/templates/lookup",{slug:a,is_custom:!t,template_prefix:r})})).content}const i=await d("postType","wp_template",{description:l,slug:a.toString(),status:"publish",title:n,content:o,is_wp_suggestion:t},{throwOnError:!0});f(i.id,i.slug),m.push({postId:i.id,postType:i.type}),g((0,h.sprintf)((0,h.__)('"%s" successfully created.'),n),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("An error occurred while creating the template.");p(t,{type:"snackbar"})}}const v=function(e,t){const n=io(),l=so(),a=(n||[]).map((e=>{let{slug:t}=e;return t})),r=(l||[]).filter((e=>Co.includes(e.slug)&&!a.includes(e.slug))),i=n=>{t(!0),e(n)},s=[...r],{defaultTaxonomiesMenuItems:c,taxonomiesMenuItems:u}=po(i),{defaultPostTypesMenuItems:m,postTypesMenuItems:d}=(e=>{const t=co(),n=io(),l=so(),a=uo(t),r=(0,o.useMemo)((()=>null==t?void 0:t.reduce(((e,t)=>{let{slug:n}=t,l=n;return"page"!==n&&(l=`single-${l}`),e[n]=l,e}),{})),[t]),i=vo("postType",r),s=(n||[]).map((e=>{let{slug:t}=e;return t})),c=(t||[]).reduce(((t,n)=>{var o;const{slug:c,labels:u,icon:m}=n,d=r[c],p=null==l?void 0:l.find((e=>{let{slug:t}=e;return t===d})),g=null==s?void 0:s.includes(d),_=a(n);let f=(0,h.sprintf)((0,h.__)("Single item: %s"),u.singular_name);_&&(f=(0,h.sprintf)((0,h.__)("Single item: %1$s (%2$s)"),u.singular_name,c));const E=p?{...p,templatePrefix:r[c]}:{slug:d,title:f,description:(0,h.sprintf)((0,h.__)("Displays a single item: %s."),u.singular_name),icon:null!=m&&m.startsWith("dashicons-")?m.slice(10):Xr,templatePrefix:r[c]},v=null==i||null===(o=i[c])||void 0===o?void 0:o.hasEntities;return v&&(E.onClick=t=>{e({type:"postType",slug:c,config:{recordNamePath:"title.rendered",queryArgs:e=>{let{search:t}=e;return{_fields:"id,title,slug,link",orderBy:t?"relevance":"modified",exclude:i[c].existingEntitiesIds}},getSpecificTemplate:e=>{let t=(0,h.sprintf)((0,h.__)("%1$s: %2$s"),u.singular_name,e.name);const n=(0,h.sprintf)((0,h.__)("Template for %1$s"),t);return _&&(t=(0,h.sprintf)((0,h.__)("%1$s (%2$s)"),t,c)),{title:t,description:n,slug:`${r[c]}-${e.slug}`,templatePrefix:r[c]}}},labels:u,hasGeneralTemplate:g,template:t})}),g&&!v||t.push(E),t}),[]);return(0,o.useMemo)((()=>c.reduce(((e,t)=>{const{slug:n}=t;let l="postTypesMenuItems";return"page"===n&&(l="defaultPostTypesMenuItems"),e[l].push(t),e}),{defaultPostTypesMenuItems:[],postTypesMenuItems:[]})),[c])})(i),p=ho(i);[...c,...m,p].forEach((e=>{if(!e)return;const t=s.findIndex((t=>t.slug===e.slug));t>-1?s[t]=e:s.push(e)})),null==s||s.sort(((e,t)=>Co.indexOf(e.slug)-Co.indexOf(t.slug)));return[...s,...mo(),...d,...u]}(s,l);return v.length?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.DropdownMenu,{className:"edit-site-new-template-dropdown",icon:null,text:t.labels.add_new,label:t.labels.add_new_item,popoverProps:{noArrow:!1},toggleProps:{variant:"primary"}},(()=>(0,o.createElement)(_.NavigableMenu,{className:"edit-site-new-template-dropdown__popover"},(0,o.createElement)(_.MenuGroup,{label:t.labels.add_new_item},v.map((e=>{const{title:t,description:n,slug:l,onClick:a,icon:r}=e;return(0,o.createElement)(_.MenuItem,{icon:r||To[l]||Xr,iconPosition:"left",info:n,key:l,onClick:()=>a?a(e):E(e)},t)}))),(0,o.createElement)(_.MenuGroup,null,(0,o.createElement)(_.MenuItem,{icon:Un,iconPosition:"left",info:(0,h.__)("Custom templates can be applied to any post or page."),key:"custom-template",onClick:()=>r(!0)},(0,h.__)("Custom template")))))),n&&(0,o.createElement)(So,{onClose:()=>l(!1),onSelect:E,entityForSuggestions:i}),a&&(0,o.createElement)(ko,{onClose:()=>r(!1),createTemplate:E})):null}function Io(e){let{postType:t}=e;const n=Pe(),[l,a]=(0,o.useState)(!1),{createErrorNotice:r}=(0,c.useDispatch)(Ze.store),{saveEntityRecord:i}=(0,c.useDispatch)(u.store);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.Button,{variant:"primary",onClick:()=>{a(!0)}},t.labels.add_new),l&&(0,o.createElement)(gr,{closeModal:()=>a(!1),onCreate:async function(e){let{title:t,area:l}=e;if(t)try{const e=(0,Et.kebabCase)(t).replace(/[^\w-]+/g,"")||"wp-custom-part",r=await i("postType","wp_template_part",{slug:e,title:t,content:"",area:l},{throwOnError:!0});a(!1),n.push({postId:r.id,postType:r.type})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("An error occurred while creating the template part.");r(t,{type:"snackbar"}),a(!1)}else r((0,h.__)("Title is not defined."),{type:"snackbar"})}}))}function Mo(e){let{templateType:t="wp_template"}=e;const n=(0,c.useSelect)((e=>e(u.store).getPostType(t)),[t]);return n?"wp_template"===t?(0,o.createElement)(No,{postType:n}):"wp_template_part"===t?(0,o.createElement)(Io,{postType:n}):null:null}function Po(e){var t;let{templateType:n}=e;const{canCreate:l,postType:a}=(0,c.useSelect)((e=>{const{supportsTemplatePartsMode:t}=e(Ut).getSettings();return{postType:e(u.store).getPostType(n),canCreate:!t}}),[n]);return a?(0,o.createElement)("header",{className:"edit-site-list-header"},(0,o.createElement)(_.__experimentalHeading,{level:1,className:"edit-site-list-header__title"},null===(t=a.labels)||void 0===t?void 0:t.name),l&&(0,o.createElement)("div",{className:"edit-site-list-header__right"},(0,o.createElement)(Mo,{templateType:n}))):null}function Vo(e){let{template:t,onClose:n}=e;const[l,a]=(0,o.useState)((()=>t.title.rendered)),[r,i]=(0,o.useState)(!1),{editEntityRecord:s,saveEditedEntityRecord:m}=(0,c.useDispatch)(u.store),{createSuccessNotice:d,createErrorNotice:p}=(0,c.useDispatch)(Ze.store);if(!t.is_custom)return null;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_.MenuItem,{onClick:()=>{i(!0),a(t.title.rendered)}},(0,h.__)("Rename")),r&&(0,o.createElement)(_.Modal,{title:(0,h.__)("Rename"),closeLabel:(0,h.__)("Close"),onRequestClose:()=>{i(!1)},overlayClassName:"edit-site-list__rename-modal"},(0,o.createElement)("form",{onSubmit:async function(e){e.preventDefault();try{await s("postType",t.type,t.id,{title:l}),a(""),i(!1),n(),await m("postType",t.type,t.id,{throwOnError:!0}),d((0,h.__)("Entity renamed."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("An error occurred while renaming the entity.");p(t,{type:"snackbar"})}}},(0,o.createElement)(_.Flex,{align:"flex-start",gap:8},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.TextControl,{label:(0,h.__)("Name"),value:l,onChange:a,required:!0}))),(0,o.createElement)(_.Flex,{className:"edit-site-list__rename-modal-actions",justify:"flex-end",expanded:!1},(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"tertiary",onClick:()=>{i(!1)}},(0,h.__)("Cancel"))),(0,o.createElement)(_.FlexItem,null,(0,o.createElement)(_.Button,{variant:"primary",type:"submit"},(0,h.__)("Save")))))))}function zo(e){let{template:t}=e;const{removeTemplate:n,revertTemplate:l}=(0,c.useDispatch)(Ut),{saveEditedEntityRecord:a}=(0,c.useDispatch)(u.store),{createSuccessNotice:r,createErrorNotice:i}=(0,c.useDispatch)(Ze.store),s=function(e){return!!e&&"custom"===e.source&&!e.has_theme_file}(t),m=Je(t);if(!s&&!m)return null;return(0,o.createElement)(_.DropdownMenu,{icon:te,label:(0,h.__)("Actions"),className:"edit-site-list-table__actions"},(e=>{let{onClose:c}=e;return(0,o.createElement)(_.MenuGroup,null,s&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Vo,{template:t,onClose:c}),(0,o.createElement)(_.MenuItem,{isDestructive:!0,isTertiary:!0,onClick:()=>{n(t),c()}},(0,h.__)("Delete"))),m&&(0,o.createElement)(_.MenuItem,{info:(0,h.__)("Use the template as supplied by the theme."),onClick:()=>{!async function(){try{await l(t,{allowUndo:!1}),await a("postType",t.type,t.id),r((0,h.__)("Entity reverted."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,h.__)("An error occurred while reverting the entity.");i(t,{type:"snackbar"})}}(),c()}},(0,h.__)("Clear customizations")))}))}var Ao=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"}));var Bo=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"}));var Ro=(0,o.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(f.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 Lo=["wp_template","wp_template_part"];function Oo(e){let{isCustomized:t,children:n}=e;return t?(0,o.createElement)(_.Tooltip,{text:(0,h.__)("This template has been customized")},n):n}function Do(e){let{text:t,icon:n,imageUrl:l,isCustomized:a}=e;const[r,i]=(0,o.useState)(!1);return(0,o.createElement)(_.__experimentalHStack,{alignment:"left"},(0,o.createElement)(Oo,{isCustomized:a},l?(0,o.createElement)("div",{className:g()("edit-site-list-added-by__avatar",{"is-loaded":r})},(0,o.createElement)("img",{onLoad:()=>i(!0),alt:"",src:l})):(0,o.createElement)("div",{className:g()("edit-site-list-added-by__icon",{"is-customized":a})},(0,o.createElement)(_.Icon,{icon:n}))),(0,o.createElement)("span",null,t))}function Go(e){var t;let{slug:n,isCustomized:l}=e;const a=(0,c.useSelect)((e=>e(u.store).getTheme(n)),[n]);return(0,o.createElement)(Do,{icon:Un,text:(null==a||null===(t=a.name)||void 0===t?void 0:t.rendered)||n,isCustomized:l})}function Fo(e){let{slug:t,isCustomized:n}=e;const l=(0,c.useSelect)((e=>e(u.store).getPlugin(t)),[t]);return(0,o.createElement)(Do,{icon:Ao,text:(null==l?void 0:l.name)||t,isCustomized:n})}function Ho(e){var t;let{id:n}=e;const l=(0,c.useSelect)((e=>e(u.store).getUser(n)),[n]);return(0,o.createElement)(Do,{icon:Bo,imageUrl:null==l||null===(t=l.avatar_urls)||void 0===t?void 0:t[48],text:null==l?void 0:l.nickname})}function $o(){const{name:e,logoURL:t}=(0,c.useSelect)((e=>{var t;const{getEntityRecord:n,getMedia:l}=e(u.store),a=n("root","__unstableBase");return{name:null==a?void 0:a.name,logoURL:null!=a&&a.site_logo?null===(t=l(a.site_logo))||void 0===t?void 0:t.source_url:void 0}}),[]);return(0,o.createElement)(Do,{icon:Ro,imageUrl:t,text:e})}function Uo(e){let{templateType:t,template:n}=e;if(n){if(Lo.includes(t)){if(n.has_theme_file&&("theme"===n.origin||!n.origin&&["theme","custom"].includes(n.source)))return(0,o.createElement)(Go,{slug:n.theme,isCustomized:"custom"===n.source});if(n.has_theme_file&&"plugin"===n.origin)return(0,o.createElement)(Fo,{slug:n.theme,isCustomized:"custom"===n.source});if(!n.has_theme_file&&"custom"===n.source&&!n.author)return(0,o.createElement)($o,null)}return(0,o.createElement)(Ho,{id:n.author})}}function Wo(e){let{templateType:t}=e;const{records:n,isResolving:l}=(0,u.useEntityRecords)("postType",t,{per_page:-1}),a=(0,c.useSelect)((e=>e(u.store).getPostType(t)),[t]);return!n||l?null:n.length?(0,o.createElement)("table",{className:"edit-site-list-table",role:"table"},(0,o.createElement)("thead",null,(0,o.createElement)("tr",{className:"edit-site-list-table-head",role:"row"},(0,o.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,h.__)("Template")),(0,o.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,h.__)("Added by")),(0,o.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,o.createElement)(_.VisuallyHidden,null,(0,h.__)("Actions"))))),(0,o.createElement)("tbody",null,n.map((e=>{var n;return(0,o.createElement)("tr",{key:e.id,className:"edit-site-list-table-row",role:"row"},(0,o.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,o.createElement)(_.__experimentalHeading,{level:4},(0,o.createElement)(Be,{params:{postId:e.id,postType:e.type}},(0,Ya.decodeEntities)((null===(n=e.title)||void 0===n?void 0:n.rendered)||e.slug))),e.description),(0,o.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,o.createElement)(Uo,{templateType:t,template:e})),(0,o.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,o.createElement)(zo,{template:e})))})))):(0,o.createElement)("div",null,(0,h.sprintf)((0,h.__)("No %s found."),null==a||null===(r=a.labels)||void 0===r||null===(i=r.name)||void 0===i?void 0:i.toLowerCase()));var r,i}function jo(){var e,t;const{params:{postType:n}}=Me();!function(){const{registerShortcut:e}=(0,c.useDispatch)(Wt.store);(0,o.useEffect)((()=>{e({name:"core/edit-site/next-region",category:"global",description:(0,h.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-site/previous-region",category:"global",description:(0,h.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"}]})}),[])}();const{previousShortcut:l,nextShortcut:a,isNavigationOpen:r}=(0,c.useSelect)((e=>({previousShortcut:e(Wt.store).getAllShortcutKeyCombinations("core/edit-site/previous-region"),nextShortcut:e(Wt.store).getAllShortcutKeyCombinations("core/edit-site/next-region"),isNavigationOpen:e(Ut).isNavigationOpened()})),[]),i=(0,c.useSelect)((e=>e(u.store).getPostType(n)),[n]);jr(null==i||null===(e=i.labels)||void 0===e?void 0:e.name);const s=null==i||null===(t=i.labels)||void 0===t?void 0:t.items_list,d=i?{header:(0,h.sprintf)((0,h.__)("%s - Header"),s),body:(0,h.sprintf)((0,h.__)("%s - Content"),s)}:void 0;return(0,o.createElement)(ee,{className:g()("edit-site-list",{"is-navigation-open":r}),labels:{drawer:(0,h.__)("Navigation Sidebar"),...d},header:(0,o.createElement)(Po,{templateType:n}),drawer:(0,o.createElement)(mr.Slot,null),notices:(0,o.createElement)(m.EditorSnackbars,null),content:(0,o.createElement)(Wo,{templateType:n}),shortcuts:{previous:l,next:a}})}function Yo(e){let{postId:t,postType:n}=e;return!(t||!n)}function qo(e){let{reboot:t}=e;const{createErrorNotice:n}=(0,c.useDispatch)(Ze.store);function l(e){n((0,h.sprintf)((0,h.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}return(0,o.createElement)(_.SlotFillProvider,null,(0,o.createElement)(m.UnsavedChangesWarning,null),(0,o.createElement)(ze,null,(e=>{let{params:n}=e;const a=Yo(n);return(0,o.createElement)(o.Fragment,null,a?(0,o.createElement)(jo,null):(0,o.createElement)(qr,{onError:t}),(0,o.createElement)(D.PluginArea,{onError:l}),(0,o.createElement)(mr,{isDefaultOpen:!!a,activeTemplateType:a?n.postType:void 0}))})))}function Xo(e){let{className:t,...n}=e;const l=(0,c.useSelect)((e=>e(Ut).getSettings().showIconLabels),[]);return(0,o.createElement)(Q,d({panelClassName:t,className:"edit-site-sidebar",scope:"core/edit-site",showIconLabels:l},n))}function Ko(e){return(0,o.createElement)(Y,d({__unstableExplicitMenuItem:!0,scope:"core/edit-site"},e))}var Zo=(0,J.compose)((0,D.withPluginContext)(((e,t)=>{var n;return{as:null!==(n=t.as)&&void 0!==n?n:_.MenuItem,icon:t.icon||e.icon,name:"core/edit-site/plugin-more-menu"}})))(W);function Qo(e,t){if(!t.__unstableHomeTemplate)return void(0,o.render)((0,o.createElement)(Dr,{message:(0,h.__)("The editor is unable to find a block template for the homepage."),dashboardLink:"index.php"}),e);(0,o.unmountComponentAtNode)(e);const n=Qo.bind(null,e,t);(0,c.dispatch)(k.store).setDefaults("core/edit-site",{editorMode:"visual",fixedToolbar:!1,focusMode:!1,keepCaretInsideBlock:!1,welcomeGuide:!0,welcomeGuideStyles:!0,showListViewByDefault:!1}),(0,c.select)(k.store).get("core/edit-site","showListViewByDefault")&&(0,c.dispatch)(Ut).setIsListViewOpened(!0),(0,c.dispatch)(O).setDefaultComplementaryArea("core/edit-site","edit-site/template"),(0,c.dispatch)(Ut).updateSettings(t),(0,c.dispatch)(m.store).updateEditorSettings({defaultTemplateTypes:t.defaultTemplateTypes,defaultTemplatePartAreas:t.defaultTemplatePartAreas});Yo((0,me.getQueryArgs)(window.location.href))&&(0,c.dispatch)(Ut).setIsNavigationPanelOpened((0,c.select)(b.store).isViewportMatch("medium"));window.addEventListener("dragover",(e=>e.preventDefault()),!1),window.addEventListener("drop",(e=>e.preventDefault()),!1),(0,o.render)((0,o.createElement)(qo,{reboot:n}),e)}function Jo(e,t){t.__experimentalFetchLinkSuggestions=(e,n)=>(0,u.__experimentalFetchLinkSuggestions)(e,n,t),t.__experimentalFetchRichUrlData=u.__experimentalFetchUrlData;const n=document.getElementById(e);(0,c.dispatch)(i.store).__experimentalReapplyBlockTypeFilters(),(0,s.registerCoreBlocks)(),Qo(n,t)}}(),(window.wp=window.wp||{}).editSite=l}(); |