WordPress/wp-includes/js/dist/edit-post.min.js
hellofromTonya 338b45ddba Editor: Update @wordpress packages for 6.2 RC1.
Updates the `@wordpress` packages to include the following changes:

- Site Editor: Move "Add Template"'s descriptions to tooltips
- Update template descriptions with more detail
- Distraction Free Mode: Don't show the metaboxes
- Remove actions from SidebarNavigationScreenWrapper
- Fix: Navigation sidebar shows a wrong submenu popover.
- Fix: Site button metrics
- Fix navigation block off-canvas appender for empty menus
- Style Book: Move iframe to root of content area to support styles that overflow block previews
- Fix navigation block off-canvas appender for empty

Reference:
* [446428841b Package publish commit in Gutenberg]

Follow-up to [55475].

Props mamaduka.
See #57471.
Built from https://develop.svn.wordpress.org/trunk@55496


git-svn-id: http://core.svn.wordpress.org/trunk@55029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 13:55:07 +00:00

7 lines
123 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

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

/*! This file is auto-generated */
!function(){var e={4403:function(e,t){var n;
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var a=o.apply(null,n);a&&e.push(a)}}else if("object"===l){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var i in n)r.call(n,i)&&n[i]&&e.push(i)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};!function(){"use strict";n.r(r),n.d(r,{PluginBlockSettingsMenuItem:function(){return Bo},PluginDocumentSettingPanel:function(){return jr},PluginMoreMenuItem:function(){return Mo},PluginPostPublishPanel:function(){return ao},PluginPostStatusInfo:function(){return _r},PluginPrePublishPanel:function(){return uo},PluginSidebar:function(){return Zr},PluginSidebarMoreMenuItem:function(){return No},__experimentalFullscreenModeClose:function(){return Cn},__experimentalMainDashboardButton:function(){return Un},initializeEditor:function(){return Io},reinitializeEditor:function(){return Do},store:function(){return Rt}});var e={};n.r(e),n.d(e,{disableComplementaryArea:function(){return $},enableComplementaryArea:function(){return W},pinItem:function(){return q},setDefaultComplementaryArea:function(){return z},setFeatureDefaults:function(){return Y},setFeatureValue:function(){return K},toggleFeature:function(){return Z},unpinItem:function(){return j}});var t={};n.r(t),n.d(t,{getActiveComplementaryArea:function(){return X},isFeatureActive:function(){return J},isItemPinned:function(){return Q}});var o={};n.r(o),n.d(o,{__experimentalSetPreviewDeviceType:function(){return Ye},__unstableCreateTemplate:function(){return tt},__unstableSwitchToTemplateMode:function(){return et},closeGeneralSidebar:function(){return Ne},closeModal:function(){return De},closePublishSidebar:function(){return Le},hideBlockTypes:function(){return $e},initializeMetaBoxes:function(){return rt},metaBoxUpdatesFailure:function(){return Ke},metaBoxUpdatesSuccess:function(){return Ze},openGeneralSidebar:function(){return Me},openModal:function(){return Ie},openPublishSidebar:function(){return Ae},removeEditorPanel:function(){return Re},requestMetaBoxUpdates:function(){return je},setAvailableMetaBoxesPerLocation:function(){return qe},setIsEditingTemplate:function(){return Je},setIsInserterOpened:function(){return Xe},setIsListViewOpened:function(){return Qe},showBlockTypes:function(){return We},switchEditorMode:function(){return Ge},toggleEditorPanelEnabled:function(){return Ve},toggleEditorPanelOpened:function(){return Fe},toggleFeature:function(){return He},togglePinnedPluginItem:function(){return Ue},togglePublishSidebar:function(){return Oe},updatePreferredStyleVariations:function(){return ze}});var l={};n.r(l),n.d(l,{__experimentalGetInsertionPoint:function(){return Dt},__experimentalGetPreviewDeviceType:function(){return Nt},areMetaBoxesInitialized:function(){return Ot},getActiveGeneralSidebarName:function(){return pt},getActiveMetaBoxLocations:function(){return kt},getAllMetaBoxes:function(){return xt},getEditedPostTemplate:function(){return Vt},getEditorMode:function(){return dt},getHiddenBlockTypes:function(){return _t},getMetaBoxesPerLocation:function(){return Tt},getPreference:function(){return ht},getPreferences:function(){return gt},hasMetaBoxes:function(){return Bt},isEditingTemplate:function(){return Lt},isEditorPanelEnabled:function(){return ft},isEditorPanelOpened:function(){return vt},isEditorPanelRemoved:function(){return bt},isEditorSidebarOpened:function(){return ut},isFeatureActive:function(){return wt},isInserterOpened:function(){return It},isListViewOpened:function(){return At},isMetaBoxLocationActive:function(){return Ct},isMetaBoxLocationVisible:function(){return Pt},isModalActive:function(){return yt},isPluginItemPinned:function(){return St},isPluginSidebarOpened:function(){return mt},isPublishSidebarOpened:function(){return Et},isSavingMetaBoxes:function(){return Mt}});var a=window.wp.element,i=window.wp.blocks,s=window.wp.blockLibrary,c=window.wp.deprecated,d=n.n(c),u=window.wp.data,m=window.wp.hooks,p=window.wp.preferences,g=window.wp.widgets,h=window.wp.mediaUtils;function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_.apply(this,arguments)}(0,m.addFilter)("editor.MediaUpload","core/edit-post/replace-media-upload",(()=>h.MediaUpload));var E=window.wp.components,b=window.wp.blockEditor,f=window.wp.i18n,v=window.wp.compose;const y=(0,v.compose)((0,u.withSelect)(((e,t)=>{if((0,i.hasBlockSupport)(t.name,"multiple",!0))return{};const n=e(b.store).getBlocks().find((e=>{let{name:n}=e;return t.name===n}));return{originalBlockClientId:n&&n.clientId!==t.clientId&&n.clientId}})),(0,u.withDispatch)(((e,t)=>{let{originalBlockClientId:n}=t;return{selectFirst:()=>e(b.store).selectBlock(n)}}))),w=(0,v.createHigherOrderComponent)((e=>y((t=>{let{originalBlockClientId:n,selectFirst:r,...o}=t;if(!n)return(0,a.createElement)(e,o);const l=(0,i.getBlockType)(o.name),s=function(e){const t=(0,i.findTransform)((0,i.getBlockTransforms)("to",e),(e=>{let{type:t,blocks:n}=e;return"block"===t&&1===n.length}));if(!t)return null;return(0,i.getBlockType)(t.blocks[0])}(o.name);return[(0,a.createElement)("div",{key:"invalid-preview",style:{minHeight:"60px"}},(0,a.createElement)(e,_({key:"block-edit"},o))),(0,a.createElement)(b.Warning,{key:"multiple-use-warning",actions:[(0,a.createElement)(E.Button,{key:"find-original",variant:"secondary",onClick:r},(0,f.__)("Find original")),(0,a.createElement)(E.Button,{key:"remove",variant:"secondary",onClick:()=>o.onReplace([])},(0,f.__)("Remove")),s&&(0,a.createElement)(E.Button,{key:"transform",variant:"secondary",onClick:()=>o.onReplace((0,i.createBlock)(s.name,o.attributes))},(0,f.__)("Transform into:")," ",s.title)]},(0,a.createElement)("strong",null,null==l?void 0:l.title,": "),(0,f.__)("This block can only be used once."))]}))),"withMultipleValidation");(0,m.addFilter)("editor.BlockEdit","core/edit-post/validate-multiple-use/with-multiple-validation",w);var S=window.wp.primitives;var k=(0,a.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(S.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),P=window.wp.plugins,C=window.wp.url,T=window.wp.notices,x=window.wp.editor;function B(){const{createNotice:e}=(0,u.useDispatch)(T.store),t=(0,u.useSelect)((e=>()=>e(x.store).getEditedPostAttribute("content")),[]);const n=(0,v.useCopyToClipboard)(t,(function(){e("info",(0,f.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,a.createElement)(E.MenuItem,{ref:n},(0,f.__)("Copy all blocks"))}var M=window.wp.keycodes;function N(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;const n=[...e];for(const e of t){const t=n.findIndex((t=>t.id===e.id));-1!==t?n[t]=e:n.push(e)}return n}const I=(0,u.combineReducers)({isSaving:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;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(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("SET_META_BOXES_PER_LOCATIONS"===t.type){const n={...e};for(const[e,r]of Object.entries(t.metaBoxesPerLocation))n[e]=N(n[e],r);return n}return e},initialized:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"META_BOXES_INITIALIZED"===t.type||e}});var D=(0,u.combineReducers)({activeModal:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e},metaBoxes:I,publishSidebarActive:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_PUBLISH_SIDEBAR":return!0;case"CLOSE_PUBLISH_SIDEBAR":return!1;case"TOGGLE_PUBLISH_SIDEBAR":return!e}return e},removedPanels:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if("REMOVE_PANEL"===t.type)if(!e.includes(t.panelName))return[...e,t.panelName];return e},deviceType:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Desktop",t=arguments.length>1?arguments[1]:void 0;return"SET_PREVIEW_DEVICE_TYPE"===t.type?t.deviceType:e},blockInserterPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},listViewPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e},isEditingTemplate:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"SET_IS_EDITING_TEMPLATE"===t.type?t.value:e}}),A=window.wp.apiFetch,L=n.n(A),O=n(4403),V=n.n(O);var F=(0,a.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(S.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));var R=(0,a.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(S.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 H=(0,a.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(S.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"})),G=window.wp.viewport;var U=(0,a.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(S.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 z=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),W=(e,t)=>n=>{let{registry:r,dispatch:o}=n;if(!t)return;r.select(p.store).get(e,"isComplementaryAreaVisible")||r.dispatch(p.store).set(e,"isComplementaryAreaVisible",!0),o({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},$=e=>t=>{let{registry:n}=t;n.select(p.store).get(e,"isComplementaryAreaVisible")&&n.dispatch(p.store).set(e,"isComplementaryAreaVisible",!1)},q=(e,t)=>n=>{let{registry:r}=n;if(!t)return;const o=r.select(p.store).get(e,"pinnedItems");!0!==(null==o?void 0:o[t])&&r.dispatch(p.store).set(e,"pinnedItems",{...o,[t]:!0})},j=(e,t)=>n=>{let{registry:r}=n;if(!t)return;const o=r.select(p.store).get(e,"pinnedItems");r.dispatch(p.store).set(e,"pinnedItems",{...o,[t]:!1})};function Z(e,t){return function(n){let{registry:r}=n;d()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),r.dispatch(p.store).toggle(e,t)}}function K(e,t,n){return function(r){let{registry:o}=r;d()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),o.dispatch(p.store).set(e,t,!!n)}}function Y(e,t){return function(n){let{registry:r}=n;d()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),r.dispatch(p.store).setDefaults(e,t)}}const X=(0,u.createRegistrySelector)((e=>(t,n)=>{var r;const o=e(p.store).get(n,"isComplementaryAreaVisible");if(void 0!==o)return o?null==t||null===(r=t.complementaryAreas)||void 0===r?void 0:r[n]:null})),Q=(0,u.createRegistrySelector)((e=>(t,n,r)=>{var o;const l=e(p.store).get(n,"pinnedItems");return null===(o=null==l?void 0:l[r])||void 0===o||o})),J=(0,u.createRegistrySelector)((e=>(t,n,r)=>(d()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(p.store).get(n,r))));var ee=(0,u.combineReducers)({complementaryAreas:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:n,area:r}=t;return e[n]?e:{...e,[n]:r}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:r}=t;return{...e,[n]:r}}}return e}});const te=(0,u.createReduxStore)("core/interface",{reducer:ee,actions:e,selectors:t});(0,u.register)(te);var ne=(0,P.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));var re=ne((function(e){let{as:t=E.Button,scope:n,identifier:r,icon:o,selectedIcon:l,name:i,...s}=e;const c=t,d=(0,u.useSelect)((e=>e(te).getActiveComplementaryArea(n)===r),[r]),{enableComplementaryArea:m,disableComplementaryArea:p}=(0,u.useDispatch)(te);return(0,a.createElement)(c,_({icon:l&&d?l:o,onClick:()=>{d?p(n):m(n,r)}},s))}));var oe=e=>{let{smallScreenTitle:t,children:n,className:r,toggleButtonProps:o}=e;const l=(0,a.createElement)(re,_({icon:U},o));return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},t&&(0,a.createElement)("span",{className:"interface-complementary-area-header__small-title"},t),l),(0,a.createElement)("div",{className:V()("components-panel__header","interface-complementary-area-header",r),tabIndex:-1},n,l))};const le=()=>{};function ae(e){let{name:t,as:n=E.Button,onClick:r,...o}=e;return(0,a.createElement)(E.Fill,{name:t},(e=>{let{onClick:t}=e;return(0,a.createElement)(n,_({onClick:r||t?function(){(r||le)(...arguments),(t||le)(...arguments)}:void 0},o))}))}ae.Slot=function(e){let{name:t,as:n=E.ButtonGroup,fillProps:r={},bubblesVirtually:o,...l}=e;return(0,a.createElement)(E.Slot,{name:t,bubblesVirtually:o,fillProps:r},(e=>{if(!a.Children.toArray(e).length)return null;const t=[];a.Children.forEach(e,(e=>{let{props:{__unstableExplicitMenuItem:n,__unstableTarget:r}}=e;r&&n&&t.push(r)}));const r=a.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&t.includes(e.props.__unstableTarget)?null:e));return(0,a.createElement)(n,l,r)}))};var ie=ae;const se=e=>{let{__unstableExplicitMenuItem:t,__unstableTarget:n,...r}=e;return(0,a.createElement)(E.MenuItem,r)};function ce(e){let{scope:t,target:n,__unstableExplicitMenuItem:r,...o}=e;return(0,a.createElement)(re,_({as:e=>(0,a.createElement)(ie,_({__unstableExplicitMenuItem:r,__unstableTarget:`${t}/${n}`,as:se,name:`${t}/plugin-more-menu`},e)),role:"menuitemcheckbox",selectedIcon:F,name:n,scope:t},o))}function de(e){let{scope:t,...n}=e;return(0,a.createElement)(E.Fill,_({name:`PinnedItems/${t}`},n))}de.Slot=function(e){let{scope:t,className:n,...r}=e;return(0,a.createElement)(E.Slot,_({name:`PinnedItems/${t}`},r),(e=>(null==e?void 0:e.length)>0&&(0,a.createElement)("div",{className:V()(n,"interface-pinned-items")},e)))};var ue=de;function me(e){let{scope:t,children:n,className:r}=e;return(0,a.createElement)(E.Fill,{name:`ComplementaryArea/${t}`},(0,a.createElement)("div",{className:r},n))}const pe=ne((function(e){let{children:t,className:n,closeLabel:r=(0,f.__)("Close plugin"),identifier:o,header:l,headerClassName:i,icon:s,isPinnable:c=!0,panelClassName:d,scope:m,name:p,smallScreenTitle:g,title:h,toggleShortcut:_,isActiveByDefault:b,showIconLabels:v=!1}=e;const{isActive:y,isPinned:w,activeArea:S,isSmall:k,isLarge:P}=(0,u.useSelect)((e=>{const{getActiveComplementaryArea:t,isItemPinned:n}=e(te),r=t(m);return{isActive:r===o,isPinned:n(m,o),activeArea:r,isSmall:e(G.store).isViewportMatch("< medium"),isLarge:e(G.store).isViewportMatch("large")}}),[o,m]);!function(e,t,n,r,o){const l=(0,a.useRef)(!1),i=(0,a.useRef)(!1),{enableComplementaryArea:s,disableComplementaryArea:c}=(0,u.useDispatch)(te);(0,a.useEffect)((()=>{r&&o&&!l.current?(c(e),i.current=!0):i.current&&!o&&l.current?(i.current=!1,s(e,t)):i.current&&n&&n!==t&&(i.current=!1),o!==l.current&&(l.current=o)}),[r,o,e,t,n])}(m,o,S,y,k);const{enableComplementaryArea:C,disableComplementaryArea:T,pinItem:x,unpinItem:B}=(0,u.useDispatch)(te);return(0,a.useEffect)((()=>{b&&void 0===S&&!k&&C(m,o)}),[S,b,m,o,k]),(0,a.createElement)(a.Fragment,null,c&&(0,a.createElement)(ue,{scope:m},w&&(0,a.createElement)(re,{scope:m,identifier:o,isPressed:y&&(!v||P),"aria-expanded":y,label:h,icon:v?F:s,showTooltip:!v,variant:v?"tertiary":void 0})),p&&c&&(0,a.createElement)(ce,{target:p,scope:m,icon:s},h),y&&(0,a.createElement)(me,{className:V()("interface-complementary-area",n),scope:m},(0,a.createElement)(oe,{className:i,closeLabel:r,onClose:()=>T(m),smallScreenTitle:g,toggleButtonProps:{label:r,shortcut:_,scope:m,identifier:o}},l||(0,a.createElement)(a.Fragment,null,(0,a.createElement)("strong",null,h),c&&(0,a.createElement)(E.Button,{className:"interface-complementary-area__pin-unpin-item",icon:w?R:H,label:w?(0,f.__)("Unpin from toolbar"):(0,f.__)("Pin to toolbar"),onClick:()=>(w?B:x)(m,o),isPressed:w,"aria-expanded":w}))),(0,a.createElement)(E.Panel,{className:d},t)))}));pe.Slot=function(e){let{scope:t,...n}=e;return(0,a.createElement)(E.Slot,_({name:`ComplementaryArea/${t}`},n))};var ge=pe;var he=e=>{let{isActive:t}=e;return(0,a.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,a.useEffect)((()=>(t?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{t&&document.body.classList.remove("is-fullscreen-mode")})),[t]),null};function _e(e){let{children:t,className:n,ariaLabel:r,as:o="div",...l}=e;return(0,a.createElement)(o,_({className:V()("interface-navigable-region",n),"aria-label":r,role:"region",tabIndex:"-1"},l),t)}var Ee=(0,a.forwardRef)((function(e,t){let{isDistractionFree:n,footer:r,header:o,editorNotices:l,sidebar:i,secondarySidebar:s,notices:c,content:d,actions:u,labels:m,className:p,enableRegionNavigation:g=!0,shortcuts:h}=e;const b=(0,E.__unstableUseNavigateRegions)(h);!function(e){(0,a.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 y={...{header:(0,f.__)("Header"),body:(0,f.__)("Content"),secondarySidebar:(0,f.__)("Block Library"),sidebar:(0,f.__)("Settings"),actions:(0,f.__)("Publish"),footer:(0,f.__)("Footer")},...m},w={hidden:n?{opacity:0}:{opacity:1},hover:{opacity:1,transition:{type:"tween",delay:.2,delayChildren:.2}}};return(0,a.createElement)("div",_({},g?b:{},{ref:(0,v.useMergeRefs)([t,g?b.ref:void 0]),className:V()(p,"interface-interface-skeleton",b.className,!!r&&"has-footer")}),(0,a.createElement)("div",{className:"interface-interface-skeleton__editor"},!!o&&n&&(0,a.createElement)(_e,{as:E.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":y.header,initial:n?"hidden":"hover",whileHover:"hover",variants:w,transition:{type:"tween",delay:.8}},o),!!o&&!n&&(0,a.createElement)(_e,{className:"interface-interface-skeleton__header",ariaLabel:y.header},o),n&&(0,a.createElement)("div",{className:"interface-interface-skeleton__header"},l),(0,a.createElement)("div",{className:"interface-interface-skeleton__body"},!!s&&(0,a.createElement)(_e,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:y.secondarySidebar},s),!!c&&(0,a.createElement)("div",{className:"interface-interface-skeleton__notices"},c),(0,a.createElement)(_e,{className:"interface-interface-skeleton__content",ariaLabel:y.body},d),!!i&&(0,a.createElement)(_e,{className:"interface-interface-skeleton__sidebar",ariaLabel:y.sidebar},i),!!u&&(0,a.createElement)(_e,{className:"interface-interface-skeleton__actions",ariaLabel:y.actions},u))),!!r&&(0,a.createElement)(_e,{className:"interface-interface-skeleton__footer",ariaLabel:y.footer},r))}));var be=(0,a.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(S.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function fe(e){let{as:t=E.DropdownMenu,className:n,label:r=(0,f.__)("Options"),popoverProps:o,toggleProps:l,children:i}=e;return(0,a.createElement)(t,{className:V()("interface-more-menu-dropdown",n),icon:be,label:r,popoverProps:{placement:"bottom-end",...o,className:V()("interface-more-menu-dropdown__content",null==o?void 0:o.className)},toggleProps:{tooltipPosition:"bottom",...l}},(e=>i(e)))}function ve(e){let{closeModal:t,children:n}=e;return(0,a.createElement)(E.Modal,{className:"interface-preferences-modal",title:(0,f.__)("Preferences"),onRequestClose:t},n)}var ye=function(e){let{icon:t,size:n=24,...r}=e;return(0,a.cloneElement)(t,{width:n,height:n,...r})};var we=(0,a.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(S.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var Se=(0,a.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(S.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));const ke="preferences-menu";function Pe(e){let{sections:t}=e;const n=(0,v.useViewportMatch)("medium"),[r,o]=(0,a.useState)(ke),{tabs:l,sectionsContentMap:i}=(0,a.useMemo)((()=>{let e={tabs:[],sectionsContentMap:{}};return t.length&&(e=t.reduce(((e,t)=>{let{name:n,tabLabel:r,content:o}=t;return e.tabs.push({name:n,title:r}),e.sectionsContentMap[n]=o,e}),{tabs:[],sectionsContentMap:{}})),e}),[t]),s=(0,a.useCallback)((e=>i[e.name]||null),[i]);let c;return c=n?(0,a.createElement)(E.TabPanel,{className:"interface-preferences__tabs",tabs:l,initialTabName:r!==ke?r:void 0,onSelect:o,orientation:"vertical"},s):(0,a.createElement)(E.__experimentalNavigatorProvider,{initialPath:"/",className:"interface-preferences__provider"},(0,a.createElement)(E.__experimentalNavigatorScreen,{path:"/"},(0,a.createElement)(E.Card,{isBorderless:!0,size:"small"},(0,a.createElement)(E.CardBody,null,(0,a.createElement)(E.__experimentalItemGroup,null,l.map((e=>(0,a.createElement)(E.__experimentalNavigatorButton,{key:e.name,path:e.name,as:E.__experimentalItem,isAction:!0},(0,a.createElement)(E.__experimentalHStack,{justify:"space-between"},(0,a.createElement)(E.FlexItem,null,(0,a.createElement)(E.__experimentalTruncate,null,e.title)),(0,a.createElement)(E.FlexItem,null,(0,a.createElement)(ye,{icon:(0,f.isRTL)()?we:Se})))))))))),t.length&&t.map((e=>(0,a.createElement)(E.__experimentalNavigatorScreen,{key:`${e.name}-menu`,path:e.name},(0,a.createElement)(E.Card,{isBorderless:!0,size:"large"},(0,a.createElement)(E.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6"},(0,a.createElement)(E.__experimentalNavigatorBackButton,{icon:(0,f.isRTL)()?Se:we,"aria-label":(0,f.__)("Navigate to the previous view")}),(0,a.createElement)(E.__experimentalText,{size:"16"},e.tabLabel)),(0,a.createElement)(E.CardBody,null,e.content)))))),c}var Ce=e=>{let{description:t,title:n,children:r}=e;return(0,a.createElement)("fieldset",{className:"interface-preferences-modal__section"},(0,a.createElement)("legend",{className:"interface-preferences-modal__section-legend"},(0,a.createElement)("h2",{className:"interface-preferences-modal__section-title"},n),t&&(0,a.createElement)("p",{className:"interface-preferences-modal__section-description"},t)),r)};var Te=function(e){let{help:t,label:n,isChecked:r,onChange:o,children:l}=e;return(0,a.createElement)("div",{className:"interface-preferences-modal__option"},(0,a.createElement)(E.ToggleControl,{__nextHasNoMarginBottom:!0,help:t,label:n,checked:r,onChange:o}),l)},xe=window.wp.a11y,Be=window.wp.coreData;const Me=e=>t=>{let{registry:n}=t;return n.dispatch(te).enableComplementaryArea(Rt.name,e)},Ne=()=>e=>{let{registry:t}=e;return t.dispatch(te).disableComplementaryArea(Rt.name)};function Ie(e){return{type:"OPEN_MODAL",name:e}}function De(){return{type:"CLOSE_MODAL"}}function Ae(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function Le(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function Oe(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const Ve=e=>t=>{var n;let{registry:r}=t;const o=null!==(n=r.select(p.store).get("core/edit-post","inactivePanels"))&&void 0!==n?n:[];let l;l=!(null==o||!o.includes(e))?o.filter((t=>t!==e)):[...o,e],r.dispatch(p.store).set("core/edit-post","inactivePanels",l)},Fe=e=>t=>{var n;let{registry:r}=t;const o=null!==(n=r.select(p.store).get("core/edit-post","openPanels"))&&void 0!==n?n:[];let l;l=!(null==o||!o.includes(e))?o.filter((t=>t!==e)):[...o,e],r.dispatch(p.store).set("core/edit-post","openPanels",l)};function Re(e){return{type:"REMOVE_PANEL",panelName:e}}const He=e=>t=>{let{registry:n}=t;return n.dispatch(p.store).toggle("core/edit-post",e)},Ge=e=>t=>{let{registry:n}=t;n.dispatch(p.store).set("core/edit-post","editorMode",e),"visual"!==e&&n.dispatch(b.store).clearSelectedBlock();const r="visual"===e?(0,f.__)("Visual editor selected"):(0,f.__)("Code editor selected");(0,xe.speak)(r,"assertive")},Ue=e=>t=>{let{registry:n}=t;const r=n.select(te).isItemPinned("core/edit-post",e);n.dispatch(te)[r?"unpinItem":"pinItem"]("core/edit-post",e)},ze=(e,t)=>n=>{var r;let{registry:o}=n;if(!e)return;const l=null!==(r=o.select(p.store).get("core/edit-post","preferredStyleVariations"))&&void 0!==r?r:{};if(t)o.dispatch(p.store).set("core/edit-post","preferredStyleVariations",{...l,[e]:t});else{const t={...l};delete t[e],o.dispatch(p.store).set("core/edit-post","preferredStyleVariations",t)}},We=e=>t=>{var n;let{registry:r}=t;const o=(null!==(n=r.select(p.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==n?n:[]).filter((t=>!(Array.isArray(e)?e:[e]).includes(t)));r.dispatch(p.store).set("core/edit-post","hiddenBlockTypes",o)},$e=e=>t=>{var n;let{registry:r}=t;const o=null!==(n=r.select(p.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==n?n:[],l=new Set([...o,...Array.isArray(e)?e:[e]]);r.dispatch(p.store).set("core/edit-post","hiddenBlockTypes",[...l])};function qe(e){return{type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e}}const je=()=>async e=>{let{registry:t,select:n,dispatch:r}=e;r({type:"REQUEST_META_BOX_UPDATES"}),window.tinyMCE&&window.tinyMCE.triggerSave();const o=t.select(x.store).getCurrentPost(),l=[!!o.comment_status&&["comment_status",o.comment_status],!!o.ping_status&&["ping_status",o.ping_status],!!o.sticky&&["sticky",o.sticky],!!o.author&&["post_author",o.author]].filter(Boolean),a=[new window.FormData(document.querySelector(".metabox-base-form")),...n.getActiveMetaBoxLocations().map((e=>new window.FormData((e=>document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`)||document.querySelector("#metaboxes .metabox-location-"+e))(e))))].reduce(((e,t)=>{for(const[n,r]of t)e.append(n,r);return e}),new window.FormData);l.forEach((e=>{let[t,n]=e;return a.append(t,n)}));try{await L()({url:window._wpMetaBoxUrl,method:"POST",body:a,parse:!1}),r.metaBoxUpdatesSuccess()}catch{r.metaBoxUpdatesFailure()}};function Ze(){return{type:"META_BOX_UPDATES_SUCCESS"}}function Ke(){return{type:"META_BOX_UPDATES_FAILURE"}}function Ye(e){return{type:"SET_PREVIEW_DEVICE_TYPE",deviceType:e}}function Xe(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function Qe(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}function Je(e){return{type:"SET_IS_EDITING_TEMPLATE",value:e}}const et=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t=>{let{registry:n,select:r,dispatch:o}=t;o(Je(!0));if(!r.isFeatureActive("welcomeGuideTemplate")){const t=e?(0,f.__)("Custom template created. You're in template mode now."):(0,f.__)("Editing template. Changes made here affect all posts and pages that use the template.");n.dispatch(T.store).createSuccessNotice(t,{type:"snackbar"})}}},tt=e=>async t=>{let{registry:n}=t;const r=await n.dispatch(Be.store).saveEntityRecord("postType","wp_template",e),o=n.select(x.store).getCurrentPost();n.dispatch(Be.store).editEntityRecord("postType",o.type,o.id,{template:r.slug})};let nt=!1;const rt=()=>e=>{let{registry:t,select:n,dispatch:r}=e;if(!t.select(x.store).__unstableIsEditorReady())return;if(nt)return;const o=t.select(x.store).getCurrentPostType();window.postboxes.page!==o&&window.postboxes.add_postbox_toggles(o),nt=!0;let l=t.select(x.store).isSavingPost(),a=t.select(x.store).isAutosavingPost();t.subscribe((async()=>{const e=t.select(x.store).isSavingPost(),o=t.select(x.store).isAutosavingPost(),i=l&&!a&&!e&&n.hasMetaBoxes();l=e,a=o,i&&await r.requestMetaBoxUpdates()})),r({type:"META_BOXES_INITIALIZED"})};var ot={};function lt(e){return[e]}function at(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function it(e,t){var n,r=t||lt;function o(e){var t,r,o,l,a,i=n,s=!0;for(t=0;t<e.length;t++){if(r=e[t],!(a=r)||"object"!=typeof a){s=!1;break}i.has(r)?i=i.get(r):(o=new WeakMap,i.set(r,o),i=o)}return i.has(ot)||((l=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=s,i.set(ot,l)),i.get(ot)}function l(){n=new WeakMap}function a(){var t,n,l,a,i,s=arguments.length;for(a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];for((t=o(i=r.apply(null,a))).isUniqueByDependants||(t.lastDependants&&!at(i,t.lastDependants,0)&&t.clear(),t.lastDependants=i),n=t.head;n;){if(at(n.args,a,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,a)},a[0]=null,n.args=a,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return a.getDependants=r,a.clear=l,l(),a}const st=[],ct={},dt=(0,u.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(p.store).get("core/edit-post","editorMode"))&&void 0!==t?t:"visual"})),ut=(0,u.createRegistrySelector)((e=>()=>{const t=e(te).getActiveComplementaryArea("core/edit-post");return["edit-post/document","edit-post/block"].includes(t)})),mt=(0,u.createRegistrySelector)((e=>()=>{const t=e(te).getActiveComplementaryArea("core/edit-post");return!!t&&!["edit-post/document","edit-post/block"].includes(t)})),pt=(0,u.createRegistrySelector)((e=>()=>e(te).getActiveComplementaryArea("core/edit-post")));const gt=(0,u.createRegistrySelector)((e=>()=>{d()("select( 'core/edit-post' ).getPreferences",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const t=["hiddenBlockTypes","editorMode","preferredStyleVariations"].reduce(((t,n)=>({...t,[n]:e(p.store).get("core/edit-post",n)})),{}),n=function(e,t){var n;const r=null==e?void 0:e.reduce(((e,t)=>({...e,[t]:{enabled:!1}})),{}),o=null==t?void 0:t.reduce(((e,t)=>{const n=null==e?void 0:e[t];return{...e,[t]:{...n,opened:!0}}}),null!=r?r:{});return null!==(n=null!=o?o:r)&&void 0!==n?n:ct}(e(p.store).get("core/edit-post","inactivePanels"),e(p.store).get("core/edit-post","openPanels"));return{...t,panels:n}}));function ht(e,t,n){d()("select( 'core/edit-post' ).getPreference",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const r=gt(e)[t];return void 0===r?n:r}const _t=(0,u.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(p.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==t?t:st}));function Et(e){return e.publishSidebarActive}function bt(e,t){return e.removedPanels.includes(t)}const ft=(0,u.createRegistrySelector)((e=>(t,n)=>{const r=e(p.store).get("core/edit-post","inactivePanels");return!(bt(t,n)||null!=r&&r.includes(n))})),vt=(0,u.createRegistrySelector)((e=>(t,n)=>{const r=e(p.store).get("core/edit-post","openPanels");return!(null==r||!r.includes(n))}));function yt(e,t){return e.activeModal===t}const wt=(0,u.createRegistrySelector)((e=>(t,n)=>!!e(p.store).get("core/edit-post",n))),St=(0,u.createRegistrySelector)((e=>(t,n)=>e(te).isItemPinned("core/edit-post",n))),kt=it((e=>Object.keys(e.metaBoxes.locations).filter((t=>Ct(e,t)))),(e=>[e.metaBoxes.locations]));function Pt(e,t){var n;return Ct(e,t)&&(null===(n=Tt(e,t))||void 0===n?void 0:n.some((t=>{let{id:n}=t;return ft(e,`meta-box-${n}`)})))}function Ct(e,t){const n=Tt(e,t);return!!n&&0!==n.length}function Tt(e,t){return e.metaBoxes.locations[t]}const xt=it((e=>Object.values(e.metaBoxes.locations).flat()),(e=>[e.metaBoxes.locations]));function Bt(e){return kt(e).length>0}function Mt(e){return e.metaBoxes.isSaving}function Nt(e){return e.deviceType}function It(e){return!!e.blockInserterPanel}function Dt(e){const{rootClientId:t,insertionIndex:n,filterValue:r}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:n,filterValue:r}}function At(e){return e.listViewPanel}function Lt(e){return e.isEditingTemplate}function Ot(e){return e.metaBoxes.initialized}const Vt=(0,u.createRegistrySelector)((e=>()=>{const t=e(x.store).getEditedPostAttribute("template");if(t){var n;const r=null===(n=e(Be.store).getEntityRecords("postType","wp_template",{per_page:-1}))||void 0===n?void 0:n.find((e=>e.slug===t));return r?e(Be.store).getEditedEntityRecord("postType","wp_template",r.id):r}const r=e(x.store).getCurrentPost();return r.link?e(Be.store).__experimentalGetTemplateForLink(r.link):null})),Ft="core/edit-post",Rt=(0,u.createReduxStore)(Ft,{reducer:D,actions:o,selectors:l});(0,u.register)(Rt);var Ht=(0,u.withDispatch)((e=>{const{openModal:t}=e(Rt);return{openModal:t}}))((function(e){let{openModal:t}=e;return(0,a.createElement)(E.MenuItem,{onClick:()=>{t("edit-post/keyboard-shortcut-help")},shortcut:M.displayShortcut.access("h")},(0,f.__)("Keyboard shortcuts"))})),Gt=window.lodash;const{Fill:Ut,Slot:zt}=(0,E.createSlotFill)("ToolsMoreMenuGroup");Ut.Slot=e=>{let{fillProps:t}=e;return(0,a.createElement)(zt,{fillProps:t},(e=>!(0,Gt.isEmpty)(e)&&(0,a.createElement)(E.MenuGroup,{label:(0,f.__)("Tools")},e)))};var Wt=Ut;function $t(){const e=(0,u.useSelect)((e=>e(Rt).isEditingTemplate()),[]);return(0,a.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:e?"welcomeGuideTemplate":"welcomeGuide",label:(0,f.__)("Welcome Guide")})}(0,P.registerPlugin)("edit-post",{render(){return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Wt,null,(e=>{let{onClose:t}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(E.MenuItem,{role:"menuitem",href:(0,C.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,f.__)("Manage Reusable blocks")),(0,a.createElement)(Ht,{onSelect:t}),(0,a.createElement)($t,null),(0,a.createElement)(B,null),(0,a.createElement)(E.MenuItem,{role:"menuitem",icon:k,href:(0,f.__)("https://wordpress.org/support/article/wordpress-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,f.__)("Help"),(0,a.createElement)(E.VisuallyHidden,{as:"span"},(0,f.__)("(opens in a new tab)"))))})))}});var qt=window.wp.keyboardShortcuts;function jt(){const e=(0,u.useSelect)((e=>e(x.store).getEditorSettings().richEditingEnabled),[]),{switchEditorMode:t}=(0,u.useDispatch)(Rt);return(0,a.createElement)("div",{className:"edit-post-text-editor"},(0,a.createElement)(x.TextEditorGlobalKeyboardShortcuts,null),e&&(0,a.createElement)("div",{className:"edit-post-text-editor__toolbar"},(0,a.createElement)("h2",null,(0,f.__)("Editing code")),(0,a.createElement)(E.Button,{variant:"tertiary",onClick:()=>t("visual"),shortcut:M.displayShortcut.secondary("m")},(0,f.__)("Exit code editor"))),(0,a.createElement)("div",{className:"edit-post-text-editor__body"},(0,a.createElement)(x.PostTitle,null),(0,a.createElement)(x.PostTextEditor,null)))}var Zt=(0,a.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(S.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"}));function Kt(e){let{children:t,contentRef:n,shouldIframe:r,styles:o,style:l}=e;const i=(0,b.__unstableUseMouseMoveTypingReset)();return r?(0,a.createElement)(b.__unstableIframe,{head:(0,a.createElement)(b.__unstableEditorStyles,{styles:o}),ref:i,contentRef:n,style:{width:"100%",height:"100%",display:"block"},name:"editor-canvas"},t):(0,a.createElement)(a.Fragment,null,(0,a.createElement)(b.__unstableEditorStyles,{styles:o}),(0,a.createElement)(b.WritingFlow,{ref:n,className:"editor-styles-wrapper",style:{flex:"1",...l},tabIndex:-1},t))}function Yt(e){for(let t=0;t<e.length;t++){if("core/post-content"===e[t].name)return e[t];if(e[t].innerBlocks.length){const n=Yt(e[t].innerBlocks);if(n)return n}}}function Xt(e){var t;let{styles:n}=e;const{deviceType:r,isWelcomeGuideVisible:o,isTemplateMode:l,editedPostTemplate:s={},wrapperBlockName:c,wrapperUniqueId:d,isBlockBasedTheme:m}=(0,u.useSelect)((e=>{const{isFeatureActive:t,isEditingTemplate:n,__experimentalGetPreviewDeviceType:r,getEditedPostTemplate:o}=e(Rt),{getCurrentPostId:l,getCurrentPostType:a,getEditorSettings:i}=e(x.store),s=n();let c;"wp_block"===a()?c="core/block":s||(c="core/post-content");const d=i(),u=d.supportsTemplateMode,m=e(Be.store).canUser("create","templates");return{deviceType:r(),isWelcomeGuideVisible:t("welcomeGuide"),isTemplateMode:s,editedPostTemplate:u&&m?o():void 0,wrapperBlockName:c,wrapperUniqueId:l(),isBlockBasedTheme:d.__unstableIsBlockBasedTheme}}),[]),{isCleanNewPost:p}=(0,u.useSelect)(x.store),g=(0,u.useSelect)((e=>e(Rt).hasMetaBoxes()),[]),{themeHasDisabledLayoutStyles:h,themeSupportsLayout:_,isFocusMode:y}=(0,u.useSelect)((e=>{const t=e(b.store).getSettings();return{themeHasDisabledLayoutStyles:t.disableLayoutStyles,themeSupportsLayout:t.supportsLayout,isFocusMode:t.focusMode}}),[]),{clearSelectedBlock:w}=(0,u.useDispatch)(b.store),{setIsEditingTemplate:S}=(0,u.useDispatch)(Rt),k={height:"100%",width:"100%",margin:0,display:"flex",flexFlow:"column",background:"white"},P={...k,borderRadius:"2px 2px 0 0",border:"1px solid #ddd",borderBottom:0},C=(0,b.__experimentalUseResizeCanvas)(r,l),T=(0,b.useSetting)("layout"),B="is-"+r.toLowerCase()+"-preview";let M,N=l?P:k;C&&(N=C),g||C||l||(M="40vh");const I=(0,a.useRef)(),D=(0,v.useMergeRefs)([I,(0,b.__unstableUseClipboardHandler)(),(0,b.__unstableUseTypewriter)(),(0,b.__unstableUseTypingObserver)(),(0,b.__unstableUseBlockSelectionClearer)()]),A=(0,b.__unstableUseBlockSelectionClearer)(),L=(0,a.useMemo)((()=>l?{type:"default"}:_?{...T,type:"constrained"}:{type:"default"}),[l,_,T]),O=(0,a.useMemo)((()=>{if(null!=s&&s.blocks)return Yt(null==s?void 0:s.blocks);const e="string"==typeof(null==s?void 0:s.content)?null==s?void 0:s.content:"";return Yt((0,i.parse)(e))||{}}),[null==s?void 0:s.content,null==s?void 0:s.blocks]),F=(0,b.__experimentaluseLayoutClasses)(O),R=V()({"is-layout-flow":!_},_&&F),H=(0,b.__experimentaluseLayoutStyles)(O,".block-editor-block-list__layout.is-root-container"),G=(null==O||null===(t=O.attributes)||void 0===t?void 0:t.layout)||{},U=(0,a.useMemo)((()=>G&&("constrained"===(null==G?void 0:G.type)||null!=G&&G.inherit||null!=G&&G.contentSize||null!=G&&G.wideSize)?{...T,...G,type:"constrained"}:{...T,...G,type:"default"}),[null==G?void 0:G.type,null==G?void 0:G.inherit,null==G?void 0:G.contentSize,null==G?void 0:G.wideSize,T]),z=null!=O&&O.isValid?U:L,W=(0,a.useRef)();return(0,a.useEffect)((()=>{var e;!o&&p()&&(null==W||null===(e=W.current)||void 0===e||e.focus())}),[o,p]),n=(0,a.useMemo)((()=>[...n,{css:".edit-post-visual-editor__post-title-wrapper{margin-top:4rem}"+(M?`body{padding-bottom:${M}}`:"")}]),[n]),(0,a.createElement)(b.BlockTools,{__unstableContentRef:I,className:V()("edit-post-visual-editor",{"is-template-mode":l})},(0,a.createElement)(x.VisualEditorGlobalKeyboardShortcuts,null),(0,a.createElement)(E.__unstableMotion.div,{className:"edit-post-visual-editor__content-area",animate:{padding:l?"48px 48px 0":"0"},ref:A},l&&(0,a.createElement)(E.Button,{className:"edit-post-visual-editor__exit-template-mode",icon:Zt,onClick:()=>{w(),S(!1)}},(0,f.__)("Back")),(0,a.createElement)(E.__unstableMotion.div,{animate:N,initial:k,className:B},(0,a.createElement)(Kt,{shouldIframe:l||"Tablet"===r||"Mobile"===r,contentRef:D,styles:n},_&&!h&&!l&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(b.__experimentalLayoutStyle,{selector:".edit-post-visual-editor__post-title-wrapper, .block-editor-block-list__layout.is-root-container",layout:L,layoutDefinitions:null==T?void 0:T.definitions}),H&&(0,a.createElement)(b.__experimentalLayoutStyle,{layout:U,css:H,layoutDefinitions:null==T?void 0:T.definitions})),!l&&(0,a.createElement)("div",{className:V()("edit-post-visual-editor__post-title-wrapper",{"is-focus-mode":y},"is-layout-flow"),contentEditable:!1},(0,a.createElement)(x.PostTitle,{ref:W})),(0,a.createElement)(b.__experimentalRecursionProvider,{blockName:c,uniqueId:d},(0,a.createElement)(b.BlockList,{className:l?"wp-site-blocks":`${R} wp-block-post-content`,__experimentalLayout:z}))))))}var Qt=function(){const{getBlockSelectionStart:e}=(0,u.useSelect)(b.store),{getEditorMode:t,isEditorSidebarOpened:n,isListViewOpened:r,isFeatureActive:o}=(0,u.useSelect)(Rt),l=(0,u.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:n}=e(x.store).getEditorSettings();return!t||!n}),[]),{createInfoNotice:s}=(0,u.useDispatch)(T.store),{switchEditorMode:c,openGeneralSidebar:d,closeGeneralSidebar:m,toggleFeature:g,setIsListViewOpened:h,setIsInserterOpened:_}=(0,u.useDispatch)(Rt),{registerShortcut:E}=(0,u.useDispatch)(qt.store),{set:v}=(0,u.useDispatch)(p.store),{replaceBlocks:y}=(0,u.useDispatch)(b.store),{getBlockName:w,getSelectedBlockClientId:S,getBlockAttributes:k}=(0,u.useSelect)(b.store),P=(e,t)=>{e.preventDefault();const n=0===t?"core/paragraph":"core/heading",r=S();if(null===r)return;const o=w(r);if("core/paragraph"!==o&&"core/heading"!==o)return;const l=k(r),{content:a,align:s}=l;y(r,(0,i.createBlock)(n,{level:t,content:a,align:s}))};return(0,a.useEffect)((()=>{E({name:"core/edit-post/toggle-mode",category:"global",description:(0,f.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),E({name:"core/edit-post/toggle-distraction-free",category:"global",description:(0,f.__)("Toggle distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),E({name:"core/edit-post/toggle-fullscreen",category:"global",description:(0,f.__)("Toggle fullscreen mode."),keyCombination:{modifier:"secondary",character:"f"}}),E({name:"core/edit-post/toggle-list-view",category:"global",description:(0,f.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}}),E({name:"core/edit-post/toggle-sidebar",category:"global",description:(0,f.__)("Show or hide the settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),E({name:"core/edit-post/next-region",category:"global",description:(0,f.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),E({name:"core/edit-post/previous-region",category:"global",description:(0,f.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]}),E({name:"core/edit-post/keyboard-shortcuts",category:"main",description:(0,f.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),E({name:"core/block-editor/transform-heading-to-paragraph",category:"block-library",description:(0,f.__)("Transform heading to paragraph."),keyCombination:{modifier:"access",character:"0"}}),[1,2,3,4,5,6].forEach((e=>{E({name:`core/block-editor/transform-paragraph-to-heading-${e}`,category:"block-library",description:(0,f.__)("Transform paragraph to heading."),keyCombination:{modifier:"access",character:`${e}`}})}))}),[]),(0,qt.useShortcut)("core/edit-post/toggle-mode",(()=>{c("visual"===t()?"text":"visual")}),{isDisabled:l}),(0,qt.useShortcut)("core/edit-post/toggle-fullscreen",(()=>{g("fullscreenMode")})),(0,qt.useShortcut)("core/edit-post/toggle-distraction-free",(()=>{m(),h(!1),v("core/edit-post","fixedToolbar",!1),_(!1),h(!1),m(),g("distractionFree"),s(o("distractionFree")?(0,f.__)("Distraction free mode turned on."):(0,f.__)("Distraction free mode turned off."),{id:"core/edit-post/distraction-free-mode/notice",type:"snackbar"})})),(0,qt.useShortcut)("core/edit-post/toggle-sidebar",(t=>{if(t.preventDefault(),n())m();else{const t=e()?"edit-post/block":"edit-post/document";d(t)}})),(0,qt.useShortcut)("core/edit-post/toggle-list-view",(()=>h(!r()))),(0,qt.useShortcut)("core/block-editor/transform-heading-to-paragraph",(e=>P(e,0))),[1,2,3,4,5,6].forEach((e=>{(0,qt.useShortcut)(`core/block-editor/transform-paragraph-to-heading-${e}`,(t=>P(t,e)))})),null};const Jt=[{keyCombination:{modifier:"primary",character:"b"},description:(0,f.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,f.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,f.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,f.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,f.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,f.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,f.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,f.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},description:(0,f.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,f.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")}];function en(e){let{keyCombination:t,forceAriaLabel:n}=e;const r=t.modifier?M.displayShortcutList[t.modifier](t.character):t.character,o=t.modifier?M.shortcutAriaLabel[t.modifier](t.character):t.character;return(0,a.createElement)("kbd",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":n||o},(Array.isArray(r)?r:[r]).map(((e,t)=>"+"===e?(0,a.createElement)(a.Fragment,{key:t},e):(0,a.createElement)("kbd",{key:t,className:"edit-post-keyboard-shortcut-help-modal__shortcut-key"},e))))}var tn=function(e){let{description:t,keyCombination:n,aliases:r=[],ariaLabel:o}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-description"},t),(0,a.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-term"},(0,a.createElement)(en,{keyCombination:n,forceAriaLabel:o}),r.map(((e,t)=>(0,a.createElement)(en,{keyCombination:e,forceAriaLabel:o,key:t})))))};var nn=function(e){let{name:t}=e;const{keyCombination:n,description:r,aliases:o}=(0,u.useSelect)((e=>{const{getShortcutKeyCombination:n,getShortcutDescription:r,getShortcutAliases:o}=e(qt.store);return{keyCombination:n(t),aliases:o(t),description:r(t)}}),[t]);return n?(0,a.createElement)(tn,{keyCombination:n,description:r,aliases:o}):null};const rn="edit-post/keyboard-shortcut-help",on=e=>{let{shortcuts:t}=e;return(0,a.createElement)("ul",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-list",role:"list"},t.map(((e,t)=>(0,a.createElement)("li",{className:"edit-post-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,a.createElement)(nn,{name:e}):(0,a.createElement)(tn,e)))))},ln=e=>{let{title:t,shortcuts:n,className:r}=e;return(0,a.createElement)("section",{className:V()("edit-post-keyboard-shortcut-help-modal__section",r)},!!t&&(0,a.createElement)("h2",{className:"edit-post-keyboard-shortcut-help-modal__section-title"},t),(0,a.createElement)(on,{shortcuts:n}))},an=e=>{let{title:t,categoryName:n,additionalShortcuts:r=[]}=e;const o=(0,u.useSelect)((e=>e(qt.store).getCategoryShortcuts(n)),[n]);return(0,a.createElement)(ln,{title:t,shortcuts:o.concat(r)})};var sn=(0,v.compose)([(0,u.withSelect)((e=>({isModalActive:e(Rt).isModalActive(rn)}))),(0,u.withDispatch)(((e,t)=>{let{isModalActive:n}=t;const{openModal:r,closeModal:o}=e(Rt);return{toggleModal:()=>n?o():r(rn)}}))])((function(e){let{isModalActive:t,toggleModal:n}=e;return(0,qt.useShortcut)("core/edit-post/keyboard-shortcuts",n),t?(0,a.createElement)(E.Modal,{className:"edit-post-keyboard-shortcut-help-modal",title:(0,f.__)("Keyboard shortcuts"),closeButtonLabel:(0,f.__)("Close"),onRequestClose:n},(0,a.createElement)(ln,{className:"edit-post-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-post/keyboard-shortcuts"]}),(0,a.createElement)(an,{title:(0,f.__)("Global shortcuts"),categoryName:"global"}),(0,a.createElement)(an,{title:(0,f.__)("Selection shortcuts"),categoryName:"selection"}),(0,a.createElement)(an,{title:(0,f.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,f.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,f.__)("Forward-slash")}]}),(0,a.createElement)(ln,{title:(0,f.__)("Text formatting"),shortcuts:Jt})):null}));function cn(e){let{willEnable:t}=e;const[n,r]=(0,a.useState)(!1);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",{className:"edit-post-preferences-modal__custom-fields-confirmation-message"},(0,f.__)("A page reload is required for this change. Make sure your content is saved before reloading.")),(0,a.createElement)(E.Button,{className:"edit-post-preferences-modal__custom-fields-confirmation-button",variant:"secondary",isBusy:n,disabled:n,onClick:()=>{r(!0),document.getElementById("toggle-custom-fields-form").submit()}},t?(0,f.__)("Enable & Reload"):(0,f.__)("Disable & Reload")))}var dn=(0,u.withSelect)((e=>({areCustomFieldsEnabled:!!e(x.store).getEditorSettings().enableCustomFields})))((function(e){let{label:t,areCustomFieldsEnabled:n}=e;const[r,o]=(0,a.useState)(n);return(0,a.createElement)(Te,{label:t,isChecked:r,onChange:o},r!==n&&(0,a.createElement)(cn,{willEnable:r}))})),un=(0,v.compose)((0,u.withSelect)(((e,t)=>{let{panelName:n}=t;const{isEditorPanelEnabled:r,isEditorPanelRemoved:o}=e(Rt);return{isRemoved:o(n),isChecked:r(n)}})),(0,v.ifCondition)((e=>{let{isRemoved:t}=e;return!t})),(0,u.withDispatch)(((e,t)=>{let{panelName:n}=t;return{onChange:()=>e(Rt).toggleEditorPanelEnabled(n)}})))(Te);const{Fill:mn,Slot:pn}=(0,E.createSlotFill)("EnablePluginDocumentSettingPanelOption"),gn=e=>{let{label:t,panelName:n}=e;return(0,a.createElement)(mn,null,(0,a.createElement)(un,{label:t,panelName:n}))};gn.Slot=pn;var hn=gn,_n=(0,v.compose)((0,u.withSelect)((e=>({isChecked:e(x.store).isPublishSidebarEnabled()}))),(0,u.withDispatch)((e=>{const{enablePublishSidebar:t,disablePublishSidebar:n}=e(x.store);return{onChange:e=>e?t():n()}})),(0,G.ifViewportMatches)("medium"))(Te),En=(0,v.compose)((0,u.withSelect)(((e,t)=>{let{featureName:n}=t;const{isFeatureActive:r}=e(Rt);return{isChecked:r(n)}})),(0,u.withDispatch)(((e,t)=>{let{featureName:n,onToggle:r=(()=>{})}=t;return{onChange:()=>{r(),e(Rt).toggleFeature(n)}}})))(Te);var bn=(0,u.withSelect)((e=>{const{getEditorSettings:t}=e(x.store),{getAllMetaBoxes:n}=e(Rt);return{areCustomFieldsRegistered:void 0!==t().enableCustomFields,metaBoxes:n()}}))((function(e){let{areCustomFieldsRegistered:t,metaBoxes:n,...r}=e;const o=n.filter((e=>{let{id:t}=e;return"postcustom"!==t}));return t||0!==o.length?(0,a.createElement)(Ce,r,t&&(0,a.createElement)(dn,{label:(0,f.__)("Custom fields")}),o.map((e=>{let{id:t,title:n}=e;return(0,a.createElement)(un,{key:t,label:n,panelName:`meta-box-${t}`})}))):null}));var fn=function(e){let{blockTypes:t,value:n,onItemChange:r}=e;return(0,a.createElement)("ul",{className:"edit-post-block-manager__checklist"},t.map((e=>(0,a.createElement)("li",{key:e.name,className:"edit-post-block-manager__checklist-item"},(0,a.createElement)(E.CheckboxControl,{__nextHasNoMarginBottom:!0,label:e.title,checked:n.includes(e.name),onChange:function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return r(e.name,...n)}}),(0,a.createElement)(b.BlockIcon,{icon:e.icon})))))};var vn=function e(t){let{title:n,blockTypes:r}=t;const o=(0,v.useInstanceId)(e),{defaultAllowedBlockTypes:l,hiddenBlockTypes:i}=(0,u.useSelect)((e=>{const{getEditorSettings:t}=e(x.store),{getHiddenBlockTypes:n}=e(Rt);return{defaultAllowedBlockTypes:t().defaultAllowedBlockTypes,hiddenBlockTypes:n()}}),[]),s=(0,a.useMemo)((()=>!0===l?r:r.filter((e=>{let{name:t}=e;return null==l?void 0:l.includes(t)}))),[l,r]),{showBlockTypes:c,hideBlockTypes:d}=(0,u.useDispatch)(Rt),m=(0,a.useCallback)(((e,t)=>{t?c(e):d(e)}),[]),p=(0,a.useCallback)((e=>{const t=r.map((e=>{let{name:t}=e;return t}));e?c(t):d(t)}),[r]);if(!s.length)return null;const g=s.map((e=>{let{name:t}=e;return t})).filter((e=>!i.includes(e))),h="edit-post-block-manager__category-title-"+o,_=g.length===s.length,b=!_&&g.length>0;return(0,a.createElement)("div",{role:"group","aria-labelledby":h,className:"edit-post-block-manager__category"},(0,a.createElement)(E.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:_,onChange:p,className:"edit-post-block-manager__category-title",indeterminate:b,label:(0,a.createElement)("span",{id:h},n)}),(0,a.createElement)(fn,{blockTypes:s,value:g,onItemChange:m}))};var yn=(0,u.withSelect)((e=>{const{getBlockTypes:t,getCategories:n,hasBlockSupport:r,isMatchingSearchTerm:o}=e(i.store),{getHiddenBlockTypes:l}=e(Rt),a=t(),s=l().filter((e=>a.some((t=>t.name===e)))),c=Array.isArray(s)&&s.length;return{blockTypes:a,categories:n(),hasBlockSupport:r,isMatchingSearchTerm:o,numberOfHiddenBlocks:c}}))((function(e){let{blockTypes:t,categories:n,hasBlockSupport:r,isMatchingSearchTerm:o,numberOfHiddenBlocks:l}=e;const i=(0,v.useDebounce)(xe.speak,500),[s,c]=(0,a.useState)("");return t=t.filter((e=>r(e,"inserter",!0)&&(!s||o(e,s))&&(!e.parent||e.parent.includes("core/post-content")))),(0,a.useEffect)((()=>{if(!s)return;const e=t.length,n=(0,f.sprintf)((0,f._n)("%d result found.","%d results found.",e),e);i(n)}),[t.length,s,i]),(0,a.createElement)("div",{className:"edit-post-block-manager__content"},!!l&&(0,a.createElement)("div",{className:"edit-post-block-manager__disabled-blocks-count"},(0,f.sprintf)((0,f._n)("%d block is hidden.","%d blocks are hidden.",l),l)),(0,a.createElement)(E.SearchControl,{__nextHasNoMarginBottom:!0,label:(0,f.__)("Search for a block"),placeholder:(0,f.__)("Search for a block"),value:s,onChange:e=>c(e),className:"edit-post-block-manager__search"}),(0,a.createElement)("div",{tabIndex:"0",role:"region","aria-label":(0,f.__)("Available block types"),className:"edit-post-block-manager__results"},0===t.length&&(0,a.createElement)("p",{className:"edit-post-block-manager__no-results"},(0,f.__)("No blocks found.")),n.map((e=>(0,a.createElement)(vn,{key:e.slug,title:e.title,blockTypes:t.filter((t=>t.category===e.slug))}))),(0,a.createElement)(vn,{title:(0,f.__)("Uncategorized"),blockTypes:t.filter((e=>{let{category:t}=e;return!t}))})))}));function wn(){const e=(0,v.useViewportMatch)("medium"),{closeModal:t}=(0,u.useDispatch)(Rt),[n,r]=(0,u.useSelect)((t=>{const{getEditorSettings:n}=t(x.store),{getEditorMode:r,isFeatureActive:o}=t(Rt),l=t(Rt).isModalActive("edit-post/preferences"),a=r(),i=n().richEditingEnabled,s=o("distractionFree");return[l,!s&&e&&i&&"visual"===a,s]}),[e]),{closeGeneralSidebar:o,setIsListViewOpened:l,setIsInserterOpened:i}=(0,u.useDispatch)(Rt),{set:s}=(0,u.useDispatch)(p.store),c=()=>{s("core/edit-post","fixedToolbar",!1),i(!1),l(!1),o()},d=(0,a.useMemo)((()=>[{name:"general",tabLabel:(0,f.__)("General"),content:(0,a.createElement)(a.Fragment,null,e&&(0,a.createElement)(Ce,{title:(0,f.__)("Publishing"),description:(0,f.__)("Change options related to publishing.")},(0,a.createElement)(_n,{help:(0,f.__)("Review settings, such as visibility and tags."),label:(0,f.__)("Include pre-publish checklist")})),(0,a.createElement)(Ce,{title:(0,f.__)("Appearance"),description:(0,f.__)("Customize options related to the block editor interface and editing flow.")},(0,a.createElement)(En,{featureName:"distractionFree",onToggle:c,help:(0,f.__)("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:(0,f.__)("Distraction free")}),(0,a.createElement)(En,{featureName:"focusMode",help:(0,f.__)("Highlights the current block and fades other content."),label:(0,f.__)("Spotlight mode")}),(0,a.createElement)(En,{featureName:"showIconLabels",label:(0,f.__)("Show button text labels"),help:(0,f.__)("Show text instead of icons on buttons.")}),(0,a.createElement)(En,{featureName:"showListViewByDefault",help:(0,f.__)("Opens the block list view sidebar by default."),label:(0,f.__)("Always open list view")}),(0,a.createElement)(En,{featureName:"themeStyles",help:(0,f.__)("Make the editor look like your theme."),label:(0,f.__)("Use theme styles")}),r&&(0,a.createElement)(En,{featureName:"showBlockBreadcrumbs",help:(0,f.__)("Shows block breadcrumbs at the bottom of the editor."),label:(0,f.__)("Display block breadcrumbs")})))},{name:"blocks",tabLabel:(0,f.__)("Blocks"),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Ce,{title:(0,f.__)("Block interactions"),description:(0,f.__)("Customize how you interact with blocks in the block library and editing canvas.")},(0,a.createElement)(En,{featureName:"mostUsedBlocks",help:(0,f.__)("Places the most frequent blocks in the block library."),label:(0,f.__)("Show most used blocks")}),(0,a.createElement)(En,{featureName:"keepCaretInsideBlock",help:(0,f.__)("Aids screen readers by stopping text caret from leaving blocks."),label:(0,f.__)("Contain text cursor inside block")})),(0,a.createElement)(Ce,{title:(0,f.__)("Visible blocks"),description:(0,f.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")},(0,a.createElement)(yn,null)))},{name:"panels",tabLabel:(0,f.__)("Panels"),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Ce,{title:(0,f.__)("Document settings"),description:(0,f.__)("Choose what displays in the panel.")},(0,a.createElement)(hn.Slot,null),(0,a.createElement)(x.PostTaxonomies,{taxonomyWrapper:(e,t)=>(0,a.createElement)(un,{label:(0,Gt.get)(t,["labels","menu_name"]),panelName:`taxonomy-panel-${t.slug}`})}),(0,a.createElement)(x.PostFeaturedImageCheck,null,(0,a.createElement)(un,{label:(0,f.__)("Featured image"),panelName:"featured-image"})),(0,a.createElement)(x.PostExcerptCheck,null,(0,a.createElement)(un,{label:(0,f.__)("Excerpt"),panelName:"post-excerpt"})),(0,a.createElement)(x.PostTypeSupportCheck,{supportKeys:["comments","trackbacks"]},(0,a.createElement)(un,{label:(0,f.__)("Discussion"),panelName:"discussion-panel"})),(0,a.createElement)(x.PageAttributesCheck,null,(0,a.createElement)(un,{label:(0,f.__)("Page attributes"),panelName:"page-attributes"}))),(0,a.createElement)(bn,{title:(0,f.__)("Additional"),description:(0,f.__)("Add extra areas to the editor.")}))}]),[e,r]);return n?(0,a.createElement)(ve,{closeModal:t},(0,a.createElement)(Pe,{sections:d})):null}class Sn extends a.Component{constructor(){super(...arguments),this.state={historyId:null}}componentDidUpdate(e){const{postId:t,postStatus:n,postType:r,isSavingPost:o}=this.props,{historyId:l}=this.state;"trash"!==n||o?t===e.postId&&t===l||"auto-draft"===n||!t||this.setBrowserURL(t):this.setTrashURL(t,r)}setTrashURL(e,t){window.location.href=function(e,t){return(0,C.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,C.addQueryArgs)("post.php",{post:e,action:"edit"})}(e)),this.setState((()=>({historyId:e})))}render(){return null}}var kn=(0,u.withSelect)((e=>{const{getCurrentPost:t,isSavingPost:n}=e(x.store),r=t();let{id:o,status:l,type:a}=r;return["wp_template","wp_template_part"].includes(a)&&(o=r.wp_id),{postId:o,postStatus:l,postType:a,isSavingPost:n()}}))(Sn);var Pn=(0,a.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,a.createElement)(S.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 Cn=function(e){let{showTooltip:t,icon:n,href:r}=e;const{isActive:o,isRequestingSiteIcon:l,postType:i,siteIconUrl:s}=(0,u.useSelect)((e=>{const{getCurrentPostType:t}=e(x.store),{isFeatureActive:n}=e(Rt),{getEntityRecord:r,getPostType:o,isResolving:l}=e(Be.store),a=r("root","__unstableBase",void 0)||{};return{isActive:n("fullscreenMode"),isRequestingSiteIcon:l("getEntityRecord",["root","__unstableBase",void 0]),postType:o(t()),siteIconUrl:a.site_icon_url}}),[]),c=(0,v.useReducedMotion)();if(!o||!i)return null;let d=(0,a.createElement)(E.Icon,{size:"36px",icon:Pn});const m={expand:{scale:1.25,transition:{type:"tween",duration:"0.3"}}};s&&(d=(0,a.createElement)(E.__unstableMotion.img,{variants:!c&&m,alt:(0,f.__)("Site Icon"),className:"edit-post-fullscreen-mode-close_site-icon",src:s})),l&&(d=null),n&&(d=(0,a.createElement)(E.Icon,{size:"36px",icon:n}));const p=V()({"edit-post-fullscreen-mode-close":!0,"has-icon":s});return(0,a.createElement)(E.__unstableMotion.div,{whileHover:"expand"},(0,a.createElement)(E.Button,{className:p,href:null!=r?r:(0,C.addQueryArgs)("edit.php",{post_type:i.slug}),label:(0,Gt.get)(i,["labels","view_items"],(0,f.__)("Back")),showTooltip:t},d))};var Tn=(0,a.createElement)(S.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(S.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));var xn=(0,a.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(S.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const Bn=e=>{e.preventDefault()};var Mn=function(){const e=(0,a.useRef)(),{setIsInserterOpened:t,setIsListViewOpened:n}=(0,u.useDispatch)(Rt),{isInserterEnabled:r,isInserterOpened:o,isTextModeEnabled:l,showIconLabels:i,isListViewOpen:s,listViewShortcut:c}=(0,u.useSelect)((e=>{const{hasInserterItems:t,getBlockRootClientId:n,getBlockSelectionEnd:r}=e(b.store),{getEditorSettings:o}=e(x.store),{getEditorMode:l,isFeatureActive:a,isListViewOpened:i}=e(Rt),{getShortcutRepresentation:s}=e(qt.store);return{isInserterEnabled:"visual"===l()&&o().richEditingEnabled&&t(n(r())),isInserterOpened:e(Rt).isInserterOpened(),isTextModeEnabled:"text"===l(),showIconLabels:a("showIconLabels"),isListViewOpen:i(),listViewShortcut:s("core/edit-post/toggle-list-view")}}),[]),d=(0,v.useViewportMatch)("medium"),m=(0,v.useViewportMatch)("wide"),p=(0,f.__)("Document tools"),g=(0,a.useCallback)((()=>n(!s)),[n,s]),h=(0,a.createElement)(a.Fragment,null,(0,a.createElement)(E.ToolbarItem,{as:E.Button,className:"edit-post-header-toolbar__document-overview-toggle",icon:Tn,disabled:l,isPressed:s,label:(0,f.__)("Document Overview"),onClick:g,shortcut:c,showTooltip:!i,variant:i?"tertiary":void 0})),_=(0,a.useCallback)((()=>{o?(e.current.focus(),t(!1)):t(!0)}),[o,t]),y=(0,f._x)("Toggle block inserter","Generic label for block inserter button"),w=o?(0,f.__)("Close"):(0,f.__)("Add");return(0,a.createElement)(b.NavigableToolbar,{className:"edit-post-header-toolbar","aria-label":p},(0,a.createElement)("div",{className:"edit-post-header-toolbar__left"},(0,a.createElement)(E.ToolbarItem,{ref:e,as:E.Button,className:"edit-post-header-toolbar__inserter-toggle",variant:"primary",isPressed:o,onMouseDown:Bn,onClick:_,disabled:!r,icon:xn,label:i?w:y,showTooltip:!i}),(m||!i)&&(0,a.createElement)(a.Fragment,null,d&&(0,a.createElement)(E.ToolbarItem,{as:b.ToolSelector,showTooltip:!i,variant:i?"tertiary":void 0,disabled:l}),(0,a.createElement)(E.ToolbarItem,{as:x.EditorHistoryUndo,showTooltip:!i,variant:i?"tertiary":void 0}),(0,a.createElement)(E.ToolbarItem,{as:x.EditorHistoryRedo,showTooltip:!i,variant:i?"tertiary":void 0}),h)))};const Nn=[{value:"visual",label:(0,f.__)("Visual editor")},{value:"text",label:(0,f.__)("Code editor")}];var In=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:n,isEditingTemplate:r,mode:o}=(0,u.useSelect)((e=>({shortcut:e(qt.store).getShortcutRepresentation("core/edit-post/toggle-mode"),isRichEditingEnabled:e(x.store).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(x.store).getEditorSettings().codeEditingEnabled,isEditingTemplate:e(Rt).isEditingTemplate(),mode:e(Rt).getEditorMode()})),[]),{switchEditorMode:l}=(0,u.useDispatch)(Rt);if(r)return null;if(!t||!n)return null;const i=Nn.map((t=>t.value!==o?{...t,shortcut:e}:t));return(0,a.createElement)(E.MenuGroup,{label:(0,f.__)("Editor")},(0,a.createElement)(E.MenuItemsChoice,{choices:i,value:o,onSelect:l}))};function Dn(){const{openModal:e}=(0,u.useDispatch)(Rt);return(0,a.createElement)(E.MenuItem,{onClick:()=>{e("edit-post/preferences")}},(0,f.__)("Preferences"))}var An=function(){const e=(0,u.useRegistry)(),t=(0,u.useSelect)((e=>e(b.store).getSettings().isDistractionFree),[]),n=(0,u.useSelect)((e=>e(b.store).getBlocks()),[]),{setIsInserterOpened:r,setIsListViewOpened:o,closeGeneralSidebar:l}=(0,u.useDispatch)(Rt),{set:i}=(0,u.useDispatch)(p.store),{selectBlock:s}=(0,u.useDispatch)(b.store);return(0,v.useViewportMatch)("medium")?(0,a.createElement)(E.MenuGroup,{label:(0,f._x)("View","noun")},(0,a.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",disabled:t,name:"fixedToolbar",label:(0,f.__)("Top toolbar"),info:(0,f.__)("Access all block and document tools in a single place"),messageActivated:(0,f.__)("Top toolbar activated"),messageDeactivated:(0,f.__)("Top toolbar deactivated")}),(0,a.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"focusMode",label:(0,f.__)("Spotlight mode"),info:(0,f.__)("Focus on one block at a time"),messageActivated:(0,f.__)("Spotlight mode activated"),messageDeactivated:(0,f.__)("Spotlight mode deactivated")}),(0,a.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fullscreenMode",label:(0,f.__)("Fullscreen mode"),info:(0,f.__)("Show and hide admin UI"),messageActivated:(0,f.__)("Fullscreen mode activated"),messageDeactivated:(0,f.__)("Fullscreen mode deactivated"),shortcut:M.displayShortcut.secondary("f")}),(0,a.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"distractionFree",onToggle:()=>{e.batch((()=>{i("core/edit-post","fixedToolbar",!1),r(!1),o(!1),l(),!t&&n.length&&s(n[0].clientId)}))},label:(0,f.__)("Distraction free"),info:(0,f.__)("Write with calmness"),messageActivated:(0,f.__)("Distraction free mode activated"),messageDeactivated:(0,f.__)("Distraction free mode deactivated"),shortcut:M.displayShortcut.primaryShift("\\")})):null};var Ln=e=>{let{showIconLabels:t}=e;const n=(0,v.useViewportMatch)("large");return(0,a.createElement)(fe,{toggleProps:{showTooltip:!t,...t&&{variant:"tertiary"}}},(e=>{let{onClose:r}=e;return(0,a.createElement)(a.Fragment,null,t&&!n&&(0,a.createElement)(ue.Slot,{className:t&&"show-icon-labels",scope:"core/edit-post"}),(0,a.createElement)(An,null),(0,a.createElement)(In,null),(0,a.createElement)(ie.Slot,{name:"core/edit-post/plugin-more-menu",label:(0,f.__)("Plugins"),as:E.MenuGroup,fillProps:{onClick:r}}),(0,a.createElement)(Wt.Slot,{fillProps:{onClose:r}}),(0,a.createElement)(E.MenuGroup,null,(0,a.createElement)(Dn,null)))}))};var On=(0,v.compose)((0,u.withSelect)((e=>({hasPublishAction:(0,Gt.get)(e(x.store).getCurrentPost(),["_links","wp:action-publish"],!1),isBeingScheduled:e(x.store).isEditedPostBeingScheduled(),isPending:e(x.store).isCurrentPostPending(),isPublished:e(x.store).isCurrentPostPublished(),isPublishSidebarEnabled:e(x.store).isPublishSidebarEnabled(),isPublishSidebarOpened:e(Rt).isPublishSidebarOpened(),isScheduled:e(x.store).isCurrentPostScheduled()}))),(0,u.withDispatch)((e=>{const{togglePublishSidebar:t}=e(Rt);return{togglePublishSidebar:t}})))((function(e){let{forceIsDirty:t,forceIsSaving:n,hasPublishAction:r,isBeingScheduled:o,isPending:l,isPublished:i,isPublishSidebarEnabled:s,isPublishSidebarOpened:c,isScheduled:d,togglePublishSidebar:u,setEntitiesSavedStatesCallback:m}=e;const p="toggle",g="button",h=(0,v.useViewportMatch)("medium","<");let _;return _=i||d&&o||l&&!r&&!h?g:h||s?p:g,(0,a.createElement)(x.PostPublishButton,{forceIsDirty:t,forceIsSaving:n,isOpen:c,isToggle:_===p,onToggle:u,setEntitiesSavedStatesCallback:m})}));function Vn(){const{hasActiveMetaboxes:e,isPostSaveable:t,isSaving:n,isViewable:r,deviceType:o}=(0,u.useSelect)((e=>{const{getEditedPostAttribute:t}=e(x.store),{getPostType:n}=e(Be.store),r=n(t("type"));return{hasActiveMetaboxes:e(Rt).hasMetaBoxes(),isSaving:e(Rt).isSavingMetaBoxes(),isPostSaveable:e(x.store).isEditedPostSaveable(),isViewable:(0,Gt.get)(r,["viewable"],!1),deviceType:e(Rt).__experimentalGetPreviewDeviceType()}}),[]),{__experimentalSetPreviewDeviceType:l}=(0,u.useDispatch)(Rt);return(0,a.createElement)(b.__experimentalPreviewOptions,{isEnabled:t,className:"edit-post-post-preview-dropdown",deviceType:o,setDeviceType:l,viewLabel:(0,f.__)("Preview")},r&&(0,a.createElement)(E.MenuGroup,null,(0,a.createElement)("div",{className:"edit-post-header-preview__grouping-external"},(0,a.createElement)(x.PostPreviewButton,{className:"edit-post-header-preview__button-external",role:"menuitem",forceIsAutosaveable:e,forcePreviewLink:n?null:void 0,textContent:(0,a.createElement)(a.Fragment,null,(0,f.__)("Preview in new tab"),(0,a.createElement)(E.Icon,{icon:k}))}))))}const Fn="__experimentalMainDashboardButton",{Fill:Rn,Slot:Hn}=(0,E.createSlotFill)(Fn),Gn=Rn;Gn.Slot=e=>{let{children:t}=e;const n=(0,E.__experimentalUseSlotFills)(Fn);return Boolean(n&&n.length)?(0,a.createElement)(Hn,{bubblesVirtually:!0}):t};var Un=Gn;var zn=(0,a.createElement)(S.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(S.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function Wn(){const{clearSelectedBlock:e}=(0,u.useDispatch)(b.store),{setIsEditingTemplate:t}=(0,u.useDispatch)(Rt),{getEditorSettings:n}=(0,u.useSelect)(x.store),{updateEditorSettings:r,editPost:o}=(0,u.useDispatch)(x.store),{deleteEntityRecord:l}=(0,u.useDispatch)(Be.store),{template:i}=(0,u.useSelect)((e=>{const{isEditingTemplate:t,getEditedPostTemplate:n}=e(Rt);return{template:t()?n():null}}),[]),[s,c]=(0,a.useState)(!1);if(!i||!i.wp_id)return null;let d=i.slug;null!=i&&i.title&&(d=i.title);const m=null==i?void 0:i.has_theme_file;return(0,a.createElement)(E.MenuGroup,{className:"edit-post-template-top-area__second-menu-group"},(0,a.createElement)(a.Fragment,null,(0,a.createElement)(E.MenuItem,{className:"edit-post-template-top-area__delete-template-button",isDestructive:!m,onClick:()=>{c(!0)},info:m?(0,f.__)("Use the template as supplied by the theme."):void 0},m?(0,f.__)("Clear customizations"):(0,f.__)("Delete template")),(0,a.createElement)(E.__experimentalConfirmDialog,{isOpen:s,onConfirm:()=>{var a;e(),t(!1),c(!1),o({template:""});const s=n(),d=Object.fromEntries(Object.entries(null!==(a=s.availableTemplates)&&void 0!==a?a:{}).filter((e=>{let[t]=e;return t!==i.slug})));r({...s,availableTemplates:d}),l("postType","wp_template",i.id,{throwOnError:!0})},onCancel:()=>{c(!1)}},(0,f.sprintf)((0,f.__)("Are you sure you want to delete the %s template? It may be used by other pages or posts."),d))))}function $n(){const[e,t]=(0,a.useState)(!1),{template:n}=(0,u.useSelect)((e=>{const{getEditedPostTemplate:t}=e(Rt);return{template:t()}}),[]),{editEntityRecord:r}=(0,u.useDispatch)(Be.store),{getEditorSettings:o}=(0,u.useSelect)(x.store),{updateEditorSettings:l}=(0,u.useDispatch)(x.store);if(!n.is_custom||n.has_theme_file)return null;let i=(0,f.__)("Default");return null!=n&&n.title?i=n.title:n&&(i=n.slug),(0,a.createElement)("div",{className:"edit-site-template-details__group"},(0,a.createElement)(E.TextControl,{__nextHasNoMarginBottom:!0,label:(0,f.__)("Title"),value:e?"":i,help:(0,f.__)('Give the template a title that indicates its purpose, e.g. "Full Width".'),onChange:a=>{if(!a&&!e)return void t(!0);t(!1);const i=o(),s=(0,Gt.mapValues)(i.availableTemplates,((e,t)=>t!==n.slug?e:a));l({...i,availableTemplates:s}),r("postType","wp_template",n.id,{title:a})},onBlur:()=>t(!1)}))}function qn(){const{description:e,title:t}=(0,u.useSelect)((e=>{const{getEditedPostTemplate:t}=e(Rt);return{title:t().title,description:t().description}}),[]);return e?(0,a.createElement)("div",{className:"edit-site-template-details__group"},(0,a.createElement)(E.__experimentalHeading,{level:4,weight:600},t),(0,a.createElement)(E.__experimentalText,{className:"edit-post-template-details__description",size:"body",as:"p",style:{marginTop:"12px"}},e)):null}var jn=function(){const{template:e,isEditing:t,title:n}=(0,u.useSelect)((e=>{const{isEditingTemplate:t,getEditedPostTemplate:n}=e(Rt),{getEditedPostAttribute:r}=e(x.store),o=t();return{template:o?n():null,isEditing:o,title:r("title")?r("title"):(0,f.__)("Untitled")}}),[]),{clearSelectedBlock:r}=(0,u.useDispatch)(b.store),{setIsEditingTemplate:o}=(0,u.useDispatch)(Rt);if(!t||!e)return null;let l=(0,f.__)("Default");null!=e&&e.title?l=e.title:e&&(l=e.slug);const i=!!(e.custom||e.wp_id||e.description);return(0,a.createElement)("div",{className:"edit-post-template-top-area"},(0,a.createElement)(E.Button,{className:"edit-post-template-post-title",isLink:!0,showTooltip:!0,label:(0,f.sprintf)((0,f.__)("Edit %s"),n),onClick:()=>{r(),o(!1)}},n),i?(0,a.createElement)(E.Dropdown,{popoverProps:{placement:"bottom"},contentClassName:"edit-post-template-top-area__popover",renderToggle:e=>{let{onToggle:t}=e;return(0,a.createElement)(E.Button,{className:"edit-post-template-title",isLink:!0,icon:zn,showTooltip:!0,onClick:t,label:(0,f.__)("Template Options")},l)},renderContent:()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)($n,null),(0,a.createElement)(qn,null),(0,a.createElement)(Wn,null))}):(0,a.createElement)(E.__experimentalText,{className:"edit-post-template-title",size:"body",style:{lineHeight:"24px"}},l))};var Zn=function(e){let{setEntitiesSavedStatesCallback:t}=e;const n=(0,v.useViewportMatch)("large"),{hasActiveMetaboxes:r,isPublishSidebarOpened:o,isSaving:l,showIconLabels:i,isDistractionFreeMode:s}=(0,u.useSelect)((e=>({hasActiveMetaboxes:e(Rt).hasMetaBoxes(),isPublishSidebarOpened:e(Rt).isPublishSidebarOpened(),isSaving:e(Rt).isSavingMetaBoxes(),showIconLabels:e(Rt).isFeatureActive("showIconLabels"),isDistractionFreeMode:e(Rt).isFeatureActive("distractionFree")})),[]),c=s&&n,d=V()("edit-post-header"),m={hidden:c?{y:"-50"}:{y:0},hover:{y:0,transition:{type:"tween",delay:.2}}},p={hidden:c?{x:"-100%"}:{x:0},hover:{x:0,transition:{type:"tween",delay:.2}}};return(0,a.createElement)("div",{className:d},(0,a.createElement)(Un.Slot,null,(0,a.createElement)(E.__unstableMotion.div,{variants:p,transition:{type:"tween",delay:.8}},(0,a.createElement)(Cn,{showTooltip:!0}))),(0,a.createElement)(E.__unstableMotion.div,{variants:m,transition:{type:"tween",delay:.8},className:"edit-post-header__toolbar"},(0,a.createElement)(Mn,null),(0,a.createElement)(jn,null)),(0,a.createElement)(E.__unstableMotion.div,{variants:m,transition:{type:"tween",delay:.8},className:"edit-post-header__settings"},!o&&(0,a.createElement)(x.PostSavedState,{forceIsDirty:r,forceIsSaving:l,showIconLabels:i}),(0,a.createElement)(Vn,null),(0,a.createElement)(x.PostPreviewButton,{forceIsAutosaveable:r,forcePreviewLink:l?null:void 0}),(0,a.createElement)(On,{forceIsDirty:r,forceIsSaving:l,setEntitiesSavedStatesCallback:t}),(n||!i)&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ue.Slot,{scope:"core/edit-post"}),(0,a.createElement)(Ln,{showIconLabels:i})),i&&!n&&(0,a.createElement)(Ln,{showIconLabels:i})))};var Kn=(0,a.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(S.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function Yn(){const{insertionPoint:e,showMostUsedBlocks:t}=(0,u.useSelect)((e=>{const{isFeatureActive:t,__experimentalGetInsertionPoint:n}=e(Rt);return{insertionPoint:n(),showMostUsedBlocks:t("mostUsedBlocks")}}),[]),{setIsInserterOpened:n}=(0,u.useDispatch)(Rt),r=(0,v.useViewportMatch)("medium","<"),o=r?"div":E.VisuallyHidden,[l,i]=(0,v.__experimentalUseDialog)({onClose:()=>n(!1),focusOnMount:null}),s=(0,a.useRef)();return(0,a.useEffect)((()=>{s.current.focusSearch()}),[]),(0,a.createElement)("div",_({ref:l},i,{className:"edit-post-editor__inserter-panel"}),(0,a.createElement)(o,{className:"edit-post-editor__inserter-panel-header"},(0,a.createElement)(E.Button,{icon:Kn,label:(0,f.__)("Close block inserter"),onClick:()=>n(!1)})),(0,a.createElement)("div",{className:"edit-post-editor__inserter-panel-content"},(0,a.createElement)(b.__experimentalLibrary,{showMostUsedBlocks:t,showInserterHelpPanel:!0,shouldFocusBlock:r,rootClientId:e.rootClientId,__experimentalInsertionIndex:e.insertionIndex,__experimentalFilterValue:e.filterValue,ref:s})))}function Xn(){return(0,a.createElement)(E.SVG,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(E.Rect,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),(0,a.createElement)(E.Line,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),(0,a.createElement)(E.Rect,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),(0,a.createElement)(E.Path,{d:"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z",fill:"black"}),(0,a.createElement)(E.Line,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),(0,a.createElement)(E.Rect,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,a.createElement)(E.Path,{d:"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z",fill:"black"}),(0,a.createElement)(E.Line,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),(0,a.createElement)(E.Rect,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),(0,a.createElement)(E.Path,{d:"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z",fill:"black"}),(0,a.createElement)(E.Line,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),(0,a.createElement)(E.Rect,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,a.createElement)(E.Path,{d:"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z",fill:"black"}))}function Qn(){const{headingCount:e}=(0,u.useSelect)((e=>{const{getGlobalBlockCount:t}=e(b.store);return{headingCount:t("core/heading")}}),[]);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"edit-post-editor__list-view-overview"},(0,a.createElement)("div",null,(0,a.createElement)(E.__experimentalText,null,(0,f.__)("Characters:")),(0,a.createElement)(E.__experimentalText,null,(0,a.createElement)(x.CharacterCount,null))),(0,a.createElement)("div",null,(0,a.createElement)(E.__experimentalText,null,(0,f.__)("Words:")),(0,a.createElement)(x.WordCount,null)),(0,a.createElement)("div",null,(0,a.createElement)(E.__experimentalText,null,(0,f.__)("Time to read:")),(0,a.createElement)(x.TimeToRead,null))),e>0?(0,a.createElement)(x.DocumentOutline,null):(0,a.createElement)("div",{className:"edit-post-editor__list-view-empty-headings"},(0,a.createElement)(Xn,null),(0,a.createElement)("p",null,(0,f.__)("Navigate the structure of your document and address issues like empty or incorrect heading levels."))))}function Jn(){const{setIsListViewOpened:e}=(0,u.useDispatch)(Rt),t=(0,v.useFocusOnMount)("firstElement"),n=(0,v.useFocusReturn)(),r=(0,v.useFocusReturn)();const[o,l]=(0,a.useState)("list-view");return(0,a.createElement)("div",{"aria-label":(0,f.__)("Document Overview"),className:"edit-post-editor__document-overview-panel",onKeyDown:function(t){t.keyCode!==M.ESCAPE||t.defaultPrevented||(t.preventDefault(),e(!1))}},(0,a.createElement)("div",{className:"edit-post-editor__document-overview-panel-header components-panel__header edit-post-sidebar__panel-tabs",ref:n},(0,a.createElement)(E.Button,{icon:U,label:(0,f.__)("Close Document Overview Sidebar"),onClick:()=>e(!1)}),(0,a.createElement)("ul",null,(0,a.createElement)("li",null,(0,a.createElement)(E.Button,{onClick:()=>{l("list-view")},className:V()("edit-post-sidebar__panel-tab",{"is-active":"list-view"===o}),"aria-current":"list-view"===o},(0,f.__)("List View"))),(0,a.createElement)("li",null,(0,a.createElement)(E.Button,{onClick:()=>{l("outline")},className:V()("edit-post-sidebar__panel-tab",{"is-active":"outline"===o}),"aria-current":"outline"===o},(0,f.__)("Outline"))))),(0,a.createElement)("div",{ref:(0,v.useMergeRefs)([r,t]),className:"edit-post-editor__list-view-container"},"list-view"===o&&(0,a.createElement)("div",{className:"edit-post-editor__list-view-panel-content"},(0,a.createElement)(b.__experimentalListView,null)),"outline"===o&&(0,a.createElement)(Qn,null)))}var er=(0,a.createElement)(S.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(S.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 tr=(0,a.createElement)(S.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(S.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"}));var nr=e=>{let{sidebarName:t}=e;const{openGeneralSidebar:n}=(0,u.useDispatch)(Rt),r=()=>n("edit-post/document"),{documentLabel:o,isTemplateMode:l}=(0,u.useSelect)((e=>({documentLabel:e(x.store).getPostTypeLabel()||(0,f._x)("Document","noun"),isTemplateMode:e(Rt).isEditingTemplate()})),[]),[i,s]="edit-post/document"===t?[(0,f.sprintf)((0,f.__)("%s (selected)"),o),"is-active"]:[o,""],[c,d]="edit-post/block"===t?[(0,f.__)("Block (selected)"),"is-active"]:[(0,f.__)("Block"),""],[m,p]="edit-post/document"===t?[(0,f.__)("Template (selected)"),"is-active"]:[(0,f.__)("Template"),""];return(0,a.createElement)("ul",null,!l&&(0,a.createElement)("li",null,(0,a.createElement)(E.Button,{onClick:r,className:`edit-post-sidebar__panel-tab ${s}`,"aria-label":i,"data-label":o},o)),l&&(0,a.createElement)("li",null,(0,a.createElement)(E.Button,{onClick:r,className:`edit-post-sidebar__panel-tab ${p}`,"aria-label":m,"data-label":(0,f.__)("Template")},(0,f.__)("Template"))),(0,a.createElement)("li",null,(0,a.createElement)(E.Button,{onClick:()=>n("edit-post/block"),className:`edit-post-sidebar__panel-tab ${d}`,"aria-label":c,"data-label":(0,f.__)("Block")},(0,f.__)("Block"))))};function rr(e){let{isOpen:t,onClick:n}=e;const r=(0,x.usePostVisibilityLabel)();return(0,a.createElement)(E.Button,{className:"edit-post-post-visibility__toggle",variant:"tertiary","aria-expanded":t,"aria-label":(0,f.sprintf)((0,f.__)("Select visibility: %s"),r),onClick:n},r)}var or=function(){const[e,t]=(0,a.useState)(null),n=(0,a.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,a.createElement)(x.PostVisibilityCheck,{render:e=>{let{canEdit:r}=e;return(0,a.createElement)(E.PanelRow,{ref:t,className:"edit-post-post-visibility"},(0,a.createElement)("span",null,(0,f.__)("Visibility")),!r&&(0,a.createElement)("span",null,(0,a.createElement)(x.PostVisibilityLabel,null)),r&&(0,a.createElement)(E.Dropdown,{contentClassName:"edit-post-post-visibility__dialog",popoverProps:n,focusOnMount:!0,renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(rr,{isOpen:t,onClick:n})},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(x.PostVisibility,{onClose:t})}}))}})};function lr(){return(0,a.createElement)(x.PostTrashCheck,null,(0,a.createElement)(E.PanelRow,null,(0,a.createElement)(x.PostTrash,null)))}function ar(){const[e,t]=(0,a.useState)(null),n=(0,a.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,a.createElement)(x.PostScheduleCheck,null,(0,a.createElement)(E.PanelRow,{className:"edit-post-post-schedule",ref:t},(0,a.createElement)("span",null,(0,f.__)("Publish")),(0,a.createElement)(E.Dropdown,{popoverProps:n,contentClassName:"edit-post-post-schedule__dialog",focusOnMount:!0,renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(ir,{isOpen:t,onClick:n})},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(x.PostSchedule,{onClose:t})}})))}function ir(e){let{isOpen:t,onClick:n}=e;const r=(0,x.usePostScheduleLabel)(),o=(0,x.usePostScheduleLabel)({full:!0});return(0,a.createElement)(E.Button,{className:"edit-post-post-schedule__toggle",variant:"tertiary",label:o,showTooltip:!0,"aria-expanded":t,"aria-label":(0,f.sprintf)((0,f.__)("Change date: %s"),r),onClick:n},r)}var sr=function(){return(0,a.createElement)(x.PostStickyCheck,null,(0,a.createElement)(E.PanelRow,null,(0,a.createElement)(x.PostSticky,null)))};var cr=function(){return(0,a.createElement)(x.PostAuthorCheck,null,(0,a.createElement)(E.PanelRow,{className:"edit-post-post-author"},(0,a.createElement)(x.PostAuthor,null)))};var dr=function(){return(0,a.createElement)(x.PostSlugCheck,null,(0,a.createElement)(E.PanelRow,{className:"edit-post-post-slug"},(0,a.createElement)(x.PostSlug,null)))};var ur=function(){return(0,a.createElement)(x.PostFormatCheck,null,(0,a.createElement)(E.PanelRow,{className:"edit-post-post-format"},(0,a.createElement)(x.PostFormat,null)))};var mr=function(){return(0,a.createElement)(x.PostPendingStatusCheck,null,(0,a.createElement)(E.PanelRow,null,(0,a.createElement)(x.PostPendingStatus,null)))};const{Fill:pr,Slot:gr}=(0,E.createSlotFill)("PluginPostStatusInfo"),hr=e=>{let{children:t,className:n}=e;return(0,a.createElement)(pr,null,(0,a.createElement)(E.PanelRow,{className:n},t))};hr.Slot=gr;var _r=hr;var Er=(0,a.createElement)(S.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(S.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5 5.5V8H20V5.5H22.5V4H20V1.5H18.5V4H16V5.5H18.5ZM13.9624 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V10.0391H18.5V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 10.4917L16.4589 10.5139L16.4641 9.01389L5.5 8.97618V6C5.5 5.72386 5.72386 5.5 6 5.5H13.9624V4ZM5.5 10.4762V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 10.4865L5.5 10.4762Z"}));const br=(0,f.__)("Custom Template");function fr(e){let{onClose:t}=e;const n=(0,u.useSelect)((e=>e(x.store).getEditorSettings().defaultBlockTemplate),[]),{__unstableCreateTemplate:r,__unstableSwitchToTemplateMode:o}=(0,u.useDispatch)(Rt),[l,s]=(0,a.useState)(""),[c,d]=(0,a.useState)(!1),m=()=>{s(""),t()};return(0,a.createElement)(E.Modal,{title:(0,f.__)("Create custom template"),onRequestClose:m,className:"edit-post-post-template__create-modal"},(0,a.createElement)("form",{className:"edit-post-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),c)return;d(!0);const t=null!=n?n:(0,i.serialize)([(0,i.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,i.createBlock)("core/site-title"),(0,i.createBlock)("core/site-tagline")]),(0,i.createBlock)("core/separator"),(0,i.createBlock)("core/group",{tagName:"main"},[(0,i.createBlock)("core/group",{layout:{inherit:!0}},[(0,i.createBlock)("core/post-title")]),(0,i.createBlock)("core/post-content",{layout:{inherit:!0}})])]);await r({slug:(0,C.cleanForSlug)(l||br),content:t,title:l||br}),d(!1),m(),o(!0)}},(0,a.createElement)(E.__experimentalVStack,{spacing:"3"},(0,a.createElement)(E.TextControl,{__nextHasNoMarginBottom:!0,label:(0,f.__)("Name"),value:l,onChange:s,placeholder:br,disabled:c,help:(0,f.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),(0,a.createElement)(E.__experimentalHStack,{justify:"right"},(0,a.createElement)(E.Button,{variant:"tertiary",onClick:m},(0,f.__)("Cancel")),(0,a.createElement)(E.Button,{variant:"primary",type:"submit",isBusy:c,"aria-disabled":c},(0,f.__)("Create"))))))}function vr(e){var t,n;let{onClose:r}=e;const{isPostsPage:o,availableTemplates:l,fetchedTemplates:i,selectedTemplateSlug:s,canCreate:c,canEdit:d}=(0,u.useSelect)((e=>{const{canUser:t,getEntityRecord:n,getEntityRecords:r}=e(Be.store),o=e(x.store).getEditorSettings(),l=t("read","settings")?n("root","site"):void 0,a=e(x.store).getCurrentPostId()===(null==l?void 0:l.page_for_posts),i=t("create","templates");return{isPostsPage:a,availableTemplates:o.availableTemplates,fetchedTemplates:i?r("postType","wp_template",{post_type:e(x.store).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(x.store).getEditedPostAttribute("template"),canCreate:i&&!a&&o.supportsTemplateMode,canEdit:i&&o.supportsTemplateMode&&!!e(Rt).getEditedPostTemplate()}}),[]),m=(0,a.useMemo)((()=>Object.entries({...l,...Object.fromEntries((null!=i?i:[]).map((e=>{let{slug:t,title:n}=e;return[t,n.rendered]})))}).map((e=>{let[t,n]=e;return{value:t,label:n}}))),[l,i]),p=null!==(t=m.find((e=>e.value===s)))&&void 0!==t?t:m.find((e=>!e.value)),{editPost:g}=(0,u.useDispatch)(x.store),{__unstableSwitchToTemplateMode:h}=(0,u.useDispatch)(Rt),[_,v]=(0,a.useState)(!1);return(0,a.createElement)("div",{className:"edit-post-post-template__form"},(0,a.createElement)(b.__experimentalInspectorPopoverHeader,{title:(0,f.__)("Template"),help:(0,f.__)("Templates define the way content is displayed when viewing your site."),actions:c?[{icon:Er,label:(0,f.__)("Add template"),onClick:()=>v(!0)}]:[],onClose:r}),o?(0,a.createElement)(E.Notice,{className:"edit-post-post-template__notice",status:"warning",isDismissible:!1},(0,f.__)("The posts page template cannot be changed.")):(0,a.createElement)(E.SelectControl,{__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:(0,f.__)("Template"),value:null!==(n=null==p?void 0:p.value)&&void 0!==n?n:"",options:m,onChange:e=>g({template:e||""})}),d&&(0,a.createElement)("p",null,(0,a.createElement)(E.Button,{variant:"link",onClick:()=>h()},(0,f.__)("Edit template"))),_&&(0,a.createElement)(fr,{onClose:()=>v(!1)}))}function yr(){const[e,t]=(0,a.useState)(null),n=(0,a.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,u.useSelect)((e=>{var t;const n=e(x.store).getCurrentPostType(),r=e(Be.store).getPostType(n);if(null==r||!r.viewable)return!1;const o=e(x.store).getEditorSettings();if(!!o.availableTemplates&&Object.keys(o.availableTemplates).length>0)return!0;if(!o.supportsTemplateMode)return!1;return null!==(t=e(Be.store).canUser("create","templates"))&&void 0!==t&&t}),[])?(0,a.createElement)(E.PanelRow,{className:"edit-post-post-template",ref:t},(0,a.createElement)("span",null,(0,f.__)("Template")),(0,a.createElement)(E.Dropdown,{popoverProps:n,className:"edit-post-post-template__dropdown",contentClassName:"edit-post-post-template__dialog",focusOnMount:!0,renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(wr,{isOpen:t,onClick:n})},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(vr,{onClose:t})}})):null}function wr(e){let{isOpen:t,onClick:n}=e;const r=(0,u.useSelect)((e=>{const t=e(x.store).getEditedPostAttribute("template"),{supportsTemplateMode:n,availableTemplates:r}=e(x.store).getEditorSettings();if(!n&&r[t])return r[t];const o=e(Be.store).canUser("create","templates")&&e(Rt).getEditedPostTemplate();return(null==o?void 0:o.title)||(null==o?void 0:o.slug)||(null==r?void 0:r[t])}),[]);return(0,a.createElement)(E.Button,{className:"edit-post-post-template__toggle",variant:"tertiary","aria-expanded":t,"aria-label":r?(0,f.sprintf)((0,f.__)("Select template: %s"),r):(0,f.__)("Select template"),onClick:n},null!=r?r:(0,f.__)("Default template"))}function Sr(){const[e,t]=(0,a.useState)(null),n=(0,a.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,a.createElement)(x.PostURLCheck,null,(0,a.createElement)(E.PanelRow,{className:"edit-post-post-url",ref:t},(0,a.createElement)("span",null,(0,f.__)("URL")),(0,a.createElement)(E.Dropdown,{popoverProps:n,className:"edit-post-post-url__dropdown",contentClassName:"edit-post-post-url__dialog",focusOnMount:!0,renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(kr,{isOpen:t,onClick:n})},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(x.PostURL,{onClose:t})}})))}function kr(e){let{isOpen:t,onClick:n}=e;const r=(0,x.usePostURLLabel)();return(0,a.createElement)(E.Button,{className:"edit-post-post-url__toggle",variant:"tertiary","aria-expanded":t,"aria-label":(0,f.sprintf)((0,f.__)("Change URL: %s"),r),onClick:n},r)}const Pr="post-status";var Cr=(0,v.compose)([(0,u.withSelect)((e=>{const{isEditorPanelRemoved:t,isEditorPanelOpened:n}=e(Rt);return{isRemoved:t(Pr),isOpened:n(Pr)}})),(0,v.ifCondition)((e=>{let{isRemoved:t}=e;return!t})),(0,u.withDispatch)((e=>({onTogglePanel(){return e(Rt).toggleEditorPanelOpened(Pr)}})))])((function(e){let{isOpened:t,onTogglePanel:n}=e;return(0,a.createElement)(E.PanelBody,{className:"edit-post-post-status",title:(0,f.__)("Summary"),opened:t,onToggle:n},(0,a.createElement)(_r.Slot,null,(e=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(or,null),(0,a.createElement)(ar,null),(0,a.createElement)(yr,null),(0,a.createElement)(Sr,null),(0,a.createElement)(sr,null),(0,a.createElement)(mr,null),(0,a.createElement)(ur,null),(0,a.createElement)(dr,null),(0,a.createElement)(cr,null),e,(0,a.createElement)(lr,null)))))}));var Tr=function(){return(0,a.createElement)(x.PostLastRevisionCheck,null,(0,a.createElement)(E.PanelBody,{className:"edit-post-last-revision__panel"},(0,a.createElement)(x.PostLastRevision,null)))};var xr=(0,v.compose)((0,u.withSelect)(((e,t)=>{const n=(0,Gt.get)(t.taxonomy,["slug"]),r=n?`taxonomy-panel-${n}`:"";return{panelName:r,isEnabled:!!n&&e(Rt).isEditorPanelEnabled(r),isOpened:!!n&&e(Rt).isEditorPanelOpened(r)}})),(0,u.withDispatch)(((e,t)=>({onTogglePanel:()=>{e(Rt).toggleEditorPanelOpened(t.panelName)}}))))((function(e){let{isEnabled:t,taxonomy:n,isOpened:r,onTogglePanel:o,children:l}=e;if(!t)return null;const i=(0,Gt.get)(n,["labels","menu_name"]);return i?(0,a.createElement)(E.PanelBody,{title:i,opened:r,onToggle:o},l):null}));var Br=function(){return(0,a.createElement)(x.PostTaxonomiesCheck,null,(0,a.createElement)(x.PostTaxonomies,{taxonomyWrapper:(e,t)=>(0,a.createElement)(xr,{taxonomy:t},e)}))};const Mr="featured-image";const Nr=(0,u.withSelect)((e=>{const{getEditedPostAttribute:t}=e(x.store),{getPostType:n}=e(Be.store),{isEditorPanelEnabled:r,isEditorPanelOpened:o}=e(Rt);return{postType:n(t("type")),isEnabled:r(Mr),isOpened:o(Mr)}})),Ir=(0,u.withDispatch)((e=>{const{toggleEditorPanelOpened:t}=e(Rt);return{onTogglePanel:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t(Mr,...n)}}}));var Dr=(0,v.compose)(Nr,Ir)((function(e){let{isEnabled:t,isOpened:n,postType:r,onTogglePanel:o}=e;return t?(0,a.createElement)(x.PostFeaturedImageCheck,null,(0,a.createElement)(E.PanelBody,{title:(0,Gt.get)(r,["labels","featured_image"],(0,f.__)("Featured image")),opened:n,onToggle:o},(0,a.createElement)(x.PostFeaturedImage,null))):null}));const Ar="post-excerpt";var Lr=(0,v.compose)([(0,u.withSelect)((e=>({isEnabled:e(Rt).isEditorPanelEnabled(Ar),isOpened:e(Rt).isEditorPanelOpened(Ar)}))),(0,u.withDispatch)((e=>({onTogglePanel(){return e(Rt).toggleEditorPanelOpened(Ar)}})))])((function(e){let{isEnabled:t,isOpened:n,onTogglePanel:r}=e;return t?(0,a.createElement)(x.PostExcerptCheck,null,(0,a.createElement)(E.PanelBody,{title:(0,f.__)("Excerpt"),opened:n,onToggle:r},(0,a.createElement)(x.PostExcerpt,null))):null}));const Or="discussion-panel";var Vr=(0,v.compose)([(0,u.withSelect)((e=>({isEnabled:e(Rt).isEditorPanelEnabled(Or),isOpened:e(Rt).isEditorPanelOpened(Or)}))),(0,u.withDispatch)((e=>({onTogglePanel(){return e(Rt).toggleEditorPanelOpened(Or)}})))])((function(e){let{isEnabled:t,isOpened:n,onTogglePanel:r}=e;return t?(0,a.createElement)(x.PostTypeSupportCheck,{supportKeys:["comments","trackbacks"]},(0,a.createElement)(E.PanelBody,{title:(0,f.__)("Discussion"),opened:n,onToggle:r},(0,a.createElement)(x.PostTypeSupportCheck,{supportKeys:"comments"},(0,a.createElement)(E.PanelRow,null,(0,a.createElement)(x.PostComments,null))),(0,a.createElement)(x.PostTypeSupportCheck,{supportKeys:"trackbacks"},(0,a.createElement)(E.PanelRow,null,(0,a.createElement)(x.PostPingbacks,null))))):null}));const Fr="page-attributes";var Rr=function(){const{isEnabled:e,isOpened:t,postType:n}=(0,u.useSelect)((e=>{const{getEditedPostAttribute:t}=e(x.store),{isEditorPanelEnabled:n,isEditorPanelOpened:r}=e(Rt),{getPostType:o}=e(Be.store);return{isEnabled:n(Fr),isOpened:r(Fr),postType:o(t("type"))}}),[]),{toggleEditorPanelOpened:r}=(0,u.useDispatch)(Rt);return e&&n?(0,a.createElement)(x.PageAttributesCheck,null,(0,a.createElement)(E.PanelBody,{title:(0,Gt.get)(n,["labels","attributes"],(0,f.__)("Page attributes")),opened:t,onToggle:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(Fr,...t)}},(0,a.createElement)(x.PageAttributesParent,null),(0,a.createElement)(E.PanelRow,null,(0,a.createElement)(x.PageAttributesOrder,null)))):null};var Hr=function(e){let{location:t}=e;const n=(0,a.useRef)(null),r=(0,a.useRef)(null);(0,a.useEffect)((()=>(r.current=document.querySelector(".metabox-location-"+t),r.current&&n.current.appendChild(r.current),()=>{r.current&&document.querySelector("#metaboxes").appendChild(r.current)})),[t]);const o=(0,u.useSelect)((e=>e(Rt).isSavingMetaBoxes()),[]),l=V()("edit-post-meta-boxes-area",`is-${t}`,{"is-loading":o});return(0,a.createElement)("div",{className:l},o&&(0,a.createElement)(E.Spinner,null),(0,a.createElement)("div",{className:"edit-post-meta-boxes-area__container",ref:n}),(0,a.createElement)("div",{className:"edit-post-meta-boxes-area__clear"}))};class Gr extends a.Component{componentDidMount(){this.updateDOM()}componentDidUpdate(e){this.props.isVisible!==e.isVisible&&this.updateDOM()}updateDOM(){const{id:e,isVisible:t}=this.props,n=document.getElementById(e);n&&(t?n.classList.remove("is-hidden"):n.classList.add("is-hidden"))}render(){return null}}var Ur=(0,u.withSelect)(((e,t)=>{let{id:n}=t;return{isVisible:e(Rt).isEditorPanelEnabled(`meta-box-${n}`)}}))(Gr);function zr(e){let{location:t}=e;const n=(0,u.useRegistry)(),{metaBoxes:r,areMetaBoxesInitialized:o,isEditorReady:l}=(0,u.useSelect)((e=>{const{__unstableIsEditorReady:n}=e(x.store),{getMetaBoxesPerLocation:r,areMetaBoxesInitialized:o}=e(Rt);return{metaBoxes:r(t),areMetaBoxesInitialized:o(),isEditorReady:n()}}),[t]);return(0,a.useEffect)((()=>{l&&!o&&n.dispatch(Rt).initializeMetaBoxes()}),[l,o]),o?(0,a.createElement)(a.Fragment,null,(null!=r?r:[]).map((e=>{let{id:t}=e;return(0,a.createElement)(Ur,{key:t,id:t})})),(0,a.createElement)(Hr,{location:t})):null}window.wp.warning;const{Fill:Wr,Slot:$r}=(0,E.createSlotFill)("PluginDocumentSettingPanel"),qr=(0,v.compose)((0,P.withPluginContext)(((e,t)=>(void 0===t.name&&"undefined"!=typeof process&&process.env,{panelName:`${e.name}/${t.name}`}))),(0,u.withSelect)(((e,t)=>{let{panelName:n}=t;return{opened:e(Rt).isEditorPanelOpened(n),isEnabled:e(Rt).isEditorPanelEnabled(n)}})),(0,u.withDispatch)(((e,t)=>{let{panelName:n}=t;return{onToggle(){return e(Rt).toggleEditorPanelOpened(n)}}})))((e=>{let{isEnabled:t,panelName:n,opened:r,onToggle:o,className:l,title:i,icon:s,children:c}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(hn,{label:i,panelName:n}),(0,a.createElement)(Wr,null,t&&(0,a.createElement)(E.PanelBody,{className:l,title:i,icon:s,opened:r,onToggle:o},c)))}));qr.Slot=$r;var jr=qr;function Zr(e){let{className:t,...n}=e;const{postTitle:r,shortcut:o,showIconLabels:l}=(0,u.useSelect)((e=>({postTitle:e(x.store).getEditedPostAttribute("title"),shortcut:e(qt.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),showIconLabels:e(Rt).isFeatureActive("showIconLabels")})),[]);return(0,a.createElement)(ge,_({panelClassName:t,className:"edit-post-sidebar",smallScreenTitle:r||(0,f.__)("(no title)"),scope:"core/edit-post",toggleShortcut:o,showIconLabels:l},n))}var Kr=(0,a.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(S.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 Yr=function(){const e=(0,u.useSelect)((e=>{const{getEditedPostTemplate:t}=e(Rt);return t()}),[]);return e?(0,a.createElement)(E.PanelBody,null,(0,a.createElement)(E.Flex,{align:"flex-start",gap:"3"},(0,a.createElement)(E.FlexItem,null,(0,a.createElement)(ye,{icon:Kr})),(0,a.createElement)(E.FlexBlock,null,(0,a.createElement)("h2",{className:"edit-post-template-summary__title"},(null==e?void 0:e.title)||(null==e?void 0:e.slug)),(0,a.createElement)("p",null,null==e?void 0:e.description)))):null};const Xr=a.Platform.select({web:!0,native:!1});var Qr=()=>{const{sidebarName:e,keyboardShortcut:t,isTemplateMode:n}=(0,u.useSelect)((e=>{let t=e(te).getActiveComplementaryArea(Rt.name);["edit-post/document","edit-post/block"].includes(t)||(e(b.store).getBlockSelectionStart()&&(t="edit-post/block"),t="edit-post/document");return{sidebarName:t,keyboardShortcut:e(qt.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),isTemplateMode:e(Rt).isEditingTemplate()}}),[]);return(0,a.createElement)(Zr,{identifier:e,header:(0,a.createElement)(nr,{sidebarName:e}),closeLabel:(0,f.__)("Close settings"),headerClassName:"edit-post-sidebar__panel-tabs",title:(0,f.__)("Settings"),toggleShortcut:t,icon:(0,f.isRTL)()?er:tr,isActiveByDefault:Xr},!n&&"edit-post/document"===e&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Cr,null),(0,a.createElement)(jr.Slot,null),(0,a.createElement)(Tr,null),(0,a.createElement)(Br,null),(0,a.createElement)(Dr,null),(0,a.createElement)(Lr,null),(0,a.createElement)(Vr,null),(0,a.createElement)(Rr,null),(0,a.createElement)(zr,{location:"side"})),n&&"edit-post/document"===e&&(0,a.createElement)(Yr,null),"edit-post/block"===e&&(0,a.createElement)(b.BlockInspector,null))};function Jr(e){let{nonAnimatedSrc:t,animatedSrc:n}=e;return(0,a.createElement)("picture",{className:"edit-post-welcome-guide__image"},(0,a.createElement)("source",{srcSet:t,media:"(prefers-reduced-motion: reduce)"}),(0,a.createElement)("img",{src:n,width:"312",height:"240",alt:""}))}function eo(){const{toggleFeature:e}=(0,u.useDispatch)(Rt);return(0,a.createElement)(E.Guide,{className:"edit-post-welcome-guide",contentLabel:(0,f.__)("Welcome to the block editor"),finishButtonText:(0,f.__)("Get started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,a.createElement)(Jr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,f.__)("Welcome to the block editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,f.__)("In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.")))},{image:(0,a.createElement)(Jr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,f.__)("Make each block your own")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,f.__)("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,a.createElement)(Jr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,f.__)("Get to know the block library")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,a.createInterpolateElement)((0,f.__)("All of the blocks available to you live in the block library. Youll find it wherever you see the <InserterIconImage /> icon."),{InserterIconImage:(0,a.createElement)("img",{alt:(0,f.__)("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,a.createElement)(Jr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,f.__)("Learn how to use the block editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,f.__)("New to the block editor? Want to learn more about using it? "),(0,a.createElement)(E.ExternalLink,{href:(0,f.__)("https://wordpress.org/support/article/wordpress-editor/")},(0,f.__)("Here's a detailed guide."))))}]})}function to(){const{toggleFeature:e}=(0,u.useDispatch)(Rt);return(0,a.createElement)(E.Guide,{className:"edit-template-welcome-guide",contentLabel:(0,f.__)("Welcome to the template editor"),finishButtonText:(0,f.__)("Get started"),onFinish:()=>e("welcomeGuideTemplate"),pages:[{image:(0,a.createElement)(Jr,{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,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,f.__)("Welcome to the template editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,f.__)("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 no(){const{isActive:e,isTemplateMode:t}=(0,u.useSelect)((e=>{const{isFeatureActive:t,isEditingTemplate:n}=e(Rt),r=n();return{isActive:t(r?"welcomeGuideTemplate":"welcomeGuide"),isTemplateMode:r}}),[]);return e?t?(0,a.createElement)(to,null):(0,a.createElement)(eo,null):null}const{Fill:ro,Slot:oo}=(0,E.createSlotFill)("PluginPostPublishPanel"),lo=(0,v.compose)((0,P.withPluginContext)(((e,t)=>({icon:t.icon||e.icon}))))((e=>{let{children:t,className:n,title:r,initialOpen:o=!1,icon:l}=e;return(0,a.createElement)(ro,null,(0,a.createElement)(E.PanelBody,{className:n,initialOpen:o||!r,title:r,icon:l},t))}));lo.Slot=oo;var ao=lo;const{Fill:io,Slot:so}=(0,E.createSlotFill)("PluginPrePublishPanel"),co=(0,v.compose)((0,P.withPluginContext)(((e,t)=>({icon:t.icon||e.icon}))))((e=>{let{children:t,className:n,title:r,initialOpen:o=!1,icon:l}=e;return(0,a.createElement)(io,null,(0,a.createElement)(E.PanelBody,{className:n,initialOpen:o||!r,title:r,icon:l},t))}));co.Slot=so;var uo=co;const{Fill:mo,Slot:po}=(0,E.createSlotFill)("ActionsPanel");function go(e){let{setEntitiesSavedStatesCallback:t,closeEntitiesSavedStates:n,isEntitiesSavedStatesOpen:r}=e;const{closePublishSidebar:o,togglePublishSidebar:l}=(0,u.useDispatch)(Rt),{publishSidebarOpened:i,hasActiveMetaboxes:s,isSavingMetaBoxes:c,hasNonPostEntityChanges:d}=(0,u.useSelect)((e=>({publishSidebarOpened:e(Rt).isPublishSidebarOpened(),hasActiveMetaboxes:e(Rt).hasMetaBoxes(),isSavingMetaBoxes:e(Rt).isSavingMetaBoxes(),hasNonPostEntityChanges:e(x.store).hasNonPostEntityChanges()})),[]),m=(0,a.useCallback)((()=>t(!0)),[]);let p;return p=i?(0,a.createElement)(x.PostPublishPanel,{onClose:o,forceIsDirty:s,forceIsSaving:c,PrePublishExtension:uo.Slot,PostPublishExtension:ao.Slot}):d?(0,a.createElement)("div",{className:"edit-post-layout__toggle-entities-saved-states-panel"},(0,a.createElement)(E.Button,{variant:"secondary",className:"edit-post-layout__toggle-entities-saved-states-panel-button",onClick:m,"aria-expanded":!1},(0,f.__)("Open save panel"))):(0,a.createElement)("div",{className:"edit-post-layout__toggle-publish-panel"},(0,a.createElement)(E.Button,{variant:"secondary",className:"edit-post-layout__toggle-publish-panel-button",onClick:l,"aria-expanded":!1},(0,f.__)("Open publish panel"))),(0,a.createElement)(a.Fragment,null,r&&(0,a.createElement)(x.EntitiesSavedStates,{close:n}),(0,a.createElement)(po,{bubblesVirtually:!0}),!r&&p)}function ho(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,u.useSelect)((e=>{const{getPatternsByBlockTypes:t}=e(b.store),{getCurrentPostType:n}=e(x.store);return{blockPatternsWithPostContentBlockType:t("core/post-content"),postType:n()}}),[]);return(0,a.useMemo)((()=>e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t)))),[t,e])}function _o(e){let{onChoosePattern:t}=e;const n=ho(),r=(0,v.useAsyncList)(n),{resetEditorBlocks:o}=(0,u.useDispatch)(x.store);return(0,a.createElement)(b.__experimentalBlockPatternsList,{blockPatterns:n,shownPatterns:r,onClickPattern:(e,n)=>{o(n),t()}})}const Eo="INITIAL",bo="PATTERN",fo="CLOSED";function vo(){const[e,t]=(0,a.useState)(Eo),n=ho().length>0,r=(0,u.useSelect)((t=>{if(!n||e!==Eo)return!1;const{getEditedPostContent:r,isEditedPostSaveable:o}=t(x.store),{isEditingTemplate:l,isFeatureActive:a}=t(Rt);return!o()&&""===r()&&!l()&&!a("welcomeGuide")}),[e,n]);return(0,a.useEffect)((()=>{r&&t(bo)}),[r]),e===Eo||e===fo?null:(0,a.createElement)(E.Modal,{className:"edit-post-start-page-options__modal",title:(0,f.__)("Choose a pattern"),onRequestClose:()=>{t(fo)}},(0,a.createElement)("div",{className:"edit-post-start-page-options__modal-content"},e===bo&&(0,a.createElement)(_o,{onChoosePattern:()=>{t(fo)}})))}const yo={header:(0,f.__)("Editor top bar"),body:(0,f.__)("Editor content"),sidebar:(0,f.__)("Editor settings"),actions:(0,f.__)("Editor publish"),footer:(0,f.__)("Editor footer")};var wo=function(e){let{styles:t}=e;const n=(0,v.useViewportMatch)("medium","<"),r=(0,v.useViewportMatch)("huge",">="),o=(0,v.useViewportMatch)("large"),{openGeneralSidebar:l,closeGeneralSidebar:i,setIsInserterOpened:s}=(0,u.useDispatch)(Rt),{createErrorNotice:c}=(0,u.useDispatch)(T.store),{mode:d,isFullscreenActive:m,isRichEditingEnabled:p,sidebarIsOpened:g,hasActiveMetaboxes:h,hasFixedToolbar:_,previousShortcut:y,nextShortcut:w,hasBlockSelected:S,isInserterOpened:k,isListViewOpened:C,showIconLabels:B,isDistractionFree:M,showBlockBreadcrumbs:N,isTemplateMode:I,documentLabel:D}=(0,u.useSelect)((e=>{const{getEditorSettings:t,getPostTypeLabel:n}=e(x.store),r=t(),o=n();return{isTemplateMode:e(Rt).isEditingTemplate(),hasFixedToolbar:e(Rt).isFeatureActive("fixedToolbar"),sidebarIsOpened:!(!e(te).getActiveComplementaryArea(Rt.name)&&!e(Rt).isPublishSidebarOpened()),isFullscreenActive:e(Rt).isFeatureActive("fullscreenMode"),isInserterOpened:e(Rt).isInserterOpened(),isListViewOpened:e(Rt).isListViewOpened(),mode:e(Rt).getEditorMode(),isRichEditingEnabled:r.richEditingEnabled,hasActiveMetaboxes:e(Rt).hasMetaBoxes(),previousShortcut:e(qt.store).getAllShortcutKeyCombinations("core/edit-post/previous-region"),nextShortcut:e(qt.store).getAllShortcutKeyCombinations("core/edit-post/next-region"),showIconLabels:e(Rt).isFeatureActive("showIconLabels"),isDistractionFree:e(Rt).isFeatureActive("distractionFree"),showBlockBreadcrumbs:e(Rt).isFeatureActive("showBlockBreadcrumbs"),documentLabel:o||(0,f._x)("Document","noun")}}),[]);(0,a.useEffect)((()=>{g&&!r&&s(!1)}),[g,r]),(0,a.useEffect)((()=>{k&&!r&&i()}),[k,r]);const[A,L]=(0,a.useState)(!1),O=(0,a.useCallback)((e=>{"function"==typeof A&&A(e),L(!1)}),[A]),F=V()("edit-post-layout","is-mode-"+d,{"is-sidebar-opened":g,"has-fixed-toolbar":_,"has-metaboxes":h,"show-icon-labels":B,"is-distraction-free":M&&o,"is-entity-save-view-open":!!A}),R=C?(0,f.__)("Document Overview"):(0,f.__)("Block Library");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(he,{isActive:m}),(0,a.createElement)(kn,null),(0,a.createElement)(x.UnsavedChangesWarning,null),(0,a.createElement)(x.AutosaveMonitor,null),(0,a.createElement)(x.LocalAutosaveMonitor,null),(0,a.createElement)(Qt,null),(0,a.createElement)(x.EditorKeyboardShortcutsRegister,null),(0,a.createElement)(Qr,null),(0,a.createElement)(Ee,{isDistractionFree:M&&o,className:F,labels:{...yo,secondarySidebar:R},header:(0,a.createElement)(Zn,{setEntitiesSavedStatesCallback:L}),editorNotices:(0,a.createElement)(x.EditorNotices,null),secondarySidebar:"visual"===d&&k?(0,a.createElement)(Yn,null):"visual"===d&&C?(0,a.createElement)(Jn,null):null,sidebar:(!n||g)&&(0,a.createElement)(a.Fragment,null,!n&&!g&&(0,a.createElement)("div",{className:"edit-post-layout__toggle-sidebar-panel"},(0,a.createElement)(E.Button,{variant:"secondary",className:"edit-post-layout__toggle-sidebar-panel-button",onClick:()=>l(S?"edit-post/block":"edit-post/document"),"aria-expanded":!1},S?(0,f.__)("Open block settings"):(0,f.__)("Open document settings"))),(0,a.createElement)(ge.Slot,{scope:"core/edit-post"})),notices:(0,a.createElement)(x.EditorSnackbars,null),content:(0,a.createElement)(a.Fragment,null,!M&&(0,a.createElement)(x.EditorNotices,null),("text"===d||!p)&&(0,a.createElement)(jt,null),p&&"visual"===d&&(0,a.createElement)(Xt,{styles:t}),!M&&!I&&(0,a.createElement)("div",{className:"edit-post-layout__metaboxes"},(0,a.createElement)(zr,{location:"normal"}),(0,a.createElement)(zr,{location:"advanced"})),n&&g&&(0,a.createElement)(E.ScrollLock,null)),footer:!M&&!n&&N&&p&&"visual"===d&&(0,a.createElement)("div",{className:"edit-post-layout__footer"},(0,a.createElement)(b.BlockBreadcrumb,{rootLabelText:D})),actions:(0,a.createElement)(go,{closeEntitiesSavedStates:O,isEntitiesSavedStatesOpen:A,setEntitiesSavedStatesCallback:L}),shortcuts:{previous:y,next:w}}),(0,a.createElement)(wn,null),(0,a.createElement)(sn,null),(0,a.createElement)(no,null),(0,a.createElement)(vo,null),(0,a.createElement)(E.Popover.Slot,null),(0,a.createElement)(P.PluginArea,{onError:function(e){c((0,f.sprintf)((0,f.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}))};function So(e){let{postId:t}=e;return(e=>{const{hasBlockSelection:t,isEditorSidebarOpened:n}=(0,u.useSelect)((e=>({hasBlockSelection:!!e(b.store).getBlockSelectionStart(),isEditorSidebarOpened:e(Ft).isEditorSidebarOpened()})),[e]),{openGeneralSidebar:r}=(0,u.useDispatch)(Ft);(0,a.useEffect)((()=>{n&&r(t?"edit-post/block":"edit-post/document")}),[t,n])})(t),(e=>{const{newPermalink:t}=(0,u.useSelect)((e=>({newPermalink:e(x.store).getCurrentPost().link})),[e]),n=(0,a.useRef)();(0,a.useEffect)((()=>{n.current=document.querySelector("#wp-admin-bar-preview a")||document.querySelector("#wp-admin-bar-view a")}),[e]),(0,a.useEffect)((()=>{t&&n.current&&n.current.setAttribute("href",t)}),[t])})(t),null}var ko=window.wp.privateApis;const{lock:Po,unlock:Co}=(0,ko.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/edit-post"),{ExperimentalEditorProvider:To}=Co(x.privateApis);var xo=function(e){let{postId:t,postType:n,settings:r,initialEdits:o,...l}=e;const{hasFixedToolbar:s,focusMode:c,isDistractionFree:d,hasInlineToolbar:m,hasThemeStyles:g,post:h,preferredStyleVariations:b,hiddenBlockTypes:f,blockTypes:v,keepCaretInsideBlock:y,isTemplateMode:w,template:S}=(0,u.useSelect)((e=>{var r,o;const{isFeatureActive:l,__experimentalGetPreviewDeviceType:a,isEditingTemplate:s,getEditedPostTemplate:c,getHiddenBlockTypes:d}=e(Rt),{getEntityRecord:u,getPostType:m,getEntityRecords:g,canUser:h}=e(Be.store),{getEditorSettings:_}=e(x.store),{getBlockTypes:E}=e(i.store);let b;if(["wp_template","wp_template_part"].includes(n)){const e=g("postType",n,{wp_id:t});b=null==e?void 0:e[0]}else b=u("postType",n,t);const f=_().supportsTemplateMode,v=null!==(r=null===(o=m(n))||void 0===o?void 0:o.viewable)&&void 0!==r&&r,y=h("create","templates");return{hasFixedToolbar:l("fixedToolbar")||"Desktop"!==a(),focusMode:l("focusMode"),isDistractionFree:l("distractionFree"),hasInlineToolbar:l("inlineToolbar"),hasThemeStyles:l("themeStyles"),preferredStyleVariations:e(p.store).get("core/edit-post","preferredStyleVariations"),hiddenBlockTypes:d(),blockTypes:E(),keepCaretInsideBlock:l("keepCaretInsideBlock"),isTemplateMode:s(),template:f&&v&&y?c():null,post:b}}),[n,t]),{updatePreferredStyleVariations:k,setIsInserterOpened:P}=(0,u.useDispatch)(Rt),C=(0,a.useMemo)((()=>{const e={...r,__experimentalPreferredStyleVariations:{value:b,onChange:k},hasFixedToolbar:s,focusMode:c,isDistractionFree:d,hasInlineToolbar:m,__experimentalSetIsInserterOpened:P,keepCaretInsideBlock:y,defaultAllowedBlockTypes:r.allowedBlockTypes};if(f.length>0){const t=!0===r.allowedBlockTypes?v.map((e=>{let{name:t}=e;return t})):r.allowedBlockTypes||[];e.allowedBlockTypes=t.filter((e=>!f.includes(e)))}return e}),[r,s,c,d,f,v,b,P,k,y]),T=(0,a.useMemo)((()=>{var e;const t=[],n=[];null===(e=r.styles)||void 0===e||e.forEach((e=>{e.__unstableType&&"theme"!==e.__unstableType?n.push(e):t.push(e)}));const o=[...r.defaultEditorStyles,...n];return g&&t.length?r.styles:o}),[r,g]);return h?(0,a.createElement)(qt.ShortcutProvider,null,(0,a.createElement)(E.SlotFillProvider,null,(0,a.createElement)(To,_({settings:C,post:h,initialEdits:o,useSubRegistry:!1,__unstableTemplate:w?S:void 0},l),(0,a.createElement)(x.ErrorBoundary,null,(0,a.createElement)(So,{postId:t}),(0,a.createElement)(wo,{styles:T})),(0,a.createElement)(x.PostLockedModal,null)))):null};var Bo=e=>{let{allowedBlocks:t,icon:n,label:r,onClick:o,small:l,role:i}=e;return(0,a.createElement)(b.BlockSettingsMenuControls,null,(e=>{let{selectedBlocks:s,onClose:c}=e;return((e,t)=>{return!Array.isArray(t)||(n=t,0===e.filter((e=>!n.includes(e))).length);var n})(s,t)?(0,a.createElement)(E.MenuItem,{onClick:(0,v.compose)(o,c),icon:n,label:l?r:void 0,role:i},!l&&r):null}))},Mo=(0,v.compose)((0,P.withPluginContext)(((e,t)=>{var n;return{as:null!==(n=t.as)&&void 0!==n?n:E.MenuItem,icon:t.icon||e.icon,name:"core/edit-post/plugin-more-menu"}})))(ie);function No(e){return(0,a.createElement)(ce,_({__unstableExplicitMenuItem:!0,scope:"core/edit-post"},e))}function Io(e,t,n,r,o){const l=document.getElementById(e),c=(0,a.createRoot)(l);(0,u.dispatch)(p.store).setDefaults("core/edit-post",{editorMode:"visual",fixedToolbar:!1,fullscreenMode:!0,hiddenBlockTypes:[],inactivePanels:[],isPublishSidebarEnabled:!0,openPanels:["post-status"],preferredStyleVariations:{},showBlockBreadcrumbs:!0,showIconLabels:!1,showListViewByDefault:!1,themeStyles:!0,welcomeGuide:!0,welcomeGuideTemplate:!0}),(0,u.dispatch)(i.store).__experimentalReapplyBlockTypeFilters(),(0,u.select)(Rt).isFeatureActive("showListViewByDefault")&&(0,u.dispatch)(Rt).setIsListViewOpened(!0),(0,s.registerCoreBlocks)(),(0,g.registerLegacyWidgetBlock)({inserter:!1}),(0,g.registerWidgetGroupBlock)({inserter:!1}),(0,m.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((e,t)=>!(!(0,u.select)(Rt).isEditingTemplate()&&"core/template-part"===t.name)&&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,a.createElement)(xo,{settings:r,postId:n,postType:t,initialEdits:o})),c}function Do(){d()("wp.editPost.reinitializeEditor",{since:"6.2",version:"6.3"})}}(),(window.wp=window.wp||{}).editPost=r}();