WordPress/wp-includes/js/dist/edit-post.min.js
isabel_brison bae8871465 Editor: initial update of npm packages for 6.3 RC3.
Includes bug fixes for patterns, command palette and several minor regressions.

Props ramonopoly.
See #58926.

Built from https://develop.svn.wordpress.org/trunk@56320


git-svn-id: http://core.svn.wordpress.org/trunk@55832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-07-28 07:40:16 +00:00

7 lines
124 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

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

/*! This file is auto-generated */
!function(){var e={4403:function(e,t){var n;
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var o={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e.push(n);else if(Array.isArray(n)){if(n.length){var l=a.apply(null,n);l&&e.push(l)}}else if("object"===r){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var s in n)o.call(n,s)&&n[s]&&e.push(s)}}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()}},t={};function n(o){var a=t[o];if(void 0!==a)return a.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{PluginBlockSettingsMenuItem:function(){return Ka},PluginDocumentSettingPanel:function(){return ua},PluginMoreMenuItem:function(){return Ya},PluginPostPublishPanel:function(){return Sa},PluginPostStatusInfo:function(){return Ao},PluginPrePublishPanel:function(){return Ta},PluginSidebar:function(){return ma},PluginSidebarMoreMenuItem:function(){return Qa},__experimentalFullscreenModeClose:function(){return Fn},__experimentalMainDashboardButton:function(){return oo},initializeEditor:function(){return Xa},reinitializeEditor:function(){return Ja},store:function(){return on}});var e={};n.r(e),n.d(e,{closeModal:function(){return q},disableComplementaryArea:function(){return H},enableComplementaryArea:function(){return F},openModal:function(){return W},pinItem:function(){return G},setDefaultComplementaryArea:function(){return R},setFeatureDefaults:function(){return $},setFeatureValue:function(){return Z},toggleFeature:function(){return z},unpinItem:function(){return U}});var t={};n.r(t),n.d(t,{getActiveComplementaryArea:function(){return j},isComplementaryAreaLoading:function(){return K},isFeatureActive:function(){return Q},isItemPinned:function(){return Y},isModalActive:function(){return X}});var a={};n.r(a),n.d(a,{__experimentalSetPreviewDeviceType:function(){return gt},__unstableCreateTemplate:function(){return ft},__unstableSwitchToTemplateMode:function(){return bt},closeGeneralSidebar:function(){return Ke},closeModal:function(){return Qe},closePublishSidebar:function(){return Je},hideBlockTypes:function(){return ct},initializeMetaBoxes:function(){return yt},metaBoxUpdatesFailure:function(){return pt},metaBoxUpdatesSuccess:function(){return mt},openGeneralSidebar:function(){return je},openModal:function(){return Ye},openPublishSidebar:function(){return Xe},removeEditorPanel:function(){return ot},requestMetaBoxUpdates:function(){return ut},setAvailableMetaBoxesPerLocation:function(){return dt},setIsEditingTemplate:function(){return Et},setIsInserterOpened:function(){return ht},setIsListViewOpened:function(){return _t},showBlockTypes:function(){return it},switchEditorMode:function(){return rt},toggleEditorPanelEnabled:function(){return tt},toggleEditorPanelOpened:function(){return nt},toggleFeature:function(){return at},togglePinnedPluginItem:function(){return lt},togglePublishSidebar:function(){return et},updatePreferredStyleVariations:function(){return st}});var r={};n.r(r),n.d(r,{__experimentalGetInsertionPoint:function(){return Qt},__experimentalGetPreviewDeviceType:function(){return Kt},areMetaBoxesInitialized:function(){return en},getActiveGeneralSidebarName:function(){return It},getActiveMetaBoxLocations:function(){return Ut},getAllMetaBoxes:function(){return Wt},getEditedPostTemplate:function(){return tn},getEditorMode:function(){return xt},getHiddenBlockTypes:function(){return At},getMetaBoxesPerLocation:function(){return $t},getPreference:function(){return Nt},getPreferences:function(){return Lt},hasMetaBoxes:function(){return qt},isEditingTemplate:function(){return Jt},isEditorPanelEnabled:function(){return Ot},isEditorPanelOpened:function(){return Rt},isEditorPanelRemoved:function(){return Vt},isEditorSidebarOpened:function(){return Mt},isFeatureActive:function(){return Ht},isInserterOpened:function(){return Yt},isListViewOpened:function(){return Xt},isMetaBoxLocationActive:function(){return Zt},isMetaBoxLocationVisible:function(){return zt},isModalActive:function(){return Ft},isPluginItemPinned:function(){return Gt},isPluginSidebarOpened:function(){return Bt},isPublishSidebarOpened:function(){return Dt},isSavingMetaBoxes:function(){return jt}});var l=window.wp.element,s=window.wp.blocks,i=window.wp.blockLibrary,c=window.wp.deprecated,d=n.n(c),u=window.wp.data,m=window.wp.hooks,p=window.wp.preferences,g=window.wp.widgets,h=window.wp.mediaUtils;(0,m.addFilter)("editor.MediaUpload","core/edit-post/replace-media-upload",(()=>h.MediaUpload));var _=window.wp.components,E=window.wp.blockEditor,b=window.wp.i18n,f=window.wp.compose;const v=(0,f.compose)((0,u.withSelect)(((e,t)=>{if((0,s.hasBlockSupport)(t.name,"multiple",!0))return{};const n=e(E.store).getBlocks().find((({name:e})=>t.name===e));return{originalBlockClientId:n&&n.clientId!==t.clientId&&n.clientId}})),(0,u.withDispatch)(((e,{originalBlockClientId:t})=>({selectFirst:()=>e(E.store).selectBlock(t)})))),y=(0,f.createHigherOrderComponent)((e=>v((({originalBlockClientId:t,selectFirst:n,...o})=>{if(!t)return(0,l.createElement)(e,{...o});const a=(0,s.getBlockType)(o.name),r=function(e){const t=(0,s.findTransform)((0,s.getBlockTransforms)("to",e),(({type:e,blocks:t})=>"block"===e&&1===t.length));if(!t)return null;return(0,s.getBlockType)(t.blocks[0])}(o.name);return[(0,l.createElement)("div",{key:"invalid-preview",style:{minHeight:"60px"}},(0,l.createElement)(e,{key:"block-edit",...o})),(0,l.createElement)(E.Warning,{key:"multiple-use-warning",actions:[(0,l.createElement)(_.Button,{key:"find-original",variant:"secondary",onClick:n},(0,b.__)("Find original")),(0,l.createElement)(_.Button,{key:"remove",variant:"secondary",onClick:()=>o.onReplace([])},(0,b.__)("Remove")),r&&(0,l.createElement)(_.Button,{key:"transform",variant:"secondary",onClick:()=>o.onReplace((0,s.createBlock)(r.name,o.attributes))},(0,b.__)("Transform into:")," ",r.title)]},(0,l.createElement)("strong",null,a?.title,": "),(0,b.__)("This block can only be used once."))]}))),"withMultipleValidation");(0,m.addFilter)("editor.BlockEdit","core/edit-post/validate-multiple-use/with-multiple-validation",y);var w=window.wp.coreData,S=window.wp.editor,k=window.wp.primitives;var P=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})),C=window.wp.plugins,T=window.wp.url,x=window.wp.notices;function M(){const{createNotice:e}=(0,u.useDispatch)(x.store),t=(0,u.useSelect)((e=>()=>e(S.store).getEditedPostAttribute("content")),[]);const n=(0,f.useCopyToClipboard)(t,(function(){e("info",(0,b.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,l.createElement)(_.MenuItem,{ref:n},(0,b.__)("Copy all blocks"))}var B=window.wp.keycodes,I=n(4403),L=n.n(I);var N=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));var A=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"}));var D=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})),V=window.wp.viewport;var O=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));const R=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),F=(e,t)=>({registry:n,dispatch:o})=>{if(!t)return;n.select(p.store).get(e,"isComplementaryAreaVisible")||n.dispatch(p.store).set(e,"isComplementaryAreaVisible",!0),o({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},H=e=>({registry:t})=>{t.select(p.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(p.store).set(e,"isComplementaryAreaVisible",!1)},G=(e,t)=>({registry:n})=>{if(!t)return;const o=n.select(p.store).get(e,"pinnedItems");!0!==o?.[t]&&n.dispatch(p.store).set(e,"pinnedItems",{...o,[t]:!0})},U=(e,t)=>({registry:n})=>{if(!t)return;const o=n.select(p.store).get(e,"pinnedItems");n.dispatch(p.store).set(e,"pinnedItems",{...o,[t]:!1})};function z(e,t){return function({registry:n}){d()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),n.dispatch(p.store).toggle(e,t)}}function Z(e,t,n){return function({registry:o}){d()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),o.dispatch(p.store).set(e,t,!!n)}}function $(e,t){return function({registry:n}){d()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),n.dispatch(p.store).setDefaults(e,t)}}function W(e){return{type:"OPEN_MODAL",name:e}}function q(){return{type:"CLOSE_MODAL"}}const j=(0,u.createRegistrySelector)((e=>(t,n)=>{const o=e(p.store).get(n,"isComplementaryAreaVisible");if(void 0!==o)return!1===o?null:t?.complementaryAreas?.[n]})),K=(0,u.createRegistrySelector)((e=>(t,n)=>{const o=e(p.store).get(n,"isComplementaryAreaVisible"),a=t?.complementaryAreas?.[n];return o&&void 0===a})),Y=(0,u.createRegistrySelector)((e=>(t,n,o)=>{var a;const r=e(p.store).get(n,"pinnedItems");return null===(a=r?.[o])||void 0===a||a})),Q=(0,u.createRegistrySelector)((e=>(t,n,o)=>(d()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(p.store).get(n,o))));function X(e,t){return e.activeModal===t}var J=(0,u.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:n,area:o}=t;return e[n]?e:{...e,[n]:o}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:o}=t;return{...e,[n]:o}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}});const ee=(0,u.createReduxStore)("core/interface",{reducer:J,actions:e,selectors:t});(0,u.register)(ee);var te=(0,C.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));var ne=te((function({as:e=_.Button,scope:t,identifier:n,icon:o,selectedIcon:a,name:r,...s}){const i=e,c=(0,u.useSelect)((e=>e(ee).getActiveComplementaryArea(t)===n),[n]),{enableComplementaryArea:d,disableComplementaryArea:m}=(0,u.useDispatch)(ee);return(0,l.createElement)(i,{icon:a&&c?a:o,onClick:()=>{c?m(t):d(t,n)},...s})}));var oe=({smallScreenTitle:e,children:t,className:n,toggleButtonProps:o})=>{const a=(0,l.createElement)(ne,{icon:O,...o});return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},e&&(0,l.createElement)("span",{className:"interface-complementary-area-header__small-title"},e),a),(0,l.createElement)("div",{className:L()("components-panel__header","interface-complementary-area-header",n),tabIndex:-1},t,a))};const ae=()=>{};function re({name:e,as:t=_.Button,onClick:n,...o}){return(0,l.createElement)(_.Fill,{name:e},(({onClick:e})=>(0,l.createElement)(t,{onClick:n||e?(...t)=>{(n||ae)(...t),(e||ae)(...t)}:void 0,...o})))}re.Slot=function({name:e,as:t=_.ButtonGroup,fillProps:n={},bubblesVirtually:o,...a}){return(0,l.createElement)(_.Slot,{name:e,bubblesVirtually:o,fillProps:n},(e=>{if(!l.Children.toArray(e).length)return null;const n=[];l.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&n.push(t)}));const o=l.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&n.includes(e.props.__unstableTarget)?null:e));return(0,l.createElement)(t,{...a},o)}))};var le=re;const se=({__unstableExplicitMenuItem:e,__unstableTarget:t,...n})=>(0,l.createElement)(_.MenuItem,{...n});function ie({scope:e,target:t,__unstableExplicitMenuItem:n,...o}){return(0,l.createElement)(ne,{as:o=>(0,l.createElement)(le,{__unstableExplicitMenuItem:n,__unstableTarget:`${e}/${t}`,as:se,name:`${e}/plugin-more-menu`,...o}),role:"menuitemcheckbox",selectedIcon:N,name:t,scope:e,...o})}function ce({scope:e,...t}){return(0,l.createElement)(_.Fill,{name:`PinnedItems/${e}`,...t})}ce.Slot=function({scope:e,className:t,...n}){return(0,l.createElement)(_.Slot,{name:`PinnedItems/${e}`,...n},(e=>e?.length>0&&(0,l.createElement)("div",{className:L()(t,"interface-pinned-items")},e)))};var de=ce;function ue({scope:e,children:t,className:n}){return(0,l.createElement)(_.Fill,{name:`ComplementaryArea/${e}`},(0,l.createElement)("div",{className:n},t))}const me=te((function({children:e,className:t,closeLabel:n=(0,b.__)("Close plugin"),identifier:o,header:a,headerClassName:r,icon:s,isPinnable:i=!0,panelClassName:c,scope:d,name:m,smallScreenTitle:p,title:g,toggleShortcut:h,isActiveByDefault:E,showIconLabels:f=!1}){const{isLoading:v,isActive:y,isPinned:w,activeArea:S,isSmall:k,isLarge:P}=(0,u.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:n,isItemPinned:a}=e(ee),r=t(d);return{isLoading:n(d),isActive:r===o,isPinned:a(d,o),activeArea:r,isSmall:e(V.store).isViewportMatch("< medium"),isLarge:e(V.store).isViewportMatch("large")}}),[o,d]);!function(e,t,n,o,a){const r=(0,l.useRef)(!1),s=(0,l.useRef)(!1),{enableComplementaryArea:i,disableComplementaryArea:c}=(0,u.useDispatch)(ee);(0,l.useEffect)((()=>{o&&a&&!r.current?(c(e),s.current=!0):s.current&&!a&&r.current?(s.current=!1,i(e,t)):s.current&&n&&n!==t&&(s.current=!1),a!==r.current&&(r.current=a)}),[o,a,e,t,n])}(d,o,S,y,k);const{enableComplementaryArea:C,disableComplementaryArea:T,pinItem:x,unpinItem:M}=(0,u.useDispatch)(ee);return(0,l.useEffect)((()=>{E&&void 0===S&&!k?C(d,o):void 0===S&&k&&T(d,o)}),[S,E,d,o,k]),(0,l.createElement)(l.Fragment,null,i&&(0,l.createElement)(de,{scope:d},w&&(0,l.createElement)(ne,{scope:d,identifier:o,isPressed:y&&(!f||P),"aria-expanded":y,"aria-disabled":v,label:g,icon:f?N:s,showTooltip:!f,variant:f?"tertiary":void 0})),m&&i&&(0,l.createElement)(ie,{target:m,scope:d,icon:s},g),y&&(0,l.createElement)(ue,{className:L()("interface-complementary-area",t),scope:d},(0,l.createElement)(oe,{className:r,closeLabel:n,onClose:()=>T(d),smallScreenTitle:p,toggleButtonProps:{label:n,shortcut:h,scope:d,identifier:o}},a||(0,l.createElement)(l.Fragment,null,(0,l.createElement)("strong",null,g),i&&(0,l.createElement)(_.Button,{className:"interface-complementary-area__pin-unpin-item",icon:w?A:D,label:w?(0,b.__)("Unpin from toolbar"):(0,b.__)("Pin to toolbar"),onClick:()=>(w?M:x)(d,o),isPressed:w,"aria-expanded":w}))),(0,l.createElement)(_.Panel,{className:c},e)))}));me.Slot=function({scope:e,...t}){return(0,l.createElement)(_.Slot,{name:`ComplementaryArea/${e}`,...t})};var pe=me;var ge=({isActive:e})=>((0,l.useEffect)((()=>{let e=!1;return document.body.classList.contains("sticky-menu")&&(e=!0,document.body.classList.remove("sticky-menu")),()=>{e&&document.body.classList.add("sticky-menu")}}),[]),(0,l.useEffect)((()=>(e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{e&&document.body.classList.remove("is-fullscreen-mode")})),[e]),null);function he({children:e,className:t,ariaLabel:n,as:o="div",...a}){return(0,l.createElement)(o,{className:L()("interface-navigable-region",t),"aria-label":n,role:"region",tabIndex:"-1",...a},e)}const _e={hidden:{opacity:0},hover:{opacity:1,transition:{type:"tween",delay:.2,delayChildren:.2}},distractionFreeInactive:{opacity:1,transition:{delay:0}}};var Ee=(0,l.forwardRef)((function({isDistractionFree:e,footer:t,header:n,editorNotices:o,sidebar:a,secondarySidebar:r,notices:s,content:i,actions:c,labels:d,className:u,enableRegionNavigation:m=!0,shortcuts:p},g){const h=(0,_.__unstableUseNavigateRegions)(p);!function(e){(0,l.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 E={...{header:(0,b.__)("Header"),body:(0,b.__)("Content"),secondarySidebar:(0,b.__)("Block Library"),sidebar:(0,b.__)("Settings"),actions:(0,b.__)("Publish"),footer:(0,b.__)("Footer")},...d};return(0,l.createElement)("div",{...m?h:{},ref:(0,f.useMergeRefs)([g,m?h.ref:void 0]),className:L()(u,"interface-interface-skeleton",h.className,!!t&&"has-footer")},(0,l.createElement)("div",{className:"interface-interface-skeleton__editor"},!!n&&(0,l.createElement)(he,{as:_.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":E.header,initial:e?"hidden":"distractionFreeInactive",whileHover:e?"hover":"distractionFreeInactive",animate:e?"hidden":"distractionFreeInactive",variants:_e,transition:e?{type:"tween",delay:.8}:void 0},n),e&&(0,l.createElement)("div",{className:"interface-interface-skeleton__header"},o),(0,l.createElement)("div",{className:"interface-interface-skeleton__body"},!!r&&(0,l.createElement)(he,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:E.secondarySidebar},r),!!s&&(0,l.createElement)("div",{className:"interface-interface-skeleton__notices"},s),(0,l.createElement)(he,{className:"interface-interface-skeleton__content",ariaLabel:E.body},i),!!a&&(0,l.createElement)(he,{className:"interface-interface-skeleton__sidebar",ariaLabel:E.sidebar},a),!!c&&(0,l.createElement)(he,{className:"interface-interface-skeleton__actions",ariaLabel:E.actions},c))),!!t&&(0,l.createElement)(he,{className:"interface-interface-skeleton__footer",ariaLabel:E.footer},t))}));var be=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function fe({as:e=_.DropdownMenu,className:t,label:n=(0,b.__)("Options"),popoverProps:o,toggleProps:a,children:r}){return(0,l.createElement)(e,{className:L()("interface-more-menu-dropdown",t),icon:be,label:n,popoverProps:{placement:"bottom-end",...o,className:L()("interface-more-menu-dropdown__content",o?.className)},toggleProps:{tooltipPosition:"bottom",...a}},(e=>r(e)))}function ve({closeModal:e,children:t}){return(0,l.createElement)(_.Modal,{className:"interface-preferences-modal",title:(0,b.__)("Preferences"),onRequestClose:e},t)}var ye=function({icon:e,size:t=24,...n}){return(0,l.cloneElement)(e,{width:t,height:t,...n})};var we=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var Se=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));const ke="preferences-menu";function Pe({sections:e}){const t=(0,f.useViewportMatch)("medium"),[n,o]=(0,l.useState)(ke),{tabs:a,sectionsContentMap:r}=(0,l.useMemo)((()=>{let t={tabs:[],sectionsContentMap:{}};return e.length&&(t=e.reduce(((e,{name:t,tabLabel:n,content:o})=>(e.tabs.push({name:t,title:n}),e.sectionsContentMap[t]=o,e)),{tabs:[],sectionsContentMap:{}})),t}),[e]),s=(0,l.useCallback)((e=>r[e.name]||null),[r]);let i;return i=t?(0,l.createElement)(_.TabPanel,{className:"interface-preferences__tabs",tabs:a,initialTabName:n!==ke?n:void 0,onSelect:o,orientation:"vertical"},s):(0,l.createElement)(_.__experimentalNavigatorProvider,{initialPath:"/",className:"interface-preferences__provider"},(0,l.createElement)(_.__experimentalNavigatorScreen,{path:"/"},(0,l.createElement)(_.Card,{isBorderless:!0,size:"small"},(0,l.createElement)(_.CardBody,null,(0,l.createElement)(_.__experimentalItemGroup,null,a.map((e=>(0,l.createElement)(_.__experimentalNavigatorButton,{key:e.name,path:e.name,as:_.__experimentalItem,isAction:!0},(0,l.createElement)(_.__experimentalHStack,{justify:"space-between"},(0,l.createElement)(_.FlexItem,null,(0,l.createElement)(_.__experimentalTruncate,null,e.title)),(0,l.createElement)(_.FlexItem,null,(0,l.createElement)(ye,{icon:(0,b.isRTL)()?we:Se})))))))))),e.length&&e.map((e=>(0,l.createElement)(_.__experimentalNavigatorScreen,{key:`${e.name}-menu`,path:e.name},(0,l.createElement)(_.Card,{isBorderless:!0,size:"large"},(0,l.createElement)(_.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6"},(0,l.createElement)(_.__experimentalNavigatorBackButton,{icon:(0,b.isRTL)()?Se:we,"aria-label":(0,b.__)("Navigate to the previous view")}),(0,l.createElement)(_.__experimentalText,{size:"16"},e.tabLabel)),(0,l.createElement)(_.CardBody,null,e.content)))))),i}var Ce=({description:e,title:t,children:n})=>(0,l.createElement)("fieldset",{className:"interface-preferences-modal__section"},(0,l.createElement)("legend",{className:"interface-preferences-modal__section-legend"},(0,l.createElement)("h2",{className:"interface-preferences-modal__section-title"},t),e&&(0,l.createElement)("p",{className:"interface-preferences-modal__section-description"},e)),n);var Te=function({help:e,label:t,isChecked:n,onChange:o,children:a}){return(0,l.createElement)("div",{className:"interface-preferences-modal__option"},(0,l.createElement)(_.ToggleControl,{__nextHasNoMarginBottom:!0,help:e,label:t,checked:n,onChange:o}),a)},xe=window.wp.keyboardShortcuts;const Me=[{keyCombination:{modifier:"primary",character:"b"},description:(0,b.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,b.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,b.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,b.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,b.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,b.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,b.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,b.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},description:(0,b.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,b.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")}];function Be({keyCombination:e,forceAriaLabel:t}){const n=e.modifier?B.displayShortcutList[e.modifier](e.character):e.character,o=e.modifier?B.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,l.createElement)("kbd",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||o},(Array.isArray(n)?n:[n]).map(((e,t)=>"+"===e?(0,l.createElement)(l.Fragment,{key:t},e):(0,l.createElement)("kbd",{key:t,className:"edit-post-keyboard-shortcut-help-modal__shortcut-key"},e))))}var Ie=function({description:e,keyCombination:t,aliases:n=[],ariaLabel:o}){return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-description"},e),(0,l.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-term"},(0,l.createElement)(Be,{keyCombination:t,forceAriaLabel:o}),n.map(((e,t)=>(0,l.createElement)(Be,{keyCombination:e,forceAriaLabel:o,key:t})))))};var Le=function({name:e}){const{keyCombination:t,description:n,aliases:o}=(0,u.useSelect)((t=>{const{getShortcutKeyCombination:n,getShortcutDescription:o,getShortcutAliases:a}=t(xe.store);return{keyCombination:n(e),aliases:a(e),description:o(e)}}),[e]);return t?(0,l.createElement)(Ie,{keyCombination:t,description:n,aliases:o}):null};const Ne="edit-post/keyboard-shortcut-help",Ae=({shortcuts:e})=>(0,l.createElement)("ul",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-list",role:"list"},e.map(((e,t)=>(0,l.createElement)("li",{className:"edit-post-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,l.createElement)(Le,{name:e}):(0,l.createElement)(Ie,{...e}))))),De=({title:e,shortcuts:t,className:n})=>(0,l.createElement)("section",{className:L()("edit-post-keyboard-shortcut-help-modal__section",n)},!!e&&(0,l.createElement)("h2",{className:"edit-post-keyboard-shortcut-help-modal__section-title"},e),(0,l.createElement)(Ae,{shortcuts:t})),Ve=({title:e,categoryName:t,additionalShortcuts:n=[]})=>{const o=(0,u.useSelect)((e=>e(xe.store).getCategoryShortcuts(t)),[t]);return(0,l.createElement)(De,{title:e,shortcuts:o.concat(n)})};var Oe=(0,f.compose)([(0,u.withSelect)((e=>({isModalActive:e(ee).isModalActive(Ne)}))),(0,u.withDispatch)(((e,{isModalActive:t})=>{const{openModal:n,closeModal:o}=e(ee);return{toggleModal:()=>t?o():n(Ne)}}))])((function({isModalActive:e,toggleModal:t}){return(0,xe.useShortcut)("core/edit-post/keyboard-shortcuts",t),e?(0,l.createElement)(_.Modal,{className:"edit-post-keyboard-shortcut-help-modal",title:(0,b.__)("Keyboard shortcuts"),closeButtonLabel:(0,b.__)("Close"),onRequestClose:t},(0,l.createElement)(De,{className:"edit-post-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-post/keyboard-shortcuts"]}),(0,l.createElement)(Ve,{title:(0,b.__)("Global shortcuts"),categoryName:"global"}),(0,l.createElement)(Ve,{title:(0,b.__)("Selection shortcuts"),categoryName:"selection"}),(0,l.createElement)(Ve,{title:(0,b.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,b.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,b.__)("Forward-slash")}]}),(0,l.createElement)(De,{title:(0,b.__)("Text formatting"),shortcuts:Me})):null}));var Re=(0,u.withDispatch)((e=>{const{openModal:t}=e(ee);return{openModal:t}}))((function({openModal:e}){return(0,l.createElement)(_.MenuItem,{onClick:()=>{e(Ne)},shortcut:B.displayShortcut.access("h")},(0,b.__)("Keyboard shortcuts"))}));const{Fill:Fe,Slot:He}=(0,_.createSlotFill)("ToolsMoreMenuGroup");Fe.Slot=({fillProps:e})=>(0,l.createElement)(He,{fillProps:e},(e=>e.length>0&&(0,l.createElement)(_.MenuGroup,{label:(0,b.__)("Tools")},e)));var Ge=Fe;function Ue(e=[],t){const n=[...e];for(const e of t){const t=n.findIndex((t=>t.id===e.id));-1!==t?n[t]=e:n.push(e)}return n}const ze=(0,u.combineReducers)({isSaving:function(e=!1,t){switch(t.type){case"REQUEST_META_BOX_UPDATES":return!0;case"META_BOX_UPDATES_SUCCESS":case"META_BOX_UPDATES_FAILURE":return!1;default:return e}},locations:function(e={},t){if("SET_META_BOXES_PER_LOCATIONS"===t.type){const n={...e};for(const[e,o]of Object.entries(t.metaBoxesPerLocation))n[e]=Ue(n[e],o);return n}return e},initialized:function(e=!1,t){return"META_BOXES_INITIALIZED"===t.type||e}});var Ze=(0,u.combineReducers)({metaBoxes:ze,publishSidebarActive:function(e=!1,t){switch(t.type){case"OPEN_PUBLISH_SIDEBAR":return!0;case"CLOSE_PUBLISH_SIDEBAR":return!1;case"TOGGLE_PUBLISH_SIDEBAR":return!e}return e},removedPanels:function(e=[],t){if("REMOVE_PANEL"===t.type)if(!e.includes(t.panelName))return[...e,t.panelName];return e},deviceType:function(e="Desktop",t){return"SET_PREVIEW_DEVICE_TYPE"===t.type?t.deviceType:e},blockInserterPanel:function(e=!1,t){switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},listViewPanel:function(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e},isEditingTemplate:function(e=!1,t){return"SET_IS_EDITING_TEMPLATE"===t.type?t.value:e}}),$e=window.wp.apiFetch,We=n.n($e),qe=window.wp.a11y;const je=e=>({registry:t})=>t.dispatch(ee).enableComplementaryArea(on.name,e),Ke=()=>({registry:e})=>e.dispatch(ee).disableComplementaryArea(on.name),Ye=e=>({registry:t})=>(d()("select( 'core/edit-post' ).openModal( name )",{since:"6.3",alternative:"select( 'core/interface').openModal( name )"}),t.dispatch(ee).openModal(e)),Qe=()=>({registry:e})=>(d()("select( 'core/edit-post' ).closeModal()",{since:"6.3",alternative:"select( 'core/interface').closeModal()"}),e.dispatch(ee).closeModal());function Xe(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function Je(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function et(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const tt=e=>({registry:t})=>{var n;const o=null!==(n=t.select(p.store).get("core/edit-post","inactivePanels"))&&void 0!==n?n:[];let a;a=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(p.store).set("core/edit-post","inactivePanels",a)},nt=e=>({registry:t})=>{var n;const o=null!==(n=t.select(p.store).get("core/edit-post","openPanels"))&&void 0!==n?n:[];let a;a=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(p.store).set("core/edit-post","openPanels",a)};function ot(e){return{type:"REMOVE_PANEL",panelName:e}}const at=e=>({registry:t})=>t.dispatch(p.store).toggle("core/edit-post",e),rt=e=>({registry:t})=>{t.dispatch(p.store).set("core/edit-post","editorMode",e),"visual"!==e&&t.dispatch(E.store).clearSelectedBlock();const n="visual"===e?(0,b.__)("Visual editor selected"):(0,b.__)("Code editor selected");(0,qe.speak)(n,"assertive")},lt=e=>({registry:t})=>{const n=t.select(ee).isItemPinned("core/edit-post",e);t.dispatch(ee)[n?"unpinItem":"pinItem"]("core/edit-post",e)},st=(e,t)=>({registry:n})=>{var o;if(!e)return;const a=null!==(o=n.select(p.store).get("core/edit-post","preferredStyleVariations"))&&void 0!==o?o:{};if(t)n.dispatch(p.store).set("core/edit-post","preferredStyleVariations",{...a,[e]:t});else{const t={...a};delete t[e],n.dispatch(p.store).set("core/edit-post","preferredStyleVariations",t)}},it=e=>({registry:t})=>{var n;const o=(null!==(n=t.select(p.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==n?n:[]).filter((t=>!(Array.isArray(e)?e:[e]).includes(t)));t.dispatch(p.store).set("core/edit-post","hiddenBlockTypes",o)},ct=e=>({registry:t})=>{var n;const o=null!==(n=t.select(p.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==n?n:[],a=new Set([...o,...Array.isArray(e)?e:[e]]);t.dispatch(p.store).set("core/edit-post","hiddenBlockTypes",[...a])};function dt(e){return{type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e}}const ut=()=>async({registry:e,select:t,dispatch:n})=>{n({type:"REQUEST_META_BOX_UPDATES"}),window.tinyMCE&&window.tinyMCE.triggerSave();const o=e.select(S.store).getCurrentPost(),a=[!!o.comment_status&&["comment_status",o.comment_status],!!o.ping_status&&["ping_status",o.ping_status],!!o.sticky&&["sticky",o.sticky],!!o.author&&["post_author",o.author]].filter(Boolean),r=[new window.FormData(document.querySelector(".metabox-base-form")),...t.getActiveMetaBoxLocations().map((e=>new window.FormData((e=>{const t=document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`);return t||document.querySelector("#metaboxes .metabox-location-"+e)})(e))))].reduce(((e,t)=>{for(const[n,o]of t)e.append(n,o);return e}),new window.FormData);a.forEach((([e,t])=>r.append(e,t)));try{await We()({url:window._wpMetaBoxUrl,method:"POST",body:r,parse:!1}),n.metaBoxUpdatesSuccess()}catch{n.metaBoxUpdatesFailure()}};function mt(){return{type:"META_BOX_UPDATES_SUCCESS"}}function pt(){return{type:"META_BOX_UPDATES_FAILURE"}}function gt(e){return{type:"SET_PREVIEW_DEVICE_TYPE",deviceType:e}}function ht(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function _t(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}function Et(e){return{type:"SET_IS_EDITING_TEMPLATE",value:e}}const bt=(e=!1)=>({registry:t,select:n,dispatch:o})=>{o(Et(!0));if(!n.isFeatureActive("welcomeGuideTemplate")){const n=e?(0,b.__)("Custom template created. You're in template mode now."):(0,b.__)("Editing template. Changes made here affect all posts and pages that use the template.");t.dispatch(x.store).createSuccessNotice(n,{type:"snackbar"})}},ft=e=>async({registry:t})=>{const n=await t.dispatch(w.store).saveEntityRecord("postType","wp_template",e),o=t.select(S.store).getCurrentPost();t.dispatch(w.store).editEntityRecord("postType",o.type,o.id,{template:n.slug})};let vt=!1;const yt=()=>({registry:e,select:t,dispatch:n})=>{if(!e.select(S.store).__unstableIsEditorReady())return;if(vt)return;const o=e.select(S.store).getCurrentPostType();window.postboxes.page!==o&&window.postboxes.add_postbox_toggles(o),vt=!0;let a=e.select(S.store).isSavingPost(),r=e.select(S.store).isAutosavingPost();e.subscribe((async()=>{const o=e.select(S.store).isSavingPost(),l=e.select(S.store).isAutosavingPost(),s=a&&!r&&!o&&t.hasMetaBoxes();a=o,r=l,s&&await n.requestMetaBoxUpdates()})),n({type:"META_BOXES_INITIALIZED"})};var wt={};function St(e){return[e]}function kt(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function Pt(e,t){var n,o=t||St;function a(){n=new WeakMap}function r(){var t,a,r,l,s,i=arguments.length;for(l=new Array(i),r=0;r<i;r++)l[r]=arguments[r];for(t=function(e){var t,o,a,r,l,s=n,i=!0;for(t=0;t<e.length;t++){if(!(l=o=e[t])||"object"!=typeof l){i=!1;break}s.has(o)?s=s.get(o):(a=new WeakMap,s.set(o,a),s=a)}return s.has(wt)||((r=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=i,s.set(wt,r)),s.get(wt)}(s=o.apply(null,l)),t.isUniqueByDependants||(t.lastDependants&&!kt(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),a=t.head;a;){if(kt(a.args,l,1))return a!==t.head&&(a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=t.head,a.prev=null,t.head.prev=a,t.head=a),a.val;a=a.next}return a={val:e.apply(null,l)},l[0]=null,a.args=l,t.head&&(t.head.prev=a,a.next=t.head),t.head=a,a.val}return r.getDependants=o,r.clear=a,a(),r}const Ct=[],Tt={},xt=(0,u.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(p.store).get("core/edit-post","editorMode"))&&void 0!==t?t:"visual"})),Mt=(0,u.createRegistrySelector)((e=>()=>{const t=e(ee).getActiveComplementaryArea("core/edit-post");return["edit-post/document","edit-post/block"].includes(t)})),Bt=(0,u.createRegistrySelector)((e=>()=>{const t=e(ee).getActiveComplementaryArea("core/edit-post");return!!t&&!["edit-post/document","edit-post/block"].includes(t)})),It=(0,u.createRegistrySelector)((e=>()=>e(ee).getActiveComplementaryArea("core/edit-post")));const Lt=(0,u.createRegistrySelector)((e=>()=>{d()("select( 'core/edit-post' ).getPreferences",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const t=["hiddenBlockTypes","editorMode","preferredStyleVariations"].reduce(((t,n)=>({...t,[n]:e(p.store).get("core/edit-post",n)})),{}),n=function(e,t){var n;const o=e?.reduce(((e,t)=>({...e,[t]:{enabled:!1}})),{}),a=t?.reduce(((e,t)=>{const n=e?.[t];return{...e,[t]:{...n,opened:!0}}}),null!=o?o:{});return null!==(n=null!=a?a:o)&&void 0!==n?n:Tt}(e(p.store).get("core/edit-post","inactivePanels"),e(p.store).get("core/edit-post","openPanels"));return{...t,panels:n}}));function Nt(e,t,n){d()("select( 'core/edit-post' ).getPreference",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const o=Lt(e)[t];return void 0===o?n:o}const At=(0,u.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(p.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==t?t:Ct}));function Dt(e){return e.publishSidebarActive}function Vt(e,t){return e.removedPanels.includes(t)}const Ot=(0,u.createRegistrySelector)((e=>(t,n)=>{const o=e(p.store).get("core/edit-post","inactivePanels");return!Vt(t,n)&&!o?.includes(n)})),Rt=(0,u.createRegistrySelector)((e=>(t,n)=>{const o=e(p.store).get("core/edit-post","openPanels");return!!o?.includes(n)})),Ft=(0,u.createRegistrySelector)((e=>(t,n)=>(d()("select( 'core/edit-post' ).isModalActive",{since:"6.3",alternative:"select( 'core/interface' ).isModalActive"}),!!e(ee).isModalActive(n)))),Ht=(0,u.createRegistrySelector)((e=>(t,n)=>!!e(p.store).get("core/edit-post",n))),Gt=(0,u.createRegistrySelector)((e=>(t,n)=>e(ee).isItemPinned("core/edit-post",n))),Ut=Pt((e=>Object.keys(e.metaBoxes.locations).filter((t=>Zt(e,t)))),(e=>[e.metaBoxes.locations]));function zt(e,t){return Zt(e,t)&&$t(e,t)?.some((({id:t})=>Ot(e,`meta-box-${t}`)))}function Zt(e,t){const n=$t(e,t);return!!n&&0!==n.length}function $t(e,t){return e.metaBoxes.locations[t]}const Wt=Pt((e=>Object.values(e.metaBoxes.locations).flat()),(e=>[e.metaBoxes.locations]));function qt(e){return Ut(e).length>0}function jt(e){return e.metaBoxes.isSaving}function Kt(e){return e.deviceType}function Yt(e){return!!e.blockInserterPanel}function Qt(e){const{rootClientId:t,insertionIndex:n,filterValue:o}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:n,filterValue:o}}function Xt(e){return e.listViewPanel}function Jt(e){return e.isEditingTemplate}function en(e){return e.metaBoxes.initialized}const tn=(0,u.createRegistrySelector)((e=>()=>{const t=e(S.store).getEditedPostAttribute("template");if(t){const n=e(w.store).getEntityRecords("postType","wp_template",{per_page:-1})?.find((e=>e.slug===t));return n?e(w.store).getEditedEntityRecord("postType","wp_template",n.id):n}const n=e(S.store).getCurrentPost();return n.link?e(w.store).__experimentalGetTemplateForLink(n.link):null})),nn="core/edit-post",on=(0,u.createReduxStore)(nn,{reducer:Ze,actions:a,selectors:r});function an(){const e=(0,u.useSelect)((e=>e(on).isEditingTemplate()),[]);return(0,l.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:e?"welcomeGuideTemplate":"welcomeGuide",label:(0,b.__)("Welcome Guide")})}function rn(){const e=(0,u.useSelect)((e=>{const{canUser:t}=e(w.store),{getEditorSettings:n}=e(S.store),o=n().__unstableIsBlockBasedTheme,a=(0,T.addQueryArgs)("edit.php",{post_type:"wp_block"}),r=(0,T.addQueryArgs)("site-editor.php",{path:"/patterns"});return t("read","templates")&&o?r:a}),[]);return(0,l.createElement)(_.MenuItem,{role:"menuitem",href:e},(0,b.__)("Manage patterns"))}(0,u.register)(on),(0,C.registerPlugin)("edit-post",{render(){return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(Ge,null,(({onClose:e})=>(0,l.createElement)(l.Fragment,null,(0,l.createElement)(rn,null),(0,l.createElement)(Re,{onSelect:e}),(0,l.createElement)(an,null),(0,l.createElement)(M,null),(0,l.createElement)(_.MenuItem,{role:"menuitem",icon:P,href:(0,b.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,b.__)("Help"),(0,l.createElement)(_.VisuallyHidden,{as:"span"},(0,b.__)("(opens in a new tab)")))))))}});var ln=window.wp.commands,sn=window.wp.coreCommands;function cn(){const e=(0,u.useSelect)((e=>e(S.store).getEditorSettings().richEditingEnabled),[]),{switchEditorMode:t}=(0,u.useDispatch)(on);return(0,l.createElement)("div",{className:"edit-post-text-editor"},(0,l.createElement)(S.TextEditorGlobalKeyboardShortcuts,null),e&&(0,l.createElement)("div",{className:"edit-post-text-editor__toolbar"},(0,l.createElement)("h2",null,(0,b.__)("Editing code")),(0,l.createElement)(_.Button,{variant:"tertiary",onClick:()=>t("visual"),shortcut:B.displayShortcut.secondary("m")},(0,b.__)("Exit code editor"))),(0,l.createElement)("div",{className:"edit-post-text-editor__body"},(0,l.createElement)(S.PostTitle,null),(0,l.createElement)(S.PostTextEditor,null)))}var dn=window.wp.privateApis;const{lock:un,unlock:mn}=(0,dn.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/edit-post"),{LayoutStyle:pn,useLayoutClasses:gn,useLayoutStyles:hn}=mn(E.privateApis),_n=!1;function En({children:e,contentRef:t,shouldIframe:n,styles:o,style:a}){const r=(0,E.__unstableUseMouseMoveTypingReset)();return n?(0,l.createElement)(E.__unstableIframe,{ref:r,contentRef:t,style:{width:"100%",height:"100%",display:"block"},name:"editor-canvas"},(0,l.createElement)(E.__unstableEditorStyles,{styles:o}),e):(0,l.createElement)(l.Fragment,null,(0,l.createElement)(E.__unstableEditorStyles,{styles:o}),(0,l.createElement)(E.WritingFlow,{ref:t,className:"editor-styles-wrapper",style:{flex:"1",...a},tabIndex:-1},e))}function bn(e){for(let t=0;t<e.length;t++){if("core/post-content"===e[t].name)return e[t].attributes;if(e[t].innerBlocks.length){const n=bn(e[t].innerBlocks);if(n)return n}}}function fn({styles:e}){const{deviceType:t,isWelcomeGuideVisible:n,isTemplateMode:o,postContentAttributes:a,editedPostTemplate:r={},wrapperBlockName:i,wrapperUniqueId:c,isBlockBasedTheme:d,hasV3BlocksOnly:m}=(0,u.useSelect)((e=>{const{isFeatureActive:t,isEditingTemplate:n,getEditedPostTemplate:o,__experimentalGetPreviewDeviceType:a}=e(on),{getCurrentPostId:r,getCurrentPostType:l,getEditorSettings:i}=e(S.store),{getBlockTypes:c}=e(s.store),d=n();let u;"wp_block"===l()?u="core/block":d||(u="core/post-content");const m=i(),p=m.supportsTemplateMode,g=e(w.store).canUser("create","templates");return{deviceType:a(),isWelcomeGuideVisible:t("welcomeGuide"),isTemplateMode:d,postContentAttributes:i().postContentAttributes,editedPostTemplate:p&&g?o():void 0,wrapperBlockName:u,wrapperUniqueId:r(),isBlockBasedTheme:m.__unstableIsBlockBasedTheme,hasV3BlocksOnly:c().every((e=>e.apiVersion>=3))}}),[]),{isCleanNewPost:p}=(0,u.useSelect)(S.store),g=(0,u.useSelect)((e=>e(on).hasMetaBoxes()),[]),{hasRootPaddingAwareAlignments:h,isFocusMode:b,themeHasDisabledLayoutStyles:v,themeSupportsLayout:y}=(0,u.useSelect)((e=>{const t=e(E.store).getSettings();return{themeHasDisabledLayoutStyles:t.disableLayoutStyles,themeSupportsLayout:t.supportsLayout,isFocusMode:t.focusMode,hasRootPaddingAwareAlignments:t.__experimentalFeatures?.useRootPaddingAwareAlignments}}),[]),k={height:"100%",width:"100%",margin:0,display:"flex",flexFlow:"column",background:"white"},P={...k,borderRadius:"2px 2px 0 0",border:"1px solid #ddd",borderBottom:0},C=(0,E.__experimentalUseResizeCanvas)(t,o),T=(0,E.useSetting)("layout"),x="is-"+t.toLowerCase()+"-preview";let M,B=o?P:k;C&&(B=C),g||C||o||(M="40vh");const I=(0,l.useRef)(),N=(0,f.useMergeRefs)([I,(0,E.__unstableUseClipboardHandler)(),(0,E.__unstableUseTypewriter)(),(0,E.__unstableUseTypingObserver)(),(0,E.__unstableUseBlockSelectionClearer)()]),A=(0,E.__unstableUseBlockSelectionClearer)(),D=(0,l.useMemo)((()=>o?{type:"default"}:y?{...T,type:"constrained"}:{type:"default"}),[o,y,T]),V=(0,l.useMemo)((()=>{if(!r?.content&&!r?.blocks)return a;if(r?.blocks)return bn(r?.blocks);const e="string"==typeof r?.content?r?.content:"";return bn((0,s.parse)(e))||{}}),[r?.content,r?.blocks,a]),{layout:O={},align:R=""}=V||{},F=gn(V,"core/post-content"),H=L()({"is-layout-flow":!y},y&&F,R&&`align${R}`),G=hn(V,"core/post-content",".block-editor-block-list__layout.is-root-container"),U=(0,l.useMemo)((()=>O&&("constrained"===O?.type||O?.inherit||O?.contentSize||O?.wideSize)?{...T,...O,type:"constrained"}:{...T,...O,type:"default"}),[O?.type,O?.inherit,O?.contentSize,O?.wideSize,T]),z=a?U:D,Z=(0,l.useRef)();(0,l.useEffect)((()=>{!n&&p()&&Z?.current?.focus()}),[n,p]),e=(0,l.useMemo)((()=>[...e,{css:".edit-post-visual-editor__post-title-wrapper{margin-top:4rem}"+(M?`body{padding-bottom:${M}}`:"")}]),[e]);return(0,l.createElement)(E.BlockTools,{__unstableContentRef:I,className:L()("edit-post-visual-editor",{"is-template-mode":o})},(0,l.createElement)(S.VisualEditorGlobalKeyboardShortcuts,null),(0,l.createElement)(_.__unstableMotion.div,{className:"edit-post-visual-editor__content-area",animate:{padding:o?"48px 48px 0":0},ref:A},(0,l.createElement)(_.__unstableMotion.div,{animate:B,initial:k,className:x},(0,l.createElement)(En,{shouldIframe:(m||_n&&d)&&!g||o||"Tablet"===t||"Mobile"===t,contentRef:N,styles:e},y&&!v&&!o&&(0,l.createElement)(l.Fragment,null,(0,l.createElement)(pn,{selector:".edit-post-visual-editor__post-title-wrapper",layout:D}),(0,l.createElement)(pn,{selector:".block-editor-block-list__layout.is-root-container",layout:z}),R&&(0,l.createElement)(pn,{css:".is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}"}),G&&(0,l.createElement)(pn,{layout:U,css:G})),!o&&(0,l.createElement)("div",{className:L()("edit-post-visual-editor__post-title-wrapper",{"is-focus-mode":b,"has-global-padding":h}),contentEditable:!1},(0,l.createElement)(S.PostTitle,{ref:Z})),(0,l.createElement)(E.__experimentalRecursionProvider,{blockName:i,uniqueId:c},(0,l.createElement)(E.BlockList,{className:o?"wp-site-blocks":`${H} wp-block-post-content`,layout:z}))))))}var vn=function(){const{getBlockSelectionStart:e}=(0,u.useSelect)(E.store),{getEditorMode:t,isEditorSidebarOpened:n,isListViewOpened:o,isFeatureActive:a}=(0,u.useSelect)(on),r=(0,u.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:n}=e(S.store).getEditorSettings();return!t||!n}),[]),{createInfoNotice:i}=(0,u.useDispatch)(x.store),{switchEditorMode:c,openGeneralSidebar:d,closeGeneralSidebar:m,toggleFeature:g,setIsListViewOpened:h,setIsInserterOpened:_}=(0,u.useDispatch)(on),{registerShortcut:f}=(0,u.useDispatch)(xe.store),{set:v}=(0,u.useDispatch)(p.store),{replaceBlocks:y}=(0,u.useDispatch)(E.store),{getBlockName:w,getSelectedBlockClientId:k,getBlockAttributes:P}=(0,u.useSelect)(E.store),C=(e,t)=>{e.preventDefault();const n=0===t?"core/paragraph":"core/heading",o=k();if(null===o)return;const a=w(o);if("core/paragraph"!==a&&"core/heading"!==a)return;const r=P(o),l="core/paragraph"===a?"align":"textAlign",i="core/paragraph"===n?"align":"textAlign";y(o,(0,s.createBlock)(n,{level:t,content:r.content,[i]:r[l]}))};return(0,l.useEffect)((()=>{f({name:"core/edit-post/toggle-mode",category:"global",description:(0,b.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),f({name:"core/edit-post/toggle-distraction-free",category:"global",description:(0,b.__)("Toggle distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),f({name:"core/edit-post/toggle-fullscreen",category:"global",description:(0,b.__)("Toggle fullscreen mode."),keyCombination:{modifier:"secondary",character:"f"}}),f({name:"core/edit-post/toggle-list-view",category:"global",description:(0,b.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}}),f({name:"core/edit-post/toggle-sidebar",category:"global",description:(0,b.__)("Show or hide the Settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),f({name:"core/edit-post/next-region",category:"global",description:(0,b.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),f({name:"core/edit-post/previous-region",category:"global",description:(0,b.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]}),f({name:"core/edit-post/keyboard-shortcuts",category:"main",description:(0,b.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),f({name:"core/edit-post/transform-heading-to-paragraph",category:"block-library",description:(0,b.__)("Transform heading to paragraph."),keyCombination:{modifier:"access",character:"0"}}),[1,2,3,4,5,6].forEach((e=>{f({name:`core/edit-post/transform-paragraph-to-heading-${e}`,category:"block-library",description:(0,b.__)("Transform paragraph to heading."),keyCombination:{modifier:"access",character:`${e}`}})}))}),[]),(0,xe.useShortcut)("core/edit-post/toggle-mode",(()=>{c("visual"===t()?"text":"visual")}),{isDisabled:r}),(0,xe.useShortcut)("core/edit-post/toggle-fullscreen",(()=>{g("fullscreenMode")})),(0,xe.useShortcut)("core/edit-post/toggle-distraction-free",(()=>{v("core/edit-post","fixedToolbar",!1),_(!1),h(!1),m(),g("distractionFree"),i(a("distractionFree")?(0,b.__)("Distraction free mode turned on."):(0,b.__)("Distraction free mode turned off."),{id:"core/edit-post/distraction-free-mode/notice",type:"snackbar"})})),(0,xe.useShortcut)("core/edit-post/toggle-sidebar",(t=>{if(t.preventDefault(),n())m();else{const t=e()?"edit-post/block":"edit-post/document";d(t)}})),(0,xe.useShortcut)("core/edit-post/toggle-list-view",(()=>{o()||h(!0)})),(0,xe.useShortcut)("core/edit-post/transform-heading-to-paragraph",(e=>C(e,0))),[1,2,3,4,5,6].forEach((e=>{(0,xe.useShortcut)(`core/edit-post/transform-paragraph-to-heading-${e}`,(t=>C(t,e)))})),null};function yn({willEnable:e}){const[t,n]=(0,l.useState)(!1);return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("p",{className:"edit-post-preferences-modal__custom-fields-confirmation-message"},(0,b.__)("A page reload is required for this change. Make sure your content is saved before reloading.")),(0,l.createElement)(_.Button,{className:"edit-post-preferences-modal__custom-fields-confirmation-button",variant:"secondary",isBusy:t,disabled:t,onClick:()=>{n(!0),document.getElementById("toggle-custom-fields-form").submit()}},e?(0,b.__)("Show & Reload Page"):(0,b.__)("Hide & Reload Page")))}var wn=(0,u.withSelect)((e=>({areCustomFieldsEnabled:!!e(S.store).getEditorSettings().enableCustomFields})))((function({label:e,areCustomFieldsEnabled:t}){const[n,o]=(0,l.useState)(t);return(0,l.createElement)(Te,{label:e,isChecked:n,onChange:o},n!==t&&(0,l.createElement)(yn,{willEnable:n}))})),Sn=(0,f.compose)((0,u.withSelect)(((e,{panelName:t})=>{const{isEditorPanelEnabled:n,isEditorPanelRemoved:o}=e(on);return{isRemoved:o(t),isChecked:n(t)}})),(0,f.ifCondition)((({isRemoved:e})=>!e)),(0,u.withDispatch)(((e,{panelName:t})=>({onChange:()=>e(on).toggleEditorPanelEnabled(t)}))))(Te);const{Fill:kn,Slot:Pn}=(0,_.createSlotFill)("EnablePluginDocumentSettingPanelOption"),Cn=({label:e,panelName:t})=>(0,l.createElement)(kn,null,(0,l.createElement)(Sn,{label:e,panelName:t}));Cn.Slot=Pn;var Tn=Cn,xn=(0,f.compose)((0,u.withSelect)((e=>({isChecked:e(S.store).isPublishSidebarEnabled()}))),(0,u.withDispatch)((e=>{const{enablePublishSidebar:t,disablePublishSidebar:n}=e(S.store);return{onChange:e=>e?t():n()}})),(0,V.ifViewportMatches)("medium"))(Te),Mn=(0,f.compose)((0,u.withSelect)(((e,{featureName:t})=>{const{isFeatureActive:n}=e(on);return{isChecked:n(t)}})),(0,u.withDispatch)(((e,{featureName:t,onToggle:n=(()=>{})})=>({onChange:()=>{n(),e(on).toggleFeature(t)}}))))(Te);var Bn=(0,u.withSelect)((e=>{const{getEditorSettings:t}=e(S.store),{getAllMetaBoxes:n}=e(on);return{areCustomFieldsRegistered:void 0!==t().enableCustomFields,metaBoxes:n()}}))((function({areCustomFieldsRegistered:e,metaBoxes:t,...n}){const o=t.filter((({id:e})=>"postcustom"!==e));return e||0!==o.length?(0,l.createElement)(Ce,{...n},e&&(0,l.createElement)(wn,{label:(0,b.__)("Custom fields")}),o.map((({id:e,title:t})=>(0,l.createElement)(Sn,{key:e,label:t,panelName:`meta-box-${e}`})))):null}));var In=function({blockTypes:e,value:t,onItemChange:n}){return(0,l.createElement)("ul",{className:"edit-post-block-manager__checklist"},e.map((e=>(0,l.createElement)("li",{key:e.name,className:"edit-post-block-manager__checklist-item"},(0,l.createElement)(_.CheckboxControl,{__nextHasNoMarginBottom:!0,label:e.title,checked:t.includes(e.name),onChange:(...t)=>n(e.name,...t)}),(0,l.createElement)(E.BlockIcon,{icon:e.icon})))))};var Ln=function e({title:t,blockTypes:n}){const o=(0,f.useInstanceId)(e),{defaultAllowedBlockTypes:a,hiddenBlockTypes:r}=(0,u.useSelect)((e=>{const{getEditorSettings:t}=e(S.store),{getHiddenBlockTypes:n}=e(on);return{defaultAllowedBlockTypes:t().defaultAllowedBlockTypes,hiddenBlockTypes:n()}}),[]),s=(0,l.useMemo)((()=>!0===a?n:n.filter((({name:e})=>a?.includes(e)))),[a,n]),{showBlockTypes:i,hideBlockTypes:c}=(0,u.useDispatch)(on),d=(0,l.useCallback)(((e,t)=>{t?i(e):c(e)}),[]),m=(0,l.useCallback)((e=>{const t=n.map((({name:e})=>e));e?i(t):c(t)}),[n]);if(!s.length)return null;const p=s.map((({name:e})=>e)).filter((e=>!r.includes(e))),g="edit-post-block-manager__category-title-"+o,h=p.length===s.length,E=!h&&p.length>0;return(0,l.createElement)("div",{role:"group","aria-labelledby":g,className:"edit-post-block-manager__category"},(0,l.createElement)(_.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:h,onChange:m,className:"edit-post-block-manager__category-title",indeterminate:E,label:(0,l.createElement)("span",{id:g},t)}),(0,l.createElement)(In,{blockTypes:s,value:p,onItemChange:d}))};var Nn=(0,f.compose)([(0,u.withSelect)((e=>{const{getBlockTypes:t,getCategories:n,hasBlockSupport:o,isMatchingSearchTerm:a}=e(s.store),{getHiddenBlockTypes:r}=e(on),l=t(),i=r().filter((e=>l.some((t=>t.name===e)))),c=Array.isArray(i)&&i.length;return{blockTypes:l,categories:n(),hasBlockSupport:o,isMatchingSearchTerm:a,numberOfHiddenBlocks:c}})),(0,u.withDispatch)((e=>{const{showBlockTypes:t}=e(on);return{enableAllBlockTypes:e=>{const n=e.map((({name:e})=>e));t(n)}}}))])((function({blockTypes:e,categories:t,hasBlockSupport:n,isMatchingSearchTerm:o,numberOfHiddenBlocks:a,enableAllBlockTypes:r}){const s=(0,f.useDebounce)(qe.speak,500),[i,c]=(0,l.useState)("");return e=e.filter((e=>n(e,"inserter",!0)&&(!i||o(e,i))&&(!e.parent||e.parent.includes("core/post-content")))),(0,l.useEffect)((()=>{if(!i)return;const t=e.length,n=(0,b.sprintf)((0,b._n)("%d result found.","%d results found.",t),t);s(n)}),[e.length,i,s]),(0,l.createElement)("div",{className:"edit-post-block-manager__content"},!!a&&(0,l.createElement)("div",{className:"edit-post-block-manager__disabled-blocks-count"},(0,b.sprintf)((0,b._n)("%d block is hidden.","%d blocks are hidden.",a),a),(0,l.createElement)(_.Button,{variant:"link",onClick:()=>r(e)},(0,b.__)("Reset"))),(0,l.createElement)(_.SearchControl,{__nextHasNoMarginBottom:!0,label:(0,b.__)("Search for a block"),placeholder:(0,b.__)("Search for a block"),value:i,onChange:e=>c(e),className:"edit-post-block-manager__search"}),(0,l.createElement)("div",{tabIndex:"0",role:"region","aria-label":(0,b.__)("Available block types"),className:"edit-post-block-manager__results"},0===e.length&&(0,l.createElement)("p",{className:"edit-post-block-manager__no-results"},(0,b.__)("No blocks found.")),t.map((t=>(0,l.createElement)(Ln,{key:t.slug,title:t.title,blockTypes:e.filter((e=>e.category===t.slug))}))),(0,l.createElement)(Ln,{title:(0,b.__)("Uncategorized"),blockTypes:e.filter((({category:e})=>!e))})))}));const An="edit-post/preferences";function Dn(){const e=(0,f.useViewportMatch)("medium"),{closeModal:t}=(0,u.useDispatch)(ee),[n,o]=(0,u.useSelect)((t=>{const{getEditorSettings:n}=t(S.store),{getEditorMode:o,isFeatureActive:a}=t(on),r=t(ee).isModalActive(An),l=o(),s=n().richEditingEnabled,i=a("distractionFree");return[r,!i&&e&&s&&"visual"===l,i]}),[e]),{closeGeneralSidebar:a,setIsListViewOpened:r,setIsInserterOpened:s}=(0,u.useDispatch)(on),{set:i}=(0,u.useDispatch)(p.store),c=()=>{i("core/edit-post","fixedToolbar",!1),s(!1),r(!1),a()},d=(0,l.useMemo)((()=>[{name:"general",tabLabel:(0,b.__)("General"),content:(0,l.createElement)(l.Fragment,null,e&&(0,l.createElement)(Ce,{title:(0,b.__)("Publishing"),description:(0,b.__)("Change options related to publishing.")},(0,l.createElement)(xn,{help:(0,b.__)("Review settings, such as visibility and tags."),label:(0,b.__)("Include pre-publish checklist")})),(0,l.createElement)(Ce,{title:(0,b.__)("Appearance"),description:(0,b.__)("Customize options related to the block editor interface and editing flow.")},(0,l.createElement)(Mn,{featureName:"distractionFree",onToggle:c,help:(0,b.__)("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:(0,b.__)("Distraction free")}),(0,l.createElement)(Mn,{featureName:"focusMode",help:(0,b.__)("Highlights the current block and fades other content."),label:(0,b.__)("Spotlight mode")}),(0,l.createElement)(Mn,{featureName:"showIconLabels",label:(0,b.__)("Show button text labels"),help:(0,b.__)("Show text instead of icons on buttons.")}),(0,l.createElement)(Mn,{featureName:"showListViewByDefault",help:(0,b.__)("Opens the block list view sidebar by default."),label:(0,b.__)("Always open list view")}),(0,l.createElement)(Mn,{featureName:"themeStyles",help:(0,b.__)("Make the editor look like your theme."),label:(0,b.__)("Use theme styles")}),o&&(0,l.createElement)(Mn,{featureName:"showBlockBreadcrumbs",help:(0,b.__)("Shows block breadcrumbs at the bottom of the editor."),label:(0,b.__)("Display block breadcrumbs")})))},{name:"blocks",tabLabel:(0,b.__)("Blocks"),content:(0,l.createElement)(l.Fragment,null,(0,l.createElement)(Ce,{title:(0,b.__)("Block interactions"),description:(0,b.__)("Customize how you interact with blocks in the block library and editing canvas.")},(0,l.createElement)(Mn,{featureName:"mostUsedBlocks",help:(0,b.__)("Places the most frequent blocks in the block library."),label:(0,b.__)("Show most used blocks")}),(0,l.createElement)(Mn,{featureName:"keepCaretInsideBlock",help:(0,b.__)("Aids screen readers by stopping text caret from leaving blocks."),label:(0,b.__)("Contain text cursor inside block")})),(0,l.createElement)(Ce,{title:(0,b.__)("Visible blocks"),description:(0,b.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")},(0,l.createElement)(Nn,null)))},{name:"panels",tabLabel:(0,b.__)("Panels"),content:(0,l.createElement)(l.Fragment,null,(0,l.createElement)(Ce,{title:(0,b.__)("Document settings"),description:(0,b.__)("Choose what displays in the panel.")},(0,l.createElement)(Tn.Slot,null),(0,l.createElement)(S.PostTaxonomies,{taxonomyWrapper:(e,t)=>(0,l.createElement)(Sn,{label:t.labels.menu_name,panelName:`taxonomy-panel-${t.slug}`})}),(0,l.createElement)(S.PostFeaturedImageCheck,null,(0,l.createElement)(Sn,{label:(0,b.__)("Featured image"),panelName:"featured-image"})),(0,l.createElement)(S.PostExcerptCheck,null,(0,l.createElement)(Sn,{label:(0,b.__)("Excerpt"),panelName:"post-excerpt"})),(0,l.createElement)(S.PostTypeSupportCheck,{supportKeys:["comments","trackbacks"]},(0,l.createElement)(Sn,{label:(0,b.__)("Discussion"),panelName:"discussion-panel"})),(0,l.createElement)(S.PageAttributesCheck,null,(0,l.createElement)(Sn,{label:(0,b.__)("Page attributes"),panelName:"page-attributes"}))),(0,l.createElement)(Bn,{title:(0,b.__)("Additional"),description:(0,b.__)("Add extra areas to the editor.")}))}]),[e,o]);return n?(0,l.createElement)(ve,{closeModal:t},(0,l.createElement)(Pe,{sections:d})):null}class Vn extends l.Component{constructor(){super(...arguments),this.state={historyId:null}}componentDidUpdate(e){const{postId:t,postStatus:n,postType:o,isSavingPost:a}=this.props,{historyId:r}=this.state;"trash"!==n||a?t===e.postId&&t===r||"auto-draft"===n||!t||this.setBrowserURL(t):this.setTrashURL(t,o)}setTrashURL(e,t){window.location.href=function(e,t){return(0,T.addQueryArgs)("edit.php",{trashed:1,post_type:t,ids:e})}(e,t)}setBrowserURL(e){window.history.replaceState({id:e},"Post "+e,function(e){return(0,T.addQueryArgs)("post.php",{post:e,action:"edit"})}(e)),this.setState((()=>({historyId:e})))}render(){return null}}var On=(0,u.withSelect)((e=>{const{getCurrentPost:t,isSavingPost:n}=e(S.store),o=t();let{id:a,status:r,type:l}=o;return["wp_template","wp_template_part"].includes(l)&&(a=o.wp_id),{postId:a,postStatus:r,postType:l,isSavingPost:n()}}))(Vn);var Rn=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,l.createElement)(k.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 Fn=function({showTooltip:e,icon:t,href:n}){var o;const{isActive:a,isRequestingSiteIcon:r,postType:s,siteIconUrl:i}=(0,u.useSelect)((e=>{const{getCurrentPostType:t}=e(S.store),{isFeatureActive:n}=e(on),{getEntityRecord:o,getPostType:a,isResolving:r}=e(w.store),l=o("root","__unstableBase",void 0)||{};return{isActive:n("fullscreenMode"),isRequestingSiteIcon:r("getEntityRecord",["root","__unstableBase",void 0]),postType:a(t()),siteIconUrl:l.site_icon_url}}),[]),c=(0,f.useReducedMotion)();if(!a||!s)return null;let d=(0,l.createElement)(_.Icon,{size:"36px",icon:Rn});const m={expand:{scale:1.25,transition:{type:"tween",duration:"0.3"}}};i&&(d=(0,l.createElement)(_.__unstableMotion.img,{variants:!c&&m,alt:(0,b.__)("Site Icon"),className:"edit-post-fullscreen-mode-close_site-icon",src:i})),r&&(d=null),t&&(d=(0,l.createElement)(_.Icon,{size:"36px",icon:t}));const p=L()({"edit-post-fullscreen-mode-close":!0,"has-icon":i});return(0,l.createElement)(_.__unstableMotion.div,{whileHover:"expand"},(0,l.createElement)(_.Button,{className:p,href:null!=n?n:(0,T.addQueryArgs)("edit.php",{post_type:s.slug}),label:null!==(o=s?.labels?.view_items)&&void 0!==o?o:(0,b.__)("Back"),showTooltip:e},d))};var Hn=(0,l.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,l.createElement)(k.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"}));var Gn=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const{useShouldContextualToolbarShow:Un}=mn(E.privateApis),zn=e=>{e.preventDefault()};var Zn=function(){const e=(0,l.useRef)(),{setIsInserterOpened:t,setIsListViewOpened:n}=(0,u.useDispatch)(on),{get:o}=(0,u.useSelect)(p.store),a=o("core/edit-post","fixedToolbar"),{isInserterEnabled:r,isInserterOpened:s,isTextModeEnabled:i,showIconLabels:c,isListViewOpen:d,listViewShortcut:m}=(0,u.useSelect)((e=>{const{hasInserterItems:t,getBlockRootClientId:n,getBlockSelectionEnd:o}=e(E.store),{getEditorSettings:a}=e(S.store),{getEditorMode:r,isFeatureActive:l,isListViewOpened:s}=e(on),{getShortcutRepresentation:i}=e(xe.store);return{isInserterEnabled:"visual"===r()&&a().richEditingEnabled&&t(n(o())),isInserterOpened:e(on).isInserterOpened(),isTextModeEnabled:"text"===r(),showIconLabels:l("showIconLabels"),isListViewOpen:s(),listViewShortcut:i("core/edit-post/toggle-list-view")}}),[]),g=(0,f.useViewportMatch)("medium"),h=(0,f.useViewportMatch)("wide"),{shouldShowContextualToolbar:v,canFocusHiddenToolbar:y,fixedToolbarCanBeFocused:w}=Un(),k=v||y||w,P=(0,b.__)("Document tools"),C=(0,l.useCallback)((()=>n(!d)),[n,d]),T=(0,l.createElement)(l.Fragment,null,(0,l.createElement)(_.ToolbarItem,{as:_.Button,className:"edit-post-header-toolbar__document-overview-toggle",icon:Hn,disabled:i,isPressed:d,label:(0,b.__)("Document Overview"),onClick:C,shortcut:m,showTooltip:!c,variant:c?"tertiary":void 0})),x=(0,l.useCallback)((()=>{s?(e.current.focus(),t(!1)):t(!0)}),[s,t]),M=(0,b._x)("Toggle block inserter","Generic label for block inserter button"),B=s?(0,b.__)("Close"):(0,b.__)("Add");return(0,l.createElement)(E.NavigableToolbar,{className:"edit-post-header-toolbar","aria-label":P,shouldUseKeyboardFocusShortcut:!k},(0,l.createElement)("div",{className:"edit-post-header-toolbar__left"},(0,l.createElement)(_.ToolbarItem,{ref:e,as:_.Button,className:"edit-post-header-toolbar__inserter-toggle",variant:"primary",isPressed:s,onMouseDown:zn,onClick:x,disabled:!r,icon:Gn,label:c?B:M,showTooltip:!c}),(h||!c)&&(0,l.createElement)(l.Fragment,null,g&&!a&&(0,l.createElement)(_.ToolbarItem,{as:E.ToolSelector,showTooltip:!c,variant:c?"tertiary":void 0,disabled:i}),(0,l.createElement)(_.ToolbarItem,{as:S.EditorHistoryUndo,showTooltip:!c,variant:c?"tertiary":void 0}),(0,l.createElement)(_.ToolbarItem,{as:S.EditorHistoryRedo,showTooltip:!c,variant:c?"tertiary":void 0}),T)))};const $n=[{value:"visual",label:(0,b.__)("Visual editor")},{value:"text",label:(0,b.__)("Code editor")}];var Wn=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:n,isEditingTemplate:o,mode:a}=(0,u.useSelect)((e=>({shortcut:e(xe.store).getShortcutRepresentation("core/edit-post/toggle-mode"),isRichEditingEnabled:e(S.store).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(S.store).getEditorSettings().codeEditingEnabled,isEditingTemplate:e(on).isEditingTemplate(),mode:e(on).getEditorMode()})),[]),{switchEditorMode:r}=(0,u.useDispatch)(on);if(o)return null;if(!t||!n)return null;const s=$n.map((t=>t.value!==a?{...t,shortcut:e}:t));return(0,l.createElement)(_.MenuGroup,{label:(0,b.__)("Editor")},(0,l.createElement)(_.MenuItemsChoice,{choices:s,value:a,onSelect:r}))};function qn(){const{openModal:e}=(0,u.useDispatch)(ee);return(0,l.createElement)(_.MenuItem,{onClick:()=>{e(An)}},(0,b.__)("Preferences"))}var jn=function(){const e=(0,u.useRegistry)(),t=(0,u.useSelect)((e=>e(E.store).getSettings().isDistractionFree),[]),{setIsInserterOpened:n,setIsListViewOpened:o,closeGeneralSidebar:a}=(0,u.useDispatch)(on),{set:r}=(0,u.useDispatch)(p.store);return(0,f.useViewportMatch)("medium")?(0,l.createElement)(_.MenuGroup,{label:(0,b._x)("View","noun")},(0,l.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",disabled:t,name:"fixedToolbar",label:(0,b.__)("Top toolbar"),info:(0,b.__)("Access all block and document tools in a single place"),messageActivated:(0,b.__)("Top toolbar activated"),messageDeactivated:(0,b.__)("Top toolbar deactivated")}),(0,l.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"focusMode",label:(0,b.__)("Spotlight mode"),info:(0,b.__)("Focus on one block at a time"),messageActivated:(0,b.__)("Spotlight mode activated"),messageDeactivated:(0,b.__)("Spotlight mode deactivated")}),(0,l.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fullscreenMode",label:(0,b.__)("Fullscreen mode"),info:(0,b.__)("Show and hide admin UI"),messageActivated:(0,b.__)("Fullscreen mode activated"),messageDeactivated:(0,b.__)("Fullscreen mode deactivated"),shortcut:B.displayShortcut.secondary("f")}),(0,l.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"distractionFree",onToggle:()=>{e.batch((()=>{r("core/edit-post","fixedToolbar",!1),n(!1),o(!1),a()}))},label:(0,b.__)("Distraction free"),info:(0,b.__)("Write with calmness"),messageActivated:(0,b.__)("Distraction free mode activated"),messageDeactivated:(0,b.__)("Distraction free mode deactivated"),shortcut:B.displayShortcut.primaryShift("\\")})):null};var Kn=({showIconLabels:e})=>{const t=(0,f.useViewportMatch)("large");return(0,l.createElement)(fe,{toggleProps:{showTooltip:!e,...e&&{variant:"tertiary"}}},(({onClose:n})=>(0,l.createElement)(l.Fragment,null,e&&!t&&(0,l.createElement)(de.Slot,{className:e&&"show-icon-labels",scope:"core/edit-post"}),(0,l.createElement)(jn,null),(0,l.createElement)(Wn,null),(0,l.createElement)(le.Slot,{name:"core/edit-post/plugin-more-menu",label:(0,b.__)("Plugins"),as:_.MenuGroup,fillProps:{onClick:n}}),(0,l.createElement)(Ge.Slot,{fillProps:{onClose:n}}),(0,l.createElement)(_.MenuGroup,null,(0,l.createElement)(qn,null)))))};var Yn=(0,f.compose)((0,u.withSelect)((e=>{var t;return{hasPublishAction:null!==(t=e(S.store).getCurrentPost()?._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:e(S.store).isEditedPostBeingScheduled(),isPending:e(S.store).isCurrentPostPending(),isPublished:e(S.store).isCurrentPostPublished(),isPublishSidebarEnabled:e(S.store).isPublishSidebarEnabled(),isPublishSidebarOpened:e(on).isPublishSidebarOpened(),isScheduled:e(S.store).isCurrentPostScheduled()}})),(0,u.withDispatch)((e=>{const{togglePublishSidebar:t}=e(on);return{togglePublishSidebar:t}})))((function({forceIsDirty:e,forceIsSaving:t,hasPublishAction:n,isBeingScheduled:o,isPending:a,isPublished:r,isPublishSidebarEnabled:s,isPublishSidebarOpened:i,isScheduled:c,togglePublishSidebar:d,setEntitiesSavedStatesCallback:u}){const m="toggle",p="button",g=(0,f.useViewportMatch)("medium","<");let h;return h=r||c&&o||a&&!n&&!g?p:g||s?m:p,(0,l.createElement)(S.PostPublishButton,{forceIsDirty:e,forceIsSaving:t,isOpen:i,isToggle:h===m,onToggle:d,setEntitiesSavedStatesCallback:u})}));function Qn(){const{hasActiveMetaboxes:e,isPostSaveable:t,isSaving:n,isViewable:o,deviceType:a}=(0,u.useSelect)((e=>{var t;const{getEditedPostAttribute:n}=e(S.store),{getPostType:o}=e(w.store),a=o(n("type"));return{hasActiveMetaboxes:e(on).hasMetaBoxes(),isSaving:e(on).isSavingMetaBoxes(),isPostSaveable:e(S.store).isEditedPostSaveable(),isViewable:null!==(t=a?.viewable)&&void 0!==t&&t,deviceType:e(on).__experimentalGetPreviewDeviceType()}}),[]),{__experimentalSetPreviewDeviceType:r}=(0,u.useDispatch)(on);return(0,l.createElement)(E.__experimentalPreviewOptions,{isEnabled:t,className:"edit-post-post-preview-dropdown",deviceType:a,setDeviceType:r,label:(0,b.__)("Preview")},o&&(0,l.createElement)(_.MenuGroup,null,(0,l.createElement)("div",{className:"edit-post-header-preview__grouping-external"},(0,l.createElement)(S.PostPreviewButton,{className:"edit-post-header-preview__button-external",role:"menuitem",forceIsAutosaveable:e,forcePreviewLink:n?null:void 0,textContent:(0,l.createElement)(l.Fragment,null,(0,b.__)("Preview in new tab"),(0,l.createElement)(_.Icon,{icon:P}))}))))}function Xn(){const{permalink:e,isPublished:t,label:n}=(0,u.useSelect)((e=>{const t=e(S.store).getCurrentPostType(),n=e(w.store).getPostType(t);return{permalink:e(S.store).getPermalink(),isPublished:e(S.store).isCurrentPostPublished(),label:n?.labels.view_item}}),[]);return t&&e?(0,l.createElement)(_.Button,{icon:P,label:n||(0,b.__)("View post"),href:e,target:"_blank"}):null}const Jn="__experimentalMainDashboardButton",{Fill:eo,Slot:to}=(0,_.createSlotFill)(Jn),no=eo;no.Slot=({children:e})=>{const t=(0,_.__experimentalUseSlotFills)(Jn);return Boolean(t&&t.length)?(0,l.createElement)(to,{bubblesVirtually:!0}):e};var oo=no;var ao=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"}));var ro=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"}));var lo=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.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 so=function(){const{template:e,isEditing:t}=(0,u.useSelect)((e=>{const{isEditingTemplate:t,getEditedPostTemplate:n}=e(on),o=t();return{template:o?n():null,isEditing:o}}),[]),{clearSelectedBlock:n}=(0,u.useDispatch)(E.store),{setIsEditingTemplate:o}=(0,u.useDispatch)(on),{open:a}=(0,u.useDispatch)(ln.store);if(!t||!e)return null;let r=(0,b.__)("Default");return e?.title?r=e.title:e&&(r=e.slug),(0,l.createElement)("div",{className:"edit-post-document-actions"},(0,l.createElement)(_.Button,{className:"edit-post-document-actions__back",onClick:()=>{n(),o(!1)},icon:(0,b.isRTL)()?ao:ro},(0,b.__)("Back")),(0,l.createElement)(_.Button,{className:"edit-post-document-actions__command",onClick:()=>a()},(0,l.createElement)(_.__experimentalHStack,{className:"edit-post-document-actions__title",spacing:1,justify:"center"},(0,l.createElement)(E.BlockIcon,{icon:lo}),(0,l.createElement)(_.__experimentalText,{size:"body",as:"h1"},(0,l.createElement)(_.VisuallyHidden,{as:"span"},(0,b.__)("Editing template: ")),r)),(0,l.createElement)("span",{className:"edit-post-document-actions__shortcut"},B.displayShortcut.primary("k"))))};const io={hidden:{y:"-50px"},hover:{y:0,transition:{type:"tween",delay:.2}}},co={hidden:{x:"-100%"},hover:{x:0,transition:{type:"tween",delay:.2}}};var uo=function({setEntitiesSavedStatesCallback:e}){const t=(0,f.useViewportMatch)("large"),{hasActiveMetaboxes:n,isPublishSidebarOpened:o,isSaving:a,showIconLabels:r}=(0,u.useSelect)((e=>({hasActiveMetaboxes:e(on).hasMetaBoxes(),isPublishSidebarOpened:e(on).isPublishSidebarOpened(),isSaving:e(on).isSavingMetaBoxes(),showIconLabels:e(on).isFeatureActive("showIconLabels")})),[]);return(0,l.createElement)("div",{className:"edit-post-header"},(0,l.createElement)(oo.Slot,null,(0,l.createElement)(_.__unstableMotion.div,{variants:co,transition:{type:"tween",delay:.8}},(0,l.createElement)(Fn,{showTooltip:!0}))),(0,l.createElement)(_.__unstableMotion.div,{variants:io,transition:{type:"tween",delay:.8},className:"edit-post-header__toolbar"},(0,l.createElement)(Zn,null),(0,l.createElement)("div",{className:"edit-post-header__center"},(0,l.createElement)(so,null))),(0,l.createElement)(_.__unstableMotion.div,{variants:io,transition:{type:"tween",delay:.8},className:"edit-post-header__settings"},!o&&(0,l.createElement)(S.PostSavedState,{forceIsDirty:n,forceIsSaving:a,showIconLabels:r}),(0,l.createElement)(Qn,null),(0,l.createElement)(S.PostPreviewButton,{forceIsAutosaveable:n,forcePreviewLink:a?null:void 0}),(0,l.createElement)(Xn,null),(0,l.createElement)(Yn,{forceIsDirty:n,forceIsSaving:a,setEntitiesSavedStatesCallback:e}),(t||!r)&&(0,l.createElement)(l.Fragment,null,(0,l.createElement)(de.Slot,{scope:"core/edit-post"}),(0,l.createElement)(Kn,{showIconLabels:r})),r&&!t&&(0,l.createElement)(Kn,{showIconLabels:r})))};var mo=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.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 po(){const{insertionPoint:e,showMostUsedBlocks:t}=(0,u.useSelect)((e=>{const{isFeatureActive:t,__experimentalGetInsertionPoint:n}=e(on);return{insertionPoint:n(),showMostUsedBlocks:t("mostUsedBlocks")}}),[]),{setIsInserterOpened:n}=(0,u.useDispatch)(on),o=(0,f.useViewportMatch)("medium","<"),a=o?"div":_.VisuallyHidden,[r,s]=(0,f.__experimentalUseDialog)({onClose:()=>n(!1),focusOnMount:null}),i=(0,l.useRef)();return(0,l.useEffect)((()=>{i.current.focusSearch()}),[]),(0,l.createElement)("div",{ref:r,...s,className:"edit-post-editor__inserter-panel"},(0,l.createElement)(a,{className:"edit-post-editor__inserter-panel-header"},(0,l.createElement)(_.Button,{icon:mo,label:(0,b.__)("Close block inserter"),onClick:()=>n(!1)})),(0,l.createElement)("div",{className:"edit-post-editor__inserter-panel-content"},(0,l.createElement)(E.__experimentalLibrary,{showMostUsedBlocks:t,showInserterHelpPanel:!0,shouldFocusBlock:o,rootClientId:e.rootClientId,__experimentalInsertionIndex:e.insertionIndex,__experimentalFilterValue:e.filterValue,ref:i})))}var go=window.wp.dom;function ho(){return(0,l.createElement)(_.SVG,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,l.createElement)(_.Rect,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),(0,l.createElement)(_.Line,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),(0,l.createElement)(_.Rect,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),(0,l.createElement)(_.Path,{d:"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z",fill:"black"}),(0,l.createElement)(_.Line,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),(0,l.createElement)(_.Rect,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,l.createElement)(_.Path,{d:"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z",fill:"black"}),(0,l.createElement)(_.Line,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),(0,l.createElement)(_.Rect,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),(0,l.createElement)(_.Path,{d:"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z",fill:"black"}),(0,l.createElement)(_.Line,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),(0,l.createElement)(_.Rect,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,l.createElement)(_.Path,{d:"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z",fill:"black"}))}function _o(){const{headingCount:e}=(0,u.useSelect)((e=>{const{getGlobalBlockCount:t}=e(E.store);return{headingCount:t("core/heading")}}),[]);return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{className:"edit-post-editor__list-view-overview"},(0,l.createElement)("div",null,(0,l.createElement)(_.__experimentalText,null,(0,b.__)("Characters:")),(0,l.createElement)(_.__experimentalText,null,(0,l.createElement)(S.CharacterCount,null))),(0,l.createElement)("div",null,(0,l.createElement)(_.__experimentalText,null,(0,b.__)("Words:")),(0,l.createElement)(S.WordCount,null)),(0,l.createElement)("div",null,(0,l.createElement)(_.__experimentalText,null,(0,b.__)("Time to read:")),(0,l.createElement)(S.TimeToRead,null))),e>0?(0,l.createElement)(S.DocumentOutline,null):(0,l.createElement)("div",{className:"edit-post-editor__list-view-empty-headings"},(0,l.createElement)(ho,null),(0,l.createElement)("p",null,(0,b.__)("Navigate the structure of your document and address issues like empty or incorrect heading levels."))))}function Eo(){const{setIsListViewOpened:e}=(0,u.useDispatch)(on),t=(0,f.useFocusOnMount)("firstElement"),n=(0,f.useFocusReturn)(),o=(0,f.useFocusReturn)();const[a,r]=(0,l.useState)(null),[s,i]=(0,l.useState)("list-view"),c=(0,l.useRef)(),d=(0,l.useRef)(),m=(0,l.useRef)(),p=(0,f.useMergeRefs)([o,t,m,r]);return(0,xe.useShortcut)("core/edit-post/toggle-list-view",(()=>{c.current.contains(c.current.ownerDocument.activeElement)?e(!1):function(e){const t=go.focus.tabbable.find(d.current)[0];if("list-view"===e){const e=go.focus.tabbable.find(m.current)[0];(c.current.contains(e)?e:t).focus()}else t.focus()}(s)})),(0,l.createElement)("div",{className:"edit-post-editor__document-overview-panel",onKeyDown:function(t){t.keyCode!==B.ESCAPE||t.defaultPrevented||(t.preventDefault(),e(!1))},ref:c},(0,l.createElement)(_.Button,{className:"edit-post-editor__document-overview-panel__close-button",ref:n,icon:O,label:(0,b.__)("Close"),onClick:()=>e(!1)}),(0,l.createElement)(_.TabPanel,{className:"edit-post-editor__document-overview-panel__tab-panel",ref:d,onSelect:e=>i(e),selectOnMove:!1,tabs:[{name:"list-view",title:(0,b._x)("List View","Post overview"),className:"edit-post-sidebar__panel-tab"},{name:"outline",title:(0,b._x)("Outline","Post overview"),className:"edit-post-sidebar__panel-tab"}]},(e=>(0,l.createElement)("div",{className:"edit-post-editor__list-view-container",ref:p},"list-view"===e.name?(0,l.createElement)("div",{className:"edit-post-editor__list-view-panel-content"},(0,l.createElement)(E.__experimentalListView,{dropZoneElement:a})):(0,l.createElement)(_o,null)))))}var bo=(0,l.createElement)(k.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.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 fo=(0,l.createElement)(k.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.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"}));var vo=({sidebarName:e})=>{const{openGeneralSidebar:t}=(0,u.useDispatch)(on),n=()=>t("edit-post/document"),{documentLabel:o,isTemplateMode:a}=(0,u.useSelect)((e=>({documentLabel:e(S.store).getPostTypeLabel()||(0,b._x)("Document","noun"),isTemplateMode:e(on).isEditingTemplate()})),[]),[r,s]="edit-post/document"===e?[(0,b.sprintf)((0,b.__)("%s (selected)"),o),"is-active"]:[o,""],[i,c]="edit-post/block"===e?[(0,b.__)("Block (selected)"),"is-active"]:[(0,b.__)("Block"),""],[d,m]="edit-post/document"===e?[(0,b.__)("Template (selected)"),"is-active"]:[(0,b.__)("Template"),""];return(0,l.createElement)("ul",null,!a&&(0,l.createElement)("li",null,(0,l.createElement)(_.Button,{onClick:n,className:`edit-post-sidebar__panel-tab ${s}`,"aria-label":r,"data-label":o},o)),a&&(0,l.createElement)("li",null,(0,l.createElement)(_.Button,{onClick:n,className:`edit-post-sidebar__panel-tab ${m}`,"aria-label":d,"data-label":(0,b.__)("Template")},(0,b.__)("Template"))),(0,l.createElement)("li",null,(0,l.createElement)(_.Button,{onClick:()=>t("edit-post/block"),className:`edit-post-sidebar__panel-tab ${c}`,"aria-label":i,"data-label":(0,b.__)("Block")},(0,b.__)("Block"))))};function yo({isOpen:e,onClick:t}){const n=(0,S.usePostVisibilityLabel)();return(0,l.createElement)(_.Button,{className:"edit-post-post-visibility__toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,b.sprintf)((0,b.__)("Select visibility: %s"),n),onClick:t},n)}var wo=function(){const[e,t]=(0,l.useState)(null),n=(0,l.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,l.createElement)(S.PostVisibilityCheck,{render:({canEdit:e})=>(0,l.createElement)(_.PanelRow,{ref:t,className:"edit-post-post-visibility"},(0,l.createElement)("span",null,(0,b.__)("Visibility")),!e&&(0,l.createElement)("span",null,(0,l.createElement)(S.PostVisibilityLabel,null)),e&&(0,l.createElement)(_.Dropdown,{contentClassName:"edit-post-post-visibility__dialog",popoverProps:n,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,l.createElement)(yo,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,l.createElement)(S.PostVisibility,{onClose:e})}))})};function So(){return(0,l.createElement)(S.PostTrashCheck,null,(0,l.createElement)(S.PostTrash,null))}function ko(){const[e,t]=(0,l.useState)(null),n=(0,l.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,l.createElement)(S.PostScheduleCheck,null,(0,l.createElement)(_.PanelRow,{className:"edit-post-post-schedule",ref:t},(0,l.createElement)("span",null,(0,b.__)("Publish")),(0,l.createElement)(_.Dropdown,{popoverProps:n,contentClassName:"edit-post-post-schedule__dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,l.createElement)(Po,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,l.createElement)(S.PostSchedule,{onClose:e})})))}function Po({isOpen:e,onClick:t}){const n=(0,S.usePostScheduleLabel)(),o=(0,S.usePostScheduleLabel)({full:!0});return(0,l.createElement)(_.Button,{className:"edit-post-post-schedule__toggle",variant:"tertiary",label:o,showTooltip:!0,"aria-expanded":e,"aria-label":(0,b.sprintf)((0,b.__)("Change date: %s"),n),onClick:t},n)}var Co=function(){return(0,l.createElement)(S.PostStickyCheck,null,(0,l.createElement)(_.PanelRow,null,(0,l.createElement)(S.PostSticky,null)))};var To=function(){return(0,l.createElement)(S.PostAuthorCheck,null,(0,l.createElement)(_.PanelRow,{className:"edit-post-post-author"},(0,l.createElement)(S.PostAuthor,null)))};var xo=function(){return(0,l.createElement)(S.PostSlugCheck,null,(0,l.createElement)(_.PanelRow,{className:"edit-post-post-slug"},(0,l.createElement)(S.PostSlug,null)))};var Mo=function(){return(0,l.createElement)(S.PostFormatCheck,null,(0,l.createElement)(_.PanelRow,{className:"edit-post-post-format"},(0,l.createElement)(S.PostFormat,null)))};var Bo=function(){return(0,l.createElement)(S.PostPendingStatusCheck,null,(0,l.createElement)(_.PanelRow,null,(0,l.createElement)(S.PostPendingStatus,null)))};const{Fill:Io,Slot:Lo}=(0,_.createSlotFill)("PluginPostStatusInfo"),No=({children:e,className:t})=>(0,l.createElement)(Io,null,(0,l.createElement)(_.PanelRow,{className:t},e));No.Slot=Lo;var Ao=No;var Do=(0,l.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,l.createElement)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5 5.5V8H20V5.5H22.5V4H20V1.5H18.5V4H16V5.5H18.5ZM13.9624 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V10.0391H18.5V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 10.4917L16.4589 10.5139L16.4641 9.01389L5.5 8.97618V6C5.5 5.72386 5.72386 5.5 6 5.5H13.9624V4ZM5.5 10.4762V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 10.4865L5.5 10.4762Z"}));const Vo=(0,b.__)("Custom Template");function Oo({onClose:e}){const t=(0,u.useSelect)((e=>e(S.store).getEditorSettings().defaultBlockTemplate),[]),{__unstableCreateTemplate:n,__unstableSwitchToTemplateMode:o}=(0,u.useDispatch)(on),[a,r]=(0,l.useState)(""),[i,c]=(0,l.useState)(!1),d=()=>{r(""),e()};return(0,l.createElement)(_.Modal,{title:(0,b.__)("Create custom template"),onRequestClose:d,className:"edit-post-post-template__create-modal"},(0,l.createElement)("form",{className:"edit-post-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),i)return;c(!0);const r=null!=t?t:(0,s.serialize)([(0,s.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,s.createBlock)("core/site-title"),(0,s.createBlock)("core/site-tagline")]),(0,s.createBlock)("core/separator"),(0,s.createBlock)("core/group",{tagName:"main"},[(0,s.createBlock)("core/group",{layout:{inherit:!0}},[(0,s.createBlock)("core/post-title")]),(0,s.createBlock)("core/post-content",{layout:{inherit:!0}})])]);await n({slug:(0,T.cleanForSlug)(a||Vo),content:r,title:a||Vo}),c(!1),d(),o(!0)}},(0,l.createElement)(_.__experimentalVStack,{spacing:"3"},(0,l.createElement)(_.TextControl,{__nextHasNoMarginBottom:!0,label:(0,b.__)("Name"),value:a,onChange:r,placeholder:Vo,disabled:i,help:(0,b.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),(0,l.createElement)(_.__experimentalHStack,{justify:"right"},(0,l.createElement)(_.Button,{variant:"tertiary",onClick:d},(0,b.__)("Cancel")),(0,l.createElement)(_.Button,{variant:"primary",type:"submit",isBusy:i,"aria-disabled":i},(0,b.__)("Create"))))))}function Ro({onClose:e}){var t,n;const{isPostsPage:o,availableTemplates:a,fetchedTemplates:r,selectedTemplateSlug:s,canCreate:i,canEdit:c}=(0,u.useSelect)((e=>{const{canUser:t,getEntityRecord:n,getEntityRecords:o}=e(w.store),a=e(S.store).getEditorSettings(),r=t("read","settings")?n("root","site"):void 0,l=e(S.store).getCurrentPostId()===r?.page_for_posts,s=t("create","templates");return{isPostsPage:l,availableTemplates:a.availableTemplates,fetchedTemplates:s?o("postType","wp_template",{post_type:e(S.store).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(S.store).getEditedPostAttribute("template"),canCreate:s&&!l&&a.supportsTemplateMode,canEdit:s&&a.supportsTemplateMode&&!!e(on).getEditedPostTemplate()}}),[]),d=(0,l.useMemo)((()=>Object.entries({...a,...Object.fromEntries((null!=r?r:[]).map((({slug:e,title:t})=>[e,t.rendered])))}).map((([e,t])=>({value:e,label:t})))),[a,r]),m=null!==(t=d.find((e=>e.value===s)))&&void 0!==t?t:d.find((e=>!e.value)),{editPost:p}=(0,u.useDispatch)(S.store),{__unstableSwitchToTemplateMode:g}=(0,u.useDispatch)(on),[h,f]=(0,l.useState)(!1);return(0,l.createElement)("div",{className:"edit-post-post-template__form"},(0,l.createElement)(E.__experimentalInspectorPopoverHeader,{title:(0,b.__)("Template"),help:(0,b.__)("Templates define the way content is displayed when viewing your site."),actions:i?[{icon:Do,label:(0,b.__)("Add template"),onClick:()=>f(!0)}]:[],onClose:e}),o?(0,l.createElement)(_.Notice,{className:"edit-post-post-template__notice",status:"warning",isDismissible:!1},(0,b.__)("The posts page template cannot be changed.")):(0,l.createElement)(_.SelectControl,{__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:(0,b.__)("Template"),value:null!==(n=m?.value)&&void 0!==n?n:"",options:d,onChange:e=>p({template:e||""})}),c&&(0,l.createElement)("p",null,(0,l.createElement)(_.Button,{variant:"link",onClick:()=>g()},(0,b.__)("Edit template"))),h&&(0,l.createElement)(Oo,{onClose:()=>f(!1)}))}function Fo(){const[e,t]=(0,l.useState)(null),n=(0,l.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,u.useSelect)((e=>{var t;const n=e(S.store).getCurrentPostType(),o=e(w.store).getPostType(n);if(!o?.viewable)return!1;const a=e(S.store).getEditorSettings();if(!!a.availableTemplates&&Object.keys(a.availableTemplates).length>0)return!0;if(!a.supportsTemplateMode)return!1;return null!==(t=e(w.store).canUser("create","templates"))&&void 0!==t&&t}),[])?(0,l.createElement)(_.PanelRow,{className:"edit-post-post-template",ref:t},(0,l.createElement)("span",null,(0,b.__)("Template")),(0,l.createElement)(_.Dropdown,{popoverProps:n,className:"edit-post-post-template__dropdown",contentClassName:"edit-post-post-template__dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,l.createElement)(Ho,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,l.createElement)(Ro,{onClose:e})})):null}function Ho({isOpen:e,onClick:t}){const n=(0,u.useSelect)((e=>{const t=e(S.store).getEditedPostAttribute("template"),{supportsTemplateMode:n,availableTemplates:o}=e(S.store).getEditorSettings();if(!n&&o[t])return o[t];const a=e(w.store).canUser("create","templates")&&e(on).getEditedPostTemplate();return a?.title||a?.slug||o?.[t]}),[]);return(0,l.createElement)(_.Button,{className:"edit-post-post-template__toggle",variant:"tertiary","aria-expanded":e,"aria-label":n?(0,b.sprintf)((0,b.__)("Select template: %s"),n):(0,b.__)("Select template"),onClick:t},null!=n?n:(0,b.__)("Default template"))}function Go(){const[e,t]=(0,l.useState)(null),n=(0,l.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,l.createElement)(S.PostURLCheck,null,(0,l.createElement)(_.PanelRow,{className:"edit-post-post-url",ref:t},(0,l.createElement)("span",null,(0,b.__)("URL")),(0,l.createElement)(_.Dropdown,{popoverProps:n,className:"edit-post-post-url__dropdown",contentClassName:"edit-post-post-url__dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,l.createElement)(Uo,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,l.createElement)(S.PostURL,{onClose:e})})))}function Uo({isOpen:e,onClick:t}){const n=(0,S.usePostURLLabel)();return(0,l.createElement)(_.Button,{className:"edit-post-post-url__toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,b.sprintf)((0,b.__)("Change URL: %s"),n),onClick:t},n)}const zo="post-status";var Zo=(0,f.compose)([(0,u.withSelect)((e=>{const{isEditorPanelRemoved:t,isEditorPanelOpened:n}=e(on);return{isRemoved:t(zo),isOpened:n(zo)}})),(0,f.ifCondition)((({isRemoved:e})=>!e)),(0,u.withDispatch)((e=>({onTogglePanel(){return e(on).toggleEditorPanelOpened(zo)}})))])((function({isOpened:e,onTogglePanel:t}){return(0,l.createElement)(_.PanelBody,{className:"edit-post-post-status",title:(0,b.__)("Summary"),opened:e,onToggle:t},(0,l.createElement)(Ao.Slot,null,(e=>(0,l.createElement)(l.Fragment,null,(0,l.createElement)(wo,null),(0,l.createElement)(ko,null),(0,l.createElement)(Fo,null),(0,l.createElement)(Go,null),(0,l.createElement)(Co,null),(0,l.createElement)(Bo,null),(0,l.createElement)(Mo,null),(0,l.createElement)(xo,null),(0,l.createElement)(To,null),(0,l.createElement)(S.PostSyncStatus,null),e,(0,l.createElement)(_.__experimentalHStack,{style:{marginTop:"16px"},spacing:4,wrap:!0},(0,l.createElement)(S.PostSwitchToDraftButton,null),(0,l.createElement)(So,null))))))}));var $o=function(){return(0,l.createElement)(S.PostLastRevisionCheck,null,(0,l.createElement)(_.PanelBody,{className:"edit-post-last-revision__panel"},(0,l.createElement)(S.PostLastRevision,null)))};var Wo=(0,f.compose)((0,u.withSelect)(((e,t)=>{const n=t.taxonomy?.slug,o=n?`taxonomy-panel-${n}`:"";return{panelName:o,isEnabled:!!n&&e(on).isEditorPanelEnabled(o),isOpened:!!n&&e(on).isEditorPanelOpened(o)}})),(0,u.withDispatch)(((e,t)=>({onTogglePanel:()=>{e(on).toggleEditorPanelOpened(t.panelName)}}))))((function({isEnabled:e,taxonomy:t,isOpened:n,onTogglePanel:o,children:a}){if(!e)return null;const r=t?.labels?.menu_name;return r?(0,l.createElement)(_.PanelBody,{title:r,opened:n,onToggle:o},a):null}));var qo=function(){return(0,l.createElement)(S.PostTaxonomiesCheck,null,(0,l.createElement)(S.PostTaxonomies,{taxonomyWrapper:(e,t)=>(0,l.createElement)(Wo,{taxonomy:t},e)}))};const jo="featured-image";const Ko=(0,u.withSelect)((e=>{const{getEditedPostAttribute:t}=e(S.store),{getPostType:n}=e(w.store),{isEditorPanelEnabled:o,isEditorPanelOpened:a}=e(on);return{postType:n(t("type")),isEnabled:o(jo),isOpened:a(jo)}})),Yo=(0,u.withDispatch)((e=>{const{toggleEditorPanelOpened:t}=e(on);return{onTogglePanel:(...e)=>t(jo,...e)}}));var Qo=(0,f.compose)(Ko,Yo)((function({isEnabled:e,isOpened:t,postType:n,onTogglePanel:o}){var a;return e?(0,l.createElement)(S.PostFeaturedImageCheck,null,(0,l.createElement)(_.PanelBody,{title:null!==(a=n?.labels?.featured_image)&&void 0!==a?a:(0,b.__)("Featured image"),opened:t,onToggle:o},(0,l.createElement)(S.PostFeaturedImage,null))):null}));const Xo="post-excerpt";var Jo=(0,f.compose)([(0,u.withSelect)((e=>({isEnabled:e(on).isEditorPanelEnabled(Xo),isOpened:e(on).isEditorPanelOpened(Xo)}))),(0,u.withDispatch)((e=>({onTogglePanel(){return e(on).toggleEditorPanelOpened(Xo)}})))])((function({isEnabled:e,isOpened:t,onTogglePanel:n}){return e?(0,l.createElement)(S.PostExcerptCheck,null,(0,l.createElement)(_.PanelBody,{title:(0,b.__)("Excerpt"),opened:t,onToggle:n},(0,l.createElement)(S.PostExcerpt,null))):null}));const ea="discussion-panel";var ta=(0,f.compose)([(0,u.withSelect)((e=>({isEnabled:e(on).isEditorPanelEnabled(ea),isOpened:e(on).isEditorPanelOpened(ea)}))),(0,u.withDispatch)((e=>({onTogglePanel(){return e(on).toggleEditorPanelOpened(ea)}})))])((function({isEnabled:e,isOpened:t,onTogglePanel:n}){return e?(0,l.createElement)(S.PostTypeSupportCheck,{supportKeys:["comments","trackbacks"]},(0,l.createElement)(_.PanelBody,{title:(0,b.__)("Discussion"),opened:t,onToggle:n},(0,l.createElement)(S.PostTypeSupportCheck,{supportKeys:"comments"},(0,l.createElement)(_.PanelRow,null,(0,l.createElement)(S.PostComments,null))),(0,l.createElement)(S.PostTypeSupportCheck,{supportKeys:"trackbacks"},(0,l.createElement)(_.PanelRow,null,(0,l.createElement)(S.PostPingbacks,null))))):null}));const na="page-attributes";var oa=function(){var e;const{isEnabled:t,isOpened:n,postType:o}=(0,u.useSelect)((e=>{const{getEditedPostAttribute:t}=e(S.store),{isEditorPanelEnabled:n,isEditorPanelOpened:o}=e(on),{getPostType:a}=e(w.store);return{isEnabled:n(na),isOpened:o(na),postType:a(t("type"))}}),[]),{toggleEditorPanelOpened:a}=(0,u.useDispatch)(on);return t&&o?(0,l.createElement)(S.PageAttributesCheck,null,(0,l.createElement)(_.PanelBody,{title:null!==(e=o?.labels?.attributes)&&void 0!==e?e:(0,b.__)("Page attributes"),opened:n,onToggle:(...e)=>a(na,...e)},(0,l.createElement)(S.PageAttributesParent,null),(0,l.createElement)(_.PanelRow,null,(0,l.createElement)(S.PageAttributesOrder,null)))):null};var aa=function({location:e}){const t=(0,l.useRef)(null),n=(0,l.useRef)(null);(0,l.useEffect)((()=>(n.current=document.querySelector(".metabox-location-"+e),n.current&&t.current.appendChild(n.current),()=>{n.current&&document.querySelector("#metaboxes").appendChild(n.current)})),[e]);const o=(0,u.useSelect)((e=>e(on).isSavingMetaBoxes()),[]),a=L()("edit-post-meta-boxes-area",`is-${e}`,{"is-loading":o});return(0,l.createElement)("div",{className:a},o&&(0,l.createElement)(_.Spinner,null),(0,l.createElement)("div",{className:"edit-post-meta-boxes-area__container",ref:t}),(0,l.createElement)("div",{className:"edit-post-meta-boxes-area__clear"}))};class ra extends l.Component{componentDidMount(){this.updateDOM()}componentDidUpdate(e){this.props.isVisible!==e.isVisible&&this.updateDOM()}updateDOM(){const{id:e,isVisible:t}=this.props,n=document.getElementById(e);n&&(t?n.classList.remove("is-hidden"):n.classList.add("is-hidden"))}render(){return null}}var la=(0,u.withSelect)(((e,{id:t})=>({isVisible:e(on).isEditorPanelEnabled(`meta-box-${t}`)})))(ra);function sa({location:e}){const t=(0,u.useRegistry)(),{metaBoxes:n,areMetaBoxesInitialized:o,isEditorReady:a}=(0,u.useSelect)((t=>{const{__unstableIsEditorReady:n}=t(S.store),{getMetaBoxesPerLocation:o,areMetaBoxesInitialized:a}=t(on);return{metaBoxes:o(e),areMetaBoxesInitialized:a(),isEditorReady:n()}}),[e]);return(0,l.useEffect)((()=>{a&&!o&&t.dispatch(on).initializeMetaBoxes()}),[a,o]),o?(0,l.createElement)(l.Fragment,null,(null!=n?n:[]).map((({id:e})=>(0,l.createElement)(la,{key:e,id:e}))),(0,l.createElement)(aa,{location:e})):null}window.wp.warning;const{Fill:ia,Slot:ca}=(0,_.createSlotFill)("PluginDocumentSettingPanel"),da=(0,f.compose)((0,C.withPluginContext)(((e,t)=>(void 0===t.name&&"undefined"!=typeof process&&process.env,{panelName:`${e.name}/${t.name}`}))),(0,u.withSelect)(((e,{panelName:t})=>({opened:e(on).isEditorPanelOpened(t),isEnabled:e(on).isEditorPanelEnabled(t)}))),(0,u.withDispatch)(((e,{panelName:t})=>({onToggle(){return e(on).toggleEditorPanelOpened(t)}}))))((({isEnabled:e,panelName:t,opened:n,onToggle:o,className:a,title:r,icon:s,children:i})=>(0,l.createElement)(l.Fragment,null,(0,l.createElement)(Tn,{label:r,panelName:t}),(0,l.createElement)(ia,null,e&&(0,l.createElement)(_.PanelBody,{className:a,title:r,icon:s,opened:n,onToggle:o},i)))));da.Slot=ca;var ua=da;function ma({className:e,...t}){const{postTitle:n,shortcut:o,showIconLabels:a}=(0,u.useSelect)((e=>({postTitle:e(S.store).getEditedPostAttribute("title"),shortcut:e(xe.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),showIconLabels:e(on).isFeatureActive("showIconLabels")})),[]);return(0,l.createElement)(pe,{panelClassName:e,className:"edit-post-sidebar",smallScreenTitle:n||(0,b.__)("(no title)"),scope:"core/edit-post",toggleShortcut:o,showIconLabels:a,...t})}var pa=function(){const e=(0,u.useSelect)((e=>{const{getEditedPostTemplate:t}=e(on);return t()}),[]);return e?(0,l.createElement)(_.PanelBody,null,(0,l.createElement)(_.Flex,{align:"flex-start",gap:"3"},(0,l.createElement)(_.FlexItem,null,(0,l.createElement)(ye,{icon:lo})),(0,l.createElement)(_.FlexBlock,null,(0,l.createElement)("h2",{className:"edit-post-template-summary__title"},e?.title||e?.slug),(0,l.createElement)("p",null,e?.description)))):null};const ga=l.Platform.select({web:!0,native:!1});var ha=()=>{const{sidebarName:e,keyboardShortcut:t,isTemplateMode:n}=(0,u.useSelect)((e=>{let t=e(ee).getActiveComplementaryArea(on.name);["edit-post/document","edit-post/block"].includes(t)||(e(E.store).getBlockSelectionStart()&&(t="edit-post/block"),t="edit-post/document");return{sidebarName:t,keyboardShortcut:e(xe.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),isTemplateMode:e(on).isEditingTemplate()}}),[]);return(0,l.createElement)(ma,{identifier:e,header:(0,l.createElement)(vo,{sidebarName:e}),closeLabel:(0,b.__)("Close Settings"),headerClassName:"edit-post-sidebar__panel-tabs",title:(0,b.__)("Settings"),toggleShortcut:t,icon:(0,b.isRTL)()?bo:fo,isActiveByDefault:ga},!n&&"edit-post/document"===e&&(0,l.createElement)(l.Fragment,null,(0,l.createElement)(Zo,null),(0,l.createElement)(ua.Slot,null),(0,l.createElement)($o,null),(0,l.createElement)(qo,null),(0,l.createElement)(Qo,null),(0,l.createElement)(Jo,null),(0,l.createElement)(ta,null),(0,l.createElement)(oa,null),(0,l.createElement)(sa,{location:"side"})),n&&"edit-post/document"===e&&(0,l.createElement)(pa,null),"edit-post/block"===e&&(0,l.createElement)(E.BlockInspector,null))};function _a({nonAnimatedSrc:e,animatedSrc:t}){return(0,l.createElement)("picture",{className:"edit-post-welcome-guide__image"},(0,l.createElement)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,l.createElement)("img",{src:t,width:"312",height:"240",alt:""}))}function Ea(){const{toggleFeature:e}=(0,u.useDispatch)(on);return(0,l.createElement)(_.Guide,{className:"edit-post-welcome-guide",contentLabel:(0,b.__)("Welcome to the block editor"),finishButtonText:(0,b.__)("Get started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,l.createElement)(_a,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,l.createElement)(l.Fragment,null,(0,l.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,b.__)("Welcome to the block editor")),(0,l.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,b.__)("In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.")))},{image:(0,l.createElement)(_a,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,l.createElement)(l.Fragment,null,(0,l.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,b.__)("Make each block your own")),(0,l.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,b.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.")))},{image:(0,l.createElement)(_a,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,l.createElement)(l.Fragment,null,(0,l.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,b.__)("Get to know the block library")),(0,l.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,l.createInterpolateElement)((0,b.__)("All of the blocks available to you live in the block library. Youll find it wherever you see the <InserterIconImage /> icon."),{InserterIconImage:(0,l.createElement)("img",{alt:(0,b.__)("inserter"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"})})))},{image:(0,l.createElement)(_a,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,l.createElement)(l.Fragment,null,(0,l.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,b.__)("Learn how to use the block editor")),(0,l.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,b.__)("New to the block editor? Want to learn more about using it? "),(0,l.createElement)(_.ExternalLink,{href:(0,b.__)("https://wordpress.org/documentation/article/wordpress-block-editor/")},(0,b.__)("Here's a detailed guide."))))}]})}function ba(){const{toggleFeature:e}=(0,u.useDispatch)(on);return(0,l.createElement)(_.Guide,{className:"edit-template-welcome-guide",contentLabel:(0,b.__)("Welcome to the template editor"),finishButtonText:(0,b.__)("Get started"),onFinish:()=>e("welcomeGuideTemplate"),pages:[{image:(0,l.createElement)(_a,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.gif"}),content:(0,l.createElement)(l.Fragment,null,(0,l.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,b.__)("Welcome to the template editor")),(0,l.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,b.__)("Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.")))}]})}function fa(){const{isActive:e,isTemplateMode:t}=(0,u.useSelect)((e=>{const{isFeatureActive:t,isEditingTemplate:n}=e(on),o=n();return{isActive:t(o?"welcomeGuideTemplate":"welcomeGuide"),isTemplateMode:o}}),[]);return e?t?(0,l.createElement)(ba,null):(0,l.createElement)(Ea,null):null}const{Fill:va,Slot:ya}=(0,_.createSlotFill)("PluginPostPublishPanel"),wa=(0,f.compose)((0,C.withPluginContext)(((e,t)=>({icon:t.icon||e.icon}))))((({children:e,className:t,title:n,initialOpen:o=!1,icon:a})=>(0,l.createElement)(va,null,(0,l.createElement)(_.PanelBody,{className:t,initialOpen:o||!n,title:n,icon:a},e))));wa.Slot=ya;var Sa=wa;const{Fill:ka,Slot:Pa}=(0,_.createSlotFill)("PluginPrePublishPanel"),Ca=(0,f.compose)((0,C.withPluginContext)(((e,t)=>({icon:t.icon||e.icon}))))((({children:e,className:t,title:n,initialOpen:o=!1,icon:a})=>(0,l.createElement)(ka,null,(0,l.createElement)(_.PanelBody,{className:t,initialOpen:o||!n,title:n,icon:a},e))));Ca.Slot=Pa;var Ta=Ca;const{Fill:xa,Slot:Ma}=(0,_.createSlotFill)("ActionsPanel");function Ba({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n}){const{closePublishSidebar:o,togglePublishSidebar:a}=(0,u.useDispatch)(on),{publishSidebarOpened:r,hasActiveMetaboxes:s,isSavingMetaBoxes:i,hasNonPostEntityChanges:c}=(0,u.useSelect)((e=>({publishSidebarOpened:e(on).isPublishSidebarOpened(),hasActiveMetaboxes:e(on).hasMetaBoxes(),isSavingMetaBoxes:e(on).isSavingMetaBoxes(),hasNonPostEntityChanges:e(S.store).hasNonPostEntityChanges()})),[]),d=(0,l.useCallback)((()=>e(!0)),[]);let m;return m=r?(0,l.createElement)(S.PostPublishPanel,{onClose:o,forceIsDirty:s,forceIsSaving:i,PrePublishExtension:Ta.Slot,PostPublishExtension:Sa.Slot}):c?(0,l.createElement)("div",{className:"edit-post-layout__toggle-entities-saved-states-panel"},(0,l.createElement)(_.Button,{variant:"secondary",className:"edit-post-layout__toggle-entities-saved-states-panel-button",onClick:d,"aria-expanded":!1},(0,b.__)("Open save panel"))):(0,l.createElement)("div",{className:"edit-post-layout__toggle-publish-panel"},(0,l.createElement)(_.Button,{variant:"secondary",className:"edit-post-layout__toggle-publish-panel-button",onClick:a,"aria-expanded":!1},(0,b.__)("Open publish panel"))),(0,l.createElement)(l.Fragment,null,n&&(0,l.createElement)(S.EntitiesSavedStates,{close:t}),(0,l.createElement)(Ma,{bubblesVirtually:!0}),!n&&m)}function Ia(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,u.useSelect)((e=>{const{getPatternsByBlockTypes:t}=e(E.store),{getCurrentPostType:n}=e(S.store);return{blockPatternsWithPostContentBlockType:t("core/post-content"),postType:n()}}),[]);return(0,l.useMemo)((()=>e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t)))),[t,e])}function La({onChoosePattern:e}){const t=Ia(),n=(0,f.useAsyncList)(t),{resetEditorBlocks:o}=(0,u.useDispatch)(S.store);return(0,l.createElement)(E.__experimentalBlockPatternsList,{blockPatterns:t,shownPatterns:n,onClickPattern:(t,n)=>{o(n),e()}})}const Na={INITIAL:"INITIAL",PATTERN:"PATTERN",CLOSED:"CLOSED"};function Aa(){const[e,t]=(0,l.useState)(Na.INITIAL),n=Ia().length>0,o=(0,u.useSelect)((t=>{if(!n||e!==Na.INITIAL)return!1;const{getEditedPostContent:o,isEditedPostSaveable:a}=t(S.store),{isEditingTemplate:r,isFeatureActive:l}=t(on);return!a()&&""===o()&&!r()&&!l("welcomeGuide")}),[e,n]);return(0,l.useEffect)((()=>{o&&t(Na.PATTERN)}),[o]),e===Na.INITIAL||e===Na.CLOSED?null:(0,l.createElement)(_.Modal,{className:"edit-post-start-page-options__modal",title:(0,b.__)("Choose a pattern"),isFullScreen:!0,onRequestClose:()=>{t(Na.CLOSED)}},(0,l.createElement)("div",{className:"edit-post-start-page-options__modal-content"},e===Na.PATTERN&&(0,l.createElement)(La,{onChoosePattern:()=>{t(Na.CLOSED)}})))}const{getLayoutStyles:Da}=mn(E.privateApis),Va={header:(0,b.__)("Editor top bar"),body:(0,b.__)("Editor content"),sidebar:(0,b.__)("Editor settings"),actions:(0,b.__)("Editor publish"),footer:(0,b.__)("Editor footer")};var Oa=function(){const e=(0,f.useViewportMatch)("medium","<"),t=(0,f.useViewportMatch)("huge",">="),n=(0,f.useViewportMatch)("large"),{openGeneralSidebar:o,closeGeneralSidebar:a,setIsInserterOpened:r}=(0,u.useDispatch)(on),{createErrorNotice:s}=(0,u.useDispatch)(x.store),{mode:i,isFullscreenActive:c,isRichEditingEnabled:d,sidebarIsOpened:m,hasActiveMetaboxes:p,hasFixedToolbar:g,previousShortcut:h,nextShortcut:v,hasBlockSelected:y,isInserterOpened:w,isListViewOpened:k,showIconLabels:P,isDistractionFree:T,showBlockBreadcrumbs:M,isTemplateMode:B,documentLabel:I,styles:N}=(0,u.useSelect)((e=>{const{getEditorSettings:t,getPostTypeLabel:n}=e(S.store),{isFeatureActive:o}=e(on),a=t(),r=n(),l=o("themeStyles"),s=[],i=[];a.styles?.forEach((e=>{e.__unstableType&&"theme"!==e.__unstableType?i.push(e):s.push(e)}));const c=[...a.defaultEditorStyles,...i];return a.disableLayoutStyles||l&&s.length||c.push({css:Da({style:{},selector:"body",hasBlockGapSupport:!1,hasFallbackGapSupport:!0,fallbackGapValue:"0.5em"})}),{isTemplateMode:e(on).isEditingTemplate(),hasFixedToolbar:e(on).isFeatureActive("fixedToolbar"),sidebarIsOpened:!(!e(ee).getActiveComplementaryArea(on.name)&&!e(on).isPublishSidebarOpened()),isFullscreenActive:e(on).isFeatureActive("fullscreenMode"),isInserterOpened:e(on).isInserterOpened(),isListViewOpened:e(on).isListViewOpened(),mode:e(on).getEditorMode(),isRichEditingEnabled:a.richEditingEnabled,hasActiveMetaboxes:e(on).hasMetaBoxes(),previousShortcut:e(xe.store).getAllShortcutKeyCombinations("core/edit-post/previous-region"),nextShortcut:e(xe.store).getAllShortcutKeyCombinations("core/edit-post/next-region"),showIconLabels:e(on).isFeatureActive("showIconLabels"),isDistractionFree:e(on).isFeatureActive("distractionFree"),showBlockBreadcrumbs:e(on).isFeatureActive("showBlockBreadcrumbs"),documentLabel:r||(0,b._x)("Document","noun"),styles:l&&s.length?a.styles:c}}),[]);(0,l.useEffect)((()=>{m&&!t&&r(!1)}),[m,t]),(0,l.useEffect)((()=>{w&&!t&&a()}),[w,t]);const[A,D]=(0,l.useState)(!1),V=(0,l.useCallback)((e=>{"function"==typeof A&&A(e),D(!1)}),[A]),O=L()("edit-post-layout","is-mode-"+i,{"is-sidebar-opened":m,"has-fixed-toolbar":g,"has-metaboxes":p,"show-icon-labels":P,"is-distraction-free":T&&n,"is-entity-save-view-open":!!A}),R=k?(0,b.__)("Document Overview"):(0,b.__)("Block Library");return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(ge,{isActive:c}),(0,l.createElement)(On,null),(0,l.createElement)(S.UnsavedChangesWarning,null),(0,l.createElement)(S.AutosaveMonitor,null),(0,l.createElement)(S.LocalAutosaveMonitor,null),(0,l.createElement)(vn,null),(0,l.createElement)(S.EditorKeyboardShortcutsRegister,null),(0,l.createElement)(ha,null),(0,l.createElement)(Ee,{isDistractionFree:T&&n,className:O,labels:{...Va,secondarySidebar:R},header:(0,l.createElement)(uo,{setEntitiesSavedStatesCallback:D}),editorNotices:(0,l.createElement)(S.EditorNotices,null),secondarySidebar:"visual"===i&&w?(0,l.createElement)(po,null):"visual"===i&&k?(0,l.createElement)(Eo,null):null,sidebar:(!e||m)&&(0,l.createElement)(l.Fragment,null,!e&&!m&&(0,l.createElement)("div",{className:"edit-post-layout__toggle-sidebar-panel"},(0,l.createElement)(_.Button,{variant:"secondary",className:"edit-post-layout__toggle-sidebar-panel-button",onClick:()=>o(y?"edit-post/block":"edit-post/document"),"aria-expanded":!1},y?(0,b.__)("Open block settings"):(0,b.__)("Open document settings"))),(0,l.createElement)(pe.Slot,{scope:"core/edit-post"})),notices:(0,l.createElement)(S.EditorSnackbars,null),content:(0,l.createElement)(l.Fragment,null,!T&&(0,l.createElement)(S.EditorNotices,null),("text"===i||!d)&&(0,l.createElement)(cn,null),d&&"visual"===i&&(0,l.createElement)(fn,{styles:N}),!T&&!B&&(0,l.createElement)("div",{className:"edit-post-layout__metaboxes"},(0,l.createElement)(sa,{location:"normal"}),(0,l.createElement)(sa,{location:"advanced"})),e&&m&&(0,l.createElement)(_.ScrollLock,null)),footer:!T&&!e&&M&&d&&"visual"===i&&(0,l.createElement)("div",{className:"edit-post-layout__footer"},(0,l.createElement)(E.BlockBreadcrumb,{rootLabelText:I})),actions:(0,l.createElement)(Ba,{closeEntitiesSavedStates:V,isEntitiesSavedStatesOpen:A,setEntitiesSavedStatesCallback:D}),shortcuts:{previous:h,next:v}}),(0,l.createElement)(Dn,null),(0,l.createElement)(Oe,null),(0,l.createElement)(fa,null),(0,l.createElement)(S.PostSyncStatusModal,null),(0,l.createElement)(Aa,null),(0,l.createElement)(_.Popover.Slot,null),(0,l.createElement)(C.PluginArea,{onError:function(e){s((0,b.sprintf)((0,b.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}))};const Ra=e=>{const{hasBlockSelection:t,isEditorSidebarOpened:n}=(0,u.useSelect)((e=>({hasBlockSelection:!!e(E.store).getBlockSelectionStart(),isEditorSidebarOpened:e(nn).isEditorSidebarOpened()})),[e]),{openGeneralSidebar:o}=(0,u.useDispatch)(nn);(0,l.useEffect)((()=>{n&&o(t?"edit-post/block":"edit-post/document")}),[t,n])},Fa=e=>{const{newPermalink:t}=(0,u.useSelect)((e=>({newPermalink:e(S.store).getCurrentPost().link})),[e]),n=(0,l.useRef)();(0,l.useEffect)((()=>{n.current=document.querySelector("#wp-admin-bar-preview a")||document.querySelector("#wp-admin-bar-view a")}),[e]),(0,l.useEffect)((()=>{t&&n.current&&n.current.setAttribute("href",t)}),[t])};function Ha({postId:e}){return Ra(e),Fa(e),null}var Ga=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"}));var Ua=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"}));var za=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,l.createElement)(k.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"}));var Za=(0,l.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,l.createElement)(k.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"}));var $a=(0,l.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,l.createElement)(k.Path,{d:"M18,0 L2,0 C0.9,0 0.01,0.9 0.01,2 L0,12 C0,13.1 0.9,14 2,14 L18,14 C19.1,14 20,13.1 20,12 L20,2 C20,0.9 19.1,0 18,0 Z M18,12 L2,12 L2,2 L18,2 L18,12 Z M9,3 L11,3 L11,5 L9,5 L9,3 Z M9,6 L11,6 L11,8 L9,8 L9,6 Z M6,3 L8,3 L8,5 L6,5 L6,3 Z M6,6 L8,6 L8,8 L6,8 L6,6 Z M3,6 L5,6 L5,8 L3,8 L3,6 Z M3,3 L5,3 L5,5 L3,5 L3,3 Z M6,9 L14,9 L14,11 L6,11 L6,9 Z M12,6 L14,6 L14,8 L12,8 L12,6 Z M12,3 L14,3 L14,5 L12,5 L12,3 Z M15,6 L17,6 L17,8 L15,8 L15,6 Z M15,3 L17,3 L17,5 L15,5 L15,3 Z M10,20 L14,16 L6,16 L10,20 Z"}));const{ExperimentalEditorProvider:Wa}=mn(S.privateApis),{useCommands:qa}=mn(sn.privateApis);var ja=function({postId:e,postType:t,settings:n,initialEdits:o,...a}){qa(),function(){const{openGeneralSidebar:e,closeGeneralSidebar:t,switchEditorMode:n,setIsListViewOpened:o}=(0,u.useDispatch)(on),{openModal:a}=(0,u.useDispatch)(ee),{editorMode:r,activeSidebar:l,isListViewOpen:s}=(0,u.useSelect)((e=>{const{getEditorMode:t,isListViewOpened:n}=e(on);return{activeSidebar:e(ee).getActiveComplementaryArea(on.name),editorMode:t(),isListViewOpen:n()}}),[]),{toggle:i}=(0,u.useDispatch)(p.store);(0,ln.useCommand)({name:"core/open-settings-sidebar",label:(0,b.__)("Toggle settings sidebar"),icon:(0,b.isRTL)()?bo:fo,callback:({close:n})=>{n(),"edit-post/document"===l?t():e("edit-post/document")}}),(0,ln.useCommand)({name:"core/open-block-inspector",label:(0,b.__)("Toggle block inspector"),icon:Ga,callback:({close:n})=>{n(),"edit-post/block"===l?t():e("edit-post/block")}}),(0,ln.useCommand)({name:"core/toggle-distraction-free",label:(0,b.__)("Toggle distraction free"),icon:Ua,callback:({close:e})=>{i("core/edit-post","distractionFree"),e()}}),(0,ln.useCommand)({name:"core/toggle-spotlight-mode",label:(0,b.__)("Toggle spotlight mode"),icon:Ua,callback:({close:e})=>{i("core/edit-post","focusMode"),e()}}),(0,ln.useCommand)({name:"core/toggle-fullscreen-mode",label:(0,b.__)("Toggle fullscreen mode"),icon:za,callback:({close:e})=>{i("core/edit-post","fullscreenMode"),e()}}),(0,ln.useCommand)({name:"core/toggle-list-view",label:(0,b.__)("Toggle list view"),icon:Hn,callback:({close:e})=>{o(!s),e()}}),(0,ln.useCommand)({name:"core/toggle-top-toolbar",label:(0,b.__)("Toggle top toolbar"),icon:Ua,callback:({close:e})=>{i("core/edit-post","fixedToolbar"),e()}}),(0,ln.useCommand)({name:"core/toggle-code-editor",label:(0,b.__)("Toggle code editor"),icon:Za,callback:({close:e})=>{n("visual"===r?"text":"visual"),e()}}),(0,ln.useCommand)({name:"core/open-preferences",label:(0,b.__)("Open editor preferences"),icon:Ua,callback:()=>{a(An)}}),(0,ln.useCommand)({name:"core/open-shortcut-help",label:(0,b.__)("Open keyboard shortcuts"),icon:$a,callback:()=>{a(Ne)}})}();const{hasFixedToolbar:r,focusMode:i,isDistractionFree:c,hasInlineToolbar:d,post:m,preferredStyleVariations:g,hiddenBlockTypes:h,blockTypes:E,keepCaretInsideBlock:f,isTemplateMode:v,template:y}=(0,u.useSelect)((n=>{var o;const{isFeatureActive:a,isEditingTemplate:r,getEditedPostTemplate:l,getHiddenBlockTypes:i}=n(on),{getEntityRecord:c,getPostType:d,getEntityRecords:u,canUser:m}=n(w.store),{getEditorSettings:g}=n(S.store),{getBlockTypes:h}=n(s.store);let _;if(["wp_template","wp_template_part"].includes(t)){const n=u("postType",t,{wp_id:e});_=n?.[0]}else _=c("postType",t,e);const E=g().supportsTemplateMode,b=null!==(o=d(t)?.viewable)&&void 0!==o&&o,f=m("create","templates");return{hasFixedToolbar:a("fixedToolbar"),focusMode:a("focusMode"),isDistractionFree:a("distractionFree"),hasInlineToolbar:a("inlineToolbar"),preferredStyleVariations:n(p.store).get("core/edit-post","preferredStyleVariations"),hiddenBlockTypes:i(),blockTypes:h(),keepCaretInsideBlock:a("keepCaretInsideBlock"),isTemplateMode:r(),template:E&&b&&f?l():null,post:_}}),[t,e]),{updatePreferredStyleVariations:k,setIsInserterOpened:P}=(0,u.useDispatch)(on),C=(0,l.useMemo)((()=>{const e={...n,__experimentalPreferredStyleVariations:{value:g,onChange:k},hasFixedToolbar:r,focusMode:i,isDistractionFree:c,hasInlineToolbar:d,__experimentalSetIsInserterOpened:P,keepCaretInsideBlock:f,defaultAllowedBlockTypes:n.allowedBlockTypes};if(h.length>0){const t=!0===n.allowedBlockTypes?E.map((({name:e})=>e)):n.allowedBlockTypes||[];e.allowedBlockTypes=t.filter((e=>!h.includes(e)))}return e}),[n,r,d,i,c,h,E,g,P,k,f]);return m?(0,l.createElement)(xe.ShortcutProvider,null,(0,l.createElement)(_.SlotFillProvider,null,(0,l.createElement)(Wa,{settings:C,post:m,initialEdits:o,useSubRegistry:!1,__unstableTemplate:v?y:void 0,...a},(0,l.createElement)(S.ErrorBoundary,null,(0,l.createElement)(ln.CommandMenu,null),(0,l.createElement)(Ha,{postId:e}),(0,l.createElement)(Oa,null)),(0,l.createElement)(S.PostLockedModal,null)))):null};var Ka=({allowedBlocks:e,icon:t,label:n,onClick:o,small:a,role:r})=>(0,l.createElement)(E.BlockSettingsMenuControls,null,(({selectedBlocks:s,onClose:i})=>((e,t)=>{return!Array.isArray(t)||(n=t,0===e.filter((e=>!n.includes(e))).length);var n})(s,e)?(0,l.createElement)(_.MenuItem,{onClick:(0,f.compose)(o,i),icon:t,label:a?n:void 0,role:r},!a&&n):null)),Ya=(0,f.compose)((0,C.withPluginContext)(((e,t)=>{var n;return{as:null!==(n=t.as)&&void 0!==n?n:_.MenuItem,icon:t.icon||e.icon,name:"core/edit-post/plugin-more-menu"}})))(le);function Qa(e){return(0,l.createElement)(ie,{__unstableExplicitMenuItem:!0,scope:"core/edit-post",...e})}function Xa(e,t,n,o,a){const r=document.getElementById(e),c=(0,l.createRoot)(r);(0,u.dispatch)(p.store).setDefaults("core/edit-post",{editorMode:"visual",fixedToolbar:!1,fullscreenMode:!0,hiddenBlockTypes:[],inactivePanels:[],isPublishSidebarEnabled:!0,openPanels:["post-status"],preferredStyleVariations:{},showBlockBreadcrumbs:!0,showIconLabels:!1,showListViewByDefault:!1,themeStyles:!0,welcomeGuide:!0,welcomeGuideTemplate:!0}),(0,u.dispatch)(s.store).__experimentalReapplyBlockTypeFilters(),(0,u.select)(on).isFeatureActive("showListViewByDefault")&&!(0,u.select)(on).isFeatureActive("distractionFree")&&(0,u.dispatch)(on).setIsListViewOpened(!0),(0,i.registerCoreBlocks)(),(0,g.registerLegacyWidgetBlock)({inserter:!1}),(0,g.registerWidgetGroupBlock)({inserter:!1}),(0,m.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((e,t)=>!(!(0,u.select)(on).isEditingTemplate()&&"core/template-part"===t.name)&&e)),(0,m.addFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",((e,t,n,{getBlockParentsByBlockName:o})=>(0,u.select)(on).isEditingTemplate()||"core/post-content"!==t.name?e:o(n,"core/query").length>0));"Standards"!==("CSS1Compat"===document.compatMode?"Standards":"Quirks")&&console.warn("Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.");return-1!==window.navigator.userAgent.indexOf("iPhone")&&window.addEventListener("scroll",(e=>{const t=document.getElementsByClassName("interface-interface-skeleton__body")[0];e.target===document&&(window.scrollY>100&&(t.scrollTop=t.scrollTop+window.scrollY),document.getElementsByClassName("is-mode-visual")[0]&&window.scrollTo(0,0))})),window.addEventListener("dragover",(e=>e.preventDefault()),!1),window.addEventListener("drop",(e=>e.preventDefault()),!1),c.render((0,l.createElement)(ja,{settings:o,postId:n,postType:t,initialEdits:a})),c}function Ja(){d()("wp.editPost.reinitializeEditor",{since:"6.2",version:"6.3"})}}(),(window.wp=window.wp||{}).editPost=o}();