/*! 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(y(c),_):E(c);s=(c=y(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 O=(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:O,actions:e,selectors:t});(0,m.register)(F);var G=window.wp.plugins,H=(0,G.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));var $=H((function(e){let{as:t=y.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=y.Button,onClick:a,...r}=e;return(0,s.createElement)(y.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=y.ButtonGroup,fillProps:a={},bubblesVirtually:r,...l}=e;return(0,s.createElement)(y.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)(y.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)(y.Fill,g({name:`PinnedItems/${t}`},n))}Z.Slot=function(e){let{scope:t,className:n,...a}=e;return(0,s.createElement)(y.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)(y.Fill,{name:`ComplementaryArea/${t}`},(0,s.createElement)("div",{className:a},n))}const J=H((function(e){let{children:t,className:n,closeLabel:a=(0,E.__)("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)(y.Button,{className:"interface-complementary-area__pin-unpin-item",icon:T?S:x,label:T?(0,E.__)("Unpin from toolbar"):(0,E.__)("Pin to toolbar"),onClick:()=>(T?V:z)(d,r),isPressed:T,"aria-expanded":T}))),(0,s.createElement)(y.Panel,{className:u},t)))}));J.Slot=function(e){let{scope:t,...n}=e;return(0,s.createElement)(y.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,y.__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,E.__)("Header"),body:(0,E.__)("Content"),secondarySidebar:(0,E.__)("Block Library"),sidebar:(0,E.__)("Settings"),actions:(0,E.__)("Publish"),footer:(0,E.__)("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:y.__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=y.DropdownMenu,className:n,label:a=(0,E.__)("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)(y.Modal,{className:"interface-preferences-modal",title:(0,E.__)("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)(y.TabPanel,{className:"interface-preferences__tabs",tabs:l,initialTabName:a!==ue?a:void 0,onSelect:r,orientation:"vertical"},i):(0,s.createElement)(y.__experimentalNavigatorProvider,{initialPath:"/",className:"interface-preferences__provider"},(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/"},(0,s.createElement)(y.Card,{isBorderless:!0,size:"small"},(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalItemGroup,null,l.map((e=>(0,s.createElement)(y.__experimentalNavigatorButton,{key:e.name,path:e.name,as:y.__experimentalItem,isAction:!0},(0,s.createElement)(y.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(y.__experimentalTruncate,null,e.title)),(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(ie,{icon:(0,E.isRTL)()?se:ce})))))))))),t.length&&t.map((e=>(0,s.createElement)(y.__experimentalNavigatorScreen,{key:`${e.name}-menu`,path:e.name},(0,s.createElement)(y.Card,{isBorderless:!0,size:"large"},(0,s.createElement)(y.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6"},(0,s.createElement)(y.__experimentalNavigatorBackButton,{icon:(0,E.isRTL)()?ce:se,"aria-label":(0,E.__)("Navigate to the previous view")}),(0,s.createElement)(y.__experimentalText,{size:"16"},e.tabLabel)),(0,s.createElement)(y.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)(y.ToggleControl,{__nextHasNoMarginBottom:!0,help:t,label:n,checked:a,onChange:r}),l)},_e=window.wp.widgets,he=window.wp.hooks,ge=window.wp.mediaUtils;(0,he.addFilter)("editor.MediaUpload","core/edit-site/components/media-upload",(()=>ge.MediaUpload));var ve=window.lodash,fe=window.wp.blockEditor,ye=window.wp.notices,Ee={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,Oe={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)*(Ee[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,Oe),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,E._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&a&&a.length&&e.push({name:(0,E._x)("Default","Indicates this palette comes from WordPress."),colors:a}),t&&t.length&&e.push({name:(0,E._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,E._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),r&&a&&a.length&&e.push({name:(0,E._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),t&&t.length&&e.push({name:(0,E._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)(ye.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,E.sprintf)((0,E.__)("%s styles applied."),(0,c.getBlockType)(t).title),{type:"snackbar",actions:[{label:(0,E.__)("Undo"),onClick(){i(),a({style:e}),o((()=>l),{undoIgnore:!0})}}]})}),[r,n,l,t]);return(0,s.createElement)(y.BaseControl,{className:"edit-site-push-changes-to-global-styles-control",help:(0,E.sprintf)((0,E.__)("Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks."),(0,c.getBlockType)(t).title)},(0,s.createElement)(y.BaseControl.VisualLabel,null,(0,E.__)("Styles")),(0,s.createElement)(y.Button,{variant:"primary",disabled:0===r.length,onClick:d},(0,E.__)("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,he.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 yt=window.wp.url;const Et=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 y={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 y}(),bt=Et.push,wt=Et.replace;Et.push=function(e,t){const n=(0,yt.getQueryArgs)(window.location.href),a=(0,yt.removeQueryArgs)(window.location.href,...Object.keys(n)),r=(0,yt.addQueryArgs)(a,e);return bt.call(Et,r,t)},Et.replace=function(e,t){const n=(0,yt.getQueryArgs)(window.location.href),a=(0,yt.removeQueryArgs)(window.location.href,...Object.keys(n)),r=(0,yt.addQueryArgs)(a,e);return wt.call(Et,r,t)};var St=Et;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)}const l=(0,yt.getQueryArgs)(window.location.href),o=(0,yt.removeQueryArgs)(window.location.href,...Object.keys(l)),i=(0,yt.addQueryArgs)(o,e);return{href:i,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)(y.ToolbarButton,g({},o,{onClick:e=>{o.onClick(e)}}),(0,E.__)("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,he.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 Ot(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 Gt(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(ye.store).createSuccessNotice((0,E.sprintf)((0,E.__)('"%s" deleted.'),e.title.rendered),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while deleting the template.");n.dispatch(ye.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,yt.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(Ot(e))try{var r;const n=a.select(_.store).getEntityConfig("postType",e.type);if(!n)return void a.dispatch(ye.store).createErrorNotice((0,E.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const l=(0,yt.addQueryArgs)(`${n.baseURL}/${e.id}`,{context:"edit",source:"theme"}),o=await At()({path:l});if(!o)return void a.dispatch(ye.store).createErrorNotice((0,E.__)("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(ye.store).createSuccessNotice((0,E.__)("Template reverted."),{type:"snackbar",actions:[{label:(0,E.__)("Undo"),onClick:t}]})}else a.dispatch(ye.store).createSuccessNotice((0,E.__)("Template reverted."))}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("Template revert failed. Please reload.");a.dispatch(ye.store).createErrorNotice(t,{type:"snackbar"})}else a.dispatch(ye.store).createErrorNotice((0,E.__)("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,E.__)("Visual editor selected"),"assertive"):"mosaic"===e&&(0,Lt.speak)((0,E.__)("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}):[])),yn=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 En(){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;(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 Dn=(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 On=(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 Fn(e){return(0,s.createElement)(y.Button,g({},e,{className:f()("edit-site-sidebar-button",e.className)}))}function Gn(e){let{isRoot:t,title:n,actions:a,content:r,description:l}=e;const{dashboardLink:o}=(0,m.useSelect)((e=>{const{getSettings:t}=Qe(e(An));return{dashboardLink:t().__experimentalDashboardLink}}),[]);return(0,s.createElement)(y.__experimentalVStack,{spacing:2},(0,s.createElement)(y.__experimentalHStack,{spacing:4,justify:"flex-start",className:"edit-site-sidebar-navigation-screen__title-icon"},t?(0,s.createElement)(Fn,{icon:(0,E.isRTL)()?ce:se,"aria-label":(0,E.__)("Navigate to the Dashboard"),href:o||"index.php",label:(0,E.__)("Dashboard")}):(0,s.createElement)(y.__experimentalNavigatorToParentButton,{as:Fn,icon:(0,E.isRTL)()?ce:se,"aria-label":(0,E.__)("Back")}),(0,s.createElement)("h2",{className:"edit-site-sidebar-navigation-screen__title"},n),a),(0,s.createElement)("nav",{className:"edit-site-sidebar-navigation-screen__content"},l&&(0,s.createElement)("p",{className:"edit-site-sidebar-navigation-screen__description"},l),r))}function Hn(e){let{className:t,icon:n,withChevron:a=!1,children:r,...l}=e;return(0,s.createElement)(y.__experimentalItem,g({className:f()("edit-site-sidebar-navigation-item",t)},l),n&&(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(ie,{style:{fill:"currentcolor"},icon:n,size:24}),(0,s.createElement)(y.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)(Gn,{isRoot:!0,title:(0,E.__)("Design"),description:(0,E.__)("Customize the appearance of your website using the block editor."),content:(0,s.createElement)(y.__experimentalItemGroup,null,false,(0,s.createElement)(y.__experimentalNavigatorButton,{as:Hn,path:"/wp_template",withChevron:!0,icon:Dn},(0,E.__)("Templates")),(0,s.createElement)(y.__experimentalNavigatorButton,{as:Hn,path:"/wp_template_part",withChevron:!0,icon:On},(0,E.__)("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)(y.Modal,{isFullScreen:!0,isDismissible:!1,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,onRequestClose:()=>{},__experimentalHideHeader:!0,className:e},(0,s.createElement)("div",{className:`${e}__content`},(0,s.createElement)(y.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,E.sprintf)((0,E.__)("Archive: %1$s (%2$s)"),e.labels.singular_name,e.slug):(0,E.sprintf)((0,E.__)("Archive: %s"),e.labels.singular_name),{slug:"archive-"+e.slug,description:(0,E.sprintf)((0,E.__)("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,E.sprintf)((0,E.__)("%1$s (%2$s)"),u.singular_name,c));const g=d?{...d,templatePrefix:r[c]}:{slug:m,title:h,description:(0,E.sprintf)((0,E.__)("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)(y.__unstableCompositeItem,g({role:"option",as:y.Button},l,{className:o,onClick:()=>a(r.config.getSpecificTemplate(t))}),(0,s.createElement)("span",{className:`${o}__title`},(0,s.createElement)(y.TextHighlight,{text:(0,Un.decodeEntities)(t.name),highlight:n})),t.link&&(0,s.createElement)("span",{className:`${o}__info`},t.link))}function ya(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 Ea(e){let{entityForSuggestions:t,onSelect:n}=e;const a=(0,y.__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=ya(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)(y.SearchControl,{__nextHasNoMarginBottom:!0,onChange:l,value:r,label:c.search_items,placeholder:c.search_items}),!(null==i||!i.length)&&(0,s.createElement)(y.__unstableComposite,g({},a,{role:"listbox",className:"edit-site-custom-template-modal__suggestions_list","aria-label":(0,E.__)("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)(y.__experimentalText,{as:"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)(y.Modal,{title:(0,E.sprintf)((0,E.__)("Add template: %s"),a.labels.singular_name),className:i,onRequestClose:t},r&&(0,s.createElement)(la,null),!l&&(0,s.createElement)(y.__experimentalVStack,{spacing:4},(0,s.createElement)(y.__experimentalText,{as:"p"},(0,E.__)("Select whether to create a single template for all items or a specific one.")),(0,s.createElement)(y.Flex,{className:`${i}__contents`,gap:"4",align:"initial"},(0,s.createElement)(y.FlexItem,{isBlock:!0,as:y.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)(y.__experimentalText,{as:"span",weight:600},a.labels.all_items),(0,s.createElement)(y.__experimentalText,{as:"span"},(0,E.__)("For all items"))),(0,s.createElement)(y.FlexItem,{isBlock:!0,as:y.Button,onClick:()=>{o(!0)}},(0,s.createElement)(y.__experimentalText,{as:"span",weight:600},a.labels.singular_name),(0,s.createElement)(y.__experimentalText,{as:"span"},(0,E.__)("For a specific item"))))),l&&(0,s.createElement)(y.__experimentalVStack,{spacing:4},(0,s.createElement)(y.__experimentalText,{as:"p"},(0,E.__)("This template will be used only for the specific item chosen.")),(0,s.createElement)(Ea,{entityForSuggestions:a,onSelect:n})))};var wa=function(e){let{onClose:t,createTemplate:n,isCreatingTemplate:a}=e;const[r,l]=(0,s.useState)(""),o=(0,E.__)("Custom Template"),[i,c]=(0,s.useState)(!1);return(0,s.createElement)(y.Modal,{title:(0,E.__)("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)(y.__experimentalVStack,{spacing:6},(0,s.createElement)(y.TextControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Name"),value:r,onChange:l,placeholder:o,disabled:i,help:(0,E.__)('Describe the template, e.g. "Post with sidebar".')}),(0,s.createElement)(y.__experimentalHStack,{className:"edit-site-custom-generic-template__modal-actions",justify:"right"},(0,s.createElement)(y.Button,{variant:"tertiary",onClick:()=>{t()}},(0,E.__)("Cancel")),(0,s.createElement)(y.Button,{variant:"primary",type:"submit",isBusy:i,"aria-disabled":i},(0,E.__)("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)(ye.store),{setTemplate:b}=Qe((0,m.useDispatch)(An));async function w(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,yt.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),h.push({postId:i.id,postType:i.type,canvas:"edit"}),f((0,E.sprintf)((0,E.__)('"%s" successfully created.'),n),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while creating the template.");v(t,{type:"snackbar"})}finally{p(!1)}}}const S=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,E.sprintf)((0,E.__)("Single item: %s"),u.singular_name);h&&(g=(0,E.sprintf)((0,E.__)("Single item: %1$s (%2$s)"),u.singular_name,c));const v=p?{...p,templatePrefix:l[c]}:{slug:d,title:g,description:(0,E.sprintf)((0,E.__)("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,E.__)("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,E.__)("Author"),search_items:(0,E.__)("Search Authors"),not_found:(0,E.__)("No authors found."),all_items:(0,E.__)("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);if(!S.length)return null;const x=(0,E.__)("A custom template can be manually applied to any post or page.");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.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)("div",{className:"edit-site-new-template-dropdown__menu-groups"},(0,s.createElement)(y.MenuGroup,{label:t.labels.add_new_item},S.map((e=>{const{title:t,description:n,slug:a,onClick:r,icon:l}=e;return(0,s.createElement)(y.Tooltip,{key:a,position:"top right",text:n,className:"edit-site-new-template-dropdown__menu-item-tooltip"},(0,s.createElement)(y.MenuItem,{icon:l||xa[a]||jn,iconPosition:"left",onClick:()=>r?r(e):w(e)},t,(0,s.createElement)(y.VisuallyHidden,null,n)))}))),(0,s.createElement)(y.MenuGroup,null,(0,s.createElement)(y.Tooltip,{position:"top right",text:x,className:"edit-site-new-template-dropdown__menu-item-tooltip"},(0,s.createElement)(y.MenuItem,{icon:Dn,iconPosition:"left",onClick:()=>i(!0)},(0,E.__)("Custom template"),(0,s.createElement)(y.VisuallyHidden,null,x)))))))),r&&(0,s.createElement)(ba,{onClose:()=>l(!1),onSelect:w,entityForSuggestions:c,isCreatingTemplate:d}),o&&(0,s.createElement)(wa,{onClose:()=>i(!1),createTemplate:w,isCreatingTemplate:d}))}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)(y.Modal,{title:(0,E.__)("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)(y.__experimentalVStack,{spacing:"4"},(0,s.createElement)(y.TextControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Name"),value:a,onChange:r,required:!0}),(0,s.createElement)(y.BaseControl,{label:(0,E.__)("Area"),id:`edit-site-create-template-part-modal__area-selection-${u}`,className:"edit-site-create-template-part-modal__area-base-control"},(0,s.createElement)(y.__experimentalRadioGroup,{label:(0,E.__)("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)(y.__experimentalRadio,{key:n,value:a,className:"edit-site-create-template-part-modal__area-radio"},(0,s.createElement)(y.Flex,{align:"start",justify:"start"},(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(y.Icon,{icon:t})),(0,s.createElement)(y.FlexBlock,{className:"edit-site-create-template-part-modal__option-label"},n,(0,s.createElement)("div",null,r)),(0,s.createElement)(y.FlexItem,{className:"edit-site-create-template-part-modal__checkbox"},l===a&&(0,s.createElement)(y.Icon,{icon:w}))))})))),(0,s.createElement)(y.Flex,{className:"edit-site-create-template-part-modal__modal-actions",justify:"flex-end"},(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(y.Button,{variant:"secondary",onClick:()=>{t()}},(0,E.__)("Cancel"))),(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(y.Button,{variant:"primary",type:"submit",disabled:!a,isBusy:i},(0,E.__)("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)(ye.store),{saveEntityRecord:c}=(0,m.useDispatch)(_.store),u=Ta();const{as:d=y.Button,...p}=null!=a?a:{};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(d,g({},p,{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,u),a=Ma(e),l=await c("postType","wp_template_part",{slug:a,title:e,content:"",area:n},{throwOnError:!0});o(!1),r.push({postId:l.id,postType:"wp_template_part",canvas:"edit"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while creating the template part.");i(t,{type:"snackbar"}),o(!1)}else i((0,E.__)("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:{labels:{title:(0,E.__)("Templates"),loading:(0,E.__)("Loading templates"),notFound:(0,E.__)("No templates found"),manage:(0,E.__)("Manage all templates"),description:(0,E.__)("Express the layout of your site with templates.")}},wp_template_part:{labels:{title:(0,E.__)("Template parts"),loading:(0,E.__)("Loading template parts"),notFound:(0,E.__)("No template parts found"),manage:(0,E.__)("Manage all template parts"),description:(0,E.__)("Template Parts are small pieces of a layout that can be reused across multiple templates and always appear the same way. Common template parts include the site header, footer, or sidebar.")}}},za=e=>{let{postType:t,postId:n,...a}=e;const r=It({postType:t,postId:n});return(0,s.createElement)(Hn,g({},r,a))};function Va(){const{params:{postType:e}}=(0,y.__experimentalUseNavigator)(),t=(0,te.useViewportMatch)("medium","<"),n=(0,m.useSelect)((e=>!!e(An).getSettings().supportsTemplatePartsMode),[]),{records:a,isResolving:r}=(0,_.useEntityRecords)("postType",e,{per_page:-1}),l=a?[...a]:[];l.sort(((e,t)=>e.slug.localeCompare(t.slug)));const o=It({path:"/"+e+"/all"}),i=!t&&!n;return(0,s.createElement)(Gn,{isRoot:n,title:Ba[e].labels.title,description:Ba[e].labels.description,actions:i&&(0,s.createElement)(Pa,{templateType:e,toggleProps:{as:Fn}}),content:(0,s.createElement)(s.Fragment,null,r&&Ba[e].labels.loading,!r&&(0,s.createElement)(y.__experimentalItemGroup,null,!(null!=a&&a.length)&&(0,s.createElement)(y.__experimentalItem,null,Ba[e].labels.notFound),l.map((t=>{var n;return(0,s.createElement)(za,{postType:e,postId:t.id,key:t.id},(0,Un.decodeEntities)((null===(n=t.title)||void 0===n?void 0:n.rendered)||t.slug))})),!t&&(0,s.createElement)(Hn,g({className:"edit-site-sidebar-navigation-screen-templates__see-all"},o,{children:Ba[e].labels.manage}))))})}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:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));function Aa(e,t){const{record:n,title:a,description:r,isLoaded:l}=(0,m.useSelect)((n=>{const{getEditedPostType:a,getEditedPostId:r}=n(An),{getEditedEntityRecord:l}=n(_.store),{__experimentalGetTemplateInfo:o}=n(h.store),i=null!=e?e:a(),s=null!=t?t:r(),c=l("postType",i,s),u=!!s,m=o(c);return{record:c,title:m.title,description:m.description,isLoaded:u}}),[e,t]);return{isLoaded:l,record:n,getTitle:()=>a?(0,Un.decodeEntities)(a):null,getDescription:()=>r?(0,Un.decodeEntities)(r):null}}function La(){const{params:e}=(0,y.__experimentalUseNavigator)(),{postType:t,postId:n}=e,{setCanvasMode:a}=Qe((0,m.useDispatch)(An)),{getDescription:r,getTitle:l,record:o}=Aa(t,n);let i=r();return i||("wp_template"===o.type&&o.is_custom?i=(0,E.__)("This is a custom template that can be applied manually to any Post or Page."):"wp_template_part"===o.type&&(i=(0,E.sprintf)((0,E.__)("This is your %s template part."),l()))),(0,s.createElement)(Gn,{title:l(),actions:(0,s.createElement)(Fn,{onClick:()=>a("edit"),label:(0,E.__)("Edit"),icon:Ra}),description:i})}function Da(e){var t;let n=null!==(t=null==e?void 0:e.path)&&void 0!==t?t:"/";if(null!=e&&e.postType&&null!=e&&e.postId)switch(e.postType){case"wp_template":case"wp_template_part":n=`/${encodeURIComponent(e.postType)}/${encodeURIComponent(e.postId)}`;break;default:n=`/navigation/${encodeURIComponent(e.postType)}/${encodeURIComponent(e.postId)}`}return n}function Oa(){return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"edit-site-sidebar-navigation-screen-navigation-menus__placeholder"}),(0,s.createElement)("div",{className:"edit-site-sidebar-navigation-screen-navigation-menus__placeholder"}),(0,s.createElement)("div",{className:"edit-site-sidebar-navigation-screen-navigation-menus__placeholder"}))}function Fa(e){let{rootClientId:t,onSelect:n}=e;const{clientIdsTree:a,isLoading:r}=(0,m.useSelect)((e=>{const{__unstableGetClientIdsTree:n,areInnerBlocksControlled:a}=e(fe.store);return{clientIdsTree:n(t),isLoading:!a(t)}}),[t]),{replaceBlock:l,__unstableMarkNextChangeAsNotPersistent:o}=(0,m.useDispatch)(fe.store),{OffCanvasEditor:i,LeafMoreMenu:u}=Qe(fe.privateApis),d=(0,s.useCallback)((e=>{"core/navigation-link"!==e.name||e.attributes.url?n(e):(o(),l(e.clientId,(0,c.createBlock)("core/navigation-link",e.attributes)))}),[n,o,l]);return(0,s.createElement)(s.Fragment,null,r&&(0,s.createElement)(Oa,null),!r&&(0,s.createElement)(i,{blocks:a,onSelect:d,LeafMoreMenu:u,showAppender:!1}),(0,s.createElement)("div",{style:{visibility:"hidden"}},(0,s.createElement)(fe.BlockTools,null,(0,s.createElement)(fe.BlockList,null))))}const Ga=()=>{},Ha={per_page:-1,status:"publish"};function $a(e){let{children:t,actions:n}=e;return(0,s.createElement)(Gn,{title:(0,E.__)("Navigation"),actions:n,description:(0,E.__)("Browse your site, edit pages, and manage your primary navigation menu."),content:t})}function Ua(){var e;const t=Tt(),{navigationMenus:n,hasResolvedNavigationMenus:a,storedSettings:r}=(0,m.useSelect)((e=>{const{getSettings:t}=Qe(e(An)),{getEntityRecords:n,hasFinishedResolution:a}=e(_.store),r=["postType","wp_navigation",Ha];return{storedSettings:t(!1),navigationMenus:n(...r),hasResolvedNavigationMenus:a("getEntityRecords",r)}}),[]),l=(0,s.useMemo)((()=>null==n?void 0:n.sort(((e,t)=>{const n=new Date(e.date),a=new Date(t.date);return n.getTime()>a.getTime()}))),[n]),o=null==l||null===(e=l[0])||void 0===e?void 0:e.id,i=(0,s.useMemo)((()=>[(0,c.createBlock)("core/navigation",{ref:o})]),[o]),u=!a,d=!(null==n||!n.length),p=(0,s.useCallback)((e=>{const{attributes:n,name:a}=e;"post-type"===n.kind&&n.id&&n.type&&t&&t.push({postType:n.type,postId:n.id}),"core/page-list-item"===a&&n.id&&t&&t.push({postType:"page",postId:n.id})}),[t]);return a&&!d?(0,s.createElement)($a,null,(0,E.__)("There are no Navigation Menus.")):!a||u?(0,s.createElement)($a,null,(0,s.createElement)(Oa,null)):(0,s.createElement)(fe.BlockEditorProvider,{settings:r,value:i,onChange:Ga,onInput:Ga},(0,s.createElement)($a,null,(0,s.createElement)("div",{className:"edit-site-sidebar-navigation-screen-navigation-menus__content"},(0,s.createElement)(Fa,{rootClientId:i[0].clientId,onSelect:p}))))}const Wa={wp_template:{title:(0,E.__)("All templates"),description:(0,E.__)("Create new templates, or reset any customizations made to the templates supplied by your theme.")},wp_template_part:{title:(0,E.__)("All template parts"),description:(0,E.__)("Create new template parts, or reset any customizations made to the template parts supplied by your theme.")}};function ja(){const{params:{postType:e}}=(0,y.__experimentalUseNavigator)();return(0,s.createElement)(Gn,{title:Wa[e].title,description:Wa[e].description})}var qa=window.wp.keycodes;function Ya(){const{countUnsavedChanges:e,isDirty:t,isSaving:n,isSaveViewOpen:a}=(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(),countUnsavedChanges:a.length}}),[]),{setIsSaveViewOpened:r}=(0,m.useDispatch)(An),l=!t||n,o=l?(0,E.__)("Saved"):(0,E.__)("Save");return(0,s.createElement)(y.__experimentalHStack,{className:"edit-site-save-hub",alignment:"right",spacing:4},t&&(0,s.createElement)("span",null,(0,E.sprintf)((0,E._n)("%d unsaved change","%d unsaved changes",e),e)),(0,s.createElement)(y.Button,{className:"edit-site-save-hub__button",variant:l?void 0:"primary","aria-disabled":l,"aria-expanded":a,isBusy:n,onClick:l?void 0:()=>r(!0),label:o,shortcut:l?void 0:qa.displayShortcut.primary("s"),icon:l?w:void 0},o))}function Xa(){var e,t;const{setCanvasMode:n}=Qe((0,m.useDispatch)(An)),{params:{postType:a,postId:r}}=(0,y.__experimentalUseNavigator)(),{record:l}=(0,_.useEntityRecord)("postType",a,r);return(0,s.createElement)(Gn,{title:l?(0,Un.decodeEntities)(null==l||null===(e=l.title)||void 0===e?void 0:e.rendered):null,actions:(0,s.createElement)(Fn,{onClick:()=>n("edit"),label:(0,E.__)("Edit"),icon:Ra}),description:"page"===a?(0,E.__)("Pages are static and are not listed by date. Pages do not use tags or categories."):(0,E.__)("Posts are entries listed in reverse chronological order on the site homepage or on the posts page."),content:(0,s.createElement)(s.Fragment,null,null!=l&&l.link?(0,s.createElement)(y.ExternalLink,{className:"edit-site-sidebar-navigation-screen__page-link",href:l.link},l.link):null,l?(0,Un.decodeEntities)(null==l||null===(t=l.description)||void 0===t?void 0:t.rendered):null)})}function Za(){return function(){const e=Tt(),{params:t}=Ct(),{location:n,params:a,goTo:r}=(0,y.__experimentalUseNavigator)(),l=(0,s.useRef)(t),o=(0,s.useRef)(n.path),i=(0,s.useRef)(!0);(0,s.useEffect)((()=>{function t(t){if(Object.entries(t).every((e=>{let[t,n]=e;return l.current[t]===n})))return;const n={...l.current,...t};l.current=n,e.push(n)}i.current?i.current=!1:null!=a&&a.postType&&null!=a&&a.postId?t({postType:null==a?void 0:a.postType,postId:null==a?void 0:a.postId,path:void 0}):t({postType:void 0,postId:void 0,path:"/"===n.path?void 0:n.path})}),[null==n?void 0:n.path,a,e]),(0,s.useEffect)((()=>{l.current=t;const e=Da(t);o.current!==e&&(o.current=e,r(e))}),[t,r])}(),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/"},(0,s.createElement)($n,null)),(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/navigation"},(0,s.createElement)(Ua,null)),(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/navigation/:postType/:postId"},(0,s.createElement)(Xa,null)),(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/:postType(wp_template|wp_template_part)"},(0,s.createElement)(Va,null)),(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/:postType(wp_template|wp_template_part)/all"},(0,s.createElement)(ja,null)),(0,s.createElement)(y.__experimentalNavigatorScreen,{path:"/:postType(wp_template|wp_template_part)/:postId"},(0,s.createElement)(La,null)))}var Ka=(0,s.memo)((function(){const{params:e}=Ct(),t=(0,s.useRef)(Da(e));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.__experimentalNavigatorProvider,{className:"edit-site-sidebar__content",initialPath:t.current},(0,s.createElement)(Za,null)),(0,s.createElement)("div",{className:"edit-site-sidebar__footer"},(0,s.createElement)(Ya,null)))}));var Qa=(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 Ja=(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 er(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 tr=(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 nr=(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 ar(e){let{className:t,...n}=e;return(0,s.createElement)(y.Icon,g({className:f()(t,"edit-site-global-styles-icon-with-current-color")},n))}function rr(e){let{icon:t,children:n,...a}=e;return(0,s.createElement)(y.__experimentalItem,a,t&&(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(ar,{icon:t,size:24}),(0,s.createElement)(y.FlexItem,null,n)),!t&&n)}function lr(e){return(0,s.createElement)(y.__experimentalNavigatorButton,g({as:rr},e))}var or=(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 ir=(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 sr=(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 cr=(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:ur,useGlobalStyle:mr}=Qe(fe.privateApis);function dr(e){return[pr(e),_r(e),hr(e),gr(e)].some(Boolean)}function pr(e){const t=tt(e);return ur("border.color",e)[0]&&t.includes("borderColor")}function _r(e){const t=tt(e);return ur("border.radius",e)[0]&&t.includes("borderRadius")}function hr(e){const t=tt(e);return ur("border.style",e)[0]&&t.includes("borderStyle")}function gr(e){const t=tt(e);return ur("border.width",e)[0]&&t.includes("borderWidth")}function vr(e){return e?e.style||!e.color&&!e.width?e:{...e,style:"solid"}:e}function fr(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",[r]=mr(`${a}border`,t,"user"),[l,o]=mr(`${a}border`,t),i=nt(t),c=pr(t),u=hr(t),m=gr(t),d=_r(t),[p,_]=mr(`${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,y.__experimentalHasSplitBorders)(e)?{top:vr(e.top),right:vr(e.right),bottom:vr(e.bottom),left:vr(e.left)}:vr(e):e}(e),n=(0,y.__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)(y.__experimentalToolsPanel,{label:(0,E.__)("Border"),resetAll:g},(m||c)&&(0,s.createElement)(y.__experimentalToolsPanelItem,{hasValue:()=>(0,y.__experimentalIsDefinedBorder)(r),label:(0,E.__)("Border"),onDeselect:()=>(()=>{if(h())return o({radius:r.radius});o(void 0)})(),isShownByDefault:!0},(0,s.createElement)(y.__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)(y.__experimentalToolsPanelItem,{hasValue:h,label:(0,E.__)("Radius"),onDeselect:()=>_(void 0),isShownByDefault:!0},(0,s.createElement)(fe.__experimentalBorderRadiusControl,{values:p,onChange:e=>{_(e||void 0)}})))}function yr(e){const t=tt(e);return t.includes("color")||t.includes("backgroundColor")||t.includes("background")||t.includes("linkColor")}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:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));var br=(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:wr,useGlobalStyle:Sr}=Qe(fe.privateApis),xr=["horizontal","vertical"];function kr(e){const t=Cr(e),n=Tr(e),a=Nr(e),r=Mr(e),l=Ir(e),o=Pr(e);return t||n||a||r||l||o}function Cr(e){const t=tt(e),[n]=wr("layout.contentSize",e);return n&&t.includes("contentSize")}function Tr(e){const t=tt(e),[n]=wr("layout.wideSize",e);return n&&t.includes("wideSize")}function Nr(e){const t=tt(e),[n]=wr("spacing.padding",e);return n&&t.includes("padding")}function Mr(e){const t=tt(e),[n]=wr("spacing.margin",e);return n&&t.includes("margin")}function Ir(e){const t=tt(e),[n]=wr("spacing.blockGap",e);return n&&t.includes("blockGap")}function Pr(e){const t=tt(e),[n]=wr("dimensions.minHeight",e);return n&&t.includes("minHeight")}function Br(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 zr(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function Vr(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 Rr(e){let{name:t,variation:n=""}=e;const a=Cr(t),r=Tr(t),l=Nr(t),o=Mr(t),i=Ir(t),c=Pr(t),u=function(){var e,t;const[n]=wr("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,y.__experimentalUseCustomUnits)({availableUnits:wr("spacing.units",t)[0]||["%","px","em","rem","vw"]}),{contentSizeValue:d,setContentSizeValue:p,hasUserSetContentSizeValue:_,resetContentSizeValue:h}=function(e){const[t,n]=wr("layout.contentSize",e),[a]=wr("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]=wr("layout.wideSize",e),[a]=wr("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]=Sr(n+"spacing.padding",e),l=zr(a),o=(0,fe.__experimentalUseCustomSides)(e,"padding"),i=o&&o.some((e=>xr.includes(e))),s=e=>{const t=Br(e,o);r(t)},c=()=>s({}),[u]=Sr(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]=Sr(n+"spacing.margin",e),l=zr(a),o=(0,fe.__experimentalUseCustomSides)(e,"margin"),i=o&&o.some((e=>xr.includes(e))),s=e=>{const t=Br(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:O,setGapValues:F,resetGapValue:G,hasGapValue:H}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t?`variations.${t}.`:"",[a,r]=Sr(n+"spacing.blockGap",e),l=Vr(a),o=(0,fe.__experimentalUseCustomSides)(e,"blockGap"),i=o&&o.some((e=>xr.includes(e))),s=()=>r(void 0),[c]=Sr(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]=Sr(n+"dimensions.minHeight",e),l=()=>r(void 0);return{minHeightValue:a,setMinHeightValue:r,resetMinHeightValue:l,hasMinHeightValue:()=>!!a}}(t,n);return(0,s.createElement)(y.__experimentalToolsPanel,{label:(0,E.__)("Dimensions"),resetAll:()=>{T(),z(),G(),h(),w()}},(a||r)&&(0,s.createElement)("span",{className:"span-columns"},(0,E.__)("Set the width of the main content area.")),a&&(0,s.createElement)(y.__experimentalToolsPanelItem,{className:"single-column",label:(0,E.__)("Content size"),hasValue:_,onDeselect:h,isShownByDefault:!0},(0,s.createElement)(y.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,s.createElement)(y.__experimentalUnitControl,{label:(0,E.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:d||"",onChange:e=>{p(e)},units:m}),(0,s.createElement)(y.__experimentalView,null,(0,s.createElement)(ie,{icon:Er})))),r&&(0,s.createElement)(y.__experimentalToolsPanelItem,{className:"single-column",label:(0,E.__)("Wide size"),hasValue:b,onDeselect:w,isShownByDefault:!0},(0,s.createElement)(y.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,s.createElement)(y.__experimentalUnitControl,{label:(0,E.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:g||"",onChange:e=>{v(e)},units:m}),(0,s.createElement)(y.__experimentalView,null,(0,s.createElement)(ie,{icon:br})))),l&&(0,s.createElement)(y.__experimentalToolsPanelItem,{hasValue:N,label:(0,E.__)("Padding"),onDeselect:T,isShownByDefault:!0,className:f()({"tools-panel-item-spacing":u})},!u&&(0,s.createElement)(y.__experimentalBoxControl,{values:S,onChange:C,label:(0,E.__)("Padding"),sides:x,units:m,allowReset:!1,splitOnAxis:k}),u&&(0,s.createElement)(fe.__experimentalSpacingSizesControl,{values:S,onChange:C,label:(0,E.__)("Padding"),sides:x,units:m,allowReset:!1,splitOnAxis:k})),o&&(0,s.createElement)(y.__experimentalToolsPanelItem,{hasValue:V,label:(0,E.__)("Margin"),onDeselect:z,isShownByDefault:!0,className:f()({"tools-panel-item-spacing":u})},!u&&(0,s.createElement)(y.__experimentalBoxControl,{values:M,onChange:B,label:(0,E.__)("Margin"),sides:I,units:m,allowReset:!1,splitOnAxis:P}),u&&(0,s.createElement)(fe.__experimentalSpacingSizesControl,{values:M,onChange:B,label:(0,E.__)("Margin"),sides:I,units:m,allowReset:!1,splitOnAxis:P})),i&&(0,s.createElement)(y.__experimentalToolsPanelItem,{hasValue:H,label:(0,E.__)("Block spacing"),onDeselect:G,isShownByDefault:!0,className:f()({"tools-panel-item-spacing":u})},!u&&(D?(0,s.createElement)(y.__experimentalBoxControl,{label:(0,E.__)("Block spacing"),min:0,onChange:F,units:m,sides:L,values:A,allowReset:!1,splitOnAxis:D}):(0,s.createElement)(y.__experimentalUnitControl,{label:(0,E.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:O,units:m,value:R})),u&&(0,s.createElement)(fe.__experimentalSpacingSizesControl,{label:(0,E.__)("Block spacing"),min:0,onChange:F,sides:D?L:["top"],values:A,allowReset:!1,splitOnAxis:D})),c&&(0,s.createElement)(y.__experimentalToolsPanelItem,{hasValue:j,label:(0,E.__)("Min. height"),onDeselect:W,isShownByDefault:!0},(0,s.createElement)(fe.HeightControl,{label:(0,E.__)("Min. height"),value:$,onChange:U})))}const{useGlobalSetting:Ar,useGlobalStyle:Lr}=Qe(fe.privateApis);function Dr(e){const t=Or(e),n=Fr(e),a=Gr(e),r=Hr(e),l=tt(e);return t||n||a||r||l.includes("fontSize")}function Or(e){const t=tt(e),[n]=Ar("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 Fr(e){const t=tt(e);return Ar("typography.lineHeight",e)[0]&&t.includes("lineHeight")}function Gr(e){const t=tt(e),n=Ar("typography.fontStyle",e)[0]&&t.includes("fontStyle"),a=Ar("typography.fontWeight",e)[0]&&t.includes("fontWeight");return n||a}function Hr(e,t){if(!Ar("typography.letterSpacing",e)[0])return!1;if(!e&&"heading"===t)return!0;return tt(e).includes("letterSpacing")}function $r(e,t){const[n,a]=Lr(e,t),[r]=Lr(e,t,"user");return[n,a,()=>!!r,()=>a(void 0)]}function Ur(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]=Ar("typography.fontSizes",t),c=(null==i?void 0:i.custom)||(null==i?void 0:i.theme)||(null==i?void 0:i.default),u=!Ar("typography.customFontSize",t)[0],[m]=Ar("typography.fontFamilies",t),d=(null==m?void 0:m.custom)||(null==m?void 0:m.theme)||(null==m?void 0:m.default),p=Ar("typography.fontStyle",t)[0]&&l.includes("fontStyle"),_=Ar("typography.fontWeight",t)[0]&&l.includes("fontWeight"),h=Or(t),g=Fr(t),v=Gr(t),f=function(e){const t=tt(e),n=Ar("typography.fontStyle",e)[0]&&t.includes("fontStyle"),a=Ar("typography.fontWeight",e)[0]&&t.includes("fontWeight");return n?a?(0,E.__)("Appearance"):(0,E.__)("Font style"):(0,E.__)("Font weight")}(t),b=Hr(t,n),w=function(e,t){return!!Ar("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]=$r(o+"typography.fontFamily",t),{fontSize:M,setFontSize:I,hasFontSize:P,resetFontSize:B}=function(e,t){const[n,a]=Lr(e,t),[r]=Lr(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]=Lr(e+"typography.fontStyle",t),[r]=Lr(e+"typography.fontStyle",t,"user"),[l,o]=Lr(e+"typography.fontWeight",t),[i]=Lr(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),[O,F,G,H]=$r(o+"typography.lineHeight",t),[$,U,W,j]=$r(o+"typography.letterSpacing",t),[q,Y,X,Z]=$r(o+"typography.textTransform",t),[K,Q,J,ee]=$r(o+"typography.textDecoration",t);return(0,s.createElement)(y.__experimentalToolsPanel,{label:(0,E.__)("Typography"),resetAll:()=>{N(),B(),D(),H(),j(),Z()}},h&&(0,s.createElement)(y.__experimentalToolsPanelItem,{label:(0,E.__)("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)(y.__experimentalToolsPanelItem,{label:(0,E.__)("Font size"),hasValue:P,onDeselect:B,isShownByDefault:!0},(0,s.createElement)(y.FontSizePicker,{value:M,onChange:I,fontSizes:c,disableCustomFontSizes:u,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})),v&&(0,s.createElement)(y.__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)(y.__experimentalToolsPanelItem,{className:"single-column",label:(0,E.__)("Line height"),hasValue:G,onDeselect:H,isShownByDefault:!0},(0,s.createElement)(fe.LineHeightControl,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:O,onChange:F,size:"__unstable-large"})),b&&(0,s.createElement)(y.__experimentalToolsPanelItem,{className:"single-column",label:(0,E.__)("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)(y.__experimentalToolsPanelItem,{label:(0,E.__)("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)(y.__experimentalToolsPanelItem,{className:"single-column",label:(0,E.__)("Text decoration"),hasValue:J,onDeselect:ee,isShownByDefault:!0},(0,s.createElement)(fe.__experimentalTextDecorationControl,{value:K,onChange:Q,size:"__unstable-large",__unstableInputWidth:"auto"})))}function Wr(e){return null==e?void 0:e.filter((e=>"block"===e.source))}function jr(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=Wr(a);return!(null==r||!r.length||n)}function qr(e){let{name:t}=e;const n=Wr((0,m.useSelect)((e=>{const{getBlockStyles:n}=e(c.store);return n(t)}),[t]));return(0,s.createElement)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},n.map(((e,n)=>null!=e&&e.isDefault?null:(0,s.createElement)(lr,{key:n,path:"/blocks/"+encodeURIComponent(t)+"/variations/"+encodeURIComponent(e.name),"aria-label":e.label},e.label))))}function Yr(e){let{blockName:t,styleName:n}=e;return(0,s.createElement)(sl,{parentMenu:"/blocks/"+encodeURIComponent(t)+"/variations/"+encodeURIComponent(n),name:t})}var Xr=function(e){let{title:t,description:n}=e;return(0,s.createElement)(y.__experimentalVStack,{spacing:0},(0,s.createElement)(y.__experimentalView,null,(0,s.createElement)(y.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3},(0,s.createElement)(y.__experimentalHStack,{spacing:2},(0,s.createElement)(y.__experimentalNavigatorToParentButton,{style:{minWidth:24,padding:0},icon:(0,E.isRTL)()?ce:se,isSmall:!0,"aria-label":(0,E.__)("Navigate to the previous view")}),(0,s.createElement)(y.__experimentalSpacer,null,(0,s.createElement)(y.__experimentalHeading,{level:5},t))))),n&&(0,s.createElement)("p",{className:"edit-site-global-styles-header__description"},n))};var Zr=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)(y.__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 Kr=function(e){let{children:t}=e;return(0,s.createElement)(y.__experimentalHeading,{className:"edit-site-global-styles-subtitle",level:2},t)};function Qr(e){let{name:t,path:n=""}=e;return jr(t,n)?(0,s.createElement)("div",{className:"edit-site-global-styles-screen-variations"},(0,s.createElement)(y.__experimentalVStack,{spacing:3},(0,s.createElement)(Kr,null,(0,E.__)("Style Variations")),(0,s.createElement)(qr,{name:t}))):null}function Jr(e){let{blockName:t,style:n}=e;const{name:a,label:r}=n;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:r}),(0,s.createElement)(Zr,{name:t,variation:`is-style-${a}`}),(0,s.createElement)(Yr,{blockName:t,styleName:a}))}const{useGlobalSetting:el,useGlobalStyle:tl}=Qe(fe.privateApis);function nl(e){return tt(e).includes("shadow")}function al(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",[r,l]=tl(`${a}shadow`,t),[o]=tl(`${a}shadow`,t,"user"),i=()=>l(void 0),c=(0,s.useCallback)((()=>i()),[i]);return(0,s.createElement)(y.__experimentalToolsPanel,{label:(0,E.__)("Shadow"),resetAll:c},(0,s.createElement)(y.__experimentalToolsPanelItem,{label:(0,E.__)("Shadow"),hasValue:()=>!!o,onDeselect:i,isShownByDefault:!0},(0,s.createElement)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(rl,{shadow:r,onShadowChange:l}))))}const rl=e=>{let{shadow:t,onShadowChange:n}=e;return(0,s.createElement)(y.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)(y.Button,a,(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(ar,{icon:cr,size:24}),(0,s.createElement)(y.FlexItem,{className:"edit-site-global-styles__shadow-label"},(0,E.__)("Shadow"))))},renderContent:()=>(0,s.createElement)(y.__experimentalDropdownContentWrapper,{paddingSize:"medium"},(0,s.createElement)(ll,{shadow:t,onShadowChange:n}))})};function ll(e){let{shadow:t,onShadowChange:n}=e;const[a]=el("shadow.presets.default"),[r]=el("shadow.presets.theme"),[l]=el("shadow.defaultPresets"),o=[...l?a:[],...r||[]];return(0,s.createElement)("div",{className:"edit-site-global-styles__shadow-panel"},(0,s.createElement)(y.__experimentalVStack,{spacing:4},(0,s.createElement)(y.__experimentalHeading,{level:5},(0,E.__)("Shadow")),(0,s.createElement)(ol,{presets:o,activeShadow:t,onSelect:n})))}function ol(e){let{presets:t,activeShadow:n,onSelect:a}=e;return t?(0,s.createElement)(y.__experimentalGrid,{columns:6,gap:0,align:"center",justify:"center"},t.map((e=>{let{name:t,slug:r,shadow:l}=e;return(0,s.createElement)(il,{key:r,label:t,isActive:l===n,onSelect:()=>a(l===n?void 0:l),shadow:l})}))):null}function il(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)(y.Button,{className:"edit-site-global-styles__shadow-indicator",onClick:a,label:t,style:{boxShadow:r},showTooltip:!0},n&&(0,s.createElement)(ie,{icon:w})))}var sl=function(e){let{name:t,parentMenu:n=""}=e;const a=Dr(t),r=yr(t),l=dr(t),o=nl(t),i=kr(t),c=jr(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)(y.__experimentalItemGroup,null,a&&(0,s.createElement)(lr,{icon:or,path:n+"/typography","aria-label":(0,E.__)("Typography styles")},(0,E.__)("Typography")),r&&(0,s.createElement)(lr,{icon:ir,path:n+"/colors","aria-label":(0,E.__)("Colors styles")},(0,E.__)("Colors")),l&&(0,s.createElement)(lr,{icon:sr,path:n+"/border","aria-label":(0,E.__)("Border")},(0,E.__)("Border")),o&&(0,s.createElement)(lr,{icon:cr,path:n+"/effects","aria-label":(0,E.__)("Shadow")},(0,E.__)("Shadow")),i&&(0,s.createElement)(lr,{icon:Dn,path:n+"/layout","aria-label":(0,E.__)("Layout styles")},(0,E.__)("Layout")),c&&(0,s.createElement)(Qr,{name:t,path:n}),d&&u&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.CardDivider,null),(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalSpacer,{as:"p",paddingTop:2,marginBottom:4},(0,E.__)("Add your own CSS to customize the block appearance.")),(0,s.createElement)(y.__experimentalItemGroup,null,(0,s.createElement)(lr,{path:n+"/css","aria-label":(0,E.__)("Additional block CSS")},(0,s.createElement)(y.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(y.FlexItem,null,(0,E.__)("Additional block CSS")),(0,s.createElement)(ar,{icon:(0,E.isRTL)()?se:ce}))))),(0,s.createElement)(y.CardDivider,null))))};const{useGlobalSetting:cl,useGlobalStyle:ul,useGlobalStylesOutput:ml}=Qe(fe.privateApis),dl={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},pl={hover:{opacity:1},start:{opacity:.5}},_l={hover:{scale:1,opacity:1},start:{scale:0,opacity:0}};var hl=e=>{let{label:t,isFocused:n,withHoverView:a}=e;const[r]=ul("typography.fontWeight"),[l="serif"]=ul("typography.fontFamily"),[o=l]=ul("elements.h1.typography.fontFamily"),[i=r]=ul("elements.h1.typography.fontWeight"),[c="black"]=ul("color.text"),[u=c]=ul("elements.h1.color.text"),[m="white"]=ul("color.background"),[d]=ul("color.gradient"),[p]=ml(),_=(0,te.useReducedMotion)(),[h]=cl("color.palette.core"),[g]=cl("color.palette.theme"),[v]=cl("color.palette.custom"),[f,E]=(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:()=>E(!0),onMouseLeave:()=>E(!1),tabIndex:-1},b,(0,s.createElement)(y.__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)(y.__unstableMotion.div,{variants:dl,style:{height:"100%",overflow:"hidden"}},(0,s.createElement)(y.__experimentalHStack,{spacing:10*S,justify:"center",style:{height:"100%",overflow:"hidden"}},(0,s.createElement)(y.__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)(y.__experimentalVStack,{spacing:4*S},k.map(((e,t)=>{let{slug:n,color:a}=e;return(0,s.createElement)(y.__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)(y.__unstableMotion.div,{variants:a&&pl,style:{height:"100%",width:"100%",position:"absolute",top:0,overflow:"hidden",filter:"blur(60px)",opacity:.1}},(0,s.createElement)(y.__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)(y.__unstableMotion.div,{variants:_l,style:{height:"100%",width:"100%",overflow:"hidden",position:"absolute",top:0}},(0,s.createElement)(y.__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 gl=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)(y.Card,{size:"small"},(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalVStack,{spacing:4},(0,s.createElement)(y.Card,null,(0,s.createElement)(y.CardMedia,null,(0,s.createElement)(hl,null))),!(null==n||!n.length)&&(0,s.createElement)(y.__experimentalItemGroup,null,(0,s.createElement)(lr,{path:"/variations","aria-label":(0,E.__)("Browse styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(y.FlexItem,null,(0,E.__)("Browse styles")),(0,s.createElement)(ar,{icon:(0,E.isRTL)()?se:ce})))),(0,s.createElement)(sl,null))),(0,s.createElement)(y.CardDivider,null),(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalSpacer,{as:"p",paddingTop:2,paddingX:"13px",marginBottom:4},(0,E.__)("Customize the appearance of specific blocks for the whole site.")),(0,s.createElement)(y.__experimentalItemGroup,null,(0,s.createElement)(lr,{path:"/blocks","aria-label":(0,E.__)("Blocks styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(y.FlexItem,null,(0,E.__)("Blocks")),(0,s.createElement)(ar,{icon:(0,E.isRTL)()?se:ce}))))),a&&!!t&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.CardDivider,null),(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalSpacer,{as:"p",paddingTop:2,paddingX:"13px",marginBottom:4},(0,E.__)("Add your own CSS to customize the appearance and layout of your site.")),(0,s.createElement)(y.__experimentalItemGroup,null,(0,s.createElement)(lr,{path:"/css","aria-label":(0,E.__)("Additional CSS")},(0,s.createElement)(y.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(y.FlexItem,null,(0,E.__)("Additional CSS")),(0,s.createElement)(ar,{icon:(0,E.isRTL)()?se:ce})))))))};function vl(e){let{block:t}=e;const n=Dr(t.name),a=yr(t.name),r=dr(t.name),l=kr(t.name),o=r||l,i=jr(t.name);if(!(n||a||o||i))return null;const c=(0,E.sprintf)((0,E.__)("%s block styles"),t.title);return(0,s.createElement)(lr,{path:"/blocks/"+encodeURIComponent(t.name),"aria-label":c},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(fe.BlockIcon,{icon:t.icon}),(0,s.createElement)(y.FlexItem,null,t.title)))}var fl=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,E.sprintf)((0,E._n)("%d result found.","%d results found.",e),e);a(n,e)}),[t,a]),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Blocks"),description:(0,E.__)("Customize the appearance of specific blocks and for the whole site.")}),(0,s.createElement)(y.SearchControl,{__nextHasNoMarginBottom:!0,className:"edit-site-block-types-search",onChange:n,value:t,label:(0,E.__)("Search for blocks"),placeholder:(0,E.__)("Search")}),(0,s.createElement)("div",{ref:o,className:"edit-site-block-types-item-list"},l.map((e=>(0,s.createElement)(vl,{block:e,key:"menu-itemblock-"+e.name})))))};var yl=function(e){let{name:t}=e;const n=(0,c.getBlockType)(t);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:n.title}),(0,s.createElement)(Zr,{name:t}),(0,s.createElement)(sl,{parentMenu:"/blocks/"+encodeURIComponent(t),name:t}))};function El(e){return e?`is-style-${e}`:""}const{useGlobalStyle:bl}=Qe(fe.privateApis);function wl(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]=bl(o+"typography.fontFamily",t),[u]=bl(o+"typography.fontStyle",t),[m]=bl(o+"typography.fontWeight",t),[d]=bl(o+"typography.letterSpacing",t),[p]=bl(o+"color.background",t),[_]=bl(o+"color.gradient",t),[h]=bl(o+"color.text",t);if(!l)return null;const g=(0,E.sprintf)((0,E.__)("Typography %s styles"),r);return(0,s.createElement)(lr,{path:n+"/typography/"+a,"aria-label":g},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(y.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,E.__)("Aa")),(0,s.createElement)(y.FlexItem,null,r)))}var Sl=function(e){let{name:t,variation:n=""}=e;const a=void 0===t?"":"/blocks/"+t,r=El(n);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Typography"),description:(0,E.__)("Manage the typography settings for different elements.")}),(0,s.createElement)(Zr,{name:t,variation:r}),!t&&(0,s.createElement)("div",{className:"edit-site-global-styles-screen-typography"},(0,s.createElement)(y.__experimentalVStack,{spacing:3},(0,s.createElement)(Kr,null,(0,E.__)("Elements")),(0,s.createElement)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(wl,{name:t,parentMenu:a,element:"text",label:(0,E.__)("Text")}),(0,s.createElement)(wl,{name:t,parentMenu:a,element:"link",label:(0,E.__)("Links")}),(0,s.createElement)(wl,{name:t,parentMenu:a,element:"heading",label:(0,E.__)("Headings")}),(0,s.createElement)(wl,{name:t,parentMenu:a,element:"button",label:(0,E.__)("Buttons")})))),!!t&&(0,s.createElement)(Ur,{name:t,variation:n,element:"text"}))};const{useGlobalStyle:xl}=Qe(fe.privateApis);function kl(e){let{name:t,element:n,headingLevel:a}=e,r="";"heading"===n?r=`elements.${a}.`:n&&"text"!==n&&(r=`elements.${n}.`);const[l]=xl(r+"typography.fontFamily",t),[o]=xl(r+"color.gradient",t),[i]=xl(r+"color.background",t),[c]=xl(r+"color.text",t),[u]=xl(r+"typography.fontSize",t),[m]=xl(r+"typography.fontStyle",t),[d]=xl(r+"typography.fontWeight",t),[p]=xl(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 Cl={text:{description:(0,E.__)("Manage the fonts used on the site."),title:(0,E.__)("Text")},link:{description:(0,E.__)("Manage the fonts and typography used on the links."),title:(0,E.__)("Links")},heading:{description:(0,E.__)("Manage the fonts and typography used on headings."),title:(0,E.__)("Headings")},button:{description:(0,E.__)("Manage the fonts and typography used on buttons."),title:(0,E.__)("Buttons")}};var Tl=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)(Xr,{title:Cl[n].title,description:Cl[n].description}),(0,s.createElement)(y.__experimentalSpacer,{marginX:4},(0,s.createElement)(kl,{name:t,element:n,headingLevel:a})),"heading"===n&&(0,s.createElement)(y.__experimentalSpacer,{marginX:4,marginBottom:"1em"},(0,s.createElement)(y.__experimentalToggleGroupControl,{label:(0,E.__)("Select heading level"),hideLabelFromVision:!0,value:a,onChange:r,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0},(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"heading",label:(0,E.__)("All")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h1",label:(0,E.__)("H1")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h2",label:(0,E.__)("H2")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h3",label:(0,E.__)("H3")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h4",label:(0,E.__)("H4")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h5",label:(0,E.__)("H5")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h6",label:(0,E.__)("H6")}))),(0,s.createElement)(Ur,{name:t,element:n,headingLevel:a}))};var Nl=(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 Ml=function(e){let{className:t,...n}=e;return(0,s.createElement)(y.Flex,g({className:f()("edit-site-global-styles__color-indicator-wrapper",t)},n))};const{useGlobalSetting:Il}=Qe(fe.privateApis),Pl=[];var Bl=function(e){let{name:t}=e;const[n]=Il("color.palette.custom"),[a]=Il("color.palette.theme"),[r]=Il("color.palette.default"),[l]=Il("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||Pl,...a||Pl,...r&&l?r:Pl]),[n,a,r,l]),c=t?"/blocks/"+encodeURIComponent(t)+"/colors/palette":"/colors/palette",u=i.length>0?(0,E.sprintf)((0,E._n)("%d color","%d colors",i.length),i.length):(0,E.__)("Add custom colors");return(0,s.createElement)(y.__experimentalVStack,{spacing:3},(0,s.createElement)(Kr,null,(0,E.__)("Palette")),(0,s.createElement)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(lr,{path:c,"aria-label":(0,E.__)("Color palettes")},(0,s.createElement)(y.__experimentalHStack,{direction:0===i.length?"row-reverse":"row"},(0,s.createElement)(y.__experimentalZStack,{isLayered:!1,offset:-8},i.slice(0,5).map(((e,t)=>{let{color:n}=e;return(0,s.createElement)(Ml,{key:`${n}-${t}`},(0,s.createElement)(y.ColorIndicator,{colorValue:n}))}))),(0,s.createElement)(y.FlexItem,null,u)))),o&&(0,s.createElement)(y.Button,{variant:"secondary",icon:Nl,onClick:o},(0,E.__)("Randomize colors")))};const{useGlobalStyle:zl}=Qe(fe.privateApis);function Vl(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]=zl(r+"color.background",t),[u]=zl(r+"color.gradient",t);return i?(0,s.createElement)(lr,{path:n+l+"/colors/background","aria-label":(0,E.__)("Colors background styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:null!=u?u:c,"data-testid":"background-color-indicator"})),(0,s.createElement)(y.FlexItem,{className:"edit-site-global-styles__color-label"},(0,E.__)("Background")))):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]=zl(r+"color.text",t);return o?(0,s.createElement)(lr,{path:n+l+"/colors/text","aria-label":(0,E.__)("Colors text styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:i,"data-testid":"text-color-indicator"})),(0,s.createElement)(y.FlexItem,{className:"edit-site-global-styles__color-label"},(0,E.__)("Text")))):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("linkColor"),[i]=zl(r+"elements.link.color.text",t),[c]=zl(r+"elements.link.:hover.color.text",t);return o?(0,s.createElement)(lr,{path:n+l+"/colors/link","aria-label":(0,E.__)("Colors link styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(y.__experimentalZStack,{isLayered:!1,offset:-8},(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:i})),(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:c}))),(0,s.createElement)(y.FlexItem,{className:"edit-site-global-styles__color-label"},(0,E.__)("Links")))):null}function Ll(e){let{name:t,parentMenu:n,variation:a=""}=e;const r=a?`variations.${a}.`:"",l=a?`/variations/${a}`:"",o=tt(t).includes("color"),[i]=zl(r+"elements.heading.color.text",t),[c]=zl(r+"elements.heading.color.background",t);return o?(0,s.createElement)(lr,{path:n+l+"/colors/heading","aria-label":(0,E.__)("Colors heading styles")},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(y.__experimentalZStack,{isLayered:!1,offset:-8},(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:c})),(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:i}))),(0,s.createElement)(y.FlexItem,null,(0,E.__)("Headings")))):null}function Dl(e){let{name:t,parentMenu:n,variation:a=""}=e;const r=a?`variations.${a}.`:"",l=a?`/variations/${a}`:"",o=tt(t).includes("buttonColor"),[i]=zl(r+"elements.button.color.text",t),[c]=zl(r+"elements.button.color.background",t);return o?(0,s.createElement)(lr,{path:n+l+"/colors/button"},(0,s.createElement)(y.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(y.__experimentalZStack,{isLayered:!1,offset:-8},(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:c})),(0,s.createElement)(Ml,{expanded:!1},(0,s.createElement)(y.ColorIndicator,{colorValue:i}))),(0,s.createElement)(y.FlexItem,{className:"edit-site-global-styles__color-label"},(0,E.__)("Buttons")))):null}var Ol=function(e){let{name:t,variation:n=""}=e;const a=void 0===t?"":"/blocks/"+encodeURIComponent(t),r=El(n);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Colors"),description:(0,E.__)("Manage palettes and the default color of different global elements on the site.")}),(0,s.createElement)(Zr,{name:t,variation:r}),(0,s.createElement)("div",{className:"edit-site-global-styles-screen-colors"},(0,s.createElement)(y.__experimentalVStack,{spacing:10},(0,s.createElement)(Bl,{name:t}),(0,s.createElement)(y.__experimentalVStack,{spacing:3},(0,s.createElement)(Kr,null,(0,E.__)("Elements")),(0,s.createElement)(y.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(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}),(0,s.createElement)(Ll,{name:t,parentMenu:a,variation:n}),(0,s.createElement)(Dl,{name:t,parentMenu:a,variation:n}))))))};const{useGlobalSetting:Fl}=Qe(fe.privateApis);function Gl(e){let{name:t}=e;const[n,a]=Fl("color.palette.theme",t),[r]=Fl("color.palette.theme",t,"base"),[l,o]=Fl("color.palette.default",t),[i]=Fl("color.palette.default",t,"base"),[c,u]=Fl("color.palette.custom",t),[m]=Fl("color.defaultPalette",t);return(0,s.createElement)(y.__experimentalVStack,{className:"edit-site-global-styles-color-palette-panel",spacing:10},!!n&&!!n.length&&(0,s.createElement)(y.__experimentalPaletteEdit,{canReset:n!==r,canOnlyChangeValues:!0,colors:n,onChange:a,paletteLabel:(0,E.__)("Theme")}),!!l&&!!l.length&&!!m&&(0,s.createElement)(y.__experimentalPaletteEdit,{canReset:l!==i,canOnlyChangeValues:!0,colors:l,onChange:o,paletteLabel:(0,E.__)("Default")}),(0,s.createElement)(y.__experimentalPaletteEdit,{colors:c,onChange:u,paletteLabel:(0,E.__)("Custom"),emptyMessage:(0,E.__)("Custom colors are empty! Add some colors to create your own color palette."),slugPrefix:"custom-"}))}const{useGlobalSetting:Hl}=Qe(fe.privateApis),$l=()=>{};function Ul(e){let{name:t}=e;const[n,a]=Hl("color.gradients.theme",t),[r]=Hl("color.gradients.theme",t,"base"),[l,o]=Hl("color.gradients.default",t),[i]=Hl("color.gradients.default",t,"base"),[c,u]=Hl("color.gradients.custom",t),[m]=Hl("color.defaultGradients",t),[d]=Hl("color.duotone.custom")||[],[p]=Hl("color.duotone.default")||[],[_]=Hl("color.duotone.theme")||[],[h]=Hl("color.defaultDuotone"),g=[...d||[],..._||[],...p&&h?p:[]];return(0,s.createElement)(y.__experimentalVStack,{className:"edit-site-global-styles-gradient-palette-panel",spacing:10},!!n&&!!n.length&&(0,s.createElement)(y.__experimentalPaletteEdit,{canReset:n!==r,canOnlyChangeValues:!0,gradients:n,onChange:a,paletteLabel:(0,E.__)("Theme")}),!!l&&!!l.length&&!!m&&(0,s.createElement)(y.__experimentalPaletteEdit,{canReset:l!==i,canOnlyChangeValues:!0,gradients:l,onChange:o,paletteLabel:(0,E.__)("Default")}),(0,s.createElement)(y.__experimentalPaletteEdit,{gradients:c,onChange:u,paletteLabel:(0,E.__)("Custom"),emptyMessage:(0,E.__)("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)(Kr,null,(0,E.__)("Duotone")),(0,s.createElement)(y.__experimentalSpacer,{margin:3}),(0,s.createElement)(y.DuotonePicker,{duotonePalette:g,disableCustomDuotone:!0,disableCustomColors:!0,clearable:!1,onChange:$l})))}var Wl=function(e){let{name:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Palette"),description:(0,E.__)("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)(y.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)(Ul,{name:t})))))};const{useGlobalSetting:jl,useGlobalStyle:ql}=Qe(fe.privateApis);var Yl=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",r=tt(t),[l]=jl("color.custom",t),[o]=jl("color.customGradient",t),i=nt(t),c=at(t),[u]=jl("color.background",t),m=r.includes("backgroundColor")&&u&&(i.length>0||l),d=r.includes("background")&&(c.length>0||o),[p,_]=ql(a+"color.background",t),[h]=ql(a+"color.background",t,"user"),[v,y]=ql(a+"color.gradient",t),[b]=ql(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:y},v&&(S.clearable=v===b));const x={...w,...S};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Background"),description:(0,E.__)("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:Xl,useGlobalStyle:Zl}=Qe(fe.privateApis);var Kl=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",r=tt(t),[l]=Xl("color.custom",t),[o]=Xl("color.text",t),i=nt(t),c=r.includes("color")&&o&&(i.length>0||l),[u,m]=Zl(a+"color.text",t),[d]=Zl(a+"color.text",t,"user");return c?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Text"),description:(0,E.__)("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:Ql,useGlobalStyle:Jl}=Qe(fe.privateApis);var eo=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",r=tt(t),[l]=Ql("color.custom",t),o=nt(t),[i]=Ql("color.link",t),c=r.includes("linkColor")&&i&&(o.length>0||l),u={default:{label:(0,E.__)("Default"),value:Jl(a+"elements.link.color.text",t)[0],handler:Jl(a+"elements.link.color.text",t)[1],userValue:Jl(a+"elements.link.color.text",t,"user")[0]},hover:{label:(0,E.__)("Hover"),value:Jl(a+"elements.link.:hover.color.text",t)[0],handler:Jl(a+"elements.link.:hover.color.text",t)[1],userValue:Jl(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)(Xr,{title:(0,E.__)("Links"),description:(0,E.__)("Set the colors used for links across the site.")}),(0,s.createElement)(y.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:to,useGlobalStyle:no}=Qe(fe.privateApis);var ao=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",[r,l]=(0,s.useState)("heading"),o=tt(t),[i]=to("color.custom",t),[c]=to("color.customGradient",t),[u]=to("color.text",t),[m]=to("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]=no(a+"elements."+r+".color.text",t),[w]=no(a+"elements."+r+".color.text",t,"user"),[S,x]=no(a+"elements."+r+".color.background",t),[k]=no(a+"elements."+r+".color.background",t,"user"),[C,T]=no(a+"elements."+r+".color.gradient",t),[N]=no(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)(Xr,{title:(0,E.__)("Headings"),description:(0,E.__)("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,E.__)("Select heading level")),(0,s.createElement)(y.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Select heading level"),hideLabelFromVision:!0,value:r,onChange:l,isBlock:!0},(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"heading",label:(0,E.__)("All")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h1",label:(0,E.__)("H1")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h2",label:(0,E.__)("H2")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h3",label:(0,E.__)("H3")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h4",label:(0,E.__)("H4")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h5",label:(0,E.__)("H5")}),(0,s.createElement)(y.__experimentalToggleGroupControlOption,{value:"h6",label:(0,E.__)("H6")}))),_&&(0,s.createElement)("div",{className:"edit-site-global-styles-screen-heading-color"},(0,s.createElement)("h4",null,"heading"===r?(0,E.__)("Text color for all heading levels"):(0,E.sprintf)((0,E.__)("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,E.__)("Background color for all heading levels"):(0,E.sprintf)((0,E.__)("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:ro,useGlobalStyle:lo}=Qe(fe.privateApis);var oo=function(e){let{name:t,variation:n=""}=e;const a=n?`variations.${n}.`:"",r=tt(t),l=nt(t),[o]=ro("color.custom",t),[i]=ro("color.background",t),c=r.includes("buttonColor")&&i&&(l.length>0||o),[u,m]=lo(a+"elements.button.color.text",t),[d]=lo("elements.button.color.text",t,"user"),[p,_]=lo("elements.button.color.background",t),[h]=lo("elements.button.color.background",t,"user");return c?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Buttons"),description:(0,E.__)("Set the default colors used for buttons across the site.")}),(0,s.createElement)("h4",{className:"edit-site-global-styles-section-title"},(0,E.__)("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,E.__)("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 io=function(e){let{name:t,variation:n=""}=e;const a=kr(t),r=El(n);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Layout")}),(0,s.createElement)(Zr,{name:t,variation:r}),a&&(0,s.createElement)(Rr,{name:t,variation:n}))},so=n(5619),co=n.n(so);function uo(){return(0,s.createElement)("div",{className:"edit-site-canvas-spinner"},(0,s.createElement)(y.Spinner,null))}const{GlobalStylesContext:mo}=Qe(fe.privateApis);function po(e,t){if(Array.isArray(t))return t}function _o(e,t){return(0,ve.mergeWith)({},e,t,po)}const ho=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.fromEntries(Object.entries((0,ve.mapValues)(e,ho)).filter((e=>{let[,t]=e;return Boolean(t)})));return(0,ve.isEmpty)(t)?void 0:t};function go(){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:ho(s.styles)||{},settings:ho(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?_o(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 vo(e){let{children:t}=e;const n=go();return n.isReady?(0,s.createElement)(mo.Provider,{value:n},t):(0,s.createElement)(uo,null)}const{GlobalStylesContext:fo}=Qe(fe.privateApis);function yo(e){let{variation:t}=e;const[n,a]=(0,s.useState)(!1),{base:r,user:l,setUserConfig:o}=(0,s.useContext)(fo),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:_o(r,t),setUserConfig:()=>{}}}),[t,r]),c=()=>{o((()=>({settings:t.settings,styles:t.styles})))},u=(0,s.useMemo)((()=>function(e,t){return co()(e.styles,t.styles)&&co()(e.settings,t.settings)}(l,t)),[l,t]);return(0,s.createElement)(fo.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===qa.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)(hl,{label:null==t?void 0:t.title,isFocused:n,withHoverView:!0}))))}var Eo=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,E.__)("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)(Xr,{back:"/",title:(0,E.__)("Browse styles"),description:(0,E.__)("Choose a variation to change the look of the site.")}),(0,s.createElement)(y.Card,{size:"small",isBorderless:!0},(0,s.createElement)(y.CardBody,null,(0,s.createElement)(y.__experimentalGrid,{columns:2},null==n?void 0:n.map(((e,t)=>(0,s.createElement)(yo,{key:t,variation:e})))))))};var bo=function(e){let{name:t,variation:n=""}=e;const a=dr(t),r=El(n);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Border")}),(0,s.createElement)(Zr,{name:t,variation:r}),a&&(0,s.createElement)(fr,{name:t,variation:n}))};const{ExperimentalBlockEditorProvider:wo,useGlobalStyle:So}=Qe(fe.privateApis),xo="EditSiteStyleBook",{Slot:ko,Fill:Co}=(0,y.createSlotFill)(xo);function To(){return[{name:"core/heading",title:(0,E.__)("Headings"),category:"text",blocks:[(0,c.createBlock)("core/heading",{content:(0,E.__)("Code Is Poetry"),level:1}),(0,c.createBlock)("core/heading",{content:(0,E.__)("Code Is Poetry"),level:2}),(0,c.createBlock)("core/heading",{content:(0,E.__)("Code Is Poetry"),level:3}),(0,c.createBlock)("core/heading",{content:(0,E.__)("Code Is Poetry"),level:4}),(0,c.createBlock)("core/heading",{content:(0,E.__)("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 No(e){let{isSelected:t,onSelect:n,onClose:a}=e;const[r,l]=(0,te.useResizeObserver)(),o=(0,te.useFocusOnMount)("firstElement"),i=(0,te.useFocusReturn)(),[u]=So("color.text"),[d]=So("color.background"),p=(0,s.useMemo)(To,[]),_=(0,s.useMemo)((()=>(0,c.getCategories)().filter((e=>p.some((t=>t.category===e.slug)))).map((e=>({name:e.slug,title:e.title,icon:e.icon})))),[p]),h=(0,m.useSelect)((e=>e(fe.store).getSettings()),[]),g=(0,s.useMemo)((()=>({...h,__unstableIsPreviewMode:!0})),[h]);return(0,s.createElement)(Co,null,(0,s.createElement)("section",{className:f()("edit-site-style-book",{"is-wide":l.width>600}),style:{color:u,background:d},"aria-label":(0,E.__)("Style Book"),onKeyDown:function(e){e.keyCode!==qa.ESCAPE||e.defaultPrevented||(e.preventDefault(),a())},ref:(0,te.useMergeRefs)([i,o])},r,(0,s.createElement)(y.Button,{className:"edit-site-style-book__close-button",icon:C,label:(0,E.__)("Close Style Book"),onClick:a,showTooltip:!1}),(0,s.createElement)(y.TabPanel,{className:"edit-site-style-book__tab-panel",tabs:_},(e=>(0,s.createElement)(fe.__unstableIframe,{className:"edit-site-style-book__iframe",head:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fe.__unstableEditorStyles,{styles:g.styles}),(0,s.createElement)("style",null,'.is-root-container { display: flow-root; }\n\t\t\t\t\t\t\t\t\t\t\tbody { position: relative; padding: 32px !important; }\n\t.edit-site-style-book__examples {\n\t\tmax-width: 900px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.edit-site-style-book__example {\n\t\tborder-radius: 2px;\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 40px;\n\t\tmargin-bottom: 40px;\n\t\tpadding: 16px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t}\n\n\t.edit-site-style-book__example.is-selected {\n\t\tbox-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t}\n\n\t.edit-site-style-book__example:focus:not(:disabled) {\n\t\tbox-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t\toutline: 3px solid transparent;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example {\n\t\tflex-direction: row;\n\t}\n\n\t.edit-site-style-book__example-title {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\tfont-size: 11px;\n\t\tfont-weight: 500;\n\t\tline-height: normal;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\ttext-transform: uppercase;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example-title {\n\t\ttext-align: right;\n\t\twidth: 120px;\n\t}\n\n\t.edit-site-style-book__example-preview {\n\t\twidth: 100%;\n\t}\n\n\t.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,\n\t.edit-site-style-book__example-preview .block-list-appender {\n\t\tdisplay: none;\n\t}\n\n\t.edit-site-style-book__example-preview .is-root-container > .wp-block:first-child {\n\t\tmargin-top: 0;\n\t}\n\t.edit-site-style-book__example-preview .is-root-container > .wp-block:last-child {\n\t\tmargin-bottom: 0;\n\t}\n')),name:"style-book-canvas",tabIndex:0},g.svgFilters,(0,s.createElement)(Mo,{className:f()("edit-site-style-book__examples",{"is-wide":l.width>600}),examples:p,category:e.name,label:(0,E.sprintf)((0,E.__)("Examples of blocks in the %s category"),e.title),isSelected:t,onSelect:n}))))))}const Mo=(0,s.memo)((e=>{let{className:t,examples:n,category:a,label:r,isSelected:l,onSelect:o}=e;const i=(0,y.__unstableUseCompositeState)({orientation:"vertical"});return(0,s.createElement)(y.__unstableComposite,g({},i,{className:t,"aria-label":r}),n.filter((e=>e.category===a)).map((e=>(0,s.createElement)(Io,{key:e.name,id:`example-${e.name}`,composite:i,title:e.title,blocks:e.blocks,isSelected:l(e.name),onClick:()=>{o(e.name)}}))))})),Io=e=>{let{composite:t,id:n,title:a,blocks:r,isSelected:l,onClick:o}=e;const i=(0,m.useSelect)((e=>e(fe.store).getSettings()),[]),c=(0,s.useMemo)((()=>({...i,__unstableIsPreviewMode:!0})),[i]),u=(0,s.useMemo)((()=>Array.isArray(r)?r:[r]),[r]);return(0,s.createElement)(y.__unstableCompositeItem,g({},t,{className:f()("edit-site-style-book__example",{"is-selected":l}),id:n,"aria-label":(0,E.sprintf)((0,E.__)("Open %s styles in Styles panel"),a),onClick:o,role:"button",as:"div"}),(0,s.createElement)("span",{className:"edit-site-style-book__example-title"},a),(0,s.createElement)("div",{className:"edit-site-style-book__example-preview","aria-hidden":!0},(0,s.createElement)(y.Disabled,{className:"edit-site-style-book__example-preview__content"},(0,s.createElement)(wo,{value:u,settings:c},(0,s.createElement)(fe.BlockList,{renderAppender:!1})))))};No.Slot=ko;var Po=No;var Bo=(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:zo}=Qe(fe.privateApis);var Vo=function(e){let{blockName:t}=e;const n=t||null,[a,r]=zo("css",n),[l]=zo("css",n,"base"),[o,i]=(0,s.useState)(null),c="/* IgnoreThemeCustomCSS */",u=!a&&l?`/* ${(0,E.__)("Theme Custom CSS start")} */\n${l}\n/* ${(0,E.__)("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)(y.Panel,null,(0,s.createElement)(y.PanelBody,{title:(0,E.__)("Original Theme Custom CSS"),initialOpen:!1},(0,s.createElement)("pre",{className:"edit-site-global-styles__custom-css-theme-css"},m))),(0,s.createElement)(y.__experimentalVStack,{spacing:3},(0,s.createElement)(Kr,null,(0,E.__)("ADDITIONAL CSS")),(0,s.createElement)(y.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,E.__)("There is an error with your CSS structure."):null)},className:"edit-site-global-styles__custom-css-input",spellCheck:!1}),o&&(0,s.createElement)(y.Tooltip,{text:o},(0,s.createElement)("div",{className:"edit-site-global-styles__custom-css-validation-wrapper"},(0,s.createElement)(y.Icon,{icon:Bo,className:"edit-site-global-styles__custom-css-validation-icon"})))))};var Ro=function(e){let{name:t}=e;const n=(0,c.getBlockType)(t),a=null==n?void 0:n.title,r=void 0!==a?(0,E.sprintf)((0,E.__)("Add your own CSS to customize the appearance of the %s block."),a):(0,E.__)("Add your own CSS to customize the appearance and layout of your site.");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("CSS"),description:(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)(y.ExternalLink,{href:"https://wordpress.org/support/article/css/",className:"edit-site-global-styles-screen-css-help-link"},(0,E.__)("Learn more about CSS")))}),(0,s.createElement)("div",{className:"edit-site-global-styles-screen-css"},(0,s.createElement)(Vo,{blockName:t})))};var Ao=function(e){let{name:t,variation:n=""}=e;const a=El(n),r=nl(t);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xr,{title:(0,E.__)("Shadow")}),(0,s.createElement)(Zr,{name:t,variation:a}),r&&(0,s.createElement)(al,{name:t,variation:n}))};const{Slot:Lo,Fill:Do}=(0,y.createSlotFill)("GlobalStylesMenu");function Oo(){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,y.__experimentalUseNavigator)();return(0,s.createElement)(Do,null,(0,s.createElement)(y.DropdownMenu,{icon:re,label:(0,E.__)("Styles actions"),controls:[{title:(0,E.__)("Reset to defaults"),onClick:r,isDisabled:!a},{title:(0,E.__)("Welcome Guide"),onClick:()=>e("core/edit-site","welcomeGuideStyles")},...t?[{title:(0,E.__)("Additional CSS"),onClick:()=>l("/css")}]:[]]}))}function Fo(e){let{className:t,...n}=e;return(0,s.createElement)(y.__experimentalNavigatorScreen,g({className:["edit-site-global-styles-sidebar__navigator-screen",t].filter(Boolean).join(" ")},n))}function Go(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)($o,{key:e.name+t,name:t,parentMenu:"/blocks/"+encodeURIComponent(t)+"/variations/"+encodeURIComponent(e.name),variation:e.name}))):null}function Ho(e){let{parentMenu:t,blockStyles:n,blockName:a}=e;return n.map(((e,n)=>(0,s.createElement)(Fo,{key:n,path:t+"/variations/"+e.name},(0,s.createElement)(Jr,{blockName:a,style:e}))))}function $o(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)(Fo,{path:n+"/typography"},(0,s.createElement)(Sl,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/typography/text"},(0,s.createElement)(Tl,{name:t,element:"text"})),(0,s.createElement)(Fo,{path:n+"/typography/link"},(0,s.createElement)(Tl,{name:t,element:"link"})),(0,s.createElement)(Fo,{path:n+"/typography/heading"},(0,s.createElement)(Tl,{name:t,element:"heading"})),(0,s.createElement)(Fo,{path:n+"/typography/button"},(0,s.createElement)(Tl,{name:t,element:"button"})),(0,s.createElement)(Fo,{path:n+"/colors"},(0,s.createElement)(Ol,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/colors/palette"},(0,s.createElement)(Wl,{name:t})),(0,s.createElement)(Fo,{path:n+"/colors/background"},(0,s.createElement)(Yl,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/colors/text"},(0,s.createElement)(Kl,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/colors/link"},(0,s.createElement)(eo,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/colors/heading"},(0,s.createElement)(ao,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/colors/button"},(0,s.createElement)(oo,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/border"},(0,s.createElement)(bo,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/effects"},(0,s.createElement)(Ao,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/layout"},(0,s.createElement)(io,{name:t,variation:a})),(0,s.createElement)(Fo,{path:n+"/css"},(0,s.createElement)(Ro,{name:t})),!(null==r||!r.length)&&(0,s.createElement)(Ho,{parentMenu:n,blockStyles:r,blockName:t}))}function Uo(e){let{onClose:t}=e;const n=(0,y.__experimentalUseNavigator)(),{path:a}=n.location;return(0,s.createElement)(Po,{isSelected:e=>a===`/blocks/${encodeURIComponent(e)}`||a.startsWith(`/blocks/${encodeURIComponent(e)}/`),onSelect:e=>{n.goTo("/blocks/"+encodeURIComponent(e))},onClose:t})}var Wo=function(e){let{isStyleBookOpened:t,onCloseStyleBook:n}=e;const a=(0,c.getBlockTypes)();return(0,s.createElement)(y.__experimentalNavigatorProvider,{className:"edit-site-global-styles-sidebar__navigator-provider",initialPath:"/"},(0,s.createElement)(Fo,{path:"/"},(0,s.createElement)(gl,null)),(0,s.createElement)(Fo,{path:"/variations"},(0,s.createElement)(Eo,null)),(0,s.createElement)(Fo,{path:"/blocks"},(0,s.createElement)(fl,null)),a.map((e=>(0,s.createElement)(Fo,{key:"menu-block-"+e.name,path:"/blocks/"+encodeURIComponent(e.name)},(0,s.createElement)(yl,{name:e.name})))),(0,s.createElement)($o,null),a.map((e=>(0,s.createElement)($o,{key:"screens-block-"+e.name,name:e.name,parentMenu:"/blocks/"+encodeURIComponent(e.name)}))),a.map(((e,t)=>(0,s.createElement)(Go,{key:"screens-block-styles-"+e.name+t,name:e.name}))),t&&(0,s.createElement)(Uo,{onClose:n}),(0,s.createElement)(Oo,null))};function jo(){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)(er,{className:"edit-site-global-styles-sidebar",identifier:"edit-site/global-styles",title:(0,E.__)("Styles"),icon:tr,closeLabel:(0,E.__)("Close Styles sidebar"),panelClassName:"edit-site-global-styles-sidebar__panel",header:(0,s.createElement)(y.Flex,{className:"edit-site-global-styles-sidebar__header"},(0,s.createElement)(y.FlexBlock,{style:{minWidth:"min-content"}},(0,s.createElement)("strong",null,(0,E.__)("Styles"))),(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(y.Button,{icon:nr,label:(0,E.__)("Style Book"),isPressed:e,disabled:"visual"!==n,onClick:()=>{t(!e)}})),(0,s.createElement)(y.FlexItem,null,(0,s.createElement)(Lo,null)))},(0,s.createElement)(Wo,{isStyleBookOpened:e,onCloseStyleBook:()=>t(!1)}))}const qo="edit-site/template",Yo="edit-site/block-inspector";var Xo=e=>{let{sidebarName:t}=e;const{enableComplementaryArea:n}=(0,m.useDispatch)(F),[a,r]=t===qo?[(0,E.__)("Template (selected)"),"is-active"]:[(0,E.__)("Template"),""],[l,o]=t===Yo?[(0,E.__)("Block (selected)"),"is-active"]:[(0,E.__)("Block"),""];return(0,s.createElement)("ul",null,(0,s.createElement)("li",null,(0,s.createElement)(y.Button,{onClick:()=>n(Dt,qo),className:`edit-site-sidebar-edit-mode__panel-tab ${r}`,"aria-label":a,"data-label":(0,E.__)("Template")},(0,E.__)("Template"))),(0,s.createElement)("li",null,(0,s.createElement)(y.Button,{onClick:()=>n(Dt,Yo),className:`edit-site-sidebar-edit-mode__panel-tab ${o}`,"aria-label":l,"data-label":(0,E.__)("Block")},(0,E.__)("Block"))))};function Zo(e){let{template:t}=e;const{revertTemplate:n}=(0,m.useDispatch)(An);return Ot(t)?(0,s.createElement)(y.DropdownMenu,{icon:re,label:(0,E.__)("Actions"),className:"edit-site-template-card__actions",toggleProps:{isSmall:!0}},(e=>{let{onClose:a}=e;return(0,s.createElement)(y.MenuGroup,null,(0,s.createElement)(y.MenuItem,{info:(0,E.__)("Use the template as supplied by the theme."),onClick:()=>{n(t),a()}},(0,E.__)("Clear customizations")))})):null}function Ko(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)(y.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 Qo(){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)(y.__experimentalHeading,{level:3,className:"edit-site-template-card__template-areas-title"},(0,E.__)("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)(Ko,{area:t.area,clientId:n.clientId}))})))):null}function Jo(){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)(y.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)(Zo,{template:a})),(0,s.createElement)("div",{className:"edit-site-template-card__description"},(0,Un.decodeEntities)(t)),(0,s.createElement)(Qo,null))):null}const{Slot:ei,Fill:ti}=(0,y.createSlotFill)("EditSiteSidebarInspector"),ni=ti;function ai(){const{sidebar:e,isEditorSidebarOpened:t,hasBlockSelection:n,supportsGlobalStyles:a}=(0,m.useSelect)((e=>{const t=e(F).getActiveComplementaryArea(Dt),n=[Yo,qo].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?Yo:qo)}),[n,t]);let l=e;return t||(l=n?Yo:qo),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(er,{identifier:l,title:(0,E.__)("Settings"),icon:(0,E.isRTL)()?Qa:Ja,closeLabel:(0,E.__)("Close settings sidebar"),header:(0,s.createElement)(Xo,{sidebarName:l}),headerClassName:"edit-site-sidebar-edit-mode__panel-tabs"},l===qo&&(0,s.createElement)(y.PanelBody,null,(0,s.createElement)(Jo,null)),l===Yo&&(0,s.createElement)(ei,{bubblesVirtually:!0})),a&&(0,s.createElement)(jo,null))}var ri=window.wp.reusableBlocks;const li=(e,t)=>`${t}`,oi=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,ii=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,E.sprintf)((0,E._x)('"%1$s" by %2$s/ %3$s',"caption"),li(n,(0,Un.decodeEntities)(t)),r?li(r,c):c,i?li(`${i}?ref=openverse`,s):s):(0,E.sprintf)((0,E._x)("Work by %2$s/ %3$s","caption"),oi(n),r?li(r,c):c,i?li(`${i}?ref=openverse`,s):s):t?(0,E.sprintf)((0,E._x)('"%1$s"/ %2$s',"caption"),li(n,(0,Un.decodeEntities)(t)),i?li(`${i}?ref=openverse`,s):s):(0,E.sprintf)((0,E._x)("Work/ %3$s","caption"),oi(n),i?li(`${i}?ref=openverse`,s):s),u.replace(/\s{2}/g," ")},si=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}}))},ci=[{name:"images",labels:{name:(0,E.__)("Images"),search_items:(0,E.__)("Search images")},mediaType:"image",async fetch(){return si({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"image"})}},{name:"videos",labels:{name:(0,E.__)("Videos"),search_items:(0,E.__)("Search videos")},mediaType:"video",async fetch(){return si({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"video"})}},{name:"audio",labels:{name:(0,E.__)("Audio"),search_items:(0,E.__)("Search audio")},mediaType:"audio",async fetch(){return si({...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},media_type:"audio"})}},{name:"openverse",labels:{name:(0,E.__)("Openverse"),search_items:(0,E.__)("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:ii(e),previewUrl:e.thumbnail}}))},getReportUrl:e=>{let{sourceId:t}=e;return`https://wordpress.org/openverse/image/${t}/report/`},isExternalResource:!0}];var ui=ci;function mi(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)(y.MenuItem,{onClick:()=>{a(t,n(t)),r()}},(0,E.__)("Detach blocks from template part"))})):null}function di(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)(ye.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)(y.MenuItem,{icon:On,onClick:()=>{r(!0)}},(0,E.__)("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,E.__)("Template part created."),{type:"snackbar"})}}))}function pi(){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)(mi,{clientId:t[0]}):(0,s.createElement)(di,{clientIds:t,blocks:n})}var _i=(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 hi=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)(y.Button,{className:"edit-site-visual-editor__back-button",icon:_i,onClick:()=>{n.back()}},(0,E.__)("Back")):null};function gi(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,E.__)("Drag to resize"),"aria-describedby":`resizable-editor__resize-help-${n}`,onKeyDown:function(e){const{keyCode:t}=e;"left"===n&&t===qa.LEFT||"right"===n&&t===qa.RIGHT?a(20):("left"===n&&t===qa.RIGHT||"right"===n&&t===qa.LEFT)&&a(-20)}}),(0,s.createElement)(y.VisuallyHidden,{id:`resizable-editor__resize-help-${n}`},(0,E.__)("Use left and right arrow keys to resize the canvas.")))}const vi={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 fi=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)(y.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)(gi,{direction:"left",resizeWidthBy:i}),right:(0,s.createElement)(gi,{direction:"right",resizeWidthBy:i})},handleClasses:void 0,handleStyles:{left:vi,right:vi}},a)};var yi=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;\n\t\t\t\t\t\t\t${"view"===l?"cursor: pointer;":""}}}`),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:Ei}=Qe(fe.privateApis),bi={type:"default",alignments:[]};function wi(){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:ui,__experimentalBlockPatterns:d,__experimentalBlockPatternCategories:p}}),[a,d,p]),[g,v,y]=(0,_.useEntityBlockEditor)("postType",r),E=(0,s.useRef)(),b=(0,te.useMergeRefs)([E,(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)(Ei,{settings:h,value:g,onInput:v,onChange:y,useSubRegistry:!1},(0,s.createElement)(pi,null),(0,s.createElement)(ni,null,(0,s.createElement)(fe.BlockInspector,null)),(0,s.createElement)(Po.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)(fi,{enableResizing:!0},n)):(0,s.createElement)(fe.BlockTools,{className:f()("edit-site-visual-editor",{"is-focus-mode":C||!!n,"is-view-mode":M}),__unstableContentRef:E,onClick:e=>{e.target===e.currentTarget&&S()}},(0,s.createElement)(fe.BlockEditorKeyboardShortcuts.Register,null),(0,s.createElement)(hi,null),(0,s.createElement)(fi,{enableResizing:N,height:null!==(t=k.height)&&void 0!==t?t:"100%"},(0,s.createElement)(yi,{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:bi,renderAppender:I}))))})),(0,s.createElement)(ri.ReusableBlocksMenuItems,null))}var Si=n(773);function xi(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)(xi),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)(y.VisuallyHidden,{as:"label",htmlFor:`code-editor-text-area-${c}`},(0,E.__)("Type text or HTML")),(0,s.createElement)(Si.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,E.__)("Start writing with text or HTML")}))}function ki(){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,E.__)("Editing code")),(0,s.createElement)(y.Button,{variant:"tertiary",onClick:()=>i("visual"),shortcut:t},(0,E.__)("Exit code editor"))),(0,s.createElement)("div",{className:"edit-site-code-editor__body"},(0,s.createElement)(xi,{value:o,onChange:e=>{l((0,c.parse)(e),{selection:void 0})},onInput:a})))}var Ci=function(){const{getEditorMode:e}=(0,m.useSelect)(An),t=(0,m.useSelect)((e=>e(An).isListViewOpened()),[]),n=(0,m.useSelect)((e=>e(F).getActiveComplementaryArea(An.name)===Yo),[]),{redo:a,undo:r}=(0,m.useDispatch)(_.store),{setIsListViewOpened:l,switchEditorMode:o}=(0,m.useDispatch)(An),{enableComplementaryArea:i,disableComplementaryArea:s}=(0,m.useDispatch)(F),{replaceBlocks:u}=(0,m.useDispatch)(fe.store),{getBlockName:d,getSelectedBlockClientId:p,getBlockAttributes:h}=(0,m.useSelect)(fe.store),g=(e,t)=>{e.preventDefault();const n=0===t?"core/paragraph":"core/heading",a=p();if(null===a)return;const r=d(a);if("core/paragraph"!==r&&"core/heading"!==r)return;const l=h(a),o="core/paragraph"===r?"align":"textAlign",i="core/paragraph"===n?"align":"textAlign";u(a,(0,c.createBlock)(n,{level:t,content:l.content,[i]:l[o]}))};return(0,Ln.useShortcut)("core/edit-site/undo",(e=>{r(),e.preventDefault()})),(0,Ln.useShortcut)("core/edit-site/redo",(e=>{a(),e.preventDefault()})),(0,Ln.useShortcut)("core/edit-site/toggle-list-view",(()=>{l(!t)})),(0,Ln.useShortcut)("core/edit-site/toggle-block-settings-sidebar",(e=>{e.preventDefault(),n?s(Dt):i(Dt,Yo)})),(0,Ln.useShortcut)("core/edit-site/toggle-mode",(()=>{o("visual"===e()?"text":"visual")})),(0,Ln.useShortcut)("core/edit-site/transform-heading-to-paragraph",(e=>g(e,0))),[1,2,3,4,5,6].forEach((e=>{(0,Ln.useShortcut)(`core/edit-site/transform-paragraph-to-heading-${e}`,(t=>g(t,e)))})),null};var Ti=(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 Ni(){const{setIsInserterOpened:e}=(0,m.useDispatch)(An),t=(0,m.useSelect)((e=>e(An).__experimentalGetInsertionPoint()),[]),n=(0,te.useViewportMatch)("medium","<"),a=n?"div":y.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)(y.Button,{icon:Ti,label:(0,E.__)("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 Mi(){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)(Mi)}`;return(0,s.createElement)("div",{"aria-labelledby":r,className:"edit-site-editor__list-view-panel",onKeyDown:function(t){t.keyCode!==qa.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,E.__)("List View")),(0,s.createElement)(y.Button,{icon:C,label:(0,E.__)("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 Ii(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 Pi(){const{toggle:e}=(0,m.useDispatch)(T.store);return(0,m.useSelect)((e=>!!e(T.store).get("core/edit-site","welcomeGuide")),[])?(0,s.createElement)(y.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,E.__)("Welcome to the site editor"),finishButtonText:(0,E.__)("Get Started"),onFinish:()=>e("core/edit-site","welcomeGuide"),pages:[{image:(0,s.createElement)(Ii,{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,E.__)("Edit your site")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("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,E.__)("Click to start designing your blocks, and choose your typography, layout, and colors."),{StylesIconImage:(0,s.createElement)("img",{alt:(0,E.__)("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 Bi(){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)(y.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,E.__)("Welcome to styles"),finishButtonText:(0,E.__)("Get Started"),onFinish:()=>e("core/edit-site","welcomeGuideStyles"),pages:[{image:(0,s.createElement)(Ii,{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,E.__)("Welcome to Styles")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("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)(Ii,{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,E.__)("Set the design")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("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)(Ii,{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,E.__)("Personalize blocks")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("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)(Ii,{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,E.__)("Learn more")),(0,s.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,E.__)("New to block themes and styling your site? "),(0,s.createElement)(y.ExternalLink,{href:(0,E.__)("https://wordpress.org/support/article/styles-overview/")},(0,E.__)("Here’s a detailed guide to learn how to make the most of it."))))}]}):null}function zi(){return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Pi,null),(0,s.createElement)(Bi,null))}const{useGlobalStylesOutput:Vi}=Qe(fe.privateApis);function Ri(){return function(){const[e,t,n]=Vi(),{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 Ai(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,E.sprintf)((0,E.__)("%1$s ‹ %2$s — WordPress"),(0,Un.decodeEntities)(e),(0,Un.decodeEntities)(n));document.title=t,(0,Lt.speak)((0,E.sprintf)((0,E.__)("Now displaying: %s"),document.title),"assertive")}}),[e,n,t])}const Li={body:(0,E.__)("Editor content"),sidebar:(0,E.__)("Editor settings"),actions:(0,E.__)("Editor publish"),footer:(0,E.__)("Editor footer")};function Di(){const{record:e,getTitle:t,isLoaded:n}=Aa(),{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,E.__)("List View"):(0,E.__)("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,E.__)("Template"):(0,E.__)("Template Part");N=(0,E.sprintf)((0,E.__)("%1$s ‹ %2$s ‹ Editor"),t(),e)}return Ai(n&&N),n?(0,s.createElement)(s.Fragment,null,f&&(0,s.createElement)(zi,null),(0,s.createElement)(_.EntityProvider,{kind:"root",type:"site"},(0,s.createElement)(_.EntityProvider,{kind:"postType",type:r,id:a},(0,s.createElement)(vo,null,(0,s.createElement)(fe.BlockContextProvider,{value:C},(0,s.createElement)(ai,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)(Ri,null),f&&(0,s.createElement)(h.EditorNotices,null),b&&e&&(0,s.createElement)(wi,null),"text"===o&&e&&f&&(0,s.createElement)(ki,null),n&&!e&&(0,s.createElement)(y.Notice,{status:"warning",isDismissible:!1},(0,E.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")),f&&(0,s.createElement)(Ci,null)),secondarySidebar:f&&(S&&(0,s.createElement)(Ni,null)||x&&(0,s.createElement)(Mi,null)),sidebar:f&&u&&(0,s.createElement)(ee.Slot,{scope:"core/edit-site"}),footer:w&&(0,s.createElement)(fe.BlockBreadcrumb,{rootLabelText:(0,E.__)("Template")}),labels:{...Li,secondarySidebar:k}})))))):(0,s.createElement)(uo,null)}function Oi(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)(y.__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 Fi(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)(ye.store);if("wp_template"===t.type&&!t.is_custom)return null;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.MenuItem,{onClick:()=>{o(!0),r(t.title.rendered)}},(0,E.__)("Rename")),l&&(0,s.createElement)(y.Modal,{title:(0,E.__)("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,E.__)("Entity renamed."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while renaming the entity.");d(t,{type:"snackbar"})}}},(0,s.createElement)(y.__experimentalVStack,{spacing:"5"},(0,s.createElement)(y.TextControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Name"),value:a,onChange:r,required:!0}),(0,s.createElement)(y.__experimentalHStack,{justify:"right"},(0,s.createElement)(y.Button,{variant:"tertiary",onClick:()=>{o(!1)}},(0,E.__)("Cancel")),(0,s.createElement)(y.Button,{variant:"primary",type:"submit"},(0,E.__)("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)(ye.store),i=function(e){return!!e&&"custom"===e.source&&!e.has_theme_file}(t),c=Ot(t);if(!i&&!c)return null;return(0,s.createElement)(y.DropdownMenu,{icon:re,label:(0,E.__)("Actions"),className:"edit-site-list-table__actions"},(e=>{let{onClose:u}=e;return(0,s.createElement)(y.MenuGroup,null,i&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Fi,{template:t,onClose:u}),(0,s.createElement)(y.MenuItem,{isDestructive:!0,isTertiary:!0,onClick:()=>{n(t),u()}},(0,E.__)("Delete"))),c&&(0,s.createElement)(y.MenuItem,{info:(0,E.__)("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,E.__)("Entity reverted."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,E.__)("An error occurred while reverting the entity.");o(t,{type:"snackbar"})}}(),u()}},(0,E.__)("Clear customizations")))}))}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:"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 $i=(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 Ui=(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 Wi=["wp_template","wp_template_part"];function ji(e){let{text:t,icon:n,imageUrl:a,isCustomized:r,templateType:l}=e;const[o,i]=(0,s.useState)(!1);return(0,s.createElement)(y.__experimentalHStack,{alignment:"left"},a?(0,s.createElement)("div",{className:f()("edit-site-list-added-by__avatar",{"is-loaded":o})},(0,s.createElement)("img",{onLoad:()=>i(!0),alt:"",src:a})):(0,s.createElement)("div",{className:"edit-site-list-added-by__icon"},(0,s.createElement)(y.Icon,{icon:n})),(0,s.createElement)("span",null,t,r&&(0,s.createElement)("span",{className:"edit-site-list-added-by__customized-info"},"wp_template"===l?(0,E._x)("Customized","template"):(0,E._x)("Customized","template part"))))}function qi(e){var t;let{slug:n,isCustomized:a,templateType:r}=e;const l=(0,m.useSelect)((e=>e(_.store).getTheme(n)),[n]);return(0,s.createElement)(ji,{icon:Dn,text:(null==l||null===(t=l.name)||void 0===t?void 0:t.rendered)||n,isCustomized:a,templateType:r})}function Yi(e){let{slug:t,isCustomized:n,templateType:a}=e;const r=(0,m.useSelect)((e=>e(_.store).getPlugin(t)),[t]);return(0,s.createElement)(ji,{icon:Hi,text:(null==r?void 0:r.name)||t,isCustomized:n,templateType:a})}function Xi(e){var t;let{id:n,templateType:a}=e;const r=(0,m.useSelect)((e=>e(_.store).getUser(n)),[n]);return(0,s.createElement)(ji,{icon:$i,imageUrl:null==r||null===(t=r.avatar_urls)||void 0===t?void 0:t[48],text:null==r?void 0:r.nickname,templateType:a})}function Zi(e){let{templateType:t}=e;const{name:n,logoURL:a}=(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)(ji,{icon:Ui,imageUrl:a,text:n,templateType:t})}function Ki(e){let{templateType:t,template:n}=e;if(n){if(Wi.includes(t)){if(n.has_theme_file&&("theme"===n.origin||!n.origin&&["theme","custom"].includes(n.source)))return(0,s.createElement)(qi,{slug:n.theme,isCustomized:"custom"===n.source,templateType:t});if(n.has_theme_file&&"plugin"===n.origin)return(0,s.createElement)(Yi,{slug:n.theme,isCustomized:"custom"===n.source,templateType:t});if(!n.has_theme_file&&"custom"===n.source&&!n.author)return(0,s.createElement)(Zi,{templateType:t})}return(0,s.createElement)(Xi,{id:n.author,templateType:t})}}function Qi(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]);if(!n||a)return null;var l,o;if(!n.length)return(0,s.createElement)("div",null,(0,E.sprintf)((0,E.__)("No %s found."),null==r||null===(l=r.labels)||void 0===l||null===(o=l.name)||void 0===o?void 0:o.toLowerCase()));const i=[...n];return i.sort(((e,t)=>e.slug.localeCompare(t.slug))),(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,E.__)("Template")),(0,s.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,E.__)("Added by")),(0,s.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,s.createElement)(y.VisuallyHidden,null,(0,E.__)("Actions"))))),(0,s.createElement)("tbody",null,i.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)(y.__experimentalHeading,{level:4},(0,s.createElement)(Pt,{params:{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)(Ki,{templateType:t,template:e})),(0,s.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,s.createElement)(Gi,{template:e})))}))))}function Ji(){var e,t;const{params:{path:n}}=Ct(),a="/wp_template/all"===n?"wp_template":"wp_template_part";!function(){const{registerShortcut:e}=(0,m.useDispatch)(Ln.store);(0,s.useEffect)((()=>{e({name:"core/edit-site/next-region",category:"global",description:(0,E.__)("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,E.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})}),[])}();const{previousShortcut:r,nextShortcut:l}=(0,m.useSelect)((e=>({previousShortcut:e(Ln.store).getAllShortcutKeyCombinations("core/edit-site/previous-region"),nextShortcut:e(Ln.store).getAllShortcutKeyCombinations("core/edit-site/next-region")})),[]),o=(0,m.useSelect)((e=>e(_.store).getPostType(a)),[a]);Ai(null==o||null===(e=o.labels)||void 0===e?void 0:e.name);const i=null==o||null===(t=o.labels)||void 0===t?void 0:t.items_list,c=o?{header:(0,E.sprintf)((0,E.__)("%s - Header"),i),body:(0,E.sprintf)((0,E.__)("%s - Content"),i)}:void 0;return(0,s.createElement)(ae,{className:"edit-site-list",labels:c,header:(0,s.createElement)(Oi,{templateType:a}),notices:(0,s.createElement)(h.EditorSnackbars,null),content:(0,s.createElement)(Qi,{templateType:a}),shortcuts:{previous:r,next:l}})}function es(e){let{text:t,children:n}=e;const a=(0,te.useCopyToClipboard)(t);return(0,s.createElement)(y.Button,{variant:"secondary",ref:a},n)}function ts(e){let{message:t,error:n}=e;const a=[(0,s.createElement)(es,{key:"copy-error",text:n.stack},(0,E.__)("Copy Error"))];return(0,s.createElement)(fe.Warning,{className:"editor-error-boundary",actions:a},t)}class ns extends s.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,he.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){return this.state.error?(0,s.createElement)(ts,{message:(0,E.__)("The editor has encountered an unexpected error."),error:this.state.error}):this.props.children}}var as=(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 rs=(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 ls=(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 os=[{keyCombination:{modifier:"primary",character:"b"},description:(0,E.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,E.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,E.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,E.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,E.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,E.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,E.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,E.__)("Make the selected text inline code.")}];function is(e){let{keyCombination:t,forceAriaLabel:n}=e;const a=t.modifier?qa.displayShortcutList[t.modifier](t.character):t.character,r=t.modifier?qa.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 ss(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)(is,{keyCombination:n,forceAriaLabel:r}),a.map(((e,t)=>(0,s.createElement)(is,{keyCombination:e,forceAriaLabel:r,key:t})))))}function cs(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)(ss,{keyCombination:n,description:a,aliases:r}):null}const us=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)(cs,{name:e}):(0,s.createElement)(ss,e)))))},ms=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)(us,{shortcuts:n}))},ds=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)(ms,{title:t,shortcuts:r.concat(a)})};function ps(e){let{isModalActive:t,toggleModal:n}=e;return t?(0,s.createElement)(y.Modal,{className:"edit-site-keyboard-shortcut-help-modal",title:(0,E.__)("Keyboard shortcuts"),onRequestClose:n},(0,s.createElement)(ms,{className:"edit-site-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-site/keyboard-shortcuts"]}),(0,s.createElement)(ds,{title:(0,E.__)("Global shortcuts"),categoryName:"global"}),(0,s.createElement)(ds,{title:(0,E.__)("Selection shortcuts"),categoryName:"selection"}),(0,s.createElement)(ds,{title:(0,E.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,E.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,E.__)("Forward-slash")}]}),(0,s.createElement)(ms,{title:(0,E.__)("Text formatting"),shortcuts:os})):null}function _s(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 hs(e){let{isModalActive:t,toggleModal:n}=e;const a=(0,s.useMemo)((()=>[{name:"general",tabLabel:(0,E.__)("General"),content:(0,s.createElement)(de,{title:(0,E.__)("Appearance"),description:(0,E.__)("Customize options related to the block editor interface and editing flow.")},(0,s.createElement)(_s,{featureName:"focusMode",help:(0,E.__)("Highlights the current block and fades other content."),label:(0,E.__)("Spotlight mode")}),(0,s.createElement)(_s,{featureName:"showIconLabels",label:(0,E.__)("Show button text labels"),help:(0,E.__)("Show text instead of icons on buttons.")}),(0,s.createElement)(_s,{featureName:"showListViewByDefault",help:(0,E.__)("Opens the block list view sidebar by default."),label:(0,E.__)("Always open list view")}))},{name:"blocks",tabLabel:(0,E.__)("Blocks"),content:(0,s.createElement)(de,{title:(0,E.__)("Block interactions"),description:(0,E.__)("Customize how you interact with blocks in the block library and editing canvas.")},(0,s.createElement)(_s,{featureName:"keepCaretInsideBlock",help:(0,E.__)("Aids screen readers by stopping text caret from leaving blocks."),label:(0,E.__)("Contain text cursor inside block")}))}]));return t?(0,s.createElement)(oe,{closeModal:n},(0,s.createElement)(me,{sections:a})):null}const{Fill:gs,Slot:vs}=(0,y.createSlotFill)("EditSiteToolsMoreMenuGroup");gs.Slot=e=>{let{fillProps:t}=e;return(0,s.createElement)(vs,{fillProps:t},(e=>!(0,ve.isEmpty)(e)&&e))};var fs=gs,ys=n(8981),Es=n.n(ys);var bs=(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 ws(){const{createErrorNotice:e}=(0,m.useDispatch)(ye.store);return(0,s.createElement)(y.MenuItem,{role:"menuitem",icon:bs,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,E.__)("An error occurred while creating the site export.");e(a,{type:"snackbar"})}},info:(0,E.__)("Download your theme with updated templates and styles.")},(0,E._x)("Export","site exporter menu item"))}function Ss(){const{toggle:e}=(0,m.useDispatch)(T.store);return(0,s.createElement)(y.MenuItem,{onClick:()=>e("core/edit-site","welcomeGuide")},(0,E.__)("Welcome Guide"))}function xs(){const{createNotice:e}=(0,m.useDispatch)(ye.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,E.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,s.createElement)(y.MenuItem,{ref:n},(0,E.__)("Copy all blocks"))}const ks=[{value:"visual",label:(0,E.__)("Visual editor")},{value:"text",label:(0,E.__)("Code editor")}];var Cs=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=ks.map((n=>n.value!==t?{...n,shortcut:e}:n));return(0,s.createElement)(y.MenuGroup,{label:(0,E.__)("Editor")},(0,s.createElement)(y.MenuItemsChoice,{choices:a,value:t,onSelect:n}))};function Ts(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)(y.MenuGroup,{label:(0,E._x)("View","noun")},(0,s.createElement)(T.PreferenceToggleMenuItem,{scope:"core/edit-site",name:"fixedToolbar",label:(0,E.__)("Top toolbar"),info:(0,E.__)("Access all block and document tools in a single place"),messageActivated:(0,E.__)("Top toolbar activated"),messageDeactivated:(0,E.__)("Top toolbar deactivated")}),(0,s.createElement)(T.PreferenceToggleMenuItem,{scope:"core/edit-site",name:"focusMode",label:(0,E.__)("Spotlight mode"),info:(0,E.__)("Focus on one block at a time"),messageActivated:(0,E.__)("Spotlight mode activated"),messageDeactivated:(0,E.__)("Spotlight mode deactivated")}),(0,s.createElement)(Cs,null),(0,s.createElement)(q.Slot,{name:"core/edit-site/plugin-more-menu",label:(0,E.__)("Plugins"),as:y.MenuGroup,fillProps:{onClick:t}})),(0,s.createElement)(y.MenuGroup,{label:(0,E.__)("Tools")},(0,s.createElement)(ws,null),(0,s.createElement)(y.MenuItem,{onClick:a,shortcut:qa.displayShortcut.access("h")},(0,E.__)("Keyboard shortcuts")),(0,s.createElement)(Ss,null),(0,s.createElement)(xs,null),(0,s.createElement)(y.MenuItem,{icon:ls,role:"menuitem",href:(0,E.__)("https://wordpress.org/support/article/site-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,E.__)("Help"),(0,s.createElement)(y.VisuallyHidden,{as:"span"},(0,E.__)("(opens in a new tab)"))),(0,s.createElement)(fs.Slot,{fillProps:{onClose:t}})),(0,s.createElement)(y.MenuGroup,null,(0,s.createElement)(y.MenuItem,{onClick:l},(0,E.__)("Preferences"))))})),(0,s.createElement)(ps,{isModalActive:n,toggleModal:a}),(0,s.createElement)(hs,{isModalActive:r,toggleModal:l}))}function Ns(){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,E.__)("Save");return(0,s.createElement)(y.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:qa.displayShortcut.primary("s"),showTooltip:!0},l)}var Ms=(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 Is=(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 Ps=(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)(y.Button,g({},e,{ref:t,icon:(0,E.isRTL)()?Is:Ms,label:(0,E.__)("Undo"),shortcut:qa.displayShortcut.primary("z"),"aria-disabled":!n,onClick:n?a:void 0}))}));var Bs=(0,s.forwardRef)((function(e,t){const n=(0,qa.isAppleOS)()?qa.displayShortcut.primaryShift("z"):qa.displayShortcut.primary("y"),a=(0,m.useSelect)((e=>e(_.store).hasRedo()),[]),{redo:r}=(0,m.useDispatch)(_.store);return(0,s.createElement)(y.Button,g({},e,{ref:t,icon:(0,E.isRTL)()?Ms:Is,label:(0,E.__)("Redo"),shortcut:n,"aria-disabled":!a,onClick:a?r:void 0}))}));var zs=(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 Vs(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)(y.TextControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Title"),value:n?"":r,help:"wp_template_part"!==t.type?(0,E.__)('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 Rs(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)(y.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Area"),labelPosition:"top",options:r,value:n,onChange:a})}function As(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({path:"/"+t.type+"/all"}),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)(y.__experimentalVStack,{className:"edit-site-template-details__group",spacing:3},c?(0,s.createElement)(Vs,{template:t}):(0,s.createElement)(y.__experimentalText,{size:16,weight:600,className:"edit-site-template-details__title",as:"p"},(0,Un.decodeEntities)(a)),r&&(0,s.createElement)(y.__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)(Rs,{id:t.id})),Ot(t)&&(0,s.createElement)(y.MenuGroup,{className:"edit-site-template-details__group edit-site-template-details__revert"},(0,s.createElement)(y.MenuItem,{className:"edit-site-template-details__revert-button",info:(0,E.__)("Use the template as supplied by the theme."),onClick:()=>{l(t),n()}},(0,E.__)("Clear customizations"))),(0,s.createElement)(y.Button,g({className:"edit-site-template-details__show-all-button"},o),"wp_template"===(null==t?void 0:t.type)?(0,E.__)("Manage all templates"):(0,E.__)("Manage all template parts")))}function Ls(e){if(e){const t=(0,c.getBlockType)(e.name);return t?(0,c.__experimentalGetBlockLabel)(t,e.attributes):null}return null}function Ds(){const e=(0,m.useSelect)((e=>e(T.store).get("core/edit-site","showIconLabels")),[]),{isLoaded:t,record:n,getTitle:a}=Aa(),{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:Ls(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,E.__)("Loading…"));if(!n)return(0,s.createElement)("div",{className:"edit-site-document-actions"},(0,E.__)("Template not found"));const u="wp_template_part"===n.type?(0,E.__)("template part"):(0,E.__)("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)(y.__experimentalText,{size:"body",className:"edit-site-document-actions__title",as:"h1"},(0,s.createElement)(y.VisuallyHidden,{as:"span"},(0,E.sprintf)((0,E.__)("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)(y.__experimentalText,{size:"body"},null!=r?r:"")),(0,s.createElement)(y.Dropdown,{popoverProps:c,renderToggle:t=>{let{isOpen:n,onToggle:a}=t;return(0,s.createElement)(y.Button,{className:"edit-site-document-actions__get-info",icon:zs,"aria-expanded":n,"aria-haspopup":"true",onClick:a,variant:e?"tertiary":void 0,label:(0,E.sprintf)((0,E.__)("Show %s details"),u)},e&&(0,E.__)("Details"))},contentClassName:"edit-site-document-actions__info-dropdown",renderContent:e=>{let{onClose:t}=e;return(0,s.createElement)(As,{template:n,onClose:t})}})))}const Os=e=>{e.preventDefault()};function Fs(){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,y.__experimentalUseSlotFills)(xo);return!(null==e||!e.length)}(),k="wp_template_part"===a,C=(0,E._x)("Toggle block inserter","Generic label for block inserter button"),N=r?(0,E.__)("Close"):(0,E.__)("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,E.__)("Document tools")},(0,s.createElement)("div",{className:"edit-site-header-edit-mode__toolbar"},(0,s.createElement)(y.ToolbarItem,{ref:t,as:y.Button,className:"edit-site-header-edit-mode__inserter-toggle",variant:"primary",isPressed:r,onMouseDown:Os,onClick:w,disabled:!i,icon:ra,label:d?N:C,showTooltip:!d}),b&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(y.ToolbarItem,{as:fe.ToolSelector,showTooltip:!d,variant:d?"tertiary":void 0,disabled:!i}),(0,s.createElement)(y.ToolbarItem,{as:Ps,showTooltip:!d,variant:d?"tertiary":void 0}),(0,s.createElement)(y.ToolbarItem,{as:Bs,showTooltip:!d,variant:d?"tertiary":void 0}),(0,s.createElement)(y.ToolbarItem,{as:y.Button,className:"edit-site-header-edit-mode__list-view-toggle",disabled:!i||I,icon:as,isPressed:l,label:(0,E.__)("List View"),onClick:S,shortcut:o,showTooltip:!d,variant:d?"tertiary":void 0}),M&&(0,s.createElement)(y.ToolbarItem,{as:y.Button,className:"edit-site-header-edit-mode__zoom-out-view-toggle",icon:rs,isPressed:I,label:(0,E.__)("Zoom-out View"),onClick:()=>{p("desktop"),v(I?"edit":"zoom-out")}})))),(0,s.createElement)("div",{className:"edit-site-header-edit-mode__center"},x?(0,E.__)("Style Book"):(0,s.createElement)(Ds,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,E.__)("View")},(0,s.createElement)(y.MenuGroup,null,(0,s.createElement)(y.MenuItem,{href:u,target:"_blank",icon:ls},(0,E.__)("View site"),(0,s.createElement)(y.VisuallyHidden,{as:"span"},(0,E.__)("(opens in a new tab)")))))),(0,s.createElement)(Ns,null),(0,s.createElement)(K.Slot,{scope:"core/edit-site"}),(0,s.createElement)(Ts,{showIconLabels:d}))))}var Gs=(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 Hs=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,E.__)("Site Icon"),src:a}):(0,s.createElement)(y.Icon,{className:"edit-site-site-icon__icon",size:"32px",icon:Gs});return(0,s.createElement)("div",{className:f()(t,"edit-site-site-icon")},r)};const $s=(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,E.__)("Go back to the dashboard")}:{label:(0,E.__)("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)(y.__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)(y.__experimentalHStack,{justify:"flex-start",className:"edit-site-site-hub__text-content",spacing:"0"},(0,s.createElement)(y.__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)(y.Button,g({},c,{className:"edit-site-layout__view-mode-toggle"}),(0,s.createElement)(Hs,{className:"edit-site-layout__view-mode-toggle-icon"}))),i&&(0,s.createElement)("div",{className:"edit-site-site-hub__site-title"},(0,Un.decodeEntities)(u))))}));var Us=$s;function Ws(){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)(y.Modal,{className:"edit-site-save-panel__modal",onRequestClose:a,__experimentalHideHeader:!0,contentLabel:(0,E.__)("Save site, content, and template changes")},(0,s.createElement)(h.EntitiesSavedStates,{close:a})):null:(0,s.createElement)(ne,{className:f()("edit-site-layout__actions",{"is-entity-save-view-open":e}),ariaLabel:(0,E.__)("Save sidebar")},e?(0,s.createElement)(h.EntitiesSavedStates,{close:a}):(0,s.createElement)("div",{className:"edit-site-editor__toggle-save-panel"},(0,s.createElement)(y.Button,{variant:"secondary",className:"edit-site-editor__toggle-save-panel-button",onClick:()=>n(!0),"aria-expanded":!1},(0,E.__)("Open save panel"))))}var js=function(){const{registerShortcut:e}=(0,m.useDispatch)(Ln.store);return(0,s.useEffect)((()=>{e({name:"core/edit-site/save",category:"global",description:(0,E.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-site/undo",category:"global",description:(0,E.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-site/redo",category:"global",description:(0,E.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,qa.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/edit-site/toggle-list-view",category:"global",description:(0,E.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/edit-site/toggle-block-settings-sidebar",category:"global",description:(0,E.__)("Show or hide the block settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/edit-site/keyboard-shortcuts",category:"main",description:(0,E.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/edit-site/next-region",category:"global",description:(0,E.__)("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,E.__)("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,E.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),e({name:"core/edit-site/transform-heading-to-paragraph",category:"block-library",description:(0,E.__)("Transform heading to paragraph."),keyCombination:{modifier:"access",character:"0"}}),[1,2,3,4,5,6].forEach((t=>{e({name:`core/edit-site/transform-paragraph-to-heading-${t}`,category:"block-library",description:(0,E.__)("Transform paragraph to heading."),keyCombination:{modifier:"access",character:`${t}`}})}))}),[e]),null};var qs=function(){const{__experimentalGetDirtyEntityRecords:e,isSavingEntityRecord:t}=(0,m.useSelect)(_.store),{setIsSaveViewOpened:n}=(0,m.useDispatch)(An);return(0,Ln.useShortcut)("core/edit-site/save",(a=>{a.preventDefault();const r=e(),l=!!r.length;!r.some((e=>t(e.kind,e.name,e.key)))&&l&&n(!0)})),null};const Ys=.5,Xs={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 Zs(){!function(){const{params:{postId:e,postType:t}={}}=Ct(),{isRequestingSite:n,homepageId:a,url:r}=(0,m.useSelect)((e=>{const{getSite:t,getUnstableBase:n}=e(_.store),a=t(),r=n();return{isRequestingSite:!r,homepageId:"page"===(null==a?void 0:a.show_on_front)?a.page_on_front:null,url:null==r?void 0:r.home}}),[]),{setTemplate:l,setTemplatePart:o,setPage:i}=(0,m.useDispatch)(An);(0,s.useEffect)((()=>{if(t&&e)switch(t){case"wp_template":l(e);break;case"wp_template_part":o(e);break;default:i({context:{postType:t,postId:e}})}else a?i({context:{postType:"page",postId:a}}):n||i({path:r})}),[r,e,t,a,n,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}=t,o=(0,s.useRef)(l),i=(0,s.useRef)(t);(0,s.useEffect)((()=>{i.current=t}),[t]),(0,s.useEffect)((()=>{r.current=n,"init"!==n&&("edit"===n&&o.current!==n&&e.push({...i.current,canvas:"edit"}),"view"===n&&void 0!==o.current&&e.push({...i.current,canvas:void 0}))}),[n,e]),(0,s.useEffect)((()=>{o.current=l,void 0===l&&"view"!==r.current?a("view"):"edit"===l&&"edit"!==r.current&&a("edit")}),[l,a])}();const e=(0,s.useRef)(),{params:t}=Ct(),n=function(e){let{path:t}=e;return"/wp_template/all"===t||"/wp_template_part/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,y.__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,(0,s.createElement)(js,null),(0,s.createElement)(qs,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)(Us,{ref:e,className:"edit-site-layout__hub",style:{width:I&&C?C-48:void 0}}),(0,s.createElement)(y.__unstableAnimatePresence,{initial:!1},a&&"edit"===r&&(0,s.createElement)(ne,{className:"edit-site-layout__header",ariaLabel:(0,E.__)("Editor top bar"),as:y.__unstableMotion.div,animate:{y:0},initial:{y:"-100%"},exit:{y:"-100%"},transition:{type:"tween",duration:c?0:Ys,ease:"easeOut"}},"edit"===r&&(0,s.createElement)(Fs,null))),(0,s.createElement)("div",{className:"edit-site-layout__content"},(0,s.createElement)(y.__unstableAnimatePresence,{initial:!1},p&&(0,s.createElement)(y.ResizableBox,{as:y.__unstableMotion.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{type:"tween",duration:c||N?0:Ys,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)(gi,{direction:"right",variation:"separator",resizeWidthBy:e=>{T((null!=C?C:P)+e)}})},handleClasses:void 0,handleStyles:{right:Xs},minWidth:I?320:void 0,maxWidth:I&&k?k.width-360:void 0},(0,s.createElement)(ne,{ariaLabel:(0,E.__)("Navigation sidebar")},(0,s.createElement)(Ka,null)))),(0,s.createElement)(Ws,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)(y.__unstableMotion.div,{whileHover:a&&"view"===r?{scale:1.01,transition:{duration:c||N?0:.2}}:{},initial:!1,layout:"position",className:"edit-site-layout__canvas",transition:{type:"tween",duration:c||N?0:Ys,ease:"easeOut"}},(0,s.createElement)(y.__unstableMotion.div,{style:{position:"absolute",top:0,left:0,bottom:0},initial:!1,animate:{width:B},transition:{type:"tween",duration:c||N?0:Ys,ease:"easeOut"}},(0,s.createElement)(ns,null,a&&(0,s.createElement)(Di,null),n&&(0,s.createElement)(Ji,null))))))))}function Ks(){const{createErrorNotice:e}=(0,m.useDispatch)(ye.store);return(0,s.createElement)(Ln.ShortcutProvider,{style:{height:"100%"}},(0,s.createElement)(y.SlotFillProvider,null,(0,s.createElement)(y.Popover.Slot,null),(0,s.createElement)(h.UnsavedChangesWarning,null),(0,s.createElement)(Mt,null,(0,s.createElement)(Zs,null),(0,s.createElement)(G.PluginArea,{onError:function(t){e((0,E.sprintf)((0,E.__)('The "%s" plugin has encountered an error and cannot be rendered.'),t))}}))))}function Qs(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 Js(e){return(0,s.createElement)(X,g({__unstableExplicitMenuItem:!0,scope:"core/edit-site"},e))}var ec=(0,te.compose)((0,G.withPluginContext)(((e,t)=>{var n;return{as:null!==(n=t.as)&&void 0!==n?n:y.MenuItem,icon:t.icon||e.icon,name:"core/edit-site/plugin-more-menu"}})))(q);function tc(e,t){const n=document.getElementById(e),a=(0,s.createRoot)(n);t.__experimentalFetchLinkSuggestions=(e,n)=>(0,_.__experimentalFetchLinkSuggestions)(e,n,t),t.__experimentalFetchRichUrlData=_.__experimentalFetchUrlData,(0,m.dispatch)(c.store).__experimentalReapplyBlockTypeFilters();const r=(0,u.__experimentalGetCoreBlocks)().filter((e=>{let{name:t}=e;return"core/freeform"!==t}));return(0,u.registerCoreBlocks)(r),(0,m.dispatch)(c.store).setFreeformFallbackBlockName("core/html"),(0,_e.registerLegacyWidgetBlock)({inserter:!1}),(0,_e.registerWidgetGroupBlock)({inserter:!1}),(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)(Ks,null)),a}function nc(){p()("wp.editSite.reinitializeEditor",{since:"6.2",version:"6.3"})}}(),(window.wp=window.wp||{}).editSite=a}();