/*! This file is auto-generated */ !function(){var e={6411:function(e,t){var n,a,r; /*! autosize 4.0.4 license: MIT http://www.jacklmoore.com/autosize */a=[e,t],n=function(e,t){"use strict";var n,a,r="function"==typeof Map?new Map:(n=[],a=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return a[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),a.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),a.splice(t,1))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function o(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,a=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]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",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",r.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 a=u(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,a.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function d(){m();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r2096103.424&&p!==d))return navigator.msSaveBlob?navigator.msSaveBlob(E(c),_):y(c);s=(c=E(c)).type||i}else if(/([\x80-\xff])/.test(c)){for(var g=0,v=new Uint8Array(c.length),f=v.length;g({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),M=(e,t)=>n=>{let{registry:a,dispatch:r}=n;if(!t)return;a.select(T.store).get(e,"isComplementaryAreaVisible")||a.dispatch(T.store).set(e,"isComplementaryAreaVisible",!0),r({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},I=e=>t=>{let{registry:n}=t;n.select(T.store).get(e,"isComplementaryAreaVisible")&&n.dispatch(T.store).set(e,"isComplementaryAreaVisible",!1)},P=(e,t)=>n=>{let{registry:a}=n;if(!t)return;const r=a.select(T.store).get(e,"pinnedItems");!0!==(null==r?void 0:r[t])&&a.dispatch(T.store).set(e,"pinnedItems",{...r,[t]:!0})},B=(e,t)=>n=>{let{registry:a}=n;if(!t)return;const r=a.select(T.store).get(e,"pinnedItems");a.dispatch(T.store).set(e,"pinnedItems",{...r,[t]:!1})};function z(e,t){return function(n){let{registry:a}=n;p()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),a.dispatch(T.store).toggle(e,t)}}function V(e,t,n){return function(a){let{registry:r}=a;p()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),r.dispatch(T.store).set(e,t,!!n)}}function R(e,t){return function(n){let{registry:a}=n;p()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),a.dispatch(T.store).setDefaults(e,t)}}const A=(0,m.createRegistrySelector)((e=>(t,n)=>{var a;const r=e(T.store).get(n,"isComplementaryAreaVisible");if(void 0!==r)return r?null==t||null===(a=t.complementaryAreas)||void 0===a?void 0:a[n]:null})),L=(0,m.createRegistrySelector)((e=>(t,n,a)=>{var r;const l=e(T.store).get(n,"pinnedItems");return null===(r=null==l?void 0:l[a])||void 0===r||r})),D=(0,m.createRegistrySelector)((e=>(t,n,a)=>(p()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(T.store).get(n,a))));var G=(0,m.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:a}=t;return e[n]?e:{...e,[n]:a}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:a}=t;return{...e,[n]:a}}}return e}});const F=(0,m.createReduxStore)("core/interface",{reducer:G,actions:e,selectors:t});(0,m.register)(F);var O=window.wp.plugins,H=(0,O.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));var $=H((function(e){let{as:t=E.Button,scope:n,identifier:a,icon:r,selectedIcon:l,name:o,...i}=e;const c=t,u=(0,m.useSelect)((e=>e(F).getActiveComplementaryArea(n)===a),[a]),{enableComplementaryArea:d,disableComplementaryArea:p}=(0,m.useDispatch)(F);return(0,s.createElement)(c,g({icon:l&&u?l:r,onClick:()=>{u?p(n):d(n,a)}},i))}));var U=e=>{let{smallScreenTitle:t,children:n,className:a,toggleButtonProps:r}=e;const l=(0,s.createElement)($,g({icon:C},r));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},t&&(0,s.createElement)("span",{className:"interface-complementary-area-header__small-title"},t),l),(0,s.createElement)("div",{className:f()("components-panel__header","interface-complementary-area-header",a),tabIndex:-1},n,l))};const W=()=>{};function j(e){let{name:t,as:n=E.Button,onClick:a,...r}=e;return(0,s.createElement)(E.Fill,{name:t},(e=>{let{onClick:t}=e;return(0,s.createElement)(n,g({onClick:a||t?function(){(a||W)(...arguments),(t||W)(...arguments)}:void 0},r))}))}j.Slot=function(e){let{name:t,as:n=E.ButtonGroup,fillProps:a={},bubblesVirtually:r,...l}=e;return(0,s.createElement)(E.Slot,{name:t,bubblesVirtually:r,fillProps:a},(e=>{if(!s.Children.toArray(e).length)return null;const t=[];s.Children.forEach(e,(e=>{let{props:{__unstableExplicitMenuItem:n,__unstableTarget:a}}=e;a&&n&&t.push(a)}));const a=s.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&t.includes(e.props.__unstableTarget)?null:e));return(0,s.createElement)(n,l,a)}))};var q=j;const Y=e=>{let{__unstableExplicitMenuItem:t,__unstableTarget:n,...a}=e;return(0,s.createElement)(E.MenuItem,a)};function X(e){let{scope:t,target:n,__unstableExplicitMenuItem:a,...r}=e;return(0,s.createElement)($,g({as:e=>(0,s.createElement)(q,g({__unstableExplicitMenuItem:a,__unstableTarget:`${t}/${n}`,as:Y,name:`${t}/plugin-more-menu`},e)),role:"menuitemcheckbox",selectedIcon:w,name:n,scope:t},r))}function Z(e){let{scope:t,...n}=e;return(0,s.createElement)(E.Fill,g({name:`PinnedItems/${t}`},n))}Z.Slot=function(e){let{scope:t,className:n,...a}=e;return(0,s.createElement)(E.Slot,g({name:`PinnedItems/${t}`},a),(e=>(null==e?void 0:e.length)>0&&(0,s.createElement)("div",{className:f()(n,"interface-pinned-items")},e)))};var K=Z;function Q(e){let{scope:t,children:n,className:a}=e;return(0,s.createElement)(E.Fill,{name:`ComplementaryArea/${t}`},(0,s.createElement)("div",{className:a},n))}const J=H((function(e){let{children:t,className:n,closeLabel:a=(0,y.__)("Close plugin"),identifier:r,header:l,headerClassName:o,icon:i,isPinnable:c=!0,panelClassName:u,scope:d,name:p,smallScreenTitle:_,title:h,toggleShortcut:g,isActiveByDefault:v,showIconLabels:b=!1}=e;const{isActive:C,isPinned:T,activeArea:N,isSmall:M,isLarge:I}=(0,m.useSelect)((e=>{const{getActiveComplementaryArea:t,isItemPinned:n}=e(F),a=t(d);return{isActive:a===r,isPinned:n(d,r),activeArea:a,isSmall:e(k.store).isViewportMatch("< medium"),isLarge:e(k.store).isViewportMatch("large")}}),[r,d]);!function(e,t,n,a,r){const l=(0,s.useRef)(!1),o=(0,s.useRef)(!1),{enableComplementaryArea:i,disableComplementaryArea:c}=(0,m.useDispatch)(F);(0,s.useEffect)((()=>{a&&r&&!l.current?(c(e),o.current=!0):o.current&&!r&&l.current?(o.current=!1,i(e,t)):o.current&&n&&n!==t&&(o.current=!1),r!==l.current&&(l.current=r)}),[a,r,e,t,n])}(d,r,N,C,M);const{enableComplementaryArea:P,disableComplementaryArea:B,pinItem:z,unpinItem:V}=(0,m.useDispatch)(F);return(0,s.useEffect)((()=>{v&&void 0===N&&!M&&P(d,r)}),[N,v,d,r,M]),(0,s.createElement)(s.Fragment,null,c&&(0,s.createElement)(K,{scope:d},T&&(0,s.createElement)($,{scope:d,identifier:r,isPressed:C&&(!b||I),"aria-expanded":C,label:h,icon:b?w:i,showTooltip:!b,variant:b?"tertiary":void 0})),p&&c&&(0,s.createElement)(X,{target:p,scope:d,icon:i},h),C&&(0,s.createElement)(Q,{className:f()("interface-complementary-area",n),scope:d},(0,s.createElement)(U,{className:o,closeLabel:a,onClose:()=>B(d),smallScreenTitle:_,toggleButtonProps:{label:a,shortcut:g,scope:d,identifier:r}},l||(0,s.createElement)(s.Fragment,null,(0,s.createElement)("strong",null,h),c&&(0,s.createElement)(E.Button,{className:"interface-complementary-area__pin-unpin-item",icon:T?S:x,label:T?(0,y.__)("Unpin from toolbar"):(0,y.__)("Pin to toolbar"),onClick:()=>(T?V:z)(d,r),isPressed:T,"aria-expanded":T}))),(0,s.createElement)(E.Panel,{className:u},t)))}));J.Slot=function(e){let{scope:t,...n}=e;return(0,s.createElement)(E.Slot,g({name:`ComplementaryArea/${t}`},n))};var ee=J,te=window.wp.compose;function ne(e){let{children:t,className:n,ariaLabel:a,as:r="div",...l}=e;return(0,s.createElement)(r,g({className:f()("interface-navigable-region",n),"aria-label":a,role:"region",tabIndex:"-1"},l),t)}var ae=(0,s.forwardRef)((function(e,t){let{isDistractionFree:n,footer:a,header:r,editorNotices:l,sidebar:o,secondarySidebar:i,notices:c,content:u,actions:m,labels:d,className:p,enableRegionNavigation:_=!0,shortcuts:h}=e;const v=(0,E.__unstableUseNavigateRegions)(h);!function(e){(0,s.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 b={...{header:(0,y.__)("Header"),body:(0,y.__)("Content"),secondarySidebar:(0,y.__)("Block Library"),sidebar:(0,y.__)("Settings"),actions:(0,y.__)("Publish"),footer:(0,y.__)("Footer")},...d},w={hidden:n?{opacity:0}:{opacity:1},hover:{opacity:1,transition:{type:"tween",delay:.2,delayChildren:.2}}};return(0,s.createElement)("div",g({},_?v:{},{ref:(0,te.useMergeRefs)([t,_?v.ref:void 0]),className:f()(p,"interface-interface-skeleton",v.className,!!a&&"has-footer")}),(0,s.createElement)("div",{className:"interface-interface-skeleton__editor"},!!r&&n&&(0,s.createElement)(ne,{as:E.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":b.header,initial:n?"hidden":"hover",whileHover:"hover",variants:w,transition:{type:"tween",delay:.8}},r),!!r&&!n&&(0,s.createElement)(ne,{className:"interface-interface-skeleton__header",ariaLabel:b.header},r),n&&(0,s.createElement)("div",{className:"interface-interface-skeleton__header"},l),(0,s.createElement)("div",{className:"interface-interface-skeleton__body"},!!i&&(0,s.createElement)(ne,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:b.secondarySidebar},i),!!c&&(0,s.createElement)("div",{className:"interface-interface-skeleton__notices"},c),(0,s.createElement)(ne,{className:"interface-interface-skeleton__content",ariaLabel:b.body},u),!!o&&(0,s.createElement)(ne,{className:"interface-interface-skeleton__sidebar",ariaLabel:b.sidebar},o),!!m&&(0,s.createElement)(ne,{className:"interface-interface-skeleton__actions",ariaLabel:b.actions},m))),!!a&&(0,s.createElement)(ne,{className:"interface-interface-skeleton__footer",ariaLabel:b.footer},a))}));var re=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function le(e){let{as:t=E.DropdownMenu,className:n,label:a=(0,y.__)("Options"),popoverProps:r,toggleProps:l,children:o}=e;return(0,s.createElement)(t,{className:f()("interface-more-menu-dropdown",n),icon:re,label:a,popoverProps:{placement:"bottom-end",...r,className:f()("interface-more-menu-dropdown__content",null==r?void 0:r.className)},toggleProps:{tooltipPosition:"bottom",...l}},(e=>o(e)))}function oe(e){let{closeModal:t,children:n}=e;return(0,s.createElement)(E.Modal,{className:"interface-preferences-modal",title:(0,y.__)("Preferences"),onRequestClose:t},n)}var ie=function(e){let{icon:t,size:n=24,...a}=e;return(0,s.cloneElement)(t,{width:n,height:n,...a})};var se=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var ce=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));const ue="preferences-menu";function me(e){let{sections:t}=e;const n=(0,te.useViewportMatch)("medium"),[a,r]=(0,s.useState)(ue),{tabs:l,sectionsContentMap:o}=(0,s.useMemo)((()=>{let e={tabs:[],sectionsContentMap:{}};return t.length&&(e=t.reduce(((e,t)=>{let{name:n,tabLabel:a,content:r}=t;return e.tabs.push({name:n,title:a}),e.sectionsContentMap[n]=r,e}),{tabs:[],sectionsContentMap:{}})),e}),[t]),i=(0,s.useCallback)((e=>o[e.name]||null),[o]);let c;return c=n?(0,s.createElement)(E.TabPanel,{className:"interface-preferences__tabs",tabs:l,initialTabName:a!==ue?a:void 0,onSelect:r,orientation:"vertical"},i):(0,s.createElement)(E.__experimentalNavigatorProvider,{initialPath:"/",className:"interface-preferences__provider"},(0,s.createElement)(E.__experimentalNavigatorScreen,{path:"/"},(0,s.createElement)(E.Card,{isBorderless:!0,size:"small"},(0,s.createElement)(E.CardBody,null,(0,s.createElement)(E.__experimentalItemGroup,null,l.map((e=>(0,s.createElement)(E.__experimentalNavigatorButton,{key:e.name,path:e.name,as:E.__experimentalItem,isAction:!0},(0,s.createElement)(E.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(E.FlexItem,null,(0,s.createElement)(E.__experimentalTruncate,null,e.title)),(0,s.createElement)(E.FlexItem,null,(0,s.createElement)(ie,{icon:(0,y.isRTL)()?se:ce})))))))))),t.length&&t.map((e=>(0,s.createElement)(E.__experimentalNavigatorScreen,{key:`${e.name}-menu`,path:e.name},(0,s.createElement)(E.Card,{isBorderless:!0,size:"large"},(0,s.createElement)(E.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6"},(0,s.createElement)(E.__experimentalNavigatorBackButton,{icon:(0,y.isRTL)()?ce:se,"aria-label":(0,y.__)("Navigate to the previous view")}),(0,s.createElement)(E.__experimentalText,{size:"16"},e.tabLabel)),(0,s.createElement)(E.CardBody,null,e.content)))))),c}var de=e=>{let{description:t,title:n,children:a}=e;return(0,s.createElement)("fieldset",{className:"interface-preferences-modal__section"},(0,s.createElement)("legend",{className:"interface-preferences-modal__section-legend"},(0,s.createElement)("h2",{className:"interface-preferences-modal__section-title"},n),t&&(0,s.createElement)("p",{className:"interface-preferences-modal__section-description"},t)),a)};var pe=function(e){let{help:t,label:n,isChecked:a,onChange:r,children:l}=e;return(0,s.createElement)("div",{className:"interface-preferences-modal__option"},(0,s.createElement)(E.ToggleControl,{__nextHasNoMarginBottom:!0,help:t,label:n,checked:a,onChange:r}),l)},_e=window.wp.hooks,he=window.wp.widgets,ge=window.wp.mediaUtils;(0,_e.addFilter)("editor.MediaUpload","core/edit-site/components/media-upload",(()=>ge.MediaUpload));var ve=window.lodash,fe=window.wp.blockEditor,Ee=window.wp.notices,ye={grad:.9,turn:360,rad:360/(2*Math.PI)},be=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},we=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Se=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},xe=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},ke=function(e){return{r:Se(e.r,0,255),g:Se(e.g,0,255),b:Se(e.b,0,255),a:Se(e.a)}},Ce=function(e){return{r:we(e.r),g:we(e.g),b:we(e.b),a:we(e.a,3)}},Te=/^#([0-9a-f]{3,8})$/i,Ne=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Me=function(e){var t=e.r,n=e.g,a=e.b,r=e.a,l=Math.max(t,n,a),o=l-Math.min(t,n,a),i=o?l===t?(n-a)/o:l===n?2+(a-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:l?o/l*100:0,v:l/255*100,a:r}},Ie=function(e){var t=e.h,n=e.s,a=e.v,r=e.a;t=t/360*6,n/=100,a/=100;var l=Math.floor(t),o=a*(1-n),i=a*(1-(t-l)*n),s=a*(1-(1-t+l)*n),c=l%6;return{r:255*[a,i,o,o,s,a][c],g:255*[s,a,a,i,o,o][c],b:255*[o,o,s,a,a,i][c],a:r}},Pe=function(e){return{h:xe(e.h),s:Se(e.s,0,100),l:Se(e.l,0,100),a:Se(e.a)}},Be=function(e){return{h:we(e.h),s:we(e.s),l:we(e.l),a:we(e.a,3)}},ze=function(e){return Ie((n=(t=e).s,{h:t.h,s:(n*=((a=t.l)<50?a:100-a)/100)>0?2*n/(a+n)*100:0,v:a+n,a:t.a}));var t,n,a},Ve=function(e){return{h:(t=Me(e)).h,s:(r=(200-(n=t.s))*(a=t.v)/100)>0&&r<200?n*a/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,a,r},Re=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ae=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Le=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,De=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ge={string:[[function(e){var t=Te.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?we(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?we(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Le.exec(e)||De.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ke({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Re.exec(e)||Ae.exec(e);if(!t)return null;var n,a,r=Pe({h:(n=t[1],a=t[2],void 0===a&&(a="deg"),Number(n)*(ye[a]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return ze(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,a=e.b,r=e.a,l=void 0===r?1:r;return be(t)&&be(n)&&be(a)?ke({r:Number(t),g:Number(n),b:Number(a),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,a=e.l,r=e.a,l=void 0===r?1:r;if(!be(t)||!be(n)||!be(a))return null;var o=Pe({h:Number(t),s:Number(n),l:Number(a),a:Number(l)});return ze(o)},"hsl"],[function(e){var t=e.h,n=e.s,a=e.v,r=e.a,l=void 0===r?1:r;if(!be(t)||!be(n)||!be(a))return null;var o=function(e){return{h:xe(e.h),s:Se(e.s,0,100),v:Se(e.v,0,100),a:Se(e.a)}}({h:Number(t),s:Number(n),v:Number(a),a:Number(l)});return Ie(o)},"hsv"]]},Fe=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=Ce(this.rgba)).r,n=e.g,a=e.b,l=(r=e.a)<1?Ne(we(255*r)):"","#"+Ne(t)+Ne(n)+Ne(a)+l;var e,t,n,a,r,l},e.prototype.toRgb=function(){return Ce(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Ce(this.rgba)).r,n=e.g,a=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+a+", "+r+")":"rgb("+t+", "+n+", "+a+")";var e,t,n,a,r},e.prototype.toHsl=function(){return Be(Ve(this.rgba))},e.prototype.toHslString=function(){return t=(e=Be(Ve(this.rgba))).h,n=e.s,a=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+a+"%, "+r+")":"hsl("+t+", "+n+"%, "+a+"%)";var e,t,n,a,r},e.prototype.toHsv=function(){return e=Me(this.rgba),{h:we(e.h),s:we(e.s),v:we(e.v),a:we(e.a,3)};var e},e.prototype.invert=function(){return je({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),je(He(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),je(He(this.rgba,-e))},e.prototype.grayscale=function(){return je(He(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),je(Ue(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),je(Ue(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?je({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):we(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Ve(this.rgba);return"number"==typeof e?je({h:e,s:t.s,l:t.l,a:t.a}):we(t.h)},e.prototype.isEqual=function(e){return this.toHex()===je(e).toHex()},e}(),je=function(e){return e instanceof We?e:new We(e)},qe=[],Ye=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Xe=function(e){return.2126*Ye(e.r)+.7152*Ye(e.g)+.0722*Ye(e.b)};var Ze=window.wp.privateApis;const{lock:Ke,unlock:Qe}=(0,Ze.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/edit-site"),{useGlobalSetting:Je}=Qe(fe.privateApis);!function(e){e.forEach((function(e){qe.indexOf(e)<0&&(e(We,Ge),qe.push(e))}))}([function(e){e.prototype.luminance=function(){return e=Xe(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,a,r,l,o,i,s,c=t instanceof e?t:new e(t);return l=this.rgba,o=c.toRgb(),n=(i=Xe(l))>(s=Xe(o))?(i+.05)/(s+.05):(s+.05)/(i+.05),void 0===(a=2)&&(a=0),void 0===r&&(r=Math.pow(10,a)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(o=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(a=n.level)?"AA":a)&&"normal"===o?7:"AA"===r&&"large"===o?3:4.5);var n,a,r,l,o}}]);const et=["background","backgroundColor","color","linkColor","buttonColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","textDecoration","padding","contentSize","wideSize","blockGap"];function tt(e){var t,n,a,r,l,o,i,s,u;if(!e)return et;const m=(0,c.getBlockType)(e);if(!m)return[];const d=[];return null==m||null===(t=m.supports)||void 0===t||null===(n=t.spacing)||void 0===n||!n.blockGap||!0===(null==m||null===(a=m.supports)||void 0===a||null===(r=a.spacing)||void 0===r?void 0:r.__experimentalSkipSerialization)||null!=m&&null!==(l=m.supports)&&void 0!==l&&null!==(o=l.spacing)&&void 0!==o&&null!==(i=o.__experimentalSkipSerialization)&&void 0!==i&&null!==(s=i.some)&&void 0!==s&&s.call(i,(e=>"blockGap"===e))||d.push("blockGap"),null!=m&&null!==(u=m.supports)&&void 0!==u&&u.shadow&&d.push("shadow"),Object.keys(c.__EXPERIMENTAL_STYLE_PROPERTY).forEach((e=>{if(c.__EXPERIMENTAL_STYLE_PROPERTY[e].support)return c.__EXPERIMENTAL_STYLE_PROPERTY[e].requiresOptOut&&c.__EXPERIMENTAL_STYLE_PROPERTY[e].support[0]in m.supports&&!1!==(0,ve.get)(m.supports,c.__EXPERIMENTAL_STYLE_PROPERTY[e].support)||(0,ve.get)(m.supports,c.__EXPERIMENTAL_STYLE_PROPERTY[e].support,!1)?d.push(e):void 0})),d}function nt(e){const[t]=Je("color.palette.custom",e),[n]=Je("color.palette.theme",e),[a]=Je("color.palette.default",e),[r]=Je("color.defaultPalette");return(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,y._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&a&&a.length&&e.push({name:(0,y._x)("Default","Indicates this palette comes from WordPress."),colors:a}),t&&t.length&&e.push({name:(0,y._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,a])}function at(e){const[t]=Je("color.gradients.custom",e),[n]=Je("color.gradients.theme",e),[a]=Je("color.gradients.default",e),[r]=Je("color.defaultGradients");return(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,y._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),r&&a&&a.length&&e.push({name:(0,y._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),t&&t.length&&e.push({name:(0,y._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,a])}const{GlobalStylesContext:rt}=Qe(fe.privateApis),lt={"color.background":"color","color.text":"color","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient","typography.fontSize":"font-size","typography.fontFamily":"font-family"},ot={"color.background":"backgroundColor","color.text":"textColor","color.gradient":"gradient","typography.fontSize":"fontSize","typography.fontFamily":"fontFamily"};function it(e){return e?JSON.parse(JSON.stringify(e)):{}}function st(e){let{name:t,attributes:n,setAttributes:a}=e;const r=(0,s.useMemo)((()=>function(e,t){return tt(e).flatMap((e=>{if(!c.__EXPERIMENTAL_STYLE_PROPERTY[e])return[];const{value:n}=c.__EXPERIMENTAL_STYLE_PROPERTY[e],a=n.join("."),r=t[ot[a]],l=r?`var:preset|${lt[a]}|${r}`:(0,ve.get)(t.style,n);return l?[{path:n,value:l}]:[]}))}(t,n)),[t,n]),{user:l,setUserConfig:o}=(0,s.useContext)(rt),{__unstableMarkNextChangeAsNotPersistent:i}=(0,m.useDispatch)(fe.store),{createSuccessNotice:u}=(0,m.useDispatch)(Ee.store),d=(0,s.useCallback)((()=>{if(0===r.length)return;const{style:e}=n,s=it(e),m=it(l);for(const{path:e,value:n}of r)(0,ve.set)(s,e,void 0),(0,ve.set)(m,["styles","blocks",t,...e],n);i(),a({style:s}),o((()=>m),{undoIgnore:!0}),u((0,y.sprintf)((0,y.__)("%s styles applied."),(0,c.getBlockType)(t).title),{type:"snackbar",actions:[{label:(0,y.__)("Undo"),onClick(){i(),a({style:e}),o((()=>l),{undoIgnore:!0})}}]})}),[r,n,l,t]);return(0,s.createElement)(E.BaseControl,{className:"edit-site-push-changes-to-global-styles-control",help:(0,y.sprintf)((0,y.__)("Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks."),(0,c.getBlockType)(t).title)},(0,s.createElement)(E.BaseControl.VisualLabel,null,(0,y.__)("Styles")),(0,s.createElement)(E.Button,{variant:"primary",disabled:0===r.length,onClick:d},(0,y.__)("Apply globally")))}const ct=(0,te.createHigherOrderComponent)((e=>t=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(fe.InspectorAdvancedControls,null,(0,s.createElement)(st,t)))));var ut;(0,_e.addFilter)("editor.BlockEdit","core/edit-site/push-changes-to-global-styles",ct),function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(ut||(ut={}));var mt=function(e){return e};var dt="beforeunload",pt="popstate";function _t(e){e.preventDefault(),e.returnValue=""}function ht(){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 gt(){return Math.random().toString(36).substr(2,8)}function vt(e){var t=e.pathname,n=void 0===t?"/":t,a=e.search,r=void 0===a?"":a,l=e.hash,o=void 0===l?"":l;return r&&"?"!==r&&(n+="?"===r.charAt(0)?r:"?"+r),o&&"#"!==o&&(n+="#"===o.charAt(0)?o:"#"+o),n}function ft(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var a=e.indexOf("?");a>=0&&(t.search=e.substr(a),e=e.substr(0,a)),e&&(t.pathname=e)}return t}var Et=window.wp.url;const yt=function(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,a=n.history;function r(){var e=n.location,t=e.pathname,r=e.search,l=e.hash,o=a.state||{};return[o.idx,mt({pathname:t,search:r,hash:l,state:o.usr||null,key:o.key||"default"})]}var l=null;n.addEventListener(pt,(function(){if(l)m.call(l),l=null;else{var e=ut.Pop,t=r(),n=t[0],a=t[1];if(m.length){if(null!=n){var o=s-n;o&&(l={action:e,location:a,retry:function(){f(-1*o)}},f(o))}}else v(e)}}));var o=ut.Pop,i=r(),s=i[0],c=i[1],u=ht(),m=ht();function d(e){return"string"==typeof e?e:vt(e)}function p(e,t){return void 0===t&&(t=null),mt(g({pathname:c.pathname,hash:"",search:""},"string"==typeof e?ft(e):e,{state:t,key:gt()}))}function _(e,t){return[{usr:e.state,key:e.key,idx:t},d(e)]}function h(e,t,n){return!m.length||(m.call({action:e,location:t,retry:n}),!1)}function v(e){o=e;var t=r();s=t[0],c=t[1],u.call({action:o,location:c})}function f(e){a.go(e)}null==s&&(s=0,a.replaceState(g({},a.state,{idx:s}),""));var E={get action(){return o},get location(){return c},createHref:d,push:function e(t,r){var l=ut.Push,o=p(t,r);if(h(l,o,(function(){e(t,r)}))){var i=_(o,s+1),c=i[0],u=i[1];try{a.pushState(c,"",u)}catch(e){n.location.assign(u)}v(l)}},replace:function e(t,n){var r=ut.Replace,l=p(t,n);if(h(r,l,(function(){e(t,n)}))){var o=_(l,s),i=o[0],c=o[1];a.replaceState(i,"",c),v(r)}},go:f,back:function(){f(-1)},forward:function(){f(1)},listen:function(e){return u.push(e)},block:function(e){var t=m.push(e);return 1===m.length&&n.addEventListener(dt,_t),function(){t(),m.length||n.removeEventListener(dt,_t)}}};return E}(),bt=yt.push,wt=yt.replace;yt.push=function(e,t){return bt.call(yt,(0,Et.addQueryArgs)(window.location.href,e),t)},yt.replace=function(e,t){return wt.call(yt,(0,Et.addQueryArgs)(window.location.href,e),t)};var St=yt;const xt=(0,s.createContext)(),kt=(0,s.createContext)();function Ct(){return(0,s.useContext)(xt)}function Tt(){return(0,s.useContext)(kt)}function Nt(e){const t=new URLSearchParams(e.search);return{...e,params:Object.fromEntries(t.entries())}}function Mt(e){let{children:t}=e;const[n,a]=(0,s.useState)((()=>Nt(St.location)));return(0,s.useEffect)((()=>St.listen((e=>{let{location:t}=e;a(Nt(t))}))),[]),(0,s.createElement)(kt.Provider,{value:St},(0,s.createElement)(xt.Provider,{value:n},t))}function It(){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 a=Tt();function r(r){r.preventDefault(),n?a.replace(e,t):a.push(e,t)}return{href:(0,Et.addQueryArgs)(window.location.href,e),onClick:r}}function Pt(e){let{params:t={},state:n,replace:a=!1,children:r,...l}=e;const{href:o,onClick:i}=It(t,n,a);return(0,s.createElement)("a",g({href:o,onClick:i},l),r)}function Bt(e){let{attributes:t}=e;const{theme:n,slug:a}=t,{params:r}=Ct(),l=(0,m.useSelect)((e=>e(_.store).getEntityRecord("postType","wp_template_part",`${n}//${a}`)),[n,a]),o=It({postId:null==l?void 0:l.id,postType:null==l?void 0:l.type},{fromTemplateId:r.postId});return l?(0,s.createElement)(fe.BlockControls,{group:"other"},(0,s.createElement)(E.ToolbarButton,g({},o,{onClick:e=>{o.onClick(e)}}),(0,y.__)("Edit"))):null}const zt=(0,te.createHigherOrderComponent)((e=>t=>{const{attributes:n,name:a}=t,r="core/template-part"===a&&n.slug;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),r&&(0,s.createElement)(Bt,{attributes:n}))}),"withEditBlockControls");(0,_e.addFilter)("editor.BlockEdit","core/edit-site/template-part-edit-button",zt);var Vt=(0,m.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_EDITED_POST":return{postType:t.postType,id:t.id,context:t.context};case"SET_EDITED_POST_CONTEXT":return{...e,context:t.context}}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"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value;case"SET_CANVAS_MODE":return!1}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"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen;case"SET_CANVAS_MODE":return!1}return e},saveViewPanel: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_IS_SAVE_VIEW_OPENED":return t.isOpen;case"SET_CANVAS_MODE":return!1}return e},canvasMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"init",t=arguments.length>1?arguments[1]:void 0;return"SET_CANVAS_MODE"===t.type?t.mode:e}}),Rt=window.wp.apiFetch,At=n.n(Rt),Lt=window.wp.a11y;const Dt="core/edit-site";function Gt(e){return!!e&&("custom"===(null==e?void 0:e.source)&&(null==e?void 0:e.has_theme_file))}function Ft(e){return function(t){let{registry:n}=t;p()("select( 'core/edit-site' ).toggleFeature( featureName )",{since:"6.0",alternative:"select( 'core/preferences').toggle( 'core/edit-site', featureName )"}),n.dispatch(T.store).toggle("core/edit-site",e)}}function Ot(e){return{type:"SET_PREVIEW_DEVICE_TYPE",deviceType:e}}const Ht=(e,t)=>async n=>{let{dispatch:a,registry:r}=n;if(!t)try{const n=await r.resolveSelect(_.store).getEntityRecord("postType","wp_template",e);t=null==n?void 0:n.slug}catch(e){}a({type:"SET_EDITED_POST",postType:"wp_template",id:e,context:{templateSlug:t}})},$t=e=>async t=>{let{dispatch:n,registry:a}=t;const r=await a.dispatch(_.store).saveEntityRecord("postType","wp_template",e);e.content&&a.dispatch(_.store).editEntityRecord("postType","wp_template",r.id,{blocks:(0,c.parse)(e.content)},{undoIgnore:!0}),n({type:"SET_EDITED_POST",postType:"wp_template",id:r.id,context:{templateSlug:r.slug}})},Ut=e=>async t=>{let{registry:n}=t;try{await n.dispatch(_.store).deleteEntityRecord("postType",e.type,e.id,{force:!0});const t=n.select(_.store).getLastEntityDeleteError("postType",e.type,e.id);if(t)throw t;n.dispatch(Ee.store).createSuccessNotice((0,y.sprintf)((0,y.__)('"%s" deleted.'),e.title.rendered),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,y.__)("An error occurred while deleting the template.");n.dispatch(Ee.store).createErrorNotice(t,{type:"snackbar"})}};function Wt(e){return{type:"SET_EDITED_POST",postType:"wp_template_part",id:e}}function jt(){return p()("dispatch( 'core/edit-site' ).setHomeTemplateId",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function qt(e){return{type:"SET_EDITED_POST_CONTEXT",context:e}}const Yt=e=>async t=>{var n;let{dispatch:a,registry:r}=t;if(!e.path&&null!==(n=e.context)&&void 0!==n&&n.postId){const t=await r.resolveSelect(_.store).getEntityRecord("postType",e.context.postType||"post",e.context.postId);e.path=(0,Et.getPathAndQueryString)(null==t?void 0:t.link)}const l=await r.resolveSelect(_.store).__experimentalGetTemplateForLink(e.path);if(l)return a({type:"SET_EDITED_POST",postType:"wp_template",id:l.id,context:{...e.context,templateSlug:l.slug}}),l.id};function Xt(){return p()("dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function Zt(){return p()("dispatch( 'core/edit-site' ).openNavigationPanelToMenu",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function Kt(){return p()("dispatch( 'core/edit-site' ).setIsNavigationPanelOpened",{since:"6.2",version:"6.4"}),{type:"NOTHING"}}function Qt(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function Jt(e){return{type:"UPDATE_SETTINGS",settings:e}}function en(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}function tn(e){return{type:"SET_IS_SAVE_VIEW_OPENED",isOpen:e}}const nn=function(e){let{allowUndo:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async n=>{let{registry:a}=n;if(Gt(e))try{var r;const n=a.select(_.store).getEntityConfig("postType",e.type);if(!n)return void a.dispatch(Ee.store).createErrorNotice((0,y.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const l=(0,Et.addQueryArgs)(`${n.baseURL}/${e.id}`,{context:"edit",source:"theme"}),o=await At()({path:l});if(!o)return void a.dispatch(Ee.store).createErrorNotice((0,y.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const i=e=>{let{blocks:t=[]}=e;return(0,c.__unstableSerializeAndClean)(t)},s=a.select(_.store).getEditedEntityRecord("postType",e.type,e.id);a.dispatch(_.store).editEntityRecord("postType",e.type,e.id,{content:i,blocks:s.blocks,source:"custom"},{undoIgnore:!0});const u=(0,c.parse)(null==o||null===(r=o.content)||void 0===r?void 0:r.raw);if(a.dispatch(_.store).editEntityRecord("postType",e.type,o.id,{content:i,blocks:u,source:"theme"}),t){const t=()=>{a.dispatch(_.store).editEntityRecord("postType",e.type,s.id,{content:i,blocks:s.blocks,source:"custom"})};a.dispatch(Ee.store).createSuccessNotice((0,y.__)("Template reverted."),{type:"snackbar",actions:[{label:(0,y.__)("Undo"),onClick:t}]})}else a.dispatch(Ee.store).createSuccessNotice((0,y.__)("Template reverted."))}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,y.__)("Template revert failed. Please reload.");a.dispatch(Ee.store).createErrorNotice(t,{type:"snackbar"})}else a.dispatch(Ee.store).createErrorNotice((0,y.__)("This template is not revertable."),{type:"snackbar"})}},an=e=>t=>{let{registry:n}=t;n.dispatch(F).enableComplementaryArea(Dt,e)},rn=()=>e=>{let{registry:t}=e;t.dispatch(F).disableComplementaryArea(Dt)},ln=e=>t=>{let{registry:n}=t;n.dispatch("core/preferences").set("core/edit-site","editorMode",e),"visual"!==e&&n.dispatch(fe.store).clearSelectedBlock(),"visual"===e?(0,Lt.speak)((0,y.__)("Visual editor selected"),"assertive"):"mosaic"===e&&(0,Lt.speak)((0,y.__)("Mosaic view selected"),"assertive")},on=e=>t=>{let{registry:n,dispatch:a}=t;n.dispatch(fe.store).__unstableSetEditorMode("edit"),a({type:"SET_CANVAS_MODE",mode:e}),"edit"===e&&n.select(T.store).get("core/edit-site","showListViewByDefault")&&a.setIsListViewOpened(!0)};var sn={};function cn(e){return[e]}function un(e,t,n){var a;if(e.length!==t.length)return!1;for(a=n;a0&&void 0!==arguments[0]?arguments[0]:dn,t=arguments.length>1?arguments[1]:void 0;const n=t?t.reduce(((e,t)=>({...e,[t.id]:t})),{}):{},a=[],r=[...e];for(;r.length;){const{innerBlocks:e,...t}=r.shift();if(r.unshift(...e),(0,c.isTemplatePart)(t)){const{attributes:{theme:e,slug:r}}=t,l=n[`${e}//${r}`];l&&a.push({templatePart:l,block:t})}}return a})),_n=(0,m.createRegistrySelector)((e=>(t,n)=>e(T.store).get("core/edit-site",n)));function hn(e,t){return p()("select( 'core/interface' ).isFeatureActive",{since:"6.0",alternative:"select( 'core/preferences' ).get"}),!!_n(e,t)}function gn(e){return e.deviceType}const vn=(0,m.createRegistrySelector)((e=>()=>e(_.store).canUser("create","media"))),fn=(0,m.createRegistrySelector)((e=>()=>"web"===s.Platform.OS?e(_.store).getEntityRecords("postType","wp_block",{per_page:-1}):[])),En=function(e,t){var n,a=t||cn;function r(e){var t,a,r,l,o,i=n,s=!0;for(t=0;t{const n={...e.settings,outlineMode:!0,focusMode:!!_n(e,"focusMode"),hasFixedToolbar:!!_n(e,"fixedToolbar"),keepCaretInsideBlock:!!_n(e,"keepCaretInsideBlock"),showIconLabels:!!_n(e,"showIconLabels"),__experimentalSetIsInserterOpened:t,__experimentalReusableBlocks:fn(e),__experimentalPreferPatternsOnRoot:"wp_template"===bn(e)};return vn(e)?(n.mediaUpload=t=>{let{onError:n,...a}=t;(0,ge.uploadMedia)({wpAllowedMimeTypes:e.settings.allowedMimeTypes,onError:e=>{let{message:t}=e;return n(t)},...a})},n):n}),(e=>[vn(e),e.settings,_n(e,"focusMode"),_n(e,"fixedToolbar"),_n(e,"keepCaretInsideBlock"),_n(e,"showIconLabels"),fn(e),bn(e)]));function yn(){p()("select( 'core/edit-site' ).getHomeTemplateId",{since:"6.2",version:"6.4"})}function bn(e){return e.editedPost.postType}function wn(e){return e.editedPost.id}function Sn(e){return e.editedPost.context}function xn(e){return{context:e.editedPost.context}}function kn(e){return!!e.blockInserterPanel}function Cn(e){const{rootClientId:t,insertionIndex:n,filterValue:a}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:n,filterValue:a}}function Tn(e){return e.listViewPanel}function Nn(e){return e.saveViewPanel}const Mn=(0,m.createRegistrySelector)((e=>t=>{const n=bn(t),a=wn(t),r=e(_.store).getEditedEntityRecord("postType",n,a),l=e(_.store).getEntityRecords("postType","wp_template_part",{per_page:-1});return pn(r.blocks,l)}));function In(e){return _n(e,"editorMode")}function Pn(){p()("dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu",{since:"6.2",version:"6.4"})}function Bn(){p()("dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu",{since:"6.2",version:"6.4"})}function zn(){p()("dispatch( 'core/edit-site' ).isNavigationOpened",{since:"6.2",version:"6.4"})}function Vn(e){return e.canvasMode}const Rn={reducer:Vt,actions:r,selectors:o},An=(0,m.createReduxStore)(Dt,Rn);(0,m.register)(An),Qe(An).registerPrivateSelectors(i),Qe(An).registerPrivateActions(l);var Ln=window.wp.keyboardShortcuts;var Dn=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"}));var Gn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));var Fn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.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"}));function On(e){let{path:t,title:n,actions:a,content:r}=e;const{dashboardLink:l}=(0,m.useSelect)((e=>{const{getSettings:t}=Qe(e(An));return{dashboardLink:t().__experimentalDashboardLink}}),[]);return(0,s.createElement)(E.__experimentalNavigatorScreen,{className:"edit-site-sidebar-navigation-screen",path:t},(0,s.createElement)(E.__experimentalVStack,{spacing:2},(0,s.createElement)(E.__experimentalHStack,{spacing:4,justify:"flex-start",className:"edit-site-sidebar-navigation-screen__title-icon"},"/"!==t?(0,s.createElement)(E.__experimentalNavigatorToParentButton,{className:"edit-site-sidebar-navigation-screen__back",icon:(0,y.isRTL)()?ce:se,"aria-label":(0,y.__)("Back")}):(0,s.createElement)(E.Button,{className:"edit-site-sidebar-navigation-screen__back",icon:(0,y.isRTL)()?ce:se,"aria-label":(0,y.__)("Navigate to the Dashboard"),href:l||"index.php",label:(0,y.__)("Dashboard")}),(0,s.createElement)("h2",{className:"edit-site-sidebar-navigation-screen__title"},n),a),(0,s.createElement)("nav",{className:"edit-site-sidebar-navigation-screen__content"},r)))}function Hn(e){let{className:t,icon:n,withChevron:a=!1,children:r,...l}=e;return(0,s.createElement)(E.__experimentalItem,g({className:f()("edit-site-sidebar-navigation-item",t)},l),n&&(0,s.createElement)(E.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(ie,{style:{fill:"currentcolor"},icon:n,size:24}),(0,s.createElement)(E.FlexBlock,null,r),a&&(0,s.createElement)(ie,{style:{fill:"currentcolor"},icon:ce,size:24})),!n&&r)}function $n(){const{navigationMenus:e}=(0,m.useSelect)((e=>{const{getEntityRecords:t}=e(_.store);return{navigationMenus:t("postType","wp_navigation",{per_page:-1,status:"publish"})}}));return(0,s.createElement)(On,{path:"/",title:(0,y.__)("Design"),content:(0,s.createElement)(E.__experimentalItemGroup,null,!!e&&e.length>0&&(0,s.createElement)(E.__experimentalNavigatorButton,{as:Hn,path:"/navigation",withChevron:!0,icon:Dn},(0,y.__)("Navigation")),(0,s.createElement)(E.__experimentalNavigatorButton,{as:Hn,path:"/templates",withChevron:!0,icon:Gn},(0,y.__)("Templates")),(0,s.createElement)(E.__experimentalNavigatorButton,{as:Hn,path:"/template-parts",withChevron:!0,icon:Fn},(0,y.__)("Template Parts")))})}var Un=window.wp.htmlEntities;var Wn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"}));var jn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.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 qn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.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 Yn=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.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 Xn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.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 Zn=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.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 Kn=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.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 Qn=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.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 Jn=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.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 ea=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.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 ta=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.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,s.createElement)(b.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 na=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"}));var aa=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"}));var ra=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));function la(){const e="edit-site-template-actions-loading-screen-modal";return(0,s.createElement)(E.Modal,{isFullScreen:!0,isDismissible:!1,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,onRequestClose:()=>{},__experimentalHideHeader:!0,className:e},(0,s.createElement)("div",{className:`${e}__content`},(0,s.createElement)(E.Spinner,null)))}const oa=()=>(0,m.useSelect)((e=>e(_.store).getEntityRecords("postType","wp_template",{per_page:-1})),[]),ia=()=>(0,m.useSelect)((e=>e(h.store).__experimentalGetDefaultTemplateTypes()),[]),sa=()=>{const e=(0,m.useSelect)((e=>e(_.store).getPostTypes({per_page:-1})),[]);return(0,s.useMemo)((()=>{const t=["attachment"];return null==e?void 0:e.filter((e=>{let{viewable:n,slug:a}=e;return n&&!t.includes(a)}))}),[e])};function ca(e){const t=(0,s.useMemo)((()=>null==e?void 0:e.reduce(((e,t)=>{let{labels:n}=t;const a=n.singular_name.toLowerCase();return e[a]=(e[a]||0)+1,e}),{})));return(0,s.useCallback)((e=>{let{labels:n,slug:a}=e;const r=n.singular_name.toLowerCase();return t[r]>1&&r!==a}),[t])}function ua(){const e=sa(),t=(0,s.useMemo)((()=>null==e?void 0:e.filter((e=>e.has_archive))),[e]),n=oa(),a=ca(t);return(0,s.useMemo)((()=>(null==t?void 0:t.filter((e=>!(n||[]).some((t=>t.slug==="archive-"+e.slug)))).map((e=>{var t;let n;return n=a(e)?(0,y.sprintf)((0,y.__)("Archive: %1$s (%2$s)"),e.labels.singular_name,e.slug):(0,y.sprintf)((0,y.__)("Archive: %s"),e.labels.singular_name),{slug:"archive-"+e.slug,description:(0,y.sprintf)((0,y.__)("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):Yn,templatePrefix:"archive"}})))||[]),[t,n,a])}const ma=e=>{const t=(()=>{const e=(0,m.useSelect)((e=>e(_.store).getTaxonomies({per_page:-1})),[]);return(0,s.useMemo)((()=>null==e?void 0:e.filter((e=>{let{visibility:t}=e;return null==t?void 0:t.publicly_queryable}))),[e])})(),n=oa(),a=ia(),r=(0,s.useMemo)((()=>null==t?void 0:t.reduce(((e,t)=>{let{slug:n}=t,a=n;return["category","post_tag"].includes(n)||(a=`taxonomy-${a}`),"post_tag"===n&&(a="tag"),e[n]=a,e}),{})),[t]),l=null==t?void 0:t.reduce(((e,t)=>{let{labels:n}=t;const a=n.singular_name.toLowerCase();return e[a]=(e[a]||0)+1,e}),{}),o=ga("taxonomy",r),i=(n||[]).map((e=>{let{slug:t}=e;return t})),c=(t||[]).reduce(((t,n)=>{var s;const{slug:c,labels:u}=n,m=r[c],d=null==a?void 0:a.find((e=>{let{slug:t}=e;return t===m})),p=null==i?void 0:i.includes(m),_=((e,t)=>{if(["category","post_tag"].includes(t))return!1;const n=e.singular_name.toLowerCase();return l[n]>1&&n!==t})(u,c);let h=u.singular_name;_&&(h=(0,y.sprintf)((0,y.__)("%1$s (%2$s)"),u.singular_name,c));const g=d?{...d,templatePrefix:r[c]}:{slug:m,title:h,description:(0,y.sprintf)((0,y.__)("Displays taxonomy: %s."),u.singular_name),icon:ea,templatePrefix:r[c]},v=null==o||null===(s=o[c])||void 0===s?void 0:s.hasEntities;return v&&(g.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:o[c].existingEntitiesIds}},getSpecificTemplate:e=>{const t=`${r[c]}-${e.slug}`;return{title:t,slug:t,templatePrefix:r[c]}}},labels:u,hasGeneralTemplate:p,template:t})}),p&&!v||t.push(g),t}),[]);return(0,s.useMemo)((()=>c.reduce(((e,t)=>{const{slug:n}=t;let a="taxonomiesMenuItems";return["category","tag"].includes(n)&&(a="defaultTaxonomiesMenuItems"),e[a].push(t),e}),{defaultTaxonomiesMenuItems:[],taxonomiesMenuItems:[]})),[c])},da={user:"author"},pa={user:{who:"authors"}};const _a=e=>{const t=oa();return(0,s.useMemo)((()=>Object.entries(e||{}).reduce(((e,n)=>{let[a,r]=n;const l=(t||[]).reduce(((e,t)=>{const n=`${r}-`;return t.slug.startsWith(n)&&e.push(t.slug.substring(n.length)),e}),[]);return l.length&&(e[a]=l),e}),{})),[e,t])},ha=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=_a(t),r=(0,m.useSelect)((t=>Object.entries(a||{}).reduce(((a,r)=>{let[l,o]=r;const i=t(_.store).getEntityRecords(e,l,{_fields:"id",context:"view",slug:o,...n[l]});return null!=i&&i.length&&(a[l]=i),a}),{})),[a]);return r},ga=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=ha(e,t,n),r=(0,m.useSelect)((r=>Object.keys(t||{}).reduce(((t,l)=>{var o,i;const s=(null==a||null===(o=a[l])||void 0===o?void 0:o.map((e=>{let{id:t}=e;return t})))||[];return t[l]={hasEntities:!(null===(i=r(_.store).getEntityRecords(e,l,{per_page:1,_fields:"id",context:"view",exclude:s,...n[l]}))||void 0===i||!i.length),existingEntitiesIds:s},t}),{})),[t,a]);return r},va=[];function fa(e){let{suggestion:t,search:n,onSelect:a,entityForSuggestions:r,composite:l}=e;const o="edit-site-custom-template-modal__suggestions_list__list-item";return(0,s.createElement)(E.__unstableCompositeItem,g({role:"option",as:E.Button},l,{className:o,onClick:()=>a(r.config.getSpecificTemplate(t))}),(0,s.createElement)("span",{className:`${o}__title`},(0,s.createElement)(E.TextHighlight,{text:(0,Un.decodeEntities)(t.name),highlight:n})),t.link&&(0,s.createElement)("span",{className:`${o}__info`},t.link))}function Ea(e,t){const{config:n}=e,a=(0,s.useMemo)((()=>({order:"asc",context:"view",search:t,per_page:t?20:10,...n.queryArgs(t)})),[t,n]),{records:r,hasResolved:l}=(0,_.useEntityRecords)(e.type,e.slug,a),[o,i]=(0,s.useState)(va);return(0,s.useEffect)((()=>{if(!l)return;let e=va;var t,a;null!=r&&r.length&&(e=r,n.recordNamePath&&(t=e,a=n.recordNamePath,e=(t||[]).map((e=>({...e,name:(0,Un.decodeEntities)((0,ve.get)(e,a))}))))),i(e)}),[r,l]),o}function ya(e){let{entityForSuggestions:t,onSelect:n}=e;const a=(0,E.__unstableUseCompositeState)({orientation:"vertical"}),[r,l,o]=function(){const[e,t]=(0,s.useState)(""),[n,a]=(0,s.useState)(""),r=(0,te.useDebounce)(a,250);return(0,s.useEffect)((()=>{n!==e&&r(e)}),[n,e]),[e,t,n]}(),i=Ea(t,o),{labels:c}=t,[u,m]=(0,s.useState)(!1);return!u&&(null==i?void 0:i.length)>9&&m(!0),(0,s.createElement)(s.Fragment,null,u&&(0,s.createElement)(E.SearchControl,{__nextHasNoMarginBottom:!0,onChange:l,value:r,label:c.search_items,placeholder:c.search_items}),!(null==i||!i.length)&&(0,s.createElement)(E.__unstableComposite,g({},a,{role:"listbox",className:"edit-site-custom-template-modal__suggestions_list","aria-label":(0,y.__)("Suggestions list")}),i.map((e=>(0,s.createElement)(fa,{key:e.slug,suggestion:e,search:o,onSelect:n,entityForSuggestions:t,composite:a})))),o&&!(null!=i&&i.length)&&(0,s.createElement)("p",{className:"edit-site-custom-template-modal__no-results"},c.not_found))}var ba=function(e){let{onClose:t,onSelect:n,entityForSuggestions:a,isCreatingTemplate:r}=e;const[l,o]=(0,s.useState)(a.hasGeneralTemplate),i="edit-site-custom-template-modal";return(0,s.createElement)(E.Modal,{title:(0,y.sprintf)((0,y.__)("Add template: %s"),a.labels.singular_name),className:i,onRequestClose:t},r&&(0,s.createElement)(la,null),!l&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("p",null,(0,y.__)("Select whether to create a single template for all items or a specific one.")),(0,s.createElement)(E.Flex,{className:`${i}__contents`,gap:"4",align:"initial"},(0,s.createElement)(E.FlexItem,{isBlock:!0,as:E.Button,onClick:()=>{const{slug:e,title:t,description:r,templatePrefix:l}=a.template;n({slug:e,title:t,description:r,templatePrefix:l})}},(0,s.createElement)(E.__experimentalText,{as:"span",weight:600},a.labels.all_items),(0,s.createElement)(E.__experimentalText,{as:"span"},(0,y.__)("For all items"))),(0,s.createElement)(E.FlexItem,{isBlock:!0,as:E.Button,onClick:()=>{o(!0)}},(0,s.createElement)(E.__experimentalText,{as:"span",weight:600},a.labels.singular_name),(0,s.createElement)(E.__experimentalText,{as:"span"},(0,y.__)("For a specific item"))))),l&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("p",null,(0,y.__)("This template will be used only for the specific item chosen.")),(0,s.createElement)(ya,{entityForSuggestions:a,onSelect:n})))};var wa=function(e){let{onClose:t,createTemplate:n,isCreatingTemplate:a}=e;const[r,l]=(0,s.useState)(""),o=(0,y.__)("Custom Template"),[i,c]=(0,s.useState)(!1);return(0,s.createElement)(E.Modal,{title:(0,y.__)("Create custom template"),onRequestClose:()=>{t()},overlayClassName:"edit-site-custom-generic-template__modal"},a&&(0,s.createElement)(la,null),(0,s.createElement)("form",{onSubmit:async function(e){if(e.preventDefault(),!i){c(!0);try{await n({slug:"wp-custom-template-"+(0,ve.kebabCase)(r||o),title:r||o},!1)}finally{c(!1)}}}},(0,s.createElement)(E.__experimentalVStack,{spacing:6},(0,s.createElement)(E.TextControl,{__nextHasNoMarginBottom:!0,label:(0,y.__)("Name"),value:r,onChange:l,placeholder:o,disabled:i,help:(0,y.__)('Describe the template, e.g. "Post with sidebar".')}),(0,s.createElement)(E.__experimentalHStack,{className:"edit-site-custom-generic-template__modal-actions",justify:"right"},(0,s.createElement)(E.Button,{variant:"tertiary",onClick:()=>{t()}},(0,y.__)("Cancel")),(0,s.createElement)(E.Button,{variant:"primary",type:"submit",isBusy:i,"aria-disabled":i},(0,y.__)("Create"))))))};const Sa=["front-page","single","page","index","archive","author","category","date","tag","taxonomy","search","404"],xa={"front-page":Wn,single:jn,page:qn,archive:Yn,search:Xn,404:Zn,index:Kn,category:Qn,author:Jn,taxonomy:ea,date:ta,tag:na,attachment:aa};function ka(e){let{postType:t,toggleProps:n,showIcon:a=!0}=e;const[r,l]=(0,s.useState)(!1),[o,i]=(0,s.useState)(!1),[c,u]=(0,s.useState)({}),[d,p]=(0,s.useState)(!1),h=Tt(),{saveEntityRecord:g}=(0,m.useDispatch)(_.store),{createErrorNotice:v,createSuccessNotice:f}=(0,m.useDispatch)(Ee.store),{setTemplate:b,setCanvasMode:w}=Qe((0,m.useDispatch)(An));async function S(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!d){p(!0);try{const{title:n,description:a,slug:r,templatePrefix:l}=e;let o=e.content;if(!o){o=(await At()({path:(0,Et.addQueryArgs)("/wp/v2/templates/lookup",{slug:r,is_custom:!t,template_prefix:l})})).content.raw}const i=await g("postType","wp_template",{description:a,slug:r.toString(),status:"publish",title:n,content:o,is_wp_suggestion:t},{throwOnError:!0});b(i.id,i.slug),w("edit"),window.queueMicrotask((()=>{h.push({postId:i.id,postType:i.type,path:"/templates/single"})})),f((0,y.sprintf)((0,y.__)('"%s" successfully created.'),n),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,y.__)("An error occurred while creating the template.");v(t,{type:"snackbar"})}finally{p(!1)}}}const x=function(e,t){const n=oa(),a=ia(),r=(n||[]).map((e=>{let{slug:t}=e;return t})),l=(a||[]).filter((e=>Sa.includes(e.slug)&&!r.includes(e.slug))),o=n=>{t(!0),e(n)},i=[...l],{defaultTaxonomiesMenuItems:c,taxonomiesMenuItems:u}=ma(o),{defaultPostTypesMenuItems:m,postTypesMenuItems:d}=(e=>{const t=sa(),n=oa(),a=ia(),r=ca(t),l=(0,s.useMemo)((()=>null==t?void 0:t.reduce(((e,t)=>{let{slug:n}=t,a=n;return"page"!==n&&(a=`single-${a}`),e[n]=a,e}),{})),[t]),o=ga("postType",l),i=(n||[]).map((e=>{let{slug:t}=e;return t})),c=(t||[]).reduce(((t,n)=>{var s;const{slug:c,labels:u,icon:m}=n,d=l[c],p=null==a?void 0:a.find((e=>{let{slug:t}=e;return t===d})),_=null==i?void 0:i.includes(d),h=r(n);let g=(0,y.sprintf)((0,y.__)("Single item: %s"),u.singular_name);h&&(g=(0,y.sprintf)((0,y.__)("Single item: %1$s (%2$s)"),u.singular_name,c));const v=p?{...p,templatePrefix:l[c]}:{slug:d,title:g,description:(0,y.sprintf)((0,y.__)("Displays a single item: %s."),u.singular_name),icon:null!=m&&m.startsWith("dashicons-")?m.slice(10):jn,templatePrefix:l[c]},f=null==o||null===(s=o[c])||void 0===s?void 0:s.hasEntities;return f&&(v.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:o[c].existingEntitiesIds}},getSpecificTemplate:e=>{const t=`${l[c]}-${e.slug}`;return{title:t,slug:t,templatePrefix:l[c]}}},labels:u,hasGeneralTemplate:_,template:t})}),_&&!f||t.push(v),t}),[]);return(0,s.useMemo)((()=>c.reduce(((e,t)=>{const{slug:n}=t;let a="postTypesMenuItems";return"page"===n&&(a="defaultPostTypesMenuItems"),e[a].push(t),e}),{defaultPostTypesMenuItems:[],postTypesMenuItems:[]})),[c])})(o),p=function(e){var t,n;const a=oa(),r=ia(),l=ga("root",da,pa);let o=null==r?void 0:r.find((e=>{let{slug:t}=e;return"author"===t}));o||(o={description:(0,y.__)("Displays latest posts written by a single author."),slug:"author",title:"Author"});const i=!(null==a||!a.find((e=>{let{slug:t}=e;return"author"===t})));if(null!==(t=l.user)&&void 0!==t&&t.hasEntities&&(o={...o,templatePrefix:"author"},o.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:l.user.existingEntitiesIds,who:"authors"}},getSpecificTemplate:e=>{const t=`author-${e.slug}`;return{title:t,slug:t,templatePrefix:"author"}}},labels:{singular_name:(0,y.__)("Author"),search_items:(0,y.__)("Search Authors"),not_found:(0,y.__)("No authors found."),all_items:(0,y.__)("All Authors")},hasGeneralTemplate:i,template:t})}),!i||null!==(n=l.user)&&void 0!==n&&n.hasEntities)return o}(o);[...c,...m,p].forEach((e=>{if(!e)return;const t=i.findIndex((t=>t.slug===e.slug));t>-1?i[t]=e:i.push(e)})),null==i||i.sort(((e,t)=>Sa.indexOf(e.slug)-Sa.indexOf(t.slug)));return[...i,...ua(),...d,...u]}(u,l);return x.length?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(E.DropdownMenu,{className:"edit-site-new-template-dropdown",icon:a?ra:null,text:a?null:t.labels.add_new,label:t.labels.add_new_item,popoverProps:{noArrow:!1},toggleProps:n},(()=>(0,s.createElement)(s.Fragment,null,d&&(0,s.createElement)(la,null),(0,s.createElement)(E.NavigableMenu,{className:"edit-site-new-template-dropdown__popover"},(0,s.createElement)(E.MenuGroup,{label:t.labels.add_new_item},x.map((e=>{const{title:t,description:n,slug:a,onClick:r,icon:l}=e;return(0,s.createElement)(E.MenuItem,{icon:l||xa[a]||jn,iconPosition:"left",info:n,key:a,onClick:()=>r?r(e):S(e)},t)}))),(0,s.createElement)(E.MenuGroup,null,(0,s.createElement)(E.MenuItem,{icon:Gn,iconPosition:"left",info:(0,y.__)("Custom templates can be applied to any post or page."),key:"custom-template",onClick:()=>i(!0)},(0,y.__)("Custom template"))))))),r&&(0,s.createElement)(ba,{onClose:()=>l(!1),onSelect:S,entityForSuggestions:c,isCreatingTemplate:d}),o&&(0,s.createElement)(wa,{onClose:()=>i(!1),createTemplate:S,isCreatingTemplate:d})):null}function Ca(e){let{closeModal:t,onCreate:n}=e;const[a,r]=(0,s.useState)(""),[l,o]=(0,s.useState)("uncategorized"),[i,c]=(0,s.useState)(!1),u=(0,te.useInstanceId)(Ca),d=(0,m.useSelect)((e=>e(h.store).__experimentalGetDefaultTemplatePartAreas()),[]);return(0,s.createElement)(E.Modal,{title:(0,y.__)("Create a template part"),onRequestClose:t,overlayClassName:"edit-site-create-template-part-modal"},(0,s.createElement)("form",{onSubmit:async e=>{e.preventDefault(),a&&(c(!0),await n({title:a,area:l}))}},(0,s.createElement)(E.__experimentalVStack,{spacing:"4"},(0,s.createElement)(E.TextControl,{__nextHasNoMarginBottom:!0,label:(0,y.__)("Name"),value:a,onChange:r,required:!0}),(0,s.createElement)(E.BaseControl,{label:(0,y.__)("Area"),id:`edit-site-create-template-part-modal__area-selection-${u}`,className:"edit-site-create-template-part-modal__area-base-control"},(0,s.createElement)(E.__experimentalRadioGroup,{label:(0,y.__)("Area"),className:"edit-site-create-template-part-modal__area-radio-group",id:`edit-site-create-template-part-modal__area-selection-${u}`,onChange:o,checked:l},d.map((e=>{let{icon:t,label:n,area:a,description:r}=e;return(0,s.createElement)(E.__experimentalRadio,{key:n,value:a,className:"edit-site-create-template-part-modal__area-radio"},(0,s.createElement)(E.Flex,{align:"start",justify:"start"},(0,s.createElement)(E.FlexItem,null,(0,s.createElement)(E.Icon,{icon:t})),(0,s.createElement)(E.FlexBlock,{className:"edit-site-create-template-part-modal__option-label"},n,(0,s.createElement)("div",null,r)),(0,s.createElement)(E.FlexItem,{className:"edit-site-create-template-part-modal__checkbox"},l===a&&(0,s.createElement)(E.Icon,{icon:w}))))})))),(0,s.createElement)(E.Flex,{className:"edit-site-create-template-part-modal__modal-actions",justify:"flex-end"},(0,s.createElement)(E.FlexItem,null,(0,s.createElement)(E.Button,{variant:"secondary",onClick:()=>{t()}},(0,y.__)("Cancel"))),(0,s.createElement)(E.FlexItem,null,(0,s.createElement)(E.Button,{variant:"primary",type:"submit",disabled:!a,isBusy:i},(0,y.__)("Create")))))))}const Ta=()=>(0,m.useSelect)((e=>e(_.store).getEntityRecords("postType","wp_template_part",{per_page:-1})),[]),Na=(e,t)=>{const n=e.toLowerCase(),a=t.map((e=>e.title.rendered.toLowerCase()));if(!a.includes(n))return e;let r=2;for(;a.includes(`${n} ${r}`);)r++;return`${e} ${r}`},Ma=e=>(0,ve.kebabCase)(e).replace(/[^\w-]+/g,"")||"wp-custom-part";function Ia(e){let{postType:t,showIcon:n=!0,toggleProps:a}=e;const r=Tt(),[l,o]=(0,s.useState)(!1),{createErrorNotice:i}=(0,m.useDispatch)(Ee.store),{saveEntityRecord:c}=(0,m.useDispatch)(_.store),{setCanvasMode:u}=Qe((0,m.useDispatch)(An)),d=Ta();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(E.Button,g({},a,{onClick:()=>{o(!0)},icon:n?ra:null,label:t.labels.add_new}),n?null:t.labels.add_new),l&&(0,s.createElement)(Ca,{closeModal:()=>o(!1),onCreate:async function(e){let{title:t,area:n}=e;if(t)try{const e=Na(t,d),a=Ma(e),l=await c("postType","wp_template_part",{slug:a,title:e,content:"",area:n},{throwOnError:!0});o(!1),u("edit"),window.queueMicrotask((()=>{r.push({postId:l.id,postType:"wp_template_part",path:"/template-parts/single"})}))}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,y.__)("An error occurred while creating the template part.");i(t,{type:"snackbar"}),o(!1)}else i((0,y.__)("Title is not defined."),{type:"snackbar"})}}))}function Pa(e){let{templateType:t="wp_template",...n}=e;const a=(0,m.useSelect)((e=>e(_.store).getPostType(t)),[t]);return a?"wp_template"===t?(0,s.createElement)(ka,g({},n,{postType:a})):"wp_template_part"===t?(0,s.createElement)(Ia,g({},n,{postType:a})):null:null}const Ba={wp_template:{path:"/templates",labels:{title:(0,y.__)("Templates"),loading:(0,y.__)("Loading templates"),notFound:(0,y.__)("No templates found"),manage:(0,y.__)("Manage all templates")}},wp_template_part:{path:"/template-parts",labels:{title:(0,y.__)("Template parts"),loading:(0,y.__)("Loading template parts"),notFound:(0,y.__)("No template parts found"),manage:(0,y.__)("Manage all template parts")}}},za=e=>{let{postType:t,postId:n,...a}=e;const r=It({postType:t,postId:n,path:Ba[t].path+"/single"});return(0,s.createElement)(Hn,g({},r,a))};function Va(e){let{postType:t="wp_template"}=e;const n=(0,te.useViewportMatch)("medium","<"),{records:a,isResolving:r}=(0,_.useEntityRecords)("postType",t,{per_page:-1}),l=It({postType:t,postId:void 0,path:Ba[t].path+"/all"});return(0,s.createElement)(On,{path:Ba[t].path,title:Ba[t].labels.title,actions:!n&&(0,s.createElement)(Pa,{templateType:t,toggleProps:{className:"edit-site-sidebar-navigation-screen-templates__add-button"}}),content:(0,s.createElement)(s.Fragment,null,r&&Ba[t].labels.loading,!r&&(0,s.createElement)(E.__experimentalItemGroup,null,!(null!=a&&a.length)&&(0,s.createElement)(E.__experimentalItem,null,Ba[t].labels.notFound),(null!=a?a:[]).map((e=>{var n;return(0,s.createElement)(za,{postType:t,postId:e.id,key:e.id},(0,Un.decodeEntities)((null===(n=e.title)||void 0===n?void 0:n.rendered)||e.slug))})),!n&&(0,s.createElement)(Hn,g({className:"edit-site-sidebar-navigation-screen-templates__see-all"},l,{children:Ba[t].labels.manage}))))})}function Ra(){const{record:e,title:t,description:n,isLoaded:a}=(0,m.useSelect)((e=>{const{getEditedPostType:t,getEditedPostId:n}=e(An),{getEditedEntityRecord:a}=e(_.store),{__experimentalGetTemplateInfo:r}=e(h.store),l=t(),o=n(),i=a("postType",l,o),s=!!o,c=r(i);return{record:i,title:c.title,description:c.description,isLoaded:s}}),[]);return{isLoaded:a,record:e,getTitle:()=>t?(0,Un.decodeEntities)(t):null,getDescription:()=>n?(0,Un.decodeEntities)(n):null}}const Aa={wp_template:{path:"/templates/single"},wp_template_part:{path:"/template-parts/single"}};function La(e){let{postType:t="wp_template"}=e;const{setCanvasMode:n}=Qe((0,m.useDispatch)(An)),{getDescription:a,getTitle:r,record:l}=Ra();let o=a();return!o&&l.is_custom&&(o=(0,y.__)("This is a custom template that can be applied manually to any Post or Page.")),(0,s.createElement)(On,{path:Aa[t].path,title:r(),actions:(0,s.createElement)(E.Button,{variant:"primary",onClick:()=>n("edit")},(0,y.__)("Edit")),content:o?(0,s.createElement)("p",null,o):void 0})}const Da={"core/navigation":["core/navigation-link","core/search","core/social-links","core/page-list","core/spacer","core/home-link","core/site-title","core/site-logo","core/navigation-submenu"],"core/social-links":["core/social-link"],"core/navigation-submenu":["core/navigation-link","core/navigation-submenu"],"core/navigation-link":["core/navigation-link","core/navigation-submenu"]};function Ga(e){let{innerBlocks:t,onSelect:n}=e;const{updateBlockListSettings:a}=(0,m.useDispatch)(fe.store),{OffCanvasEditor:r}=Qe(fe.privateApis);return(0,s.useEffect)((()=>{a("",{allowedBlocks:Da["core/navigation"]}),t.forEach((e=>{Da[e.name]&&a(e.clientId,{allowedBlocks:Da[e.name]})}))}),[a,t]),(0,s.createElement)(r,{blocks:t,onSelect:n})}const Fa=[{per_page:-1,status:"publish"}];function Oa(e){var t;let{onSelect:n}=e;const{selectedNavigationBlockId:a,clientIdToRef:r,navigationMenus:l,isResolvingNavigationMenus:o,hasResolvedNavigationMenus:i,firstNavigationBlockId:c}=(0,m.useSelect)((e=>{const{__experimentalGetActiveBlockIdByBlockNames:t,__experimentalGetGlobalBlocksByName:n,getBlock:a}=e(fe.store),{getEntityRecords:r,hasFinishedResolution:l,isResolving:o}=e(_.store),i=["postType","wp_navigation",Fa[0]],s=t("core/navigation"),c=n("core/navigation"),u={};return c.forEach((e=>{var t,n;u[e]=null===(t=a(e))||void 0===t||null===(n=t.attributes)||void 0===n?void 0:n.ref})),{selectedNavigationBlockId:s,firstNavigationBlockId:null==c?void 0:c[0],clientIdToRef:u,navigationMenus:r(...i),isResolvingNavigationMenus:o("getEntityRecords",i),hasResolvedNavigationMenus:l("getEntityRecords",i)}}),[]),u=(0,te.useInstanceId)(Ga,"edit-site-navigation-inspector-menu"),d=r[c],p=null==l||null===(t=l[0])||void 0===t?void 0:t.id,h=d||p,[g,v]=(0,s.useState)(d);(0,s.useEffect)((()=>{a&&v(r[a])}),[a]);let f=[];l&&(f=l.map((e=>{let{id:t,title:n}=e;return{value:t,label:n.rendered}})));const[b,w,S]=(0,_.useEntityBlockEditor)("postType","wp_navigation",{id:g||h}),{isLoadingInnerBlocks:x,hasLoadedInnerBlocks:k}=(0,m.useSelect)((e=>{const{isResolving:t,hasFinishedResolution:n}=e(_.store);return{isLoadingInnerBlocks:t("getEntityRecord",["postType","wp_navigation",g||h]),hasLoadedInnerBlocks:n("getEntityRecord",["postType","wp_navigation",g||h])}}),[g,h]),C=!(i&&k),T=(null==l?void 0:l.length)>1,N=!(null==l||!l.length),M=N?b:[],I=!(null==M||!M.length);return(0,s.useEffect)((()=>{o&&(0,Lt.speak)("Loading Navigation sidebar menus."),i&&(0,Lt.speak)("Navigation sidebar menus have loaded.")}),[o,i]),(0,s.useEffect)((()=>{x&&(0,Lt.speak)("Loading Navigation sidebar selected menu items."),k&&(0,Lt.speak)("Navigation sidebar selected menu items have loaded.")}),[x,k]),(0,s.createElement)("div",{className:"edit-site-navigation-inspector"},i&&!N&&(0,s.createElement)("p",{className:"edit-site-navigation-inspector__empty-msg"},(0,y.__)("There are no Navigation Menus.")),!i&&(0,s.createElement)("div",{className:"edit-site-navigation-inspector__placeholder"}),i&&T&&(0,s.createElement)(E.SelectControl,{__nextHasNoMarginBottom:!0,className:"edit-site-navigation-inspector__select-menu","aria-controls":k?u:void 0,value:g||h,options:f,onChange:e=>v(Number(e))}),C&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"edit-site-navigation-inspector__placeholder is-child"}),(0,s.createElement)("div",{className:"edit-site-navigation-inspector__placeholder is-child"}),(0,s.createElement)("div",{className:"edit-site-navigation-inspector__placeholder is-child"})),I&&!C&&(0,s.createElement)(fe.BlockEditorProvider,{value:M,onChange:S,onInput:w},(0,s.createElement)(Ga,{innerBlocks:M,onSelect:n})),!I&&!C&&(0,s.createElement)("p",{className:"edit-site-navigation-inspector__empty-msg"},(0,y.__)("Navigation Menu is empty.")))}function Ha(){const e=Tt(),t=(0,s.useCallback)((t=>{const{attributes:n}=t;"post-type"===n.kind&&n.id&&n.type&&e&&e.push({postType:n.type,postId:n.id,path:"/navigation/single"})}),[e]);return(0,s.createElement)(On,{path:"/navigation",title:(0,y.__)("Navigation"),content:(0,s.createElement)("div",{className:"edit-site-sidebar-navigation-screen-navigation-menus"},(0,s.createElement)(Oa,{onSelect:t}))})}const $a={wp_template:{path:"/templates/all",title:(0,y.__)("All templates")},wp_template_part:{path:"/template-parts/all",title:(0,y.__)("All template parts")}};function Ua(e){let{postType:t="wp_template"}=e;return(0,s.createElement)(On,{path:$a[t].path,title:$a[t].title})}var Wa=window.wp.keycodes;function ja(){const{isDirty:e,isSaving:t,isSaveViewOpen:n}=(0,m.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,isSavingEntityRecord:n}=e(_.store),a=t(),{isSaveViewOpened:r}=e(An);return{isDirty:a.length>0,isSaving:a.some((e=>n(e.kind,e.name,e.key))),isSaveViewOpen:r()}}),[]),{setIsSaveViewOpened:a}=(0,m.useDispatch)(An),r=!e||t,l=(0,y.__)("Save");return(0,s.createElement)(E.Button,{variant:"primary",className:"edit-site-save-button__button","aria-disabled":r,"aria-expanded":n,isBusy:t,onClick:r?void 0:()=>a(!0),label:l,shortcut:r?void 0:Wa.displayShortcut.primary("s"),showTooltip:!0},l)}function qa(){var e,t;const{setCanvasMode:n}=Qe((0,m.useDispatch)(An)),{post:a}=(0,m.useSelect)((e=>{var t;const{getEditedPostContext:n}=e(An),{getEntityRecord:a}=e(_.store),{postType:r,postId:l}=null!==(t=n())&&void 0!==t?t:{};return{post:l&&r?a("postType",r,l):null}}),[]);return(0,s.createElement)(On,{path:"/navigation/single",title:a?(0,Un.decodeEntities)(null==a||null===(e=a.title)||void 0===e?void 0:e.rendered):null,actions:(0,s.createElement)(E.Button,{variant:"primary",onClick:()=>n("edit")},(0,y.__)("Edit")),content:a?(0,Un.decodeEntities)(null==a||null===(t=a.description)||void 0===t?void 0:t.rendered):null})}function Ya(){return function(){const e=Tt(),{params:t}=Ct(),{path:n="/"}=t,{location:a,goTo:r}=(0,E.__experimentalUseNavigator)(),l=(0,s.useRef)(n),o=(0,s.useRef)(a.path);(0,s.useEffect)((()=>{l.current=n,n!==o.current&&r(n)}),[n]),(0,s.useEffect)((()=>{o.current=a.path,a.path!==l.current&&e.push({...t,path:a.path})}),[a.path,e])}(),(0,s.createElement)(s.Fragment,null,(0,s.createElement)($n,null),(0,s.createElement)(Ha,null),(0,s.createElement)(qa,null),(0,s.createElement)(Va,{postType:"wp_template"}),(0,s.createElement)(Va,{postType:"wp_template_part"}),(0,s.createElement)(La,{postType:"wp_template"}),(0,s.createElement)(La,{postType:"wp_template_part"}),(0,s.createElement)(Ua,{postType:"wp_template"}),(0,s.createElement)(Ua,{postType:"wp_template_part"}))}var Xa=(0,s.memo)((function(){const{isDirty:e}=(0,m.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t}=e(_.store);return{isDirty:t().length>0}}),[]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(E.__experimentalNavigatorProvider,{className:"edit-site-sidebar__content",initialPath:"/"},(0,s.createElement)(Ya,null)),e&&(0,s.createElement)("div",{className:"edit-site-sidebar__footer"},(0,s.createElement)(ja,null)))}));var Za=(0,s.createElement)(b.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"}));var Ka=(0,s.createElement)(b.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"}));function Qa(e){let{className:t,identifier:n,title:a,icon:r,children:l,closeLabel:o,header:i,headerClassName:c,panelClassName:u}=e;const d=(0,m.useSelect)((e=>e(An).getSettings().showIconLabels),[]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ee,{className:t,scope:"core/edit-site",identifier:n,title:a,icon:r,closeLabel:o,header:i,headerClassName:c,panelClassName:u,showIconLabels:d},l),(0,s.createElement)(X,{scope:"core/edit-site",identifier:n,icon:r},a))}var Ja=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.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"}));var er=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z"}));function tr(e){let{className:t,...n}=e;return(0,s.createElement)(E.Icon,g({className:f()(t,"edit-site-global-styles-icon-with-current-color")},n))}function nr(e){let{icon:t,children:n,...a}=e;return(0,s.createElement)(E.__experimentalItem,a,t&&(0,s.createElement)(E.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(tr,{icon:t,size:24}),(0,s.createElement)(E.FlexItem,null,n)),!t&&n)}function ar(e){return(0,s.createElement)(E.__experimentalNavigatorButton,g({as:nr},e))}var rr=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.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 lr=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.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 or=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"m6.6 15.6-1.2.8c.6.9 1.3 1.6 2.2 2.2l.8-1.2c-.7-.5-1.3-1.1-1.8-1.8zM5.5 12c0-.4 0-.9.1-1.3l-1.5-.3c0 .5-.1 1.1-.1 1.6s.1 1.1.2 1.6l1.5-.3c-.2-.4-.2-.9-.2-1.3zm11.9-3.6 1.2-.8c-.6-.9-1.3-1.6-2.2-2.2l-.8 1.2c.7.5 1.3 1.1 1.8 1.8zM5.3 7.6l1.2.8c.5-.7 1.1-1.3 1.8-1.8l-.7-1.3c-.9.6-1.7 1.4-2.3 2.3zm14.5 2.8-1.5.3c.1.4.1.8.1 1.3s0 .9-.1 1.3l1.5.3c.1-.5.2-1 .2-1.6s-.1-1.1-.2-1.6zM12 18.5c-.4 0-.9 0-1.3-.1l-.3 1.5c.5.1 1 .2 1.6.2s1.1-.1 1.6-.2l-.3-1.5c-.4.1-.9.1-1.3.1zm3.6-1.1.8 1.2c.9-.6 1.6-1.3 2.2-2.2l-1.2-.8c-.5.7-1.1 1.3-1.8 1.8zM10.4 4.2l.3 1.5c.4-.1.8-.1 1.3-.1s.9 0 1.3.1l.3-1.5c-.5-.1-1.1-.2-1.6-.2s-1.1.1-1.6.2z"}));var ir=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z"}));const{useGlobalSetting:sr,useGlobalStyle:cr}=Qe(fe.privateApis);function ur(e){return[mr(e),dr(e),pr(e),_r(e)].some(Boolean)}function mr(e){const t=tt(e);return sr("border.color",e)[0]&&t.includes("borderColor")}function dr(e){const t=tt(e);return sr("border.radius",e)[0]&&t.includes("borderRadius")}function pr(e){const t=tt(e);return sr("border.style",e)[0]&&t.includes("borderStyle")}function _r(e){const t=tt(e);return sr("border.width",e)[0]&&t.includes("borderWidth")}function hr(e){return e?e.style||!e.color&&!e.width?e:{...e,style:"solid"}:e}function gr(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",[r]=cr(`${a}border`,t,"user"),[l,o]=cr(`${a}border`,t),i=nt(t),c=mr(t),u=pr(t),m=_r(t),d=dr(t),[p,_]=cr(`${a}border.radius`,t),h=()=>{const e=null==r?void 0:r.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},g=(0,s.useCallback)((()=>o(void 0)),[o]),v=(0,s.useCallback)((e=>{const t=function(e){return e?(0,E.__experimentalHasSplitBorders)(e)?{top:hr(e.top),right:hr(e.right),bottom:hr(e.bottom),left:hr(e.left)}:hr(e):e}(e),n=(0,E.__experimentalHasSplitBorders)(t)?{color:null,style:null,width:null,...t}:{top:t,right:t,bottom:t,left:t};o({radius:null==l?void 0:l.radius,...n})}),[o]);return(0,s.createElement)(E.__experimentalToolsPanel,{label:(0,y.__)("Border"),resetAll:g},(m||c)&&(0,s.createElement)(E.__experimentalToolsPanelItem,{hasValue:()=>(0,E.__experimentalIsDefinedBorder)(r),label:(0,y.__)("Border"),onDeselect:()=>(()=>{if(h())return o({radius:r.radius});o(void 0)})(),isShownByDefault:!0},(0,s.createElement)(E.__experimentalBorderBoxControl,{colors:i,enableAlpha:!0,enableStyle:u,onChange:v,popoverOffset:40,popoverPlacement:"left-start",value:l,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large"})),d&&(0,s.createElement)(E.__experimentalToolsPanelItem,{hasValue:h,label:(0,y.__)("Radius"),onDeselect:()=>_(void 0),isShownByDefault:!0},(0,s.createElement)(fe.__experimentalBorderRadiusControl,{values:p,onChange:e=>{_(e||void 0)}})))}function vr(e){const t=tt(e);return t.includes("color")||t.includes("backgroundColor")||t.includes("background")||t.includes("linkColor")}var fr=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));var Er=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"}));const{useGlobalSetting:yr,useGlobalStyle:br}=Qe(fe.privateApis),wr=["horizontal","vertical"];function Sr(e){const t=xr(e),n=kr(e),a=Cr(e),r=Tr(e),l=Nr(e),o=Mr(e);return t||n||a||r||l||o}function xr(e){const t=tt(e),[n]=yr("layout.contentSize",e);return n&&t.includes("contentSize")}function kr(e){const t=tt(e),[n]=yr("layout.wideSize",e);return n&&t.includes("wideSize")}function Cr(e){const t=tt(e),[n]=yr("spacing.padding",e);return n&&t.includes("padding")}function Tr(e){const t=tt(e),[n]=yr("spacing.margin",e);return n&&t.includes("margin")}function Nr(e){const t=tt(e),[n]=yr("spacing.blockGap",e);return n&&t.includes("blockGap")}function Mr(e){const t=tt(e),[n]=yr("dimensions.minHeight",e);return n&&t.includes("minHeight")}function Ir(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 Pr(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function Br(e){return e&&"string"==typeof e?{top:e}:e?{...e,right:null==e?void 0:e.left,bottom:null==e?void 0:e.top}:e}function zr(e){let{name:t,variation:n=""}=e;const a=xr(t),r=kr(t),l=Cr(t),o=Tr(t),i=Nr(t),c=Mr(t),u=function(){var e,t;const[n]=yr("spacing.spacingSizes"),{custom:a,theme:r,default:l}=n||{},o=null!==(e=null!==(t=null!=a?a:r)&&void 0!==t?t:l)&&void 0!==e?e:[];return n&&o.length>0}(),m=(0,E.__experimentalUseCustomUnits)({availableUnits:yr("spacing.units",t)[0]||["%","px","em","rem","vw"]}),{contentSizeValue:d,setContentSizeValue:p,hasUserSetContentSizeValue:_,resetContentSizeValue:h}=function(e){const[t,n]=yr("layout.contentSize",e),[a]=yr("layout.contentSize",e,"user");return{contentSizeValue:t,setContentSizeValue:n,hasUserSetContentSizeValue:()=>!!a,resetContentSizeValue:()=>n("")}}(t),{wideSizeValue:g,setWideSizeValue:v,hasUserSetWideSizeValue:b,resetWideSizeValue:w}=function(e){const[t,n]=yr("layout.wideSize",e),[a]=yr("layout.wideSize",e,"user");return{wideSizeValue:t,setWideSizeValue:n,hasUserSetWideSizeValue:()=>!!a,resetWideSizeValue:()=>n("")}}(t),{paddingValues:S,paddingSides:x,isAxialPadding:k,setPaddingValues:C,resetPaddingValue:T,hasPaddingValue:N}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t?`variations.${t}.`:"",[a,r]=br(n+"spacing.padding",e),l=Pr(a),o=(0,fe.__experimentalUseCustomSides)(e,"padding"),i=o&&o.some((e=>wr.includes(e))),s=e=>{const t=Ir(e,o);r(t)},c=()=>s({}),[u]=br(n+"spacing.padding",e,"user");return{paddingValues:l,paddingSides:o,isAxialPadding:i,setPaddingValues:s,resetPaddingValue:c,hasPaddingValue:()=>!!u}}(t,n),{marginValues:M,marginSides:I,isAxialMargin:P,setMarginValues:B,resetMarginValue:z,hasMarginValue:V}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t?`variations.${t}.`:"",[a,r]=br(n+"spacing.margin",e),l=Pr(a),o=(0,fe.__experimentalUseCustomSides)(e,"margin"),i=o&&o.some((e=>wr.includes(e))),s=e=>{const t=Ir(e,o);r(t)},c=()=>s({});return{marginValues:l,marginSides:o,isAxialMargin:i,setMarginValues:s,resetMarginValue:c,hasMarginValue:()=>!!l&&Object.keys(l).length}}(t,n),{gapValue:R,gapValues:A,gapSides:L,isAxialGap:D,setGapValue:G,setGapValues:F,resetGapValue:O,hasGapValue:H}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t?`variations.${t}.`:"",[a,r]=br(n+"spacing.blockGap",e),l=Br(a),o=(0,fe.__experimentalUseCustomSides)(e,"blockGap"),i=o&&o.some((e=>wr.includes(e))),s=()=>r(void 0),[c]=br(n+"spacing.blockGap",e,"user"),u=e=>{e||r(null),!i&&null!=e&&e.hasOwnProperty("top")?r(e.top):r({top:null==e?void 0:e.top,left:null==e?void 0:e.left})};return{gapValue:a,gapValues:l,gapSides:o,isAxialGap:i,setGapValue:r,setGapValues:u,resetGapValue:s,hasGapValue:()=>!!c}}(t,n),{minHeightValue:$,setMinHeightValue:U,resetMinHeightValue:W,hasMinHeightValue:j}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t?`variations.${t}.`:"",[a,r]=br(n+"dimensions.minHeight",e),l=()=>r(void 0);return{minHeightValue:a,setMinHeightValue:r,resetMinHeightValue:l,hasMinHeightValue:()=>!!a}}(t,n);return(0,s.createElement)(E.__experimentalToolsPanel,{label:(0,y.__)("Dimensions"),resetAll:()=>{T(),z(),O(),h(),w()}},(a||r)&&(0,s.createElement)("span",{className:"span-columns"},(0,y.__)("Set the width of the main content area.")),a&&(0,s.createElement)(E.__experimentalToolsPanelItem,{className:"single-column",label:(0,y.__)("Content size"),hasValue:_,onDeselect:h,isShownByDefault:!0},(0,s.createElement)(E.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,s.createElement)(E.__experimentalUnitControl,{label:(0,y.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:d||"",onChange:e=>{p(e)},units:m}),(0,s.createElement)(E.__experimentalView,null,(0,s.createElement)(ie,{icon:fr})))),r&&(0,s.createElement)(E.__experimentalToolsPanelItem,{className:"single-column",label:(0,y.__)("Wide size"),hasValue:b,onDeselect:w,isShownByDefault:!0},(0,s.createElement)(E.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,s.createElement)(E.__experimentalUnitControl,{label:(0,y.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:g||"",onChange:e=>{v(e)},units:m}),(0,s.createElement)(E.__experimentalView,null,(0,s.createElement)(ie,{icon:Er})))),l&&(0,s.createElement)(E.__experimentalToolsPanelItem,{hasValue:N,label:(0,y.__)("Padding"),onDeselect:T,isShownByDefault:!0,className:f()({"tools-panel-item-spacing":u})},!u&&(0,s.createElement)(E.__experimentalBoxControl,{values:S,onChange:C,label:(0,y.__)("Padding"),sides:x,units:m,allowReset:!1,splitOnAxis:k}),u&&(0,s.createElement)(fe.__experimentalSpacingSizesControl,{values:S,onChange:C,label:(0,y.__)("Padding"),sides:x,units:m,allowReset:!1,splitOnAxis:k})),o&&(0,s.createElement)(E.__experimentalToolsPanelItem,{hasValue:V,label:(0,y.__)("Margin"),onDeselect:z,isShownByDefault:!0,className:f()({"tools-panel-item-spacing":u})},!u&&(0,s.createElement)(E.__experimentalBoxControl,{values:M,onChange:B,label:(0,y.__)("Margin"),sides:I,units:m,allowReset:!1,splitOnAxis:P}),u&&(0,s.createElement)(fe.__experimentalSpacingSizesControl,{values:M,onChange:B,label:(0,y.__)("Margin"),sides:I,units:m,allowReset:!1,splitOnAxis:P})),i&&(0,s.createElement)(E.__experimentalToolsPanelItem,{hasValue:H,label:(0,y.__)("Block spacing"),onDeselect:O,isShownByDefault:!0,className:f()({"tools-panel-item-spacing":u})},!u&&(D?(0,s.createElement)(E.__experimentalBoxControl,{label:(0,y.__)("Block spacing"),min:0,onChange:F,units:m,sides:L,values:A,allowReset:!1,splitOnAxis:D}):(0,s.createElement)(E.__experimentalUnitControl,{label:(0,y.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:G,units:m,value:R})),u&&(0,s.createElement)(fe.__experimentalSpacingSizesControl,{label:(0,y.__)("Block spacing"),min:0,onChange:F,sides:D?L:["top"],values:A,allowReset:!1,splitOnAxis:D})),c&&(0,s.createElement)(E.__experimentalToolsPanelItem,{hasValue:j,label:(0,y.__)("Min. height"),onDeselect:W,isShownByDefault:!0},(0,s.createElement)(fe.HeightControl,{label:(0,y.__)("Min. height"),value:$,onChange:U})))}const{useGlobalSetting:Vr,useGlobalStyle:Rr}=Qe(fe.privateApis);function Ar(e){const t=Lr(e),n=Dr(e),a=Gr(e),r=Fr(e),l=tt(e);return t||n||a||r||l.includes("fontSize")}function Lr(e){const t=tt(e),[n]=Vr("typography.fontFamilies",e),a=(null==n?void 0:n.custom)||(null==n?void 0:n.theme)||(null==n?void 0:n.default);return t.includes("fontFamily")&&!(null==a||!a.length)}function Dr(e){const t=tt(e);return Vr("typography.lineHeight",e)[0]&&t.includes("lineHeight")}function Gr(e){const t=tt(e),n=Vr("typography.fontStyle",e)[0]&&t.includes("fontStyle"),a=Vr("typography.fontWeight",e)[0]&&t.includes("fontWeight");return n||a}function Fr(e,t){if(!Vr("typography.letterSpacing",e)[0])return!1;if(!e&&"heading"===t)return!0;return tt(e).includes("letterSpacing")}function Or(e,t){const[n,a]=Rr(e,t),[r]=Rr(e,t,"user");return[n,a,()=>!!r,()=>a(void 0)]}function Hr(e){let{name:t,element:n,headingLevel:a,variation:r=""}=e;const l=tt(t);let o="";"heading"===n?o=`elements.${a}.`:n&&"text"!==n&&(o=`elements.${n}.`),r&&(o=o?`variations.${r}.${o}`:`variations.${r}`);const[i]=Vr("typography.fontSizes",t),c=(null==i?void 0:i.custom)||(null==i?void 0:i.theme)||(null==i?void 0:i.default),u=!Vr("typography.customFontSize",t)[0],[m]=Vr("typography.fontFamilies",t),d=(null==m?void 0:m.custom)||(null==m?void 0:m.theme)||(null==m?void 0:m.default),p=Vr("typography.fontStyle",t)[0]&&l.includes("fontStyle"),_=Vr("typography.fontWeight",t)[0]&&l.includes("fontWeight"),h=Lr(t),g=Dr(t),v=Gr(t),f=function(e){const t=tt(e),n=Vr("typography.fontStyle",e)[0]&&t.includes("fontStyle"),a=Vr("typography.fontWeight",e)[0]&&t.includes("fontWeight");return n?a?(0,y.__)("Appearance"):(0,y.__)("Font style"):(0,y.__)("Font weight")}(t),b=Fr(t,n),w=function(e,t){return!!Vr("typography.textTransform",e)[0]&&(!e&&"heading"===t||tt(e).includes("textTransform"))}(t,n),S=function(e,t){return!e&&"link"===t}(t,n);let x=l.includes("fontSize");"heading"===n&&"heading"===a&&(x=!1);const[k,C,T,N]=Or(o+"typography.fontFamily",t),{fontSize:M,setFontSize:I,hasFontSize:P,resetFontSize:B}=function(e,t){const[n,a]=Rr(e,t),[r]=Rr(e,t,"user");return{fontSize:n,setFontSize:(e,t)=>{null!=t&&t.slug&&(e=`var:preset|font-size|${null==t?void 0:t.slug}`),a(e)},hasFontSize:()=>!!r,resetFontSize:()=>a(void 0)}}(o+"typography.fontSize",t),{fontStyle:z,setFontStyle:V,fontWeight:R,setFontWeight:A,hasFontAppearance:L,resetFontAppearance:D}=function(e,t){const[n,a]=Rr(e+"typography.fontStyle",t),[r]=Rr(e+"typography.fontStyle",t,"user"),[l,o]=Rr(e+"typography.fontWeight",t),[i]=Rr(e+"typography.fontWeight",t,"user");return{fontStyle:n,setFontStyle:a,fontWeight:l,setFontWeight:o,hasFontAppearance:()=>!!r||!!i,resetFontAppearance:()=>{a(void 0),o(void 0)}}}(o,t),[G,F,O,H]=Or(o+"typography.lineHeight",t),[$,U,W,j]=Or(o+"typography.letterSpacing",t),[q,Y,X,Z]=Or(o+"typography.textTransform",t),[K,Q,J,ee]=Or(o+"typography.textDecoration",t);return(0,s.createElement)(E.__experimentalToolsPanel,{label:(0,y.__)("Typography"),resetAll:()=>{N(),B(),D(),H(),j(),Z()}},h&&(0,s.createElement)(E.__experimentalToolsPanelItem,{label:(0,y.__)("Font family"),hasValue:T,onDeselect:N,isShownByDefault:!0},(0,s.createElement)(fe.__experimentalFontFamilyControl,{fontFamilies:d,value:k,onChange:C,size:"__unstable-large",__nextHasNoMarginBottom:!0})),x&&(0,s.createElement)(E.__experimentalToolsPanelItem,{label:(0,y.__)("Font size"),hasValue:P,onDeselect:B,isShownByDefault:!0},(0,s.createElement)(E.FontSizePicker,{value:M,onChange:I,fontSizes:c,disableCustomFontSizes:u,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})),v&&(0,s.createElement)(E.__experimentalToolsPanelItem,{className:"single-column",label:f,hasValue:L,onDeselect:D,isShownByDefault:!0},(0,s.createElement)(fe.__experimentalFontAppearanceControl,{value:{fontStyle:z,fontWeight:R},onChange:e=>{let{fontStyle:t,fontWeight:n}=e;V(t),A(n)},hasFontStyles:p,hasFontWeights:_,size:"__unstable-large",__nextHasNoMarginBottom:!0})),g&&(0,s.createElement)(E.__experimentalToolsPanelItem,{className:"single-column",label:(0,y.__)("Line height"),hasValue:O,onDeselect:H,isShownByDefault:!0},(0,s.createElement)(fe.LineHeightControl,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:G,onChange:F,size:"__unstable-large"})),b&&(0,s.createElement)(E.__experimentalToolsPanelItem,{className:"single-column",label:(0,y.__)("Letter spacing"),hasValue:W,onDeselect:j,isShownByDefault:!0},(0,s.createElement)(fe.__experimentalLetterSpacingControl,{value:$,onChange:U,size:"__unstable-large",__unstableInputWidth:"auto"})),w&&(0,s.createElement)(E.__experimentalToolsPanelItem,{label:(0,y.__)("Letter case"),hasValue:X,onDeselect:Z,isShownByDefault:!0},(0,s.createElement)(fe.__experimentalTextTransformControl,{value:q,onChange:Y,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})),S&&(0,s.createElement)(E.__experimentalToolsPanelItem,{className:"single-column",label:(0,y.__)("Text decoration"),hasValue:J,onDeselect:ee,isShownByDefault:!0},(0,s.createElement)(fe.__experimentalTextDecorationControl,{value:K,onChange:Q,size:"__unstable-large",__unstableInputWidth:"auto"})))}function $r(e){return null==e?void 0:e.filter((e=>"block"===e.source))}function Ur(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t.includes("variations"),a=(0,m.useSelect)((t=>{const{getBlockStyles:n}=t(c.store);return n(e)}),[e]),r=$r(a);return!(null==r||!r.length||n)}function Wr(e){let{name:t}=e;const n=$r((0,m.useSelect)((e=>{const{getBlockStyles:n}=e(c.store);return n(t)}),[t]));return(0,s.createElement)(E.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},n.map(((e,n)=>null!=e&&e.isDefault?null:(0,s.createElement)(ar,{key:n,path:"/blocks/"+encodeURIComponent(t)+"/variations/"+encodeURIComponent(e.name),"aria-label":e.label},e.label))))}function jr(e){let{blockName:t,styleName:n}=e;return(0,s.createElement)(ol,{parentMenu:"/blocks/"+encodeURIComponent(t)+"/variations/"+encodeURIComponent(n),name:t})}var qr=function(e){let{title:t,description:n}=e;return(0,s.createElement)(E.__experimentalVStack,{spacing:0},(0,s.createElement)(E.__experimentalView,null,(0,s.createElement)(E.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3},(0,s.createElement)(E.__experimentalHStack,{spacing:2},(0,s.createElement)(E.__experimentalNavigatorToParentButton,{style:{minWidth:24,padding:0},icon:(0,y.isRTL)()?ce:se,isSmall:!0,"aria-label":(0,y.__)("Navigate to the previous view")}),(0,s.createElement)(E.__experimentalSpacer,null,(0,s.createElement)(E.__experimentalHeading,{level:5},t))))),n&&(0,s.createElement)("p",{className:"edit-site-global-styles-header__description"},n))};var Yr=e=>{var t;let{name:n,variation:a=""}=e;const r=null===(t=(0,c.getBlockType)(n))||void 0===t?void 0:t.example,l={...r,attributes:{...null==r?void 0:r.attributes,className:a}},o=r&&(0,c.getBlockFromExample)(n,a?l:r),i=(null==r?void 0:r.viewportWidth)||null,u="150px";return r?(0,s.createElement)(E.__experimentalSpacer,{marginX:4,marginBottom:4},(0,s.createElement)("div",{className:"edit-site-global-styles__block-preview-panel",style:{maxHeight:u,boxSizing:"initial"}},(0,s.createElement)(fe.BlockPreview,{blocks:o,viewportWidth:i,minHeight:u,additionalStyles:[{css:"\n\t\t\t\t\t\t\t\tbody{\n\t\t\t\t\t\t\t\t\tmin-height:150px;\n\t\t\t\t\t\t\t\t\tdisplay:flex;align-items:center;justify-content:center;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t"}]}))):null};var Xr=function(e){let{children:t}=e;return(0,s.createElement)(E.__experimentalHeading,{className:"edit-site-global-styles-subtitle",level:2},t)};function Zr(e){let{name:t,path:n=""}=e;return Ur(t,n)?(0,s.createElement)("div",{className:"edit-site-global-styles-screen-variations"},(0,s.createElement)(E.__experimentalVStack,{spacing:3},(0,s.createElement)("p",null,"Manage style variations, saved block appearence presets."),(0,s.createElement)(Xr,null,(0,y.__)("Style Variations")),(0,s.createElement)(Wr,{name:t}))):null}function Kr(e){let{blockName:t,style:n}=e;const{name:a,label:r}=n;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qr,{title:r}),(0,s.createElement)(Yr,{name:t,variation:`is-style-${a}`}),(0,s.createElement)(jr,{blockName:t,styleName:a}))}const{useGlobalSetting:Qr,useGlobalStyle:Jr}=Qe(fe.privateApis);function el(e){return tt(e).includes("shadow")}function tl(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",[r,l]=Jr(`${a}shadow`,t),[o]=Jr(`${a}shadow`,t,"user"),i=()=>l(void 0),c=(0,s.useCallback)((()=>i()),[i]);return(0,s.createElement)(E.__experimentalToolsPanel,{label:(0,y.__)("Shadow"),resetAll:c},(0,s.createElement)(E.__experimentalToolsPanelItem,{label:(0,y.__)("Shadow"),hasValue:()=>!!o,onDeselect:i,isShownByDefault:!0},(0,s.createElement)(E.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(nl,{shadow:r,onShadowChange:l}))))}const nl=e=>{let{shadow:t,onShadowChange:n}=e;return(0,s.createElement)(E.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"edit-site-global-styles__shadow-dropdown",renderToggle:e=>{let{onToggle:t,isOpen:n}=e;const a={onClick:t,className:f()({"is-open":n}),"aria-expanded":n};return(0,s.createElement)(E.Button,a,(0,s.createElement)(E.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(tr,{icon:ir,size:24}),(0,s.createElement)(E.FlexItem,{className:"edit-site-global-styles__shadow-label"},(0,y.__)("Shadow"))))},renderContent:()=>(0,s.createElement)(E.__experimentalDropdownContentWrapper,{paddingSize:"medium"},(0,s.createElement)(al,{shadow:t,onShadowChange:n}))})};function al(e){let{shadow:t,onShadowChange:n}=e;const[a]=Qr("shadow.presets.default"),[r]=Qr("shadow.presets.theme"),[l]=Qr("shadow.defaultPresets"),o=[...l?a:[],...r||[]];return(0,s.createElement)("div",{className:"edit-site-global-styles__shadow-panel"},(0,s.createElement)(E.__experimentalVStack,{spacing:4},(0,s.createElement)(E.__experimentalHeading,{level:5},(0,y.__)("Shadow")),(0,s.createElement)(rl,{presets:o,activeShadow:t,onSelect:n})))}function rl(e){let{presets:t,activeShadow:n,onSelect:a}=e;return t?(0,s.createElement)(E.__experimentalGrid,{columns:6,gap:0,align:"center",justify:"center"},t.map(((e,t)=>{let{name:r,shadow:l}=e;return(0,s.createElement)(ll,{key:t,label:r,isActive:l===n,onSelect:()=>a(l===n?void 0:l),shadow:l})}))):null}function ll(e){let{label:t,isActive:n,onSelect:a,shadow:r}=e;return(0,s.createElement)("div",{className:"edit-site-global-styles__shadow-indicator-wrapper"},(0,s.createElement)(E.Button,{className:"edit-site-global-styles__shadow-indicator",onClick:a,"aria-label":t,style:{boxShadow:r}},n&&(0,s.createElement)(ie,{icon:w})))}var ol=function(e){let{name:t,parentMenu:n=""}=e;const a=Ar(t),r=vr(t),l=ur(t),o=el(t),i=Sr(t),c=Ur(t,n),{canEditCSS:u}=(0,m.useSelect)((e=>{var t,n;const{getEntityRecord:a,__experimentalGetCurrentGlobalStylesId:r}=e(_.store),l=r(),o=l?a("root","globalStyles",l):void 0;return{canEditCSS:null!==(t=!(null==o||null===(n=o._links)||void 0===n||!n["wp:action-edit-css"]))&&void 0!==t&&t}}),[]),d=n.includes("blocks")&&!n.includes("variations");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(E.__experimentalItemGroup,null,a&&(0,s.createElement)(ar,{icon:rr,path:n+"/typography","aria-label":(0,y.__)("Typography styles")},(0,y.__)("Typography")),r&&(0,s.createElement)(ar,{icon:lr,path:n+"/colors","aria-label":(0,y.__)("Colors styles")},(0,y.__)("Colors")),l&&(0,s.createElement)(ar,{icon:or,path:n+"/border","aria-label":(0,y.__)("Border")},(0,y.__)("Border")),o&&(0,s.createElement)(ar,{icon:ir,path:n+"/effects","aria-label":(0,y.__)("Shadow")},(0,y.__)("Shadow")),i&&(0,s.createElement)(ar,{icon:Gn,path:n+"/layout","aria-label":(0,y.__)("Layout styles")},(0,y.__)("Layout")),c&&(0,s.createElement)(Zr,{name:t,path:n}),d&&u&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(E.CardDivider,null),(0,s.createElement)(E.CardBody,null,(0,s.createElement)(E.__experimentalSpacer,{as:"p",paddingTop:2,marginBottom:4},(0,y.__)("Add your own CSS to customize the block appearance.")),(0,s.createElement)(E.__experimentalItemGroup,null,(0,s.createElement)(ar,{path:n+"/css","aria-label":(0,y.__)("Additional block CSS")},(0,s.createElement)(E.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(E.FlexItem,null,(0,y.__)("Additional block CSS")),(0,s.createElement)(tr,{icon:(0,y.isRTL)()?se:ce}))))),(0,s.createElement)(E.CardDivider,null))))};const{useGlobalSetting:il,useGlobalStyle:sl,useGlobalStylesOutput:cl}=Qe(fe.privateApis),ul={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},ml={hover:{opacity:1},start:{opacity:.5}},dl={hover:{scale:1,opacity:1},start:{scale:0,opacity:0}};var pl=e=>{let{label:t,isFocused:n,withHoverView:a}=e;const[r]=sl("typography.fontWeight"),[l="serif"]=sl("typography.fontFamily"),[o=l]=sl("elements.h1.typography.fontFamily"),[i=r]=sl("elements.h1.typography.fontWeight"),[c="black"]=sl("color.text"),[u=c]=sl("elements.h1.color.text"),[m="white"]=sl("color.background"),[d]=sl("color.gradient"),[p]=cl(),_=(0,te.useReducedMotion)(),[h]=il("color.palette.core"),[g]=il("color.palette.theme"),[v]=il("color.palette.custom"),[f,y]=(0,s.useState)(!1),[b,{width:w}]=(0,te.useResizeObserver)(),S=w?w/248:1,x=(null!=g?g:[]).concat(null!=v?v:[]).concat(null!=h?h:[]),k=x.filter((e=>{let{color:t}=e;return t!==m&&t!==u})).slice(0,2),C=(0,s.useMemo)((()=>p?[...p,{css:"html{overflow:hidden}body{min-width: 0;padding: 0;border: none;}",isGlobalStyles:!0}]:p),[p]);return(0,s.createElement)(fe.__unstableIframe,{className:"edit-site-global-styles-preview__iframe",head:(0,s.createElement)(fe.__unstableEditorStyles,{styles:C}),style:{height:152*S,visibility:w?"visible":"hidden"},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),tabIndex:-1},b,(0,s.createElement)(E.__unstableMotion.div,{style:{height:152*S,width:"100%",background:null!=d?d:m,cursor:"pointer"},initial:"start",animate:(f||n)&&!_&&t?"hover":"start"},(0,s.createElement)(E.__unstableMotion.div,{variants:ul,style:{height:"100%",overflow:"hidden"}},(0,s.createElement)(E.__experimentalHStack,{spacing:10*S,justify:"center",style:{height:"100%",overflow:"hidden"}},(0,s.createElement)(E.__unstableMotion.div,{style:{fontFamily:o,fontSize:65*S,color:u,fontWeight:i},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:.3,type:"tween"}},"Aa"),(0,s.createElement)(E.__experimentalVStack,{spacing:4*S},k.map(((e,t)=>{let{slug:n,color:a}=e;return(0,s.createElement)(E.__unstableMotion.div,{key:n,style:{height:32*S,width:32*S,background:a,borderRadius:32*S/2},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:1===t?.2:.1}})}))))),(0,s.createElement)(E.__unstableMotion.div,{variants:a&&ml,style:{height:"100%",width:"100%",position:"absolute",top:0,overflow:"hidden",filter:"blur(60px)",opacity:.1}},(0,s.createElement)(E.__experimentalHStack,{spacing:0,justify:"flex-start",style:{height:"100%",overflow:"hidden"}},x.slice(0,4).map(((e,t)=>{let{color:n}=e;return(0,s.createElement)("div",{key:t,style:{height:"100%",background:n,flexGrow:1}})})))),(0,s.createElement)(E.__unstableMotion.div,{variants:dl,style:{height:"100%",width:"100%",overflow:"hidden",position:"absolute",top:0}},(0,s.createElement)(E.__experimentalVStack,{spacing:3*S,justify:"center",style:{height:"100%",overflow:"hidden",padding:10*S,boxSizing:"border-box"}},t&&(0,s.createElement)("div",{style:{fontSize:40*S,fontFamily:o,color:u,fontWeight:i,lineHeight:"1em",textAlign:"center"}},t)))))};var _l=function(){const{useGlobalStyle:e}=Qe(fe.privateApis),[t]=e("css"),{variations:n,canEditCSS:a}=(0,m.useSelect)((e=>{var t,n;const{getEntityRecord:a,__experimentalGetCurrentGlobalStylesId:r,__experimentalGetCurrentThemeGlobalStylesVariations:l}=e(_.store),o=r(),i=o?a("root","globalStyles",o):void 0;return{variations:l(),canEditCSS:null!==(t=!(null==i||null===(n=i._links)||void 0===n||!n["wp:action-edit-css"]))&&void 0!==t&&t}}),[]);return(0,s.createElement)(E.Card,{size:"small"},(0,s.createElement)(E.CardBody,null,(0,s.createElement)(E.__experimentalVStack,{spacing:4},(0,s.createElement)(E.Card,null,(0,s.createElement)(E.CardMedia,null,(0,s.createElement)(pl,null))),!(null==n||!n.length)&&(0,s.createElement)(E.__experimentalItemGroup,null,(0,s.createElement)(ar,{path:"/variations","aria-label":(0,y.__)("Browse styles")},(0,s.createElement)(E.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(E.FlexItem,null,(0,y.__)("Browse styles")),(0,s.createElement)(tr,{icon:(0,y.isRTL)()?se:ce})))),(0,s.createElement)(ol,null))),(0,s.createElement)(E.CardDivider,null),(0,s.createElement)(E.CardBody,null,(0,s.createElement)(E.__experimentalSpacer,{as:"p",paddingTop:2,paddingX:"13px",marginBottom:4},(0,y.__)("Customize the appearance of specific blocks for the whole site.")),(0,s.createElement)(E.__experimentalItemGroup,null,(0,s.createElement)(ar,{path:"/blocks","aria-label":(0,y.__)("Blocks styles")},(0,s.createElement)(E.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(E.FlexItem,null,(0,y.__)("Blocks")),(0,s.createElement)(tr,{icon:(0,y.isRTL)()?se:ce}))))),a&&!!t&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(E.CardDivider,null),(0,s.createElement)(E.CardBody,null,(0,s.createElement)(E.__experimentalSpacer,{as:"p",paddingTop:2,paddingX:"13px",marginBottom:4},(0,y.__)("Add your own CSS to customize the appearance and layout of your site.")),(0,s.createElement)(E.__experimentalItemGroup,null,(0,s.createElement)(ar,{path:"/css","aria-label":(0,y.__)("Additional CSS")},(0,s.createElement)(E.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(E.FlexItem,null,(0,y.__)("Additional CSS")),(0,s.createElement)(tr,{icon:(0,y.isRTL)()?se:ce})))))))};function hl(e){let{block:t}=e;const n=Ar(t.name),a=vr(t.name),r=ur(t.name),l=Sr(t.name),o=r||l,i=Ur(t.name);if(!(n||a||o||i))return null;const c=(0,y.sprintf)((0,y.__)("%s block styles"),t.title);return(0,s.createElement)(ar,{path:"/blocks/"+encodeURIComponent(t.name),"aria-label":c},(0,s.createElement)(E.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(fe.BlockIcon,{icon:t.icon}),(0,s.createElement)(E.FlexItem,null,t.title)))}var gl=function(){const e=function(){const e=(0,m.useSelect)((e=>e(c.store).getBlockTypes()),[]),{core:t,noncore:n}=e.reduce(((e,t)=>{const{core:n,noncore:a}=e;return(t.name.startsWith("core/")?n:a).push(t),e}),{core:[],noncore:[]});return[...t,...n]}(),[t,n]=(0,s.useState)(""),a=(0,te.useDebounce)(Lt.speak,500),r=(0,m.useSelect)((e=>e(c.store).isMatchingSearchTerm),[]),l=(0,s.useMemo)((()=>t?e.filter((e=>r(e,t))):e),[t,e,r]),o=(0,s.useRef)();return(0,s.useEffect)((()=>{if(!t)return;const e=o.current.childElementCount,n=(0,y.sprintf)((0,y._n)("%d result found.","%d results found.",e),e);a(n,e)}),[t,a]),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qr,{title:(0,y.__)("Blocks"),description:(0,y.__)("Customize the appearance of specific blocks and for the whole site.")}),(0,s.createElement)(E.SearchControl,{__nextHasNoMarginBottom:!0,className:"edit-site-block-types-search",onChange:n,value:t,label:(0,y.__)("Search for blocks"),placeholder:(0,y.__)("Search")}),(0,s.createElement)("div",{ref:o,className:"edit-site-block-types-item-list"},l.map((e=>(0,s.createElement)(hl,{block:e,key:"menu-itemblock-"+e.name})))))};var vl=function(e){let{name:t}=e;const n=(0,c.getBlockType)(t);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qr,{title:n.title}),(0,s.createElement)(Yr,{name:t}),(0,s.createElement)(ol,{parentMenu:"/blocks/"+encodeURIComponent(t),name:t}))};function fl(e){return e?`is-style-${e}`:""}const{useGlobalStyle:El}=Qe(fe.privateApis);function yl(e){let{name:t,parentMenu:n,element:a,label:r}=e;const l=!t,o="text"!==a&&a?`elements.${a}.`:"",i="link"===a?{textDecoration:"underline"}:{},[c]=El(o+"typography.fontFamily",t),[u]=El(o+"typography.fontStyle",t),[m]=El(o+"typography.fontWeight",t),[d]=El(o+"typography.letterSpacing",t),[p]=El(o+"color.background",t),[_]=El(o+"color.gradient",t),[h]=El(o+"color.text",t);if(!l)return null;const g=(0,y.sprintf)((0,y.__)("Typography %s styles"),r);return(0,s.createElement)(ar,{path:n+"/typography/"+a,"aria-label":g},(0,s.createElement)(E.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(E.FlexItem,{className:"edit-site-global-styles-screen-typography__indicator",style:{fontFamily:null!=c?c:"serif",background:null!=_?_:p,color:h,fontStyle:u,fontWeight:m,letterSpacing:d,...i}},(0,y.__)("Aa")),(0,s.createElement)(E.FlexItem,null,r)))}var bl=function(e){let{name:t,variation:n=""}=e;const a=void 0===t?"":"/blocks/"+t,r=fl(n);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qr,{title:(0,y.__)("Typography"),description:(0,y.__)("Manage the typography settings for different elements.")}),(0,s.createElement)(Yr,{name:t,variation:r}),!t&&(0,s.createElement)("div",{className:"edit-site-global-styles-screen-typography"},(0,s.createElement)(E.__experimentalVStack,{spacing:3},(0,s.createElement)(Xr,null,(0,y.__)("Elements")),(0,s.createElement)(E.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(yl,{name:t,parentMenu:a,element:"text",label:(0,y.__)("Text")}),(0,s.createElement)(yl,{name:t,parentMenu:a,element:"link",label:(0,y.__)("Links")}),(0,s.createElement)(yl,{name:t,parentMenu:a,element:"heading",label:(0,y.__)("Headings")}),(0,s.createElement)(yl,{name:t,parentMenu:a,element:"button",label:(0,y.__)("Buttons")})))),!!t&&(0,s.createElement)(Hr,{name:t,variation:n,element:"text"}))};const{useGlobalStyle:wl}=Qe(fe.privateApis);function Sl(e){let{name:t,element:n,headingLevel:a}=e,r="";"heading"===n?r=`elements.${a}.`:n&&"text"!==n&&(r=`elements.${n}.`);const[l]=wl(r+"typography.fontFamily",t),[o]=wl(r+"color.gradient",t),[i]=wl(r+"color.background",t),[c]=wl(r+"color.text",t),[u]=wl(r+"typography.fontSize",t),[m]=wl(r+"typography.fontStyle",t),[d]=wl(r+"typography.fontWeight",t),[p]=wl(r+"typography.letterSpacing",t),_="link"===n?{textDecoration:"underline"}:{};return(0,s.createElement)("div",{className:"edit-site-typography-preview",style:{fontFamily:null!=l?l:"serif",background:null!=o?o:i,color:c,fontSize:u,fontStyle:m,fontWeight:d,letterSpacing:p,..._}},"Aa")}const xl={text:{description:(0,y.__)("Manage the fonts used on the site."),title:(0,y.__)("Text")},link:{description:(0,y.__)("Manage the fonts and typography used on the links."),title:(0,y.__)("Links")},heading:{description:(0,y.__)("Manage the fonts and typography used on headings."),title:(0,y.__)("Headings")},button:{description:(0,y.__)("Manage the fonts and typography used on buttons."),title:(0,y.__)("Buttons")}};var kl=function(e){let{name:t,element:n}=e;const[a,r]=(0,s.useState)("heading");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qr,{title:xl[n].title,description:xl[n].description}),(0,s.createElement)(E.__experimentalSpacer,{marginX:4},(0,s.createElement)(Sl,{name:t,element:n,headingLevel:a})),"heading"===n&&(0,s.createElement)(E.__experimentalSpacer,{marginX:4,marginBottom:"1em"},(0,s.createElement)(E.__experimentalToggleGroupControl,{label:(0,y.__)("Select heading level"),hideLabelFromVision:!0,value:a,onChange:r,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0},(0,s.createElement)(E.__experimentalToggleGroupControlOption,{value:"heading",label:(0,y.__)("All")}),(0,s.createElement)(E.__experimentalToggleGroupControlOption,{value:"h1",label:(0,y.__)("H1")}),(0,s.createElement)(E.__experimentalToggleGroupControlOption,{value:"h2",label:(0,y.__)("H2")}),(0,s.createElement)(E.__experimentalToggleGroupControlOption,{value:"h3",label:(0,y.__)("H3")}),(0,s.createElement)(E.__experimentalToggleGroupControlOption,{value:"h4",label:(0,y.__)("H4")}),(0,s.createElement)(E.__experimentalToggleGroupControlOption,{value:"h5",label:(0,y.__)("H5")}),(0,s.createElement)(E.__experimentalToggleGroupControlOption,{value:"h6",label:(0,y.__)("H6")}))),(0,s.createElement)(Hr,{name:t,element:n,headingLevel:a}))};var Cl=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/SVG"},(0,s.createElement)(b.Path,{d:"M17.192 6.75L15.47 5.03l1.06-1.06 3.537 3.53-3.537 3.53-1.06-1.06 1.723-1.72h-3.19c-.602 0-.993.202-1.28.498-.309.319-.538.792-.695 1.383-.13.488-.222 1.023-.296 1.508-.034.664-.116 1.413-.303 2.117-.193.721-.513 1.467-1.068 2.04-.575.594-1.359.954-2.357.954H4v-1.5h4.003c.601 0 .993-.202 1.28-.498.308-.319.538-.792.695-1.383.149-.557.216-1.093.288-1.662l.039-.31a9.653 9.653 0 0 1 .272-1.653c.193-.722.513-1.467 1.067-2.04.576-.594 1.36-.954 2.358-.954h3.19zM8.004 6.75c.8 0 1.46.23 1.988.628a6.24 6.24 0 0 0-.684 1.396 1.725 1.725 0 0 0-.024-.026c-.287-.296-.679-.498-1.28-.498H4v-1.5h4.003zM12.699 14.726c-.161.459-.38.94-.684 1.396.527.397 1.188.628 1.988.628h3.19l-1.722 1.72 1.06 1.06L20.067 16l-3.537-3.53-1.06 1.06 1.723 1.72h-3.19c-.602 0-.993-.202-1.28-.498a1.96 1.96 0 0 1-.024-.026z"}));var Tl=function(e){let{className:t,...n}=e;return(0,s.createElement)(E.Flex,g({className:f()("edit-site-global-styles__color-indicator-wrapper",t)},n))};const{useGlobalSetting:Nl}=Qe(fe.privateApis),Ml=[];var Il=function(e){let{name:t}=e;const[n]=Nl("color.palette.custom"),[a]=Nl("color.palette.theme"),[r]=Nl("color.palette.default"),[l]=Nl("color.defaultPalette",t),[o]=function(e){const[t,n]=Je("color.palette.theme",e);return window.__experimentalEnableColorRandomizer?[function(){const e=Math.floor(225*Math.random()),a=t.map((t=>{const{color:n}=t,a=je(n).rotate(e).toHex();return{...t,color:a}}));n(a)}]:[]}(),i=(0,s.useMemo)((()=>[...n||Ml,...a||Ml,...r&&l?r:Ml]),[n,a,r,l]),c=t?"/blocks/"+encodeURIComponent(t)+"/colors/palette":"/colors/palette",u=i.length>0?(0,y.sprintf)((0,y._n)("%d color","%d colors",i.length),i.length):(0,y.__)("Add custom colors");return(0,s.createElement)(E.__experimentalVStack,{spacing:3},(0,s.createElement)(Xr,null,(0,y.__)("Palette")),(0,s.createElement)(E.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(ar,{path:c,"aria-label":(0,y.__)("Color palettes")},(0,s.createElement)(E.__experimentalHStack,{direction:0===i.length?"row-reverse":"row"},(0,s.createElement)(E.__experimentalZStack,{isLayered:!1,offset:-8},i.slice(0,5).map(((e,t)=>{let{color:n}=e;return(0,s.createElement)(Tl,{key:`${n}-${t}`},(0,s.createElement)(E.ColorIndicator,{colorValue:n}))}))),(0,s.createElement)(E.FlexItem,null,u)))),o&&(0,s.createElement)(E.Button,{variant:"secondary",icon:Cl,onClick:o},(0,y.__)("Randomize colors")))};const{useGlobalStyle:Pl}=Qe(fe.privateApis);function Bl(e){let{name:t,parentMenu:n,variation:a=""}=e;const r=a?`variations.${a}.`:"",l=a?`/variations/${a}`:"",o=tt(t),i=o.includes("backgroundColor")||o.includes("background"),[c]=Pl(r+"color.background",t),[u]=Pl(r+"color.gradient",t);return i?(0,s.createElement)(ar,{path:n+l+"/colors/background","aria-label":(0,y.__)("Colors background styles")},(0,s.createElement)(E.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(Tl,{expanded:!1},(0,s.createElement)(E.ColorIndicator,{colorValue:null!=u?u:c,"data-testid":"background-color-indicator"})),(0,s.createElement)(E.FlexItem,{className:"edit-site-global-styles__color-label"},(0,y.__)("Background")))):null}function zl(e){let{name:t,parentMenu:n,variation:a=""}=e;const r=a?`variations.${a}.`:"",l=a?`/variations/${a}`:"",o=tt(t).includes("color"),[i]=Pl(r+"color.text",t);return o?(0,s.createElement)(ar,{path:n+l+"/colors/text","aria-label":(0,y.__)("Colors text styles")},(0,s.createElement)(E.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(Tl,{expanded:!1},(0,s.createElement)(E.ColorIndicator,{colorValue:i,"data-testid":"text-color-indicator"})),(0,s.createElement)(E.FlexItem,{className:"edit-site-global-styles__color-label"},(0,y.__)("Text")))):null}function Vl(e){let{name:t,parentMenu:n,variation:a=""}=e;const r=a?`variations.${a}.`:"",l=a?`/variations/${a}`:"",o=tt(t).includes("linkColor"),[i]=Pl(r+"elements.link.color.text",t),[c]=Pl(r+"elements.link.:hover.color.text",t);return o?(0,s.createElement)(ar,{path:n+l+"/colors/link","aria-label":(0,y.__)("Colors link styles")},(0,s.createElement)(E.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(E.__experimentalZStack,{isLayered:!1,offset:-8},(0,s.createElement)(Tl,{expanded:!1},(0,s.createElement)(E.ColorIndicator,{colorValue:i})),(0,s.createElement)(Tl,{expanded:!1},(0,s.createElement)(E.ColorIndicator,{colorValue:c}))),(0,s.createElement)(E.FlexItem,{className:"edit-site-global-styles__color-label"},(0,y.__)("Links")))):null}function Rl(e){let{name:t,parentMenu:n,variation:a=""}=e;const r=a?`variations.${a}.`:"",l=a?`/variations/${a}`:"",o=tt(t).includes("color"),[i]=Pl(r+"elements.heading.color.text",t),[c]=Pl(r+"elements.heading.color.background",t);return o?(0,s.createElement)(ar,{path:n+l+"/colors/heading","aria-label":(0,y.__)("Colors heading styles")},(0,s.createElement)(E.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(E.__experimentalZStack,{isLayered:!1,offset:-8},(0,s.createElement)(Tl,{expanded:!1},(0,s.createElement)(E.ColorIndicator,{colorValue:c})),(0,s.createElement)(Tl,{expanded:!1},(0,s.createElement)(E.ColorIndicator,{colorValue:i}))),(0,s.createElement)(E.FlexItem,null,(0,y.__)("Headings")))):null}function Al(e){let{name:t,parentMenu:n,variation:a=""}=e;const r=a?`variations.${a}.`:"",l=a?`/variations/${a}`:"",o=tt(t).includes("buttonColor"),[i]=Pl(r+"elements.button.color.text",t),[c]=Pl(r+"elements.button.color.background",t);return o?(0,s.createElement)(ar,{path:n+l+"/colors/button"},(0,s.createElement)(E.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(E.__experimentalZStack,{isLayered:!1,offset:-8},(0,s.createElement)(Tl,{expanded:!1},(0,s.createElement)(E.ColorIndicator,{colorValue:c})),(0,s.createElement)(Tl,{expanded:!1},(0,s.createElement)(E.ColorIndicator,{colorValue:i}))),(0,s.createElement)(E.FlexItem,{className:"edit-site-global-styles__color-label"},(0,y.__)("Buttons")))):null}var Ll=function(e){let{name:t,variation:n=""}=e;const a=void 0===t?"":"/blocks/"+encodeURIComponent(t),r=fl(n);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qr,{title:(0,y.__)("Colors"),description:(0,y.__)("Manage palettes and the default color of different global elements on the site.")}),(0,s.createElement)(Yr,{name:t,variation:r}),(0,s.createElement)("div",{className:"edit-site-global-styles-screen-colors"},(0,s.createElement)(E.__experimentalVStack,{spacing:10},(0,s.createElement)(Il,{name:t}),(0,s.createElement)(E.__experimentalVStack,{spacing:3},(0,s.createElement)(Xr,null,(0,y.__)("Elements")),(0,s.createElement)(E.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(Bl,{name:t,parentMenu:a,variation:n}),(0,s.createElement)(zl,{name:t,parentMenu:a,variation:n}),(0,s.createElement)(Vl,{name:t,parentMenu:a,variation:n}),(0,s.createElement)(Rl,{name:t,parentMenu:a,variation:n}),(0,s.createElement)(Al,{name:t,parentMenu:a,variation:n}))))))};const{useGlobalSetting:Dl}=Qe(fe.privateApis);function Gl(e){let{name:t}=e;const[n,a]=Dl("color.palette.theme",t),[r]=Dl("color.palette.theme",t,"base"),[l,o]=Dl("color.palette.default",t),[i]=Dl("color.palette.default",t,"base"),[c,u]=Dl("color.palette.custom",t),[m]=Dl("color.defaultPalette",t);return(0,s.createElement)(E.__experimentalVStack,{className:"edit-site-global-styles-color-palette-panel",spacing:10},!!n&&!!n.length&&(0,s.createElement)(E.__experimentalPaletteEdit,{canReset:n!==r,canOnlyChangeValues:!0,colors:n,onChange:a,paletteLabel:(0,y.__)("Theme")}),!!l&&!!l.length&&!!m&&(0,s.createElement)(E.__experimentalPaletteEdit,{canReset:l!==i,canOnlyChangeValues:!0,colors:l,onChange:o,paletteLabel:(0,y.__)("Default")}),(0,s.createElement)(E.__experimentalPaletteEdit,{colors:c,onChange:u,paletteLabel:(0,y.__)("Custom"),emptyMessage:(0,y.__)("Custom colors are empty! Add some colors to create your own color palette."),slugPrefix:"custom-"}))}const{useGlobalSetting:Fl}=Qe(fe.privateApis),Ol=()=>{};function Hl(e){let{name:t}=e;const[n,a]=Fl("color.gradients.theme",t),[r]=Fl("color.gradients.theme",t,"base"),[l,o]=Fl("color.gradients.default",t),[i]=Fl("color.gradients.default",t,"base"),[c,u]=Fl("color.gradients.custom",t),[m]=Fl("color.defaultGradients",t),[d]=Fl("color.duotone.custom")||[],[p]=Fl("color.duotone.default")||[],[_]=Fl("color.duotone.theme")||[],[h]=Fl("color.defaultDuotone"),g=[...d||[],..._||[],...p&&h?p:[]];return(0,s.createElement)(E.__experimentalVStack,{className:"edit-site-global-styles-gradient-palette-panel",spacing:10},!!n&&!!n.length&&(0,s.createElement)(E.__experimentalPaletteEdit,{canReset:n!==r,canOnlyChangeValues:!0,gradients:n,onChange:a,paletteLabel:(0,y.__)("Theme")}),!!l&&!!l.length&&!!m&&(0,s.createElement)(E.__experimentalPaletteEdit,{canReset:l!==i,canOnlyChangeValues:!0,gradients:l,onChange:o,paletteLabel:(0,y.__)("Default")}),(0,s.createElement)(E.__experimentalPaletteEdit,{gradients:c,onChange:u,paletteLabel:(0,y.__)("Custom"),emptyMessage:(0,y.__)("Custom gradients are empty! Add some gradients to create your own palette."),slugPrefix:"custom-"}),!!g&&!!g.length&&(0,s.createElement)("div",null,(0,s.createElement)(Xr,null,(0,y.__)("Duotone")),(0,s.createElement)(E.__experimentalSpacer,{margin:3}),(0,s.createElement)(E.DuotonePicker,{duotonePalette:g,disableCustomDuotone:!0,disableCustomColors:!0,clearable:!1,onChange:Ol})))}var $l=function(e){let{name:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qr,{title:(0,y.__)("Palette"),description:(0,y.__)("Palettes are used to provide default color options for blocks and various design tools. Here you can edit the colors with their labels.")}),(0,s.createElement)(E.TabPanel,{tabs:[{name:"solid",title:"Solid",value:"solid"},{name:"gradient",title:"Gradient",value:"gradient"}]},(e=>(0,s.createElement)(s.Fragment,null,"solid"===e.value&&(0,s.createElement)(Gl,{name:t}),"gradient"===e.value&&(0,s.createElement)(Hl,{name:t})))))};const{useGlobalSetting:Ul,useGlobalStyle:Wl}=Qe(fe.privateApis);var jl=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",r=tt(t),[l]=Ul("color.custom",t),[o]=Ul("color.customGradient",t),i=nt(t),c=at(t),[u]=Ul("color.background",t),m=r.includes("backgroundColor")&&u&&(i.length>0||l),d=r.includes("background")&&(c.length>0||o),[p,_]=Wl(a+"color.background",t),[h]=Wl(a+"color.background",t,"user"),[v,E]=Wl(a+"color.gradient",t),[b]=Wl(a+"color.gradient",t,"user");if(!m&&!d)return null;let w={};m&&(w={colorValue:p,onColorChange:_},p&&(w.clearable=p===h));let S={};d&&(S={gradientValue:v,onGradientChange:E},v&&(S.clearable=v===b));const x={...w,...S};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qr,{title:(0,y.__)("Background"),description:(0,y.__)("Set a background color or gradient for the whole site.")}),(0,s.createElement)(fe.__experimentalColorGradientControl,g({className:f()("edit-site-screen-background-color__control",{"has-no-tabs":!m||!d}),colors:i,gradients:c,disableCustomColors:!l,disableCustomGradients:!o,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0},x)))};const{useGlobalSetting:ql,useGlobalStyle:Yl}=Qe(fe.privateApis);var Xl=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",r=tt(t),[l]=ql("color.custom",t),[o]=ql("color.text",t),i=nt(t),c=r.includes("color")&&o&&(i.length>0||l),[u,m]=Yl(a+"color.text",t),[d]=Yl(a+"color.text",t,"user");return c?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qr,{title:(0,y.__)("Text"),description:(0,y.__)("Set the default color used for text across the site.")}),(0,s.createElement)(fe.__experimentalColorGradientControl,{className:"edit-site-screen-text-color__control",colors:i,disableCustomColors:!l,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:u,onColorChange:m,clearable:u===d})):null};const{useGlobalSetting:Zl,useGlobalStyle:Kl}=Qe(fe.privateApis);var Ql=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",r=tt(t),[l]=Zl("color.custom",t),o=nt(t),[i]=Zl("color.link",t),c=r.includes("linkColor")&&i&&(o.length>0||l),u={default:{label:(0,y.__)("Default"),value:Kl(a+"elements.link.color.text",t)[0],handler:Kl(a+"elements.link.color.text",t)[1],userValue:Kl(a+"elements.link.color.text",t,"user")[0]},hover:{label:(0,y.__)("Hover"),value:Kl(a+"elements.link.:hover.color.text",t)[0],handler:Kl(a+"elements.link.:hover.color.text",t)[1],userValue:Kl(a+"elements.link.:hover.color.text",t,"user")[0]}};if(!c)return null;const m=Object.entries(u).map((e=>{let[t,n]=e;return{name:t,title:n.label,className:`color-text-${t}`}}));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qr,{title:(0,y.__)("Links"),description:(0,y.__)("Set the colors used for links across the site.")}),(0,s.createElement)(E.TabPanel,{tabs:m},(e=>{var t;const n=null!==(t=u[e.name])&&void 0!==t?t:null;return n?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fe.__experimentalColorGradientControl,{className:"edit-site-screen-link-color__control",colors:o,disableCustomColors:!l,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:n.value,onColorChange:n.handler,clearable:n.value===n.userValue})):null})))};const{useGlobalSetting:Jl,useGlobalStyle:eo}=Qe(fe.privateApis);var to=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",[r,l]=(0,s.useState)("heading"),o=tt(t),[i]=Jl("color.custom",t),[c]=Jl("color.customGradient",t),[u]=Jl("color.text",t),[m]=Jl("color.background",t),d=nt(t),p=at(t),_=o.includes("color")&&u&&(d.length>0||i),h=o.includes("backgroundColor")&&m&&(d.length>0||i),v=o.includes("background")&&(p.length>0||c),[f,b]=eo(a+"elements."+r+".color.text",t),[w]=eo(a+"elements."+r+".color.text",t,"user"),[S,x]=eo(a+"elements."+r+".color.background",t),[k]=eo(a+"elements."+r+".color.background",t,"user"),[C,T]=eo(a+"elements."+r+".color.gradient",t),[N]=eo(a+"elements."+r+".color.gradient",t,"user");if(!_&&!h&&!v)return null;let M={};h&&(M={colorValue:S,onColorChange:x},S&&(M.clearable=S===k));let I={};v&&(I={gradientValue:C,onGradientChange:T},C&&(I.clearable=C===N));const P={...M,...I};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qr,{title:(0,y.__)("Headings"),description:(0,y.__)("Set the default color used for headings across the site.")}),(0,s.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,s.createElement)("h4",null,(0,y.__)("Select heading level")),(0,s.createElement)(E.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,y.__)("Select heading level"),hideLabelFromVision:!0,value:r,onChange:l,isBlock:!0},(0,s.createElement)(E.__experimentalToggleGroupControlOption,{value:"heading",label:(0,y.__)("All")}),(0,s.createElement)(E.__experimentalToggleGroupControlOption,{value:"h1",label:(0,y.__)("H1")}),(0,s.createElement)(E.__experimentalToggleGroupControlOption,{value:"h2",label:(0,y.__)("H2")}),(0,s.createElement)(E.__experimentalToggleGroupControlOption,{value:"h3",label:(0,y.__)("H3")}),(0,s.createElement)(E.__experimentalToggleGroupControlOption,{value:"h4",label:(0,y.__)("H4")}),(0,s.createElement)(E.__experimentalToggleGroupControlOption,{value:"h5",label:(0,y.__)("H5")}),(0,s.createElement)(E.__experimentalToggleGroupControlOption,{value:"h6",label:(0,y.__)("H6")}))),_&&(0,s.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,s.createElement)("h4",null,"heading"===r?(0,y.__)("Text color for all heading levels"):(0,y.sprintf)((0,y.__)("Text color for %s"),r.toUpperCase())),(0,s.createElement)(fe.__experimentalColorGradientControl,{className:"edit-site-screen-heading-text-color__control",colors:d,disableCustomColors:!i,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:f,onColorChange:b,clearable:f===w})),h&&(0,s.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,s.createElement)("h4",null,"heading"===r?(0,y.__)("Background color for all heading levels"):(0,y.sprintf)((0,y.__)("Background color for %s"),r.toUpperCase())),(0,s.createElement)(fe.__experimentalColorGradientControl,g({className:"edit-site-screen-heading-background-color__control",colors:d,gradients:p,disableCustomColors:!i,disableCustomGradients:!c,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0},P))))};const{useGlobalSetting:no,useGlobalStyle:ao}=Qe(fe.privateApis);var ro=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",r=tt(t),l=nt(t),[o]=no("color.custom",t),[i]=no("color.background",t),c=r.includes("buttonColor")&&i&&(l.length>0||o),[u,m]=ao(a+"elements.button.color.text",t),[d]=ao("elements.button.color.text",t,"user"),[p,_]=ao("elements.button.color.background",t),[h]=ao("elements.button.color.background",t,"user");return c?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qr,{title:(0,y.__)("Buttons"),description:(0,y.__)("Set the default colors used for buttons across the site.")}),(0,s.createElement)("h4",{className:"edit-site-global-styles-section-title"},(0,y.__)("Text color")),(0,s.createElement)(fe.__experimentalColorGradientControl,{className:"edit-site-screen-button-color__control",colors:l,disableCustomColors:!o,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:u,onColorChange:m,clearable:u===d}),(0,s.createElement)("h4",{className:"edit-site-global-styles-section-title"},(0,y.__)("Background color")),(0,s.createElement)(fe.__experimentalColorGradientControl,{className:"edit-site-screen-button-color__control",colors:l,disableCustomColors:!o,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:p,onColorChange:_,clearable:p===h})):null};var lo=function(e){let{name:t,variation:n=""}=e;const a=Sr(t),r=fl(n);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qr,{title:(0,y.__)("Layout")}),(0,s.createElement)(Yr,{name:t,variation:r}),a&&(0,s.createElement)(zr,{name:t,variation:n}))},oo=n(5619),io=n.n(oo);function so(){return(0,s.createElement)("div",{className:"edit-site-canvas-spinner"},(0,s.createElement)(E.Spinner,null))}const{GlobalStylesContext:co}=Qe(fe.privateApis);function uo(e,t){if(Array.isArray(t))return t}function mo(e,t){return(0,ve.mergeWith)({},e,t,uo)}const po=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.fromEntries(Object.entries((0,ve.mapValues)(e,po)).filter((e=>{let[,t]=e;return Boolean(t)})));return(0,ve.isEmpty)(t)?void 0:t};function _o(){const[e,t,n]=function(){const{globalStylesId:e,isReady:t,settings:n,styles:a}=(0,m.useSelect)((e=>{const{getEditedEntityRecord:t,hasFinishedResolution:n}=e(_.store),a=e(_.store).__experimentalGetCurrentGlobalStylesId(),r=a?t("root","globalStyles",a):void 0;let l=!1;return n("__experimentalGetCurrentGlobalStylesId")&&(l=!a||n("getEditedEntityRecord",["root","globalStyles",a])),{globalStylesId:a,isReady:l,settings:null==r?void 0:r.settings,styles:null==r?void 0:r.styles}}),[]),{getEditedEntityRecord:r}=(0,m.useSelect)(_.store),{editEntityRecord:l}=(0,m.useDispatch)(_.store),o=(0,s.useMemo)((()=>({settings:null!=n?n:{},styles:null!=a?a:{}})),[n,a]),i=(0,s.useCallback)((function(t){var n,a;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=r("root","globalStyles",e),s=t({styles:null!==(n=null==i?void 0:i.styles)&&void 0!==n?n:{},settings:null!==(a=null==i?void 0:i.settings)&&void 0!==a?a:{}});l("root","globalStyles",e,{styles:po(s.styles)||{},settings:po(s.settings)||{}},o)}),[e]);return[t,o,i]}(),[a,r]=function(){const e=(0,m.useSelect)((e=>e(_.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),l=(0,s.useMemo)((()=>r&&t?mo(r,t):{}),[t,r]);return(0,s.useMemo)((()=>({isReady:e&&a,user:t,base:r,merged:l,setUserConfig:n})),[l,t,r,n,e,a])}function ho(e){let{children:t}=e;const n=_o();return n.isReady?(0,s.createElement)(co.Provider,{value:n},t):(0,s.createElement)(so,null)}const{GlobalStylesContext:go}=Qe(fe.privateApis);function vo(e){let{variation:t}=e;const[n,a]=(0,s.useState)(!1),{base:r,user:l,setUserConfig:o}=(0,s.useContext)(go),i=(0,s.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:r,merged:mo(r,t),setUserConfig:()=>{}}}),[t,r]),c=()=>{o((()=>({settings:t.settings,styles:t.styles})))},u=(0,s.useMemo)((()=>function(e,t){return io()(e.styles,t.styles)&&io()(e.settings,t.settings)}(l,t)),[l,t]);return(0,s.createElement)(go.Provider,{value:i},(0,s.createElement)("div",{className:f()("edit-site-global-styles-variations_item",{"is-active":u}),role:"button",onClick:c,onKeyDown:e=>{e.keyCode===Wa.ENTER&&(e.preventDefault(),c())},tabIndex:"0","aria-label":null==t?void 0:t.title,"aria-current":u,onFocus:()=>a(!0),onBlur:()=>a(!1)},(0,s.createElement)("div",{className:"edit-site-global-styles-variations_item-preview"},(0,s.createElement)(pl,{label:null==t?void 0:t.title,isFocused:n,withHoverView:!0}))))}var fo=function(){const{variations:e,mode:t}=(0,m.useSelect)((e=>({variations:e(_.store).__experimentalGetCurrentThemeGlobalStylesVariations(),mode:e(fe.store).__unstableGetEditorMode()})),[]),n=(0,s.useMemo)((()=>[{title:(0,y.__)("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]),{__unstableSetEditorMode:a}=(0,m.useDispatch)(fe.store),r=(0,s.useRef)(null);return(0,s.useEffect)((()=>{"zoom-out"!==t&&(r.current=!1)}),[t]),(0,s.useEffect)((()=>{if("zoom-out"!==t)return a("zoom-out"),r.current=!0,()=>{r.current&&a(t)}}),[]),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qr,{back:"/",title:(0,y.__)("Browse styles"),description:(0,y.__)("Choose a variation to change the look of the site.")}),(0,s.createElement)(E.Card,{size:"small",isBorderless:!0},(0,s.createElement)(E.CardBody,null,(0,s.createElement)(E.__experimentalGrid,{columns:2},null==n?void 0:n.map(((e,t)=>(0,s.createElement)(vo,{key:t,variation:e})))))))};var Eo=function(e){let{name:t,variation:n=""}=e;const a=ur(t),r=fl(n);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qr,{title:(0,y.__)("Border & Shadow")}),(0,s.createElement)(Yr,{name:t,variation:r}),a&&(0,s.createElement)(gr,{name:t,variation:n}))};const{useGlobalStyle:yo}=Qe(fe.privateApis),bo="EditSiteStyleBook",{Slot:wo,Fill:So}=(0,E.createSlotFill)(bo);function xo(){return[{name:"core/heading",title:(0,y.__)("Headings"),category:"text",blocks:[(0,c.createBlock)("core/heading",{content:(0,y.__)("Code Is Poetry"),level:1}),(0,c.createBlock)("core/heading",{content:(0,y.__)("Code Is Poetry"),level:2}),(0,c.createBlock)("core/heading",{content:(0,y.__)("Code Is Poetry"),level:3}),(0,c.createBlock)("core/heading",{content:(0,y.__)("Code Is Poetry"),level:4}),(0,c.createBlock)("core/heading",{content:(0,y.__)("Code Is Poetry"),level:5})]},...(0,c.getBlockTypes)().filter((e=>{const{name:t,example:n,supports:a}=e;return"core/heading"!==t&&!!n&&!1!==a.inserter})).map((e=>({name:e.name,title:e.title,category:e.category,blocks:(0,c.getBlockFromExample)(e.name,e.example)})))]}function ko(e){let{isSelected:t,onSelect:n,onClose:a}=e;const[r,l]=(0,te.useResizeObserver)(),[o]=yo("color.text"),[i]=yo("color.background"),u=(0,s.useMemo)(xo,[]),m=(0,s.useMemo)((()=>(0,c.getCategories)().filter((e=>u.some((t=>t.category===e.slug)))).map((e=>({name:e.slug,title:e.title,icon:e.icon})))),[u]);return(0,s.createElement)(So,null,(0,s.createElement)("section",{className:f()("edit-site-style-book",{"is-wide":l.width>600}),style:{color:o,background:i},"aria-label":(0,y.__)("Style Book")},r,(0,s.createElement)(E.Button,{className:"edit-site-style-book__close-button",icon:C,label:(0,y.__)("Close Style Book"),onClick:a}),(0,s.createElement)(E.TabPanel,{className:"edit-site-style-book__tab-panel",tabs:m},(e=>(0,s.createElement)(Co,{examples:u,category:e.name,isSelected:t,onSelect:n})))))}const Co=(0,s.memo)((e=>{let{examples:t,category:n,isSelected:a,onSelect:r}=e;return(0,s.createElement)("div",{className:"edit-site-style-book__examples"},t.filter((e=>e.category===n)).map((e=>(0,s.createElement)(To,{key:e.name,title:e.title,blocks:e.blocks,isSelected:a(e.name),onClick:()=>{r(e.name)}}))))})),To=(0,s.memo)((e=>{let{title:t,blocks:n,isSelected:a,onClick:r}=e;return(0,s.createElement)("button",{className:f()("edit-site-style-book__example",{"is-selected":a}),"aria-label":(0,y.sprintf)((0,y.__)("Open %s styles in Styles panel"),t),onClick:r},(0,s.createElement)("span",{className:"edit-site-style-book__example-title"},t),(0,s.createElement)("div",{className:"edit-site-style-book__example-preview"},(0,s.createElement)(fe.BlockPreview,{blocks:n,viewportWidth:0,additionalStyles:[{css:".wp-block:first-child { margin-top: 0; }.wp-block:last-child { margin-bottom: 0; }"}]})))}));ko.Slot=wo;var No=ko;var Mo=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));const{useGlobalStyle:Io}=Qe(fe.privateApis);var Po=function(e){let{blockName:t}=e;const n=t||null,[a,r]=Io("css",n),[l]=Io("css",n,"base"),[o,i]=(0,s.useState)(null),c="/* IgnoreThemeCustomCSS */",u=!a&&l?`/* ${(0,y.__)("Theme Custom CSS start")} */\n${l}\n/* ${(0,y.__)("Theme Custom CSS end")} */`:void 0,m=l&&a&&u!==a?l:void 0;return(0,s.createElement)(s.Fragment,null,m&&(0,s.createElement)(E.Panel,null,(0,s.createElement)(E.PanelBody,{title:(0,y.__)("Original Theme Custom CSS"),initialOpen:!1},(0,s.createElement)("pre",{className:"edit-site-global-styles__custom-css-theme-css"},m))),(0,s.createElement)(E.__experimentalVStack,{spacing:3},(0,s.createElement)(Xr,null,(0,y.__)("ADDITIONAL CSS")),(0,s.createElement)(E.TextareaControl,{__nextHasNoMarginBottom:!0,value:(null==a?void 0:a.replace(c,""))||u,onChange:e=>function(e){if(l&&""===e)r(c);else if(r(e),o){const[t]=(0,fe.transformStyles)([{css:e}],".editor-styles-wrapper");t&&i(null)}}(e),onBlur:function(e){var t;if(null==e||null===(t=e.target)||void 0===t||!t.value)return void i(null);const[n]=(0,fe.transformStyles)([{css:e.target.value}],".editor-styles-wrapper");i(null===n?(0,y.__)("There is an error with your CSS structure."):null)},className:"edit-site-global-styles__custom-css-input",spellCheck:!1}),o&&(0,s.createElement)(E.Tooltip,{text:o},(0,s.createElement)("div",{className:"edit-site-global-styles__custom-css-validation-wrapper"},(0,s.createElement)(E.Icon,{icon:Mo,className:"edit-site-global-styles__custom-css-validation-icon"})))))};var Bo=function(e){let{name:t}=e;const n=(0,c.getBlockType)(t),a=null==n?void 0:n.title,r=void 0!==a?(0,y.sprintf)((0,y.__)("Add your own CSS to customize the appearance of the %s block."),a):(0,y.__)("Add your own CSS to customize the appearance and layout of your site.");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qr,{title:(0,y.__)("CSS"),description:(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)(E.ExternalLink,{href:"https://wordpress.org/support/article/css/",className:"edit-site-global-styles-screen-css-help-link"},(0,y.__)("Learn more about CSS")))}),(0,s.createElement)("div",{className:"edit-site-global-styles-screen-css"},(0,s.createElement)(Po,{blockName:t})))};var zo=function(e){let{name:t,variation:n=""}=e;const a=fl(n),r=el(t);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qr,{title:(0,y.__)("Shadow")}),(0,s.createElement)(Yr,{name:t,variation:a}),r&&(0,s.createElement)(tl,{name:t,variation:n}))};const{Slot:Vo,Fill:Ro}=(0,E.createSlotFill)("GlobalStylesMenu");function Ao(){const{toggle:e}=(0,m.useDispatch)(T.store),{canEditCSS:t}=(0,m.useSelect)((e=>{var t,n;const{getEntityRecord:a,__experimentalGetCurrentGlobalStylesId:r}=e(_.store),l=r(),o=l?a("root","globalStyles",l):void 0;return{canEditCSS:null!==(t=!(null==o||null===(n=o._links)||void 0===n||!n["wp:action-edit-css"]))&&void 0!==t&&t}}),[]),{useGlobalStylesReset:n}=Qe(fe.privateApis),[a,r]=n(),{goTo:l}=(0,E.__experimentalUseNavigator)();return(0,s.createElement)(Ro,null,(0,s.createElement)(E.DropdownMenu,{icon:re,label:(0,y.__)("More Styles actions"),controls:[{title:(0,y.__)("Reset to defaults"),onClick:r,isDisabled:!a},{title:(0,y.__)("Welcome Guide"),onClick:()=>e("core/edit-site","welcomeGuideStyles")},...t?[{title:(0,y.__)("Additional CSS"),onClick:()=>l("/css")}]:[]]}))}function Lo(e){let{className:t,...n}=e;return(0,s.createElement)(E.__experimentalNavigatorScreen,g({className:["edit-site-global-styles-sidebar__navigator-screen",t].filter(Boolean).join(" ")},n))}function Do(e){let{name:t}=e;const n=(0,m.useSelect)((e=>{const{getBlockStyles:n}=e(c.store);return n(t)}),[t]);return null!=n&&n.length?n.map((e=>(0,s.createElement)(Fo,{key:e.name+t,name:t,parentMenu:"/blocks/"+encodeURIComponent(t)+"/variations/"+encodeURIComponent(e.name),variation:e.name}))):null}function Go(e){let{parentMenu:t,blockStyles:n,blockName:a}=e;return n.map(((e,n)=>(0,s.createElement)(Lo,{key:n,path:t+"/variations/"+e.name},(0,s.createElement)(Kr,{blockName:a,style:e}))))}function Fo(e){let{name:t,parentMenu:n="",variation:a=""}=e;const r=(0,m.useSelect)((e=>{const{getBlockStyles:n}=e(c.store);return n(t)}),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Lo,{path:n+"/typography"},(0,s.createElement)(bl,{name:t,variation:a})),(0,s.createElement)(Lo,{path:n+"/typography/text"},(0,s.createElement)(kl,{name:t,element:"text"})),(0,s.createElement)(Lo,{path:n+"/typography/link"},(0,s.createElement)(kl,{name:t,element:"link"})),(0,s.createElement)(Lo,{path:n+"/typography/heading"},(0,s.createElement)(kl,{name:t,element:"heading"})),(0,s.createElement)(Lo,{path:n+"/typography/button"},(0,s.createElement)(kl,{name:t,element:"button"})),(0,s.createElement)(Lo,{path:n+"/colors"},(0,s.createElement)(Ll,{name:t,variation:a})),(0,s.createElement)(Lo,{path:n+"/colors/palette"},(0,s.createElement)($l,{name:t})),(0,s.createElement)(Lo,{path:n+"/colors/background"},(0,s.createElement)(jl,{name:t,variation:a})),(0,s.createElement)(Lo,{path:n+"/colors/text"},(0,s.createElement)(Xl,{name:t,variation:a})),(0,s.createElement)(Lo,{path:n+"/colors/link"},(0,s.createElement)(Ql,{name:t,variation:a})),(0,s.createElement)(Lo,{path:n+"/colors/heading"},(0,s.createElement)(to,{name:t,variation:a})),(0,s.createElement)(Lo,{path:n+"/colors/button"},(0,s.createElement)(ro,{name:t,variation:a})),(0,s.createElement)(Lo,{path:n+"/border"},(0,s.createElement)(Eo,{name:t,variation:a})),(0,s.createElement)(Lo,{path:n+"/effects"},(0,s.createElement)(zo,{name:t,variation:a})),(0,s.createElement)(Lo,{path:n+"/layout"},(0,s.createElement)(lo,{name:t,variation:a})),(0,s.createElement)(Lo,{path:n+"/css"},(0,s.createElement)(Bo,{name:t})),!(null==r||!r.length)&&(0,s.createElement)(Go,{parentMenu:n,blockStyles:r,blockName:t}))}function Oo(e){let{onClose:t}=e;const n=(0,E.__experimentalUseNavigator)(),{path:a}=n.location;return(0,s.createElement)(No,{isSelected:e=>a===`/blocks/${encodeURIComponent(e)}`||a.startsWith(`/blocks/${encodeURIComponent(e)}/`),onSelect:e=>{n.goTo("/blocks/"+encodeURIComponent(e))},onClose:t})}var Ho=function(e){let{isStyleBookOpened:t,onCloseStyleBook:n}=e;const a=(0,c.getBlockTypes)();return(0,s.createElement)(E.__experimentalNavigatorProvider,{className:"edit-site-global-styles-sidebar__navigator-provider",initialPath:"/"},(0,s.createElement)(Lo,{path:"/"},(0,s.createElement)(_l,null)),(0,s.createElement)(Lo,{path:"/variations"},(0,s.createElement)(fo,null)),(0,s.createElement)(Lo,{path:"/blocks"},(0,s.createElement)(gl,null)),a.map((e=>(0,s.createElement)(Lo,{key:"menu-block-"+e.name,path:"/blocks/"+encodeURIComponent(e.name)},(0,s.createElement)(vl,{name:e.name})))),(0,s.createElement)(Fo,null),a.map((e=>(0,s.createElement)(Fo,{key:"screens-block-"+e.name,name:e.name,parentMenu:"/blocks/"+encodeURIComponent(e.name)}))),a.map(((e,t)=>(0,s.createElement)(Do,{key:"screens-block-styles-"+e.name+t,name:e.name}))),t&&(0,s.createElement)(Oo,{onClose:n}),(0,s.createElement)(Ao,null))};function $o(){const[e,t]=(0,s.useState)(!1),n=(0,m.useSelect)((e=>e(An).getEditorMode()),[]);return(0,s.useEffect)((()=>{"visual"!==n&&t(!1)}),[n]),(0,s.createElement)(Qa,{className:"edit-site-global-styles-sidebar",identifier:"edit-site/global-styles",title:(0,y.__)("Styles"),icon:Ja,closeLabel:(0,y.__)("Close Styles sidebar"),panelClassName:"edit-site-global-styles-sidebar__panel",header:(0,s.createElement)(E.Flex,null,(0,s.createElement)(E.FlexBlock,null,(0,s.createElement)("strong",null,(0,y.__)("Styles"))),(0,s.createElement)(E.FlexItem,null,(0,s.createElement)(E.Button,{icon:er,label:e?(0,y.__)("Close Style Book"):(0,y.__)("Open Style Book"),isPressed:e,disabled:"visual"!==n,onClick:()=>{t(!e)}})),(0,s.createElement)(E.FlexItem,null,(0,s.createElement)(Vo,null)))},(0,s.createElement)(Ho,{isStyleBookOpened:e,onCloseStyleBook:()=>t(!1)}))}const Uo="edit-site/template",Wo="edit-site/block-inspector";var jo=e=>{let{sidebarName:t}=e;const{enableComplementaryArea:n}=(0,m.useDispatch)(F),[a,r]=t===Uo?[(0,y.__)("Template (selected)"),"is-active"]:[(0,y.__)("Template"),""],[l,o]=t===Wo?[(0,y.__)("Block (selected)"),"is-active"]:[(0,y.__)("Block"),""];return(0,s.createElement)("ul",null,(0,s.createElement)("li",null,(0,s.createElement)(E.Button,{onClick:()=>n(Dt,Uo),className:`edit-site-sidebar-edit-mode__panel-tab ${r}`,"aria-label":a,"data-label":(0,y.__)("Template")},(0,y.__)("Template"))),(0,s.createElement)("li",null,(0,s.createElement)(E.Button,{onClick:()=>n(Dt,Wo),className:`edit-site-sidebar-edit-mode__panel-tab ${o}`,"aria-label":l,"data-label":(0,y.__)("Block")},(0,y.__)("Block"))))};function qo(e){let{template:t}=e;const{revertTemplate:n}=(0,m.useDispatch)(An);return Gt(t)?(0,s.createElement)(E.DropdownMenu,{icon:re,label:(0,y.__)("Actions"),className:"edit-site-template-card__actions",toggleProps:{isSmall:!0}},(e=>{let{onClose:a}=e;return(0,s.createElement)(E.MenuGroup,null,(0,s.createElement)(E.MenuItem,{info:(0,y.__)("Use the template as supplied by the theme."),onClick:()=>{n(t),a()}},(0,y.__)("Clear customizations")))})):null}function Yo(e){let{area:t,clientId:n}=e;const{selectBlock:a,toggleBlockHighlight:r}=(0,m.useDispatch)(fe.store),l=(0,m.useSelect)((e=>e(h.store).__experimentalGetDefaultTemplatePartAreas().find((e=>e.area===t))),[t]),o=()=>r(n,!0),i=()=>r(n,!1);return(0,s.createElement)(E.Button,{className:"edit-site-template-card__template-areas-item",icon:null==l?void 0:l.icon,onMouseOver:o,onMouseLeave:i,onFocus:o,onBlur:i,onClick:()=>{a(n)}},null==l?void 0:l.label)}function Xo(){const e=(0,m.useSelect)((e=>e(An).getCurrentTemplateTemplateParts()),[]);return e.length?(0,s.createElement)("section",{className:"edit-site-template-card__template-areas"},(0,s.createElement)(E.__experimentalHeading,{level:3,className:"edit-site-template-card__template-areas-title"},(0,y.__)("Areas")),(0,s.createElement)("ul",{className:"edit-site-template-card__template-areas-list"},e.map((e=>{let{templatePart:t,block:n}=e;return(0,s.createElement)("li",{key:t.slug},(0,s.createElement)(Yo,{area:t.area,clientId:n.clientId}))})))):null}function Zo(){const{info:{title:e,description:t,icon:n},template:a}=(0,m.useSelect)((e=>{const{getEditedPostType:t,getEditedPostId:n}=e(An),{getEditedEntityRecord:a}=e(_.store),{__experimentalGetTemplateInfo:r}=e(h.store),l=a("postType",t(),n());return{info:l?r(l):{},template:l}}),[]);return e||t?(0,s.createElement)("div",{className:"edit-site-template-card"},(0,s.createElement)(E.Icon,{className:"edit-site-template-card__icon",icon:n}),(0,s.createElement)("div",{className:"edit-site-template-card__content"},(0,s.createElement)("div",{className:"edit-site-template-card__header"},(0,s.createElement)("h2",{className:"edit-site-template-card__title"},(0,Un.decodeEntities)(e)),(0,s.createElement)(qo,{template:a})),(0,s.createElement)("div",{className:"edit-site-template-card__description"},(0,Un.decodeEntities)(t)),(0,s.createElement)(Xo,null))):null}const{Slot:Ko,Fill:Qo}=(0,E.createSlotFill)("EditSiteSidebarInspector"),Jo=Qo;function ei(){const{sidebar:e,isEditorSidebarOpened:t,hasBlockSelection:n,supportsGlobalStyles:a}=(0,m.useSelect)((e=>{const t=e(F).getActiveComplementaryArea(Dt),n=[Wo,Uo].includes(t),a=e(An).getSettings();return{sidebar:t,isEditorSidebarOpened:n,hasBlockSelection:!!e(fe.store).getBlockSelectionStart(),supportsGlobalStyles:!(null!=a&&a.supportsTemplatePartsMode)}}),[]),{enableComplementaryArea:r}=(0,m.useDispatch)(F);(0,s.useEffect)((()=>{t&&r(Dt,n?Wo:Uo)}),[n,t]);let l=e;return t||(l=n?Wo:Uo),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Qa,{identifier:l,title:(0,y.__)("Settings"),icon:(0,y.isRTL)()?Za:Ka,closeLabel:(0,y.__)("Close settings sidebar"),header:(0,s.createElement)(jo,{sidebarName:l}),headerClassName:"edit-site-sidebar-edit-mode__panel-tabs"},l===Uo&&(0,s.createElement)(E.PanelBody,null,(0,s.createElement)(Zo,null)),l===Wo&&(0,s.createElement)(Ko,{bubblesVirtually:!0})),a&&(0,s.createElement)($o,null))}var ti=window.wp.reusableBlocks;const ni=(e,t)=>`${t}`,ai=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,ri=e=>{const{title:t,foreign_landing_url:n,creator:a,creator_url:r,license:l,license_version:o,license_url:i}=e,s=((e,t)=>{let n=e.trim();return"pdm"!==e&&(n=e.toUpperCase().replace("SAMPLING","Sampling")),t&&(n+=` ${t}`),["pdm","cc0"].includes(e)||(n=`CC ${n}`),n})(l,o),c=(0,Un.decodeEntities)(a);let u;return u=c?t?(0,y.sprintf)((0,y._x)('"%1$s" by %2$s/ %3$s',"caption"),ni(n,(0,Un.decodeEntities)(t)),r?ni(r,c):c,i?ni(`${i}?ref=openverse`,s):s):(0,y.sprintf)((0,y._x)("Work by %2$s/ %3$s","caption"),ai(n),r?ni(r,c):c,i?ni(`${i}?ref=openverse`,s):s):t?(0,y.sprintf)((0,y._x)('"%1$s"/ %2$s',"caption"),ni(n,(0,Un.decodeEntities)(t)),i?ni(`${i}?ref=openverse`,s):s):(0,y.sprintf)((0,y._x)("Work/ %3$s","caption"),ai(n),i?ni(`${i}?ref=openverse`,s):s),u.replace(/\s{2}/g," ")},li=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=await(0,m.resolveSelect)(_.store).getMediaItems({...e,orderBy:null!=e&&e.search?"relevance":"date"});return t.map((e=>{var t,n,a,r;return{...e,alt:e.alt_text,url:e.source_url,previewUrl:null===(t=e.media_details)||void 0===t||null===(n=t.sizes)||void 0===n||null===(a=n.medium)||void 0===a?void 0:a.source_url,caption:null===(r=e.caption)||void 0===r?void 0:r.raw}}))},oi=[{name:"images",labels:{name:(0,y.__)("Images"),search_items:(0,y.__)("Search images")},mediaType:"image",async fetch(){return li({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"image"})}},{name:"videos",labels:{name:(0,y.__)("Videos"),search_items:(0,y.__)("Search videos")},mediaType:"video",async fetch(){return li({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"video"})}},{name:"audio",labels:{name:(0,y.__)("Audio"),search_items:(0,y.__)("Search audio")},mediaType:"audio",async fetch(){return li({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"audio"})}},{name:"openverse",labels:{name:(0,y.__)("Openverse"),search_items:(0,y.__)("Search Openverse")},mediaType:"image",async fetch(){const e={...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"},t={per_page:"page_size",search:"q"},n=new URL("https://api.openverse.engineering/v1/images/");Object.entries(e).forEach((e=>{let[a,r]=e;const l=t[a]||a;n.searchParams.set(l,r)}));const a=await window.fetch(n,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}});return(await a.json()).results.map((e=>{var t;return{...e,title:null!==(t=e.title)&&void 0!==t&&t.toLowerCase().startsWith("file:")?e.title.slice(5):e.title,sourceId:e.id,id:void 0,caption:ri(e),previewUrl:e.thumbnail}}))},getReportUrl:e=>{let{sourceId:t}=e;return`https://wordpress.org/openverse/image/${t}/report/`},isExternalResource:!0}];var ii=oi;function si(e){let{clientId:t}=e;const{getBlocks:n}=(0,m.useSelect)(fe.store),{replaceBlocks:a}=(0,m.useDispatch)(fe.store);return(0,m.useSelect)((e=>e(fe.store).canRemoveBlock(t)),[t])?(0,s.createElement)(fe.BlockSettingsMenuControls,null,(e=>{let{onClose:r}=e;return(0,s.createElement)(E.MenuItem,{onClick:()=>{a(t,n(t)),r()}},(0,y.__)("Detach blocks from template part"))})):null}function ci(e){let{clientIds:t,blocks:n}=e;const[a,r]=(0,s.useState)(!1),{replaceBlocks:l}=(0,m.useDispatch)(fe.store),{saveEntityRecord:o}=(0,m.useDispatch)(_.store),{createSuccessNotice:i}=(0,m.useDispatch)(Ee.store),u=Ta(),{canCreate:d}=(0,m.useSelect)((e=>{const{supportsTemplatePartsMode:t}=e(An).getSettings();return{canCreate:!t}}),[]);if(!d)return null;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fe.BlockSettingsMenuControls,null,(()=>(0,s.createElement)(E.MenuItem,{icon:Fn,onClick:()=>{r(!0)}},(0,y.__)("Create Template part")))),a&&(0,s.createElement)(Ca,{closeModal:()=>{r(!1)},onCreate:async e=>{let{title:a,area:r}=e;const s=Na(a,u),m=Ma(s),d=await o("postType","wp_template_part",{slug:m,title:s,content:(0,c.serialize)(n),area:r});l(t,(0,c.createBlock)("core/template-part",{slug:d.slug,theme:d.theme})),i((0,y.__)("Template part created."),{type:"snackbar"})}}))}function ui(){var e;const{clientIds:t,blocks:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientIds:t,getBlocksByClientId:n}=e(fe.store),a=t();return{clientIds:a,blocks:n(a)}}),[]);return 1===n.length&&"core/template-part"===(null===(e=n[0])||void 0===e?void 0:e.name)?(0,s.createElement)(si,{clientId:t[0]}):(0,s.createElement)(ci,{clientIds:t,blocks:n})}var mi=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"}));var di=function(){var e;const t=Ct(),n=Tt(),a="wp_template_part"===t.params.postType,r=null===(e=t.state)||void 0===e?void 0:e.fromTemplateId;return a&&r?(0,s.createElement)(E.Button,{className:"edit-site-visual-editor__back-button",icon:mi,onClick:()=>{n.back()}},(0,y.__)("Back")):null};function pi(e){let{variation:t="default",direction:n,resizeWidthBy:a}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("button",{className:`resizable-editor__drag-handle is-${n} is-variation-${t}`,"aria-label":(0,y.__)("Drag to resize"),"aria-describedby":`resizable-editor__resize-help-${n}`,onKeyDown:function(e){const{keyCode:t}=e;"left"===n&&t===Wa.LEFT||"right"===n&&t===Wa.RIGHT?a(20):("left"===n&&t===Wa.RIGHT||"right"===n&&t===Wa.LEFT)&&a(-20)}}),(0,s.createElement)(E.VisuallyHidden,{id:`resizable-editor__resize-help-${n}`},(0,y.__)("Use left and right arrow keys to resize the canvas.")))}const _i={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 hi=function(e){let{enableResizing:t,height:n,children:a}=e;const[r,l]=(0,s.useState)("100%"),o=(0,s.useRef)(),i=(0,s.useCallback)((e=>{o.current&&l(o.current.offsetWidth+e)}),[]);return(0,s.createElement)(E.ResizableBox,{ref:e=>{o.current=null==e?void 0:e.resizable},size:{width:t?r:"100%",height:t&&n?n:"100%"},onResizeStop:(e,t,n)=>{l(n.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{right:t,left:t},showHandle:t,resizeRatio:2,handleComponent:{left:(0,s.createElement)(pi,{direction:"left",resizeWidthBy:i}),right:(0,s.createElement)(pi,{direction:"right",resizeWidthBy:i})},handleClasses:void 0,handleStyles:{left:_i,right:_i}},a)};var gi=function(e){let{enableResizing:t,settings:n,children:a,...r}=e;const{canvasMode:l,deviceType:o,isZoomOutMode:i}=(0,m.useSelect)((e=>({deviceType:e(An).__experimentalGetPreviewDeviceType(),isZoomOutMode:"zoom-out"===e(fe.store).__unstableGetEditorMode(),canvasMode:Qe(e(An)).getCanvasMode()})),[]),{setCanvasMode:c}=Qe((0,m.useDispatch)(An)),u=(0,fe.__experimentalUseResizeCanvas)(o),d=(0,fe.__unstableUseMouseMoveTypingReset)();return(0,s.createElement)(fe.__unstableIframe,g({scale:i?.45:void 0,frameSize:i?100:void 0,style:t?{}:u,head:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fe.__unstableEditorStyles,{styles:n.styles}),(0,s.createElement)("style",null,".is-root-container { display: flow-root; }\n\t\t\t\t\t\t\tbody { position: relative; }"),t&&(0,s.createElement)("style",null,".is-root-container { min-height: 0 !important; }")),ref:d,name:"editor-canvas",className:"edit-site-visual-editor__editor-canvas"},r,{role:"view"===l?"button":void 0,onClick:"view"===l?()=>c("edit"):void 0,readonly:"view"===l}),n.svgFilters,a)};const{ExperimentalBlockEditorProvider:vi}=Qe(fe.privateApis),fi={type:"default",alignments:[]};function Ei(){var e,t;const{setIsInserterOpened:n}=(0,m.useDispatch)(An),{storedSettings:a,templateType:r,canvasMode:l}=(0,m.useSelect)((e=>{const{getSettings:t,getEditedPostType:a,getCanvasMode:r}=Qe(e(An));return{storedSettings:t(n),templateType:a(),canvasMode:r()}}),[n]),o=null!==(e=a.__experimentalAdditionalBlockPatterns)&&void 0!==e?e:a.__experimentalBlockPatterns,i=null!==(t=a.__experimentalAdditionalBlockPatternCategories)&&void 0!==t?t:a.__experimentalBlockPatternCategories,{restBlockPatterns:c,restBlockPatternCategories:u}=(0,m.useSelect)((e=>({restBlockPatterns:e(_.store).getBlockPatterns(),restBlockPatternCategories:e(_.store).getBlockPatternCategories()})),[]),d=(0,s.useMemo)((()=>[...o||[],...c||[]].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)}))),[o,c,r]),p=(0,s.useMemo)((()=>[...i||[],...u||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))),[i,u]),h=(0,s.useMemo)((()=>{const{__experimentalAdditionalBlockPatterns:e,__experimentalAdditionalBlockPatternCategories:t,...n}=a;return{...n,inserterMediaCategories:ii,__experimentalBlockPatterns:d,__experimentalBlockPatternCategories:p}}),[a,d,p]),[g,v,E]=(0,_.useEntityBlockEditor)("postType",r),y=(0,s.useRef)(),b=(0,te.useMergeRefs)([y,(0,fe.__unstableUseClipboardHandler)(),(0,fe.__unstableUseTypingObserver)()]),w=(0,te.useViewportMatch)("small","<"),{clearSelectedBlock:S}=(0,m.useDispatch)(fe.store),[x,k]=(0,te.useResizeObserver)(),C="wp_template_part"===r,T=0!==g.length,N=C&&"view"!==l&&!w,M="view"===l,I=!(C&&T||M)&&void 0;return(0,s.createElement)(vi,{settings:h,value:g,onInput:v,onChange:E,useSubRegistry:!1},(0,s.createElement)(ui,null),(0,s.createElement)(Jo,null,(0,s.createElement)(fe.BlockInspector,null)),(0,s.createElement)(No.Slot,null,(e=>{var t;let[n]=e;return n?(0,s.createElement)("div",{className:"edit-site-visual-editor is-focus-mode"},(0,s.createElement)(hi,{enableResizing:!0},n)):(0,s.createElement)(fe.BlockTools,{className:f()("edit-site-visual-editor",{"is-focus-mode":C||!!n,"is-view-mode":M}),__unstableContentRef:y,onClick:e=>{e.target===e.currentTarget&&S()}},(0,s.createElement)(fe.BlockEditorKeyboardShortcuts.Register,null),(0,s.createElement)(di,null),(0,s.createElement)(hi,{enableResizing:N,height:null!==(t=k.height)&&void 0!==t?t:"100%"},(0,s.createElement)(gi,{enableResizing:N,settings:h,contentRef:b,readonly:"view"===l},x,(0,s.createElement)(fe.BlockList,{className:"edit-site-block-editor__block-list wp-site-blocks",__experimentalLayout:fi,renderAppender:I}))))})),(0,s.createElement)(ti.ReusableBlocksMenuItems,null))}var yi=n(773);function bi(e){let{value:t,onChange:n,onInput:a}=e;const[r,l]=(0,s.useState)(t),[o,i]=(0,s.useState)(!1),c=(0,te.useInstanceId)(bi),u=(0,s.useRef)();o||r===t||l(t);return(0,s.useEffect)((()=>()=>{u.current&&n(u.current)}),[]),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(E.VisuallyHidden,{as:"label",htmlFor:`code-editor-text-area-${c}`},(0,y.__)("Type text or HTML")),(0,s.createElement)(yi.Z,{autoComplete:"off",dir:"auto",value:r,onChange:e=>{const t=e.target.value;a(t),l(t),i(!0),u.current=t},onBlur:()=>{o&&(n(r),i(!1))},className:"edit-site-code-editor-text-area",id:`code-editor-text-area-${c}`,placeholder:(0,y.__)("Start writing with text or HTML")}))}function wi(){const{templateType:e,shortcut:t}=(0,m.useSelect)((e=>{const{getEditedPostType:t}=e(An),{getShortcutRepresentation:n}=e(Ln.store);return{templateType:t(),shortcut:n("core/edit-site/toggle-mode")}}),[]),[n,a]=(0,_.useEntityProp)("postType",e,"content"),[r,,l]=(0,_.useEntityBlockEditor)("postType",e);let o;o=n instanceof Function?n({blocks:r}):r?(0,c.__unstableSerializeAndClean)(r):n;const{switchEditorMode:i}=(0,m.useDispatch)(An);return(0,s.createElement)("div",{className:"edit-site-code-editor"},(0,s.createElement)("div",{className:"edit-site-code-editor__toolbar"},(0,s.createElement)("h2",null,(0,y.__)("Editing code")),(0,s.createElement)(E.Button,{variant:"tertiary",onClick:()=>i("visual"),shortcut:t},(0,y.__)("Exit code editor"))),(0,s.createElement)("div",{className:"edit-site-code-editor__body"},(0,s.createElement)(bi,{value:o,onChange:e=>{l((0,c.parse)(e),{selection:void 0})},onInput:a})))}function Si(){const{__experimentalGetDirtyEntityRecords:e,isSavingEntityRecord:t}=(0,m.useSelect)(_.store),{getEditorMode:n}=(0,m.useSelect)(An),a=(0,m.useSelect)((e=>e(An).isListViewOpened()),[]),r=(0,m.useSelect)((e=>e(F).getActiveComplementaryArea(An.name)===Wo),[]),{redo:l,undo:o}=(0,m.useDispatch)(_.store),{setIsListViewOpened:i,switchEditorMode:s}=(0,m.useDispatch)(An),{enableComplementaryArea:c,disableComplementaryArea:u}=(0,m.useDispatch)(F),{setIsSaveViewOpened:d}=(0,m.useDispatch)(An);return(0,Ln.useShortcut)("core/edit-site/save",(n=>{n.preventDefault();const a=e(),r=!!a.length;!a.some((e=>t(e.kind,e.name,e.key)))&&r&&d(!0)})),(0,Ln.useShortcut)("core/edit-site/undo",(e=>{o(),e.preventDefault()})),(0,Ln.useShortcut)("core/edit-site/redo",(e=>{l(),e.preventDefault()})),(0,Ln.useShortcut)("core/edit-site/toggle-list-view",(()=>{i(!a)})),(0,Ln.useShortcut)("core/edit-site/toggle-block-settings-sidebar",(e=>{e.preventDefault(),r?u(Dt):c(Dt,Wo)})),(0,Ln.useShortcut)("core/edit-site/toggle-mode",(()=>{s("visual"===n()?"text":"visual")})),null}Si.Register=function(){const{registerShortcut:e}=(0,m.useDispatch)(Ln.store);return(0,s.useEffect)((()=>{e({name:"core/edit-site/save",category:"global",description:(0,y.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-site/undo",category:"global",description:(0,y.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-site/redo",category:"global",description:(0,y.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,Wa.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/edit-site/toggle-list-view",category:"global",description:(0,y.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/edit-site/toggle-block-settings-sidebar",category:"global",description:(0,y.__)("Show or hide the block settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/edit-site/keyboard-shortcuts",category:"main",description:(0,y.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/edit-site/next-region",category:"global",description:(0,y.__)("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,y.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]}),e({name:"core/edit-site/toggle-mode",category:"global",description:(0,y.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}})}),[e]),null};var xi=Si;var ki=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.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 Ci(){const{setIsInserterOpened:e}=(0,m.useDispatch)(An),t=(0,m.useSelect)((e=>e(An).__experimentalGetInsertionPoint()),[]),n=(0,te.useViewportMatch)("medium","<"),a=n?"div":E.VisuallyHidden,[r,l]=(0,te.__experimentalUseDialog)({onClose:()=>e(!1),focusOnMount:null}),o=(0,s.useRef)();return(0,s.useEffect)((()=>{o.current.focusSearch()}),[]),(0,s.createElement)("div",g({ref:r},l,{className:"edit-site-editor__inserter-panel"}),(0,s.createElement)(a,{className:"edit-site-editor__inserter-panel-header"},(0,s.createElement)(E.Button,{icon:ki,label:(0,y.__)("Close block inserter"),onClick:()=>e(!1)})),(0,s.createElement)("div",{className:"edit-site-editor__inserter-panel-content"},(0,s.createElement)(fe.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:n,rootClientId:t.rootClientId,__experimentalInsertionIndex:t.insertionIndex,__experimentalFilterValue:t.filterValue,ref:o})))}function Ti(){const{setIsListViewOpened:e}=(0,m.useDispatch)(An),t=(0,te.useFocusOnMount)("firstElement"),n=(0,te.useFocusReturn)(),a=(0,te.useFocusReturn)();const r=`edit-site-editor__list-view-panel-label-${(0,te.useInstanceId)(Ti)}`;return(0,s.createElement)("div",{"aria-labelledby":r,className:"edit-site-editor__list-view-panel",onKeyDown:function(t){t.keyCode!==Wa.ESCAPE||t.defaultPrevented||e(!1)}},(0,s.createElement)("div",{className:"edit-site-editor__list-view-panel-header",ref:n},(0,s.createElement)("strong",{id:r},(0,y.__)("List View")),(0,s.createElement)(E.Button,{icon:C,label:(0,y.__)("Close List View Sidebar"),onClick:()=>e(!1)})),(0,s.createElement)("div",{className:"edit-site-editor__list-view-panel-content",ref:(0,te.useMergeRefs)([a,t])},(0,s.createElement)(fe.__experimentalListView,null)))}function Ni(e){let{nonAnimatedSrc:t,animatedSrc:n}=e;return(0,s.createElement)("picture",{className:"edit-site-welcome-guide__image"},(0,s.createElement)("source",{srcSet:t,media:"(prefers-reduced-motion: reduce)"}),(0,s.createElement)("img",{src:n,width:"312",height:"240",alt:""}))}function Mi(){const{toggle:e}=(0,m.useDispatch)(T.store);return(0,m.useSelect)((e=>!!e(T.store).get("core/edit-site","welcomeGuide")),[])?(0,s.createElement)(E.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,y.__)("Welcome to the site editor"),finishButtonText:(0,y.__)("Get Started"),onFinish:()=>e("core/edit-site","welcomeGuide"),pages:[{image:(0,s.createElement)(Ni,{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,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,y.__)("Edit your site")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,y.__)("Design everything on your site — from the header right down to the footer — using blocks.")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,s.createInterpolateElement)((0,y.__)("Click to start designing your blocks, and choose your typography, layout, and colors."),{StylesIconImage:(0,s.createElement)("img",{alt:(0,y.__)("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 Ii(){const{toggle:e}=(0,m.useDispatch)(T.store),{isActive:t,isStylesOpen:n}=(0,m.useSelect)((e=>{const t=e(F).getActiveComplementaryArea(An.name);return{isActive:!!e(T.store).get("core/edit-site","welcomeGuideStyles"),isStylesOpen:"edit-site/global-styles"===t}}),[]);return t&&n?(0,s.createElement)(E.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,y.__)("Welcome to styles"),finishButtonText:(0,y.__)("Get Started"),onFinish:()=>e("core/edit-site","welcomeGuideStyles"),pages:[{image:(0,s.createElement)(Ni,{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,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,y.__)("Welcome to Styles")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,y.__)("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,s.createElement)(Ni,{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,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,y.__)("Set the design")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,y.__)("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,s.createElement)(Ni,{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,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,y.__)("Personalize blocks")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,y.__)("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,s.createElement)(Ni,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,y.__)("Learn more")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,y.__)("New to block themes and styling your site? "),(0,s.createElement)(E.ExternalLink,{href:(0,y.__)("https://wordpress.org/support/article/styles-overview/")},(0,y.__)("Here’s a detailed guide to learn how to make the most of it."))))}]}):null}function Pi(){return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Mi,null),(0,s.createElement)(Ii,null))}const{useGlobalStylesOutput:Bi}=Qe(fe.privateApis);function zi(){return function(){const[e,t,n]=Bi(),{getSettings:a}=(0,m.useSelect)(An),{updateSettings:r}=(0,m.useDispatch)(An);(0,s.useEffect)((()=>{var l;if(!e||!t)return;const o=a(),i=Object.values(null!==(l=o.styles)&&void 0!==l?l:[]).filter((e=>!e.isGlobalStyles));r({...o,styles:[...i,...e],svgFilters:n,__experimentalFeatures:t})}),[e,t])}(),null}function Vi(e){const t=Ct(),n=(0,m.useSelect)((e=>{var t;return null===(t=e(_.store).getEntityRecord("root","site"))||void 0===t?void 0:t.title}),[]),a=(0,s.useRef)(!0);(0,s.useEffect)((()=>{a.current=!1}),[t]),(0,s.useEffect)((()=>{if(!a.current&&e&&n){const t=(0,y.sprintf)((0,y.__)("%1$s ‹ %2$s — WordPress"),(0,Un.decodeEntities)(e),(0,Un.decodeEntities)(n));document.title=t,(0,Lt.speak)((0,y.sprintf)((0,y.__)("Now displaying: %s"),document.title),"assertive")}}),[e,n,t])}const Ri={body:(0,y.__)("Editor content"),sidebar:(0,y.__)("Editor settings"),actions:(0,y.__)("Editor publish"),footer:(0,y.__)("Editor footer")};function Ai(){const{record:e,getTitle:t,isLoaded:n}=Ra(),{id:a,type:r}=e,{context:l,editorMode:o,canvasMode:i,blockEditorMode:c,isRightSidebarOpen:u,isInserterOpen:d,isListViewOpen:p,showIconLabels:g}=(0,m.useSelect)((e=>{const{getEditedPostContext:t,getEditorMode:n,getCanvasMode:a,isInserterOpened:r,isListViewOpened:l}=Qe(e(An)),{__unstableGetEditorMode:o}=e(fe.store),{getActiveComplementaryArea:i}=e(F);return{context:t(),editorMode:n(),canvasMode:a(),blockEditorMode:o(),isInserterOpen:r(),isListViewOpen:l(),isRightSidebarOpen:i(An.name),showIconLabels:e(T.store).get("core/edit-site","showIconLabels")}}),[]),{setEditedPostContext:v}=(0,m.useDispatch)(An),f="edit"===i,b="view"===i||"visual"===o,w=f&&b&&"zoom-out"!==c,S=f&&b&&d,x=f&&b&&p,k=p?(0,y.__)("List View"):(0,y.__)("Block Library"),C=(0,s.useMemo)((()=>({...l,queryContext:[(null==l?void 0:l.queryContext)||{page:1},e=>v({...l,queryContext:{...null==l?void 0:l.queryContext,...e}})]})),[l,v]);let N;if(n){const e="wp_template"===r?(0,y.__)("Template"):(0,y.__)("Template Part");N=(0,y.sprintf)((0,y.__)("%1$s ‹ %2$s ‹ Editor"),t(),e)}return Vi(n&&N),n?(0,s.createElement)(s.Fragment,null,f&&(0,s.createElement)(Pi,null),(0,s.createElement)(xi.Register,null),(0,s.createElement)(_.EntityProvider,{kind:"root",type:"site"},(0,s.createElement)(_.EntityProvider,{kind:"postType",type:r,id:a},(0,s.createElement)(ho,null,(0,s.createElement)(fe.BlockContextProvider,{value:C},(0,s.createElement)(ei,null),(0,s.createElement)(ae,{enableRegionNavigation:!1,className:g&&"show-icon-labels",notices:f&&(0,s.createElement)(h.EditorSnackbars,null),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(zi,null),f&&(0,s.createElement)(h.EditorNotices,null),b&&e&&(0,s.createElement)(Ei,null),"text"===o&&e&&f&&(0,s.createElement)(wi,null),n&&!e&&(0,s.createElement)(E.Notice,{status:"warning",isDismissible:!1},(0,y.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")),f&&(0,s.createElement)(xi,null)),secondarySidebar:f&&(S&&(0,s.createElement)(Ci,null)||x&&(0,s.createElement)(Ti,null)),sidebar:f&&u&&(0,s.createElement)(ee.Slot,{scope:"core/edit-site"}),footer:w&&(0,s.createElement)(fe.BlockBreadcrumb,{rootLabelText:(0,y.__)("Template")}),labels:{...Ri,secondarySidebar:k}})))))):(0,s.createElement)(so,null)}function Li(e){var t;let{templateType:n}=e;const{canCreate:a,postType:r}=(0,m.useSelect)((e=>{const{supportsTemplatePartsMode:t}=e(An).getSettings();return{postType:e(_.store).getPostType(n),canCreate:!t}}),[n]);return r?(0,s.createElement)("header",{className:"edit-site-list-header"},(0,s.createElement)(E.__experimentalHeading,{level:1,className:"edit-site-list-header__title"},null===(t=r.labels)||void 0===t?void 0:t.name),a&&(0,s.createElement)("div",{className:"edit-site-list-header__right"},(0,s.createElement)(Pa,{templateType:n,showIcon:!1,toggleProps:{variant:"primary"}}))):null}function Di(e){let{template:t,onClose:n}=e;const[a,r]=(0,s.useState)((()=>t.title.rendered)),[l,o]=(0,s.useState)(!1),{editEntityRecord:i,saveEditedEntityRecord:c}=(0,m.useDispatch)(_.store),{createSuccessNotice:u,createErrorNotice:d}=(0,m.useDispatch)(Ee.store);if("wp_template"===t.type&&!t.is_custom)return null;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(E.MenuItem,{onClick:()=>{o(!0),r(t.title.rendered)}},(0,y.__)("Rename")),l&&(0,s.createElement)(E.Modal,{title:(0,y.__)("Rename"),onRequestClose:()=>{o(!1)},overlayClassName:"edit-site-list__rename-modal"},(0,s.createElement)("form",{onSubmit:async function(e){e.preventDefault();try{await i("postType",t.type,t.id,{title:a}),r(""),o(!1),n(),await c("postType",t.type,t.id,{throwOnError:!0}),u((0,y.__)("Entity renamed."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,y.__)("An error occurred while renaming the entity.");d(t,{type:"snackbar"})}}},(0,s.createElement)(E.__experimentalVStack,{spacing:"5"},(0,s.createElement)(E.TextControl,{__nextHasNoMarginBottom:!0,label:(0,y.__)("Name"),value:a,onChange:r,required:!0}),(0,s.createElement)(E.__experimentalHStack,{justify:"right"},(0,s.createElement)(E.Button,{variant:"tertiary",onClick:()=>{o(!1)}},(0,y.__)("Cancel")),(0,s.createElement)(E.Button,{variant:"primary",type:"submit"},(0,y.__)("Save")))))))}function Gi(e){let{template:t}=e;const{removeTemplate:n,revertTemplate:a}=(0,m.useDispatch)(An),{saveEditedEntityRecord:r}=(0,m.useDispatch)(_.store),{createSuccessNotice:l,createErrorNotice:o}=(0,m.useDispatch)(Ee.store),i=function(e){return!!e&&"custom"===e.source&&!e.has_theme_file}(t),c=Gt(t);if(!i&&!c)return null;return(0,s.createElement)(E.DropdownMenu,{icon:re,label:(0,y.__)("Actions"),className:"edit-site-list-table__actions"},(e=>{let{onClose:u}=e;return(0,s.createElement)(E.MenuGroup,null,i&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Di,{template:t,onClose:u}),(0,s.createElement)(E.MenuItem,{isDestructive:!0,isTertiary:!0,onClick:()=>{n(t),u()}},(0,y.__)("Delete"))),c&&(0,s.createElement)(E.MenuItem,{info:(0,y.__)("Use the template as supplied by the theme."),onClick:()=>{!async function(){try{await a(t,{allowUndo:!1}),await r("postType",t.type,t.id),l((0,y.__)("Entity reverted."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,y.__)("An error occurred while reverting the entity.");o(t,{type:"snackbar"})}}(),u()}},(0,y.__)("Clear customizations")))}))}var Fi=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.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 Oi=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.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 Hi=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.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 $i=["wp_template","wp_template_part"];function Ui(e){let{isCustomized:t,children:n}=e;return t?(0,s.createElement)(E.Tooltip,{text:(0,y.__)("This template has been customized")},n):n}function Wi(e){let{text:t,icon:n,imageUrl:a,isCustomized:r}=e;const[l,o]=(0,s.useState)(!1);return(0,s.createElement)(E.__experimentalHStack,{alignment:"left"},(0,s.createElement)(Ui,{isCustomized:r},a?(0,s.createElement)("div",{className:f()("edit-site-list-added-by__avatar",{"is-loaded":l})},(0,s.createElement)("img",{onLoad:()=>o(!0),alt:"",src:a})):(0,s.createElement)("div",{className:f()("edit-site-list-added-by__icon",{"is-customized":r})},(0,s.createElement)(E.Icon,{icon:n}))),(0,s.createElement)("span",null,t))}function ji(e){var t;let{slug:n,isCustomized:a}=e;const r=(0,m.useSelect)((e=>e(_.store).getTheme(n)),[n]);return(0,s.createElement)(Wi,{icon:Gn,text:(null==r||null===(t=r.name)||void 0===t?void 0:t.rendered)||n,isCustomized:a})}function qi(e){let{slug:t,isCustomized:n}=e;const a=(0,m.useSelect)((e=>e(_.store).getPlugin(t)),[t]);return(0,s.createElement)(Wi,{icon:Fi,text:(null==a?void 0:a.name)||t,isCustomized:n})}function Yi(e){var t;let{id:n}=e;const a=(0,m.useSelect)((e=>e(_.store).getUser(n)),[n]);return(0,s.createElement)(Wi,{icon:Oi,imageUrl:null==a||null===(t=a.avatar_urls)||void 0===t?void 0:t[48],text:null==a?void 0:a.nickname})}function Xi(){const{name:e,logoURL:t}=(0,m.useSelect)((e=>{var t;const{getEntityRecord:n,getMedia:a}=e(_.store),r=n("root","__unstableBase");return{name:null==r?void 0:r.name,logoURL:null!=r&&r.site_logo?null===(t=a(r.site_logo))||void 0===t?void 0:t.source_url:void 0}}),[]);return(0,s.createElement)(Wi,{icon:Hi,imageUrl:t,text:e})}function Zi(e){let{templateType:t,template:n}=e;if(n){if($i.includes(t)){if(n.has_theme_file&&("theme"===n.origin||!n.origin&&["theme","custom"].includes(n.source)))return(0,s.createElement)(ji,{slug:n.theme,isCustomized:"custom"===n.source});if(n.has_theme_file&&"plugin"===n.origin)return(0,s.createElement)(qi,{slug:n.theme,isCustomized:"custom"===n.source});if(!n.has_theme_file&&"custom"===n.source&&!n.author)return(0,s.createElement)(Xi,null)}return(0,s.createElement)(Yi,{id:n.author})}}function Ki(e){let{templateType:t}=e;const{records:n,isResolving:a}=(0,_.useEntityRecords)("postType",t,{per_page:-1}),r=(0,m.useSelect)((e=>e(_.store).getPostType(t)),[t]);return!n||a?null:n.length?(0,s.createElement)("table",{className:"edit-site-list-table",role:"table"},(0,s.createElement)("thead",null,(0,s.createElement)("tr",{className:"edit-site-list-table-head",role:"row"},(0,s.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,y.__)("Template")),(0,s.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,y.__)("Added by")),(0,s.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,s.createElement)(E.VisuallyHidden,null,(0,y.__)("Actions"))))),(0,s.createElement)("tbody",null,n.map((e=>{var n;return(0,s.createElement)("tr",{key:e.id,className:"edit-site-list-table-row",role:"row"},(0,s.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,s.createElement)(E.__experimentalHeading,{level:4},(0,s.createElement)(Pt,{params:{path:"wp_template"===e.type?"/templates/single":"/template-parts/single",postId:e.id,postType:e.type}},(0,Un.decodeEntities)((null===(n=e.title)||void 0===n?void 0:n.rendered)||e.slug))),(0,Un.decodeEntities)(e.description)),(0,s.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,s.createElement)(Zi,{templateType:t,template:e})),(0,s.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,s.createElement)(Gi,{template:e})))})))):(0,s.createElement)("div",null,(0,y.sprintf)((0,y.__)("No %s found."),null==r||null===(l=r.labels)||void 0===l||null===(o=l.name)||void 0===o?void 0:o.toLowerCase()));var l,o}function Qi(){var e,t;const{params:{postType:n}}=Ct();!function(){const{registerShortcut:e}=(0,m.useDispatch)(Ln.store);(0,s.useEffect)((()=>{e({name:"core/edit-site/next-region",category:"global",description:(0,y.__)("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,y.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})}),[])}();const{previousShortcut:a,nextShortcut:r}=(0,m.useSelect)((e=>({previousShortcut:e(Ln.store).getAllShortcutKeyCombinations("core/edit-site/previous-region"),nextShortcut:e(Ln.store).getAllShortcutKeyCombinations("core/edit-site/next-region")})),[]),l=(0,m.useSelect)((e=>e(_.store).getPostType(n)),[n]);Vi(null==l||null===(e=l.labels)||void 0===e?void 0:e.name);const o=null==l||null===(t=l.labels)||void 0===t?void 0:t.items_list,i=l?{header:(0,y.sprintf)((0,y.__)("%s - Header"),o),body:(0,y.sprintf)((0,y.__)("%s - Content"),o)}:void 0;return(0,s.createElement)(ae,{className:"edit-site-list",labels:i,header:(0,s.createElement)(Li,{templateType:n}),notices:(0,s.createElement)(h.EditorSnackbars,null),content:(0,s.createElement)(Ki,{templateType:n}),shortcuts:{previous:a,next:r}})}function Ji(e){let{text:t,children:n}=e;const a=(0,te.useCopyToClipboard)(t);return(0,s.createElement)(E.Button,{variant:"secondary",ref:a},n)}function es(e){let{message:t,error:n}=e;const a=[(0,s.createElement)(Ji,{key:"copy-error",text:n.stack},(0,y.__)("Copy Error"))];return(0,s.createElement)(fe.Warning,{className:"editor-error-boundary",actions:a},t)}class ts extends s.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,_e.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){return this.state.error?(0,s.createElement)(es,{message:(0,y.__)("The editor has encountered an unexpected error."),error:this.state.error}):this.props.children}}var ns=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));var as=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.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 rs=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.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"}));const ls=[{keyCombination:{modifier:"primary",character:"b"},description:(0,y.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,y.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,y.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,y.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,y.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,y.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,y.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,y.__)("Make the selected text inline code.")}];function os(e){let{keyCombination:t,forceAriaLabel:n}=e;const a=t.modifier?Wa.displayShortcutList[t.modifier](t.character):t.character,r=t.modifier?Wa.shortcutAriaLabel[t.modifier](t.character):t.character;return(0,s.createElement)("kbd",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":n||r},(Array.isArray(a)?a:[a]).map(((e,t)=>"+"===e?(0,s.createElement)(s.Fragment,{key:t},e):(0,s.createElement)("kbd",{key:t,className:"edit-site-keyboard-shortcut-help-modal__shortcut-key"},e))))}function is(e){let{description:t,keyCombination:n,aliases:a=[],ariaLabel:r}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-description"},t),(0,s.createElement)("div",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-term"},(0,s.createElement)(os,{keyCombination:n,forceAriaLabel:r}),a.map(((e,t)=>(0,s.createElement)(os,{keyCombination:e,forceAriaLabel:r,key:t})))))}function ss(e){let{name:t}=e;const{keyCombination:n,description:a,aliases:r}=(0,m.useSelect)((e=>{const{getShortcutKeyCombination:n,getShortcutDescription:a,getShortcutAliases:r}=e(Ln.store);return{keyCombination:n(t),aliases:r(t),description:a(t)}}),[t]);return n?(0,s.createElement)(is,{keyCombination:n,description:a,aliases:r}):null}const cs=e=>{let{shortcuts:t}=e;return(0,s.createElement)("ul",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-list",role:"list"},t.map(((e,t)=>(0,s.createElement)("li",{className:"edit-site-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,s.createElement)(ss,{name:e}):(0,s.createElement)(is,e)))))},us=e=>{let{title:t,shortcuts:n,className:a}=e;return(0,s.createElement)("section",{className:f()("edit-site-keyboard-shortcut-help-modal__section",a)},!!t&&(0,s.createElement)("h2",{className:"edit-site-keyboard-shortcut-help-modal__section-title"},t),(0,s.createElement)(cs,{shortcuts:n}))},ms=e=>{let{title:t,categoryName:n,additionalShortcuts:a=[]}=e;const r=(0,m.useSelect)((e=>e(Ln.store).getCategoryShortcuts(n)),[n]);return(0,s.createElement)(us,{title:t,shortcuts:r.concat(a)})};function ds(e){let{isModalActive:t,toggleModal:n}=e;return t?(0,s.createElement)(E.Modal,{className:"edit-site-keyboard-shortcut-help-modal",title:(0,y.__)("Keyboard shortcuts"),onRequestClose:n},(0,s.createElement)(us,{className:"edit-site-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-site/keyboard-shortcuts"]}),(0,s.createElement)(ms,{title:(0,y.__)("Global shortcuts"),categoryName:"global"}),(0,s.createElement)(ms,{title:(0,y.__)("Selection shortcuts"),categoryName:"selection"}),(0,s.createElement)(ms,{title:(0,y.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,y.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,y.__)("Forward-slash")}]}),(0,s.createElement)(us,{title:(0,y.__)("Text formatting"),shortcuts:ls})):null}function ps(e){const{featureName:t,...n}=e,a=(0,m.useSelect)((e=>!!e(T.store).get("core/edit-site",t)),[t]),{toggle:r}=(0,m.useDispatch)(T.store);return(0,s.createElement)(pe,g({onChange:()=>r("core/edit-site",t),isChecked:a},n))}function _s(e){let{isModalActive:t,toggleModal:n}=e;const a=(0,s.useMemo)((()=>[{name:"general",tabLabel:(0,y.__)("General"),content:(0,s.createElement)(de,{title:(0,y.__)("Appearance"),description:(0,y.__)("Customize options related to the block editor interface and editing flow.")},(0,s.createElement)(ps,{featureName:"focusMode",help:(0,y.__)("Highlights the current block and fades other content."),label:(0,y.__)("Spotlight mode")}),(0,s.createElement)(ps,{featureName:"showIconLabels",label:(0,y.__)("Show button text labels"),help:(0,y.__)("Show text instead of icons on buttons.")}),(0,s.createElement)(ps,{featureName:"showListViewByDefault",help:(0,y.__)("Opens the block list view sidebar by default."),label:(0,y.__)("Always open list view")}))},{name:"blocks",tabLabel:(0,y.__)("Blocks"),content:(0,s.createElement)(de,{title:(0,y.__)("Block interactions"),description:(0,y.__)("Customize how you interact with blocks in the block library and editing canvas.")},(0,s.createElement)(ps,{featureName:"keepCaretInsideBlock",help:(0,y.__)("Aids screen readers by stopping text caret from leaving blocks."),label:(0,y.__)("Contain text cursor inside block")}))}]));return t?(0,s.createElement)(oe,{closeModal:n},(0,s.createElement)(me,{sections:a})):null}const{Fill:hs,Slot:gs}=(0,E.createSlotFill)("EditSiteToolsMoreMenuGroup");hs.Slot=e=>{let{fillProps:t}=e;return(0,s.createElement)(gs,{fillProps:t},(e=>!(0,ve.isEmpty)(e)&&e))};var vs=hs,fs=n(8981),Es=n.n(fs);var ys=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.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 bs(){const{createErrorNotice:e}=(0,m.useDispatch)(Ee.store);return(0,s.createElement)(E.MenuItem,{role:"menuitem",icon:ys,onClick:async function(){try{const e=await At()({path:"/wp-block-editor/v1/export",parse:!1,headers:{Accept:"application/zip"}}),t=await e.blob(),n=e.headers.get("content-disposition").match(/=(.+)\.zip/),a=n[1]?n[1]:"edit-site-export";Es()(t,a+".zip","application/zip")}catch(t){let n={};try{n=await t.json()}catch(e){}const a=n.message&&"unknown_error"!==n.code?n.message:(0,y.__)("An error occurred while creating the site export.");e(a,{type:"snackbar"})}},info:(0,y.__)("Download your theme with updated templates and styles.")},(0,y._x)("Export","site exporter menu item"))}function ws(){const{toggle:e}=(0,m.useDispatch)(T.store);return(0,s.createElement)(E.MenuItem,{onClick:()=>e("core/edit-site","welcomeGuide")},(0,y.__)("Welcome Guide"))}function Ss(){const{createNotice:e}=(0,m.useDispatch)(Ee.store),t=(0,m.useSelect)((e=>()=>{const{getEditedPostId:t,getEditedPostType:n}=e(An),{getEditedEntityRecord:a}=e(_.store),r=a("postType",n(),t());if(r){if("function"==typeof r.content)return r.content(r);if(r.blocks)return(0,c.__unstableSerializeAndClean)(r.blocks);if(r.content)return r.content}return""}),[]);const n=(0,te.useCopyToClipboard)(t,(function(){e("info",(0,y.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,s.createElement)(E.MenuItem,{ref:n},(0,y.__)("Copy all blocks"))}const xs=[{value:"visual",label:(0,y.__)("Visual editor")},{value:"text",label:(0,y.__)("Code editor")}];var ks=function(){const{shortcut:e,mode:t}=(0,m.useSelect)((e=>({shortcut:e(Ln.store).getShortcutRepresentation("core/edit-site/toggle-mode"),isRichEditingEnabled:e(An).getSettings().richEditingEnabled,isCodeEditingEnabled:e(An).getSettings().codeEditingEnabled,mode:e(An).getEditorMode()})),[]),{switchEditorMode:n}=(0,m.useDispatch)(An),a=xs.map((n=>n.value!==t?{...n,shortcut:e}:n));return(0,s.createElement)(E.MenuGroup,{label:(0,y.__)("Editor")},(0,s.createElement)(E.MenuItemsChoice,{choices:a,value:t,onSelect:n}))};function Cs(e){let{showIconLabels:t}=e;const[n,a]=(0,s.useReducer)((e=>!e),!1),[r,l]=(0,s.useReducer)((e=>!e),!1);return(0,Ln.useShortcut)("core/edit-site/keyboard-shortcuts",a),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(le,{toggleProps:{showTooltip:!t,...t&&{variant:"tertiary"}}},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(E.MenuGroup,{label:(0,y._x)("View","noun")},(0,s.createElement)(T.PreferenceToggleMenuItem,{scope:"core/edit-site",name:"fixedToolbar",label:(0,y.__)("Top toolbar"),info:(0,y.__)("Access all block and document tools in a single place"),messageActivated:(0,y.__)("Top toolbar activated"),messageDeactivated:(0,y.__)("Top toolbar deactivated")}),(0,s.createElement)(T.PreferenceToggleMenuItem,{scope:"core/edit-site",name:"focusMode",label:(0,y.__)("Spotlight mode"),info:(0,y.__)("Focus on one block at a time"),messageActivated:(0,y.__)("Spotlight mode activated"),messageDeactivated:(0,y.__)("Spotlight mode deactivated")}),(0,s.createElement)(ks,null),(0,s.createElement)(q.Slot,{name:"core/edit-site/plugin-more-menu",label:(0,y.__)("Plugins"),as:E.MenuGroup,fillProps:{onClick:t}})),(0,s.createElement)(E.MenuGroup,{label:(0,y.__)("Tools")},(0,s.createElement)(bs,null),(0,s.createElement)(E.MenuItem,{onClick:a,shortcut:Wa.displayShortcut.access("h")},(0,y.__)("Keyboard shortcuts")),(0,s.createElement)(ws,null),(0,s.createElement)(Ss,null),(0,s.createElement)(E.MenuItem,{icon:rs,role:"menuitem",href:(0,y.__)("https://wordpress.org/support/article/site-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,y.__)("Help"),(0,s.createElement)(E.VisuallyHidden,{as:"span"},(0,y.__)("(opens in a new tab)"))),(0,s.createElement)(vs.Slot,{fillProps:{onClose:t}})),(0,s.createElement)(E.MenuGroup,null,(0,s.createElement)(E.MenuItem,{onClick:l},(0,y.__)("Preferences"))))})),(0,s.createElement)(ds,{isModalActive:n,toggleModal:a}),(0,s.createElement)(_s,{isModalActive:r,toggleModal:l}))}var Ts=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.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 Ns=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(b.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 Ms=(0,s.forwardRef)((function(e,t){const n=(0,m.useSelect)((e=>e(_.store).hasUndo()),[]),{undo:a}=(0,m.useDispatch)(_.store);return(0,s.createElement)(E.Button,g({},e,{ref:t,icon:(0,y.isRTL)()?Ns:Ts,label:(0,y.__)("Undo"),shortcut:Wa.displayShortcut.primary("z"),"aria-disabled":!n,onClick:n?a:void 0}))}));var Is=(0,s.forwardRef)((function(e,t){const n=(0,Wa.isAppleOS)()?Wa.displayShortcut.primaryShift("z"):Wa.displayShortcut.primary("y"),a=(0,m.useSelect)((e=>e(_.store).hasRedo()),[]),{redo:r}=(0,m.useDispatch)(_.store);return(0,s.createElement)(E.Button,g({},e,{ref:t,icon:(0,y.isRTL)()?Ts:Ns,label:(0,y.__)("Redo"),shortcut:n,"aria-disabled":!a,onClick:a?r:void 0}))}));var Ps=(0,s.createElement)(b.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(b.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function Bs(e){var t;let{onClose:n,templatePart:a,closeTemplateDetailsDropdown:r}=e;const{revertTemplate:l}=(0,m.useDispatch)(An),{params:o}=Ct(),i=It({postId:a.id,postType:a.type},{fromTemplateId:o.postId});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(E.MenuGroup,null,(0,s.createElement)(E.MenuItem,g({},i,{onClick:function(e){i.onClick(e),n(),r()}}),(0,y.sprintf)((0,y.__)("Edit %s"),null===(t=a.title)||void 0===t?void 0:t.rendered))),Gt(a)&&(0,s.createElement)(E.MenuGroup,null,(0,s.createElement)(E.MenuItem,{info:(0,y.__)("Use the template part as supplied by the theme."),onClick:function(){l(a),n(),r()}},(0,y.__)("Clear customizations"))))}function zs(e){let{templatePart:t,clientId:n,closeTemplateDetailsDropdown:a}=e;const{selectBlock:r,toggleBlockHighlight:l}=(0,m.useDispatch)(fe.store),o=(0,m.useSelect)((e=>e(h.store).__experimentalGetDefaultTemplatePartAreas().find((e=>e.area===t.area))),[t.area]),i=()=>l(n,!0),c=()=>l(n,!1);return(0,s.createElement)("div",{role:"menuitem",className:"edit-site-template-details__template-areas-item"},(0,s.createElement)(E.MenuItem,{role:"button",icon:null==o?void 0:o.icon,iconPosition:"left",onClick:()=>{r(n)},onMouseOver:i,onMouseLeave:c,onFocus:i,onBlur:c},null==o?void 0:o.label),(0,s.createElement)(E.DropdownMenu,{icon:re,label:(0,y.__)("More options"),className:"edit-site-template-details__template-areas-item-more"},(e=>{let{onClose:n}=e;return(0,s.createElement)(Bs,{onClose:n,templatePart:t,closeTemplateDetailsDropdown:a})})))}function Vs(e){let{closeTemplateDetailsDropdown:t}=e;const n=(0,m.useSelect)((e=>e(An).getCurrentTemplateTemplateParts()),[]);return n.length?(0,s.createElement)(E.MenuGroup,{label:(0,y.__)("Areas"),className:"edit-site-template-details__group edit-site-template-details__template-areas"},n.map((e=>{let{templatePart:n,block:a}=e;return(0,s.createElement)(zs,{key:n.slug,clientId:a.clientId,templatePart:n,closeTemplateDetailsDropdown:t})}))):null}function Rs(e){let{template:t}=e;const[n,a]=(0,s.useState)(!1),[r,l]=(0,_.useEntityProp)("postType",t.type,"title",t.id);return(0,s.createElement)(E.TextControl,{__nextHasNoMarginBottom:!0,label:(0,y.__)("Title"),value:n?"":r,help:"wp_template_part"!==t.type?(0,y.__)('Give the template a title that indicates its purpose, e.g. "Full Width".'):null,onChange:e=>{e||n?(a(!1),l(e)):a(!0)},onBlur:()=>a(!1)})}function As(e){let{id:t}=e;const[n,a]=(0,_.useEntityProp)("postType","wp_template_part","area",t),r=(0,m.useSelect)((e=>e(h.store).__experimentalGetDefaultTemplatePartAreas()),[]).map((e=>{let{label:t,area:n}=e;return{label:t,value:n}}));return(0,s.createElement)(E.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,y.__)("Area"),labelPosition:"top",options:r,value:n,onChange:a})}function Ls(e){let{template:t,onClose:n}=e;const{title:a,description:r}=(0,m.useSelect)((e=>e(h.store).__experimentalGetTemplateInfo(t)),[]),{revertTemplate:l}=(0,m.useDispatch)(An),o=It({postType:t.type,postId:void 0}),i="wp_template_part"===t.type,c=(i||t.is_custom)&&!t.has_theme_file;if(!t)return null;return(0,s.createElement)("div",{className:"edit-site-template-details"},(0,s.createElement)(E.__experimentalVStack,{className:"edit-site-template-details__group",spacing:3},c?(0,s.createElement)(Rs,{template:t}):(0,s.createElement)(E.__experimentalText,{size:16,weight:600,className:"edit-site-template-details__title",as:"p"},(0,Un.decodeEntities)(a)),r&&(0,s.createElement)(E.__experimentalText,{size:"body",className:"edit-site-template-details__description",as:"p"},(0,Un.decodeEntities)(r))),i&&(0,s.createElement)("div",{className:"edit-site-template-details__group"},(0,s.createElement)(As,{id:t.id})),(0,s.createElement)(Vs,{closeTemplateDetailsDropdown:n}),Gt(t)&&(0,s.createElement)(E.MenuGroup,{className:"edit-site-template-details__group edit-site-template-details__revert"},(0,s.createElement)(E.MenuItem,{className:"edit-site-template-details__revert-button",info:(0,y.__)("Use the template as supplied by the theme."),onClick:()=>{l(t),n()}},(0,y.__)("Clear customizations"))),(0,s.createElement)(E.Button,g({className:"edit-site-template-details__show-all-button"},o),"wp_template"===(null==t?void 0:t.type)?(0,y.__)("Browse all templates"):(0,y.__)("Browse all template parts")))}function Ds(e){if(e){const t=(0,c.getBlockType)(e.name);return t?(0,c.__experimentalGetBlockLabel)(t,e.attributes):null}return null}function Gs(){const e=(0,m.useSelect)((e=>e(T.store).get("core/edit-site","showIconLabels")),[]),{isLoaded:t,record:n,getTitle:a}=Ra(),{label:r,icon:l}=function(){const{getBlock:e}=(0,m.useSelect)(fe.store),t=(0,m.useSelect)((e=>e(fe.store).__experimentalGetActiveBlockIdByBlockNames(["core/template-part"])),[]),n=(0,fe.useBlockDisplayInformation)(t);return t?{label:Ds(e(t)),isActive:!0,icon:null==n?void 0:n.icon}:{}}(),[o,i]=(0,s.useState)(null),c=(0,s.useMemo)((()=>({anchor:o,placement:"bottom"})),[o]);if(!t)return(0,s.createElement)("div",{className:"edit-site-document-actions"},(0,y.__)("Loading…"));if(!n)return(0,s.createElement)("div",{className:"edit-site-document-actions"},(0,y.__)("Template not found"));const u="wp_template_part"===n.type?(0,y.__)("template part"):(0,y.__)("template");return(0,s.createElement)("div",{className:f()("edit-site-document-actions",{"has-secondary-label":!!r})},(0,s.createElement)("div",{ref:i,className:"edit-site-document-actions__title-wrapper"},(0,s.createElement)(E.__experimentalText,{size:"body",className:"edit-site-document-actions__title",as:"h1"},(0,s.createElement)(E.VisuallyHidden,{as:"span"},(0,y.sprintf)((0,y.__)("Editing %s: "),u)),a()),(0,s.createElement)("div",{className:"edit-site-document-actions__secondary-item"},(0,s.createElement)(fe.BlockIcon,{icon:l,showColors:!0}),(0,s.createElement)(E.__experimentalText,{size:"body"},null!=r?r:"")),(0,s.createElement)(E.Dropdown,{popoverProps:c,renderToggle:t=>{let{isOpen:n,onToggle:a}=t;return(0,s.createElement)(E.Button,{className:"edit-site-document-actions__get-info",icon:Ps,"aria-expanded":n,"aria-haspopup":"true",onClick:a,variant:e?"tertiary":void 0,label:(0,y.sprintf)((0,y.__)("Show %s details"),u)},e&&(0,y.__)("Details"))},contentClassName:"edit-site-document-actions__info-dropdown",renderContent:e=>{let{onClose:t}=e;return(0,s.createElement)(Ls,{template:n,onClose:t})}})))}const Fs=e=>{e.preventDefault()};function Os(){var e;const t=(0,s.useRef)(),{deviceType:n,templateType:a,isInserterOpen:r,isListViewOpen:l,listViewShortcut:o,isVisualMode:i,blockEditorMode:c,homeUrl:u,showIconLabels:d}=(0,m.useSelect)((e=>{var t;const{__experimentalGetPreviewDeviceType:n,getEditedPostType:a,isInserterOpened:r,isListViewOpened:l,getEditorMode:o}=e(An),{getShortcutRepresentation:i}=e(Ln.store),{__unstableGetEditorMode:s}=e(fe.store),c=a(),{getUnstableBase:u}=e(_.store);return{deviceType:n(),templateType:c,isInserterOpen:r(),isListViewOpen:l(),listViewShortcut:i("core/edit-site/toggle-list-view"),isVisualMode:"visual"===o(),blockEditorMode:s(),homeUrl:null===(t=u())||void 0===t?void 0:t.home,showIconLabels:e(T.store).get("core/edit-site","showIconLabels")}}),[]),{__experimentalSetPreviewDeviceType:p,setIsInserterOpened:h,setIsListViewOpened:g}=(0,m.useDispatch)(An),{__unstableSetEditorMode:v}=(0,m.useDispatch)(fe.store),b=(0,te.useViewportMatch)("medium"),w=(0,s.useCallback)((()=>{r?(t.current.focus(),h(!1)):h(!0)}),[r,h]),S=(0,s.useCallback)((()=>g(!l)),[g,l]),x=function(){const e=(0,E.__experimentalUseSlotFills)(bo);return!(null==e||!e.length)}(),k="wp_template_part"===a,C=(0,y._x)("Toggle block inserter","Generic label for block inserter button"),N=r?(0,y.__)("Close"):(0,y.__)("Add"),M=(null===(e=window)||void 0===e?void 0:e.__experimentalEnableZoomedOutView)&&i,I="zoom-out"===c;return(0,s.createElement)("div",{className:f()("edit-site-header-edit-mode",{"show-icon-labels":d})},!x&&(0,s.createElement)(fe.NavigableToolbar,{className:"edit-site-header-edit-mode__start","aria-label":(0,y.__)("Document tools")},(0,s.createElement)("div",{className:"edit-site-header-edit-mode__toolbar"},(0,s.createElement)(E.ToolbarItem,{ref:t,as:E.Button,className:"edit-site-header-edit-mode__inserter-toggle",variant:"primary",isPressed:r,onMouseDown:Fs,onClick:w,disabled:!i,icon:ra,label:d?N:C,showTooltip:!d}),b&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(E.ToolbarItem,{as:fe.ToolSelector,showTooltip:!d,variant:d?"tertiary":void 0,disabled:!i}),(0,s.createElement)(E.ToolbarItem,{as:Ms,showTooltip:!d,variant:d?"tertiary":void 0}),(0,s.createElement)(E.ToolbarItem,{as:Is,showTooltip:!d,variant:d?"tertiary":void 0}),(0,s.createElement)(E.ToolbarItem,{as:E.Button,className:"edit-site-header-edit-mode__list-view-toggle",disabled:!i||I,icon:ns,isPressed:l,label:(0,y.__)("List View"),onClick:S,shortcut:o,showTooltip:!d,variant:d?"tertiary":void 0}),M&&(0,s.createElement)(E.ToolbarItem,{as:E.Button,className:"edit-site-header-edit-mode__zoom-out-view-toggle",icon:as,isPressed:I,label:(0,y.__)("Zoom-out View"),onClick:()=>{p("desktop"),v(I?"edit":"zoom-out")}})))),(0,s.createElement)("div",{className:"edit-site-header-edit-mode__center"},x?(0,y.__)("Style Book"):(0,s.createElement)(Gs,null)),(0,s.createElement)("div",{className:"edit-site-header-edit-mode__end"},(0,s.createElement)("div",{className:"edit-site-header-edit-mode__actions"},!k&&!x&&(0,s.createElement)("div",{className:f()("edit-site-header-edit-mode__preview-options",{"is-zoomed-out":I})},(0,s.createElement)(fe.__experimentalPreviewOptions,{deviceType:n,setDeviceType:p,viewLabel:(0,y.__)("View")},(0,s.createElement)(E.MenuGroup,null,(0,s.createElement)(E.MenuItem,{href:u,target:"_blank",icon:rs},(0,y.__)("View site"),(0,s.createElement)(E.VisuallyHidden,{as:"span"},(0,y.__)("(opens in a new tab)")))))),(0,s.createElement)(ja,null),(0,s.createElement)(K.Slot,{scope:"core/edit-site"}),(0,s.createElement)(Cs,{showIconLabels:d}))))}var Hs=(0,s.createElement)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(b.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 $s=function(e){let{className:t}=e;const{isRequestingSite:n,siteIconUrl:a}=(0,m.useSelect)((e=>{const{getEntityRecord:t,isResolving:n}=e(_.store),a=t("root","__unstableBase",void 0)||{};return{isRequestingSite:n("core","getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:a.site_icon_url}}),[]);if(n&&!a)return null;const r=a?(0,s.createElement)("img",{className:"edit-site-site-icon__image",alt:(0,y.__)("Site Icon"),src:a}):(0,s.createElement)(E.Icon,{className:"edit-site-site-icon__icon",size:"32px",icon:Hs});return(0,s.createElement)("div",{className:f()(t,"edit-site-site-icon")},r)};const Us=(0,s.forwardRef)(((e,t)=>{const{canvasMode:n,dashboardLink:a}=(0,m.useSelect)((e=>{e(An).getEditedPostType();const{getCanvasMode:t,getSettings:n}=Qe(e(An));return{canvasMode:t(),dashboardLink:n().__experimentalDashboardLink}}),[]),r=(0,te.useReducedMotion)(),{setCanvasMode:l}=Qe((0,m.useDispatch)(An)),{clearSelectedBlock:o}=(0,m.useDispatch)(fe.store),i="edit"!==n,c="view"===n?{href:a||"index.php","aria-label":(0,y.__)("Go back to the dashboard")}:{label:(0,y.__)("Open Navigation Sidebar"),onClick:()=>{o(),l("view")}},u=(0,m.useSelect)((e=>{var t;return null===(t=e(_.store).getEntityRecord("root","site"))||void 0===t?void 0:t.title}),[]);return(0,s.createElement)(E.__unstableMotion.div,g({ref:t},e,{className:f()("edit-site-site-hub",e.className),layout:!0,transition:{type:"tween",duration:r?0:.3,ease:"easeOut"}}),(0,s.createElement)(E.__experimentalHStack,{justify:"flex-start",className:"edit-site-site-hub__text-content",spacing:"0"},(0,s.createElement)(E.__unstableMotion.div,{className:"edit-site-site-hub__view-mode-toggle-container",layout:!0,transition:{type:"tween",duration:r?0:.3,ease:"easeOut"}},(0,s.createElement)(E.Button,g({},c,{className:"edit-site-layout__view-mode-toggle"}),(0,s.createElement)($s,{className:"edit-site-layout__view-mode-toggle-icon"}))),i&&(0,s.createElement)("div",null,u)))}));var Ws=Us;function js(){const{isSaveViewOpen:e,canvasMode:t}=(0,m.useSelect)((e=>{const{isSaveViewOpened:t,getCanvasMode:n}=Qe(e(An));return{isSaveViewOpen:t(),canvasMode:n()}}),[]),{setIsSaveViewOpened:n}=(0,m.useDispatch)(An),a=()=>n(!1);return"view"===t?e?(0,s.createElement)(E.Modal,{className:"edit-site-save-panel__modal",onRequestClose:a,__experimentalHideHeader:!0,contentLabel:(0,y.__)("Save site, content, and template changes")},(0,s.createElement)(h.EntitiesSavedStates,{close:a})):null:(0,s.createElement)(ne,{className:"edit-site-layout__actions",ariaLabel:(0,y.__)("Save sidebar")},e?(0,s.createElement)(h.EntitiesSavedStates,{close:a}):(0,s.createElement)("div",{className:"edit-site-editor__toggle-save-panel"},(0,s.createElement)(E.Button,{variant:"secondary",className:"edit-site-editor__toggle-save-panel-button",onClick:()=>n(!0),"aria-expanded":!1},(0,y.__)("Open save panel"))))}const qs=.5,Ys={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};function Xs(){!function(){const{params:{postId:e,postType:t,path:n="/"}={}}=Ct(),{isRequestingSite:a,homepageId:r}=(0,m.useSelect)((e=>{const{getSite:t}=e(_.store),n=t();return{isRequestingSite:!n,homepageId:"page"===(null==n?void 0:n.show_on_front)?n.page_on_front:null}}),[]),{setTemplate:l,setTemplatePart:o,setPage:i}=(0,m.useDispatch)(An);(0,s.useEffect)((()=>{switch(n){case"/templates/single":l(e);break;case"/template-parts/single":o(e);break;case"/navigation/single":i({context:{postType:t,postId:e}});break;default:r?i({context:{postType:"page",postId:r}}):a||i({path:"/"})}}),[n,e,r,a,i,l,o])}(),function(){const e=Tt(),{params:t}=Ct(),n=(0,m.useSelect)((e=>Qe(e(An)).getCanvasMode()),[]),{setCanvasMode:a}=Qe((0,m.useDispatch)(An)),r=(0,s.useRef)(n),{canvas:l="view"}=t,o=(0,s.useRef)(l);(0,s.useEffect)((()=>{r.current=n,r!==o&&e.push({...t,canvas:n})}),[n]),(0,s.useEffect)((()=>{o.current=l,l!==r.current&&a(l)}),[l])}();const e=(0,s.useRef)(),{params:t}=Ct(),n=function(e){let{path:t}=e;return"/templates/all"===t||"/template-parts/all"===t}(t),a=!n,{canvasMode:r,previousShortcut:l,nextShortcut:o}=(0,m.useSelect)((e=>{const{getAllShortcutKeyCombinations:t}=e(Ln.store),{getCanvasMode:n}=Qe(e(An));return{canvasMode:n(),previousShortcut:t("core/edit-site/previous-region"),nextShortcut:t("core/edit-site/next-region")}}),[]),i=(0,E.__unstableUseNavigateRegions)({previous:l,next:o}),c=(0,te.useReducedMotion)(),u=(0,te.useViewportMatch)("medium","<"),d=u?0:24,p=u&&!n||!u&&("view"===r||!a),h=u&&a&&"edit"===r||!u||!a,v=!a&&!u||!u&&a&&"view"===r,b=u&&n||a&&"edit"===r,[w,S]=(0,te.useResizeObserver)(),[x,k]=(0,te.useResizeObserver)(),[C,T]=(0,s.useState)(null),[N,M]=(0,s.useState)(!1),I=!u&&"view"===r,P=u?"100vw":360;let B=N?"100%":k.width;return v&&!N&&(B=S.width-d),"init"===r?null:(0,s.createElement)(s.Fragment,null,x,(0,s.createElement)("div",g({},i,{ref:i.ref,className:f()("edit-site-layout",i.className,{"is-full-canvas":b,"is-edit-mode":"edit"===r})}),(0,s.createElement)(Ws,{ref:e,className:"edit-site-layout__hub",style:{width:I&&C?C-48:void 0}}),(0,s.createElement)(E.__unstableAnimatePresence,{initial:!1},a&&"edit"===r&&(0,s.createElement)(ne,{className:"edit-site-layout__header",ariaLabel:(0,y.__)("Editor top bar"),as:E.__unstableMotion.div,animate:{y:0},initial:{y:"-100%"},exit:{y:"-100%"},transition:{type:"tween",duration:c?0:qs,ease:"easeOut"}},"edit"===r&&(0,s.createElement)(Os,null))),(0,s.createElement)("div",{className:"edit-site-layout__content"},(0,s.createElement)(E.__unstableAnimatePresence,{initial:!1},p&&(0,s.createElement)(E.ResizableBox,{as:E.__unstableMotion.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{type:"tween",duration:c||N?0:qs,ease:"easeOut"},size:{height:"100%",width:I&&C?C:P},className:"edit-site-layout__sidebar",enable:{right:I},onResizeStop:(e,t,n)=>{T(n.clientWidth),M(!1)},onResizeStart:()=>{M(!0)},onResize:(t,n,a)=>{e.current.style.width=a.clientWidth-48+"px"},handleComponent:{right:(0,s.createElement)(pi,{direction:"right",variation:"separator",resizeWidthBy:e=>{T((null!=C?C:P)+e)}})},handleClasses:void 0,handleStyles:{right:Ys},minWidth:I?320:void 0,maxWidth:I&&k?k.width-360:void 0},(0,s.createElement)(ne,{ariaLabel:(0,y.__)("Navigation sidebar")},(0,s.createElement)(Xa,null)))),(0,s.createElement)(js,null),h&&(0,s.createElement)("div",{className:f()("edit-site-layout__canvas-container",{"is-resizing":N}),style:{paddingTop:v?d:0,paddingBottom:v?d:0}},w,!!S.width&&(0,s.createElement)(E.__unstableMotion.div,{initial:!1,layout:"position",className:"edit-site-layout__canvas",transition:{type:"tween",duration:c||N?0:qs,ease:"easeOut"}},(0,s.createElement)(E.__unstableMotion.div,{style:{position:"absolute",top:0,left:0,bottom:0},initial:!1,animate:{width:B},transition:{type:"tween",duration:c||N?0:qs,ease:"easeOut"}},(0,s.createElement)(ts,null,a&&(0,s.createElement)(Ai,null),n&&(0,s.createElement)(Qi,null))))))))}function Zs(){const{createErrorNotice:e}=(0,m.useDispatch)(Ee.store);return(0,s.createElement)(Ln.ShortcutProvider,{style:{height:"100%"}},(0,s.createElement)(E.SlotFillProvider,null,(0,s.createElement)(E.Popover.Slot,null),(0,s.createElement)(h.UnsavedChangesWarning,null),(0,s.createElement)(Mt,null,(0,s.createElement)(Xs,null),(0,s.createElement)(O.PluginArea,{onError:function(t){e((0,y.sprintf)((0,y.__)('The "%s" plugin has encountered an error and cannot be rendered.'),t))}}))))}function Ks(e){let{className:t,...n}=e;const a=(0,m.useSelect)((e=>e(An).getSettings().showIconLabels),[]);return(0,s.createElement)(ee,g({panelClassName:t,className:"edit-site-sidebar-edit-mode",scope:"core/edit-site",showIconLabels:a},n))}function Qs(e){return(0,s.createElement)(X,g({__unstableExplicitMenuItem:!0,scope:"core/edit-site"},e))}var Js=(0,te.compose)((0,O.withPluginContext)(((e,t)=>{var n;return{as:null!==(n=t.as)&&void 0!==n?n:E.MenuItem,icon:t.icon||e.icon,name:"core/edit-site/plugin-more-menu"}})))(q);function ec(e,t){const n=document.getElementById(e),a=(0,s.createRoot)(n);return t.__experimentalFetchLinkSuggestions=(e,n)=>(0,_.__experimentalFetchLinkSuggestions)(e,n,t),t.__experimentalFetchRichUrlData=_.__experimentalFetchUrlData,(0,m.dispatch)(c.store).__experimentalReapplyBlockTypeFilters(),(0,u.registerCoreBlocks)(),(0,he.registerLegacyWidgetBlock)({inserter:!1}),(0,_e.addFilter)("blockEditor.__unstableCanInsertBlockType","removeClassicBlockFromInserter",((e,t)=>"core/freeform"!==t.name&&e)),(0,m.dispatch)(T.store).setDefaults("core/edit-site",{editorMode:"visual",fixedToolbar:!1,focusMode:!1,keepCaretInsideBlock:!1,welcomeGuide:!0,welcomeGuideStyles:!0,showListViewByDefault:!1}),(0,m.dispatch)(F).setDefaultComplementaryArea("core/edit-site","edit-site/template"),(0,m.dispatch)(An).updateSettings(t),(0,m.dispatch)(h.store).updateEditorSettings({defaultTemplateTypes:t.defaultTemplateTypes,defaultTemplatePartAreas:t.defaultTemplatePartAreas}),window.addEventListener("dragover",(e=>e.preventDefault()),!1),window.addEventListener("drop",(e=>e.preventDefault()),!1),a.render((0,s.createElement)(Zs,null)),a}function tc(){p()("wp.editSite.reinitializeEditor",{since:"6.2",version:"6.3"})}}(),(window.wp=window.wp||{}).editSite=a}();