Current File : /home/resuelf/www/wp-content/plugins/gutenberg/build/edit-post/index.min.js |
!function(){var e={4403:function(e,t){var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var s=r.apply(null,n);s&&e.push(s)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var i in n)o.call(n,i)&&n[i]&&e.push(i);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{PluginBlockSettingsMenuItem:function(){return yr},PluginDocumentSettingPanel:function(){return Ao},PluginMoreMenuItem:function(){return vr},PluginPostPublishPanel:function(){return jo},PluginPostStatusInfo:function(){return vo},PluginPrePublishPanel:function(){return Xo},PluginSidebar:function(){return Io},PluginSidebarMoreMenuItem:function(){return wr},__experimentalFullscreenModeClose:function(){return Vn},__experimentalMainDashboardButton:function(){return Kn},__experimentalPluginPostExcerpt:function(){return Sr},initializeEditor:function(){return kr},reinitializeEditor:function(){return Pr},store:function(){return pn}});var e={};n.r(e),n.d(e,{closeModal:function(){return Q},disableComplementaryArea:function(){return z},enableComplementaryArea:function(){return G},openModal:function(){return j},pinItem:function(){return H},setDefaultComplementaryArea:function(){return V},setFeatureDefaults:function(){return q},setFeatureValue:function(){return W},toggleFeature:function(){return $},unpinItem:function(){return U}});var t={};n.r(t),n.d(t,{getActiveComplementaryArea:function(){return Y},isComplementaryAreaLoading:function(){return K},isFeatureActive:function(){return Z},isItemPinned:function(){return X},isModalActive:function(){return J}});var r={};n.r(r),n.d(r,{__experimentalSetPreviewDeviceType:function(){return ft},__unstableCreateTemplate:function(){return kt},__unstableSwitchToTemplateMode:function(){return St},closeGeneralSidebar:function(){return et},closeModal:function(){return nt},closePublishSidebar:function(){return rt},hideBlockTypes:function(){return ht},initializeMetaBoxes:function(){return Bt},metaBoxUpdatesFailure:function(){return Et},metaBoxUpdatesSuccess:function(){return _t},openGeneralSidebar:function(){return Je},openModal:function(){return tt},openPublishSidebar:function(){return ot},removeEditorPanel:function(){return lt},requestMetaBoxUpdates:function(){return bt},setAvailableMetaBoxesPerLocation:function(){return gt},setIsEditingTemplate:function(){return wt},setIsInserterOpened:function(){return yt},setIsListViewOpened:function(){return vt},showBlockTypes:function(){return pt},switchEditorMode:function(){return dt},toggleDistractionFree:function(){return Ct},toggleEditorPanelEnabled:function(){return st},toggleEditorPanelOpened:function(){return it},toggleFeature:function(){return ct},togglePinnedPluginItem:function(){return ut},togglePublishSidebar:function(){return at},updatePreferredStyleVariations:function(){return mt}});var a={};n.r(a),n.d(a,{__experimentalGetInsertionPoint:function(){return sn},__experimentalGetPreviewDeviceType:function(){return rn},areMetaBoxesInitialized:function(){return dn},getActiveGeneralSidebarName:function(){return Gt},getActiveMetaBoxLocations:function(){return Xt},getAllMetaBoxes:function(){return tn},getEditedPostTemplate:function(){return un},getEditorMode:function(){return Rt},getHiddenBlockTypes:function(){return Ut},getMetaBoxesPerLocation:function(){return en},getPreference:function(){return Ht},getPreferences:function(){return zt},hasMetaBoxes:function(){return nn},isEditingTemplate:function(){return cn},isEditorPanelEnabled:function(){return qt},isEditorPanelOpened:function(){return jt},isEditorPanelRemoved:function(){return Wt},isEditorSidebarOpened:function(){return Ot},isFeatureActive:function(){return Yt},isInserterOpened:function(){return an},isListViewOpened:function(){return ln},isMetaBoxLocationActive:function(){return Jt},isMetaBoxLocationVisible:function(){return Zt},isModalActive:function(){return Qt},isPluginItemPinned:function(){return Kt},isPluginSidebarOpened:function(){return Vt},isPublishSidebarOpened:function(){return $t},isSavingMetaBoxes:function(){return on}});var s=window.React,i=window.wp.blocks,l=window.wp.blockLibrary,c=window.wp.deprecated,d=n.n(c),u=window.wp.element,m=window.wp.data,p=window.wp.hooks,h=window.wp.preferences,g=window.wp.widgets,b=window.wp.editor,_=window.wp.mediaUtils;(0,p.addFilter)("editor.MediaUpload","core/edit-post/replace-media-upload",(()=>_.MediaUpload));var E=window.wp.components,f=window.wp.blockEditor,y=window.wp.i18n,v=window.wp.compose;const w=(0,v.compose)((0,m.withSelect)(((e,t)=>{if((0,i.hasBlockSupport)(t.name,"multiple",!0))return{};const n=e(f.store).getBlocks().find((({name:e})=>t.name===e));return{originalBlockClientId:n&&n.clientId!==t.clientId&&n.clientId}})),(0,m.withDispatch)(((e,{originalBlockClientId:t})=>({selectFirst:()=>e(f.store).selectBlock(t)})))),S=(0,v.createHigherOrderComponent)((e=>w((({originalBlockClientId:t,selectFirst:n,...o})=>{if(!t)return(0,s.createElement)(e,{...o});const r=(0,i.getBlockType)(o.name),a=function(e){const t=(0,i.findTransform)((0,i.getBlockTransforms)("to",e),(({type:e,blocks:t})=>"block"===e&&1===t.length));return t?(0,i.getBlockType)(t.blocks[0]):null}(o.name);return[(0,s.createElement)("div",{key:"invalid-preview",style:{minHeight:"60px"}},(0,s.createElement)(e,{key:"block-edit",...o})),(0,s.createElement)(f.Warning,{key:"multiple-use-warning",actions:[(0,s.createElement)(E.Button,{key:"find-original",variant:"secondary",onClick:n},(0,y.__)("Find original")),(0,s.createElement)(E.Button,{key:"remove",variant:"secondary",onClick:()=>o.onReplace([])},(0,y.__)("Remove")),a&&(0,s.createElement)(E.Button,{key:"transform",variant:"secondary",onClick:()=>o.onReplace((0,i.createBlock)(a.name,o.attributes))},(0,y.__)("Transform into:")," ",a.title)]},(0,s.createElement)("strong",null,r?.title,": "),(0,y.__)("This block can only be used once."))]}))),"withMultipleValidation");(0,p.addFilter)("editor.BlockEdit","core/edit-post/validate-multiple-use/with-multiple-validation",S);var k=window.wp.coreData,P=window.wp.primitives,B=(0,s.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(P.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})),C=window.wp.plugins,M=window.wp.url,T=window.wp.notices;function x(){const{createNotice:e}=(0,m.useDispatch)(T.store),{getEditedPostAttribute:t}=(0,m.useSelect)(b.store),n=(0,v.useCopyToClipboard)((function(){return t("content")}),(function(){e("info",(0,y.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,s.createElement)(E.MenuItem,{ref:n},(0,y.__)("Copy all blocks"))}var A=window.wp.keycodes,I=n(4403),N=n.n(I),L=(0,s.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(P.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),D=(0,s.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(P.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"})),F=(0,s.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(P.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})),R=window.wp.viewport,O=(0,s.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(P.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));const V=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),G=(e,t)=>({registry:n,dispatch:o})=>{t&&(n.select(h.store).get(e,"isComplementaryAreaVisible")||n.dispatch(h.store).set(e,"isComplementaryAreaVisible",!0),o({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t}))},z=e=>({registry:t})=>{t.select(h.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(h.store).set(e,"isComplementaryAreaVisible",!1)},H=(e,t)=>({registry:n})=>{if(!t)return;const o=n.select(h.store).get(e,"pinnedItems");!0!==o?.[t]&&n.dispatch(h.store).set(e,"pinnedItems",{...o,[t]:!0})},U=(e,t)=>({registry:n})=>{if(!t)return;const o=n.select(h.store).get(e,"pinnedItems");n.dispatch(h.store).set(e,"pinnedItems",{...o,[t]:!1})};function $(e,t){return function({registry:n}){d()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),n.dispatch(h.store).toggle(e,t)}}function W(e,t,n){return function({registry:o}){d()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),o.dispatch(h.store).set(e,t,!!n)}}function q(e,t){return function({registry:n}){d()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),n.dispatch(h.store).setDefaults(e,t)}}function j(e){return{type:"OPEN_MODAL",name:e}}function Q(){return{type:"CLOSE_MODAL"}}const Y=(0,m.createRegistrySelector)((e=>(t,n)=>{const o=e(h.store).get(n,"isComplementaryAreaVisible");if(void 0!==o)return!1===o?null:t?.complementaryAreas?.[n]})),K=(0,m.createRegistrySelector)((e=>(t,n)=>{const o=e(h.store).get(n,"isComplementaryAreaVisible"),r=t?.complementaryAreas?.[n];return o&&void 0===r})),X=(0,m.createRegistrySelector)((e=>(t,n,o)=>{var r;const a=e(h.store).get(n,"pinnedItems");return null===(r=a?.[o])||void 0===r||r})),Z=(0,m.createRegistrySelector)((e=>(t,n,o)=>(d()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(h.store).get(n,o))));function J(e,t){return e.activeModal===t}var ee=(0,m.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:n,area:o}=t;return e[n]?e:{...e,[n]:o}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:o}=t;return{...e,[n]:o}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}});const te=(0,m.createReduxStore)("core/interface",{reducer:ee,actions:e,selectors:t});(0,m.register)(te);var ne=(0,C.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`}))),oe=ne((function({as:e=E.Button,scope:t,identifier:n,icon:o,selectedIcon:r,name:a,...i}){const l=e,c=(0,m.useSelect)((e=>e(te).getActiveComplementaryArea(t)===n),[n,t]),{enableComplementaryArea:d,disableComplementaryArea:u}=(0,m.useDispatch)(te);return(0,s.createElement)(l,{icon:r&&c?r:o,"aria-controls":n.replace("/",":"),onClick:()=>{c?u(t):d(t,n)},...i})})),re=({smallScreenTitle:e,children:t,className:n,toggleButtonProps:o})=>{const r=(0,s.createElement)(oe,{icon:O,...o});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},e&&(0,s.createElement)("span",{className:"interface-complementary-area-header__small-title"},e),r),(0,s.createElement)("div",{className:N()("components-panel__header","interface-complementary-area-header",n),tabIndex:-1},t,r))};const ae=()=>{};function se({name:e,as:t=E.Button,onClick:n,...o}){return(0,s.createElement)(E.Fill,{name:e},(({onClick:e})=>(0,s.createElement)(t,{onClick:n||e?(...t)=>{(n||ae)(...t),(e||ae)(...t)}:void 0,...o})))}se.Slot=function({name:e,as:t=E.ButtonGroup,fillProps:n={},bubblesVirtually:o,...r}){return(0,s.createElement)(E.Slot,{name:e,bubblesVirtually:o,fillProps:n},(e=>{if(!u.Children.toArray(e).length)return null;const n=[];u.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&n.push(t)}));const o=u.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&n.includes(e.props.__unstableTarget)?null:e));return(0,s.createElement)(t,{...r},o)}))};var ie=se;const le=({__unstableExplicitMenuItem:e,__unstableTarget:t,...n})=>(0,s.createElement)(E.MenuItem,{...n});function ce({scope:e,target:t,__unstableExplicitMenuItem:n,...o}){return(0,s.createElement)(oe,{as:o=>(0,s.createElement)(ie,{__unstableExplicitMenuItem:n,__unstableTarget:`${e}/${t}`,as:le,name:`${e}/plugin-more-menu`,...o}),role:"menuitemcheckbox",selectedIcon:L,name:t,scope:e,...o})}function de({scope:e,...t}){return(0,s.createElement)(E.Fill,{name:`PinnedItems/${e}`,...t})}de.Slot=function({scope:e,className:t,...n}){return(0,s.createElement)(E.Slot,{name:`PinnedItems/${e}`,...n},(e=>e?.length>0&&(0,s.createElement)("div",{className:N()(t,"interface-pinned-items")},e)))};var ue=de;function me({scope:e,children:t,className:n,id:o}){return(0,s.createElement)(E.Fill,{name:`ComplementaryArea/${e}`},(0,s.createElement)("div",{id:o,className:n},t))}const pe=ne((function({children:e,className:t,closeLabel:n=(0,y.__)("Close plugin"),identifier:o,header:r,headerClassName:a,icon:i,isPinnable:l=!0,panelClassName:c,scope:d,name:p,smallScreenTitle:g,title:b,toggleShortcut:_,isActiveByDefault:f}){const{isLoading:v,isActive:w,isPinned:S,activeArea:k,isSmall:P,isLarge:B,showIconLabels:C}=(0,m.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:n,isItemPinned:r}=e(te),{get:a}=e(h.store),s=t(d);return{isLoading:n(d),isActive:s===o,isPinned:r(d,o),activeArea:s,isSmall:e(R.store).isViewportMatch("< medium"),isLarge:e(R.store).isViewportMatch("large"),showIconLabels:a("core","showIconLabels")}}),[o,d]);!function(e,t,n,o,r){const a=(0,u.useRef)(!1),s=(0,u.useRef)(!1),{enableComplementaryArea:i,disableComplementaryArea:l}=(0,m.useDispatch)(te);(0,u.useEffect)((()=>{o&&r&&!a.current?(l(e),s.current=!0):s.current&&!r&&a.current?(s.current=!1,i(e,t)):s.current&&n&&n!==t&&(s.current=!1),r!==a.current&&(a.current=r)}),[o,r,e,t,n,l,i])}(d,o,k,w,P);const{enableComplementaryArea:M,disableComplementaryArea:T,pinItem:x,unpinItem:A}=(0,m.useDispatch)(te);return(0,u.useEffect)((()=>{f&&void 0===k&&!P?M(d,o):void 0===k&&P&&T(d,o)}),[k,f,d,o,P,M,T]),(0,s.createElement)(s.Fragment,null,l&&(0,s.createElement)(ue,{scope:d},S&&(0,s.createElement)(oe,{scope:d,identifier:o,isPressed:w&&(!C||B),"aria-expanded":w,"aria-disabled":v,label:b,icon:C?L:i,showTooltip:!C,variant:C?"tertiary":void 0,size:"compact"})),p&&l&&(0,s.createElement)(ce,{target:p,scope:d,icon:i},b),w&&(0,s.createElement)(me,{className:N()("interface-complementary-area",t),scope:d,id:o.replace("/",":")},(0,s.createElement)(re,{className:a,closeLabel:n,onClose:()=>T(d),smallScreenTitle:g,toggleButtonProps:{label:n,shortcut:_,scope:d,identifier:o}},r||(0,s.createElement)(s.Fragment,null,(0,s.createElement)("strong",null,b),l&&(0,s.createElement)(E.Button,{className:"interface-complementary-area__pin-unpin-item",icon:S?D:F,label:S?(0,y.__)("Unpin from toolbar"):(0,y.__)("Pin to toolbar"),onClick:()=>(S?A:x)(d,o),isPressed:S,"aria-expanded":S}))),(0,s.createElement)(E.Panel,{className:c},e)))}));pe.Slot=function({scope:e,...t}){return(0,s.createElement)(E.Slot,{name:`ComplementaryArea/${e}`,...t})};var he=pe,ge=({isActive:e})=>((0,u.useEffect)((()=>{let e=!1;return document.body.classList.contains("sticky-menu")&&(e=!0,document.body.classList.remove("sticky-menu")),()=>{e&&document.body.classList.add("sticky-menu")}}),[]),(0,u.useEffect)((()=>(e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{e&&document.body.classList.remove("is-fullscreen-mode")})),[e]),null);function be({children:e,className:t,ariaLabel:n,as:o="div",...r}){return(0,s.createElement)(o,{className:N()("interface-navigable-region",t),"aria-label":n,role:"region",tabIndex:"-1",...r},e)}const _e={hidden:{opacity:0},hover:{opacity:1,transition:{type:"tween",delay:.2,delayChildren:.2}},distractionFreeInactive:{opacity:1,transition:{delay:0}}};var Ee=(0,u.forwardRef)((function({isDistractionFree:e,footer:t,header:n,editorNotices:o,sidebar:r,secondarySidebar:a,notices:i,content:l,actions:c,labels:d,className:m,enableRegionNavigation:p=!0,shortcuts:h},g){const b=(0,E.__unstableUseNavigateRegions)(h);!function(e){(0,u.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const _={
/* translators: accessibility text for the top bar landmark region. */
header:(0,y.__)("Header"),
/* translators: accessibility text for the content landmark region. */
body:(0,y.__)("Content"),
/* translators: accessibility text for the secondary sidebar landmark region. */
secondarySidebar:(0,y.__)("Block Library"),
/* translators: accessibility text for the settings landmark region. */
sidebar:(0,y.__)("Settings"),
/* translators: accessibility text for the publish landmark region. */
actions:(0,y.__)("Publish"),
/* translators: accessibility text for the footer landmark region. */
footer:(0,y.__)("Footer"),...d};return(0,s.createElement)("div",{...p?b:{},ref:(0,v.useMergeRefs)([g,p?b.ref:void 0]),className:N()(m,"interface-interface-skeleton",b.className,!!t&&"has-footer")},(0,s.createElement)("div",{className:"interface-interface-skeleton__editor"},!!n&&(0,s.createElement)(be,{as:E.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":_.header,initial:e?"hidden":"distractionFreeInactive",whileHover:e?"hover":"distractionFreeInactive",animate:e?"hidden":"distractionFreeInactive",variants:_e,transition:e?{type:"tween",delay:.8}:void 0},n),e&&(0,s.createElement)("div",{className:"interface-interface-skeleton__header"},o),(0,s.createElement)("div",{className:"interface-interface-skeleton__body"},!!a&&(0,s.createElement)(be,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:_.secondarySidebar},a),!!i&&(0,s.createElement)("div",{className:"interface-interface-skeleton__notices"},i),(0,s.createElement)(be,{className:"interface-interface-skeleton__content",ariaLabel:_.body},l),!!r&&(0,s.createElement)(be,{className:"interface-interface-skeleton__sidebar",ariaLabel:_.sidebar},r),!!c&&(0,s.createElement)(be,{className:"interface-interface-skeleton__actions",ariaLabel:_.actions},c))),!!t&&(0,s.createElement)(be,{className:"interface-interface-skeleton__footer",ariaLabel:_.footer},t))})),fe=(0,s.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(P.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function ye({as:e=E.DropdownMenu,className:t,label:
/* translators: button label text should, if possible, be under 16 characters. */
n=(0,y.__)("Options"),popoverProps:o,toggleProps:r,children:a}){return(0,s.createElement)(e,{className:N()("interface-more-menu-dropdown",t),icon:fe,label:n,popoverProps:{placement:"bottom-end",...o,className:N()("interface-more-menu-dropdown__content",o?.className)},toggleProps:{tooltipPosition:"bottom",...r,size:"compact"}},(e=>a(e)))}function ve({closeModal:e,children:t}){return(0,s.createElement)(E.Modal,{className:"interface-preferences-modal",title:(0,y.__)("Preferences"),onRequestClose:e},t)}var we=(0,u.forwardRef)((function({icon:e,size:t=24,...n},o){return(0,u.cloneElement)(e,{width:t,height:t,...n,ref:o})})),Se=(0,s.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(P.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),ke=(0,s.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(P.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));const Pe="preferences-menu";function Be({sections:e}){const t=(0,v.useViewportMatch)("medium"),[n,o]=(0,u.useState)(Pe),{tabs:r,sectionsContentMap:a}=(0,u.useMemo)((()=>{let t={tabs:[],sectionsContentMap:{}};return e.length&&(t=e.reduce(((e,{name:t,tabLabel:n,content:o})=>(e.tabs.push({name:t,title:n}),e.sectionsContentMap[t]=o,e)),{tabs:[],sectionsContentMap:{}})),t}),[e]),i=(0,u.useCallback)((e=>a[e.name]||null),[a]);let l;return l=t?(0,s.createElement)(E.TabPanel,{className:"interface-preferences__tabs",tabs:r,initialTabName:n!==Pe?n:void 0,onSelect:o,orientation:"vertical"},i):(0,s.createElement)(E.__experimentalNavigatorProvider,{initialPath:"/",className:"interface-preferences__provider"},(0,s.createElement)(E.__experimentalNavigatorScreen,{path:"/"},(0,s.createElement)(E.Card,{isBorderless:!0,size:"small"},(0,s.createElement)(E.CardBody,null,(0,s.createElement)(E.__experimentalItemGroup,null,r.map((e=>(0,s.createElement)(E.__experimentalNavigatorButton,{key:e.name,path:e.name,as:E.__experimentalItem,isAction:!0},(0,s.createElement)(E.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(E.FlexItem,null,(0,s.createElement)(E.__experimentalTruncate,null,e.title)),(0,s.createElement)(E.FlexItem,null,(0,s.createElement)(we,{icon:(0,y.isRTL)()?Se:ke})))))))))),e.length&&e.map((e=>(0,s.createElement)(E.__experimentalNavigatorScreen,{key:`${e.name}-menu`,path:e.name},(0,s.createElement)(E.Card,{isBorderless:!0,size:"large"},(0,s.createElement)(E.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6"},(0,s.createElement)(E.__experimentalNavigatorBackButton,{icon:(0,y.isRTL)()?ke:Se,"aria-label":(0,y.__)("Navigate to the previous view")}),(0,s.createElement)(E.__experimentalText,{size:"16"},e.tabLabel)),(0,s.createElement)(E.CardBody,null,e.content)))))),l}var Ce=({description:e,title:t,children:n})=>(0,s.createElement)("fieldset",{className:"interface-preferences-modal__section"},(0,s.createElement)("legend",{className:"interface-preferences-modal__section-legend"},(0,s.createElement)("h2",{className:"interface-preferences-modal__section-title"},t),e&&(0,s.createElement)("p",{className:"interface-preferences-modal__section-description"},e)),(0,s.createElement)("div",{className:"interface-preferences-modal__section-content"},n)),Me=function({help:e,label:t,isChecked:n,onChange:o,children:r}){return(0,s.createElement)("div",{className:"interface-preferences-modal__option"},(0,s.createElement)(E.ToggleControl,{__nextHasNoMarginBottom:!0,help:e,label:t,checked:n,onChange:o}),r)},Te=window.wp.keyboardShortcuts;const xe=[{keyCombination:{modifier:"primary",character:"b"},description:(0,y.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,y.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,y.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,y.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,y.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,y.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,y.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,y.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},description:(0,y.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,y.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")}];function Ae({keyCombination:e,forceAriaLabel:t}){const n=e.modifier?A.displayShortcutList[e.modifier](e.character):e.character,o=e.modifier?A.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,s.createElement)("kbd",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||o},(Array.isArray(n)?n:[n]).map(((e,t)=>"+"===e?(0,s.createElement)(u.Fragment,{key:t},e):(0,s.createElement)("kbd",{key:t,className:"edit-post-keyboard-shortcut-help-modal__shortcut-key"},e))))}var Ie=function({description:e,keyCombination:t,aliases:n=[],ariaLabel:o}){return(0,s.createElement)(u.Fragment,null,(0,s.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-description"},e),(0,s.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-term"},(0,s.createElement)(Ae,{keyCombination:t,forceAriaLabel:o}),n.map(((e,t)=>(0,s.createElement)(Ae,{keyCombination:e,forceAriaLabel:o,key:t})))))},Ne=function({name:e}){const{keyCombination:t,description:n,aliases:o}=(0,m.useSelect)((t=>{const{getShortcutKeyCombination:n,getShortcutDescription:o,getShortcutAliases:r}=t(Te.store);return{keyCombination:n(e),aliases:r(e),description:o(e)}}),[e]);return t?(0,s.createElement)(Ie,{keyCombination:t,description:n,aliases:o}):null};const Le="edit-post/keyboard-shortcut-help",De=({shortcuts:e})=>(0,s.createElement)("ul",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-list",role:"list"},e.map(((e,t)=>(0,s.createElement)("li",{className:"edit-post-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,s.createElement)(Ne,{name:e}):(0,s.createElement)(Ie,{...e}))))),Fe=({title:e,shortcuts:t,className:n})=>(0,s.createElement)("section",{className:N()("edit-post-keyboard-shortcut-help-modal__section",n)},!!e&&(0,s.createElement)("h2",{className:"edit-post-keyboard-shortcut-help-modal__section-title"},e),(0,s.createElement)(De,{shortcuts:t})),Re=({title:e,categoryName:t,additionalShortcuts:n=[]})=>{const o=(0,m.useSelect)((e=>e(Te.store).getCategoryShortcuts(t)),[t]);return(0,s.createElement)(Fe,{title:e,shortcuts:o.concat(n)})};var Oe=(0,v.compose)([(0,m.withSelect)((e=>({isModalActive:e(te).isModalActive(Le)}))),(0,m.withDispatch)(((e,{isModalActive:t})=>{const{openModal:n,closeModal:o}=e(te);return{toggleModal:()=>t?o():n(Le)}}))])((function({isModalActive:e,toggleModal:t}){return(0,Te.useShortcut)("core/edit-post/keyboard-shortcuts",t),e?(0,s.createElement)(E.Modal,{className:"edit-post-keyboard-shortcut-help-modal",title:(0,y.__)("Keyboard shortcuts"),closeButtonLabel:(0,y.__)("Close"),onRequestClose:t},(0,s.createElement)(Fe,{className:"edit-post-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-post/keyboard-shortcuts"]}),(0,s.createElement)(Re,{title:(0,y.__)("Global shortcuts"),categoryName:"global"}),(0,s.createElement)(Re,{title:(0,y.__)("Selection shortcuts"),categoryName:"selection"}),(0,s.createElement)(Re,{title:(0,y.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,y.__)("Change the block type after adding a new paragraph."),
/* translators: The forward-slash character. e.g. '/'. */
ariaLabel:(0,y.__)("Forward-slash")}]}),(0,s.createElement)(Fe,{title:(0,y.__)("Text formatting"),shortcuts:xe})):null})),Ve=(0,m.withDispatch)((e=>{const{openModal:t}=e(te);return{openModal:t}}))((function({openModal:e}){return(0,s.createElement)(E.MenuItem,{onClick:()=>{e(Le)},shortcut:A.displayShortcut.access("h")},(0,y.__)("Keyboard shortcuts"))}));const{Fill:Ge,Slot:ze}=(0,E.createSlotFill)("ToolsMoreMenuGroup");Ge.Slot=({fillProps:e})=>(0,s.createElement)(ze,{fillProps:e},(e=>e.length>0&&(0,s.createElement)(E.MenuGroup,{label:(0,y.__)("Tools")},e)));var He=Ge;function Ue(){const e=(0,m.useSelect)((e=>"template-only"===e(b.store).getRenderingMode()),[]);return(0,s.createElement)(h.PreferenceToggleMenuItem,{scope:"core/edit-post",name:e?"welcomeGuideTemplate":"welcomeGuide",label:(0,y.__)("Welcome Guide")})}function $e(){const e=(0,m.useSelect)((e=>{const{canUser:t}=e(k.store),{getEditorSettings:n}=e(b.store),o=n().__unstableIsBlockBasedTheme,r=(0,M.addQueryArgs)("edit.php",{post_type:"wp_block"}),a=(0,M.addQueryArgs)("site-editor.php",{path:"/patterns"});return t("read","templates")&&o?a:r}),[]);return(0,s.createElement)(E.MenuItem,{role:"menuitem",href:e},(0,y.__)("Manage patterns"))}(0,C.registerPlugin)("edit-post",{render(){return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(He,null,(({onClose:e})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)($e,null),(0,s.createElement)(Ve,{onSelect:e}),(0,s.createElement)(Ue,null),(0,s.createElement)(x,null),(0,s.createElement)(E.MenuItem,{role:"menuitem",icon:B,href:(0,y.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,y.__)("Help"),(0,s.createElement)(E.VisuallyHidden,{as:"span"},/* translators: accessibility text */
(0,y.__)("(opens in a new tab)")))))))}});var We=window.wp.commands,qe=window.wp.coreCommands;function je(e=[],t){const n=[...e];for(const e of t){const t=n.findIndex((t=>t.id===e.id));-1!==t?n[t]=e:n.push(e)}return n}const Qe=(0,m.combineReducers)({isSaving:function(e=!1,t){switch(t.type){case"REQUEST_META_BOX_UPDATES":return!0;case"META_BOX_UPDATES_SUCCESS":case"META_BOX_UPDATES_FAILURE":return!1;default:return e}},locations:function(e={},t){if("SET_META_BOXES_PER_LOCATIONS"===t.type){const n={...e};for(const[e,o]of Object.entries(t.metaBoxesPerLocation))n[e]=je(n[e],o);return n}return e},initialized:function(e=!1,t){return"META_BOXES_INITIALIZED"===t.type||e}});var Ye=(0,m.combineReducers)({metaBoxes:Qe,publishSidebarActive:function(e=!1,t){switch(t.type){case"OPEN_PUBLISH_SIDEBAR":return!0;case"CLOSE_PUBLISH_SIDEBAR":return!1;case"TOGGLE_PUBLISH_SIDEBAR":return!e}return e}}),Ke=window.wp.apiFetch,Xe=n.n(Ke),Ze=window.wp.a11y;const Je=e=>({dispatch:t,registry:n})=>{n.select(h.store).get("core","distractionFree")&&t.toggleDistractionFree(),n.dispatch(te).enableComplementaryArea(pn.name,e)},et=()=>({registry:e})=>e.dispatch(te).disableComplementaryArea(pn.name),tt=e=>({registry:t})=>(d()("select( 'core/edit-post' ).openModal( name )",{since:"6.3",alternative:"select( 'core/interface').openModal( name )"}),t.dispatch(te).openModal(e)),nt=()=>({registry:e})=>(d()("select( 'core/edit-post' ).closeModal()",{since:"6.3",alternative:"select( 'core/interface').closeModal()"}),e.dispatch(te).closeModal());function ot(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function rt(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function at(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const st=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelEnabled"}),t.dispatch(b.store).toggleEditorPanelEnabled(e)},it=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).toggleEditorPanelOpened",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelOpened"}),t.dispatch(b.store).toggleEditorPanelOpened(e)},lt=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).removeEditorPanel",{since:"6.5",alternative:"dispatch( 'core/editor').removeEditorPanel"}),t.dispatch(b.store).removeEditorPanel(e)},ct=e=>({registry:t})=>t.dispatch(h.store).toggle("core/edit-post",e),dt=e=>({dispatch:t,registry:n})=>{n.dispatch(h.store).set("core/edit-post","editorMode",e),"visual"!==e&&n.dispatch(f.store).clearSelectedBlock(),"text"===e&&n.select(h.store).get("core","distractionFree")&&t.toggleDistractionFree();const o="visual"===e?(0,y.__)("Visual editor selected"):(0,y.__)("Code editor selected");(0,Ze.speak)(o,"assertive")},ut=e=>({registry:t})=>{const n=t.select(te).isItemPinned("core/edit-post",e);t.dispatch(te)[n?"unpinItem":"pinItem"]("core/edit-post",e)},mt=(e,t)=>({registry:n})=>{var o;if(!e)return;const r=null!==(o=n.select(h.store).get("core/edit-post","preferredStyleVariations"))&&void 0!==o?o:{};if(t)n.dispatch(h.store).set("core/edit-post","preferredStyleVariations",{...r,[e]:t});else{const t={...r};delete t[e],n.dispatch(h.store).set("core/edit-post","preferredStyleVariations",t)}},pt=e=>({registry:t})=>{var n;const o=(null!==(n=t.select(h.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==n?n:[]).filter((t=>!(Array.isArray(e)?e:[e]).includes(t)));t.dispatch(h.store).set("core/edit-post","hiddenBlockTypes",o)},ht=e=>({registry:t})=>{var n;const o=null!==(n=t.select(h.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==n?n:[],r=new Set([...o,...Array.isArray(e)?e:[e]]);t.dispatch(h.store).set("core/edit-post","hiddenBlockTypes",[...r])};function gt(e){return{type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e}}const bt=()=>async({registry:e,select:t,dispatch:n})=>{n({type:"REQUEST_META_BOX_UPDATES"}),window.tinyMCE&&window.tinyMCE.triggerSave();const o=e.select(b.store).getCurrentPost(),r=[!!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")),...t.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,o]of t)e.append(n,o);return e}),new window.FormData);r.forEach((([e,t])=>a.append(e,t)));try{await Xe()({url:window._wpMetaBoxUrl,method:"POST",body:a,parse:!1}),n.metaBoxUpdatesSuccess()}catch{n.metaBoxUpdatesFailure()}};function _t(){return{type:"META_BOX_UPDATES_SUCCESS"}}function Et(){return{type:"META_BOX_UPDATES_FAILURE"}}const ft=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType",{since:"6.5",version:"6.7",hint:"registry.dispatch( editorStore ).setDeviceType"}),t.dispatch(b.store).setDeviceType(e)},yt=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).setIsInserterOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsInserterOpened"}),t.dispatch(b.store).setIsInserterOpened(e)},vt=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).setIsListViewOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsListViewOpened"}),t.dispatch(b.store).setIsListViewOpened(e)};function wt(){return d()("dispatch( 'core/edit-post' ).setIsEditingTemplate",{since:"6.5",alternative:"dispatch( 'core/editor').setRenderingMode"}),{type:"NOTHING"}}const St=()=>({registry:e})=>{e.dispatch(b.store).setRenderingMode("template-only")};function kt(){return d()("dispatch( 'core/edit-post' ).__unstableCreateTemplate",{since:"6.5"}),{type:"NOTHING"}}let Pt=!1;const Bt=()=>({registry:e,select:t,dispatch:n})=>{if(!e.select(b.store).__unstableIsEditorReady())return;if(Pt)return;const o=e.select(b.store).getCurrentPostType();window.postboxes.page!==o&&window.postboxes.add_postbox_toggles(o),Pt=!0,(0,p.addFilter)("editor.__unstableSavePost","core/edit-post/save-metaboxes",((e,o)=>e.then((()=>{if(!o.isAutosave&&t.hasMetaBoxes())return n.requestMetaBoxUpdates()})))),n({type:"META_BOXES_INITIALIZED"})},Ct=()=>({dispatch:e,registry:t})=>{const n=t.select(h.store).get("core","distractionFree");n||t.batch((()=>{t.dispatch(h.store).set("core","fixedToolbar",!0),t.dispatch(b.store).setIsInserterOpened(!1),t.dispatch(b.store).setIsListViewOpened(!1),e.closeGeneralSidebar()})),t.batch((()=>{t.dispatch(h.store).set("core","distractionFree",!n),t.dispatch(T.store).createInfoNotice(n?(0,y.__)("Distraction free off."):(0,y.__)("Distraction free on."),{id:"core/edit-post/distraction-free-mode/notice",type:"snackbar"})}))};var Mt={};function Tt(e){return[e]}function xt(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function At(e,t){var n,o=t||Tt;function r(){n=new WeakMap}function a(){var t,r,a,s,i,l=arguments.length;for(s=new Array(l),a=0;a<l;a++)s[a]=arguments[a];for(t=function(e){var t,o,r,a,s,i=n,l=!0;for(t=0;t<e.length;t++){if(!(s=o=e[t])||"object"!=typeof s){l=!1;break}i.has(o)?i=i.get(o):(r=new WeakMap,i.set(o,r),i=r)}return i.has(Mt)||((a=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=l,i.set(Mt,a)),i.get(Mt)}(i=o.apply(null,s)),t.isUniqueByDependants||(t.lastDependants&&!xt(i,t.lastDependants,0)&&t.clear(),t.lastDependants=i),r=t.head;r;){if(xt(r.args,s,1))return r!==t.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=t.head,r.prev=null,t.head.prev=r,t.head=r),r.val;r=r.next}return r={val:e.apply(null,s)},s[0]=null,r.args=s,t.head&&(t.head.prev=r,r.next=t.head),t.head=r,r.val}return a.getDependants=o,a.clear=r,r(),a}var It=window.wp.privateApis;const{lock:Nt,unlock:Lt}=(0,It.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/edit-post"),Dt=[],Ft={},Rt=(0,m.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(h.store).get("core/edit-post","editorMode"))&&void 0!==t?t:"visual"})),Ot=(0,m.createRegistrySelector)((e=>()=>{const t=e(te).getActiveComplementaryArea("core/edit-post");return["edit-post/document","edit-post/block"].includes(t)})),Vt=(0,m.createRegistrySelector)((e=>()=>{const t=e(te).getActiveComplementaryArea("core/edit-post");return!!t&&!["edit-post/document","edit-post/block"].includes(t)})),Gt=(0,m.createRegistrySelector)((e=>()=>e(te).getActiveComplementaryArea("core/edit-post"))),zt=(0,m.createRegistrySelector)((e=>()=>{d()("select( 'core/edit-post' ).getPreferences",{since:"6.0",alternative:"select( 'core/preferences' ).get"});return{...["hiddenBlockTypes","editorMode","preferredStyleVariations"].reduce(((t,n)=>({...t,[n]:e(h.store).get("core/edit-post",n)})),{}),panels:function(e,t){var n;const o=e?.reduce(((e,t)=>({...e,[t]:{enabled:!1}})),{}),r=t?.reduce(((e,t)=>{const n=e?.[t];return{...e,[t]:{...n,opened:!0}}}),null!=o?o:{});return null!==(n=null!=r?r:o)&&void 0!==n?n:Ft}(e(h.store).get("core","inactivePanels"),e(h.store).get("core","openPanels"))}}));function Ht(e,t,n){d()("select( 'core/edit-post' ).getPreference",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const o=zt(e)[t];return void 0===o?n:o}const Ut=(0,m.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(h.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==t?t:Dt}));function $t(e){return e.publishSidebarActive}const Wt=(0,m.createRegistrySelector)((e=>(t,n)=>(d()("select( 'core/edit-post' ).isEditorPanelRemoved",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelRemoved"}),e(b.store).isEditorPanelRemoved(n)))),qt=(0,m.createRegistrySelector)((e=>(t,n)=>(d()("select( 'core/edit-post' ).isEditorPanelEnabled",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelEnabled"}),e(b.store).isEditorPanelEnabled(n)))),jt=(0,m.createRegistrySelector)((e=>(t,n)=>(d()("select( 'core/edit-post' ).isEditorPanelOpened",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelOpened"}),e(b.store).isEditorPanelOpened(n)))),Qt=(0,m.createRegistrySelector)((e=>(t,n)=>(d()("select( 'core/edit-post' ).isModalActive",{since:"6.3",alternative:"select( 'core/interface' ).isModalActive"}),!!e(te).isModalActive(n)))),Yt=(0,m.createRegistrySelector)((e=>(t,n)=>!!e(h.store).get("core/edit-post",n))),Kt=(0,m.createRegistrySelector)((e=>(t,n)=>e(te).isItemPinned("core/edit-post",n))),Xt=At((e=>Object.keys(e.metaBoxes.locations).filter((t=>Jt(e,t)))),(e=>[e.metaBoxes.locations])),Zt=(0,m.createRegistrySelector)((e=>(t,n)=>Jt(t,n)&&en(t,n)?.some((({id:n})=>e(b.store).isEditorPanelEnabled(t,`meta-box-${n}`)))));function Jt(e,t){const n=en(e,t);return!!n&&0!==n.length}function en(e,t){return e.metaBoxes.locations[t]}const tn=At((e=>Object.values(e.metaBoxes.locations).flat()),(e=>[e.metaBoxes.locations]));function nn(e){return Xt(e).length>0}function on(e){return e.metaBoxes.isSaving}const rn=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-site' ).__experimentalGetPreviewDeviceType",{since:"6.5",version:"6.7",alternative:"select( 'core/editor' ).getDeviceType"}),e(b.store).getDeviceType()))),an=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-post' ).isInserterOpened",{since:"6.5",alternative:"select( 'core/editor' ).isInserterOpened"}),e(b.store).isInserterOpened()))),sn=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-post' ).__experimentalGetInsertionPoint",{since:"6.5",version:"6.7"}),Lt(e(b.store)).getInsertionPoint()))),ln=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-post' ).isListViewOpened",{since:"6.5",alternative:"select( 'core/editor' ).isListViewOpened"}),e(b.store).isListViewOpened()))),cn=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-post' ).isEditingTemplate",{since:"6.5",alternative:"select( 'core/editor' ).getRenderingMode"}),"post-only"!==e(b.store).getRenderingMode())));function dn(e){return e.metaBoxes.initialized}const un=(0,m.createRegistrySelector)((e=>()=>{const t=e(b.store).getEditedPostAttribute("template");if(t){const n=e(k.store).getEntityRecords("postType","wp_template",{per_page:-1})?.find((e=>e.slug===t));return n?e(k.store).getEditedEntityRecord("postType","wp_template",n.id):n}const n=e(b.store).getCurrentPost();return n.link?e(k.store).__experimentalGetTemplateForLink(n.link):null})),mn="core/edit-post",pn=(0,m.createReduxStore)(mn,{reducer:Ye,actions:r,selectors:a});function hn(){const e=(0,m.useSelect)((e=>e(b.store).getEditorSettings().richEditingEnabled),[]),{switchEditorMode:t}=(0,m.useDispatch)(pn),{isWelcomeGuideVisible:n}=(0,m.useSelect)((e=>{const{isFeatureActive:t}=e(pn);return{isWelcomeGuideVisible:t("welcomeGuide")}}),[]),o=(0,u.useRef)();return(0,u.useEffect)((()=>{n||o?.current?.focus()}),[n]),(0,s.createElement)("div",{className:"edit-post-text-editor"},e&&(0,s.createElement)("div",{className:"edit-post-text-editor__toolbar"},(0,s.createElement)("h2",null,(0,y.__)("Editing code")),(0,s.createElement)(E.Button,{variant:"tertiary",onClick:()=>t("visual"),shortcut:A.displayShortcut.secondary("m")},(0,y.__)("Exit code editor"))),(0,s.createElement)("div",{className:"edit-post-text-editor__body"},(0,s.createElement)(b.PostTitleRaw,{ref:o}),(0,s.createElement)(b.PostTextEditor,null)))}(0,m.register)(pn);const{EditorCanvas:gn}=Lt(b.privateApis);function bn({styles:e}){const{isWelcomeGuideVisible:t,renderingMode:n,isBlockBasedTheme:o,hasV3BlocksOnly:r}=(0,m.useSelect)((e=>{const{isFeatureActive:t}=e(pn),{getEditorSettings:n,getRenderingMode:o}=e(b.store),{getBlockTypes:r}=e(i.store),a=n();return{isWelcomeGuideVisible:t("welcomeGuide"),renderingMode:o(),isBlockBasedTheme:a.__unstableIsBlockBasedTheme,hasV3BlocksOnly:r().every((e=>e.apiVersion>=3))}}),[]),a=(0,m.useSelect)((e=>e(pn).hasMetaBoxes()),[]);let l;a||"post-only"!==n||(l="40vh"),e=(0,u.useMemo)((()=>[...e,{css:l?`body{padding-bottom:${l}}`:""}]),[e,l]);const c=(r||o)&&!a||"template-only"===n;return(0,s.createElement)("div",{className:N()("edit-post-visual-editor",{"is-template-mode":"template-only"===n,"has-inline-canvas":!c})},(0,s.createElement)(gn,{disableIframe:!c,styles:e,autoFocus:!t}))}var En=function(){const{getEditorMode:e,isEditorSidebarOpened:t}=(0,m.useSelect)(pn),n=(0,m.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:n}=e(b.store).getEditorSettings();return!t||!n}),[]),{switchEditorMode:o,openGeneralSidebar:r,closeGeneralSidebar:a,toggleFeature:s,toggleDistractionFree:l}=(0,m.useDispatch)(pn),{registerShortcut:c}=(0,m.useDispatch)(Te.store),{replaceBlocks:d}=(0,m.useDispatch)(f.store),{getBlockName:p,getSelectedBlockClientId:h,getBlockAttributes:g,getBlockSelectionStart:_}=(0,m.useSelect)(f.store),E=(e,t)=>{e.preventDefault();const n=0===t?"core/paragraph":"core/heading",o=h();if(null===o)return;const r=p(o);if("core/paragraph"!==r&&"core/heading"!==r)return;const a=g(o),s="core/paragraph"===r?"align":"textAlign",l="core/paragraph"===n?"align":"textAlign";d(o,(0,i.createBlock)(n,{level:t,content:a.content,[l]:a[s]}))};return(0,u.useEffect)((()=>{c({name:"core/edit-post/toggle-mode",category:"global",description:(0,y.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),c({name:"core/edit-post/toggle-distraction-free",category:"global",description:(0,y.__)("Toggle distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),c({name:"core/edit-post/toggle-fullscreen",category:"global",description:(0,y.__)("Toggle fullscreen mode."),keyCombination:{modifier:"secondary",character:"f"}}),c({name:"core/edit-post/toggle-sidebar",category:"global",description:(0,y.__)("Show or hide the Settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),c({name:"core/edit-post/next-region",category:"global",description:(0,y.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),c({name:"core/edit-post/previous-region",category:"global",description:(0,y.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]}),c({name:"core/edit-post/keyboard-shortcuts",category:"main",description:(0,y.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),c({name:"core/edit-post/transform-heading-to-paragraph",category:"block-library",description:(0,y.__)("Transform heading to paragraph."),keyCombination:{modifier:"access",character:"0"}}),[1,2,3,4,5,6].forEach((e=>{c({name:`core/edit-post/transform-paragraph-to-heading-${e}`,category:"block-library",description:(0,y.__)("Transform paragraph to heading."),keyCombination:{modifier:"access",character:`${e}`}})}))}),[]),(0,Te.useShortcut)("core/edit-post/toggle-mode",(()=>{o("visual"===e()?"text":"visual")}),{isDisabled:n}),(0,Te.useShortcut)("core/edit-post/toggle-fullscreen",(()=>{s("fullscreenMode")})),(0,Te.useShortcut)("core/edit-post/toggle-distraction-free",(()=>{l()})),(0,Te.useShortcut)("core/edit-post/toggle-sidebar",(e=>{if(e.preventDefault(),t())a();else{const e=_()?"edit-post/block":"edit-post/document";r(e)}})),(0,Te.useShortcut)("core/edit-post/transform-heading-to-paragraph",(e=>E(e,0))),[1,2,3,4,5,6].forEach((e=>{(0,Te.useShortcut)(`core/edit-post/transform-paragraph-to-heading-${e}`,(t=>E(t,e)))})),null};function fn({willEnable:e}){const[t,n]=(0,u.useState)(!1);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("p",{className:"edit-post-preferences-modal__custom-fields-confirmation-message"},(0,y.__)("A page reload is required for this change. Make sure your content is saved before reloading.")),(0,s.createElement)(E.Button,{className:"edit-post-preferences-modal__custom-fields-confirmation-button",variant:"secondary",isBusy:t,disabled:t,onClick:()=>{n(!0),function(){const e=document.getElementById("toggle-custom-fields-form");e.querySelector('[name="_wp_http_referer"]').setAttribute("value",(0,M.getPathAndQueryString)(window.location.href)),e.submit()}()}},e?(0,y.__)("Show & Reload Page"):(0,y.__)("Hide & Reload Page")))}var yn=(0,m.withSelect)((e=>({areCustomFieldsEnabled:!!e(b.store).getEditorSettings().enableCustomFields})))((function({label:e,areCustomFieldsEnabled:t}){const[n,o]=(0,u.useState)(t);return(0,s.createElement)(Me,{label:e,isChecked:n,onChange:o},n!==t&&(0,s.createElement)(fn,{willEnable:n}))})),vn=(0,v.compose)((0,m.withSelect)(((e,{panelName:t})=>{const{isEditorPanelEnabled:n,isEditorPanelRemoved:o}=e(b.store);return{isRemoved:o(t),isChecked:n(t)}})),(0,v.ifCondition)((({isRemoved:e})=>!e)),(0,m.withDispatch)(((e,{panelName:t})=>({onChange:()=>e(b.store).toggleEditorPanelEnabled(t)}))))(Me);const{Fill:wn,Slot:Sn}=(0,E.createSlotFill)("EnablePluginDocumentSettingPanelOption"),kn=({label:e,panelName:t})=>(0,s.createElement)(wn,null,(0,s.createElement)(vn,{label:e,panelName:t}));kn.Slot=Sn;var Pn=kn,Bn=(0,v.compose)((0,m.withSelect)((e=>({isChecked:e(b.store).isPublishSidebarEnabled()}))),(0,m.withDispatch)((e=>{const{enablePublishSidebar:t,disablePublishSidebar:n}=e(b.store);return{onChange:e=>e?t():n()}})),(0,R.ifViewportMatches)("medium"))(Me);function Cn(e){const{scope:t="core/edit-post",featureName:n,onToggle:o=(()=>{}),...r}=e,a=(0,m.useSelect)((e=>!!e(h.store).get(t,n)),[t,n]),{toggle:i}=(0,m.useDispatch)(h.store);return(0,s.createElement)(Me,{onChange:()=>{o(),i(t,n)},isChecked:a,...r})}var Mn=(0,m.withSelect)((e=>{const{getEditorSettings:t}=e(b.store),{getAllMetaBoxes:n}=e(pn);return{areCustomFieldsRegistered:void 0!==t().enableCustomFields,metaBoxes:n()}}))((function({areCustomFieldsRegistered:e,metaBoxes:t,...n}){const o=t.filter((({id:e})=>"postcustom"!==e));return e||0!==o.length?(0,s.createElement)(Ce,{...n},e&&(0,s.createElement)(yn,{label:(0,y.__)("Custom fields")}),o.map((({id:e,title:t})=>(0,s.createElement)(vn,{key:e,label:t,panelName:`meta-box-${e}`})))):null})),Tn=function({blockTypes:e,value:t,onItemChange:n}){return(0,s.createElement)("ul",{className:"edit-post-block-manager__checklist"},e.map((e=>(0,s.createElement)("li",{key:e.name,className:"edit-post-block-manager__checklist-item"},(0,s.createElement)(E.CheckboxControl,{__nextHasNoMarginBottom:!0,label:e.title,checked:t.includes(e.name),onChange:(...t)=>n(e.name,...t)}),(0,s.createElement)(f.BlockIcon,{icon:e.icon})))))},xn=function e({title:t,blockTypes:n}){const o=(0,v.useInstanceId)(e),{defaultAllowedBlockTypes:r,hiddenBlockTypes:a}=(0,m.useSelect)((e=>{const{getEditorSettings:t}=e(b.store),{getHiddenBlockTypes:n}=e(pn);return{defaultAllowedBlockTypes:t().defaultAllowedBlockTypes,hiddenBlockTypes:n()}}),[]),i=(0,u.useMemo)((()=>!0===r?n:n.filter((({name:e})=>r?.includes(e)))),[r,n]),{showBlockTypes:l,hideBlockTypes:c}=(0,m.useDispatch)(pn),d=(0,u.useCallback)(((e,t)=>{t?l(e):c(e)}),[]),p=(0,u.useCallback)((e=>{const t=n.map((({name:e})=>e));e?l(t):c(t)}),[n]);if(!i.length)return null;const h=i.map((({name:e})=>e)).filter((e=>!a.includes(e))),g="edit-post-block-manager__category-title-"+o,_=h.length===i.length,f=!_&&h.length>0;return(0,s.createElement)("div",{role:"group","aria-labelledby":g,className:"edit-post-block-manager__category"},(0,s.createElement)(E.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:_,onChange:p,className:"edit-post-block-manager__category-title",indeterminate:f,label:(0,s.createElement)("span",{id:g},t)}),(0,s.createElement)(Tn,{blockTypes:i,value:h,onItemChange:d}))},An=(0,v.compose)([(0,m.withSelect)((e=>{const{getBlockTypes:t,getCategories:n,hasBlockSupport:o,isMatchingSearchTerm:r}=e(i.store),{getHiddenBlockTypes:a}=e(pn),s=t(),l=a().filter((e=>s.some((t=>t.name===e)))),c=Array.isArray(l)&&l.length;return{blockTypes:s,categories:n(),hasBlockSupport:o,isMatchingSearchTerm:r,numberOfHiddenBlocks:c}})),(0,m.withDispatch)((e=>{const{showBlockTypes:t}=e(pn);return{enableAllBlockTypes:e=>{const n=e.map((({name:e})=>e));t(n)}}}))])((function({blockTypes:e,categories:t,hasBlockSupport:n,isMatchingSearchTerm:o,numberOfHiddenBlocks:r,enableAllBlockTypes:a}){const i=(0,v.useDebounce)(Ze.speak,500),[l,c]=(0,u.useState)("");return e=e.filter((e=>n(e,"inserter",!0)&&(!l||o(e,l))&&(!e.parent||e.parent.includes("core/post-content")))),(0,u.useEffect)((()=>{if(!l)return;const t=e.length,n=(0,y.sprintf)(/* translators: %d: number of results. */
(0,y._n)("%d result found.","%d results found.",t),t);i(n)}),[e.length,l,i]),(0,s.createElement)("div",{className:"edit-post-block-manager__content"},!!r&&(0,s.createElement)("div",{className:"edit-post-block-manager__disabled-blocks-count"},(0,y.sprintf)(/* translators: %d: number of blocks. */
(0,y._n)("%d block is hidden.","%d blocks are hidden.",r),r),(0,s.createElement)(E.Button,{variant:"link",onClick:()=>a(e)},(0,y.__)("Reset"))),(0,s.createElement)(E.SearchControl,{__nextHasNoMarginBottom:!0,label:(0,y.__)("Search for a block"),placeholder:(0,y.__)("Search for a block"),value:l,onChange:e=>c(e),className:"edit-post-block-manager__search"}),(0,s.createElement)("div",{tabIndex:"0",role:"region","aria-label":(0,y.__)("Available block types"),className:"edit-post-block-manager__results"},0===e.length&&(0,s.createElement)("p",{className:"edit-post-block-manager__no-results"},(0,y.__)("No blocks found.")),t.map((t=>(0,s.createElement)(xn,{key:t.slug,title:t.title,blockTypes:e.filter((e=>e.category===t.slug))}))),(0,s.createElement)(xn,{title:(0,y.__)("Uncategorized"),blockTypes:e.filter((({category:e})=>!e))})))}));const In="edit-post/preferences";function Nn(){const e=(0,v.useViewportMatch)("medium"),{closeModal:t}=(0,m.useDispatch)(te),[n,o]=(0,m.useSelect)((t=>{const{getEditorSettings:n}=t(b.store),{getEditorMode:o}=t(pn),{get:r}=t(h.store),a=t(te).isModalActive(In),s=o(),i=n().richEditingEnabled,l=r("core","distractionFree");return[a,!l&&e&&i&&"visual"===s,l]}),[e]),{closeGeneralSidebar:r}=(0,m.useDispatch)(pn),{setIsListViewOpened:a,setIsInserterOpened:i}=(0,m.useDispatch)(b.store),{set:l}=(0,m.useDispatch)(h.store),c=()=>{l("core","fixedToolbar",!0),i(!1),a(!1),r()},d=()=>{l("core","distractionFree",!1)},p=(0,u.useMemo)((()=>[{name:"general",tabLabel:(0,y.__)("General"),content:(0,s.createElement)(s.Fragment,null,e&&(0,s.createElement)(Ce,{title:(0,y.__)("Publishing")},(0,s.createElement)(Bn,{help:(0,y.__)("Review settings, such as visibility and tags."),label:(0,y.__)("Enable pre-publish checks")})),(0,s.createElement)(Ce,{title:(0,y.__)("Interface")},(0,s.createElement)(Cn,{scope:"core",featureName:"showListViewByDefault",help:(0,y.__)("Opens the block list view sidebar by default."),label:(0,y.__)("Always open list view")}),o&&(0,s.createElement)(Cn,{scope:"core",featureName:"showBlockBreadcrumbs",help:(0,y.__)("Display the block hierarchy trail at the bottom of the editor."),label:(0,y.__)("Show block breadcrumbs")}),(0,s.createElement)(Cn,{scope:"core",featureName:"allowRightClickOverrides",help:(0,y.__)("Allows contextual list view menus via right-click, overriding browser defaults."),label:(0,y.__)("Allow right-click contextual menus")})),(0,s.createElement)(Ce,{title:(0,y.__)("Document settings"),description:(0,y.__)("Select what settings are shown in the document panel.")},(0,s.createElement)(Pn.Slot,null),(0,s.createElement)(b.PostTaxonomies,{taxonomyWrapper:(e,t)=>(0,s.createElement)(vn,{label:t.labels.menu_name,panelName:`taxonomy-panel-${t.slug}`})}),(0,s.createElement)(b.PostFeaturedImageCheck,null,(0,s.createElement)(vn,{label:(0,y.__)("Featured image"),panelName:"featured-image"})),(0,s.createElement)(b.PostExcerptCheck,null,(0,s.createElement)(vn,{label:(0,y.__)("Excerpt"),panelName:"post-excerpt"})),(0,s.createElement)(b.PostTypeSupportCheck,{supportKeys:["comments","trackbacks"]},(0,s.createElement)(vn,{label:(0,y.__)("Discussion"),panelName:"discussion-panel"})),(0,s.createElement)(b.PageAttributesCheck,null,(0,s.createElement)(vn,{label:(0,y.__)("Page attributes"),panelName:"page-attributes"}))),(0,s.createElement)(Mn,{title:(0,y.__)("Advanced")}))},{name:"appearance",tabLabel:(0,y.__)("Appearance"),content:(0,s.createElement)(Ce,{title:(0,y.__)("Appearance"),description:(0,y.__)("Customize the editor interface to suit your needs.")},(0,s.createElement)(Cn,{scope:"core",featureName:"fixedToolbar",onToggle:d,help:(0,y.__)("Access all block and document tools in a single place."),label:(0,y.__)("Top toolbar")}),(0,s.createElement)(Cn,{scope:"core",featureName:"distractionFree",onToggle:c,help:(0,y.__)("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:(0,y.__)("Distraction free")}),(0,s.createElement)(Cn,{scope:"core",featureName:"focusMode",help:(0,y.__)("Highlights the current block and fades other content."),label:(0,y.__)("Spotlight mode")}),(0,s.createElement)(Cn,{featureName:"themeStyles",help:(0,y.__)("Make the editor look like your theme."),label:(0,y.__)("Use theme styles")}))},{name:"accessibility",tabLabel:(0,y.__)("Accessibility"),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ce,{title:(0,y.__)("Navigation"),description:(0,y.__)("Optimize the editing experience for enhanced control.")},(0,s.createElement)(Cn,{scope:"core",featureName:"keepCaretInsideBlock",help:(0,y.__)("Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block."),label:(0,y.__)("Contain text cursor inside block")})),(0,s.createElement)(Ce,{title:(0,y.__)("Interface")},(0,s.createElement)(Cn,{scope:"core",featureName:"showIconLabels",label:(0,y.__)("Show button text labels"),help:(0,y.__)("Show text instead of icons on buttons across the interface.")})))},{name:"blocks",tabLabel:(0,y.__)("Blocks"),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ce,{title:(0,y.__)("Inserter")},(0,s.createElement)(Cn,{scope:"core",featureName:"mostUsedBlocks",help:(0,y.__)("Adds a category with the most frequently used blocks in the inserter."),label:(0,y.__)("Show most used blocks")})),(0,s.createElement)(Ce,{title:(0,y.__)("Manage block visibility"),description:(0,y.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")},(0,s.createElement)(An,null)))}]),[e,o]);return n?(0,s.createElement)(ve,{closeModal:t},(0,s.createElement)(Be,{sections:p})):null}class Ln extends u.Component{constructor(){super(...arguments),this.state={historyId:null}}componentDidUpdate(e){const{postId:t,postStatus:n,postType:o,isSavingPost:r,hasHistory:a}=this.props,{historyId:s}=this.state;"trash"!==n||r?t===e.postId&&t===s||"auto-draft"===n||!t||a||this.setBrowserURL(t):this.setTrashURL(t,o)}setTrashURL(e,t){window.location.href=function(e,t){return(0,M.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,M.addQueryArgs)("post.php",{post:e,action:"edit"})}(e)),this.setState((()=>({historyId:e})))}render(){return null}}var Dn=(0,m.withSelect)((e=>{const{getCurrentPost:t,isSavingPost:n}=e(b.store),o=t();let{id:r,status:a,type:s}=o;return["wp_template","wp_template_part"].includes(s)&&(r=o.wp_id),{postId:r,postStatus:a,postType:s,isSavingPost:n()}}))(Ln),Fn=(0,s.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(P.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})),Rn=(0,s.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(P.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})),On=(0,s.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(P.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"})),Vn=function({showTooltip:e,icon:t,href:n}){var o;const{isActive:r,isRequestingSiteIcon:a,postType:i,siteIconUrl:l}=(0,m.useSelect)((e=>{const{getCurrentPostType:t}=e(b.store),{isFeatureActive:n}=e(pn),{getEntityRecord:o,getPostType:r,isResolving:a}=e(k.store),s=o("root","__unstableBase",void 0)||{};return{isActive:n("fullscreenMode"),isRequestingSiteIcon:a("getEntityRecord",["root","__unstableBase",void 0]),postType:r(t()),siteIconUrl:s.site_icon_url}}),[]),c=(0,v.useReducedMotion)();if(!r||!i)return null;let d=(0,s.createElement)(E.Icon,{size:"36px",icon:On});l&&(d=(0,s.createElement)(E.__unstableMotion.img,{variants:!c&&{expand:{scale:1.25,transition:{type:"tween",duration:"0.3"}}},alt:(0,y.__)("Site Icon"),className:"edit-post-fullscreen-mode-close_site-icon",src:l})),a&&(d=null),t&&(d=(0,s.createElement)(E.Icon,{size:"36px",icon:t}));const u=N()({"edit-post-fullscreen-mode-close":!0,"has-icon":l});return(0,s.createElement)(E.__unstableMotion.div,{whileHover:"expand"},(0,s.createElement)(E.Button,{className:u,href:null!=n?n:(0,M.addQueryArgs)("edit.php",{post_type:i.slug}),label:null!==(o=i?.labels?.view_items)&&void 0!==o?o:(0,y.__)("Back"),showTooltip:e},d))};const Gn=[{value:"visual",label:(0,y.__)("Visual editor")},{value:"text",label:(0,y.__)("Code editor")}];var zn=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:n,isEditingTemplate:o,mode:r}=(0,m.useSelect)((e=>({shortcut:e(Te.store).getShortcutRepresentation("core/edit-post/toggle-mode"),isRichEditingEnabled:e(b.store).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(b.store).getEditorSettings().codeEditingEnabled,isEditingTemplate:"template-only"===e(b.store).getRenderingMode(),mode:e(pn).getEditorMode()})),[]),{switchEditorMode:a}=(0,m.useDispatch)(pn);if(o)return null;let i=r;t||"visual"!==r||(i="text"),n||"text"!==r||(i="visual");const l=Gn.map((o=>(n||"text"!==o.value||(o={...o,disabled:!0}),t||"visual"!==o.value||(o={...o,disabled:!0,info:(0,y.__)("You can enable the visual editor in your profile settings.")}),o.value===i||o.disabled?o:{...o,shortcut:e})));return(0,s.createElement)(E.MenuGroup,{label:(0,y.__)("Editor")},(0,s.createElement)(E.MenuItemsChoice,{choices:l,value:i,onSelect:a}))};function Hn(){const{openModal:e}=(0,m.useDispatch)(te);return(0,s.createElement)(E.MenuItem,{onClick:()=>{e(In)}},(0,y.__)("Preferences"))}var Un=function(){const e=(0,m.useRegistry)(),{closeGeneralSidebar:t}=(0,m.useDispatch)(pn),{set:n}=(0,m.useDispatch)(h.store),{setIsInserterOpened:o,setIsListViewOpened:r}=(0,m.useDispatch)(b.store);return(0,v.useViewportMatch)("medium")?(0,s.createElement)(E.MenuGroup,{label:(0,y._x)("View","noun")},(0,s.createElement)(h.PreferenceToggleMenuItem,{scope:"core",name:"fixedToolbar",onToggle:()=>{n("core","distractionFree",!1)},label:(0,y.__)("Top toolbar"),info:(0,y.__)("Access all block and document tools in a single place"),messageActivated:(0,y.__)("Top toolbar activated"),messageDeactivated:(0,y.__)("Top toolbar deactivated")}),(0,s.createElement)(h.PreferenceToggleMenuItem,{scope:"core",name:"distractionFree",onToggle:()=>{e.batch((()=>{n("core","fixedToolbar",!0),o(!1),r(!1),t()}))},label:(0,y.__)("Distraction free"),info:(0,y.__)("Write with calmness"),messageActivated:(0,y.__)("Distraction free mode activated"),messageDeactivated:(0,y.__)("Distraction free mode deactivated"),shortcut:A.displayShortcut.primaryShift("\\")}),(0,s.createElement)(h.PreferenceToggleMenuItem,{scope:"core",name:"focusMode",label:(0,y.__)("Spotlight mode"),info:(0,y.__)("Focus on one block at a time"),messageActivated:(0,y.__)("Spotlight mode activated"),messageDeactivated:(0,y.__)("Spotlight mode deactivated")}),(0,s.createElement)(h.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fullscreenMode",label:(0,y.__)("Fullscreen mode"),info:(0,y.__)("Show and hide the admin user interface"),messageActivated:(0,y.__)("Fullscreen mode activated"),messageDeactivated:(0,y.__)("Fullscreen mode deactivated"),shortcut:A.displayShortcut.secondary("f")})):null},$n=({showIconLabels:e})=>{const t=(0,v.useViewportMatch)("large");return(0,s.createElement)(ye,{toggleProps:{showTooltip:!e,...e&&{variant:"tertiary"},size:"compact"}},(({onClose:n})=>(0,s.createElement)(s.Fragment,null,e&&!t&&(0,s.createElement)(ue.Slot,{className:e&&"show-icon-labels",scope:"core/edit-post"}),(0,s.createElement)(Un,null),(0,s.createElement)(zn,null),(0,s.createElement)(ie.Slot,{name:"core/edit-post/plugin-more-menu",label:(0,y.__)("Plugins"),as:E.MenuGroup,fillProps:{onClick:n}}),(0,s.createElement)(He.Slot,{fillProps:{onClose:n}}),(0,s.createElement)(E.MenuGroup,null,(0,s.createElement)(Hn,null)))))},Wn=(0,v.compose)((0,m.withSelect)((e=>{var t;return{hasPublishAction:null!==(t=e(b.store).getCurrentPost()?._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:e(b.store).isEditedPostBeingScheduled(),isPending:e(b.store).isCurrentPostPending(),isPublished:e(b.store).isCurrentPostPublished(),isPublishSidebarEnabled:e(b.store).isPublishSidebarEnabled(),isPublishSidebarOpened:e(pn).isPublishSidebarOpened(),isScheduled:e(b.store).isCurrentPostScheduled()}})),(0,m.withDispatch)((e=>{const{togglePublishSidebar:t}=e(pn);return{togglePublishSidebar:t}})))((function({forceIsDirty:e,hasPublishAction:t,isBeingScheduled:n,isPending:o,isPublished:r,isPublishSidebarEnabled:a,isPublishSidebarOpened:i,isScheduled:l,togglePublishSidebar:c,setEntitiesSavedStatesCallback:d}){const u="toggle",m="button",p=(0,v.useViewportMatch)("medium","<");let h;return h=r||l&&n||o&&!t&&!p?m:p||a?u:m,(0,s.createElement)(b.PostPublishButton,{forceIsDirty:e,isOpen:i,isToggle:h===u,onToggle:c,setEntitiesSavedStatesCallback:d})}));const qn="__experimentalMainDashboardButton",{Fill:jn,Slot:Qn}=(0,E.createSlotFill)(qn),Yn=jn;Yn.Slot=({children:e})=>{const t=(0,E.__experimentalUseSlotFills)(qn);return Boolean(t&&t.length)?(0,s.createElement)(Qn,{bubblesVirtually:!0}):e};var Kn=Yn;const{DocumentTools:Xn,PostViewLink:Zn,PreviewDropdown:Jn}=Lt(b.privateApis),eo={hidden:{y:"-50px"},distractionFreeInactive:{y:0},hover:{y:0,transition:{type:"tween",delay:.2}}},to={hidden:{x:"-100%"},distractionFreeInactive:{x:0},hover:{x:0,transition:{type:"tween",delay:.2}}};var no=function({setEntitiesSavedStatesCallback:e}){const t=(0,v.useViewportMatch)("large"),n=(0,v.useViewportMatch)("medium"),o=(0,u.useRef)(),{isTextEditor:r,hasBlockSelection:a,hasActiveMetaboxes:i,hasFixedToolbar:l,isEditingTemplate:c,isPublishSidebarOpened:d,showIconLabels:p,hasHistory:g}=(0,m.useSelect)((e=>{const{get:t}=e(h.store),{getEditorMode:n}=e(pn);return{isTextEditor:"text"===n(),hasBlockSelection:!!e(f.store).getBlockSelectionStart(),hasActiveMetaboxes:e(pn).hasMetaBoxes(),hasHistory:!!e(b.store).getEditorSettings().goBack,isEditingTemplate:"template-only"===e(b.store).getRenderingMode(),isPublishSidebarOpened:e(pn).isPublishSidebarOpened(),hasFixedToolbar:t("core","fixedToolbar"),showIconLabels:t("core","showIconLabels")}}),[]),[_,w]=(0,u.useState)(!0);return(0,u.useEffect)((()=>{a&&w(!1)}),[a]),(0,s.createElement)("div",{className:"edit-post-header"},(0,s.createElement)(Kn.Slot,null,(0,s.createElement)(E.__unstableMotion.div,{variants:to,transition:{type:"tween",delay:.8}},(0,s.createElement)(Vn,{showTooltip:!0}))),(0,s.createElement)(E.__unstableMotion.div,{variants:eo,transition:{type:"tween",delay:.8},className:"edit-post-header__toolbar"},(0,s.createElement)(Xn,{disableBlockTools:r}),l&&n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:N()("selected-block-tools-wrapper",{"is-collapsed":c&&_})},(0,s.createElement)(f.BlockToolbar,{hideDragHandle:!0})),(0,s.createElement)(E.Popover.Slot,{ref:o,name:"block-toolbar"}),c&&a&&(0,s.createElement)(E.Button,{className:"edit-post-header__block-tools-toggle",icon:_?Fn:Rn,onClick:()=>{w((e=>!e))},label:_?(0,y.__)("Show block tools"):(0,y.__)("Hide block tools")})),(0,s.createElement)("div",{className:N()("edit-post-header__center",{"is-collapsed":c&&a&&!_&&l&&n})},(c||g)&&(0,s.createElement)(b.DocumentBar,null))),(0,s.createElement)(E.__unstableMotion.div,{variants:eo,transition:{type:"tween",delay:.8},className:"edit-post-header__settings"},!d&&(0,s.createElement)(b.PostSavedState,{forceIsDirty:i}),(0,s.createElement)(Jn,{forceIsAutosaveable:i}),(0,s.createElement)(b.PostPreviewButton,{className:"edit-post-header__post-preview-button",forceIsAutosaveable:i}),(0,s.createElement)(Zn,null),(0,s.createElement)(Wn,{forceIsDirty:i,setEntitiesSavedStatesCallback:e}),(t||!p)&&(0,s.createElement)(ue.Slot,{scope:"core/edit-post"}),(0,s.createElement)($n,{showIconLabels:p})))},oo=(0,s.createElement)(P.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(P.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"})),ro=(0,s.createElement)(P.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(P.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"}));const{Tabs:ao}=Lt(E.privateApis);var so=()=>{const{documentLabel:e,isTemplateMode:t}=(0,m.useSelect)((e=>{const{getPostTypeLabel:t,getRenderingMode:n}=e(b.store);return{
// translators: Default label for the Document sidebar tab, not selected.
documentLabel:t()||(0,y._x)("Document","noun"),isTemplateMode:"template-only"===n()}}),[]);return(0,s.createElement)(ao.TabList,null,(0,s.createElement)(ao.Tab,{tabId:Ro.document},t?(0,y.__)("Template"):e),(0,s.createElement)(ao.Tab,{tabId:Ro.block},(0,y.__)("Block")))};const{PostPanelRow:io}=Lt(b.privateApis);function lo({isOpen:e,onClick:t}){const n=(0,b.usePostVisibilityLabel)();return(0,s.createElement)(E.Button,{className:"edit-post-post-visibility__toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,y.sprintf)((0,y.__)("Select visibility: %s"),n),onClick:t},n)}var co=function(){const[e,t]=(0,u.useState)(null),n=(0,u.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,s.createElement)(b.PostVisibilityCheck,{render:({canEdit:e})=>(0,s.createElement)(io,{label:(0,y.__)("Visibility"),ref:t},!e&&(0,s.createElement)("span",null,(0,s.createElement)(b.PostVisibilityLabel,null)),e&&(0,s.createElement)(E.Dropdown,{contentClassName:"edit-post-post-visibility__dialog",popoverProps:n,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,s.createElement)(lo,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,s.createElement)(b.PostVisibility,{onClose:e})}))})};function uo(){return(0,s.createElement)(b.PostTrashCheck,null,(0,s.createElement)(b.PostTrash,null))}const{PostPanelRow:mo}=Lt(b.privateApis);var po=function(){return(0,s.createElement)(b.PostStickyCheck,null,(0,s.createElement)(mo,null,(0,s.createElement)(b.PostSticky,null)))},ho=function(){return(0,s.createElement)(b.PostSlugCheck,null,(0,s.createElement)(E.PanelRow,{className:"edit-post-post-slug"},(0,s.createElement)(b.PostSlug,null)))},go=function(){return(0,s.createElement)(b.PostFormatCheck,null,(0,s.createElement)(E.PanelRow,{className:"edit-post-post-format"},(0,s.createElement)(b.PostFormat,null)))};const{PostPanelRow:bo}=Lt(b.privateApis);var _o=function(){return(0,s.createElement)(b.PostPendingStatusCheck,null,(0,s.createElement)(bo,null,(0,s.createElement)(b.PostPendingStatus,null)))};const{Fill:Eo,Slot:fo}=(0,E.createSlotFill)("PluginPostStatusInfo"),yo=({children:e,className:t})=>(0,s.createElement)(Eo,null,(0,s.createElement)(E.PanelRow,{className:t},e));yo.Slot=fo;var vo=yo;const wo="post-status";function So(){const{isOpened:e,isRemoved:t}=(0,m.useSelect)((e=>{const{isEditorPanelRemoved:t,isEditorPanelOpened:n}=e(b.store);return{isRemoved:t(wo),isOpened:n(wo)}}),[]),{toggleEditorPanelOpened:n}=(0,m.useDispatch)(b.store);return t?null:(0,s.createElement)(E.PanelBody,{className:"edit-post-post-status",title:(0,y.__)("Summary"),opened:e,onToggle:()=>n(wo)},(0,s.createElement)(vo.Slot,null,(e=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(co,null),(0,s.createElement)(b.PostSchedulePanel,null),(0,s.createElement)(b.PostTemplatePanel,null),(0,s.createElement)(b.PostURLPanel,null),(0,s.createElement)(b.PostSyncStatus,null),(0,s.createElement)(po,null),(0,s.createElement)(_o,null),(0,s.createElement)(go,null),(0,s.createElement)(ho,null),(0,s.createElement)(b.PostAuthorPanel,null),e,(0,s.createElement)(E.__experimentalHStack,{style:{marginTop:"16px"},spacing:4,wrap:!0},(0,s.createElement)(b.PostSwitchToDraftButton,null),(0,s.createElement)(uo,null))))))}var ko=function({location:e}){const t=(0,u.useRef)(null),n=(0,u.useRef)(null);(0,u.useEffect)((()=>(n.current=document.querySelector(".metabox-location-"+e),n.current&&t.current.appendChild(n.current),()=>{n.current&&document.querySelector("#metaboxes").appendChild(n.current)})),[e]);const o=(0,m.useSelect)((e=>e(pn).isSavingMetaBoxes()),[]),r=N()("edit-post-meta-boxes-area",`is-${e}`,{"is-loading":o});return(0,s.createElement)("div",{className:r},o&&(0,s.createElement)(E.Spinner,null),(0,s.createElement)("div",{className:"edit-post-meta-boxes-area__container",ref:t}),(0,s.createElement)("div",{className:"edit-post-meta-boxes-area__clear"}))};class Po extends u.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 Bo=(0,m.withSelect)(((e,{id:t})=>({isVisible:e(b.store).isEditorPanelEnabled(`meta-box-${t}`)})))(Po);function Co({location:e}){const t=(0,m.useRegistry)(),{metaBoxes:n,areMetaBoxesInitialized:o,isEditorReady:r}=(0,m.useSelect)((t=>{const{__unstableIsEditorReady:n}=t(b.store),{getMetaBoxesPerLocation:o,areMetaBoxesInitialized:r}=t(pn);return{metaBoxes:o(e),areMetaBoxesInitialized:r(),isEditorReady:n()}}),[e]);return(0,u.useEffect)((()=>{r&&!o&&t.dispatch(pn).initializeMetaBoxes()}),[r,o]),o?(0,s.createElement)(s.Fragment,null,(null!=n?n:[]).map((({id:e})=>(0,s.createElement)(Bo,{key:e,id:e}))),(0,s.createElement)(ko,{location:e})):null}window.wp.warning;const{Fill:Mo,Slot:To}=(0,E.createSlotFill)("PluginDocumentSettingPanel"),xo=({name:e,className:t,title:n,icon:o,children:r})=>{const{name:a}=(0,C.usePluginContext)(),i=`${a}/${e}`,{opened:l,isEnabled:c}=(0,m.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:n}=e(b.store);return{opened:t(i),isEnabled:n(i)}}),[i]),{toggleEditorPanelOpened:d}=(0,m.useDispatch)(b.store);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Pn,{label:n,panelName:i}),(0,s.createElement)(Mo,null,c&&(0,s.createElement)(E.PanelBody,{className:t,title:n,icon:o,opened:l,onToggle:()=>d(i)},r)))};xo.Slot=To;var Ao=xo;function Io({className:e,...t}){const{postTitle:n,shortcut:o}=(0,m.useSelect)((e=>({postTitle:e(b.store).getEditedPostAttribute("title"),shortcut:e(Te.store).getShortcutRepresentation("core/edit-post/toggle-sidebar")})),[]);return(0,s.createElement)(he,{panelClassName:e,className:"edit-post-sidebar",smallScreenTitle:n||(0,y.__)("(no title)"),scope:"core/edit-post",toggleShortcut:o,...t})}var No=(0,s.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(P.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"})),Lo=function(){const e=(0,m.useSelect)((e=>{const{getEditedPostTemplate:t}=e(pn);return t()}),[]);return e?(0,s.createElement)(E.PanelBody,null,(0,s.createElement)(E.Flex,{align:"flex-start",gap:"3"},(0,s.createElement)(E.FlexItem,null,(0,s.createElement)(we,{icon:No})),(0,s.createElement)(E.FlexBlock,null,(0,s.createElement)("h2",{className:"edit-post-template-summary__title"},e?.title||e?.slug),(0,s.createElement)("p",null,e?.description)))):null};const{Tabs:Do}=Lt(E.privateApis),Fo=u.Platform.select({web:!0,native:!1}),Ro={document:"edit-post/document",block:"edit-post/block"},Oo=({sidebarName:e,keyboardShortcut:t,isTemplateMode:n})=>{const o=(0,u.useContext)(Do.Context);return(0,s.createElement)(Io,{identifier:e,header:(0,s.createElement)(Do.Context.Provider,{value:o},(0,s.createElement)(so,null)),closeLabel:(0,y.__)("Close Settings"),className:"edit-post-sidebar__panel",headerClassName:"edit-post-sidebar__panel-tabs"
/* translators: button label text should, if possible, be under 16 characters. */,title:(0,y.__)("Settings"),toggleShortcut:t,icon:(0,y.isRTL)()?oo:ro,isActiveByDefault:Fo},(0,s.createElement)(Do.Context.Provider,{value:o},(0,s.createElement)(Do.TabPanel,{tabId:Ro.document,focusable:!1},!n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(So,null),(0,s.createElement)(Ao.Slot,null),(0,s.createElement)(b.PostLastRevisionPanel,null),(0,s.createElement)(b.PostTaxonomiesPanel,null),(0,s.createElement)(b.PostFeaturedImagePanel,null),(0,s.createElement)(b.PostExcerptPanel,null),(0,s.createElement)(b.PostDiscussionPanel,null),(0,s.createElement)(b.PageAttributesPanel,null),(0,s.createElement)(Co,{location:"side"})),n&&(0,s.createElement)(Lo,null)),(0,s.createElement)(Do.TabPanel,{tabId:Ro.block,focusable:!1},(0,s.createElement)(f.BlockInspector,null))))};var Vo=()=>{const{sidebarName:e,isSettingsSidebarActive:t,keyboardShortcut:n,isTemplateMode:o}=(0,m.useSelect)((e=>{let t=e(te).getActiveComplementaryArea(pn.name),n=!0;return[Ro.document,Ro.block].includes(t)||(n=!1,e(f.store).getBlockSelectionStart()&&(t=Ro.block),t=Ro.document),{sidebarName:t,isSettingsSidebarActive:n,keyboardShortcut:e(Te.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),isTemplateMode:"template-only"===e(b.store).getRenderingMode()}}),[]),{openGeneralSidebar:r}=(0,m.useDispatch)(pn),a=(0,u.useCallback)((e=>{e&&r(e)}),[r]);return(0,s.createElement)(Do,{selectedTabId:t?e:null,onSelect:a},(0,s.createElement)(Oo,{sidebarName:e,keyboardShortcut:n,isTemplateMode:o}))};function Go({nonAnimatedSrc:e,animatedSrc:t}){return(0,s.createElement)("picture",{className:"edit-post-welcome-guide__image"},(0,s.createElement)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,s.createElement)("img",{src:t,width:"312",height:"240",alt:""}))}function zo(){const{toggleFeature:e}=(0,m.useDispatch)(pn);return(0,s.createElement)(E.Guide,{className:"edit-post-welcome-guide",contentLabel:(0,y.__)("Welcome to the block editor"),finishButtonText:(0,y.__)("Get started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,s.createElement)(Go,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,y.__)("Welcome to the block editor")),(0,s.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,y.__)("In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.")))},{image:(0,s.createElement)(Go,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,y.__)("Make each block your own")),(0,s.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,y.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.")))},{image:(0,s.createElement)(Go,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,y.__)("Get to know the block library")),(0,s.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,u.createInterpolateElement)((0,y.__)("All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon."),{InserterIconImage:(0,s.createElement)("img",{alt:(0,y.__)("inserter"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"})})))},{image:(0,s.createElement)(Go,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,y.__)("Learn how to use the block editor")),(0,s.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,y.__)("New to the block editor? Want to learn more about using it? "),(0,s.createElement)(E.ExternalLink,{href:(0,y.__)("https://wordpress.org/documentation/article/wordpress-block-editor/")},(0,y.__)("Here's a detailed guide."))))}]})}function Ho(){const{toggleFeature:e}=(0,m.useDispatch)(pn);return(0,s.createElement)(E.Guide,{className:"edit-template-welcome-guide",contentLabel:(0,y.__)("Welcome to the template editor"),finishButtonText:(0,y.__)("Get started"),onFinish:()=>e("welcomeGuideTemplate"),pages:[{image:(0,s.createElement)(Go,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.gif"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,y.__)("Welcome to the template editor")),(0,s.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,y.__)("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 Uo(){const{isActive:e,isTemplateMode:t}=(0,m.useSelect)((e=>{const{isFeatureActive:t}=e(pn),{getRenderingMode:n}=e(b.store),o="template-only"===n();return{isActive:t(o?"welcomeGuideTemplate":"welcomeGuide"),isTemplateMode:o}}),[]);return e?t?(0,s.createElement)(Ho,null):(0,s.createElement)(zo,null):null}const{Fill:$o,Slot:Wo}=(0,E.createSlotFill)("PluginPostPublishPanel"),qo=({children:e,className:t,title:n,initialOpen:o=!1,icon:r})=>{const{icon:a}=(0,C.usePluginContext)();return(0,s.createElement)($o,null,(0,s.createElement)(E.PanelBody,{className:t,initialOpen:o||!n,title:n,icon:null!=r?r:a},e))};qo.Slot=Wo;var jo=qo;const{Fill:Qo,Slot:Yo}=(0,E.createSlotFill)("PluginPrePublishPanel"),Ko=({children:e,className:t,title:n,initialOpen:o=!1,icon:r})=>{const{icon:a}=(0,C.usePluginContext)();return(0,s.createElement)(Qo,null,(0,s.createElement)(E.PanelBody,{className:t,initialOpen:o||!n,title:n,icon:null!=r?r:a},e))};Ko.Slot=Yo;var Xo=Ko;const{Fill:Zo,Slot:Jo}=(0,E.createSlotFill)("ActionsPanel");function er({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n}){const{closePublishSidebar:o,togglePublishSidebar:r}=(0,m.useDispatch)(pn),{publishSidebarOpened:a,hasActiveMetaboxes:i,hasNonPostEntityChanges:l}=(0,m.useSelect)((e=>({publishSidebarOpened:e(pn).isPublishSidebarOpened(),hasActiveMetaboxes:e(pn).hasMetaBoxes(),hasNonPostEntityChanges:e(b.store).hasNonPostEntityChanges()})),[]),c=(0,u.useCallback)((()=>e(!0)),[]);let d;return d=a?(0,s.createElement)(b.PostPublishPanel,{onClose:o,forceIsDirty:i,PrePublishExtension:Xo.Slot,PostPublishExtension:jo.Slot}):l?(0,s.createElement)("div",{className:"edit-post-layout__toggle-entities-saved-states-panel"},(0,s.createElement)(E.Button,{variant:"secondary",className:"edit-post-layout__toggle-entities-saved-states-panel-button",onClick:c,"aria-expanded":!1},(0,y.__)("Open save panel"))):(0,s.createElement)("div",{className:"edit-post-layout__toggle-publish-panel"},(0,s.createElement)(E.Button,{variant:"secondary",className:"edit-post-layout__toggle-publish-panel-button",onClick:r,"aria-expanded":!1},(0,y.__)("Open publish panel"))),(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(b.EntitiesSavedStates,{close:t}),(0,s.createElement)(Jo,{bubblesVirtually:!0}),!n&&d)}function tr({blockPatterns:e,onChoosePattern:t}){const n=(0,v.useAsyncList)(e),{resetEditorBlocks:o}=(0,m.useDispatch)(b.store);return(0,s.createElement)(f.__experimentalBlockPatternsList,{blockPatterns:e,shownPatterns:n,onClickPattern:(e,n)=>{o(n),t()}})}function nr({onClose:e}){const t=function(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,m.useSelect)((e=>{const{getPatternsByBlockTypes:t}=e(f.store),{getCurrentPostType:n}=e(b.store);return{blockPatternsWithPostContentBlockType:t("core/post-content"),postType:n()}}),[]);return(0,u.useMemo)((()=>e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t)))),[t,e])}();return t.length>0?(0,s.createElement)(E.Modal,{className:"edit-post-start-page-options__modal",title:(0,y.__)("Choose a pattern"),isFullScreen:!0,onRequestClose:e},(0,s.createElement)("div",{className:"edit-post-start-page-options__modal-content"},(0,s.createElement)(tr,{blockPatterns:t,onChoosePattern:e}))):null}function or(){const[e,t]=(0,u.useState)(!1),n=(0,m.useSelect)((e=>{const{isCleanNewPost:t,getRenderingMode:n}=e(b.store),{isFeatureActive:o}=e(pn);return"post-only"===n()&&!o("welcomeGuide")&&t()}),[]);return!n||e?null:(0,s.createElement)(nr,{onClose:()=>t(!0)})}var rr=(0,s.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(P.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),ar=(0,s.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(P.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"})),sr=(0,s.createElement)(P.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(P.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})),ir=(0,s.createElement)(P.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(P.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"})),lr=(0,s.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(P.Path,{d:"m16 15.5h-8v-1.5h8zm-7.5-2.5h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm-9-3h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2z"}),(0,s.createElement)(P.Path,{d:"m18.5 6.5h-13a.5.5 0 0 0 -.5.5v9.5a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9.5a.5.5 0 0 0 -.5-.5zm-13-1.5h13a2 2 0 0 1 2 2v9.5a2 2 0 0 1 -2 2h-13a2 2 0 0 1 -2-2v-9.5a2 2 0 0 1 2-2z"})),cr=(0,s.createElement)(P.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(P.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}));const{getLayoutStyles:dr}=Lt(f.privateApis),{useCommands:ur}=Lt(qe.privateApis),{useCommandContext:mr}=Lt(We.privateApis),{InserterSidebar:pr,ListViewSidebar:hr}=Lt(b.privateApis),gr={
/* translators: accessibility text for the editor top bar landmark region. */
header:(0,y.__)("Editor top bar"),
/* translators: accessibility text for the editor content landmark region. */
body:(0,y.__)("Editor content"),
/* translators: accessibility text for the editor settings landmark region. */
sidebar:(0,y.__)("Editor settings"),
/* translators: accessibility text for the editor publish landmark region. */
actions:(0,y.__)("Editor publish"),
/* translators: accessibility text for the editor footer landmark region. */
footer:(0,y.__)("Editor footer")};var br=function(){ur(),function(){const{openGeneralSidebar:e,closeGeneralSidebar:t,switchEditorMode:n,toggleDistractionFree:o}=(0,m.useDispatch)(pn),{openModal:r}=(0,m.useDispatch)(te),{editorMode:a,activeSidebar:s,isListViewOpen:i,isPublishSidebarEnabled:l,showBlockBreadcrumbs:c,isDistractionFree:d}=(0,m.useSelect)((e=>{const{get:t}=e(h.store),{getEditorMode:n}=e(pn),{isListViewOpened:o}=e(b.store);return{activeSidebar:e(te).getActiveComplementaryArea(pn.name),editorMode:n(),isListViewOpen:o(),isPublishSidebarEnabled:e(b.store).isPublishSidebarEnabled(),showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),isDistractionFree:t("core","distractionFree")}}),[]),{toggle:u}=(0,m.useDispatch)(h.store),{createInfoNotice:p}=(0,m.useDispatch)(T.store),{__unstableSaveForPreview:g,setIsListViewOpened:_}=(0,m.useDispatch)(b.store),{getCurrentPostId:E}=(0,m.useSelect)(b.store);(0,We.useCommand)({name:"core/open-settings-sidebar",label:(0,y.__)("Toggle settings sidebar"),icon:(0,y.isRTL)()?oo:ro,callback:({close:n})=>{n(),"edit-post/document"===s?t():e("edit-post/document")}}),(0,We.useCommand)({name:"core/open-block-inspector",label:(0,y.__)("Toggle block inspector"),icon:rr,callback:({close:n})=>{n(),"edit-post/block"===s?t():e("edit-post/block")}}),(0,We.useCommand)({name:"core/toggle-distraction-free",label:(0,y.__)("Toggle distraction free"),callback:({close:e})=>{o(),e()}}),(0,We.useCommand)({name:"core/toggle-spotlight-mode",label:(0,y.__)("Toggle spotlight mode"),callback:({close:e})=>{u("core","focusMode"),e()}}),(0,We.useCommand)({name:"core/toggle-fullscreen-mode",label:(0,y.__)("Toggle fullscreen mode"),icon:ar,callback:({close:e})=>{u("core/edit-post","fullscreenMode"),e()}}),(0,We.useCommand)({name:"core/toggle-list-view",label:(0,y.__)("Toggle list view"),icon:sr,callback:({close:e})=>{_(!i),e()}}),(0,We.useCommand)({name:"core/toggle-top-toolbar",label:(0,y.__)("Toggle top toolbar"),callback:({close:e})=>{u("core","fixedToolbar"),d&&o(),e()}}),(0,We.useCommand)({name:"core/toggle-code-editor",label:(0,y.__)("Toggle code editor"),icon:ir,callback:({close:e})=>{n("visual"===a?"text":"visual"),e()}}),(0,We.useCommand)({name:"core/open-preferences",label:(0,y.__)("Editor preferences"),callback:()=>{r(In)}}),(0,We.useCommand)({name:"core/open-shortcut-help",label:(0,y.__)("Keyboard shortcuts"),icon:lr,callback:()=>{r(Le)}}),(0,We.useCommand)({name:"core/toggle-breadcrumbs",label:c?(0,y.__)("Hide block breadcrumbs"):(0,y.__)("Show block breadcrumbs"),callback:({close:e})=>{u("core","showBlockBreadcrumbs"),e(),p(c?(0,y.__)("Breadcrumbs hidden."):(0,y.__)("Breadcrumbs visible."),{id:"core/edit-post/toggle-breadcrumbs/notice",type:"snackbar"})}}),(0,We.useCommand)({name:"core/toggle-publish-sidebar",label:l?(0,y.__)("Disable pre-publish checks"):(0,y.__)("Enable pre-publish checks"),icon:cr,callback:({close:e})=>{e(),u("core/edit-post","isPublishSidebarEnabled"),p(l?(0,y.__)("Pre-publish checks disabled."):(0,y.__)("Pre-publish checks enabled."),{id:"core/edit-post/publish-sidebar/notice",type:"snackbar"})}}),(0,We.useCommand)({name:"core/preview-link",label:(0,y.__)("Preview in a new tab"),icon:B,callback:async({close:e})=>{e();const t=E(),n=await g();window.open(n,`wp-preview-${t}`)}})}(),(0,f.useBlockCommands)();const e=(0,v.useViewportMatch)("medium","<"),t=(0,v.useViewportMatch)("huge",">="),n=(0,v.useViewportMatch)("large"),o=(0,v.useViewportMatch)("medium"),{openGeneralSidebar:r,closeGeneralSidebar:a}=(0,m.useDispatch)(pn),{createErrorNotice:i}=(0,m.useDispatch)(T.store),{setIsInserterOpened:l}=(0,m.useDispatch)(b.store),{mode:c,isFullscreenActive:d,isRichEditingEnabled:p,sidebarIsOpened:g,hasActiveMetaboxes:_,previousShortcut:w,nextShortcut:S,hasBlockSelected:k,isInserterOpened:P,isListViewOpened:M,showIconLabels:x,isDistractionFree:A,showBlockBreadcrumbs:I,showMetaBoxes:L,documentLabel:D,hasHistory:F}=(0,m.useSelect)((e=>{const{get:t}=e(h.store),{getEditorSettings:n,getPostTypeLabel:o}=e(b.store),r=n(),a=o();return{showMetaBoxes:"post-only"===e(b.store).getRenderingMode(),sidebarIsOpened:!(!e(te).getActiveComplementaryArea(pn.name)&&!e(pn).isPublishSidebarOpened()),isFullscreenActive:e(pn).isFeatureActive("fullscreenMode"),isInserterOpened:e(b.store).isInserterOpened(),isListViewOpened:e(b.store).isListViewOpened(),mode:e(pn).getEditorMode(),isRichEditingEnabled:r.richEditingEnabled,hasActiveMetaboxes:e(pn).hasMetaBoxes(),previousShortcut:e(Te.store).getAllShortcutKeyCombinations("core/edit-post/previous-region"),nextShortcut:e(Te.store).getAllShortcutKeyCombinations("core/edit-post/next-region"),showIconLabels:t("core","showIconLabels"),isDistractionFree:t("core","distractionFree"),showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),
// translators: Default label for the Document in the Block Breadcrumb.
documentLabel:a||(0,y._x)("Document","noun"),hasBlockSelected:!!e(f.store).getBlockSelectionStart(),hasHistory:!!n().goBack}}),[]);mr(k?"block-selection-edit":"post-editor-edit");const R=function(){const{hasThemeStyleSupport:e,editorSettings:t}=(0,m.useSelect)((e=>({hasThemeStyleSupport:e(pn).isFeatureActive("themeStyles"),editorSettings:e(b.store).getEditorSettings()})),[]);return(0,u.useMemo)((()=>{var n,o;const r=null!==(n=t.styles?.filter((e=>e.__unstableType&&"theme"!==e.__unstableType)))&&void 0!==n?n:[],a=[...t.defaultEditorStyles,...r],s=e&&r.length!==(null!==(o=t.styles?.length)&&void 0!==o?o:0);return t.disableLayoutStyles||s||a.push({css:dr({style:{},selector:"body",hasBlockGapSupport:!1,hasFallbackGapSupport:!0,fallbackGapValue:"0.5em"})}),s?t.styles:a}),[t.defaultEditorStyles,t.disableLayoutStyles,t.styles,e])}();(0,u.useEffect)((()=>{g&&!t&&l(!1)}),[t,l,g]),(0,u.useEffect)((()=>{P&&!t&&a()}),[a,P,t]);const[O,V]=(0,u.useState)(!1),G=(0,u.useCallback)((e=>{"function"==typeof O&&O(e),V(!1)}),[O]);x?document.body.classList.add("show-icon-labels"):document.body.classList.remove("show-icon-labels");const z=N()("edit-post-layout","is-mode-"+c,{"is-sidebar-opened":g,"has-metaboxes":_,"is-distraction-free":A&&n,"is-entity-save-view-open":!!O}),H=M?(0,y.__)("Document Overview"):(0,y.__)("Block Library");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ge,{isActive:d}),(0,s.createElement)(Dn,{hasHistory:F}),(0,s.createElement)(b.UnsavedChangesWarning,null),(0,s.createElement)(b.AutosaveMonitor,null),(0,s.createElement)(b.LocalAutosaveMonitor,null),(0,s.createElement)(En,null),(0,s.createElement)(b.EditorKeyboardShortcutsRegister,null),(0,s.createElement)(b.EditorKeyboardShortcuts,null),(0,s.createElement)(Ee,{isDistractionFree:A&&n,className:z,labels:{...gr,secondarySidebar:H},header:(0,s.createElement)(no,{setEntitiesSavedStatesCallback:V}),editorNotices:(0,s.createElement)(b.EditorNotices,null),secondarySidebar:"visual"===c&&P?(0,s.createElement)(pr,null):"visual"===c&&M?(0,s.createElement)(hr,null):null,sidebar:(!e||g)&&(0,s.createElement)(s.Fragment,null,!e&&!g&&(0,s.createElement)("div",{className:"edit-post-layout__toggle-sidebar-panel"},(0,s.createElement)(E.Button,{variant:"secondary",className:"edit-post-layout__toggle-sidebar-panel-button",onClick:()=>r(k?"edit-post/block":"edit-post/document"),"aria-expanded":!1},k?(0,y.__)("Open block settings"):(0,y.__)("Open document settings"))),(0,s.createElement)(he.Slot,{scope:"core/edit-post"})),notices:(0,s.createElement)(b.EditorSnackbars,null),content:(0,s.createElement)(s.Fragment,null,!A&&(0,s.createElement)(b.EditorNotices,null),("text"===c||!p)&&(0,s.createElement)(hn,null),!o&&(0,s.createElement)(f.BlockToolbar,{hideDragHandle:!0}),p&&"visual"===c&&(0,s.createElement)(bn,{styles:R}),!A&&L&&(0,s.createElement)("div",{className:"edit-post-layout__metaboxes"},(0,s.createElement)(Co,{location:"normal"}),(0,s.createElement)(Co,{location:"advanced"})),e&&g&&(0,s.createElement)(E.ScrollLock,null)),footer:!A&&!e&&I&&p&&"visual"===c&&(0,s.createElement)("div",{className:"edit-post-layout__footer"},(0,s.createElement)(f.BlockBreadcrumb,{rootLabelText:D})),actions:(0,s.createElement)(er,{closeEntitiesSavedStates:G,isEntitiesSavedStatesOpen:O,setEntitiesSavedStatesCallback:V}),shortcuts:{previous:w,next:S}}),(0,s.createElement)(Nn,null),(0,s.createElement)(Oe,null),(0,s.createElement)(Uo,null),(0,s.createElement)(b.PostSyncStatusModal,null),(0,s.createElement)(or,null),(0,s.createElement)(C.PluginArea,{onError:function(e){i((0,y.sprintf)(/* translators: %s: plugin name */
(0,y.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}),(0,s.createElement)(Vo,null))};function _r({postId:e}){return(e=>{const{hasBlockSelection:t,isEditorSidebarOpened:n}=(0,m.useSelect)((e=>({hasBlockSelection:!!e(f.store).getBlockSelectionStart(),isEditorSidebarOpened:e(mn).isEditorSidebarOpened()})),[e]),{openGeneralSidebar:o}=(0,m.useDispatch)(mn);(0,u.useEffect)((()=>{n&&o(t?"edit-post/block":"edit-post/document")}),[t,n])})(e),(e=>{const{newPermalink:t}=(0,m.useSelect)((e=>({newPermalink:e(b.store).getCurrentPost().link})),[e]),n=(0,u.useRef)();(0,u.useEffect)((()=>{n.current=document.querySelector("#wp-admin-bar-preview a")||document.querySelector("#wp-admin-bar-view a")}),[e]),(0,u.useEffect)((()=>{t&&n.current&&n.current.setAttribute("href",t)}),[t])})(e),null}const{ExperimentalEditorProvider:Er}=Lt(b.privateApis);var fr=function({postId:e,postType:t,settings:n,initialEdits:o,...r}){const{currentPost:a,getPostLinkProps:l,goBack:c}=function(e,t){const[n,o]=(0,u.useReducer)(((e,{type:t,post:n})=>"push"===t?[...e,n]:"pop"===t&&e.length>1?e.slice(0,-1):e),[{postId:e,postType:t}]),r=(0,u.useCallback)((e=>{const t=(0,M.getQueryArgs)(window.location.href),n=(0,M.removeQueryArgs)(window.location.href,...Object.keys(t));return{href:(0,M.addQueryArgs)(n,{post:e.postId,action:"edit"}),onClick:t=>{t.preventDefault(),o({type:"push",post:{postId:e.postId,postType:e.postType}})}}}),[]),a=(0,u.useCallback)((()=>{o({type:"pop"})}),[]);return{currentPost:n[n.length-1],getPostLinkProps:r,goBack:n.length>1?a:void 0}}(e,t),{hasInlineToolbar:d,post:p,preferredStyleVariations:g,hiddenBlockTypes:_,blockTypes:f,template:y}=(0,m.useSelect)((e=>{var t;const{isFeatureActive:n,getEditedPostTemplate:o,getHiddenBlockTypes:r}=e(pn),{getEntityRecord:s,getPostType:l,getEntityRecords:c,canUser:d}=e(k.store),{getEditorSettings:u}=e(b.store),{getBlockTypes:m}=e(i.store);let p;if(["wp_template","wp_template_part"].includes(a.postType)){const e=c("postType",a.postType,{wp_id:a.postId});p=e?.[0]}else p=s("postType",a.postType,a.postId);const g=u().supportsTemplateMode,_=null!==(t=l(a.postType)?.viewable)&&void 0!==t&&t,E=d("create","templates");return{hasInlineToolbar:n("inlineToolbar"),preferredStyleVariations:e(h.store).get("core/edit-post","preferredStyleVariations"),hiddenBlockTypes:r(),blockTypes:m(),template:g&&_&&E?o():null,post:p}}),[a.postType,a.postId]),{updatePreferredStyleVariations:v}=(0,m.useDispatch)(pn),w=(0,u.useMemo)((()=>{const e={...n,getPostLinkProps:l,goBack:c,__experimentalPreferredStyleVariations:{value:g,onChange:v},hasInlineToolbar:d,defaultAllowedBlockTypes:n.allowedBlockTypes};if(_.length>0){const t=!0===n.allowedBlockTypes?f.map((({name:e})=>e)):n.allowedBlockTypes||[];e.allowedBlockTypes=t.filter((e=>!_.includes(e)))}return e}),[n,d,_,f,g,v,l,c]);return p?(0,s.createElement)(E.SlotFillProvider,null,(0,s.createElement)(Er,{settings:w,post:p,initialEdits:o,useSubRegistry:!1,__unstableTemplate:y,...r},(0,s.createElement)(b.ErrorBoundary,null,(0,s.createElement)(We.CommandMenu,null),(0,s.createElement)(_r,{postId:a.postId}),(0,s.createElement)(br,null)),(0,s.createElement)(b.PostLockedModal,null))):null},yr=({allowedBlocks:e,icon:t,label:n,onClick:o,small:r,role:a})=>(0,s.createElement)(f.BlockSettingsMenuControls,null,(({selectedBlocks:i,onClose:l})=>((e,t)=>{return!Array.isArray(t)||(n=t,0===e.filter((e=>!n.includes(e))).length);var n})(i,e)?(0,s.createElement)(E.MenuItem,{onClick:(0,v.compose)(o,l),icon:t,label:r?n:void 0,role:a},!r&&n):null)),vr=(0,v.compose)((0,C.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 wr(e){return(0,s.createElement)(ce,{__unstableExplicitMenuItem:!0,scope:"core/edit-post",...e})}const{PluginPostExcerpt:Sr}=Lt(b.privateApis);function kr(e,t,n,o,r){const a=document.getElementById(e),c=(0,u.createRoot)(a);return(0,m.dispatch)(h.store).setDefaults("core/edit-post",{editorMode:"visual",fullscreenMode:!0,hiddenBlockTypes:[],isPublishSidebarEnabled:!0,preferredStyleVariations:{},themeStyles:!0,welcomeGuide:!0,welcomeGuideTemplate:!0}),(0,m.dispatch)(h.store).setDefaults("core",{allowRightClickOverrides:!0,fixedToolbar:!1,inactivePanels:[],openPanels:["post-status"],showBlockBreadcrumbs:!0,showIconLabels:!1,showListViewByDefault:!1}),(0,m.dispatch)(i.store).reapplyBlockTypeFilters(),(0,m.select)(h.store).get("core","showListViewByDefault")&&!(0,m.select)(h.store).get("core","distractionFree")&&(0,m.dispatch)(b.store).setIsListViewOpened(!0),(0,l.registerCoreBlocks)(),(0,g.registerLegacyWidgetBlock)({inserter:!1}),(0,g.registerWidgetGroupBlock)({inserter:!1}),(0,l.__experimentalRegisterExperimentalCoreBlocks)({enableFSEBlocks:o.__unstableEnableFullSiteEditingBlocks}),(0,p.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((e,t)=>("post-only"!==(0,m.select)(b.store).getRenderingMode()||"core/template-part"!==t.name)&&e)),(0,p.addFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",((e,t,n,{getBlockParentsByBlockName:o})=>"post-only"===(0,m.select)(b.store).getRenderingMode()&&"core/post-content"===t.name?o(n,"core/query").length>0:e)),"Standards"!=("CSS1Compat"===document.compatMode?"Standards":"Quirks")&&console.warn("Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins."),-1!==window.navigator.userAgent.indexOf("iPhone")&&window.addEventListener("scroll",(e=>{const t=document.getElementsByClassName("interface-interface-skeleton__body")[0];e.target===document&&(window.scrollY>100&&(t.scrollTop=t.scrollTop+window.scrollY),document.getElementsByClassName("is-mode-visual")[0]&&window.scrollTo(0,0))})),window.addEventListener("dragover",(e=>e.preventDefault()),!1),window.addEventListener("drop",(e=>e.preventDefault()),!1),c.render((0,s.createElement)(fr,{settings:o,postId:n,postType:t,initialEdits:r})),c}function Pr(){d()("wp.editPost.reinitializeEditor",{since:"6.2",version:"6.3"})}}(),(window.wp=window.wp||{}).editPost=o}();
//# sourceMappingURL=index.min.js.map