mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-14 22:56:19 +01:00
1de40f71be
This patch, somewhat small brings a lot to WordPress. This includes features like: - DataViews. - Customization tools like box shadow, background size and repeat. - UI improvements in the site editor. - Preferences sharing between the post and site editors. - Unified panels and editors between post and site editors. - Improved template mode in the post editor. - Iterations to multiple interactive blocks. - Preparing the blocks and UI for pattern overrides. - and a lot more. Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj. See #60315. Built from https://develop.svn.wordpress.org/trunk@57377 git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
7 lines
90 KiB
JavaScript
7 lines
90 KiB
JavaScript
/*! This file is auto-generated */
|
||
!function(){var e={4403:function(e,t){var o;
|
||
/*!
|
||
Copyright (c) 2018 Jed Watson.
|
||
Licensed under the MIT License (MIT), see
|
||
http://jedwatson.github.io/classnames
|
||
*/!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var a=typeof o;if("string"===a||"number"===a)e.push(o);else if(Array.isArray(o)){if(o.length){var s=r.apply(null,o);s&&e.push(s)}}else if("object"===a){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){e.push(o.toString());continue}for(var i in o)n.call(o,i)&&o[i]&&e.push(i)}}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(o=function(){return r}.apply(t,[]))||(e.exports=o)}()}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,o),a.exports}o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};!function(){"use strict";o.r(n),o.d(n,{PluginBlockSettingsMenuItem:function(){return hr},PluginDocumentSettingPanel:function(){return Sn},PluginMoreMenuItem:function(){return br},PluginPostPublishPanel:function(){return Gn},PluginPostStatusInfo:function(){return mn},PluginPrePublishPanel:function(){return $n},PluginSidebar:function(){return Pn},PluginSidebarMoreMenuItem:function(){return Er},__experimentalFullscreenModeClose:function(){return To},__experimentalMainDashboardButton:function(){return zo},__experimentalPluginPostExcerpt:function(){return fr},initializeEditor:function(){return _r},reinitializeEditor:function(){return vr},store:function(){return ro}});var e={};o.r(e),o.d(e,{closeModal:function(){return j},disableComplementaryArea:function(){return z},enableComplementaryArea:function(){return G},openModal:function(){return Q},pinItem:function(){return H},setDefaultComplementaryArea:function(){return V},setFeatureDefaults:function(){return q},setFeatureValue:function(){return W},toggleFeature:function(){return $},unpinItem:function(){return U}});var t={};o.r(t),o.d(t,{getActiveComplementaryArea:function(){return Y},isComplementaryAreaLoading:function(){return Z},isFeatureActive:function(){return K},isItemPinned:function(){return X},isModalActive:function(){return J}});var r={};o.r(r),o.d(r,{__experimentalSetPreviewDeviceType:function(){return gt},__unstableCreateTemplate:function(){return _t},__unstableSwitchToTemplateMode:function(){return ft},closeGeneralSidebar:function(){return Ye},closeModal:function(){return Xe},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 Ze},openPublishSidebar:function(){return Ke},removeEditorPanel:function(){return nt},requestMetaBoxUpdates:function(){return ut},setAvailableMetaBoxesPerLocation:function(){return dt},setIsEditingTemplate:function(){return Et},setIsInserterOpened:function(){return ht},setIsListViewOpened:function(){return bt},showBlockTypes:function(){return lt},switchEditorMode:function(){return at},toggleDistractionFree:function(){return wt},toggleEditorPanelEnabled:function(){return tt},toggleEditorPanelOpened:function(){return ot},toggleFeature:function(){return rt},togglePinnedPluginItem:function(){return st},togglePublishSidebar:function(){return et},updatePreferredStyleVariations:function(){return it}});var a={};o.r(a),o.d(a,{__experimentalGetInsertionPoint:function(){return Kt},__experimentalGetPreviewDeviceType:function(){return Zt},areMetaBoxesInitialized:function(){return to},getActiveGeneralSidebarName:function(){return It},getActiveMetaBoxLocations:function(){return Ut},getAllMetaBoxes:function(){return Qt},getEditedPostTemplate:function(){return oo},getEditorMode:function(){return Bt},getHiddenBlockTypes:function(){return Ft},getMetaBoxesPerLocation:function(){return qt},getPreference:function(){return Nt},getPreferences:function(){return Lt},hasMetaBoxes:function(){return jt},isEditingTemplate:function(){return eo},isEditorPanelEnabled:function(){return Ot},isEditorPanelOpened:function(){return Vt},isEditorPanelRemoved:function(){return Rt},isEditorSidebarOpened:function(){return Tt},isFeatureActive:function(){return zt},isInserterOpened:function(){return Xt},isListViewOpened:function(){return Jt},isMetaBoxLocationActive:function(){return Wt},isMetaBoxLocationVisible:function(){return $t},isModalActive:function(){return Gt},isPluginItemPinned:function(){return Ht},isPluginSidebarOpened:function(){return At},isPublishSidebarOpened:function(){return Dt},isSavingMetaBoxes:function(){return Yt}});var s=window.React,i=window.wp.blocks,l=window.wp.blockLibrary,c=window.wp.deprecated,d=o.n(c),u=window.wp.element,m=window.wp.data,p=window.wp.hooks,g=window.wp.preferences,h=window.wp.widgets,b=window.wp.editor,E=window.wp.mediaUtils;(0,p.addFilter)("editor.MediaUpload","core/edit-post/replace-media-upload",(()=>E.MediaUpload));var f=window.wp.components,_=window.wp.blockEditor,v=window.wp.i18n,y=window.wp.compose;const w=(0,y.compose)((0,m.withSelect)(((e,t)=>{if((0,i.hasBlockSupport)(t.name,"multiple",!0))return{};const o=e(_.store).getBlocks().find((({name:e})=>t.name===e));return{originalBlockClientId:o&&o.clientId!==t.clientId&&o.clientId}})),(0,m.withDispatch)(((e,{originalBlockClientId:t})=>({selectFirst:()=>e(_.store).selectBlock(t)})))),S=(0,y.createHigherOrderComponent)((e=>w((({originalBlockClientId:t,selectFirst:o,...n})=>{if(!t)return(0,s.createElement)(e,{...n});const r=(0,i.getBlockType)(n.name),a=function(e){const t=(0,i.findTransform)((0,i.getBlockTransforms)("to",e),(({type:e,blocks:t})=>"block"===e&&1===t.length));if(!t)return null;return(0,i.getBlockType)(t.blocks[0])}(n.name);return[(0,s.createElement)("div",{key:"invalid-preview",style:{minHeight:"60px"}},(0,s.createElement)(e,{key:"block-edit",...n})),(0,s.createElement)(_.Warning,{key:"multiple-use-warning",actions:[(0,s.createElement)(f.Button,{key:"find-original",variant:"secondary",onClick:o},(0,v.__)("Find original")),(0,s.createElement)(f.Button,{key:"remove",variant:"secondary",onClick:()=>n.onReplace([])},(0,v.__)("Remove")),a&&(0,s.createElement)(f.Button,{key:"transform",variant:"secondary",onClick:()=>n.onReplace((0,i.createBlock)(a.name,n.attributes))},(0,v.__)("Transform into:")," ",a.title)]},(0,s.createElement)("strong",null,r?.title,": "),(0,v.__)("This block can only be used once."))]}))),"withMultipleValidation");(0,p.addFilter)("editor.BlockEdit","core/edit-post/validate-multiple-use/with-multiple-validation",S);var P=window.wp.coreData,k=window.wp.primitives;var M=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.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,x=window.wp.url,B=window.wp.notices;function T(){const{createNotice:e}=(0,m.useDispatch)(B.store),{getEditedPostAttribute:t}=(0,m.useSelect)(b.store);const o=(0,y.useCopyToClipboard)((function(){return t("content")}),(function(){e("info",(0,v.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,s.createElement)(f.MenuItem,{ref:o},(0,v.__)("Copy all blocks"))}var A=window.wp.keycodes,I=o(4403),L=o.n(I);var N=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.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 F=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.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,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.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"})),R=window.wp.viewport;var O=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.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 V=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),G=(e,t)=>({registry:o,dispatch:n})=>{if(!t)return;o.select(g.store).get(e,"isComplementaryAreaVisible")||o.dispatch(g.store).set(e,"isComplementaryAreaVisible",!0),n({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},z=e=>({registry:t})=>{t.select(g.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(g.store).set(e,"isComplementaryAreaVisible",!1)},H=(e,t)=>({registry:o})=>{if(!t)return;const n=o.select(g.store).get(e,"pinnedItems");!0!==n?.[t]&&o.dispatch(g.store).set(e,"pinnedItems",{...n,[t]:!0})},U=(e,t)=>({registry:o})=>{if(!t)return;const n=o.select(g.store).get(e,"pinnedItems");o.dispatch(g.store).set(e,"pinnedItems",{...n,[t]:!1})};function $(e,t){return function({registry:o}){d()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),o.dispatch(g.store).toggle(e,t)}}function W(e,t,o){return function({registry:n}){d()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),n.dispatch(g.store).set(e,t,!!o)}}function q(e,t){return function({registry:o}){d()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),o.dispatch(g.store).setDefaults(e,t)}}function Q(e){return{type:"OPEN_MODAL",name:e}}function j(){return{type:"CLOSE_MODAL"}}const Y=(0,m.createRegistrySelector)((e=>(t,o)=>{const n=e(g.store).get(o,"isComplementaryAreaVisible");if(void 0!==n)return!1===n?null:t?.complementaryAreas?.[o]})),Z=(0,m.createRegistrySelector)((e=>(t,o)=>{const n=e(g.store).get(o,"isComplementaryAreaVisible"),r=t?.complementaryAreas?.[o];return n&&void 0===r})),X=(0,m.createRegistrySelector)((e=>(t,o,n)=>{var r;const a=e(g.store).get(o,"pinnedItems");return null===(r=a?.[n])||void 0===r||r})),K=(0,m.createRegistrySelector)((e=>(t,o,n)=>(d()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(g.store).get(o,n))));function J(e,t){return e.activeModal===t}var ee=(0,m.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:o,area:n}=t;return e[o]?e:{...e,[o]:n}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:o,area:n}=t;return{...e,[o]:n}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}});const te=(0,m.createReduxStore)("core/interface",{reducer:ee,actions:e,selectors:t});(0,m.register)(te);var oe=(0,C.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));var ne=oe((function({as:e=f.Button,scope:t,identifier:o,icon:n,selectedIcon:r,name:a,...i}){const l=e,c=(0,m.useSelect)((e=>e(te).getActiveComplementaryArea(t)===o),[o,t]),{enableComplementaryArea:d,disableComplementaryArea:u}=(0,m.useDispatch)(te);return(0,s.createElement)(l,{icon:r&&c?r:n,"aria-controls":o.replace("/",":"),onClick:()=>{c?u(t):d(t,o)},...i})}));var re=({smallScreenTitle:e,children:t,className:o,toggleButtonProps:n})=>{const r=(0,s.createElement)(ne,{icon:O,...n});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},e&&(0,s.createElement)("span",{className:"interface-complementary-area-header__small-title"},e),r),(0,s.createElement)("div",{className:L()("components-panel__header","interface-complementary-area-header",o),tabIndex:-1},t,r))};const ae=()=>{};function se({name:e,as:t=f.Button,onClick:o,...n}){return(0,s.createElement)(f.Fill,{name:e},(({onClick:e})=>(0,s.createElement)(t,{onClick:o||e?(...t)=>{(o||ae)(...t),(e||ae)(...t)}:void 0,...n})))}se.Slot=function({name:e,as:t=f.ButtonGroup,fillProps:o={},bubblesVirtually:n,...r}){return(0,s.createElement)(f.Slot,{name:e,bubblesVirtually:n,fillProps:o},(e=>{if(!u.Children.toArray(e).length)return null;const o=[];u.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&o.push(t)}));const n=u.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&o.includes(e.props.__unstableTarget)?null:e));return(0,s.createElement)(t,{...r},n)}))};var ie=se;const le=({__unstableExplicitMenuItem:e,__unstableTarget:t,...o})=>(0,s.createElement)(f.MenuItem,{...o});function ce({scope:e,target:t,__unstableExplicitMenuItem:o,...n}){return(0,s.createElement)(ne,{as:n=>(0,s.createElement)(ie,{__unstableExplicitMenuItem:o,__unstableTarget:`${e}/${t}`,as:le,name:`${e}/plugin-more-menu`,...n}),role:"menuitemcheckbox",selectedIcon:N,name:t,scope:e,...n})}function de({scope:e,...t}){return(0,s.createElement)(f.Fill,{name:`PinnedItems/${e}`,...t})}de.Slot=function({scope:e,className:t,...o}){return(0,s.createElement)(f.Slot,{name:`PinnedItems/${e}`,...o},(e=>e?.length>0&&(0,s.createElement)("div",{className:L()(t,"interface-pinned-items")},e)))};var ue=de;function me({scope:e,children:t,className:o,id:n}){return(0,s.createElement)(f.Fill,{name:`ComplementaryArea/${e}`},(0,s.createElement)("div",{id:n,className:o},t))}const pe=oe((function({children:e,className:t,closeLabel:o=(0,v.__)("Close plugin"),identifier:n,header:r,headerClassName:a,icon:i,isPinnable:l=!0,panelClassName:c,scope:d,name:p,smallScreenTitle:h,title:b,toggleShortcut:E,isActiveByDefault:_}){const{isLoading:y,isActive:w,isPinned:S,activeArea:P,isSmall:k,isLarge:M,showIconLabels:C}=(0,m.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:o,isItemPinned:r}=e(te),{get:a}=e(g.store),s=t(d);return{isLoading:o(d),isActive:s===n,isPinned:r(d,n),activeArea:s,isSmall:e(R.store).isViewportMatch("< medium"),isLarge:e(R.store).isViewportMatch("large"),showIconLabels:a("core","showIconLabels")}}),[n,d]);!function(e,t,o,n,r){const a=(0,u.useRef)(!1),s=(0,u.useRef)(!1),{enableComplementaryArea:i,disableComplementaryArea:l}=(0,m.useDispatch)(te);(0,u.useEffect)((()=>{n&&r&&!a.current?(l(e),s.current=!0):s.current&&!r&&a.current?(s.current=!1,i(e,t)):s.current&&o&&o!==t&&(s.current=!1),r!==a.current&&(a.current=r)}),[n,r,e,t,o,l,i])}(d,n,P,w,k);const{enableComplementaryArea:x,disableComplementaryArea:B,pinItem:T,unpinItem:A}=(0,m.useDispatch)(te);return(0,u.useEffect)((()=>{_&&void 0===P&&!k?x(d,n):void 0===P&&k&&B(d,n)}),[P,_,d,n,k,x,B]),(0,s.createElement)(s.Fragment,null,l&&(0,s.createElement)(ue,{scope:d},S&&(0,s.createElement)(ne,{scope:d,identifier:n,isPressed:w&&(!C||M),"aria-expanded":w,"aria-disabled":y,label:b,icon:C?N:i,showTooltip:!C,variant:C?"tertiary":void 0,size:"compact"})),p&&l&&(0,s.createElement)(ce,{target:p,scope:d,icon:i},b),w&&(0,s.createElement)(me,{className:L()("interface-complementary-area",t),scope:d,id:n.replace("/",":")},(0,s.createElement)(re,{className:a,closeLabel:o,onClose:()=>B(d),smallScreenTitle:h,toggleButtonProps:{label:o,shortcut:E,scope:d,identifier:n}},r||(0,s.createElement)(s.Fragment,null,(0,s.createElement)("strong",null,b),l&&(0,s.createElement)(f.Button,{className:"interface-complementary-area__pin-unpin-item",icon:S?F:D,label:S?(0,v.__)("Unpin from toolbar"):(0,v.__)("Pin to toolbar"),onClick:()=>(S?A:T)(d,n),isPressed:S,"aria-expanded":S}))),(0,s.createElement)(f.Panel,{className:c},e)))}));pe.Slot=function({scope:e,...t}){return(0,s.createElement)(f.Slot,{name:`ComplementaryArea/${e}`,...t})};var ge=pe;var he=({isActive:e})=>((0,u.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,u.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 be({children:e,className:t,ariaLabel:o,as:n="div",...r}){return(0,s.createElement)(n,{className:L()("interface-navigable-region",t),"aria-label":o,role:"region",tabIndex:"-1",...r},e)}const Ee={hidden:{opacity:0},hover:{opacity:1,transition:{type:"tween",delay:.2,delayChildren:.2}},distractionFreeInactive:{opacity:1,transition:{delay:0}}};var fe=(0,u.forwardRef)((function({isDistractionFree:e,footer:t,header:o,editorNotices:n,sidebar:r,secondarySidebar:a,notices:i,content:l,actions:c,labels:d,className:m,enableRegionNavigation:p=!0,shortcuts:g},h){const b=(0,f.__unstableUseNavigateRegions)(g);!function(e){(0,u.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,v._x)("Header","header landmark area"),body:(0,v.__)("Content"),secondarySidebar:(0,v.__)("Block Library"),sidebar:(0,v.__)("Settings"),actions:(0,v.__)("Publish"),footer:(0,v.__)("Footer")},...d};return(0,s.createElement)("div",{...p?b:{},ref:(0,y.useMergeRefs)([h,p?b.ref:void 0]),className:L()(m,"interface-interface-skeleton",b.className,!!t&&"has-footer")},(0,s.createElement)("div",{className:"interface-interface-skeleton__editor"},!!o&&(0,s.createElement)(be,{as:f.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":E.header,initial:e?"hidden":"distractionFreeInactive",whileHover:e?"hover":"distractionFreeInactive",animate:e?"hidden":"distractionFreeInactive",variants:Ee,transition:e?{type:"tween",delay:.8}:void 0},o),e&&(0,s.createElement)("div",{className:"interface-interface-skeleton__header"},n),(0,s.createElement)("div",{className:"interface-interface-skeleton__body"},!!a&&(0,s.createElement)(be,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:E.secondarySidebar},a),!!i&&(0,s.createElement)("div",{className:"interface-interface-skeleton__notices"},i),(0,s.createElement)(be,{className:"interface-interface-skeleton__content",ariaLabel:E.body},l),!!r&&(0,s.createElement)(be,{className:"interface-interface-skeleton__sidebar",ariaLabel:E.sidebar},r),!!c&&(0,s.createElement)(be,{className:"interface-interface-skeleton__actions",ariaLabel:E.actions},c))),!!t&&(0,s.createElement)(be,{className:"interface-interface-skeleton__footer",ariaLabel:E.footer},t))}));var _e=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function ve({as:e=f.DropdownMenu,className:t,label:o=(0,v.__)("Options"),popoverProps:n,toggleProps:r,children:a}){return(0,s.createElement)(e,{className:L()("interface-more-menu-dropdown",t),icon:_e,label:o,popoverProps:{placement:"bottom-end",...n,className:L()("interface-more-menu-dropdown__content",n?.className)},toggleProps:{tooltipPosition:"bottom",...r,size:"compact"}},(e=>a(e)))}var ye=window.wp.keyboardShortcuts;const we=[{keyCombination:{modifier:"primary",character:"b"},description:(0,v.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,v.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,v.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,v.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,v.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,v.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,v.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,v.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},description:(0,v.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,v.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")}];function Se({keyCombination:e,forceAriaLabel:t}){const o=e.modifier?A.displayShortcutList[e.modifier](e.character):e.character,n=e.modifier?A.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,s.createElement)("kbd",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||n},(Array.isArray(o)?o:[o]).map(((e,t)=>"+"===e?(0,s.createElement)(u.Fragment,{key:t},e):(0,s.createElement)("kbd",{key:t,className:"edit-post-keyboard-shortcut-help-modal__shortcut-key"},e))))}var Pe=function({description:e,keyCombination:t,aliases:o=[],ariaLabel:n}){return(0,s.createElement)(u.Fragment,null,(0,s.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-description"},e),(0,s.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-term"},(0,s.createElement)(Se,{keyCombination:t,forceAriaLabel:n}),o.map(((e,t)=>(0,s.createElement)(Se,{keyCombination:e,forceAriaLabel:n,key:t})))))};var ke=function({name:e}){const{keyCombination:t,description:o,aliases:n}=(0,m.useSelect)((t=>{const{getShortcutKeyCombination:o,getShortcutDescription:n,getShortcutAliases:r}=t(ye.store);return{keyCombination:o(e),aliases:r(e),description:n(e)}}),[e]);return t?(0,s.createElement)(Pe,{keyCombination:t,description:o,aliases:n}):null};const Me="edit-post/keyboard-shortcut-help",Ce=({shortcuts:e})=>(0,s.createElement)("ul",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-list",role:"list"},e.map(((e,t)=>(0,s.createElement)("li",{className:"edit-post-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,s.createElement)(ke,{name:e}):(0,s.createElement)(Pe,{...e}))))),xe=({title:e,shortcuts:t,className:o})=>(0,s.createElement)("section",{className:L()("edit-post-keyboard-shortcut-help-modal__section",o)},!!e&&(0,s.createElement)("h2",{className:"edit-post-keyboard-shortcut-help-modal__section-title"},e),(0,s.createElement)(Ce,{shortcuts:t})),Be=({title:e,categoryName:t,additionalShortcuts:o=[]})=>{const n=(0,m.useSelect)((e=>e(ye.store).getCategoryShortcuts(t)),[t]);return(0,s.createElement)(xe,{title:e,shortcuts:n.concat(o)})};var Te=(0,y.compose)([(0,m.withSelect)((e=>({isModalActive:e(te).isModalActive(Me)}))),(0,m.withDispatch)(((e,{isModalActive:t})=>{const{openModal:o,closeModal:n}=e(te);return{toggleModal:()=>t?n():o(Me)}}))])((function({isModalActive:e,toggleModal:t}){return(0,ye.useShortcut)("core/edit-post/keyboard-shortcuts",t),e?(0,s.createElement)(f.Modal,{className:"edit-post-keyboard-shortcut-help-modal",title:(0,v.__)("Keyboard shortcuts"),closeButtonLabel:(0,v.__)("Close"),onRequestClose:t},(0,s.createElement)(xe,{className:"edit-post-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-post/keyboard-shortcuts"]}),(0,s.createElement)(Be,{title:(0,v.__)("Global shortcuts"),categoryName:"global"}),(0,s.createElement)(Be,{title:(0,v.__)("Selection shortcuts"),categoryName:"selection"}),(0,s.createElement)(Be,{title:(0,v.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,v.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,v.__)("Forward-slash")}]}),(0,s.createElement)(xe,{title:(0,v.__)("Text formatting"),shortcuts:we})):null}));var Ae=(0,m.withDispatch)((e=>{const{openModal:t}=e(te);return{openModal:t}}))((function({openModal:e}){return(0,s.createElement)(f.MenuItem,{onClick:()=>{e(Me)},shortcut:A.displayShortcut.access("h")},(0,v.__)("Keyboard shortcuts"))}));const{Fill:Ie,Slot:Le}=(0,f.createSlotFill)("ToolsMoreMenuGroup");Ie.Slot=({fillProps:e})=>(0,s.createElement)(Le,{fillProps:e},(e=>e.length>0&&(0,s.createElement)(f.MenuGroup,{label:(0,v.__)("Tools")},e)));var Ne=Ie;function Fe(){const e=(0,m.useSelect)((e=>"template-only"===e(b.store).getRenderingMode()),[]);return(0,s.createElement)(g.PreferenceToggleMenuItem,{scope:"core/edit-post",name:e?"welcomeGuideTemplate":"welcomeGuide",label:(0,v.__)("Welcome Guide")})}function De(){const e=(0,m.useSelect)((e=>{const{canUser:t}=e(P.store),{getEditorSettings:o}=e(b.store),n=o().__unstableIsBlockBasedTheme,r=(0,x.addQueryArgs)("edit.php",{post_type:"wp_block"}),a=(0,x.addQueryArgs)("site-editor.php",{path:"/patterns"});return t("read","templates")&&n?a:r}),[]);return(0,s.createElement)(f.MenuItem,{role:"menuitem",href:e},(0,v.__)("Manage patterns"))}(0,C.registerPlugin)("edit-post",{render(){return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ne,null,(({onClose:e})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(De,null),(0,s.createElement)(Ae,{onSelect:e}),(0,s.createElement)(Fe,null),(0,s.createElement)(T,null),(0,s.createElement)(f.MenuItem,{role:"menuitem",icon:M,href:(0,v.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,v.__)("Help"),(0,s.createElement)(f.VisuallyHidden,{as:"span"},(0,v.__)("(opens in a new tab)")))))))}});var Re=window.wp.commands,Oe=window.wp.coreCommands;function Ve(e=[],t){const o=[...e];for(const e of t){const t=o.findIndex((t=>t.id===e.id));-1!==t?o[t]=e:o.push(e)}return o}const Ge=(0,m.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 o={...e};for(const[e,n]of Object.entries(t.metaBoxesPerLocation))o[e]=Ve(o[e],n);return o}return e},initialized:function(e=!1,t){return"META_BOXES_INITIALIZED"===t.type||e}});var ze=(0,m.combineReducers)({metaBoxes:Ge,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}}),He=window.wp.apiFetch,Ue=o.n(He),$e=window.wp.a11y;var We=window.wp.privateApis;const{lock:qe,unlock:Qe}=(0,We.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/edit-post"),je=e=>({dispatch:t,registry:o})=>{o.select(g.store).get("core","distractionFree")&&t.toggleDistractionFree(),o.dispatch(te).enableComplementaryArea(ro.name,e)},Ye=()=>({registry:e})=>e.dispatch(te).disableComplementaryArea(ro.name),Ze=e=>({registry:t})=>(d()("select( 'core/edit-post' ).openModal( name )",{since:"6.3",alternative:"select( 'core/interface').openModal( name )"}),t.dispatch(te).openModal(e)),Xe=()=>({registry:e})=>(d()("select( 'core/edit-post' ).closeModal()",{since:"6.3",alternative:"select( 'core/interface').closeModal()"}),e.dispatch(te).closeModal());function Ke(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function Je(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function et(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const tt=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelEnabled"}),t.dispatch(b.store).toggleEditorPanelEnabled(e)},ot=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).toggleEditorPanelOpened",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelOpened"}),t.dispatch(b.store).toggleEditorPanelOpened(e)},nt=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).removeEditorPanel",{since:"6.5",alternative:"dispatch( 'core/editor').removeEditorPanel"}),t.dispatch(b.store).removeEditorPanel(e)},rt=e=>({registry:t})=>t.dispatch(g.store).toggle("core/edit-post",e),at=e=>({dispatch:t,registry:o})=>{o.dispatch(g.store).set("core","editorMode",e),"visual"!==e&&o.dispatch(_.store).clearSelectedBlock(),"text"===e&&o.select(g.store).get("core","distractionFree")&&t.toggleDistractionFree();const n="visual"===e?(0,v.__)("Visual editor selected"):(0,v.__)("Code editor selected");(0,$e.speak)(n,"assertive")},st=e=>({registry:t})=>{const o=t.select(te).isItemPinned("core/edit-post",e);t.dispatch(te)[o?"unpinItem":"pinItem"]("core/edit-post",e)},it=(e,t)=>({registry:o})=>{var n;if(!e)return;const r=null!==(n=o.select(g.store).get("core/edit-post","preferredStyleVariations"))&&void 0!==n?n:{};if(t)o.dispatch(g.store).set("core/edit-post","preferredStyleVariations",{...r,[e]:t});else{const t={...r};delete t[e],o.dispatch(g.store).set("core/edit-post","preferredStyleVariations",t)}},lt=e=>({registry:t})=>{Qe(t.dispatch(b.store)).showBlockTypes(e)},ct=e=>({registry:t})=>{Qe(t.dispatch(b.store)).hideBlockTypes(e)};function dt(e){return{type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e}}const ut=()=>async({registry:e,select:t,dispatch:o})=>{o({type:"REQUEST_META_BOX_UPDATES"}),window.tinyMCE&&window.tinyMCE.triggerSave();const n=e.select(b.store).getCurrentPost(),r=[!!n.comment_status&&["comment_status",n.comment_status],!!n.ping_status&&["ping_status",n.ping_status],!!n.sticky&&["sticky",n.sticky],!!n.author&&["post_author",n.author]].filter(Boolean),a=[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[o,n]of t)e.append(o,n);return e}),new window.FormData);r.forEach((([e,t])=>a.append(e,t)));try{await Ue()({url:window._wpMetaBoxUrl,method:"POST",body:a,parse:!1}),o.metaBoxUpdatesSuccess()}catch{o.metaBoxUpdatesFailure()}};function mt(){return{type:"META_BOX_UPDATES_SUCCESS"}}function pt(){return{type:"META_BOX_UPDATES_FAILURE"}}const gt=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType",{since:"6.5",version:"6.7",hint:"registry.dispatch( editorStore ).setDeviceType"}),t.dispatch(b.store).setDeviceType(e)},ht=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).setIsInserterOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsInserterOpened"}),t.dispatch(b.store).setIsInserterOpened(e)},bt=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).setIsListViewOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsListViewOpened"}),t.dispatch(b.store).setIsListViewOpened(e)};function Et(){return d()("dispatch( 'core/edit-post' ).setIsEditingTemplate",{since:"6.5",alternative:"dispatch( 'core/editor').setRenderingMode"}),{type:"NOTHING"}}const ft=()=>({registry:e})=>{e.dispatch(b.store).setRenderingMode("template-only")};function _t(){return d()("dispatch( 'core/edit-post' ).__unstableCreateTemplate",{since:"6.5"}),{type:"NOTHING"}}let vt=!1;const yt=()=>({registry:e,select:t,dispatch:o})=>{if(!e.select(b.store).__unstableIsEditorReady())return;if(vt)return;const n=e.select(b.store).getCurrentPostType();window.postboxes.page!==n&&window.postboxes.add_postbox_toggles(n),vt=!0,(0,p.addFilter)("editor.__unstableSavePost","core/edit-post/save-metaboxes",((e,n)=>e.then((()=>{if(!n.isAutosave&&t.hasMetaBoxes())return o.requestMetaBoxUpdates()})))),o({type:"META_BOXES_INITIALIZED"})},wt=()=>({dispatch:e,registry:t})=>{const o=t.select(g.store).get("core","distractionFree");o||t.batch((()=>{t.dispatch(g.store).set("core","fixedToolbar",!0),t.dispatch(b.store).setIsInserterOpened(!1),t.dispatch(b.store).setIsListViewOpened(!1),e.closeGeneralSidebar()})),t.batch((()=>{t.dispatch(g.store).set("core","distractionFree",!o),t.dispatch(B.store).createInfoNotice(o?(0,v.__)("Distraction free off."):(0,v.__)("Distraction free on."),{id:"core/edit-post/distraction-free-mode/notice",type:"snackbar",actions:[{label:(0,v.__)("Undo"),onClick:()=>{t.dispatch(g.store).toggle("core","distractionFree")}}]})}))};var St={};function Pt(e){return[e]}function kt(e,t,o){var n;if(e.length!==t.length)return!1;for(n=o;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Mt(e,t){var o,n=t||Pt;function r(){o=new WeakMap}function a(){var t,r,a,s,i,l=arguments.length;for(s=new Array(l),a=0;a<l;a++)s[a]=arguments[a];for(t=function(e){var t,n,r,a,s,i=o,l=!0;for(t=0;t<e.length;t++){if(!(s=n=e[t])||"object"!=typeof s){l=!1;break}i.has(n)?i=i.get(n):(r=new WeakMap,i.set(n,r),i=r)}return i.has(St)||((a=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=l,i.set(St,a)),i.get(St)}(i=n.apply(null,s)),t.isUniqueByDependants||(t.lastDependants&&!kt(i,t.lastDependants,0)&&t.clear(),t.lastDependants=i),r=t.head;r;){if(kt(r.args,s,1))return r!==t.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=t.head,r.prev=null,t.head.prev=r,t.head=r),r.val;r=r.next}return r={val:e.apply(null,s)},s[0]=null,r.args=s,t.head&&(t.head.prev=r,r.next=t.head),t.head=r,r.val}return a.getDependants=n,a.clear=r,r(),a}const Ct=[],xt={},Bt=(0,m.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(g.store).get("core","editorMode"))&&void 0!==t?t:"visual"})),Tt=(0,m.createRegistrySelector)((e=>()=>{const t=e(te).getActiveComplementaryArea("core/edit-post");return["edit-post/document","edit-post/block"].includes(t)})),At=(0,m.createRegistrySelector)((e=>()=>{const t=e(te).getActiveComplementaryArea("core/edit-post");return!!t&&!["edit-post/document","edit-post/block"].includes(t)})),It=(0,m.createRegistrySelector)((e=>()=>e(te).getActiveComplementaryArea("core/edit-post")));const Lt=(0,m.createRegistrySelector)((e=>()=>{d()("select( 'core/edit-post' ).getPreferences",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const t=["preferredStyleVariations"].reduce(((t,o)=>({...t,[o]:e(g.store).get("core/edit-post",o)})),{}),o=["editorMode","hiddenBlockTypes"].reduce(((t,o)=>({...t,[o]:e(g.store).get("core",o)})),{}),n=function(e,t){var o;const n=e?.reduce(((e,t)=>({...e,[t]:{enabled:!1}})),{}),r=t?.reduce(((e,t)=>{const o=e?.[t];return{...e,[t]:{...o,opened:!0}}}),null!=n?n:{});return null!==(o=null!=r?r:n)&&void 0!==o?o:xt}(e(g.store).get("core","inactivePanels"),e(g.store).get("core","openPanels"));return{...t,...o,panels:n}}));function Nt(e,t,o){d()("select( 'core/edit-post' ).getPreference",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const n=Lt(e)[t];return void 0===n?o:n}const Ft=(0,m.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(g.store).get("core","hiddenBlockTypes"))&&void 0!==t?t:Ct}));function Dt(e){return e.publishSidebarActive}const Rt=(0,m.createRegistrySelector)((e=>(t,o)=>(d()("select( 'core/edit-post' ).isEditorPanelRemoved",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelRemoved"}),e(b.store).isEditorPanelRemoved(o)))),Ot=(0,m.createRegistrySelector)((e=>(t,o)=>(d()("select( 'core/edit-post' ).isEditorPanelEnabled",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelEnabled"}),e(b.store).isEditorPanelEnabled(o)))),Vt=(0,m.createRegistrySelector)((e=>(t,o)=>(d()("select( 'core/edit-post' ).isEditorPanelOpened",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelOpened"}),e(b.store).isEditorPanelOpened(o)))),Gt=(0,m.createRegistrySelector)((e=>(t,o)=>(d()("select( 'core/edit-post' ).isModalActive",{since:"6.3",alternative:"select( 'core/interface' ).isModalActive"}),!!e(te).isModalActive(o)))),zt=(0,m.createRegistrySelector)((e=>(t,o)=>!!e(g.store).get("core/edit-post",o))),Ht=(0,m.createRegistrySelector)((e=>(t,o)=>e(te).isItemPinned("core/edit-post",o))),Ut=Mt((e=>Object.keys(e.metaBoxes.locations).filter((t=>Wt(e,t)))),(e=>[e.metaBoxes.locations])),$t=(0,m.createRegistrySelector)((e=>(t,o)=>Wt(t,o)&&qt(t,o)?.some((({id:o})=>e(b.store).isEditorPanelEnabled(t,`meta-box-${o}`)))));function Wt(e,t){const o=qt(e,t);return!!o&&0!==o.length}function qt(e,t){return e.metaBoxes.locations[t]}const Qt=Mt((e=>Object.values(e.metaBoxes.locations).flat()),(e=>[e.metaBoxes.locations]));function jt(e){return Ut(e).length>0}function Yt(e){return e.metaBoxes.isSaving}const Zt=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-site' ).__experimentalGetPreviewDeviceType",{since:"6.5",version:"6.7",alternative:"select( 'core/editor' ).getDeviceType"}),e(b.store).getDeviceType()))),Xt=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-post' ).isInserterOpened",{since:"6.5",alternative:"select( 'core/editor' ).isInserterOpened"}),e(b.store).isInserterOpened()))),Kt=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-post' ).__experimentalGetInsertionPoint",{since:"6.5",version:"6.7"}),Qe(e(b.store)).getInsertionPoint()))),Jt=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-post' ).isListViewOpened",{since:"6.5",alternative:"select( 'core/editor' ).isListViewOpened"}),e(b.store).isListViewOpened()))),eo=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-post' ).isEditingTemplate",{since:"6.5",alternative:"select( 'core/editor' ).getRenderingMode"}),"post-only"!==e(b.store).getRenderingMode())));function to(e){return e.metaBoxes.initialized}const oo=(0,m.createRegistrySelector)((e=>()=>{const t=e(b.store).getEditedPostAttribute("template");if(t){const o=e(P.store).getEntityRecords("postType","wp_template",{per_page:-1})?.find((e=>e.slug===t));return o?e(P.store).getEditedEntityRecord("postType","wp_template",o.id):o}const o=e(b.store).getCurrentPost();let n;n=o.slug?"page"===o.type?`${o.type}-${o.slug}`:`single-${o.type}-${o.slug}`:"page"===o.type?"page":`single-${o.type}`;const r=e(P.store).getDefaultTemplateId({slug:n});return e(P.store).getEditedEntityRecord("postType","wp_template",r)})),no="core/edit-post",ro=(0,m.createReduxStore)(no,{reducer:ze,actions:r,selectors:a});function ao(){const e=(0,m.useSelect)((e=>e(b.store).getEditorSettings().richEditingEnabled),[]),{switchEditorMode:t}=(0,m.useDispatch)(ro),{isWelcomeGuideVisible:o}=(0,m.useSelect)((e=>{const{isFeatureActive:t}=e(ro);return{isWelcomeGuideVisible:t("welcomeGuide")}}),[]),n=(0,u.useRef)();return(0,u.useEffect)((()=>{o||n?.current?.focus()}),[o]),(0,s.createElement)("div",{className:"edit-post-text-editor"},e&&(0,s.createElement)("div",{className:"edit-post-text-editor__toolbar"},(0,s.createElement)("h2",null,(0,v.__)("Editing code")),(0,s.createElement)(f.Button,{variant:"tertiary",onClick:()=>t("visual"),shortcut:A.displayShortcut.secondary("m")},(0,v.__)("Exit code editor"))),(0,s.createElement)("div",{className:"edit-post-text-editor__body"},(0,s.createElement)(b.PostTitleRaw,{ref:n}),(0,s.createElement)(b.PostTextEditor,null)))}(0,m.register)(ro);const{EditorCanvas:so}=Qe(b.privateApis),io=!1;function lo({styles:e}){const{isWelcomeGuideVisible:t,renderingMode:o,isBlockBasedTheme:n,hasV3BlocksOnly:r}=(0,m.useSelect)((e=>{const{isFeatureActive:t}=e(ro),{getEditorSettings:o,getRenderingMode:n}=e(b.store),{getBlockTypes:r}=e(i.store),a=o();return{isWelcomeGuideVisible:t("welcomeGuide"),renderingMode:n(),isBlockBasedTheme:a.__unstableIsBlockBasedTheme,hasV3BlocksOnly:r().every((e=>e.apiVersion>=3))}}),[]),a=(0,m.useSelect)((e=>e(ro).hasMetaBoxes()),[]);let l;a||"post-only"!==o||(l="40vh"),e=(0,u.useMemo)((()=>[...e,{css:l?`body{padding-bottom:${l}}`:""}]),[e,l]);const c=(r||io&&n)&&!a||"template-only"===o;return(0,s.createElement)("div",{className:L()("edit-post-visual-editor",{"is-template-mode":"template-only"===o,"has-inline-canvas":!c})},(0,s.createElement)(so,{disableIframe:!c,styles:e,autoFocus:!t}))}var co=function(){const{getEditorMode:e,isEditorSidebarOpened:t}=(0,m.useSelect)(ro),o=(0,m.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:o}=e(b.store).getEditorSettings();return!t||!o}),[]),{switchEditorMode:n,openGeneralSidebar:r,closeGeneralSidebar:a,toggleFeature:s,toggleDistractionFree:l}=(0,m.useDispatch)(ro),{registerShortcut:c}=(0,m.useDispatch)(ye.store),{replaceBlocks:d}=(0,m.useDispatch)(_.store),{getBlockName:p,getSelectedBlockClientId:g,getBlockAttributes:h,getBlockSelectionStart:E}=(0,m.useSelect)(_.store),f=(e,t)=>{e.preventDefault();const o=0===t?"core/paragraph":"core/heading",n=g();if(null===n)return;const r=p(n);if("core/paragraph"!==r&&"core/heading"!==r)return;const a=h(n),s="core/paragraph"===r?"align":"textAlign",l="core/paragraph"===o?"align":"textAlign";d(n,(0,i.createBlock)(o,{level:t,content:a.content,[l]:a[s]}))};return(0,u.useEffect)((()=>{c({name:"core/edit-post/toggle-mode",category:"global",description:(0,v.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),c({name:"core/edit-post/toggle-distraction-free",category:"global",description:(0,v.__)("Toggle distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),c({name:"core/edit-post/toggle-fullscreen",category:"global",description:(0,v.__)("Toggle fullscreen mode."),keyCombination:{modifier:"secondary",character:"f"}}),c({name:"core/edit-post/toggle-sidebar",category:"global",description:(0,v.__)("Show or hide the Settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),c({name:"core/edit-post/next-region",category:"global",description:(0,v.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),c({name:"core/edit-post/previous-region",category:"global",description:(0,v.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]}),c({name:"core/edit-post/keyboard-shortcuts",category:"main",description:(0,v.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),c({name:"core/edit-post/transform-heading-to-paragraph",category:"block-library",description:(0,v.__)("Transform heading to paragraph."),keyCombination:{modifier:"access",character:"0"}}),[1,2,3,4,5,6].forEach((e=>{c({name:`core/edit-post/transform-paragraph-to-heading-${e}`,category:"block-library",description:(0,v.__)("Transform paragraph to heading."),keyCombination:{modifier:"access",character:`${e}`}})}))}),[]),(0,ye.useShortcut)("core/edit-post/toggle-mode",(()=>{n("visual"===e()?"text":"visual")}),{isDisabled:o}),(0,ye.useShortcut)("core/edit-post/toggle-fullscreen",(()=>{s("fullscreenMode")})),(0,ye.useShortcut)("core/edit-post/toggle-distraction-free",(()=>{l()})),(0,ye.useShortcut)("core/edit-post/toggle-sidebar",(e=>{if(e.preventDefault(),t())a();else{const e=E()?"edit-post/block":"edit-post/document";r(e)}})),(0,ye.useShortcut)("core/edit-post/transform-heading-to-paragraph",(e=>f(e,0))),[1,2,3,4,5,6].forEach((e=>{(0,ye.useShortcut)(`core/edit-post/transform-paragraph-to-heading-${e}`,(t=>f(t,e)))})),null};const{PreferenceBaseOption:uo}=Qe(g.privateApis);function mo({willEnable:e}){const[t,o]=(0,u.useState)(!1);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("p",{className:"edit-post-preferences-modal__custom-fields-confirmation-message"},(0,v.__)("A page reload is required for this change. Make sure your content is saved before reloading.")),(0,s.createElement)(f.Button,{className:"edit-post-preferences-modal__custom-fields-confirmation-button",variant:"secondary",isBusy:t,disabled:t,onClick:()=>{o(!0),function(){const e=document.getElementById("toggle-custom-fields-form");e.querySelector('[name="_wp_http_referer"]').setAttribute("value",(0,x.getPathAndQueryString)(window.location.href)),e.submit()}()}},e?(0,v.__)("Show & Reload Page"):(0,v.__)("Hide & Reload Page")))}var po=(0,m.withSelect)((e=>({areCustomFieldsEnabled:!!e(b.store).getEditorSettings().enableCustomFields})))((function({label:e,areCustomFieldsEnabled:t}){const[o,n]=(0,u.useState)(t);return(0,s.createElement)(uo,{label:e,isChecked:o,onChange:n},o!==t&&(0,s.createElement)(mo,{willEnable:o}))}));const{PreferenceBaseOption:go}=Qe(g.privateApis);var ho=(0,y.compose)((0,m.withSelect)(((e,{panelName:t})=>{const{isEditorPanelEnabled:o,isEditorPanelRemoved:n}=e(b.store);return{isRemoved:n(t),isChecked:o(t)}})),(0,y.ifCondition)((({isRemoved:e})=>!e)),(0,m.withDispatch)(((e,{panelName:t})=>({onChange:()=>e(b.store).toggleEditorPanelEnabled(t)}))))(go);const{PreferencesModalSection:bo}=Qe(g.privateApis);var Eo=(0,m.withSelect)((e=>{const{getEditorSettings:t}=e(b.store),{getAllMetaBoxes:o}=e(ro);return{areCustomFieldsRegistered:void 0!==t().enableCustomFields,metaBoxes:o()}}))((function({areCustomFieldsRegistered:e,metaBoxes:t,...o}){const n=t.filter((({id:e})=>"postcustom"!==e));return e||0!==n.length?(0,s.createElement)(bo,{...o},e&&(0,s.createElement)(po,{label:(0,v.__)("Custom fields")}),n.map((({id:e,title:t})=>(0,s.createElement)(ho,{key:e,label:t,panelName:`meta-box-${e}`})))):null}));const{PreferenceBaseOption:fo}=Qe(g.privateApis);var _o=(0,y.compose)((0,m.withSelect)((e=>({isChecked:e(b.store).isPublishSidebarEnabled()}))),(0,m.withDispatch)((e=>{const{enablePublishSidebar:t,disablePublishSidebar:o}=e(b.store);return{onChange:e=>e?t():o()}})),(0,R.ifViewportMatches)("medium"))(fo);const{PreferencesModalSection:vo,PreferenceToggleControl:yo}=Qe(g.privateApis),{PreferencesModal:wo}=Qe(b.privateApis),So="edit-post/preferences";function Po(){const e=(0,y.useViewportMatch)("medium"),{closeModal:t}=(0,m.useDispatch)(te),{isModalActive:o}=(0,m.useSelect)((e=>({isModalActive:e(te).isModalActive(So)})),[]),n={general:(0,s.createElement)(s.Fragment,null,e&&(0,s.createElement)(vo,{title:(0,v.__)("Publishing")},(0,s.createElement)(_o,{help:(0,v.__)("Review settings, such as visibility and tags."),label:(0,v.__)("Enable pre-publish checks")})),(0,s.createElement)(Eo,{title:(0,v.__)("Advanced")})),appearance:(0,s.createElement)(yo,{scope:"core/edit-post",featureName:"themeStyles",help:(0,v.__)("Make the editor look like your theme."),label:(0,v.__)("Use theme styles")})};return o?(0,s.createElement)(wo,{extraSections:n,isActive:o,onClose:t}):null}class ko extends u.Component{constructor(){super(...arguments),this.state={historyId:null}}componentDidUpdate(e){const{postId:t,postStatus:o,postType:n,isSavingPost:r,hasHistory:a}=this.props,{historyId:s}=this.state;"trash"!==o||r?t===e.postId&&t===s||"auto-draft"===o||!t||a||this.setBrowserURL(t):this.setTrashURL(t,n)}setTrashURL(e,t){window.location.href=function(e,t){return(0,x.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,x.addQueryArgs)("post.php",{post:e,action:"edit"})}(e)),this.setState((()=>({historyId:e})))}render(){return null}}var Mo=(0,m.withSelect)((e=>{const{getCurrentPost:t,isSavingPost:o}=e(b.store),n=t();let{id:r,status:a,type:s}=n;return["wp_template","wp_template_part"].includes(s)&&(r=n.wp_id),{postId:r,postStatus:a,postType:s,isSavingPost:o()}}))(ko);var Co=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"}));var xo=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"}));var Bo=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.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 To=function({showTooltip:e,icon:t,href:o}){var n;const{isActive:r,isRequestingSiteIcon:a,postType:i,siteIconUrl:l}=(0,m.useSelect)((e=>{const{getCurrentPostType:t}=e(b.store),{isFeatureActive:o}=e(ro),{getEntityRecord:n,getPostType:r,isResolving:a}=e(P.store),s=n("root","__unstableBase",void 0)||{};return{isActive:o("fullscreenMode"),isRequestingSiteIcon:a("getEntityRecord",["root","__unstableBase",void 0]),postType:r(t()),siteIconUrl:s.site_icon_url}}),[]),c=(0,y.useReducedMotion)();if(!r||!i)return null;let d=(0,s.createElement)(f.Icon,{size:"36px",icon:Bo});const u={expand:{scale:1.25,transition:{type:"tween",duration:"0.3"}}};l&&(d=(0,s.createElement)(f.__unstableMotion.img,{variants:!c&&u,alt:(0,v.__)("Site Icon"),className:"edit-post-fullscreen-mode-close_site-icon",src:l})),a&&(d=null),t&&(d=(0,s.createElement)(f.Icon,{size:"36px",icon:t}));const p=L()({"edit-post-fullscreen-mode-close":!0,"has-icon":l});return(0,s.createElement)(f.__unstableMotion.div,{whileHover:"expand"},(0,s.createElement)(f.Button,{className:p,href:null!=o?o:(0,x.addQueryArgs)("edit.php",{post_type:i.slug}),label:null!==(n=i?.labels?.view_items)&&void 0!==n?n:(0,v.__)("Back"),showTooltip:e},d))};const Ao=[{value:"visual",label:(0,v.__)("Visual editor")},{value:"text",label:(0,v.__)("Code editor")}];var Io=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:o,isEditingTemplate:n,mode:r}=(0,m.useSelect)((e=>({shortcut:e(ye.store).getShortcutRepresentation("core/edit-post/toggle-mode"),isRichEditingEnabled:e(b.store).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(b.store).getEditorSettings().codeEditingEnabled,isEditingTemplate:"template-only"===e(b.store).getRenderingMode(),mode:e(ro).getEditorMode()})),[]),{switchEditorMode:a}=(0,m.useDispatch)(ro);if(n)return null;let i=r;t||"visual"!==r||(i="text"),o||"text"!==r||(i="visual");const l=Ao.map((n=>(o||"text"!==n.value||(n={...n,disabled:!0}),t||"visual"!==n.value||(n={...n,disabled:!0,info:(0,v.__)("You can enable the visual editor in your profile settings.")}),n.value===i||n.disabled?n:{...n,shortcut:e})));return(0,s.createElement)(f.MenuGroup,{label:(0,v.__)("Editor")},(0,s.createElement)(f.MenuItemsChoice,{choices:l,value:i,onSelect:a}))};function Lo(){const{openModal:e}=(0,m.useDispatch)(te);return(0,s.createElement)(f.MenuItem,{onClick:()=>{e(So)}},(0,v.__)("Preferences"))}var No=function(){const e=(0,m.useRegistry)(),{closeGeneralSidebar:t}=(0,m.useDispatch)(ro),{set:o}=(0,m.useDispatch)(g.store),{setIsInserterOpened:n,setIsListViewOpened:r}=(0,m.useDispatch)(b.store);return(0,y.useViewportMatch)("medium")?(0,s.createElement)(f.MenuGroup,{label:(0,v._x)("View","noun")},(0,s.createElement)(g.PreferenceToggleMenuItem,{scope:"core",name:"fixedToolbar",onToggle:()=>{o("core","distractionFree",!1)},label:(0,v.__)("Top toolbar"),info:(0,v.__)("Access all block and document tools in a single place"),messageActivated:(0,v.__)("Top toolbar activated"),messageDeactivated:(0,v.__)("Top toolbar deactivated")}),(0,s.createElement)(g.PreferenceToggleMenuItem,{scope:"core",name:"distractionFree",onToggle:()=>{e.batch((()=>{o("core","fixedToolbar",!0),n(!1),r(!1),t()}))},label:(0,v.__)("Distraction free"),info:(0,v.__)("Write with calmness"),messageActivated:(0,v.__)("Distraction free mode activated"),messageDeactivated:(0,v.__)("Distraction free mode deactivated"),shortcut:A.displayShortcut.primaryShift("\\")}),(0,s.createElement)(g.PreferenceToggleMenuItem,{scope:"core",name:"focusMode",label:(0,v.__)("Spotlight mode"),info:(0,v.__)("Focus on one block at a time"),messageActivated:(0,v.__)("Spotlight mode activated"),messageDeactivated:(0,v.__)("Spotlight mode deactivated")}),(0,s.createElement)(g.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fullscreenMode",label:(0,v.__)("Fullscreen mode"),info:(0,v.__)("Show and hide the admin user interface"),messageActivated:(0,v.__)("Fullscreen mode activated"),messageDeactivated:(0,v.__)("Fullscreen mode deactivated"),shortcut:A.displayShortcut.secondary("f")})):null};var Fo=({showIconLabels:e})=>{const t=(0,y.useViewportMatch)("large");return(0,s.createElement)(ve,{toggleProps:{showTooltip:!e,...e&&{variant:"tertiary"},size:"compact"}},(({onClose:o})=>(0,s.createElement)(s.Fragment,null,e&&!t&&(0,s.createElement)(ue.Slot,{className:e&&"show-icon-labels",scope:"core/edit-post"}),(0,s.createElement)(No,null),(0,s.createElement)(Io,null),(0,s.createElement)(ie.Slot,{name:"core/edit-post/plugin-more-menu",label:(0,v.__)("Plugins"),as:f.MenuGroup,fillProps:{onClick:o}}),(0,s.createElement)(Ne.Slot,{fillProps:{onClose:o}}),(0,s.createElement)(f.MenuGroup,null,(0,s.createElement)(Lo,null)))))};var Do=(0,y.compose)((0,m.withSelect)((e=>{var t;return{hasPublishAction:null!==(t=e(b.store).getCurrentPost()?._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:e(b.store).isEditedPostBeingScheduled(),isPending:e(b.store).isCurrentPostPending(),isPublished:e(b.store).isCurrentPostPublished(),isPublishSidebarEnabled:e(b.store).isPublishSidebarEnabled(),isPublishSidebarOpened:e(ro).isPublishSidebarOpened(),isScheduled:e(b.store).isCurrentPostScheduled()}})),(0,m.withDispatch)((e=>{const{togglePublishSidebar:t}=e(ro);return{togglePublishSidebar:t}})))((function({forceIsDirty:e,hasPublishAction:t,isBeingScheduled:o,isPending:n,isPublished:r,isPublishSidebarEnabled:a,isPublishSidebarOpened:i,isScheduled:l,togglePublishSidebar:c,setEntitiesSavedStatesCallback:d}){const u="toggle",m="button",p=(0,y.useViewportMatch)("medium","<");let g;return g=r||l&&o||n&&!t&&!p?m:p||a?u:m,(0,s.createElement)(b.PostPublishButton,{forceIsDirty:e,isOpen:i,isToggle:g===u,onToggle:c,setEntitiesSavedStatesCallback:d})}));const Ro="__experimentalMainDashboardButton",{Fill:Oo,Slot:Vo}=(0,f.createSlotFill)(Ro),Go=Oo;Go.Slot=({children:e})=>{const t=(0,f.__experimentalUseSlotFills)(Ro);return Boolean(t&&t.length)?(0,s.createElement)(Vo,{bubblesVirtually:!0}):e};var zo=Go;const{DocumentTools:Ho,PostViewLink:Uo,PreviewDropdown:$o}=Qe(b.privateApis),Wo={hidden:{y:"-50px"},distractionFreeInactive:{y:0},hover:{y:0,transition:{type:"tween",delay:.2}}},qo={hidden:{x:"-100%"},distractionFreeInactive:{x:0},hover:{x:0,transition:{type:"tween",delay:.2}}};var Qo=function({setEntitiesSavedStatesCallback:e}){const t=(0,y.useViewportMatch)("large"),o=(0,y.useViewportMatch)("medium"),n=(0,u.useRef)(),{isTextEditor:r,hasBlockSelection:a,hasActiveMetaboxes:i,hasFixedToolbar:l,isEditingTemplate:c,isPublishSidebarOpened:d,showIconLabels:p,hasHistory:h}=(0,m.useSelect)((e=>{const{get:t}=e(g.store),{getEditorMode:o}=e(ro);return{isTextEditor:"text"===o(),hasBlockSelection:!!e(_.store).getBlockSelectionStart(),hasActiveMetaboxes:e(ro).hasMetaBoxes(),hasHistory:!!e(b.store).getEditorSettings().goBack,isEditingTemplate:"template-only"===e(b.store).getRenderingMode(),isPublishSidebarOpened:e(ro).isPublishSidebarOpened(),hasFixedToolbar:t("core","fixedToolbar"),showIconLabels:t("core","showIconLabels")}}),[]),[E,w]=(0,u.useState)(!0);return(0,u.useEffect)((()=>{a&&w(!1)}),[a]),(0,s.createElement)("div",{className:"edit-post-header"},(0,s.createElement)(zo.Slot,null,(0,s.createElement)(f.__unstableMotion.div,{variants:qo,transition:{type:"tween",delay:.8}},(0,s.createElement)(To,{showTooltip:!0}))),(0,s.createElement)(f.__unstableMotion.div,{variants:Wo,transition:{type:"tween",delay:.8},className:"edit-post-header__toolbar"},(0,s.createElement)(Ho,{disableBlockTools:r}),l&&o&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:L()("selected-block-tools-wrapper",{"is-collapsed":E})},(0,s.createElement)(_.BlockToolbar,{hideDragHandle:!0})),(0,s.createElement)(f.Popover.Slot,{ref:n,name:"block-toolbar"}),a&&(0,s.createElement)(f.Button,{className:"edit-post-header__block-tools-toggle",icon:E?Co:xo,onClick:()=>{w((e=>!e))},label:E?(0,v.__)("Show block tools"):(0,v.__)("Hide block tools")})),(0,s.createElement)("div",{className:L()("edit-post-header__center",{"is-collapsed":c&&a&&!E&&l&&o})},(c||h)&&(0,s.createElement)(b.DocumentBar,null))),(0,s.createElement)(f.__unstableMotion.div,{variants:Wo,transition:{type:"tween",delay:.8},className:"edit-post-header__settings"},!d&&(0,s.createElement)(b.PostSavedState,{forceIsDirty:i}),(0,s.createElement)($o,{forceIsAutosaveable:i}),(0,s.createElement)(b.PostPreviewButton,{className:"edit-post-header__post-preview-button",forceIsAutosaveable:i}),(0,s.createElement)(Uo,null),(0,s.createElement)(Do,{forceIsDirty:i,setEntitiesSavedStatesCallback:e}),(t||!p)&&(0,s.createElement)(ue.Slot,{scope:"core/edit-post"}),(0,s.createElement)(Fo,{showIconLabels:p})))};var jo=(0,s.createElement)(k.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.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 Yo=(0,s.createElement)(k.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.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"}));const{Tabs:Zo}=Qe(f.privateApis);var Xo=()=>{const{documentLabel:e,isTemplateMode:t}=(0,m.useSelect)((e=>{const{getPostTypeLabel:t,getRenderingMode:o}=e(b.store);return{documentLabel:t()||(0,v._x)("Document","noun"),isTemplateMode:"template-only"===o()}}),[]);return(0,s.createElement)(Zo.TabList,null,(0,s.createElement)(Zo.Tab,{tabId:Tn.document},t?(0,v.__)("Template"):e),(0,s.createElement)(Zo.Tab,{tabId:Tn.block},(0,v.__)("Block")))};const{PostPanelRow:Ko}=Qe(b.privateApis);function Jo({isOpen:e,onClick:t}){const o=(0,b.usePostVisibilityLabel)();return(0,s.createElement)(f.Button,{className:"edit-post-post-visibility__toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,v.sprintf)((0,v.__)("Select visibility: %s"),o),onClick:t},o)}var en=function(){const[e,t]=(0,u.useState)(null),o=(0,u.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,s.createElement)(b.PostVisibilityCheck,{render:({canEdit:e})=>(0,s.createElement)(Ko,{label:(0,v.__)("Visibility"),ref:t},!e&&(0,s.createElement)("span",null,(0,s.createElement)(b.PostVisibilityLabel,null)),e&&(0,s.createElement)(f.Dropdown,{contentClassName:"edit-post-post-visibility__dialog",popoverProps:o,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,s.createElement)(Jo,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,s.createElement)(b.PostVisibility,{onClose:e})}))})};function tn(){return(0,s.createElement)(b.PostTrashCheck,null,(0,s.createElement)(b.PostTrash,null))}const{PostPanelRow:on}=Qe(b.privateApis);var nn=function(){return(0,s.createElement)(b.PostStickyCheck,null,(0,s.createElement)(on,null,(0,s.createElement)(b.PostSticky,null)))};var rn=function(){return(0,s.createElement)(b.PostSlugCheck,null,(0,s.createElement)(f.PanelRow,{className:"edit-post-post-slug"},(0,s.createElement)(b.PostSlug,null)))};var an=function(){return(0,s.createElement)(b.PostFormatCheck,null,(0,s.createElement)(f.PanelRow,{className:"edit-post-post-format"},(0,s.createElement)(b.PostFormat,null)))};const{PostPanelRow:sn}=Qe(b.privateApis);var ln=function(){return(0,s.createElement)(b.PostPendingStatusCheck,null,(0,s.createElement)(sn,null,(0,s.createElement)(b.PostPendingStatus,null)))};const{Fill:cn,Slot:dn}=(0,f.createSlotFill)("PluginPostStatusInfo"),un=({children:e,className:t})=>(0,s.createElement)(cn,null,(0,s.createElement)(f.PanelRow,{className:t},e));un.Slot=dn;var mn=un;const pn="post-status";function gn(){const{isOpened:e,isRemoved:t}=(0,m.useSelect)((e=>{const{isEditorPanelRemoved:t,isEditorPanelOpened:o}=e(b.store);return{isRemoved:t(pn),isOpened:o(pn)}}),[]),{toggleEditorPanelOpened:o}=(0,m.useDispatch)(b.store);return t?null:(0,s.createElement)(f.PanelBody,{className:"edit-post-post-status",title:(0,v.__)("Summary"),opened:e,onToggle:()=>o(pn)},(0,s.createElement)(mn.Slot,null,(e=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(en,null),(0,s.createElement)(b.PostSchedulePanel,null),(0,s.createElement)(b.PostTemplatePanel,null),(0,s.createElement)(b.PostURLPanel,null),(0,s.createElement)(b.PostSyncStatus,null),(0,s.createElement)(nn,null),(0,s.createElement)(ln,null),(0,s.createElement)(an,null),(0,s.createElement)(rn,null),(0,s.createElement)(b.PostAuthorPanel,null),e,(0,s.createElement)(f.__experimentalHStack,{style:{marginTop:"16px"},spacing:4,wrap:!0},(0,s.createElement)(b.PostSwitchToDraftButton,null),(0,s.createElement)(tn,null))))))}var hn=function({location:e}){const t=(0,u.useRef)(null),o=(0,u.useRef)(null);(0,u.useEffect)((()=>(o.current=document.querySelector(".metabox-location-"+e),o.current&&t.current.appendChild(o.current),()=>{o.current&&document.querySelector("#metaboxes").appendChild(o.current)})),[e]);const n=(0,m.useSelect)((e=>e(ro).isSavingMetaBoxes()),[]),r=L()("edit-post-meta-boxes-area",`is-${e}`,{"is-loading":n});return(0,s.createElement)("div",{className:r},n&&(0,s.createElement)(f.Spinner,null),(0,s.createElement)("div",{className:"edit-post-meta-boxes-area__container",ref:t}),(0,s.createElement)("div",{className:"edit-post-meta-boxes-area__clear"}))};class bn extends u.Component{componentDidMount(){this.updateDOM()}componentDidUpdate(e){this.props.isVisible!==e.isVisible&&this.updateDOM()}updateDOM(){const{id:e,isVisible:t}=this.props,o=document.getElementById(e);o&&(t?o.classList.remove("is-hidden"):o.classList.add("is-hidden"))}render(){return null}}var En=(0,m.withSelect)(((e,{id:t})=>({isVisible:e(b.store).isEditorPanelEnabled(`meta-box-${t}`)})))(bn);function fn({location:e}){const t=(0,m.useRegistry)(),{metaBoxes:o,areMetaBoxesInitialized:n,isEditorReady:r}=(0,m.useSelect)((t=>{const{__unstableIsEditorReady:o}=t(b.store),{getMetaBoxesPerLocation:n,areMetaBoxesInitialized:r}=t(ro);return{metaBoxes:n(e),areMetaBoxesInitialized:r(),isEditorReady:o()}}),[e]),a=!!o?.length;return(0,u.useEffect)((()=>{r&&a&&!n&&t.dispatch(ro).initializeMetaBoxes()}),[r,a,n]),n?(0,s.createElement)(s.Fragment,null,(null!=o?o:[]).map((({id:e})=>(0,s.createElement)(En,{key:e,id:e}))),(0,s.createElement)(hn,{location:e})):null}window.wp.warning;const{Fill:_n,Slot:vn}=(0,f.createSlotFill)("PluginDocumentSettingPanel"),{EnablePluginDocumentSettingPanelOption:yn}=Qe(b.privateApis),wn=({name:e,className:t,title:o,icon:n,children:r})=>{const{name:a}=(0,C.usePluginContext)(),i=`${a}/${e}`,{opened:l,isEnabled:c}=(0,m.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:o}=e(b.store);return{opened:t(i),isEnabled:o(i)}}),[i]),{toggleEditorPanelOpened:d}=(0,m.useDispatch)(b.store);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(yn,{label:o,panelName:i}),(0,s.createElement)(_n,null,c&&(0,s.createElement)(f.PanelBody,{className:t,title:o,icon:n,opened:l,onToggle:()=>d(i)},r)))};wn.Slot=vn;var Sn=wn;function Pn({className:e,...t}){const{postTitle:o,shortcut:n}=(0,m.useSelect)((e=>({postTitle:e(b.store).getEditedPostAttribute("title"),shortcut:e(ye.store).getShortcutRepresentation("core/edit-post/toggle-sidebar")})),[]);return(0,s.createElement)(ge,{panelClassName:e,className:"edit-post-sidebar",smallScreenTitle:o||(0,v.__)("(no title)"),scope:"core/edit-post",toggleShortcut:n,...t})}var kn=(0,u.forwardRef)((function({icon:e,size:t=24,...o},n){return(0,u.cloneElement)(e,{width:t,height:t,...o,ref:n})}));var Mn=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.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 Cn=function(){const e=(0,m.useSelect)((e=>{const{getEditedPostTemplate:t}=e(ro);return t()}),[]);return e?(0,s.createElement)(f.PanelBody,null,(0,s.createElement)(f.Flex,{align:"flex-start",gap:"3"},(0,s.createElement)(f.FlexItem,null,(0,s.createElement)(kn,{icon:Mn})),(0,s.createElement)(f.FlexBlock,null,(0,s.createElement)("h2",{className:"edit-post-template-summary__title"},e?.title||e?.slug),(0,s.createElement)("p",null,e?.description)))):null};const{Tabs:xn}=Qe(f.privateApis),Bn=u.Platform.select({web:!0,native:!1}),Tn={document:"edit-post/document",block:"edit-post/block"},An=({sidebarName:e,keyboardShortcut:t,isTemplateMode:o})=>{const n=(0,u.useContext)(xn.Context);return(0,s.createElement)(Pn,{identifier:e,header:(0,s.createElement)(xn.Context.Provider,{value:n},(0,s.createElement)(Xo,null)),closeLabel:(0,v.__)("Close Settings"),className:"edit-post-sidebar__panel",headerClassName:"edit-post-sidebar__panel-tabs",title:(0,v.__)("Settings"),toggleShortcut:t,icon:(0,v.isRTL)()?jo:Yo,isActiveByDefault:Bn},(0,s.createElement)(xn.Context.Provider,{value:n},(0,s.createElement)(xn.TabPanel,{tabId:Tn.document,focusable:!1},!o&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(gn,null),(0,s.createElement)(Sn.Slot,null),(0,s.createElement)(b.PostLastRevisionPanel,null),(0,s.createElement)(b.PostTaxonomiesPanel,null),(0,s.createElement)(b.PostFeaturedImagePanel,null),(0,s.createElement)(b.PostExcerptPanel,null),(0,s.createElement)(b.PostDiscussionPanel,null),(0,s.createElement)(b.PageAttributesPanel,null),(0,s.createElement)(fn,{location:"side"})),o&&(0,s.createElement)(Cn,null)),(0,s.createElement)(xn.TabPanel,{tabId:Tn.block,focusable:!1},(0,s.createElement)(_.BlockInspector,null))))};var In=()=>{const{sidebarName:e,isSettingsSidebarActive:t,keyboardShortcut:o,isTemplateMode:n}=(0,m.useSelect)((e=>{let t=e(te).getActiveComplementaryArea(ro.name),o=!0;[Tn.document,Tn.block].includes(t)||(o=!1,e(_.store).getBlockSelectionStart()&&(t=Tn.block),t=Tn.document);return{sidebarName:t,isSettingsSidebarActive:o,keyboardShortcut:e(ye.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),isTemplateMode:"template-only"===e(b.store).getRenderingMode()}}),[]),{openGeneralSidebar:r}=(0,m.useDispatch)(ro),a=(0,u.useCallback)((e=>{e&&r(e)}),[r]);return(0,s.createElement)(xn,{selectedTabId:t?e:null,onSelect:a},(0,s.createElement)(An,{sidebarName:e,keyboardShortcut:o,isTemplateMode:n}))};function Ln({nonAnimatedSrc:e,animatedSrc:t}){return(0,s.createElement)("picture",{className:"edit-post-welcome-guide__image"},(0,s.createElement)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,s.createElement)("img",{src:t,width:"312",height:"240",alt:""}))}function Nn(){const{toggleFeature:e}=(0,m.useDispatch)(ro);return(0,s.createElement)(f.Guide,{className:"edit-post-welcome-guide",contentLabel:(0,v.__)("Welcome to the block editor"),finishButtonText:(0,v.__)("Get started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,s.createElement)(Ln,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,v.__)("Welcome to the block editor")),(0,s.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,v.__)("In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.")))},{image:(0,s.createElement)(Ln,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,v.__)("Make each block your own")),(0,s.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,v.__)("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,s.createElement)(Ln,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,v.__)("Get to know the block library")),(0,s.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,u.createInterpolateElement)((0,v.__)("All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon."),{InserterIconImage:(0,s.createElement)("img",{alt:(0,v.__)("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,s.createElement)(Ln,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,v.__)("Learn how to use the block editor")),(0,s.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,v.__)("New to the block editor? Want to learn more about using it? "),(0,s.createElement)(f.ExternalLink,{href:(0,v.__)("https://wordpress.org/documentation/article/wordpress-block-editor/")},(0,v.__)("Here's a detailed guide."))))}]})}function Fn(){const{toggleFeature:e}=(0,m.useDispatch)(ro);return(0,s.createElement)(f.Guide,{className:"edit-template-welcome-guide",contentLabel:(0,v.__)("Welcome to the template editor"),finishButtonText:(0,v.__)("Get started"),onFinish:()=>e("welcomeGuideTemplate"),pages:[{image:(0,s.createElement)(Ln,{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,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,v.__)("Welcome to the template editor")),(0,s.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,v.__)("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 Dn(){const{isActive:e,isTemplateMode:t}=(0,m.useSelect)((e=>{const{isFeatureActive:t}=e(ro),{getRenderingMode:o}=e(b.store),n="template-only"===o();return{isActive:t(n?"welcomeGuideTemplate":"welcomeGuide"),isTemplateMode:n}}),[]);return e?t?(0,s.createElement)(Fn,null):(0,s.createElement)(Nn,null):null}const{Fill:Rn,Slot:On}=(0,f.createSlotFill)("PluginPostPublishPanel"),Vn=({children:e,className:t,title:o,initialOpen:n=!1,icon:r})=>{const{icon:a}=(0,C.usePluginContext)();return(0,s.createElement)(Rn,null,(0,s.createElement)(f.PanelBody,{className:t,initialOpen:n||!o,title:o,icon:null!=r?r:a},e))};Vn.Slot=On;var Gn=Vn;const{Fill:zn,Slot:Hn}=(0,f.createSlotFill)("PluginPrePublishPanel"),Un=({children:e,className:t,title:o,initialOpen:n=!1,icon:r})=>{const{icon:a}=(0,C.usePluginContext)();return(0,s.createElement)(zn,null,(0,s.createElement)(f.PanelBody,{className:t,initialOpen:n||!o,title:o,icon:null!=r?r:a},e))};Un.Slot=Hn;var $n=Un;const{Fill:Wn,Slot:qn}=(0,f.createSlotFill)("ActionsPanel");function Qn({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:o}){const{closePublishSidebar:n,togglePublishSidebar:r}=(0,m.useDispatch)(ro),{publishSidebarOpened:a,hasActiveMetaboxes:i,hasNonPostEntityChanges:l}=(0,m.useSelect)((e=>({publishSidebarOpened:e(ro).isPublishSidebarOpened(),hasActiveMetaboxes:e(ro).hasMetaBoxes(),hasNonPostEntityChanges:e(b.store).hasNonPostEntityChanges()})),[]),c=(0,u.useCallback)((()=>e(!0)),[]);let d;return d=a?(0,s.createElement)(b.PostPublishPanel,{onClose:n,forceIsDirty:i,PrePublishExtension:$n.Slot,PostPublishExtension:Gn.Slot}):l?(0,s.createElement)("div",{className:"edit-post-layout__toggle-entities-saved-states-panel"},(0,s.createElement)(f.Button,{variant:"secondary",className:"edit-post-layout__toggle-entities-saved-states-panel-button",onClick:c,"aria-expanded":!1},(0,v.__)("Open save panel"))):(0,s.createElement)("div",{className:"edit-post-layout__toggle-publish-panel"},(0,s.createElement)(f.Button,{variant:"secondary",className:"edit-post-layout__toggle-publish-panel-button",onClick:r,"aria-expanded":!1},(0,v.__)("Open publish panel"))),(0,s.createElement)(s.Fragment,null,o&&(0,s.createElement)(b.EntitiesSavedStates,{close:t}),(0,s.createElement)(qn,{bubblesVirtually:!0}),!o&&d)}function jn({blockPatterns:e,onChoosePattern:t}){const o=(0,y.useAsyncList)(e),{resetEditorBlocks:n}=(0,m.useDispatch)(b.store);return(0,s.createElement)(_.__experimentalBlockPatternsList,{blockPatterns:e,shownPatterns:o,onClickPattern:(e,o)=>{n(o),t()}})}function Yn({onClose:e}){const t=function(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,m.useSelect)((e=>{const{getPatternsByBlockTypes:t}=e(_.store),{getCurrentPostType:o}=e(b.store);return{blockPatternsWithPostContentBlockType:t("core/post-content"),postType:o()}}),[]);return(0,u.useMemo)((()=>e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t)))),[t,e])}();return t.length>0?(0,s.createElement)(f.Modal,{className:"edit-post-start-page-options__modal",title:(0,v.__)("Choose a pattern"),isFullScreen:!0,onRequestClose:e},(0,s.createElement)("div",{className:"edit-post-start-page-options__modal-content"},(0,s.createElement)(jn,{blockPatterns:t,onChoosePattern:e}))):null}function Zn(){const[e,t]=(0,u.useState)(!1),o=(0,m.useSelect)((e=>{const{isCleanNewPost:t,getRenderingMode:o}=e(b.store),{isFeatureActive:n}=e(ro);return"post-only"===o()&&!n("welcomeGuide")&&t()}),[]);return!o||e?null:(0,s.createElement)(Yn,{onClose:()=>t(!0)})}var Xn=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.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 Kn=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.Path,{d:"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"}));var Jn=(0,s.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(k.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"}));var er=(0,s.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.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 tr=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.Path,{d:"m16 15.5h-8v-1.5h8zm-7.5-2.5h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm-9-3h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2z"}),(0,s.createElement)(k.Path,{d:"m18.5 6.5h-13a.5.5 0 0 0 -.5.5v9.5a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9.5a.5.5 0 0 0 -.5-.5zm-13-1.5h13a2 2 0 0 1 2 2v9.5a2 2 0 0 1 -2 2h-13a2 2 0 0 1 -2-2v-9.5a2 2 0 0 1 2-2z"}));var or=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}));const{getLayoutStyles:nr}=Qe(_.privateApis),{useCommands:rr}=Qe(Oe.privateApis),{useCommandContext:ar}=Qe(Re.privateApis),{InserterSidebar:sr,ListViewSidebar:ir}=Qe(b.privateApis),lr={header:(0,v.__)("Editor top bar"),body:(0,v.__)("Editor content"),sidebar:(0,v.__)("Editor settings"),actions:(0,v.__)("Editor publish"),footer:(0,v.__)("Editor footer")};var cr=function(){rr(),function(){const{openGeneralSidebar:e,closeGeneralSidebar:t,switchEditorMode:o,toggleDistractionFree:n}=(0,m.useDispatch)(ro),{openModal:r}=(0,m.useDispatch)(te),{editorMode:a,activeSidebar:s,isListViewOpen:i,isFullscreen:l,isPublishSidebarEnabled:c,showBlockBreadcrumbs:d,isDistractionFree:u,isTopToolbar:p,isFocusMode:h}=(0,m.useSelect)((e=>{const{get:t}=e(g.store),{getEditorMode:o}=e(ro),{isListViewOpened:n}=e(b.store);return{activeSidebar:e(te).getActiveComplementaryArea(ro.name),editorMode:o(),isListViewOpen:n(),isPublishSidebarEnabled:e(b.store).isPublishSidebarEnabled(),showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),isDistractionFree:t("core","distractionFree"),isFocusMode:t("core","focusMode"),isTopToolbar:t("core","fixedToolbar"),isFullscreen:t("core/edit-post","fullscreenMode")}}),[]),{toggle:E}=(0,m.useDispatch)(g.store),{createInfoNotice:f}=(0,m.useDispatch)(B.store),{__unstableSaveForPreview:_,setIsListViewOpened:y}=(0,m.useDispatch)(b.store),{getCurrentPostId:w}=(0,m.useSelect)(b.store);(0,Re.useCommand)({name:"core/open-settings-sidebar",label:(0,v.__)("Toggle settings sidebar"),icon:(0,v.isRTL)()?jo:Yo,callback:({close:o})=>{o(),"edit-post/document"===s?t():e("edit-post/document")}}),(0,Re.useCommand)({name:"core/open-block-inspector",label:(0,v.__)("Toggle block inspector"),icon:Xn,callback:({close:o})=>{o(),"edit-post/block"===s?t():e("edit-post/block")}}),(0,Re.useCommand)({name:"core/toggle-distraction-free",label:u?(0,v.__)("Exit Distraction Free"):(0,v.__)("Enter Distraction Free "),callback:({close:e})=>{n(),e()}}),(0,Re.useCommand)({name:"core/toggle-spotlight-mode",label:(0,v.__)("Toggle spotlight"),callback:({close:e})=>{E("core","focusMode"),e(),f(h?(0,v.__)("Spotlight off."):(0,v.__)("Spotlight on."),{id:"core/edit-post/toggle-spotlight-mode/notice",type:"snackbar",actions:[{label:(0,v.__)("Undo"),onClick:()=>{E("core","focusMode")}}]})}}),(0,Re.useCommand)({name:"core/toggle-fullscreen-mode",label:l?(0,v.__)("Exit fullscreen"):(0,v.__)("Enter fullscreen"),icon:Kn,callback:({close:e})=>{E("core/edit-post","fullscreenMode"),e(),f(l?(0,v.__)("Fullscreen off."):(0,v.__)("Fullscreen on."),{id:"core/edit-post/toggle-fullscreen-mode/notice",type:"snackbar",actions:[{label:(0,v.__)("Undo"),onClick:()=>{E("core/edit-post","fullscreenMode")}}]})}}),(0,Re.useCommand)({name:"core/toggle-list-view",label:i?(0,v.__)("Close List View"):(0,v.__)("Open List View"),icon:Jn,callback:({close:e})=>{y(!i),e(),f(i?(0,v.__)("List View off."):(0,v.__)("List View on."),{id:"core/edit-post/toggle-list-view/notice",type:"snackbar"})}}),(0,Re.useCommand)({name:"core/toggle-top-toolbar",label:(0,v.__)("Toggle top toolbar"),callback:({close:e})=>{E("core","fixedToolbar"),u&&n(),e(),f(p?(0,v.__)("Top toolbar off."):(0,v.__)("Top toolbar on."),{id:"core/edit-post/toggle-top-toolbar/notice",type:"snackbar",actions:[{label:(0,v.__)("Undo"),onClick:()=>{E("core","fixedToolbar")}}]})}}),(0,Re.useCommand)({name:"core/toggle-code-editor",label:"visual"===a?(0,v.__)("Open code editor"):(0,v.__)("Exit code editor"),icon:er,callback:({close:e})=>{o("visual"===a?"text":"visual"),e()}}),(0,Re.useCommand)({name:"core/open-preferences",label:(0,v.__)("Editor preferences"),callback:()=>{r(So)}}),(0,Re.useCommand)({name:"core/open-shortcut-help",label:(0,v.__)("Keyboard shortcuts"),icon:tr,callback:()=>{r(Me)}}),(0,Re.useCommand)({name:"core/toggle-breadcrumbs",label:d?(0,v.__)("Hide block breadcrumbs"):(0,v.__)("Show block breadcrumbs"),callback:({close:e})=>{E("core","showBlockBreadcrumbs"),e(),f(d?(0,v.__)("Breadcrumbs hidden."):(0,v.__)("Breadcrumbs visible."),{id:"core/edit-post/toggle-breadcrumbs/notice",type:"snackbar"})}}),(0,Re.useCommand)({name:"core/toggle-publish-sidebar",label:c?(0,v.__)("Disable pre-publish checks"):(0,v.__)("Enable pre-publish checks"),icon:or,callback:({close:e})=>{e(),E("core/edit-post","isPublishSidebarEnabled"),f(c?(0,v.__)("Pre-publish checks disabled."):(0,v.__)("Pre-publish checks enabled."),{id:"core/edit-post/publish-sidebar/notice",type:"snackbar"})}}),(0,Re.useCommand)({name:"core/preview-link",label:(0,v.__)("Preview in a new tab"),icon:M,callback:async({close:e})=>{e();const t=w(),o=await _();window.open(o,`wp-preview-${t}`)}})}(),(0,_.useBlockCommands)();const e=(0,y.useViewportMatch)("medium","<"),t=(0,y.useViewportMatch)("huge",">="),o=(0,y.useViewportMatch)("large"),n=(0,y.useViewportMatch)("medium"),{openGeneralSidebar:r,closeGeneralSidebar:a}=(0,m.useDispatch)(ro),{createErrorNotice:i}=(0,m.useDispatch)(B.store),{setIsInserterOpened:l}=(0,m.useDispatch)(b.store),{mode:c,isFullscreenActive:d,isRichEditingEnabled:p,sidebarIsOpened:h,hasActiveMetaboxes:E,previousShortcut:w,nextShortcut:S,hasBlockSelected:P,isInserterOpened:k,isListViewOpened:x,showIconLabels:T,isDistractionFree:A,showBlockBreadcrumbs:I,showMetaBoxes:N,documentLabel:F,hasHistory:D}=(0,m.useSelect)((e=>{const{get:t}=e(g.store),{getEditorSettings:o,getPostTypeLabel:n}=e(b.store),r=o(),a=n();return{showMetaBoxes:"post-only"===e(b.store).getRenderingMode(),sidebarIsOpened:!(!e(te).getActiveComplementaryArea(ro.name)&&!e(ro).isPublishSidebarOpened()),isFullscreenActive:e(ro).isFeatureActive("fullscreenMode"),isInserterOpened:e(b.store).isInserterOpened(),isListViewOpened:e(b.store).isListViewOpened(),mode:e(ro).getEditorMode(),isRichEditingEnabled:r.richEditingEnabled,hasActiveMetaboxes:e(ro).hasMetaBoxes(),previousShortcut:e(ye.store).getAllShortcutKeyCombinations("core/edit-post/previous-region"),nextShortcut:e(ye.store).getAllShortcutKeyCombinations("core/edit-post/next-region"),showIconLabels:t("core","showIconLabels"),isDistractionFree:t("core","distractionFree"),showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),documentLabel:a||(0,v._x)("Document","noun"),hasBlockSelected:!!e(_.store).getBlockSelectionStart(),hasHistory:!!o().goBack}}),[]);ar(P?"block-selection-edit":"post-editor-edit");const R=function(){const{hasThemeStyleSupport:e,editorSettings:t}=(0,m.useSelect)((e=>({hasThemeStyleSupport:e(ro).isFeatureActive("themeStyles"),editorSettings:e(b.store).getEditorSettings()})),[]);return(0,u.useMemo)((()=>{var o,n;const r=null!==(o=t.styles?.filter((e=>e.__unstableType&&"theme"!==e.__unstableType)))&&void 0!==o?o:[],a=[...t.defaultEditorStyles,...r],s=e&&r.length!==(null!==(n=t.styles?.length)&&void 0!==n?n:0);return t.disableLayoutStyles||s||a.push({css:nr({style:{},selector:"body",hasBlockGapSupport:!1,hasFallbackGapSupport:!0,fallbackGapValue:"0.5em"})}),s?t.styles:a}),[t.defaultEditorStyles,t.disableLayoutStyles,t.styles,e])}();(0,u.useEffect)((()=>{h&&!t&&l(!1)}),[t,l,h]),(0,u.useEffect)((()=>{k&&!t&&a()}),[a,k,t]);const[O,V]=(0,u.useState)(!1),G=(0,u.useCallback)((e=>{"function"==typeof O&&O(e),V(!1)}),[O]);T?document.body.classList.add("show-icon-labels"):document.body.classList.remove("show-icon-labels");const z=L()("edit-post-layout","is-mode-"+c,{"is-sidebar-opened":h,"has-metaboxes":E,"is-distraction-free":A&&o,"is-entity-save-view-open":!!O}),H=x?(0,v.__)("Document Overview"):(0,v.__)("Block Library");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(he,{isActive:d}),(0,s.createElement)(Mo,{hasHistory:D}),(0,s.createElement)(b.UnsavedChangesWarning,null),(0,s.createElement)(b.AutosaveMonitor,null),(0,s.createElement)(b.LocalAutosaveMonitor,null),(0,s.createElement)(co,null),(0,s.createElement)(b.EditorKeyboardShortcutsRegister,null),(0,s.createElement)(b.EditorKeyboardShortcuts,null),(0,s.createElement)(fe,{isDistractionFree:A&&o,className:z,labels:{...lr,secondarySidebar:H},header:(0,s.createElement)(Qo,{setEntitiesSavedStatesCallback:V}),editorNotices:(0,s.createElement)(b.EditorNotices,null),secondarySidebar:"visual"===c&&k?(0,s.createElement)(sr,null):"visual"===c&&x?(0,s.createElement)(ir,null):null,sidebar:(!e||h)&&(0,s.createElement)(s.Fragment,null,!e&&!h&&(0,s.createElement)("div",{className:"edit-post-layout__toggle-sidebar-panel"},(0,s.createElement)(f.Button,{variant:"secondary",className:"edit-post-layout__toggle-sidebar-panel-button",onClick:()=>r(P?"edit-post/block":"edit-post/document"),"aria-expanded":!1},P?(0,v.__)("Open block settings"):(0,v.__)("Open document settings"))),(0,s.createElement)(ge.Slot,{scope:"core/edit-post"})),notices:(0,s.createElement)(b.EditorSnackbars,null),content:(0,s.createElement)(s.Fragment,null,!A&&(0,s.createElement)(b.EditorNotices,null),("text"===c||!p)&&(0,s.createElement)(ao,null),!n&&(0,s.createElement)(_.BlockToolbar,{hideDragHandle:!0}),p&&"visual"===c&&(0,s.createElement)(lo,{styles:R}),!A&&N&&(0,s.createElement)("div",{className:"edit-post-layout__metaboxes"},(0,s.createElement)(fn,{location:"normal"}),(0,s.createElement)(fn,{location:"advanced"})),e&&h&&(0,s.createElement)(f.ScrollLock,null)),footer:!A&&!e&&I&&p&&"visual"===c&&(0,s.createElement)("div",{className:"edit-post-layout__footer"},(0,s.createElement)(_.BlockBreadcrumb,{rootLabelText:F})),actions:(0,s.createElement)(Qn,{closeEntitiesSavedStates:G,isEntitiesSavedStatesOpen:O,setEntitiesSavedStatesCallback:V}),shortcuts:{previous:w,next:S}}),(0,s.createElement)(Po,null),(0,s.createElement)(Te,null),(0,s.createElement)(Dn,null),(0,s.createElement)(b.PostSyncStatusModal,null),(0,s.createElement)(Zn,null),(0,s.createElement)(C.PluginArea,{onError:function(e){i((0,v.sprintf)((0,v.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}),(0,s.createElement)(In,null))};const dr=e=>{const{hasBlockSelection:t,isEditorSidebarOpened:o}=(0,m.useSelect)((e=>({hasBlockSelection:!!e(_.store).getBlockSelectionStart(),isEditorSidebarOpened:e(no).isEditorSidebarOpened()})),[e]),{openGeneralSidebar:n}=(0,m.useDispatch)(no);(0,u.useEffect)((()=>{o&&n(t?"edit-post/block":"edit-post/document")}),[t,o])},ur=e=>{const{newPermalink:t}=(0,m.useSelect)((e=>({newPermalink:e(b.store).getCurrentPost().link})),[e]),o=(0,u.useRef)();(0,u.useEffect)((()=>{o.current=document.querySelector("#wp-admin-bar-preview a")||document.querySelector("#wp-admin-bar-view a")}),[e]),(0,u.useEffect)((()=>{t&&o.current&&o.current.setAttribute("href",t)}),[t])};function mr({postId:e}){return dr(e),ur(e),null}const{ExperimentalEditorProvider:pr}=Qe(b.privateApis);var gr=function({postId:e,postType:t,settings:o,initialEdits:n,...r}){const{currentPost:a,getPostLinkProps:i,goBack:l}=function(e,t){const[o,n]=(0,u.useReducer)(((e,{type:t,post:o})=>"push"===t?[...e,o]:"pop"===t&&e.length>1?e.slice(0,-1):e),[{postId:e,postType:t}]),r=(0,u.useCallback)((e=>{const t=(0,x.getQueryArgs)(window.location.href),o=(0,x.removeQueryArgs)(window.location.href,...Object.keys(t));return{href:(0,x.addQueryArgs)(o,{post:e.postId,action:"edit"}),onClick:t=>{t.preventDefault(),n({type:"push",post:{postId:e.postId,postType:e.postType}})}}}),[]),a=(0,u.useCallback)((()=>{n({type:"pop"})}),[]);return{currentPost:o[o.length-1],getPostLinkProps:r,goBack:o.length>1?a:void 0}}(e,t),{hasInlineToolbar:c,post:d,preferredStyleVariations:p,template:h}=(0,m.useSelect)((e=>{var t;const{isFeatureActive:o,getEditedPostTemplate:n}=e(ro),{getEntityRecord:r,getPostType:s,getEntityRecords:i,canUser:l}=e(P.store),{getEditorSettings:c}=e(b.store);let d;if(["wp_template","wp_template_part"].includes(a.postType)){const e=i("postType",a.postType,{wp_id:a.postId});d=e?.[0]}else d=r("postType",a.postType,a.postId);const u=c().supportsTemplateMode,m=null!==(t=s(a.postType)?.viewable)&&void 0!==t&&t,p=l("create","templates");return{hasInlineToolbar:o("inlineToolbar"),preferredStyleVariations:e(g.store).get("core/edit-post","preferredStyleVariations"),template:u&&m&&p?n():null,post:d}}),[a.postType,a.postId]),{updatePreferredStyleVariations:E}=(0,m.useDispatch)(ro),_=(0,u.useMemo)((()=>({...o,getPostLinkProps:i,goBack:l,__experimentalPreferredStyleVariations:{value:p,onChange:E},hasInlineToolbar:c})),[o,c,p,E,i,l]);return d?(0,s.createElement)(f.SlotFillProvider,null,(0,s.createElement)(pr,{settings:_,post:d,initialEdits:n,useSubRegistry:!1,__unstableTemplate:h,...r},(0,s.createElement)(b.ErrorBoundary,null,(0,s.createElement)(Re.CommandMenu,null),(0,s.createElement)(mr,{postId:a.postId}),(0,s.createElement)(cr,null)),(0,s.createElement)(b.PostLockedModal,null))):null};var hr=({allowedBlocks:e,icon:t,label:o,onClick:n,small:r,role:a})=>(0,s.createElement)(_.BlockSettingsMenuControls,null,(({selectedBlocks:i,onClose:l})=>((e,t)=>{return!Array.isArray(t)||(o=t,0===e.filter((e=>!o.includes(e))).length);var o})(i,e)?(0,s.createElement)(f.MenuItem,{onClick:(0,y.compose)(n,l),icon:t,label:r?o:void 0,role:a},!r&&o):null)),br=(0,y.compose)((0,C.withPluginContext)(((e,t)=>{var o;return{as:null!==(o=t.as)&&void 0!==o?o:f.MenuItem,icon:t.icon||e.icon,name:"core/edit-post/plugin-more-menu"}})))(ie);function Er(e){return(0,s.createElement)(ce,{__unstableExplicitMenuItem:!0,scope:"core/edit-post",...e})}const{PluginPostExcerpt:fr}=Qe(b.privateApis);function _r(e,t,o,n,r){const a=document.getElementById(e),c=(0,u.createRoot)(a);(0,m.dispatch)(g.store).setDefaults("core/edit-post",{fullscreenMode:!0,isPublishSidebarEnabled:!0,preferredStyleVariations:{},themeStyles:!0,welcomeGuide:!0,welcomeGuideTemplate:!0}),(0,m.dispatch)(g.store).setDefaults("core",{allowRightClickOverrides:!0,editorMode:"visual",fixedToolbar:!1,hiddenBlockTypes:[],inactivePanels:[],openPanels:["post-status"],showBlockBreadcrumbs:!0,showIconLabels:!1,showListViewByDefault:!1}),(0,m.dispatch)(i.store).reapplyBlockTypeFilters(),(0,m.select)(g.store).get("core","showListViewByDefault")&&!(0,m.select)(g.store).get("core","distractionFree")&&(0,m.dispatch)(b.store).setIsListViewOpened(!0),(0,l.registerCoreBlocks)(),(0,h.registerLegacyWidgetBlock)({inserter:!1}),(0,h.registerWidgetGroupBlock)({inserter:!1}),(0,p.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((e,t)=>("post-only"!==(0,m.select)(b.store).getRenderingMode()||"core/template-part"!==t.name)&&e)),(0,p.addFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",((e,t,o,{getBlockParentsByBlockName:n})=>"post-only"===(0,m.select)(b.store).getRenderingMode()&&"core/post-content"===t.name?n(o,"core/query").length>0:e));"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,s.createElement)(gr,{settings:n,postId:o,postType:t,initialEdits:r})),c}function vr(){d()("wp.editPost.reinitializeEditor",{since:"6.2",version:"6.3"})}}(),(window.wp=window.wp||{}).editPost=n}(); |