WordPress/wp-includes/js/dist/edit-post.min.js

2 lines
39 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

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

/*! This file is auto-generated */
(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var o in s)e.o(s,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:s[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{PluginBlockSettingsMenuItem:()=>Gt,PluginDocumentSettingPanel:()=>Ut,PluginMoreMenuItem:()=>Ht,PluginPostPublishPanel:()=>qt,PluginPostStatusInfo:()=>Qt,PluginPrePublishPanel:()=>zt,PluginSidebar:()=>Wt,PluginSidebarMoreMenuItem:()=>$t,__experimentalFullscreenModeClose:()=>ze,__experimentalMainDashboardButton:()=>Zt,__experimentalPluginPostExcerpt:()=>Xt,initializeEditor:()=>Yt,reinitializeEditor:()=>Kt,store:()=>He});var s={};e.r(s),e.d(s,{__experimentalSetPreviewDeviceType:()=>ie,__unstableCreateTemplate:()=>ce,closeGeneralSidebar:()=>N,closeModal:()=>G,closePublishSidebar:()=>H,hideBlockTypes:()=>J,initializeMetaBoxes:()=>de,metaBoxUpdatesFailure:()=>oe,metaBoxUpdatesSuccess:()=>se,openGeneralSidebar:()=>L,openModal:()=>V,openPublishSidebar:()=>U,removeEditorPanel:()=>W,requestMetaBoxUpdates:()=>te,setAvailableMetaBoxesPerLocation:()=>ee,setIsEditingTemplate:()=>ae,setIsInserterOpened:()=>re,setIsListViewOpened:()=>ne,showBlockTypes:()=>K,switchEditorMode:()=>X,toggleDistractionFree:()=>pe,toggleEditorPanelEnabled:()=>q,toggleEditorPanelOpened:()=>Q,toggleFeature:()=>$,togglePinnedPluginItem:()=>Z,togglePublishSidebar:()=>z,updatePreferredStyleVariations:()=>Y});var o={};e.r(o),e.d(o,{__experimentalGetInsertionPoint:()=>Le,__experimentalGetPreviewDeviceType:()=>De,areMetaBoxesInitialized:()=>Ge,getActiveGeneralSidebarName:()=>_e,getActiveMetaBoxLocations:()=>ke,getAllMetaBoxes:()=>Re,getEditedPostTemplate:()=>Ue,getEditorMode:()=>he,getHiddenBlockTypes:()=>ve,getMetaBoxesPerLocation:()=>Ae,getPreference:()=>fe,getPreferences:()=>be,hasMetaBoxes:()=>Ce,isEditingTemplate:()=>Ve,isEditorPanelEnabled:()=>Pe,isEditorPanelOpened:()=>Ee,isEditorPanelRemoved:()=>Se,isEditorSidebarOpened:()=>we,isFeatureActive:()=>Te,isInserterOpened:()=>Fe,isListViewOpened:()=>Ne,isMetaBoxLocationActive:()=>Ie,isMetaBoxLocationVisible:()=>je,isModalActive:()=>Me,isPluginItemPinned:()=>Be,isPluginSidebarOpened:()=>ye,isPublishSidebarOpened:()=>xe,isSavingMetaBoxes:()=>Oe});const i=window.wp.blocks,r=window.wp.blockLibrary,n=window.wp.deprecated;var a=e.n(n);const c=window.wp.element,l=window.wp.data,d=window.wp.preferences,p=window.wp.widgets,u=window.wp.editor,g=window.wp.components,m=window.wp.coreData,h=window.wp.commands;function w(e){var t,s,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(s=w(e[t]))&&(o&&(o+=" "),o+=s)}else for(s in e)e[s]&&(o&&(o+=" "),o+=s);return o}const y=function(){for(var e,t,s=0,o="",i=arguments.length;s<i;s++)(e=arguments[s])&&(t=w(e))&&(o&&(o+=" "),o+=t);return o},_=window.wp.blockEditor,b=window.wp.compose,f=window.wp.plugins,v=window.wp.i18n,x=window.wp.notices,S=window.wp.coreCommands,P=window.wp.url,E=window.wp.primitives,M=window.ReactJSXRuntime,T=(0,M.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,M.jsx)(E.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"})});function B(e=[],t){const s=[...e];for(const e of t){const t=s.findIndex((t=>t.id===e.id));-1!==t?s[t]=e:s.push(e)}return s}const k=(0,l.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 s={...e};for(const[e,o]of Object.entries(t.metaBoxesPerLocation))s[e]=B(s[e],o);return s}return e},initialized:function(e=!1,t){return"META_BOXES_INITIALIZED"===t.type||e}}),j=(0,l.combineReducers)({metaBoxes:k}),I=window.wp.apiFetch;var A=e.n(I);const R=window.wp.hooks,C=window.wp.privateApis,{lock:O,unlock:D}=(0,C.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/edit-post"),{interfaceStore:F}=D(u.privateApis),L=e=>({registry:t})=>{t.dispatch(F).enableComplementaryArea("core",e)},N=()=>({registry:e})=>e.dispatch(F).disableComplementaryArea("core"),V=e=>({registry:t})=>(a()("select( 'core/edit-post' ).openModal( name )",{since:"6.3",alternative:"select( 'core/interface').openModal( name )"}),t.dispatch(F).openModal(e)),G=()=>({registry:e})=>(a()("select( 'core/edit-post' ).closeModal()",{since:"6.3",alternative:"select( 'core/interface').closeModal()"}),e.dispatch(F).closeModal()),U=()=>({registry:e})=>{a()("dispatch( 'core/edit-post' ).openPublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').openPublishSidebar"}),e.dispatch(u.store).openPublishSidebar()},H=()=>({registry:e})=>{a()("dispatch( 'core/edit-post' ).closePublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').closePublishSidebar"}),e.dispatch(u.store).closePublishSidebar()},z=()=>({registry:e})=>{a()("dispatch( 'core/edit-post' ).togglePublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').togglePublishSidebar"}),e.dispatch(u.store).togglePublishSidebar()},q=e=>({registry:t})=>{a()("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelEnabled"}),t.dispatch(u.store).toggleEditorPanelEnabled(e)},Q=e=>({registry:t})=>{a()("dispatch( 'core/edit-post' ).toggleEditorPanelOpened",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelOpened"}),t.dispatch(u.store).toggleEditorPanelOpened(e)},W=e=>({registry:t})=>{a()("dispatch( 'core/edit-post' ).removeEditorPanel",{since:"6.5",alternative:"dispatch( 'core/editor').removeEditorPanel"}),t.dispatch(u.store).removeEditorPanel(e)},$=e=>({registry:t})=>t.dispatch(d.store).toggle("core/edit-post",e),X=e=>({registry:t})=>{a()("dispatch( 'core/edit-post' ).switchEditorMode",{since:"6.6",alternative:"dispatch( 'core/editor').switchEditorMode"}),t.dispatch(u.store).switchEditorMode(e)},Z=e=>({registry:t})=>{const s=t.select(F).isItemPinned("core",e);t.dispatch(F)[s?"unpinItem":"pinItem"]("core",e)};function Y(){return a()("dispatch( 'core/edit-post' ).updatePreferredStyleVariations",{since:"6.6",hint:"Preferred Style Variations are not supported anymore."}),{type:"NOTHING"}}const K=e=>({registry:t})=>{D(t.dispatch(u.store)).showBlockTypes(e)},J=e=>({registry:t})=>{D(t.dispatch(u.store)).hideBlockTypes(e)};function ee(e){return{type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e}}const te=()=>async({registry:e,select:t,dispatch:s})=>{s({type:"REQUEST_META_BOX_UPDATES"}),window.tinyMCE&&window.tinyMCE.triggerSave();const o=e.select(u.store).getCurrentPost(),i=[!!o.comment_status&&["comment_status",o.comment_status],!!o.ping_status&&["ping_status",o.ping_status],!!o.sticky&&["sticky",o.sticky],!!o.author&&["post_author",o.author]].filter(Boolean),r=[new window.FormData(document.querySelector(".metabox-base-form")),...t.getActiveMetaBoxLocations().map((e=>new window.FormData((e=>{const t=document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`);return t||document.querySelector("#metaboxes .metabox-location-"+e)})(e))))].reduce(((e,t)=>{for(const[s,o]of t)e.append(s,o);return e}),new window.FormData);i.forEach((([e,t])=>r.append(e,t)));try{await A()({url:window._wpMetaBoxUrl,method:"POST",body:r,parse:!1}),s.metaBoxUpdatesSuccess()}catch{s.metaBoxUpdatesFailure()}};function se(){return{type:"META_BOX_UPDATES_SUCCESS"}}function oe(){return{type:"META_BOX_UPDATES_FAILURE"}}const ie=e=>({registry:t})=>{a()("dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType",{since:"6.5",version:"6.7",hint:"registry.dispatch( editorStore ).setDeviceType"}),t.dispatch(u.store).setDeviceType(e)},re=e=>({registry:t})=>{a()("dispatch( 'core/edit-post' ).setIsInserterOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsInserterOpened"}),t.dispatch(u.store).setIsInserterOpened(e)},ne=e=>({registry:t})=>{a()("dispatch( 'core/edit-post' ).setIsListViewOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsListViewOpened"}),t.dispatch(u.store).setIsListViewOpened(e)};function ae(){return a()("dispatch( 'core/edit-post' ).setIsEditingTemplate",{since:"6.5",alternative:"dispatch( 'core/editor').setRenderingMode"}),{type:"NOTHING"}}function ce(){return a()("dispatch( 'core/edit-post' ).__unstableCreateTemplate",{since:"6.5"}),{type:"NOTHING"}}let le=!1;const de=()=>({registry:e,select:t,dispatch:s})=>{if(!e.select(u.store).__unstableIsEditorReady())return;if(le)return;const o=e.select(u.store).getCurrentPostType();window.postboxes.page!==o&&window.postboxes.add_postbox_toggles(o),le=!0,(0,R.addFilter)("editor.__unstableSavePost","core/edit-post/save-metaboxes",((e,o)=>e.then((()=>{if(!o.isAutosave&&t.hasMetaBoxes())return s.requestMetaBoxUpdates()})))),s({type:"META_BOXES_INITIALIZED"})},pe=()=>({registry:e})=>{a()("dispatch( 'core/edit-post' ).toggleDistractionFree",{since:"6.6",alternative:"dispatch( 'core/editor').toggleDistractionFree"}),e.dispatch(u.store).toggleDistractionFree()},{interfaceStore:ue}=D(u.privateApis),ge=[],me={},he=(0,l.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(d.store).get("core","editorMode"))&&void 0!==t?t:"visual"})),we=(0,l.createRegistrySelector)((e=>()=>{const t=e(ue).getActiveComplementaryArea("core");return["edit-post/document","edit-post/block"].includes(t)})),ye=(0,l.createRegistrySelector)((e=>()=>{const t=e(ue).getActiveComplementaryArea("core");return!!t&&!["edit-post/document","edit-post/block"].includes(t)})),_e=(0,l.createRegistrySelector)((e=>()=>e(ue).getActiveComplementaryArea("core")));const be=(0,l.createRegistrySelector)((e=>()=>{a()("select( 'core/edit-post' ).getPreferences",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const t=["editorMode","hiddenBlockTypes"].reduce(((t,s)=>({...t,[s]:e(d.store).get("core",s)})),{}),s=function(e,t){var s;const o=e?.reduce(((e,t)=>({...e,[t]:{enabled:!1}})),{}),i=t?.reduce(((e,t)=>{const s=e?.[t];return{...e,[t]:{...s,opened:!0}}}),null!=o?o:{});return null!==(s=null!=i?i:o)&&void 0!==s?s:me}(e(d.store).get("core","inactivePanels"),e(d.store).get("core","openPanels"));return{...t,panels:s}}));function fe(e,t,s){a()("select( 'core/edit-post' ).getPreference",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const o=be(e)[t];return void 0===o?s:o}const ve=(0,l.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(d.store).get("core","hiddenBlockTypes"))&&void 0!==t?t:ge})),xe=(0,l.createRegistrySelector)((e=>()=>(a()("select( 'core/edit-post' ).isPublishSidebarOpened",{since:"6.6",alternative:"select( 'core/editor' ).isPublishSidebarOpened"}),e(u.store).isPublishSidebarOpened()))),Se=(0,l.createRegistrySelector)((e=>(t,s)=>(a()("select( 'core/edit-post' ).isEditorPanelRemoved",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelRemoved"}),e(u.store).isEditorPanelRemoved(s)))),Pe=(0,l.createRegistrySelector)((e=>(t,s)=>(a()("select( 'core/edit-post' ).isEditorPanelEnabled",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelEnabled"}),e(u.store).isEditorPanelEnabled(s)))),Ee=(0,l.createRegistrySelector)((e=>(t,s)=>(a()("select( 'core/edit-post' ).isEditorPanelOpened",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelOpened"}),e(u.store).isEditorPanelOpened(s)))),Me=(0,l.createRegistrySelector)((e=>(t,s)=>(a()("select( 'core/edit-post' ).isModalActive",{since:"6.3",alternative:"select( 'core/interface' ).isModalActive"}),!!e(ue).isModalActive(s)))),Te=(0,l.createRegistrySelector)((e=>(t,s)=>!!e(d.store).get("core/edit-post",s))),Be=(0,l.createRegistrySelector)((e=>(t,s)=>e(ue).isItemPinned("core",s))),ke=(0,l.createSelector)((e=>Object.keys(e.metaBoxes.locations).filter((t=>Ie(e,t)))),(e=>[e.metaBoxes.locations])),je=(0,l.createRegistrySelector)((e=>(t,s)=>Ie(t,s)&&Ae(t,s)?.some((({id:s})=>e(u.store).isEditorPanelEnabled(t,`meta-box-${s}`)))));function Ie(e,t){const s=Ae(e,t);return!!s&&0!==s.length}function Ae(e,t){return e.metaBoxes.locations[t]}const Re=(0,l.createSelector)((e=>Object.values(e.metaBoxes.locations).flat()),(e=>[e.metaBoxes.locations]));function Ce(e){return ke(e).length>0}function Oe(e){return e.metaBoxes.isSaving}const De=(0,l.createRegistrySelector)((e=>()=>(a()("select( 'core/edit-site' ).__experimentalGetPreviewDeviceType",{since:"6.5",version:"6.7",alternative:"select( 'core/editor' ).getDeviceType"}),e(u.store).getDeviceType()))),Fe=(0,l.createRegistrySelector)((e=>()=>(a()("select( 'core/edit-post' ).isInserterOpened",{since:"6.5",alternative:"select( 'core/editor' ).isInserterOpened"}),e(u.store).isInserterOpened()))),Le=(0,l.createRegistrySelector)((e=>()=>(a()("select( 'core/edit-post' ).__experimentalGetInsertionPoint",{since:"6.5",version:"6.7"}),D(e(u.store)).getInsertionPoint()))),Ne=(0,l.createRegistrySelector)((e=>()=>(a()("select( 'core/edit-post' ).isListViewOpened",{since:"6.5",alternative:"select( 'core/editor' ).isListViewOpened"}),e(u.store).isListViewOpened()))),Ve=(0,l.createRegistrySelector)((e=>()=>(a()("select( 'core/edit-post' ).isEditingTemplate",{since:"6.5",alternative:"select( 'core/editor' ).getRenderingMode"}),"wp_template"===e(u.store).getCurrentPostType())));function Ge(e){return e.metaBoxes.initialized}const Ue=(0,l.createRegistrySelector)((e=>()=>{const{id:t,type:s,slug:o}=e(u.store).getCurrentPost(),{getSite:i,getEditedEntityRecord:r,getEntityRecords:n}=e(m.store),a=i();if(+t===a?.page_for_posts){return r("postType","wp_template",e(m.store).getDefaultTemplateId({slug:"home"}))}const c=e(u.store).getEditedPostAttribute("template");if(c){const e=n("postType","wp_template",{per_page:-1})?.find((e=>e.slug===c));return e?r("postType","wp_template",e.id):e}let l;l=o?"page"===s?`${s}-${o}`:`single-${s}-${o}`:"page"===s?"page":`single-${s}`;const d=e(m.store).getDefaultTemplateId({slug:l});return d?e(m.store).getEditedEntityRecord("postType","wp_template",d):null})),He=(0,l.createReduxStore)("core/edit-post",{reducer:j,actions:s,selectors:o});(0,l.register)(He);const ze=function({showTooltip:e,icon:t,href:s,initialPost:o}){var i;const{isActive:r,isRequestingSiteIcon:n,postType:a,siteIconUrl:c}=(0,l.useSelect)((e=>{const{getCurrentPostType:t}=e(u.store),{isFeatureActive:s}=e(He),{getEntityRecord:i,getPostType:r,isResolving:n}=e(m.store),a=i("root","__unstableBase",void 0)||{},c=o?.type||t();return{isActive:s("fullscreenMode"),isRequestingSiteIcon:n("getEntityRecord",["root","__unstableBase",void 0]),postType:r(c),siteIconUrl:a.site_icon_url}}),[]),d=(0,b.useReducedMotion)();if(!r||!a)return null;let p=(0,M.jsx)(g.Icon,{size:"36px",icon:T});const h={expand:{scale:1.25,transition:{type:"tween",duration:"0.3"}}};c&&(p=(0,M.jsx)(g.__unstableMotion.img,{variants:!d&&h,alt:(0,v.__)("Site Icon"),className:"edit-post-fullscreen-mode-close_site-icon",src:c})),n&&(p=null),t&&(p=(0,M.jsx)(g.Icon,{size:"36px",icon:t}));const w=y({"edit-post-fullscreen-mode-close":!0,"has-icon":c}),_=null!=s?s:(0,P.addQueryArgs)("edit.php",{post_type:a.slug}),f=null!==(i=a?.labels?.view_items)&&void 0!==i?i:(0,v.__)("Back");return(0,M.jsx)(g.__unstableMotion.div,{whileHover:"expand",children:(0,M.jsx)(g.Button,{className:w,href:_,label:f,showTooltip:e,children:p})})},{BackButton:qe}=D(u.privateApis),Qe={hidden:{x:"-100%"},distractionFreeInactive:{x:0},hover:{x:0,transition:{type:"tween",delay:.2}}};const We=function({initialPost:e}){return(0,M.jsx)(qe,{children:(0,M.jsx)(g.__unstableMotion.div,{variants:Qe,transition:{type:"tween",delay:.8},children:(0,M.jsx)(ze,{showTooltip:!0,initialPost:e})})})},$e=window.wp.keyboardShortcuts;const Xe=function(){const{toggleFeature:e}=(0,l.useDispatch)(He),{registerShortcut:t}=(0,l.useDispatch)($e.store);return(0,c.useEffect)((()=>{t({name:"core/edit-post/toggle-fullscreen",category:"global",description:(0,v.__)("Toggle fullscreen mode."),keyCombination:{modifier:"secondary",character:"f"}})}),[]),(0,$e.useShortcut)("core/edit-post/toggle-fullscreen",(()=>{e("fullscreenMode")})),null},{ReusableBlocksRenameHint:Ze}=D(_.privateApis);function Ye(){const{editPost:e}=(0,l.useDispatch)(u.store),[t,s]=(0,c.useState)(!1),[o,i]=(0,c.useState)(void 0),[r,n]=(0,c.useState)(""),{postType:a,isNewPost:d}=(0,l.useSelect)((e=>{const{getEditedPostAttribute:t,isCleanNewPost:s}=e(u.store);return{postType:t("type"),isNewPost:s()}}),[]);return(0,c.useEffect)((()=>{d&&"wp_block"===a&&s(!0)}),[]),"wp_block"===a&&d?(0,M.jsx)(M.Fragment,{children:t&&(0,M.jsx)(g.Modal,{title:(0,v.__)("Create pattern"),onRequestClose:()=>{s(!1)},overlayClassName:"reusable-blocks-menu-items__convert-modal",children:(0,M.jsx)("form",{onSubmit:t=>{t.preventDefault(),s(!1),e({title:r,meta:{wp_pattern_sync_status:o}})},children:(0,M.jsxs)(g.__experimentalVStack,{spacing:"5",children:[(0,M.jsx)(g.TextControl,{label:(0,v.__)("Name"),value:r,onChange:n,placeholder:(0,v.__)("My pattern"),className:"patterns-create-modal__name-input",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,M.jsx)(Ze,{}),(0,M.jsx)(g.ToggleControl,{label:(0,v._x)("Synced","Option that makes an individual pattern synchronized"),help:(0,v.__)("Sync this pattern across multiple locations."),checked:!o,onChange:()=>{i(o?void 0:"unsynced")}}),(0,M.jsx)(g.__experimentalHStack,{justify:"right",children:(0,M.jsx)(g.Button,{variant:"primary",type:"submit",disabled:!r,__experimentalIsFocusable:!0,children:(0,v.__)("Create")})})]})})})}):null}class Ke extends c.Component{constructor(){super(...arguments),this.state={historyId:null}}componentDidUpdate(e){const{postId:t,postStatus:s,postType:o,isSavingPost:i,hasHistory:r}=this.props,{historyId:n}=this.state;"trash"!==s||i?t===e.postId&&t===n||"auto-draft"===s||!t||r||this.setBrowserURL(t):this.setTrashURL(t,o)}setTrashURL(e,t){window.location.href=function(e,t){return(0,P.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,P.addQueryArgs)("post.php",{post:e,action:"edit"})}(e)),this.setState((()=>({historyId:e})))}render(){return null}}const Je=(0,l.withSelect)((e=>{const{getCurrentPost:t,isSavingPost:s}=e(u.store),o=t();let{id:i,status:r,type:n}=o;return["wp_template","wp_template_part"].includes(n)&&(i=o.wp_id),{postId:i,postStatus:r,postType:n,isSavingPost:s()}}))(Ke);const et=function({location:e}){const t=(0,c.useRef)(null),s=(0,c.useRef)(null);(0,c.useEffect)((()=>(s.current=document.querySelector(".metabox-location-"+e),s.current&&t.current.appendChild(s.current),()=>{s.current&&document.querySelector("#metaboxes").appendChild(s.current)})),[e]);const o=(0,l.useSelect)((e=>e(He).isSavingMetaBoxes()),[]),i=y("edit-post-meta-boxes-area",`is-${e}`,{"is-loading":o});return(0,M.jsxs)("div",{className:i,children:[o&&(0,M.jsx)(g.Spinner,{}),(0,M.jsx)("div",{className:"edit-post-meta-boxes-area__container",ref:t}),(0,M.jsx)("div",{className:"edit-post-meta-boxes-area__clear"})]})};class tt extends c.Component{componentDidMount(){this.updateDOM()}componentDidUpdate(e){this.props.isVisible!==e.isVisible&&this.updateDOM()}updateDOM(){const{id:e,isVisible:t}=this.props,s=document.getElementById(e);s&&(t?s.classList.remove("is-hidden"):s.classList.add("is-hidden"))}render(){return null}}const st=(0,l.withSelect)(((e,{id:t})=>({isVisible:e(u.store).isEditorPanelEnabled(`meta-box-${t}`)})))(tt);function ot({location:e}){const t=(0,l.useRegistry)(),{metaBoxes:s,areMetaBoxesInitialized:o,isEditorReady:i}=(0,l.useSelect)((t=>{const{__unstableIsEditorReady:s}=t(u.store),{getMetaBoxesPerLocation:o,areMetaBoxesInitialized:i}=t(He);return{metaBoxes:o(e),areMetaBoxesInitialized:i(),isEditorReady:s()}}),[e]),r=!!s?.length;return(0,c.useEffect)((()=>{i&&r&&!o&&t.dispatch(He).initializeMetaBoxes()}),[i,r,o]),o?(0,M.jsxs)(M.Fragment,{children:[(null!=s?s:[]).map((({id:e})=>(0,M.jsx)(st,{id:e},e))),(0,M.jsx)(et,{location:e})]}):null}const it=window.wp.keycodes;const rt=function(){const e=(0,l.useSelect)((e=>{const{canUser:t}=e(m.store),s=(0,P.addQueryArgs)("edit.php",{post_type:"wp_block"}),o=(0,P.addQueryArgs)("site-editor.php",{path:"/patterns"});return t("create","templates")?o:s}),[]);return(0,M.jsx)(g.MenuItem,{role:"menuitem",href:e,children:(0,v.__)("Manage patterns")})};function nt(){const e=(0,l.useSelect)((e=>"wp_template"===e(u.store).getCurrentPostType()),[]);return(0,M.jsx)(d.PreferenceToggleMenuItem,{scope:"core/edit-post",name:e?"welcomeGuideTemplate":"welcomeGuide",label:(0,v.__)("Welcome Guide")})}const{PreferenceBaseOption:at}=D(d.privateApis);function ct({willEnable:e}){const[t,s]=(0,c.useState)(!1);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("p",{className:"edit-post-preferences-modal__custom-fields-confirmation-message",children:(0,v.__)("A page reload is required for this change. Make sure your content is saved before reloading.")}),(0,M.jsx)(g.Button,{className:"edit-post-preferences-modal__custom-fields-confirmation-button",variant:"secondary",isBusy:t,disabled:t,onClick:()=>{s(!0),function(){const e=document.getElementById("toggle-custom-fields-form");e.querySelector('[name="_wp_http_referer"]').setAttribute("value",(0,P.getPathAndQueryString)(window.location.href)),e.submit()}()},children:e?(0,v.__)("Show & Reload Page"):(0,v.__)("Hide & Reload Page")})]})}const lt=(0,l.withSelect)((e=>({areCustomFieldsEnabled:!!e(u.store).getEditorSettings().enableCustomFields})))((function({label:e,areCustomFieldsEnabled:t}){const[s,o]=(0,c.useState)(t);return(0,M.jsx)(at,{label:e,isChecked:s,onChange:o,children:s!==t&&(0,M.jsx)(ct,{willEnable:s})})})),{PreferenceBaseOption:dt}=D(d.privateApis),pt=(0,b.compose)((0,l.withSelect)(((e,{panelName:t})=>{const{isEditorPanelEnabled:s,isEditorPanelRemoved:o}=e(u.store);return{isRemoved:o(t),isChecked:s(t)}})),(0,b.ifCondition)((({isRemoved:e})=>!e)),(0,l.withDispatch)(((e,{panelName:t})=>({onChange:()=>e(u.store).toggleEditorPanelEnabled(t)}))))(dt),{PreferencesModalSection:ut}=D(d.privateApis);const gt=(0,l.withSelect)((e=>{const{getEditorSettings:t}=e(u.store),{getAllMetaBoxes:s}=e(He);return{areCustomFieldsRegistered:void 0!==t().enableCustomFields,metaBoxes:s()}}))((function({areCustomFieldsRegistered:e,metaBoxes:t,...s}){const o=t.filter((({id:e})=>"postcustom"!==e));return e||0!==o.length?(0,M.jsxs)(ut,{...s,children:[e&&(0,M.jsx)(lt,{label:(0,v.__)("Custom fields")}),o.map((({id:e,title:t})=>(0,M.jsx)(pt,{label:t,panelName:`meta-box-${e}`},e)))]}):null})),{PreferenceToggleControl:mt}=D(d.privateApis),{PreferencesModal:ht}=D(u.privateApis);function wt(){const e={general:(0,M.jsx)(gt,{title:(0,v.__)("Advanced")}),appearance:(0,M.jsx)(mt,{scope:"core/edit-post",featureName:"themeStyles",help:(0,v.__)("Make the editor look like your theme."),label:(0,v.__)("Use theme styles")})};return(0,M.jsx)(ht,{extraSections:e})}const{ToolsMoreMenuGroup:yt,ViewMoreMenuGroup:_t}=D(u.privateApis),bt=()=>{const e=(0,b.useViewportMatch)("large");return(0,M.jsxs)(M.Fragment,{children:[e&&(0,M.jsx)(_t,{children:(0,M.jsx)(d.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fullscreenMode",label:(0,v.__)("Fullscreen mode"),info:(0,v.__)("Show and hide the admin user interface"),messageActivated:(0,v.__)("Fullscreen mode activated"),messageDeactivated:(0,v.__)("Fullscreen mode deactivated"),shortcut:it.displayShortcut.secondary("f")})}),(0,M.jsxs)(yt,{children:[(0,M.jsx)(rt,{}),(0,M.jsx)(nt,{})]}),(0,M.jsx)(wt,{})]})};function ft({nonAnimatedSrc:e,animatedSrc:t}){return(0,M.jsxs)("picture",{className:"edit-post-welcome-guide__image",children:[(0,M.jsx)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,M.jsx)("img",{src:t,width:"312",height:"240",alt:""})]})}function vt(){const{toggleFeature:e}=(0,l.useDispatch)(He);return(0,M.jsx)(g.Guide,{className:"edit-post-welcome-guide",contentLabel:(0,v.__)("Welcome to the block editor"),finishButtonText:(0,v.__)("Get started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,M.jsx)(ft,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,v.__)("Welcome to the block editor")}),(0,M.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,v.__)("In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.")})]})},{image:(0,M.jsx)(ft,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,v.__)("Make each block your own")}),(0,M.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,v.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.")})]})},{image:(0,M.jsx)(ft,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,v.__)("Get to know the block library")}),(0,M.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,c.createInterpolateElement)((0,v.__)("All of the blocks available to you live in the block library. Youll find it wherever you see the <InserterIconImage /> icon."),{InserterIconImage:(0,M.jsx)("img",{alt:(0,v.__)("inserter"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"})})})]})},{image:(0,M.jsx)(ft,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,v.__)("Learn how to use the block editor")}),(0,M.jsxs)("p",{className:"edit-post-welcome-guide__text",children:[(0,v.__)("New to the block editor? Want to learn more about using it? "),(0,M.jsx)(g.ExternalLink,{href:(0,v.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),children:(0,v.__)("Here's a detailed guide.")})]})]})}]})}function xt(){const{toggleFeature:e}=(0,l.useDispatch)(He);return(0,M.jsx)(g.Guide,{className:"edit-template-welcome-guide",contentLabel:(0,v.__)("Welcome to the template editor"),finishButtonText:(0,v.__)("Get started"),onFinish:()=>e("welcomeGuideTemplate"),pages:[{image:(0,M.jsx)(ft,{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,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,v.__)("Welcome to the template editor")}),(0,M.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,v.__)("Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.")})]})}]})}function St(){const{isActive:e,isEditingTemplate:t}=(0,l.useSelect)((e=>{const{isFeatureActive:t}=e(He),{getCurrentPostType:s}=e(u.store),o="wp_template"===s();return{isActive:t(o?"welcomeGuideTemplate":"welcomeGuide"),isEditingTemplate:o}}),[]);return e?t?(0,M.jsx)(xt,{}):(0,M.jsx)(vt,{}):null}const Pt=(0,M.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,M.jsx)(E.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"})});const Et=!1;const{getLayoutStyles:Mt}=D(_.privateApis),{useCommands:Tt}=D(S.privateApis),{useCommandContext:Bt}=D(h.privateApis),{EditorInterface:kt,FullscreenMode:jt,Sidebar:It}=D(u.privateApis),{BlockKeyboardShortcuts:At}=D(r.privateApis),Rt=["wp_template","wp_template_part","wp_block","wp_navigation"];const Ct=function({initialPost:e}){Tt(),function(){const{isFullscreen:e}=(0,l.useSelect)((e=>{const{get:t}=e(d.store);return{isFullscreen:t("core/edit-post","fullscreenMode")}}),[]),{toggle:t}=(0,l.useDispatch)(d.store),{createInfoNotice:s}=(0,l.useDispatch)(x.store);(0,h.useCommand)({name:"core/toggle-fullscreen-mode",label:e?(0,v.__)("Exit fullscreen"):(0,v.__)("Enter fullscreen"),icon:Pt,callback:({close:o})=>{t("core/edit-post","fullscreenMode"),o(),s(e?(0,v.__)("Fullscreen off."):(0,v.__)("Fullscreen on."),{id:"core/edit-post/toggle-fullscreen-mode/notice",type:"snackbar",actions:[{label:(0,v.__)("Undo"),onClick:()=>{t("core/edit-post","fullscreenMode")}}]})}})}();const t=(0,b.useViewportMatch)("large"),s=function(){const e=(0,l.useRegistry)();return(0,b.useRefEffect)((t=>{function s(s){if(s.target!==t)return;const{ownerDocument:o}=t,{defaultView:r}=o;if(!r.parseInt(r.getComputedStyle(t).paddingBottom,10))return;const n=t.lastElementChild;if(!n)return;const a=n.getBoundingClientRect();if(s.clientY<a.bottom)return;s.preventDefault();const c=e.select(_.store).getBlockOrder(""),l=c[c.length-1];if(!l)return;const d=e.select(_.store).getBlock(l),{selectBlock:p,insertDefaultBlock:u}=e.dispatch(_.store);(0,i.isUnmodifiedDefaultBlock)(d)?p(l):u()}return t.addEventListener("mousedown",s),()=>{t.removeEventListener("mousedown",s)}}),[e])}(),o=function(){const{isBlockBasedTheme:e,hasV3BlocksOnly:t,isEditingTemplate:s,hasMetaBoxes:o}=(0,l.useSelect)((e=>{const{getEditorSettings:t,getCurrentPostType:s}=e(u.store),{getBlockTypes:o}=e(i.store);return{isBlockBasedTheme:t().__unstableIsBlockBasedTheme,hasV3BlocksOnly:o().every((e=>e.apiVersion>=3)),isEditingTemplate:"wp_template"===s(),hasMetaBoxes:e(He).hasMetaBoxes()}}),[]);return(t||Et&&e)&&!o||s}(),{createErrorNotice:r}=(0,l.useDispatch)(x.store),{mode:n,isFullscreenActive:a,sidebarIsOpened:p,hasActiveMetaboxes:g,hasBlockSelected:m,showIconLabels:w,isDistractionFree:S,showBlockBreadcrumbs:E,showMetaBoxes:T,hasHistory:B,isEditingTemplate:k,isWelcomeGuideVisible:j}=(0,l.useSelect)((e=>{const{get:t}=e(d.store),{getEditorSettings:s}=e(u.store),{isFeatureActive:o}=e(He);return{mode:e(u.store).getEditorMode(),isFullscreenActive:e(He).isFeatureActive("fullscreenMode"),hasActiveMetaboxes:e(He).hasMetaBoxes(),hasBlockSelected:!!e(_.store).getBlockSelectionStart(),showIconLabels:t("core","showIconLabels"),isDistractionFree:t("core","distractionFree"),showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),showMetaBoxes:"post-only"===e(u.store).getRenderingMode(),hasHistory:!!s().onNavigateToPreviousEntityRecord,isEditingTemplate:"wp_template"===e(u.store).getCurrentPostType(),isWelcomeGuideVisible:o("welcomeGuide")}}),[]);Bt(m?"block-selection-edit":"entity-edit");const I=function(){const{hasThemeStyleSupport:e,editorSettings:t,isZoomedOutView:s,hasMetaBoxes:o,renderingMode:i,postType:r}=(0,l.useSelect)((e=>{const{__unstableGetEditorMode:t}=e(_.store),{getCurrentPostType:s,getRenderingMode:o}=e(u.store),i=s();return{hasThemeStyleSupport:e(He).isFeatureActive("themeStyles"),editorSettings:e(u.store).getEditorSettings(),isZoomedOutView:"zoom-out"===t(),hasMetaBoxes:e(He).hasMetaBoxes(),renderingMode:o(),postType:i}}),[]);return(0,c.useMemo)((()=>{var n,a,c;const l=null!==(n=t.styles?.filter((e=>e.__unstableType&&"theme"!==e.__unstableType)))&&void 0!==n?n:[],d=[...t.defaultEditorStyles,...l],p=e&&l.length!==(null!==(a=t.styles?.length)&&void 0!==a?a:0);t.disableLayoutStyles||p||d.push({css:Mt({style:{},selector:"body",hasBlockGapSupport:!1,hasFallbackGapSupport:!0,fallbackGapValue:"0.5em"})});const u=p?null!==(c=t.styles)&&void 0!==c?c:[]:d;return s||o||"post-only"!==i||Rt.includes(r)||u.push({css:"body{padding-bottom: 40vh}"}),u}),[t.defaultEditorStyles,t.disableLayoutStyles,t.styles,e])}();w?document.body.classList.add("show-icon-labels"):document.body.classList.remove("show-icon-labels");const A=y("edit-post-layout","is-mode-"+n,{"is-sidebar-opened":p,"has-metaboxes":g,"is-distraction-free":S&&t,"has-block-breadcrumbs":E&&!S&&t}),{createSuccessNotice:R}=(0,l.useDispatch)(x.store),C=(0,c.useCallback)(((e,t)=>{switch(e){case"move-to-trash":document.location.href=(0,P.addQueryArgs)("edit.php",{trashed:1,post_type:t[0].type,ids:t[0].id});break;case"duplicate-post":{const e=t[0],s="string"==typeof e.title?e.title:e.title?.rendered;R((0,v.sprintf)((0,v.__)('"%s" successfully created.'),s),{type:"snackbar",id:"duplicate-post-action",actions:[{label:(0,v.__)("Edit"),onClick:()=>{const t=e.id;document.location.href=(0,P.addQueryArgs)("post.php",{post:t,action:"edit"})}}]})}}}),[R]);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(jt,{isActive:a}),(0,M.jsx)(Je,{hasHistory:B}),(0,M.jsx)(u.UnsavedChangesWarning,{}),(0,M.jsx)(u.AutosaveMonitor,{}),(0,M.jsx)(u.LocalAutosaveMonitor,{}),(0,M.jsx)(Xe,{}),(0,M.jsx)(u.EditorKeyboardShortcutsRegister,{}),(0,M.jsx)(At,{}),(0,M.jsx)(St,{}),(0,M.jsx)(Ye,{}),(0,M.jsx)(f.PluginArea,{onError:function(e){r((0,v.sprintf)((0,v.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}),!S&&(0,M.jsx)(It,{onActionPerformed:C,extraPanels:!k&&(0,M.jsx)(ot,{location:"side"})}),(0,M.jsx)(bt,{}),(0,M.jsx)(We,{initialPost:e}),(0,M.jsx)(u.EditorSnackbars,{}),(0,M.jsx)(kt,{className:A,styles:I,forceIsDirty:g,contentRef:s,disableIframe:!o,autoFocus:!j,children:!S&&T&&(0,M.jsxs)("div",{className:"edit-post-layout__metaboxes",children:[(0,M.jsx)(ot,{location:"normal"}),(0,M.jsx)(ot,{location:"advanced"})]})})]})},Ot=()=>{const{newPermalink:e}=(0,l.useSelect)((e=>({newPermalink:e(u.store).getCurrentPost().link})),[]),t=(0,c.useRef)();(0,c.useEffect)((()=>{t.current=document.querySelector("#wp-admin-bar-preview a")||document.querySelector("#wp-admin-bar-view a")}),[]),(0,c.useEffect)((()=>{e&&t.current&&t.current.setAttribute("href",e)}),[e])};function Dt(){return Ot(),null}const{ExperimentalEditorProvider:Ft}=D(u.privateApis);const Lt=function({postId:e,postType:t,settings:s,initialEdits:o,...i}){const{currentPost:r,onNavigateToEntityRecord:n,onNavigateToPreviousEntityRecord:a}=function(e,t,s){const[o,i]=(0,c.useReducer)(((e,{type:t,post:s,previousRenderingMode:o})=>"push"===t?[...e,{post:s,previousRenderingMode:o}]:"pop"===t&&e.length>1?e.slice(0,-1):e),[{post:{postId:e,postType:t}}]),{post:r,previousRenderingMode:n}=o[o.length-1],{getRenderingMode:a}=(0,l.useSelect)(u.store),{setRenderingMode:d}=(0,l.useDispatch)(u.store),p=(0,c.useCallback)((e=>{i({type:"push",post:{postId:e.postId,postType:e.postType},previousRenderingMode:a()}),d(s)}),[a,d,s]),g=(0,c.useCallback)((()=>{i({type:"pop"}),n&&d(n)}),[d,n]);return{currentPost:r,onNavigateToEntityRecord:p,onNavigateToPreviousEntityRecord:o.length>1?g:void 0}}(e,t,"post-only"),{post:d,template:p}=(0,l.useSelect)((e=>{var t;const{getEditedPostTemplate:s}=e(He),{getEntityRecord:o,getPostType:i,canUser:n}=e(m.store),{getEditorSettings:a}=e(u.store),c=o("postType",r.postType,r.postId),l=a().supportsTemplateMode,d=null!==(t=i(r.postType)?.viewable)&&void 0!==t&&t,p=n("read","templates");return{template:l&&d&&p&&"wp_template"!==r.postType?s():null,post:c}}),[r.postType,r.postId]),w=(0,c.useMemo)((()=>({...s,onNavigateToEntityRecord:n,onNavigateToPreviousEntityRecord:a,defaultRenderingMode:"post-only"})),[s,n,a]),y=(0,c.useMemo)((()=>({type:t,id:e})),[t,e]);return d?(0,M.jsx)(g.SlotFillProvider,{children:(0,M.jsxs)(Ft,{settings:w,post:d,initialEdits:o,useSubRegistry:!1,__unstableTemplate:p,...i,children:[(0,M.jsxs)(u.ErrorBoundary,{children:[(0,M.jsx)(h.CommandMenu,{}),(0,M.jsx)(Dt,{}),(0,M.jsx)(Ct,{initialPost:y})]}),(0,M.jsx)(u.PostLockedModal,{})]})}):null},{PluginPostExcerpt:Nt}=D(u.privateApis),Vt=e=>{a()(`wp.editPost.${e}`,{since:"6.6",alternative:`wp.editor.${e}`})};function Gt(e){return Vt("PluginBlockSettingsMenuItem"),(0,M.jsx)(u.PluginBlockSettingsMenuItem,{...e})}function Ut(e){return Vt("PluginDocumentSettingPanel"),(0,M.jsx)(u.PluginDocumentSettingPanel,{...e})}function Ht(e){return Vt("PluginMoreMenuItem"),(0,M.jsx)(u.PluginMoreMenuItem,{...e})}function zt(e){return Vt("PluginPrePublishPanel"),(0,M.jsx)(u.PluginPrePublishPanel,{...e})}function qt(e){return Vt("PluginPostPublishPanel"),(0,M.jsx)(u.PluginPostPublishPanel,{...e})}function Qt(e){return Vt("PluginPostStatusInfo"),(0,M.jsx)(u.PluginPostStatusInfo,{...e})}function Wt(e){return Vt("PluginSidebar"),(0,M.jsx)(u.PluginSidebar,{...e})}function $t(e){return Vt("PluginSidebarMoreMenuItem"),(0,M.jsx)(u.PluginSidebarMoreMenuItem,{...e})}function Xt(){return a()("wp.editPost.__experimentalPluginPostExcerpt",{since:"6.6",hint:"Core and custom panels can be access programmatically using their panel name.",link:"https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically"}),Nt}const{BackButton:Zt}=D(u.privateApis);function Yt(e,t,s,o,n){const a=window.matchMedia("(min-width: 782px)").matches,g=document.getElementById(e),m=(0,c.createRoot)(g);(0,l.dispatch)(d.store).setDefaults("core/edit-post",{fullscreenMode:!0,themeStyles:!0,welcomeGuide:!0,welcomeGuideTemplate:!0}),(0,l.dispatch)(d.store).setDefaults("core",{allowRightClickOverrides:!0,editorMode:"visual",fixedToolbar:!1,hiddenBlockTypes:[],inactivePanels:[],openPanels:["post-status"],showBlockBreadcrumbs:!0,showIconLabels:!1,showListViewByDefault:!1,isPublishSidebarEnabled:!0}),(0,l.dispatch)(i.store).reapplyBlockTypeFilters(),a&&(0,l.select)(d.store).get("core","showListViewByDefault")&&!(0,l.select)(d.store).get("core","distractionFree")&&(0,l.dispatch)(u.store).setIsListViewOpened(!0),(0,r.registerCoreBlocks)(),(0,p.registerLegacyWidgetBlock)({inserter:!1}),(0,p.registerWidgetGroupBlock)({inserter:!1});"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),m.render((0,M.jsx)(Lt,{settings:o,postId:s,postType:t,initialEdits:n})),m}function Kt(){a()("wp.editPost.reinitializeEditor",{since:"6.2",version:"6.3"})}(window.wp=window.wp||{}).editPost=t})();