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