/*! This file is auto-generated */ !function(){var e={6411:function(e,t){var n,r,o; /*! autosize 4.0.4 license: MIT http://www.jacklmoore.com/autosize */r=[e,t],n=function(e,t){"use strict";var n,r,o="function"==typeof Map?new Map:(n=[],r=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return r[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),r.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),r.splice(t,1))}}),i=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){i=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function s(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var t=null,n=null,r=null,s=function(){e.clientWidth!==n&&p()},a=function(t){window.removeEventListener("resize",s,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",p,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),o.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",p,!1),window.addEventListener("resize",s,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:a,update:p}),l()}function l(){var n=window.getComputedStyle(e,null);"vertical"===n.resize?e.style.resize="none":"both"===n.resize&&(e.style.resize="horizontal"),t="content-box"===n.boxSizing?-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function d(){if(0!==e.scrollHeight){var r=u(e),o=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,r.forEach((function(e){e.node.scrollTop=e.scrollTop})),o&&(document.documentElement.scrollTop=o)}}function p(){d();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),o="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(o()=>e(s.store).hasUndo())),M=(0,i.createRegistrySelector)((e=>()=>e(s.store).hasRedo()));function F(e){return"auto-draft"===W(e).status}function z(e){return"content"in q(e)}const H=(0,i.createRegistrySelector)((e=>t=>{const n=$(t),r=G(t);return!!e(s.store).hasEditsForEntityRecord("postType",n,r)})),V=(0,i.createRegistrySelector)((e=>t=>{const n=e(s.store).__experimentalGetDirtyEntityRecords(),{type:r,id:o}=W(t);return n.some((e=>"postType"!==e.kind||e.name!==r||e.key!==o))}));function j(e){return!H(e)&&F(e)}const W=(0,i.createRegistrySelector)((e=>t=>{const n=G(t),r=$(t),o=e(s.store).getRawEntityRecord("postType",r,n);return o||L}));function $(e){return e.postType}function G(e){return e.postId}function K(e){var t;return null!==(t=W(e)._links?.["version-history"]?.[0]?.count)&&void 0!==t?t:0}function Y(e){var t;return null!==(t=W(e)._links?.["predecessor-version"]?.[0]?.id)&&void 0!==t?t:null}const q=(0,i.createRegistrySelector)((e=>t=>{const n=$(t),r=G(t);return e(s.store).getEntityRecordEdits("postType",n,r)||L}));function Q(e,t){switch(t){case"type":return $(e);case"id":return G(e);default:const n=W(e);if(!n.hasOwnProperty(t))break;return d(n[t])}}const X=f(((e,t)=>{const n=q(e);return n.hasOwnProperty(t)?{...Q(e,t),...n[t]}:Q(e,t)}),((e,t)=>[Q(e,t),q(e)[t]]));function Z(e,t){if("content"===t)return ye(e);const n=q(e);return n.hasOwnProperty(t)?P.has(t)?X(e,t):n[t]:Q(e,t)}const J=(0,i.createRegistrySelector)((e=>(t,n)=>{if(!A.includes(n)&&"preview_link"!==n)return;const r=$(t),o=G(t),i=e(s.store).getCurrentUser()?.id,a=e(s.store).getAutosave(r,o,i);return a?d(a[n]):void 0}));function ee(e){if("private"===Z(e,"status"))return"private";return Z(e,"password")?"password":"public"}function te(e){return"pending"===W(e).status}function ne(e,t){const n=t||W(e);return-1!==["publish","private"].indexOf(n.status)||"future"===n.status&&!(0,v.isInTheFuture)(new Date(Number((0,v.getDate)(n.date))-B))}function re(e){return"future"===W(e).status&&!ne(e)}function oe(e){const t=W(e);return H(e)||-1===["publish","private","future"].indexOf(t.status)}function ie(e){return!de(e)&&(!!Z(e,"title")||!!Z(e,"excerpt")||!se(e)||"native"===o.Platform.OS)}const se=(0,i.createRegistrySelector)((e=>t=>{const n=G(t),r=$(t),o=e(s.store).getEditedEntityRecord("postType",r,n);if("function"!=typeof o.content)return!o.content;const i=Z(t,"blocks");if(0===i.length)return!0;if(i.length>1)return!1;const a=i[0].name;return(a===(0,_.getDefaultBlockName)()||a===(0,_.getFreeformContentHandlerName)())&&!ye(t)})),ae=(0,i.createRegistrySelector)((e=>t=>{if(!ie(t))return!1;if(Te(t))return!1;const n=$(t),r=G(t),o=e(s.store).hasFetchedAutosaves(n,r),i=e(s.store).getCurrentUser()?.id,a=e(s.store).getAutosave(n,r,i);return!!o&&(!a||(!!z(t)||["title","excerpt","meta"].some((e=>d(a[e])!==Z(t,e)))))}));function le(e){const t=Z(e,"date"),n=new Date(Number((0,v.getDate)(t))-B);return(0,v.isInTheFuture)(n)}function ce(e){const t=Z(e,"date"),n=Z(e,"modified"),r=W(e).status;return("draft"===r||"auto-draft"===r||"pending"===r)&&(t===n||null===t)}function ue(e){return!!e.deleting.pending}function de(e){return!!e.saving.pending}const pe=(0,i.createRegistrySelector)((e=>t=>{const n=e(s.store).__experimentalGetEntitiesBeingSaved(),{type:r,id:o}=W(t);return n.some((e=>"postType"!==e.kind||e.name!==r||e.key!==o))})),me=(0,i.createRegistrySelector)((e=>t=>{const n=$(t),r=G(t);return!e(s.store).getLastEntitySaveError("postType",n,r)})),he=(0,i.createRegistrySelector)((e=>t=>{const n=$(t),r=G(t);return!!e(s.store).getLastEntitySaveError("postType",n,r)}));function ge(e){return de(e)&&Boolean(e.saving.options?.isAutosave)}function fe(e){return de(e)&&Boolean(e.saving.options?.isPreview)}function _e(e){if(e.saving.pending||de(e))return;let t=J(e,"preview_link");t&&"draft"!==W(e).status||(t=Z(e,"link"),t&&(t=(0,y.addQueryArgs)(t,{preview:!0})));const n=Z(e,"featured_media");return t&&n?(0,y.addQueryArgs)(t,{_thumbnail_id:n}):t}function ve(e){const t=De(e);if(t.length>2)return null;let n;if(1===t.length&&(n=t[0].name,"core/embed"===n)){const e=t[0].attributes?.providerNameSlug;["youtube","vimeo"].includes(e)?n="core/video":["spotify","soundcloud"].includes(e)&&(n="core/audio")}switch(2===t.length&&"core/paragraph"===t[1].name&&(n=t[0].name),n){case"core/image":return"image";case"core/quote":case"core/pullquote":return"quote";case"core/gallery":return"gallery";case"core/video":return"video";case"core/audio":return"audio";default:return null}}const ye=(0,i.createRegistrySelector)((e=>t=>{const n=G(t),r=$(t),o=e(s.store).getEditedEntityRecord("postType",r,n);if(o){if("function"==typeof o.content)return o.content(o);if(o.blocks)return(0,_.__unstableSerializeAndClean)(o.blocks);if(o.content)return o.content}return""}));function be(e){return de(e)&&!ne(e)&&"publish"===Z(e,"status")}function Ee(e){const t=Z(e,"permalink_template");return x.test(t)}function Se(e){const t=ke(e);if(!t)return null;const{prefix:n,postName:r,suffix:o}=t;return Ee(e)?n+r+o:n}function we(e){return Z(e,"slug")||(0,y.cleanForSlug)(Z(e,"title"))||G(e)}function ke(e){const t=Z(e,"permalink_template");if(!t)return null;const n=Z(e,"slug")||Z(e,"generated_slug"),[r,o]=t.split(x);return{prefix:r,postName:n,suffix:o}}function Pe(e){return e.postLock.isLocked}function Ce(e){return Object.keys(e.postSavingLock).length>0}function Te(e){return Object.keys(e.postAutosavingLock).length>0}function xe(e){return e.postLock.isTakeover}function Be(e){return e.postLock.user}function Ae(e){return e.postLock.activePostLock}function Ie(e){return Boolean(W(e)._links?.hasOwnProperty("wp:action-unfiltered-html"))}const Ne=(0,i.createRegistrySelector)((e=>()=>!!e(k.store).get("core/edit-post","isPublishSidebarEnabled"))),De=f((e=>Z(e,"blocks")||(0,_.parse)(ye(e))),(e=>[Z(e,"blocks"),ye(e)]));function Re(e){return E()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),Z(e,"selection")?.selectionStart}function Oe(e){return E()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),Z(e,"selection")?.selectionEnd}function Le(e){return Z(e,"selection")}function Ue(e){return e.isReady}function Me(e){return e.editorSettings}function Fe(){return E()("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function ze(){return E()("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function He(e){return(0,i.createRegistrySelector)((t=>(n,...r)=>(E()("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`",version:"6.2"}),t(c.store)[e](...r))))}const Ve=He("getBlockName"),je=He("isBlockValid"),We=He("getBlockAttributes"),$e=He("getBlock"),Ge=He("getBlocks"),Ke=He("getClientIdsOfDescendants"),Ye=He("getClientIdsWithDescendants"),qe=He("getGlobalBlockCount"),Qe=He("getBlocksByClientId"),Xe=He("getBlockCount"),Ze=He("getBlockSelectionStart"),Je=He("getBlockSelectionEnd"),et=He("getSelectedBlockCount"),tt=He("hasSelectedBlock"),nt=He("getSelectedBlockClientId"),rt=He("getSelectedBlock"),ot=He("getBlockRootClientId"),it=He("getBlockHierarchyRootClientId"),st=He("getAdjacentBlockClientId"),at=He("getPreviousBlockClientId"),lt=He("getNextBlockClientId"),ct=He("getSelectedBlocksInitialCaretPosition"),ut=He("getMultiSelectedBlockClientIds"),dt=He("getMultiSelectedBlocks"),pt=He("getFirstMultiSelectedBlockClientId"),mt=He("getLastMultiSelectedBlockClientId"),ht=He("isFirstMultiSelectedBlock"),gt=He("isBlockMultiSelected"),ft=He("isAncestorMultiSelected"),_t=He("getMultiSelectedBlocksStartClientId"),vt=He("getMultiSelectedBlocksEndClientId"),yt=He("getBlockOrder"),bt=He("getBlockIndex"),Et=He("isBlockSelected"),St=He("hasSelectedInnerBlock"),wt=He("isBlockWithinSelection"),kt=He("hasMultiSelection"),Pt=He("isMultiSelecting"),Ct=He("isSelectionEnabled"),Tt=He("getBlockMode"),xt=He("isTyping"),Bt=He("isCaretWithinFormattedText"),At=He("getBlockInsertionPoint"),It=He("isBlockInsertionPointVisible"),Nt=He("isValidTemplate"),Dt=He("getTemplate"),Rt=He("getTemplateLock"),Ot=He("canInsertBlockType"),Lt=He("getInserterItems"),Ut=He("hasInserterItems"),Mt=He("getBlockListSettings");function Ft(e){return Me(e)?.defaultTemplateTypes}const zt=f((e=>{const t=Me(e)?.defaultTemplatePartAreas||[];return t?.map((e=>({...e,icon:O(e.icon)})))}),(e=>[Me(e)?.defaultTemplatePartAreas])),Ht=f(((e,t)=>{var n;const r=Ft(e);return r&&null!==(n=Object.values(r).find((e=>e.slug===t)))&&void 0!==n?n:L}),((e,t)=>[Ft(e),t]));function Vt(e,t){if(!t)return L;const{description:n,slug:r,title:o,area:i}=t,{title:s,description:a}=Ht(e,r),l="string"==typeof o?o:o?.rendered;return{title:l&&l!==r?l:s||r,description:("string"==typeof n?n:n?.raw)||a,icon:zt(e).find((e=>i===e.area))?.icon||w}}const jt=(0,i.createRegistrySelector)((e=>t=>{const n=$(t),r=e(s.store).getPostType(n);return r?.labels?.singular_name}));var Wt=window.wp.apiFetch,$t=n.n(Wt),Gt=window.wp.notices;function Kt(e,t){return`wp-autosave-block-editor-post-${t?"auto-draft":e}`}function Yt(e,t){window.sessionStorage.removeItem(Kt(e,t))}var qt=window.wp.i18n;const Qt=(e,t,n)=>({dispatch:r})=>{r.setupEditorState(e);if("auto-draft"===e.status&&n){let o;o="content"in t?t.content:e.content.raw;let i=(0,_.parse)(o);i=(0,_.synchronizeBlocksWithTemplate)(i,n),r.resetEditorBlocks(i,{__unstableShouldCreateUndoLevel:!1})}t&&Object.values(t).some((([t,n])=>{var r;return n!==(null!==(r=e[t]?.raw)&&void 0!==r?r:e[t])}))&&r.editPost(t)};function Xt(){return{type:"TEAR_DOWN_EDITOR"}}function Zt(){return E()("wp.data.dispatch( 'core/editor' ).resetPost",{since:"6.0",version:"6.3",alternative:"Initialize the editor with the setupEditorState action"}),{type:"DO_NOTHING"}}function Jt(){return E()("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function en(e){return{type:"SETUP_EDITOR_STATE",post:e}}const tn=(e,t)=>({select:n,registry:r})=>{const{id:o,type:i}=n.getCurrentPost();r.dispatch(s.store).editEntityRecord("postType",i,o,e,t)},nn=(e={})=>async({select:t,dispatch:n,registry:r})=>{if(!t.isEditedPostSaveable())return;const o=t.getEditedPostContent();e.isAutosave||n.editPost({content:o},{undoIgnore:!0});const i=t.getCurrentPost(),a={id:i.id,...r.select(s.store).getEntityRecordNonTransientEdits("postType",i.type,i.id),content:o};n({type:"REQUEST_POST_UPDATE_START",options:e}),await r.dispatch(s.store).saveEntityRecord("postType",i.type,a,e);let u=r.select(s.store).getLastEntitySaveError("postType",i.type,i.id);if(u||await(0,l.applyFilters)("editor.__unstableSavePost",Promise.resolve(),e).catch((e=>{u=e})),n({type:"REQUEST_POST_UPDATE_FINISH",options:e}),u){const e=function(e){const{post:t,edits:n,error:r}=e;if(r&&"rest_autosave_no_changes"===r.code)return[];const o=["publish","private","future"],i=-1!==o.indexOf(t.status),s={publish:(0,qt.__)("Publishing failed."),private:(0,qt.__)("Publishing failed."),future:(0,qt.__)("Scheduling failed.")};let a=i||-1===o.indexOf(n.status)?(0,qt.__)("Updating failed."):s[n.status];return r.message&&!/<\/?[^>]*>/.test(r.message)&&(a=[a,r.message].join(" ")),[a,{id:C}]}({post:i,edits:a,error:u});e.length&&r.dispatch(Gt.store).createErrorNotice(...e)}else{const n=t.getCurrentPost(),o=function(e){var t;const{previousPost:n,post:r,postType:o}=e;if(e.options?.isAutosave)return[];if("trash"===r.status&&"trash"!==n.status)return[];const i=["publish","private","future"],s=i.includes(n.status),a=i.includes(r.status);let l,c,u=null!==(t=o?.viewable)&&void 0!==t&&t;s||a?s&&!a?(l=o.labels.item_reverted_to_draft,u=!1):l=!s&&a?{publish:o.labels.item_published,private:o.labels.item_published_privately,future:o.labels.item_scheduled}[r.status]:o.labels.item_updated:(l=(0,qt.__)("Draft saved."),c=!0);const d=[];return u&&d.push({label:c?(0,qt.__)("View Preview"):o.labels.view_item,url:r.link}),[l,{id:C,type:"snackbar",actions:d}]}({previousPost:i,post:n,postType:await r.resolveSelect(s.store).getPostType(n.type),options:e});o.length&&r.dispatch(Gt.store).createSuccessNotice(...o),e.isAutosave||r.dispatch(c.store).__unstableMarkLastChangeAsPersistent()}};function rn(){return E()("wp.data.dispatch( 'core/editor' ).refreshPost",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}const on=()=>async({select:e,dispatch:t,registry:n})=>{const r=e.getCurrentPostType(),o=await n.resolveSelect(s.store).getPostType(r);n.dispatch(Gt.store).removeNotice(T);const{rest_base:i,rest_namespace:a="wp/v2"}=o;t({type:"REQUEST_POST_DELETE_START"});try{const n=e.getCurrentPost();await $t()({path:`/${a}/${i}/${n.id}`,method:"DELETE"}),await t.savePost()}catch(e){n.dispatch(Gt.store).createErrorNotice(...(l={error:e},[l.error.message&&"unknown_error"!==l.error.code?l.error.message:(0,qt.__)("Trashing failed"),{id:T}]))}var l;t({type:"REQUEST_POST_DELETE_FINISH"})},sn=({local:e=!1,...t}={})=>async({select:n,dispatch:r})=>{if(e){const e=n.getCurrentPost(),t=n.isEditedPostNew(),r=n.getEditedPostAttribute("title"),o=n.getEditedPostAttribute("content"),i=n.getEditedPostAttribute("excerpt");!function(e,t,n,r,o){window.sessionStorage.setItem(Kt(e,t),JSON.stringify({post_title:n,content:r,excerpt:o}))}(e.id,t,r,o,i)}else await r.savePost({isAutosave:!0,...t})},an=({forceIsAutosaveable:e}={})=>async({select:t,dispatch:n})=>{if((e||t.isEditedPostAutosaveable())&&!t.isPostLocked()){["draft","auto-draft"].includes(t.getEditedPostAttribute("status"))?await n.savePost({isPreview:!0}):await n.autosave({isPreview:!0})}return t.getEditedPostPreviewLink()},ln=()=>({registry:e})=>{e.dispatch(s.store).redo()},cn=()=>({registry:e})=>{e.dispatch(s.store).undo()};function un(){return E()("wp.data.dispatch( 'core/editor' ).createUndoLevel",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function dn(e){return{type:"UPDATE_POST_LOCK",lock:e}}const pn=()=>({registry:e})=>{e.dispatch(k.store).set("core/edit-post","isPublishSidebarEnabled",!0)},mn=()=>({registry:e})=>{e.dispatch(k.store).set("core/edit-post","isPublishSidebarEnabled",!1)};function hn(e){return{type:"LOCK_POST_SAVING",lockName:e}}function gn(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function fn(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function _n(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}const vn=(e,t={})=>({select:n,dispatch:r,registry:o})=>{const{__unstableShouldCreateUndoLevel:i,selection:a}=t,l={blocks:e,selection:a};if(!1!==i){const{id:e,type:t}=n.getCurrentPost();if(o.select(s.store).getEditedEntityRecord("postType",t,e).blocks===l.blocks)return void o.dispatch(s.store).__unstableCreateUndoLevel("postType",t,e);l.content=({blocks:e=[]})=>(0,_.__unstableSerializeAndClean)(e)}r.editPost(l)};function yn(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const bn=e=>(...t)=>({registry:n})=>{E()("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`",version:"6.2"}),n.dispatch(c.store)[e](...t)},En=bn("resetBlocks"),Sn=bn("receiveBlocks"),wn=bn("updateBlock"),kn=bn("updateBlockAttributes"),Pn=bn("selectBlock"),Cn=bn("startMultiSelect"),Tn=bn("stopMultiSelect"),xn=bn("multiSelect"),Bn=bn("clearSelectedBlock"),An=bn("toggleSelection"),In=bn("replaceBlocks"),Nn=bn("replaceBlock"),Dn=bn("moveBlocksDown"),Rn=bn("moveBlocksUp"),On=bn("moveBlockToPosition"),Ln=bn("insertBlock"),Un=bn("insertBlocks"),Mn=bn("showInsertionPoint"),Fn=bn("hideInsertionPoint"),zn=bn("setTemplateValidity"),Hn=bn("synchronizeTemplate"),Vn=bn("mergeBlocks"),jn=bn("removeBlocks"),Wn=bn("removeBlock"),$n=bn("toggleBlockMode"),Gn=bn("startTyping"),Kn=bn("stopTyping"),Yn=bn("enterFormattedText"),qn=bn("exitFormattedText"),Qn=bn("insertDefaultBlock"),Xn=bn("updateBlockListSettings"),Zn={reducer:p,selectors:e,actions:t},Jn=(0,i.createReduxStore)("core/editor",{...Zn});(0,i.register)(Jn);function er(e){const t=e.avatar_urls&&e.avatar_urls[24]?(0,o.createElement)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):(0,o.createElement)("span",{className:"editor-autocompleters__no-avatar"});return(0,o.createElement)(o.Fragment,null,t,(0,o.createElement)("span",{className:"editor-autocompleters__user-name"},e.name),(0,o.createElement)("span",{className:"editor-autocompleters__user-slug"},e.slug))}(0,l.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",(function(e){var t;const n=Object.fromEntries(Object.entries(null!==(t=e.attributes)&&void 0!==t?t:{}).filter((([,{source:e}])=>"meta"===e)).map((([e,{meta:t}])=>[e,t])));return Object.entries(n).length&&(e.edit=(e=>(0,a.createHigherOrderComponent)((t=>({attributes:n,setAttributes:r,...a})=>{const l=(0,i.useSelect)((e=>e(Jn).getCurrentPostType()),[]),[c,u]=(0,s.useEntityProp)("postType",l,"meta"),d=(0,o.useMemo)((()=>({...n,...Object.fromEntries(Object.entries(e).map((([e,t])=>[e,c[t]])))})),[n,c]);return(0,o.createElement)(t,{attributes:d,setAttributes:t=>{const n=Object.fromEntries(Object.entries(null!=t?t:{}).filter((([t])=>t in e)).map((([t,n])=>[e[t],n])));Object.entries(n).length&&u(n),r(t)},...a})}),"withMetaAttributeSource"))(n)(e.edit)),e}));var tr={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=(0,i.useSelect)((t=>{const{getUsers:n}=t(s.store);return n({context:"view",search:encodeURIComponent(e)})}),[e]),n=(0,o.useMemo)((()=>t?t.map((e=>({key:`user-${e.slug}`,value:e,label:er(e)}))):[]),[t]);return[n]},getOptionCompletion(e){return`@${e.slug}`}};(0,l.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(e=[]){return e.push({...tr}),e}));var nr=window.wp.keyboardShortcuts;function rr(){const{redo:e,undo:t,savePost:n}=(0,i.useDispatch)(Jn),{isEditedPostDirty:r,isPostSavingLocked:o}=(0,i.useSelect)(Jn);return(0,nr.useShortcut)("core/editor/undo",(e=>{t(),e.preventDefault()})),(0,nr.useShortcut)("core/editor/redo",(t=>{e(),t.preventDefault()})),(0,nr.useShortcut)("core/editor/save",(e=>{e.preventDefault(),o()||r()&&n()})),null}class or extends o.Component{constructor(e){super(e),this.needsAutosave=!(!e.isDirty||!e.isAutosaveable)}componentDidMount(){this.props.disableIntervalChecks||this.setAutosaveTimer()}componentDidUpdate(e){this.props.disableIntervalChecks?this.props.editsReference!==e.editsReference&&this.props.autosave():(this.props.interval!==e.interval&&(clearTimeout(this.timerId),this.setAutosaveTimer()),this.props.isDirty&&(!this.props.isAutosaving||e.isAutosaving)?this.props.editsReference!==e.editsReference&&(this.needsAutosave=!0):this.needsAutosave=!1)}componentWillUnmount(){clearTimeout(this.timerId)}setAutosaveTimer(e=1e3*this.props.interval){this.timerId=setTimeout((()=>{this.autosaveTimerHandler()}),e)}autosaveTimerHandler(){this.props.isAutosaveable?(this.needsAutosave&&(this.needsAutosave=!1,this.props.autosave()),this.setAutosaveTimer()):this.setAutosaveTimer(1e3)}render(){return null}}var ir=(0,a.compose)([(0,i.withSelect)(((e,t)=>{const{getReferenceByDistinctEdits:n}=e(s.store),{isEditedPostDirty:r,isEditedPostAutosaveable:o,isAutosavingPost:i,getEditorSettings:a}=e(Jn),{interval:l=a().autosaveInterval}=t;return{editsReference:n(),isDirty:r(),isAutosaveable:o(),isAutosaving:i(),interval:l}})),(0,i.withDispatch)(((e,t)=>({autosave(){const{autosave:n=e(Jn).autosave}=t;n()}})))])(or),sr=window.wp.richText,ar=n(4403),lr=n.n(ar);var cr=({children:e,isValid:t,level:n,href:r,onSelect:i})=>(0,o.createElement)("li",{className:lr()("document-outline__item",`is-${n.toLowerCase()}`,{"is-invalid":!t})},(0,o.createElement)("a",{href:r,className:"document-outline__button",onClick:i},(0,o.createElement)("span",{className:"document-outline__emdash","aria-hidden":"true"}),(0,o.createElement)("strong",{className:"document-outline__level"},n),(0,o.createElement)("span",{className:"document-outline__item-content"},e)));const ur=(0,o.createElement)("em",null,(0,qt.__)("(Empty heading)")),dr=[(0,o.createElement)("br",{key:"incorrect-break"}),(0,o.createElement)("em",{key:"incorrect-message"},(0,qt.__)("(Incorrect heading level)"))],pr=[(0,o.createElement)("br",{key:"incorrect-break-h1"}),(0,o.createElement)("em",{key:"incorrect-message-h1"},(0,qt.__)("(Your theme may already use a H1 for the post title)"))],mr=[(0,o.createElement)("br",{key:"incorrect-break-multiple-h1"}),(0,o.createElement)("em",{key:"incorrect-message-multiple-h1"},(0,qt.__)("(Multiple H1 headings are not recommended)"))],hr=(e=[])=>e.flatMap(((e={})=>"core/heading"===e.name?{...e,level:e.attributes.level,isEmpty:gr(e)}:hr(e.innerBlocks))),gr=e=>!e.attributes.content||0===e.attributes.content.length;var fr=(0,a.compose)((0,i.withSelect)((e=>{var t;const{getBlocks:n}=e(c.store),{getEditedPostAttribute:r}=e(Jn),{getPostType:o}=e(s.store),i=o(r("type"));return{title:r("title"),blocks:n(),isTitleSupported:null!==(t=i?.supports?.title)&&void 0!==t&&t}})))((({blocks:e=[],title:t,onSelect:n,isTitleSupported:r,hasOutlineItemsDisabled:s})=>{const a=hr(e),{selectBlock:l}=(0,i.useDispatch)(c.store);if(a.length<1)return null;let u=1;const d=document.querySelector(".editor-post-title__input"),p=r&&t&&d,m=a.reduce(((e,t)=>({...e,[t.level]:(e[t.level]||0)+1})),{})[1]>1;return(0,o.createElement)("div",{className:"document-outline"},(0,o.createElement)("ul",null,p&&(0,o.createElement)(cr,{level:(0,qt.__)("Title"),isValid:!0,onSelect:n,href:`#${d.id}`,isDisabled:s},t),a.map(((e,t)=>{const r=e.level>u+1,i=!(e.isEmpty||r||!e.level||1===e.level&&(m||p));return u=e.level,(0,o.createElement)(cr,{key:t,level:`H${e.level}`,isValid:i,isDisabled:s,href:`#block-${e.clientId}`,onSelect:()=>{l(e.clientId),n?.()}},e.isEmpty?ur:(0,sr.getTextContent)((0,sr.create)({html:e.attributes.content})),r&&dr,1===e.level&&m&&mr,p&&1===e.level&&!m&&pr)}))))}));var _r=(0,i.withSelect)((e=>({blocks:e(c.store).getBlocks()})))((function({blocks:e,children:t}){return e.filter((e=>"core/heading"===e.name)).length<1?null:t})),vr=window.wp.keycodes;var yr=function(){const{registerShortcut:e}=(0,i.useDispatch)(nr.store);return(0,o.useEffect)((()=>{e({name:"core/editor/save",category:"global",description:(0,qt.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/editor/undo",category:"global",description:(0,qt.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/editor/redo",category:"global",description:(0,qt.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,vr.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]})}),[e]),(0,o.createElement)(c.BlockEditorKeyboardShortcuts.Register,null)},br=window.wp.components;var Er=(0,o.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(S.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"}));var Sr=(0,o.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(S.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"}));var wr=(0,o.forwardRef)((function(e,t){const n=(0,vr.isAppleOS)()?vr.displayShortcut.primaryShift("z"):vr.displayShortcut.primary("y"),r=(0,i.useSelect)((e=>e(Jn).hasEditorRedo()),[]),{redo:s}=(0,i.useDispatch)(Jn);return(0,o.createElement)(br.Button,{...e,ref:t,icon:(0,qt.isRTL)()?Sr:Er,label:(0,qt.__)("Redo"),shortcut:n,"aria-disabled":!r,onClick:r?s:void 0,className:"editor-history__redo"})}));var kr=(0,o.forwardRef)((function(e,t){const n=(0,i.useSelect)((e=>e(Jn).hasEditorUndo()),[]),{undo:r}=(0,i.useDispatch)(Jn);return(0,o.createElement)(br.Button,{...e,ref:t,icon:(0,qt.isRTL)()?Er:Sr,label:(0,qt.__)("Undo"),shortcut:vr.displayShortcut.primary("z"),"aria-disabled":!n,onClick:n?r:void 0,className:"editor-history__undo"})}));var Pr=(0,a.compose)([(0,i.withSelect)((e=>({isValid:e(c.store).isValidTemplate()}))),(0,i.withDispatch)((e=>{const{setTemplateValidity:t,synchronizeTemplate:n}=e(c.store);return{resetTemplateValidity:()=>t(!0),synchronizeTemplate:n}}))])((function({isValid:e,...t}){return e?null:(0,o.createElement)(br.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:(0,qt.__)("Keep it as is"),onClick:t.resetTemplateValidity},{label:(0,qt.__)("Reset the template"),onClick:()=>{window.confirm((0,qt.__)("Resetting the template may result in loss of content, do you want to continue?"))&&t.synchronizeTemplate()}}]},(0,qt.__)("The content of your post doesn’t match the template assigned to your post type."))}));var Cr=(0,a.compose)([(0,i.withSelect)((e=>({notices:e(Gt.store).getNotices()}))),(0,i.withDispatch)((e=>({onRemove:e(Gt.store).removeNotice})))])((function({notices:e,onRemove:t}){const n=e.filter((({isDismissible:e,type:t})=>e&&"default"===t)),r=e.filter((({isDismissible:e,type:t})=>!e&&"default"===t));return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(br.NoticeList,{notices:r,className:"components-editor-notices__pinned"}),(0,o.createElement)(br.NoticeList,{notices:n,className:"components-editor-notices__dismissible",onRemove:t},(0,o.createElement)(Pr,null)))}));function Tr(){const e=(0,i.useSelect)((e=>e(Gt.store).getNotices()),[]),{removeNotice:t}=(0,i.useDispatch)(Gt.store),n=e.filter((({type:e})=>"snackbar"===e));return(0,o.createElement)(br.SnackbarList,{notices:n,className:"components-editor-notices__snackbar",onRemove:t})}var xr=window.wp.htmlEntities;function Br({record:e,checked:t,onChange:n}){const{name:r,kind:a,title:l,key:c}=e,u=(0,i.useSelect)((e=>{if("postType"!==a||"wp_template"!==r)return l;const t=e(s.store).getEditedEntityRecord(a,r,c);return e(Jn).__experimentalGetTemplateInfo(t).title}),[r,a,l,c]);return(0,o.createElement)(br.PanelRow,null,(0,o.createElement)(br.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,o.createElement)("strong",null,(0,xr.decodeEntities)(u)||(0,qt.__)("Untitled")),checked:t,onChange:n}))}function Ar({list:e,unselectedEntities:t,setUnselectedEntities:n}){const r=e.length,a=e[0],l=(0,i.useSelect)((e=>e(s.store).getEntityConfig(a.kind,a.name)),[a.kind,a.name]),{name:c}=a;let u=l.label;"wp_template_part"===c&&(u=1===r?(0,qt.__)("Template Part"):(0,qt.__)("Template Parts"));const d=function(e,t){switch(e){case"site":return 1===t?(0,qt.__)("This change will affect your whole site."):(0,qt.__)("These changes will affect your whole site.");case"wp_template":return(0,qt.__)("This change will affect pages and posts that use this template.");case"page":case"post":return(0,qt.__)("The following content has been modified.")}}(c,r);return(0,o.createElement)(br.PanelBody,{title:u,initialOpen:!0},d&&(0,o.createElement)(br.PanelRow,null,d),e.map((e=>(0,o.createElement)(Br,{key:e.key||e.property,record:e,checked:!t.some((t=>t.kind===e.kind&&t.name===e.name&&t.key===e.key&&t.property===e.property)),onChange:t=>n(e,t)}))))}const Ir={title:(0,qt.__)("Title"),description:(0,qt.__)("Tagline"),site_logo:(0,qt.__)("Logo"),site_icon:(0,qt.__)("Icon"),show_on_front:(0,qt.__)("Show on front"),page_on_front:(0,qt.__)("Page on front"),posts_per_page:(0,qt.__)("Maximum posts per page"),default_comment_status:(0,qt.__)("Allow comments on new posts")},Nr=()=>{const{editedEntities:e,siteEdits:t}=(0,i.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,getEntityRecordEdits:n}=e(s.store);return{editedEntities:t(),siteEdits:n("root","site")}}),[]),n=(0,o.useMemo)((()=>{const n=e.filter((e=>!("root"===e.kind&&"site"===e.name))),r=[];for(const e in t)r.push({kind:"root",name:"site",title:Ir[e]||e,property:e});return[...n,...r]}),[e,t]),[r,a]=(0,o.useState)([]);return{dirtyEntityRecords:n,isDirty:n.length-r.length>0,setUnselectedEntities:({kind:e,name:t,key:n,property:o},i)=>{a(i?r.filter((r=>r.kind!==e||r.name!==t||r.key!==n||r.property!==o)):[...r,{kind:e,name:t,key:n,property:o}])},unselectedEntities:r}},Dr=[{kind:"postType",name:"wp_navigation"}];function Rr(e){return e}function Or({close:e}){const t=Nr();return(0,o.createElement)(Lr,{close:e,...t})}function Lr({additionalPrompt:e,close:t,onSave:n=Rr,saveEnabled:r,saveLabel:l=(0,qt.__)("Save"),dirtyEntityRecords:u,isDirty:d,setUnselectedEntities:p,unselectedEntities:m}){const h=(0,o.useRef)(),{editEntityRecord:g,saveEditedEntityRecord:f,__experimentalSaveSpecifiedEntityEdits:_}=(0,i.useDispatch)(s.store),{__unstableMarkLastChangeAsPersistent:v}=(0,i.useDispatch)(c.store),{createSuccessNotice:y,createErrorNotice:b,removeNotice:E}=(0,i.useDispatch)(Gt.store),S=u.reduce(((e,t)=>{const{name:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{}),{site:w,wp_template:k,wp_template_part:P,...C}=S,T=[w,k,P,...Object.values(C)].filter(Array.isArray),x=null!=r?r:d,B=(0,o.useCallback)((()=>t()),[t]),[A,I]=(0,a.__experimentalUseDialog)({onClose:()=>B()});return(0,o.createElement)("div",{ref:A,...I,className:"entities-saved-states__panel"},(0,o.createElement)(br.Flex,{className:"entities-saved-states__panel-header",gap:2},(0,o.createElement)(br.FlexItem,{isBlock:!0,as:br.Button,ref:h,variant:"primary",disabled:!x,onClick:()=>{const e="site-editor-save-success";E(e);const r=u.filter((({kind:e,name:t,key:n,property:r})=>!m.some((o=>o.kind===e&&o.name===t&&o.key===n&&o.property===r))));t(r);const o=[],i=[];r.forEach((({kind:e,name:t,key:n,property:r})=>{"root"===e&&"site"===t?o.push(r):(Dr.some((n=>n.kind===e&&n.name===t))&&g(e,t,n,{status:"publish"}),i.push(f(e,t,n)))})),o.length&&i.push(_("root","site",void 0,o)),v(),Promise.all(i).then((e=>n(e))).then((t=>{t.some((e=>void 0===e))?b((0,qt.__)("Saving failed.")):y((0,qt.__)("Site updated."),{type:"snackbar",id:e})})).catch((e=>b(`${(0,qt.__)("Saving failed.")} ${e}`)))},className:"editor-entities-saved-states__save-button"},l),(0,o.createElement)(br.FlexItem,{isBlock:!0,as:br.Button,variant:"secondary",onClick:B},(0,qt.__)("Cancel"))),(0,o.createElement)("div",{className:"entities-saved-states__text-prompt"},(0,o.createElement)("strong",null,(0,qt.__)("Are you ready to save?")),e,d&&(0,o.createElement)("p",null,(0,qt.__)("The following changes have been made to your site, templates, and content."))),T.map((e=>(0,o.createElement)(Ar,{key:e[0].name,list:e,unselectedEntities:m,setUnselectedEntities:p}))))}function Ur(){try{return(0,i.select)(Jn).getEditedPostContent()}catch(e){}}function Mr({text:e,children:t}){const n=(0,a.useCopyToClipboard)(e);return(0,o.createElement)(br.Button,{variant:"secondary",ref:n},t)}class Fr extends o.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,l.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){const{error:e}=this.state;if(!e)return this.props.children;const t=[(0,o.createElement)(Mr,{key:"copy-post",text:Ur},(0,qt.__)("Copy Post Text")),(0,o.createElement)(Mr,{key:"copy-error",text:e.stack},(0,qt.__)("Copy Error"))];return(0,o.createElement)(c.Warning,{className:"editor-error-boundary",actions:t},(0,qt.__)("The editor has encountered an unexpected error."))}}var zr=Fr;const Hr=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame;let Vr;function jr(){const{postId:e,isEditedPostNew:t,hasRemoteAutosave:n}=(0,i.useSelect)((e=>({postId:e(Jn).getCurrentPostId(),isEditedPostNew:e(Jn).isEditedPostNew(),hasRemoteAutosave:!!e(Jn).getEditorSettings().autosave})),[]),{getEditedPostAttribute:r}=(0,i.useSelect)(Jn),{createWarningNotice:s,removeNotice:a}=(0,i.useDispatch)(Gt.store),{editPost:l,resetEditorBlocks:c}=(0,i.useDispatch)(Jn);(0,o.useEffect)((()=>{let o=function(e,t){return window.sessionStorage.getItem(Kt(e,t))}(e,t);if(!o)return;try{o=JSON.parse(o)}catch{return}const{post_title:i,content:u,excerpt:d}=o,p={title:i,content:u,excerpt:d};if(!Object.keys(p).some((e=>p[e]!==r(e))))return void Yt(e,t);if(n)return;const m="wpEditorAutosaveRestore";s((0,qt.__)("The backup of this post in your browser is different from the version below."),{id:m,actions:[{label:(0,qt.__)("Restore the backup"),onClick(){const{content:e,...t}=p;l(t),c((0,_.parse)(p.content)),a(m)}}]})}),[t,e])}var Wr=(0,a.ifCondition)((()=>{if(void 0!==Vr)return Vr;try{window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),Vr=!0}catch{Vr=!1}return Vr}))((function(){const{autosave:e}=(0,i.useDispatch)(Jn),t=(0,o.useCallback)((()=>{Hr((()=>e({local:!0})))}),[]);jr(),function(){const{postId:e,isEditedPostNew:t,isDirty:n,isAutosaving:r,didError:s}=(0,i.useSelect)((e=>({postId:e(Jn).getCurrentPostId(),isEditedPostNew:e(Jn).isEditedPostNew(),isDirty:e(Jn).isEditedPostDirty(),isAutosaving:e(Jn).isAutosavingPost(),didError:e(Jn).didPostSaveRequestFail()})),[]),l=(0,o.useRef)(n),c=(0,o.useRef)(r);(0,o.useEffect)((()=>{!s&&(c.current&&!r||l.current&&!n)&&Yt(e,t),l.current=n,c.current=r}),[n,r,s]);const u=(0,a.usePrevious)(t),d=(0,a.usePrevious)(e);(0,o.useEffect)((()=>{d===e&&u&&!t&&Yt(e,!0)}),[t,e])}();const n=(0,i.useSelect)((e=>e(Jn).getEditorSettings().localAutosaveInterval),[]);return(0,o.createElement)(ir,{interval:n,autosave:t})}));var $r=function({children:e}){const t=(0,i.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Jn),{getPostType:n}=e(s.store),r=n(t("type"));return!!r?.supports?.["page-attributes"]}),[]);return t?e:null};var Gr=function({children:e,supportKeys:t}){const n=(0,i.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Jn),{getPostType:n}=e(s.store);return n(t("type"))}),[]);let r=!0;return n&&(r=(Array.isArray(t)?t:[t]).some((e=>!!n.supports[e]))),r?e:null};function Kr(){const e=(0,i.useSelect)((e=>{var t;return null!==(t=e(Jn).getEditedPostAttribute("menu_order"))&&void 0!==t?t:0}),[]),{editPost:t}=(0,i.useDispatch)(Jn),[n,r]=(0,o.useState)(null),s=null!=n?n:e;return(0,o.createElement)(br.Flex,null,(0,o.createElement)(br.FlexBlock,null,(0,o.createElement)(br.__experimentalNumberControl,{label:(0,qt.__)("Order"),value:s,onChange:e=>{r(e);const n=Number(e);Number.isInteger(n)&&""!==e.trim?.()&&t({menu_order:n})},labelPosition:"side",onBlur:()=>{r(null)}})))}function Yr(){return(0,o.createElement)(Gr,{supportKeys:"page-attributes"},(0,o.createElement)(Kr,null))}var qr=n(4793),Qr=n.n(qr);function Xr(e){const t=e.map((e=>({children:[],parent:null,...e})));if(t.some((({parent:e})=>null===e)))return t;const n=t.reduce(((e,t)=>{const{parent:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{}),r=e=>e.map((e=>{const t=n[e.id];return{...e,children:t&&t.length?r(t):[]}}));return r(n[0]||[])}const Zr=e=>(0,xr.decodeEntities)(e),Jr=e=>({...e,name:Zr(e.name)}),eo=e=>(null!=e?e:[]).map(Jr);function to(e){return e?.title?.rendered?(0,xr.decodeEntities)(e.title.rendered):`#${e.id} (${(0,qt.__)("no title")})`}const no=(e,t)=>{const n=Qr()(e||"").toLowerCase(),r=Qr()(t||"").toLowerCase();return n===r?0:n.startsWith(r)?n.length:1/0};var ro=function(){const{editPost:e}=(0,i.useDispatch)(Jn),[t,n]=(0,o.useState)(!1),{isHierarchical:r,parentPostId:l,parentPostTitle:c,pageItems:u}=(0,i.useSelect)((e=>{var n;const{getPostType:r,getEntityRecords:o,getEntityRecord:i}=e(s.store),{getCurrentPostId:a,getEditedPostAttribute:l}=e(Jn),c=l("type"),u=l("parent"),d=r(c),p=a(),m=null!==(n=d?.hierarchical)&&void 0!==n&&n,h={per_page:100,exclude:p,parent_exclude:p,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};t&&(h.search=t);const g=u?i("postType",c,u):null;return{isHierarchical:m,parentPostId:u,parentPostTitle:g?to(g):"",pageItems:m?o("postType",c,h):null}}),[t]),d=(0,o.useMemo)((()=>{const e=(n,r=0)=>n.map((t=>[{value:t.id,label:"— ".repeat(r)+(0,xr.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],r+1)])).sort((([e],[n])=>no(e.rawName,t)>=no(n.rawName,t)?1:-1)).flat();if(!u)return[];let n=u.map((e=>({id:e.id,parent:e.parent,name:to(e)})));t||(n=Xr(n));const r=e(n),o=r.find((e=>e.value===l));return c&&!o&&r.unshift({value:l,label:c}),r}),[u,t,c,l]);return r?(0,o.createElement)(br.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:(0,qt.__)("Parent"),value:l,options:d,onFilterValueChange:(0,a.debounce)((e=>{n(e)}),300),onChange:t=>{e({parent:t})}}):null};var oo=function(){const{availableTemplates:e,selectedTemplate:t,isViewable:n}=(0,i.useSelect)((e=>{var t;const{getEditedPostAttribute:n,getEditorSettings:r,getCurrentPostType:o}=e(Jn),{getPostType:i}=e(s.store);return{selectedTemplate:n("template"),availableTemplates:r().availableTemplates,isViewable:null!==(t=i(o())?.viewable)&&void 0!==t&&t}}),[]),{editPost:r}=(0,i.useDispatch)(Jn);return n&&e&&Object.keys(e).length?(0,o.createElement)(br.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,qt.__)("Template:"),value:t,onChange:e=>{r({template:e||""})},options:Object.entries(null!=e?e:{}).map((([e,t])=>({value:e,label:t})))}):null};const io={who:"authors",per_page:50,_fields:"id,name",context:"view"};var so=function(){const[e,t]=(0,o.useState)(),{authorId:n,isLoading:r,authors:l,postAuthor:c}=(0,i.useSelect)((t=>{const{getUser:n,getUsers:r,isResolving:o}=t(s.store),{getEditedPostAttribute:i}=t(Jn),a=n(i("author"),{context:"view"}),l={...io};return e&&(l.search=e),{authorId:i("author"),postAuthor:a,authors:r(l),isLoading:o("core","getUsers",[l])}}),[e]),{editPost:u}=(0,i.useDispatch)(Jn),d=(0,o.useMemo)((()=>{const e=(null!=l?l:[]).map((e=>({value:e.id,label:(0,xr.decodeEntities)(e.name)})));return e.findIndex((({value:e})=>c?.id===e))<0&&c?[{value:c.id,label:(0,xr.decodeEntities)(c.name)},...e]:e}),[l,c]);return c?(0,o.createElement)(br.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,qt.__)("Author"),options:d,value:n,onFilterValueChange:(0,a.debounce)((e=>{t(e)}),300),onChange:e=>{e&&u({author:e})},isLoading:r,allowReset:!1}):null};var ao=function(){const{editPost:e}=(0,i.useDispatch)(Jn),{postAuthor:t,authors:n}=(0,i.useSelect)((e=>({postAuthor:e(Jn).getEditedPostAttribute("author"),authors:e(s.store).getUsers(io)})),[]),r=(0,o.useMemo)((()=>(null!=n?n:[]).map((e=>({value:e.id,label:(0,xr.decodeEntities)(e.name)})))),[n]);return(0,o.createElement)(br.SelectControl,{__nextHasNoMarginBottom:!0,className:"post-author-selector",label:(0,qt.__)("Author"),options:r,onChange:t=>{const n=Number(t);e({author:n})},value:t})};var lo=function(){return(0,i.useSelect)((e=>{const t=e(s.store).getUsers(io);return t?.length>=25}),[])?(0,o.createElement)(so,null):(0,o.createElement)(ao,null)};function co({children:e}){const{hasAssignAuthorAction:t,hasAuthors:n}=(0,i.useSelect)((e=>{var t;const n=e(Jn).getCurrentPost(),r=e(s.store).getUsers(io);return{hasAssignAuthorAction:null!==(t=n._links?.["wp:action-assign-author"])&&void 0!==t&&t,hasAuthors:r?.length>=1}}),[]);return t&&n?(0,o.createElement)(Gr,{supportKeys:"author"},e):null}var uo=function(){const e=(0,i.useSelect)((e=>{var t;return null!==(t=e(Jn).getEditedPostAttribute("comment_status"))&&void 0!==t?t:"open"}),[]),{editPost:t}=(0,i.useDispatch)(Jn);return(0,o.createElement)(br.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,qt.__)("Allow comments"),checked:"open"===e,onChange:()=>t({comment_status:"open"===e?"closed":"open"})})};var po=function(){const e=(0,i.useSelect)((e=>e(Jn).getEditedPostAttribute("excerpt")),[]),{editPost:t}=(0,i.useDispatch)(Jn);return(0,o.createElement)("div",{className:"editor-post-excerpt"},(0,o.createElement)(br.TextareaControl,{__nextHasNoMarginBottom:!0,label:(0,qt.__)("Write an excerpt (optional)"),className:"editor-post-excerpt__textarea",onChange:e=>t({excerpt:e}),value:e}),(0,o.createElement)(br.ExternalLink,{href:(0,qt.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt")},(0,qt.__)("Learn more about manual excerpts")))};var mo=function({children:e}){return(0,o.createElement)(Gr,{supportKeys:"excerpt"},e)},ho=window.wp.blob;var go=(0,i.withSelect)((e=>{const{getThemeSupports:t}=e(s.store),{getEditedPostAttribute:n}=e(Jn);return{postType:n("type"),themeSupports:t()}}))((function({themeSupports:e,children:t,postType:n,supportKeys:r}){return(Array.isArray(r)?r:[r]).some((t=>{var r;const o=null!==(r=e?.[t])&&void 0!==r&&r;return"post-thumbnails"===t&&Array.isArray(o)?o.includes(n):o}))?t:null}));var fo=function({children:e}){return(0,o.createElement)(go,{supportKeys:"post-thumbnails"},(0,o.createElement)(Gr,{supportKeys:"thumbnail"},e))};const _o=["image"],vo=(0,qt.__)("Featured image"),yo=(0,qt.__)("Set featured image"),bo=(0,o.createElement)("p",null,(0,qt.__)("To edit the featured image, you need permission to upload media."));const Eo=(0,i.withSelect)((e=>{const{getMedia:t,getPostType:n}=e(s.store),{getCurrentPostId:r,getEditedPostAttribute:o}=e(Jn),i=o("featured_media");return{media:i?t(i,{context:"view"}):null,currentPostId:r(),postType:n(o("type")),featuredImageId:i}})),So=(0,i.withDispatch)(((e,{noticeOperations:t},{select:n})=>{const{editPost:r}=e(Jn);return{onUpdateImage(e){r({featured_media:e.id})},onDropImage(e){n(c.store).getSettings().mediaUpload({allowedTypes:["image"],filesList:e,onFileChange([e]){r({featured_media:e.id})},onError(e){t.removeAllNotices(),t.createErrorNotice(e)}})},onRemoveImage(){r({featured_media:0})}}}));var wo=(0,a.compose)(br.withNotices,Eo,So,(0,br.withFilters)("editor.PostFeaturedImage"))((function({currentPostId:e,featuredImageId:t,onUpdateImage:n,onRemoveImage:r,media:s,postType:a,noticeUI:u,noticeOperations:d}){const p=(0,o.useRef)(),[m,h]=(0,o.useState)(!1),g=(0,i.useSelect)((e=>e(c.store).getSettings().mediaUpload),[]),{mediaWidth:f,mediaHeight:_,mediaSourceUrl:v}=function(e,t){var n,r;if(!e)return{};const o=(0,l.applyFilters)("editor.PostFeaturedImage.imageSize","large",e.id,t);if(o in(null!==(n=e?.media_details?.sizes)&&void 0!==n?n:{}))return{mediaWidth:e.media_details.sizes[o].width,mediaHeight:e.media_details.sizes[o].height,mediaSourceUrl:e.media_details.sizes[o].source_url};const i=(0,l.applyFilters)("editor.PostFeaturedImage.imageSize","thumbnail",e.id,t);return i in(null!==(r=e?.media_details?.sizes)&&void 0!==r?r:{})?{mediaWidth:e.media_details.sizes[i].width,mediaHeight:e.media_details.sizes[i].height,mediaSourceUrl:e.media_details.sizes[i].source_url}:{mediaWidth:e.media_details.width,mediaHeight:e.media_details.height,mediaSourceUrl:e.source_url}}(s,e);function y(e){g({allowedTypes:["image"],filesList:e,onFileChange([e]){(0,ho.isBlobURL)(e?.url)?h(!0):(n(e),h(!1))},onError(e){d.removeAllNotices(),d.createErrorNotice(e)}})}return(0,o.createElement)(fo,null,u,(0,o.createElement)("div",{className:"editor-post-featured-image"},s&&(0,o.createElement)("div",{id:`editor-post-featured-image-${t}-describedby`,className:"hidden"},s.alt_text&&(0,qt.sprintf)((0,qt.__)("Current image: %s"),s.alt_text),!s.alt_text&&(0,qt.sprintf)((0,qt.__)("The current image has no alternative text. The file name is: %s"),s.media_details.sizes?.full?.file||s.slug)),(0,o.createElement)(c.MediaUploadCheck,{fallback:bo},(0,o.createElement)(c.MediaUpload,{title:a?.labels?.featured_image||vo,onSelect:n,unstableFeaturedImageFlow:!0,allowedTypes:_o,modalClass:"editor-post-featured-image__media-modal",render:({open:e})=>(0,o.createElement)("div",{className:"editor-post-featured-image__container"},(0,o.createElement)(br.Button,{ref:p,className:t?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:e,"aria-label":t?(0,qt.__)("Edit or replace the image"):null,"aria-describedby":t?`editor-post-featured-image-${t}-describedby`:null},!!t&&s&&(0,o.createElement)(br.ResponsiveWrapper,{naturalWidth:f,naturalHeight:_,isInline:!0},(0,o.createElement)("img",{src:v,alt:""})),m&&(0,o.createElement)(br.Spinner,null),!t&&!m&&(a?.labels?.set_featured_image||yo)),!!t&&(0,o.createElement)(br.__experimentalHStack,{className:"editor-post-featured-image__actions"},(0,o.createElement)(br.Button,{className:"editor-post-featured-image__action",onClick:e,"aria-hidden":"true"},(0,qt.__)("Replace")),(0,o.createElement)(br.Button,{className:"editor-post-featured-image__action",onClick:()=>{r(),p.current.focus()}},(0,qt.__)("Remove"))),(0,o.createElement)(br.DropZone,{onFilesDrop:y})),value:t}))))}));var ko=function({children:e}){return(0,i.useSelect)((e=>e(Jn).getEditorSettings().disablePostFormats),[])?null:(0,o.createElement)(Gr,{supportKeys:"post-formats"},e)};const Po=[{id:"aside",caption:(0,qt.__)("Aside")},{id:"audio",caption:(0,qt.__)("Audio")},{id:"chat",caption:(0,qt.__)("Chat")},{id:"gallery",caption:(0,qt.__)("Gallery")},{id:"image",caption:(0,qt.__)("Image")},{id:"link",caption:(0,qt.__)("Link")},{id:"quote",caption:(0,qt.__)("Quote")},{id:"standard",caption:(0,qt.__)("Standard")},{id:"status",caption:(0,qt.__)("Status")},{id:"video",caption:(0,qt.__)("Video")}].sort(((e,t)=>{const n=e.caption.toUpperCase(),r=t.caption.toUpperCase();return nr?1:0}));function Co(){const e=`post-format-selector-${(0,a.useInstanceId)(Co)}`,{postFormat:t,suggestedFormat:n,supportedFormats:r}=(0,i.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:n}=e(Jn),r=t("format"),o=e(s.store).getThemeSupports();return{postFormat:null!=r?r:"standard",suggestedFormat:n(),supportedFormats:o.formats}}),[]),l=Po.filter((e=>r?.includes(e.id)||t===e.id)),c=l.find((e=>e.id===n)),{editPost:u}=(0,i.useDispatch)(Jn),d=e=>u({format:e});return(0,o.createElement)(ko,null,(0,o.createElement)("div",{className:"editor-post-format"},(0,o.createElement)(br.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,qt.__)("Post Format"),value:t,onChange:e=>d(e),id:e,options:l.map((e=>({label:e.caption,value:e.id})))}),c&&c.id!==t&&(0,o.createElement)("p",{className:"editor-post-format__suggestion"},(0,o.createElement)(br.Button,{variant:"link",onClick:()=>d(c.id)},(0,qt.sprintf)((0,qt.__)("Apply suggested format: %s"),c.caption)))))}var To=(0,o.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(S.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"}));var xo=function({children:e}){const{lastRevisionId:t,revisionsCount:n}=(0,i.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(Jn);return{lastRevisionId:t(),revisionsCount:n()}}),[]);return!t||n<2?null:(0,o.createElement)(Gr,{supportKeys:"revisions"},e)};var Bo=function(){const{lastRevisionId:e,revisionsCount:t}=(0,i.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:n}=e(Jn);return{lastRevisionId:t(),revisionsCount:n()}}),[]);return(0,o.createElement)(xo,null,(0,o.createElement)(br.Button,{href:(0,y.addQueryArgs)("revision.php",{revision:e}),className:"editor-post-last-revision__title",icon:To},(0,qt.sprintf)((0,qt._n)("%d Revision","%d Revisions",t),t)))};function Ao(){const e="core/editor/post-locked-modal-"+(0,a.useInstanceId)(Ao),{autosave:t,updatePostLock:n}=(0,i.useDispatch)(Jn),{isLocked:r,isTakeover:c,user:u,postId:d,postLockUtils:p,activePostLock:m,postType:h,previewLink:g}=(0,i.useSelect)((e=>{const{isPostLocked:t,isPostLockTakeover:n,getPostLockUser:r,getCurrentPostId:o,getActivePostLock:i,getEditedPostAttribute:a,getEditedPostPreviewLink:l,getEditorSettings:c}=e(Jn),{getPostType:u}=e(s.store);return{isLocked:t(),isTakeover:n(),user:r(),postId:o(),postLockUtils:c().postLockUtils,activePostLock:i(),postType:u(a("type")),previewLink:l()}}),[]);if((0,o.useEffect)((()=>{function o(){if(r||!m)return;const e=new window.FormData;if(e.append("action","wp-remove-post-lock"),e.append("_wpnonce",p.unlockNonce),e.append("post_ID",d),e.append("active_post_lock",m),window.navigator.sendBeacon)window.navigator.sendBeacon(p.ajaxUrl,e);else{const t=new window.XMLHttpRequest;t.open("POST",p.ajaxUrl,!1),t.send(e)}}return(0,l.addAction)("heartbeat.send",e,(function(e){r||(e["wp-refresh-post-lock"]={lock:m,post_id:d})})),(0,l.addAction)("heartbeat.tick",e,(function(e){if(!e["wp-refresh-post-lock"])return;const r=e["wp-refresh-post-lock"];r.lock_error?(t(),n({isLocked:!0,isTakeover:!0,user:{name:r.lock_error.name,avatar:r.lock_error.avatar_src_2x}})):r.new_lock&&n({isLocked:!1,activePostLock:r.new_lock})})),window.addEventListener("beforeunload",o),()=>{(0,l.removeAction)("heartbeat.send",e),(0,l.removeAction)("heartbeat.tick",e),window.removeEventListener("beforeunload",o)}}),[]),!r)return null;const f=u.name,_=u.avatar,v=(0,y.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:d,action:"edit",_wpnonce:p.nonce}),b=(0,y.addQueryArgs)("edit.php",{post_type:h?.slug}),E=(0,qt.__)("Exit editor");return(0,o.createElement)(br.Modal,{title:c?(0,qt.__)("Someone else has taken over this post"):(0,qt.__)("This post is already being edited"),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,className:"editor-post-locked-modal"},(0,o.createElement)(br.__experimentalHStack,{alignment:"top",spacing:6},!!_&&(0,o.createElement)("img",{src:_,alt:(0,qt.__)("Avatar"),className:"editor-post-locked-modal__avatar",width:64,height:64}),(0,o.createElement)("div",null,!!c&&(0,o.createElement)("p",null,(0,o.createInterpolateElement)(f?(0,qt.sprintf)((0,qt.__)("%s now has editing control of this post (). Don’t worry, your changes up to this moment have been saved."),f):(0,qt.__)("Another user now has editing control of this post (). Don’t worry, your changes up to this moment have been saved."),{strong:(0,o.createElement)("strong",null),PreviewLink:(0,o.createElement)(br.ExternalLink,{href:g},(0,qt.__)("preview"))})),!c&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("p",null,(0,o.createInterpolateElement)(f?(0,qt.sprintf)((0,qt.__)("%s is currently working on this post (), which means you cannot make changes, unless you take over."),f):(0,qt.__)("Another user is currently working on this post (), which means you cannot make changes, unless you take over."),{strong:(0,o.createElement)("strong",null),PreviewLink:(0,o.createElement)(br.ExternalLink,{href:g},(0,qt.__)("preview"))})),(0,o.createElement)("p",null,(0,qt.__)("If you take over, the other user will lose editing control to the post, but their changes will be saved."))),(0,o.createElement)(br.__experimentalHStack,{className:"editor-post-locked-modal__buttons",justify:"flex-end"},!c&&(0,o.createElement)(br.Button,{variant:"tertiary",href:v},(0,qt.__)("Take over")),(0,o.createElement)(br.Button,{variant:"primary",href:b},E)))))}var Io=function({children:e}){const{hasPublishAction:t,isPublished:n}=(0,i.useSelect)((e=>{var t;const{isCurrentPostPublished:n,getCurrentPost:r}=e(Jn);return{hasPublishAction:null!==(t=r()._links?.["wp:action-publish"])&&void 0!==t&&t,isPublished:n()}}),[]);return n||!t?null:e};var No=function(){const e=(0,i.useSelect)((e=>e(Jn).getEditedPostAttribute("status")),[]),{editPost:t}=(0,i.useDispatch)(Jn);return(0,o.createElement)(Io,null,(0,o.createElement)(br.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,qt.__)("Pending review"),checked:"pending"===e,onChange:()=>{t({status:"pending"===e?"draft":"pending"})}}))};var Do=function(){const e=(0,i.useSelect)((e=>{var t;return null!==(t=e(Jn).getEditedPostAttribute("ping_status"))&&void 0!==t?t:"open"}),[]),{editPost:t}=(0,i.useDispatch)(Jn);return(0,o.createElement)(br.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,qt.__)("Allow pingbacks & trackbacks"),checked:"open"===e,onChange:()=>t({ping_status:"open"===e?"closed":"open"})})};function Ro({className:e,textContent:t,forceIsAutosaveable:n,role:r,onPreview:a}){const{postId:c,currentPostLink:u,previewLink:d,isSaveable:p,isViewable:m}=(0,i.useSelect)((e=>{var t;const n=e(Jn),r=e(s.store).getPostType(n.getCurrentPostType("type"));return{postId:n.getCurrentPostId(),currentPostLink:n.getCurrentPostAttribute("link"),previewLink:n.getEditedPostPreviewLink(),isSaveable:n.isEditedPostSaveable(),isViewable:null!==(t=r?.viewable)&&void 0!==t&&t}}),[]),{__unstableSaveForPreview:h}=(0,i.useDispatch)(Jn);if(!m)return null;const g=`wp-preview-${c}`,f=d||u;return(0,o.createElement)(br.Button,{variant:e?void 0:"tertiary",className:e||"editor-post-preview",href:f,target:g,disabled:!p,onClick:async e=>{e.preventDefault();const t=window.open("",g);t.focus(),function(e){let t=(0,o.renderToString)((0,o.createElement)("div",{className:"editor-post-preview-button__interstitial-message"},(0,o.createElement)(br.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96"},(0,o.createElement)(br.Path,{className:"outer",d:"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",fill:"none"}),(0,o.createElement)(br.Path,{className:"inner",d:"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",fill:"none"})),(0,o.createElement)("p",null,(0,qt.__)("Generating preview…"))));t+='\n\t\t\n\t',t=(0,l.applyFilters)("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=(0,qt.__)("Generating preview…"),e.close()}(t.document);const r=await h({forceIsAutosaveable:n});t.location=r,a?.()},role:r},t||(0,o.createElement)(o.Fragment,null,(0,qt._x)("Preview","imperative verb"),(0,o.createElement)(br.VisuallyHidden,{as:"span"},(0,qt.__)("(opens in a new tab)"))))}var Oo=(0,a.compose)([(0,i.withSelect)((e=>{var t;const{isCurrentPostPublished:n,isEditedPostBeingScheduled:r,isSavingPost:o,isPublishingPost:i,getCurrentPost:s,getCurrentPostType:a,isAutosavingPost:l}=e(Jn);return{isPublished:n(),isBeingScheduled:r(),isSaving:o(),isPublishing:i(),hasPublishAction:null!==(t=s()._links?.["wp:action-publish"])&&void 0!==t&&t,postType:a(),isAutosaving:l()}}))])((function({isPublished:e,isBeingScheduled:t,isSaving:n,isPublishing:r,hasPublishAction:o,isAutosaving:i,hasNonPostEntityChanges:s}){return r?(0,qt.__)("Publishing…"):e&&n&&!i?(0,qt.__)("Updating…"):t&&n&&!i?(0,qt.__)("Scheduling…"):o?e?s?(0,qt.__)("Update…"):(0,qt.__)("Update"):t?s?(0,qt.__)("Schedule…"):(0,qt.__)("Schedule"):(0,qt.__)("Publish"):s?(0,qt.__)("Submit for Review…"):(0,qt.__)("Submit for Review")}));const Lo=()=>{};class Uo extends o.Component{constructor(e){super(e),this.buttonNode=(0,o.createRef)(),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}componentDidMount(){this.props.focusOnMount&&(this.timeoutID=setTimeout((()=>{this.buttonNode.current.focus()}),0))}componentWillUnmount(){clearTimeout(this.timeoutID)}createOnClick(e){return(...t)=>{const{hasNonPostEntityChanges:n,setEntitiesSavedStatesCallback:r}=this.props;return n&&r?(this.setState({entitiesSavedStatesCallback:()=>e(...t)}),r((()=>this.closeEntitiesSavedStates)),Lo):e(...t)}}closeEntitiesSavedStates(e){const{postType:t,postId:n}=this.props,{entitiesSavedStatesCallback:r}=this.state;this.setState({entitiesSavedStatesCallback:!1},(()=>{e&&e.some((e=>"postType"===e.kind&&e.name===t&&e.key===n))&&r()}))}render(){const{forceIsDirty:e,hasPublishAction:t,isBeingScheduled:n,isOpen:r,isPostSavingLocked:i,isPublishable:s,isPublished:a,isSaveable:l,isSaving:c,isAutoSaving:u,isToggle:d,onSave:p,onStatusChange:m,onSubmit:h=Lo,onToggle:g,visibility:f,hasNonPostEntityChanges:_,isSavingNonPostEntityChanges:v}=this.props,y=(c||!l||i||!s&&!e)&&(!_||v),b=(a||c||!l||!s&&!e)&&(!_||v);let E;E=t?"private"===f?"private":n?"future":"publish":"pending";const S={"aria-disabled":y,className:"editor-post-publish-button",isBusy:!u&&c,variant:"primary",onClick:this.createOnClick((()=>{y||(h(),m(E),p())}))},w={"aria-disabled":b,"aria-expanded":r,className:"editor-post-publish-panel__toggle",isBusy:c&&a,variant:"primary",onClick:this.createOnClick((()=>{b||g()}))},k=n?(0,qt.__)("Schedule…"):(0,qt.__)("Publish"),P=(0,o.createElement)(Oo,{hasNonPostEntityChanges:_}),C=d?w:S,T=d?k:P;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(br.Button,{ref:this.buttonNode,...C,className:lr()(C.className,"editor-post-publish-button__button",{"has-changes-dot":_})},T))}}var Mo=(0,a.compose)([(0,i.withSelect)((e=>{var t;const{isSavingPost:n,isAutosavingPost:r,isEditedPostBeingScheduled:o,getEditedPostVisibility:i,isCurrentPostPublished:s,isEditedPostSaveable:a,isEditedPostPublishable:l,isPostSavingLocked:c,getCurrentPost:u,getCurrentPostType:d,getCurrentPostId:p,hasNonPostEntityChanges:m,isSavingNonPostEntityChanges:h}=e(Jn);return{isSaving:n(),isAutoSaving:r(),isBeingScheduled:o(),visibility:i(),isSaveable:a(),isPostSavingLocked:c(),isPublishable:l(),isPublished:s(),hasPublishAction:null!==(t=u()._links?.["wp:action-publish"])&&void 0!==t&&t,postType:d(),postId:p(),hasNonPostEntityChanges:m(),isSavingNonPostEntityChanges:h()}})),(0,i.withDispatch)((e=>{const{editPost:t,savePost:n}=e(Jn);return{onStatusChange:e=>t({status:e},{undoIgnore:!0}),onSave:n}}))])(Uo);var Fo=(0,o.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(S.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));var zo=(0,o.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,o.createElement)(S.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"}));const Ho={public:{label:(0,qt.__)("Public"),info:(0,qt.__)("Visible to everyone.")},private:{label:(0,qt.__)("Private"),info:(0,qt.__)("Only visible to site admins and editors.")},password:{label:(0,qt.__)("Password protected"),info:(0,qt.__)("Only those with the password can view this post.")}};function Vo({onClose:e}){const t=(0,a.useInstanceId)(Vo),{status:n,visibility:r,password:s}=(0,i.useSelect)((e=>({status:e(Jn).getEditedPostAttribute("status"),visibility:e(Jn).getEditedPostVisibility(),password:e(Jn).getEditedPostAttribute("password")}))),{editPost:l,savePost:u}=(0,i.useDispatch)(Jn),[d,p]=(0,o.useState)(!!s),[m,h]=(0,o.useState)(!1);return(0,o.createElement)("div",{className:"editor-post-visibility"},(0,o.createElement)(c.__experimentalInspectorPopoverHeader,{title:(0,qt.__)("Visibility"),help:(0,qt.__)("Control how this post is viewed."),onClose:e}),(0,o.createElement)("fieldset",{className:"editor-post-visibility__fieldset"},(0,o.createElement)(br.VisuallyHidden,{as:"legend"},(0,qt.__)("Visibility")),(0,o.createElement)(jo,{instanceId:t,value:"public",label:Ho.public.label,info:Ho.public.info,checked:"public"===r&&!d,onChange:()=>{l({status:"private"===r?"draft":n,password:""}),p(!1)}}),(0,o.createElement)(jo,{instanceId:t,value:"private",label:Ho.private.label,info:Ho.private.info,checked:"private"===r,onChange:()=>{h(!0)}}),(0,o.createElement)(jo,{instanceId:t,value:"password",label:Ho.password.label,info:Ho.password.info,checked:d,onChange:()=>{l({status:"private"===r?"draft":n,password:s||""}),p(!0)}}),d&&(0,o.createElement)("div",{className:"editor-post-visibility__password"},(0,o.createElement)(br.VisuallyHidden,{as:"label",htmlFor:`editor-post-visibility__password-input-${t}`},(0,qt.__)("Create password")),(0,o.createElement)("input",{className:"editor-post-visibility__password-input",id:`editor-post-visibility__password-input-${t}`,type:"text",onChange:e=>{l({password:e.target.value})},value:s,placeholder:(0,qt.__)("Use a secure password")}))),(0,o.createElement)(br.__experimentalConfirmDialog,{isOpen:m,onConfirm:()=>{l({status:"private",password:""}),p(!1),h(!1),u()},onCancel:()=>{h(!1)}},(0,qt.__)("Would you like to privately publish this post now?")))}function jo({instanceId:e,value:t,label:n,info:r,...i}){return(0,o.createElement)("div",{className:"editor-post-visibility__choice"},(0,o.createElement)("input",{type:"radio",name:`editor-post-visibility__setting-${e}`,value:t,id:`editor-post-${t}-${e}`,"aria-describedby":`editor-post-${t}-${e}-description`,className:"editor-post-visibility__radio",...i}),(0,o.createElement)("label",{htmlFor:`editor-post-${t}-${e}`,className:"editor-post-visibility__label"},n),(0,o.createElement)("p",{id:`editor-post-${t}-${e}-description`,className:"editor-post-visibility__info"},r))}function Wo(){return $o()}function $o(){const e=(0,i.useSelect)((e=>e(Jn).getEditedPostVisibility()));return Ho[e]?.label}function Go(e){return Go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Go(e)}function Ko(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function Yo(e){Ko(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===Go(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function qo(e){Ko(1,arguments);var t=Yo(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Qo(e){Ko(1,arguments);var t=Yo(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}Math.pow(10,8);var Xo=6e4,Zo=36e5;function Jo(e,t){var n;Ko(1,arguments);var r=function(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}(null!==(n=null==t?void 0:t.additionalDigits)&&void 0!==n?n:2);if(2!==r&&1!==r&&0!==r)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var o,i=function(e){var t,n={},r=e.split(ei.dateTimeDelimiter);if(r.length>2)return n;/:/.test(r[0])?t=r[0]:(n.date=r[0],t=r[1],ei.timeZoneDelimiter.test(n.date)&&(n.date=e.split(ei.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length)));if(t){var o=ei.timezone.exec(t);o?(n.time=t.replace(o[1],""),n.timezone=o[1]):n.time=t}return n}(e);if(i.date){var s=function(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};var o=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:null===i?o:100*i,restDateString:e.slice((r[1]||r[2]).length)}}(i.date,r);o=function(e,t){if(null===t)return new Date(NaN);var n=e.match(ti);if(!n)return new Date(NaN);var r=!!n[4],o=oi(n[1]),i=oi(n[2])-1,s=oi(n[3]),a=oi(n[4]),l=oi(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,a,l)?function(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var o=r.getUTCDay()||7,i=7*(t-1)+n+1-o;return r.setUTCDate(r.getUTCDate()+i),r}(t,a,l):new Date(NaN);var c=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(si[t]||(ai(e)?29:28))}(t,i,s)&&function(e,t){return t>=1&&t<=(ai(e)?366:365)}(t,o)?(c.setUTCFullYear(t,i,Math.max(o,s)),c):new Date(NaN)}(s.restDateString,s.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var a,l=o.getTime(),c=0;if(i.time&&(c=function(e){var t=e.match(ni);if(!t)return NaN;var n=ii(t[1]),r=ii(t[2]),o=ii(t[3]);if(!function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,r,o))return NaN;return n*Zo+r*Xo+1e3*o}(i.time),isNaN(c)))return new Date(NaN);if(!i.timezone){var u=new Date(l+c),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return a=function(e){if("Z"===e)return 0;var t=e.match(ri);if(!t)return 0;var n="+"===t[1]?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,o))return NaN;return n*(r*Zo+o*Xo)}(i.timezone),isNaN(a)?new Date(NaN):new Date(l+c+a)}var ei={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ti=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ni=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ri=/^([+-])(\d{2})(?::?(\d{2}))?$/;function oi(e){return e?parseInt(e):1}function ii(e){return e&&parseFloat(e.replace(",","."))||0}var si=[31,null,31,30,31,30,31,31,30,31,30,31];function ai(e){return e%400==0||e%4==0&&e%100!=0}function li({onClose:e}){const{postDate:t,postType:n}=(0,i.useSelect)((e=>({postDate:e(Jn).getEditedPostAttribute("date"),postType:e(Jn).getCurrentPostType()})),[]),{editPost:r}=(0,i.useDispatch)(Jn),[a,l]=(0,o.useState)(qo(new Date(t))),u=(0,i.useSelect)((e=>e(s.store).getEntityRecords("postType",n,{status:"publish,future",after:qo(a).toISOString(),before:Qo(a).toISOString(),exclude:[e(Jn).getCurrentPostId()],per_page:100,_fields:"id,date"})),[a,n]),d=(0,o.useMemo)((()=>(u||[]).map((({date:e})=>({date:new Date(e)})))),[u]),p=(0,v.getSettings)(),m=/a(?!\\)/i.test(p.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,o.createElement)(c.__experimentalPublishDateTimePicker,{currentDate:t,onChange:e=>r({date:e}),is12Hour:m,events:d,onMonthPreviewed:e=>l(Jo(e)),onClose:e})}function ci(e){return ui(e)}function ui({full:e=!1}={}){const{date:t,isFloating:n}=(0,i.useSelect)((e=>({date:e(Jn).getEditedPostAttribute("date"),isFloating:e(Jn).isEditedPostDateFloating()})),[]);return e?di(t):function(e,{isFloating:t=!1,now:n=new Date}={}){if(!e||t)return(0,qt.__)("Immediately");if(!function(e){const{timezone:t}=(0,v.getSettings)(),n=Number(t.offset),r=e.getTimezoneOffset()/60*-1;return n===r}(n))return di(e);const r=(0,v.getDate)(e);if(pi(r,n))return(0,qt.sprintf)((0,qt.__)("Today at %s"),(0,v.dateI18n)((0,qt._x)("g:i a","post schedule time format"),r));const o=new Date(n);if(o.setDate(o.getDate()+1),pi(r,o))return(0,qt.sprintf)((0,qt.__)("Tomorrow at %s"),(0,v.dateI18n)((0,qt._x)("g:i a","post schedule time format"),r));if(r.getFullYear()===n.getFullYear())return(0,v.dateI18n)((0,qt._x)("F j g:i a","post schedule date format without year"),r);return(0,v.dateI18n)((0,qt._x)("F j, Y g:i a","post schedule full date format"),r)}(t,{isFloating:n})}function di(e){const t=(0,v.getDate)(e),n=function(){const{timezone:e}=(0,v.getSettings)();if(e.abbr&&isNaN(Number(e.abbr)))return e.abbr;return`UTC${e.offset<0?"":"+"}${e.offset}`}(),r=(0,v.dateI18n)((0,qt._x)("F j, Y g:i a","post schedule full date format"),t);return(0,qt.isRTL)()?`${n} ${r}`:`${r} ${n}`}function pi(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}var mi=window.wp.a11y;const hi=3,gi={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function fi({onSelect:e,taxonomy:t}){const{_terms:n,showTerms:r}=(0,i.useSelect)((e=>{const n=e(s.store).getEntityRecords("taxonomy",t.slug,gi);return{_terms:n,showTerms:n?.length>=hi}}),[t.slug]);if(!r)return null;const a=eo(n);return(0,o.createElement)("div",{className:"editor-post-taxonomies__flat-term-most-used"},(0,o.createElement)(br.BaseControl.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label"},t.labels.most_used),(0,o.createElement)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list"},a.map((t=>(0,o.createElement)("li",{key:t.id},(0,o.createElement)(br.Button,{variant:"link",onClick:()=>e(t)},t.name))))))}const _i=[],vi=20,yi={per_page:vi,_fields:"id,name",context:"view"},bi=(e,t)=>Zr(e).toLowerCase()===Zr(t).toLowerCase(),Ei=(e,t)=>e.map((e=>t.find((t=>bi(t.name,e))).id));function Si({slug:e}){var t,n;const[r,l]=(0,o.useState)([]),[c,u]=(0,o.useState)(""),d=(0,a.useDebounce)(u,500),{terms:p,termIds:m,taxonomy:h,hasAssignAction:g,hasCreateAction:f,hasResolvedTerms:_}=(0,i.useSelect)((t=>{var n,r;const{getCurrentPost:o,getEditedPostAttribute:i}=t(Jn),{getEntityRecords:a,getTaxonomy:l,hasFinishedResolution:c}=t(s.store),u=o(),d=l(e),p=d?i(d.rest_base):_i,m={...yi,include:p.join(","),per_page:-1};return{hasCreateAction:!!d&&(null!==(n=u._links?.["wp:action-create-"+d.rest_base])&&void 0!==n&&n),hasAssignAction:!!d&&(null!==(r=u._links?.["wp:action-assign-"+d.rest_base])&&void 0!==r&&r),taxonomy:d,termIds:p,terms:p.length?a("taxonomy",e,m):_i,hasResolvedTerms:c("getEntityRecords",["taxonomy",e,m])}}),[e]),{searchResults:v}=(0,i.useSelect)((t=>{const{getEntityRecords:n}=t(s.store);return{searchResults:c?n("taxonomy",e,{...yi,search:c}):_i}}),[c,e]);(0,o.useEffect)((()=>{if(_){const e=(null!=p?p:[]).map((e=>Zr(e.name)));l(e)}}),[p,_]);const y=(0,o.useMemo)((()=>(null!=v?v:[]).map((e=>Zr(e.name)))),[v]),{editPost:b}=(0,i.useDispatch)(Jn),{saveEntityRecord:E}=(0,i.useDispatch)(s.store),{createErrorNotice:S}=(0,i.useDispatch)(Gt.store);if(!g)return null;function w(e){b({[h.rest_base]:e})}const k=null!==(t=h?.labels?.add_new_item)&&void 0!==t?t:"post_tag"===e?(0,qt.__)("Add new tag"):(0,qt.__)("Add new Term"),P=null!==(n=h?.labels?.singular_name)&&void 0!==n?n:"post_tag"===e?(0,qt.__)("Tag"):(0,qt.__)("Term"),C=(0,qt.sprintf)((0,qt._x)("%s added","term"),P),T=(0,qt.sprintf)((0,qt._x)("%s removed","term"),P),x=(0,qt.sprintf)((0,qt._x)("Remove %s","term"),P);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(br.FormTokenField,{__next40pxDefaultSize:!0,value:r,suggestions:y,onChange:function(t){const n=[...null!=p?p:[],...null!=v?v:[]],r=t.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]),o=r.filter((e=>!n.find((t=>bi(t.name,e)))));if(l(r),0===o.length)return w(Ei(r,n));f&&Promise.all(o.map((t=>async function(t){try{const n=await E("taxonomy",e,t,{throwOnError:!0});return Jr(n)}catch(e){if("term_exists"!==e.code)throw e;return{id:e.data.term_id,name:t.name}}}({name:t})))).then((e=>{const t=n.concat(e);return w(Ei(r,t))})).catch((e=>{S(e.message,{type:"snackbar"})}))},onInputChange:d,maxSuggestions:vi,label:k,messages:{added:C,removed:T,remove:x}}),(0,o.createElement)(fi,{taxonomy:h,onSelect:function(t){var n;if(m.includes(t.id))return;const r=[...m,t.id],o="post_tag"===e?(0,qt.__)("Tag"):(0,qt.__)("Term"),i=(0,qt.sprintf)((0,qt._x)("%s added","term"),null!==(n=h?.labels?.singular_name)&&void 0!==n?n:o);(0,mi.speak)(i,"assertive"),w(r)}}))}var wi=(0,br.withFilters)("editor.PostTaxonomyType")(Si);const ki=()=>{const e=[(0,qt.__)("Suggestion:"),(0,o.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,qt.__)("Add tags"))];return(0,o.createElement)(br.PanelBody,{initialOpen:!1,title:e},(0,o.createElement)("p",null,(0,qt.__)("Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.")),(0,o.createElement)(wi,{slug:"post_tag"}))};class Pi extends o.Component{constructor(e){super(e),this.state={hadTagsWhenOpeningThePanel:e.hasTags}}render(){return this.state.hadTagsWhenOpeningThePanel?null:(0,o.createElement)(ki,null)}}var Ci=(0,a.compose)((0,i.withSelect)((e=>{const t=e(Jn).getCurrentPostType(),n=e(s.store).getTaxonomy("post_tag"),r=n&&e(Jn).getEditedPostAttribute(n.rest_base);return{areTagsFetched:void 0!==n,isPostTypeSupported:n&&n.types.some((e=>e===t)),hasTags:r&&r.length}})),(0,a.ifCondition)((({areTagsFetched:e,isPostTypeSupported:t})=>t&&e)))(Pi);const Ti=(e,t)=>Po.filter((t=>e?.includes(t.id))).find((e=>e.id===t)),xi=({suggestedPostFormat:e,suggestionText:t,onUpdatePostFormat:n})=>(0,o.createElement)(br.Button,{variant:"link",onClick:()=>n(e)},t);function Bi(){const{currentPostFormat:e,suggestion:t}=(0,i.useSelect)((e=>{var t;const{getEditedPostAttribute:n,getSuggestedPostFormat:r}=e(Jn),o=null!==(t=e(s.store).getThemeSupports().formats)&&void 0!==t?t:[];return{currentPostFormat:n("format"),suggestion:Ti(o,r())}}),[]),{editPost:n}=(0,i.useDispatch)(Jn),r=[(0,qt.__)("Suggestion:"),(0,o.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,qt.__)("Use a post format"))];return t&&t.id!==e?(0,o.createElement)(br.PanelBody,{initialOpen:!1,title:r},(0,o.createElement)("p",null,(0,qt.__)("Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.")),(0,o.createElement)("p",null,(0,o.createElement)(xi,{onUpdatePostFormat:e=>n({format:e}),suggestedPostFormat:t.id,suggestionText:(0,qt.sprintf)((0,qt.__)('Apply the "%1$s" format.'),t.caption)}))):null}const Ai={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view"},Ii=8,Ni=[];function Di({slug:e}){var t,n;const[r,l]=(0,o.useState)(!1),[c,u]=(0,o.useState)(""),[d,p]=(0,o.useState)(""),[m,h]=(0,o.useState)(!1),[g,f]=(0,o.useState)(""),[_,v]=(0,o.useState)([]),y=(0,a.useDebounce)(mi.speak,500),{hasCreateAction:b,hasAssignAction:E,terms:S,loading:w,availableTerms:k,taxonomy:P}=(0,i.useSelect)((t=>{var n,r;const{getCurrentPost:o,getEditedPostAttribute:i}=t(Jn),{getTaxonomy:a,getEntityRecords:l,isResolving:c}=t(s.store),u=a(e),d=o();return{hasCreateAction:!!u&&(null!==(n=d._links?.["wp:action-create-"+u.rest_base])&&void 0!==n&&n),hasAssignAction:!!u&&(null!==(r=d._links?.["wp:action-assign-"+u.rest_base])&&void 0!==r&&r),terms:u?i(u.rest_base):Ni,loading:c("getEntityRecords",["taxonomy",e,Ai]),availableTerms:l("taxonomy",e,Ai)||Ni,taxonomy:u}}),[e]),{editPost:C}=(0,i.useDispatch)(Jn),{saveEntityRecord:T}=(0,i.useDispatch)(s.store),x=(0,o.useMemo)((()=>function(e,t){const n=e=>-1!==t.indexOf(e.id)||void 0!==e.children&&e.children.map(n).filter((e=>e)).length>0,r=[...e];return r.sort(((e,t)=>{const r=n(e),o=n(t);return r===o?0:r&&!o?-1:!r&&o?1:0})),r}(Xr(k),S)),[k]),{createErrorNotice:B}=(0,i.useDispatch)(Gt.store);if(!E)return null;const A=e=>{C({[P.rest_base]:e})},I=e=>e.map((e=>(0,o.createElement)("div",{key:e.id,className:"editor-post-taxonomies__hierarchical-terms-choice"},(0,o.createElement)(br.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:-1!==S.indexOf(e.id),onChange:()=>{(e=>{const t=S.includes(e)?S.filter((t=>t!==e)):[...S,e];A(t)})(parseInt(e.id,10))},label:(0,xr.decodeEntities)(e.name)}),!!e.children.length&&(0,o.createElement)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices"},I(e.children))))),N=(t,n,r)=>{var o;return null!==(o=P?.labels?.[t])&&void 0!==o?o:"category"===e?n:r},D=N("add_new_item",(0,qt.__)("Add new category"),(0,qt.__)("Add new term")),R=N("new_item_name",(0,qt.__)("Add new category"),(0,qt.__)("Add new term")),O=N("parent_item",(0,qt.__)("Parent Category"),(0,qt.__)("Parent Term")),L=`— ${O} —`,U=D,M=null!==(t=P?.labels?.search_items)&&void 0!==t?t:(0,qt.__)("Search Terms"),F=null!==(n=P?.name)&&void 0!==n?n:(0,qt.__)("Terms"),z=k.length>=Ii;return(0,o.createElement)(br.Flex,{direction:"column",gap:"4"},z&&(0,o.createElement)(br.TextControl,{__nextHasNoMarginBottom:!0,label:M,value:g,onChange:e=>{const t=x.map(function(e){const t=n=>{if(""===e)return n;const r={...n};return r.children.length>0&&(r.children=r.children.map(t).filter((e=>e))),(-1!==r.name.toLowerCase().indexOf(e.toLowerCase())||r.children.length>0)&&r};return t}(e)).filter((e=>e)),n=e=>{let t=0;for(let r=0;r{h(!m)},className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":m,variant:"link"},D)),m&&(0,o.createElement)("form",{onSubmit:async t=>{var n;if(t.preventDefault(),""===c||r)return;const o=function(e,t,n){return e.find((e=>(!e.parent&&!t||parseInt(e.parent)===parseInt(t))&&e.name.toLowerCase()===n.toLowerCase()))}(k,d,c);if(o)return S.some((e=>e===o.id))||A([...S,o.id]),u(""),void p("");let i;l(!0);try{i=await(s={name:c,parent:d||void 0},T("taxonomy",e,s,{throwOnError:!0}))}catch(e){return void B(e.message,{type:"snackbar"})}var s;const a="category"===e?(0,qt.__)("Category"):(0,qt.__)("Term"),m=(0,qt.sprintf)((0,qt._x)("%s added","term"),null!==(n=P?.labels?.singular_name)&&void 0!==n?n:a);(0,mi.speak)(m,"assertive"),l(!1),u(""),p(""),A([...S,i.id])}},(0,o.createElement)(br.Flex,{direction:"column",gap:"4"},(0,o.createElement)(br.TextControl,{__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-input",label:R,value:c,onChange:e=>{u(e)},required:!0}),!!k.length&&(0,o.createElement)(br.TreeSelect,{__nextHasNoMarginBottom:!0,label:O,noOptionLabel:L,onChange:e=>{p(e)},selectedId:d,tree:x}),(0,o.createElement)(br.FlexItem,null,(0,o.createElement)(br.Button,{variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit"},U)))))}var Ri=(0,br.withFilters)("editor.PostTaxonomyType")(Di);var Oi=function(){const e=(0,i.useSelect)((e=>{const t=e(Jn).getCurrentPostType(),{canUser:n,getEntityRecord:r,getTaxonomy:o}=e(s.store),i=o("category"),a=n("read","settings")?r("root","site")?.default_category:void 0,l=a?r("taxonomy","category",a):void 0,c=i&&i.types.some((e=>e===t)),u=i&&e(Jn).getEditedPostAttribute(i.rest_base);return!!i&&!!l&&c&&(0===u?.length||1===u?.length&&l?.id===u[0])}),[]),[t,n]=(0,o.useState)(!1);if((0,o.useEffect)((()=>{e&&n(!0)}),[e]),!t)return null;const r=[(0,qt.__)("Suggestion:"),(0,o.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,qt.__)("Assign a category"))];return(0,o.createElement)(br.PanelBody,{initialOpen:!1,title:r},(0,o.createElement)("p",null,(0,qt.__)("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")),(0,o.createElement)(Ri,{slug:"category"}))};var Li=(0,o.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(S.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"}));function Ui(e){const t=[];return e.forEach((e=>{t.push(e),t.push(...Ui(e.innerBlocks))})),t}function Mi(e){const{selectBlock:t}=(0,i.useDispatch)(c.store);return(0,o.createElement)(br.__unstableMotion.img,{tabIndex:0,role:"button","aria-label":(0,qt.__)("Select image block."),onClick:()=>{t(e.clientId)},onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(t(e.clientId),n.preventDefault())},key:e.clientId,alt:e.attributes.alt,src:e.attributes.url,animate:{opacity:1},exit:{opacity:0,scale:0},style:{width:"36px",height:"36px",objectFit:"cover",borderRadius:"2px",cursor:"pointer"},whileHover:{scale:1.08}})}function Fi(){const[e,t]=(0,o.useState)(!1),{editorBlocks:n,mediaUpload:r}=(0,i.useSelect)((e=>({editorBlocks:e(Jn).getEditorBlocks(),mediaUpload:e(c.store).getSettings().mediaUpload})),[]),s=Ui(n).filter((e=>"core/image"===e.name&&e.attributes.url&&!e.attributes.id)),{updateBlockAttributes:a}=(0,i.useDispatch)(c.store);if(!r||!s.length)return null;const l=[(0,qt.__)("Suggestion:"),(0,o.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,qt.__)("External media"))];return(0,o.createElement)(br.PanelBody,{initialOpen:!0,title:l},(0,o.createElement)("p",null,(0,qt.__)("There are some external images in the post which can be uploaded to the media library. Images coming from different domains may not always display correctly, load slowly for visitors, or be removed unexpectedly.")),(0,o.createElement)("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:"8px"}},(0,o.createElement)(br.__unstableAnimatePresence,null,s.map((e=>(0,o.createElement)(Mi,{key:e.clientId,...e})))),e?(0,o.createElement)(br.Spinner,null):(0,o.createElement)(br.Button,{icon:Li,variant:"primary",onClick:function(){t(!0),Promise.all(s.map((e=>window.fetch(e.attributes.url.includes("?")?e.attributes.url:e.attributes.url+"?").then((e=>e.blob())).then((t=>new Promise(((n,o)=>{r({filesList:[t],onFileChange:([t])=>{(0,ho.isBlobURL)(t.url)||(a(e.clientId,{id:t.id,url:t.url}),n())},onError(){o()}})}))))))).finally((()=>{t(!1)}))}},(0,qt.__)("Upload all"))))}var zi=function({children:e}){const{isBeingScheduled:t,isRequestingSiteIcon:n,hasPublishAction:r,siteIconUrl:a,siteTitle:l,siteHome:c}=(0,i.useSelect)((e=>{var t;const{getCurrentPost:n,isEditedPostBeingScheduled:r}=e(Jn),{getEntityRecord:o,isResolving:i}=e(s.store),a=o("root","__unstableBase",void 0)||{};return{hasPublishAction:null!==(t=n()._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:r(),isRequestingSiteIcon:i("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:a.site_icon_url,siteTitle:a.name,siteHome:a.home&&(0,y.filterURLForDisplay)(a.home)}}),[]);let u,d,p=(0,o.createElement)(br.Icon,{className:"components-site-icon",size:"36px",icon:zo});return a&&(p=(0,o.createElement)("img",{alt:(0,qt.__)("Site Icon"),className:"components-site-icon",src:a})),n&&(p=null),r?t?(u=(0,qt.__)("Are you ready to schedule?"),d=(0,qt.__)("Your work will be published at the specified date and time.")):(u=(0,qt.__)("Are you ready to publish?"),d=(0,qt.__)("Double-check your settings before publishing.")):(u=(0,qt.__)("Are you ready to submit for review?"),d=(0,qt.__)("When you’re ready, submit your work for review, and an Editor will be able to approve it for you.")),(0,o.createElement)("div",{className:"editor-post-publish-panel__prepublish"},(0,o.createElement)("div",null,(0,o.createElement)("strong",null,u)),(0,o.createElement)("p",null,d),(0,o.createElement)("div",{className:"components-site-card"},p,(0,o.createElement)("div",{className:"components-site-info"},(0,o.createElement)("span",{className:"components-site-name"},(0,xr.decodeEntities)(l)||(0,qt.__)("(Untitled)")),(0,o.createElement)("span",{className:"components-site-home"},c))),(0,o.createElement)(Fi,null),r&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(br.PanelBody,{initialOpen:!1,title:[(0,qt.__)("Visibility:"),(0,o.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,o.createElement)(Wo,null))]},(0,o.createElement)(Vo,null)),(0,o.createElement)(br.PanelBody,{initialOpen:!1,title:[(0,qt.__)("Publish:"),(0,o.createElement)("span",{className:"editor-post-publish-panel__link",key:"label"},(0,o.createElement)(ci,null))]},(0,o.createElement)(li,null))),(0,o.createElement)(Bi,null),(0,o.createElement)(Ci,null),(0,o.createElement)(Oi,null),e)};const Hi="%postname%",Vi="%pagename%";function ji({text:e,onCopy:t,children:n}){const r=(0,a.useCopyToClipboard)(e,t);return(0,o.createElement)(br.Button,{variant:"secondary",ref:r},n)}class Wi extends o.Component{constructor(){super(...arguments),this.state={showCopyConfirmation:!1},this.onCopy=this.onCopy.bind(this),this.onSelectInput=this.onSelectInput.bind(this),this.postLink=(0,o.createRef)()}componentDidMount(){this.props.focusOnMount&&this.postLink.current.focus()}componentWillUnmount(){clearTimeout(this.dismissCopyConfirmation)}onCopy(){this.setState({showCopyConfirmation:!0}),clearTimeout(this.dismissCopyConfirmation),this.dismissCopyConfirmation=setTimeout((()=>{this.setState({showCopyConfirmation:!1})}),4e3)}onSelectInput(e){e.target.select()}render(){const{children:e,isScheduled:t,post:n,postType:r}=this.props,i=r?.labels?.singular_name,s=r?.labels?.view_item,a=r?.labels?.add_new_item,l="future"===n.status?(e=>{const{slug:t}=e;return e.permalink_template.includes(Hi)?e.permalink_template.replace(Hi,t):e.permalink_template.includes(Vi)?e.permalink_template.replace(Vi,t):e.permalink_template})(n):n.link,c=(0,y.addQueryArgs)("post-new.php",{post_type:n.type}),u=t?(0,o.createElement)(o.Fragment,null,(0,qt.__)("is now scheduled. It will go live on")," ",(0,o.createElement)(ci,null),"."):(0,qt.__)("is now live.");return(0,o.createElement)("div",{className:"post-publish-panel__postpublish"},(0,o.createElement)(br.PanelBody,{className:"post-publish-panel__postpublish-header"},(0,o.createElement)("a",{ref:this.postLink,href:l},(0,xr.decodeEntities)(n.title)||(0,qt.__)("(no title)"))," ",u),(0,o.createElement)(br.PanelBody,null,(0,o.createElement)("p",{className:"post-publish-panel__postpublish-subheader"},(0,o.createElement)("strong",null,(0,qt.__)("What’s next?"))),(0,o.createElement)("div",{className:"post-publish-panel__postpublish-post-address-container"},(0,o.createElement)(br.TextControl,{__nextHasNoMarginBottom:!0,className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:(0,qt.sprintf)((0,qt.__)("%s address"),i),value:(0,y.safeDecodeURIComponent)(l),onFocus:this.onSelectInput}),(0,o.createElement)("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap"},(0,o.createElement)(ji,{text:l,onCopy:this.onCopy},this.state.showCopyConfirmation?(0,qt.__)("Copied!"):(0,qt.__)("Copy")))),(0,o.createElement)("div",{className:"post-publish-panel__postpublish-buttons"},!t&&(0,o.createElement)(br.Button,{variant:"primary",href:l},s),(0,o.createElement)(br.Button,{variant:t?"primary":"secondary",href:c},a))),e)}}var $i=(0,i.withSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPost:n,isCurrentPostScheduled:r}=e(Jn),{getPostType:o}=e(s.store);return{post:n(),postType:o(t("type")),isScheduled:r()}}))(Wi);class Gi extends o.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this)}componentDidUpdate(e){e.isPublished&&!this.props.isSaving&&this.props.isDirty&&this.props.onClose()}onSubmit(){const{onClose:e,hasPublishAction:t,isPostTypeViewable:n}=this.props;t&&n||e()}render(){const{forceIsDirty:e,isBeingScheduled:t,isPublished:n,isPublishSidebarEnabled:r,isScheduled:i,isSaving:s,isSavingNonPostEntityChanges:a,onClose:l,onTogglePublishSidebar:c,PostPublishExtension:u,PrePublishExtension:d,...p}=this.props,{hasPublishAction:m,isDirty:h,isPostTypeViewable:g,...f}=p,_=n||i&&t,v=!_&&!s,y=_&&!s;return(0,o.createElement)("div",{className:"editor-post-publish-panel",...f},(0,o.createElement)("div",{className:"editor-post-publish-panel__header"},y?(0,o.createElement)(br.Button,{onClick:l,icon:Fo,label:(0,qt.__)("Close panel")}):(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"editor-post-publish-panel__header-publish-button"},(0,o.createElement)(Mo,{focusOnMount:!0,onSubmit:this.onSubmit,forceIsDirty:e})),(0,o.createElement)("div",{className:"editor-post-publish-panel__header-cancel-button"},(0,o.createElement)(br.Button,{disabled:a,onClick:l,variant:"secondary"},(0,qt.__)("Cancel"))))),(0,o.createElement)("div",{className:"editor-post-publish-panel__content"},v&&(0,o.createElement)(zi,null,d&&(0,o.createElement)(d,null)),y&&(0,o.createElement)($i,{focusOnMount:!0},u&&(0,o.createElement)(u,null)),s&&(0,o.createElement)(br.Spinner,null)),(0,o.createElement)("div",{className:"editor-post-publish-panel__footer"},(0,o.createElement)(br.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,qt.__)("Always show pre-publish checks."),checked:r,onChange:c})))}}var Ki=(0,a.compose)([(0,i.withSelect)((e=>{var t;const{getPostType:n}=e(s.store),{getCurrentPost:r,getEditedPostAttribute:o,isCurrentPostPublished:i,isCurrentPostScheduled:a,isEditedPostBeingScheduled:l,isEditedPostDirty:c,isAutosavingPost:u,isSavingPost:d,isSavingNonPostEntityChanges:p}=e(Jn),{isPublishSidebarEnabled:m}=e(Jn),h=n(o("type"));return{hasPublishAction:null!==(t=r()._links?.["wp:action-publish"])&&void 0!==t&&t,isPostTypeViewable:h?.viewable,isBeingScheduled:l(),isDirty:c(),isPublished:i(),isPublishSidebarEnabled:m(),isSaving:d()&&!u(),isSavingNonPostEntityChanges:p(),isScheduled:a()}})),(0,i.withDispatch)(((e,{isPublishSidebarEnabled:t})=>{const{disablePublishSidebar:n,enablePublishSidebar:r}=e(Jn);return{onTogglePublishSidebar:()=>{t?n():r()}}})),br.withFocusReturn,br.withConstrainedTabbing])(Gi);var Yi=(0,o.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(S.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-4v-2.4L14 14l1-1-3-3-3 3 1 1 1.2-1.2v2.4H7.7c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4H9l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8 0 1-.8 1.8-1.7 1.8z"}));var qi=(0,o.forwardRef)((function({icon:e,size:t=24,...n},r){return(0,o.cloneElement)(e,{width:t,height:t,...n,ref:r})}));var Qi=(0,o.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(S.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));var Xi=(0,o.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(S.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"}));function Zi({forceIsDirty:e,showIconLabels:t=!1}){const[n,r]=(0,o.useState)(!1),s=(0,a.useViewportMatch)("small"),{isAutosaving:l,isDirty:c,isNew:u,isPending:d,isPublished:p,isSaveable:m,isSaving:h,isScheduled:g,hasPublishAction:f}=(0,i.useSelect)((t=>{var n;const{isEditedPostNew:r,isCurrentPostPublished:o,isCurrentPostScheduled:i,isEditedPostDirty:s,isSavingPost:a,isEditedPostSaveable:l,getCurrentPost:c,isAutosavingPost:u,getEditedPostAttribute:d}=t(Jn);return{isAutosaving:u(),isDirty:e||s(),isNew:r(),isPending:"pending"===d("status"),isPublished:o(),isSaving:a(),isSaveable:l(),isScheduled:i(),hasPublishAction:null!==(n=c()?._links?.["wp:action-publish"])&&void 0!==n&&n}}),[e]),{savePost:_}=(0,i.useDispatch)(Jn),v=(0,a.usePrevious)(h);if((0,o.useEffect)((()=>{let e;return v&&!h&&(r(!0),e=setTimeout((()=>{r(!1)}),1e3)),()=>clearTimeout(e)}),[h]),!f&&d)return null;if(p||g)return null;const y=d?(0,qt.__)("Save as pending"):(0,qt.__)("Save draft"),b=(0,qt.__)("Save"),E=n||!u&&!c,S=h||E,w=h||E||!m;let k;return h?k=l?(0,qt.__)("Autosaving"):(0,qt.__)("Saving"):E?k=(0,qt.__)("Saved"):s?k=y:t&&(k=b),(0,o.createElement)(br.Button,{className:m||h?lr()({"editor-post-save-draft":!S,"editor-post-saved-state":S,"is-saving":h,"is-autosaving":l,"is-saved":E,[(0,br.__unstableGetAnimateClassName)({type:"loading"})]:h}):void 0,onClick:w?void 0:()=>_(),shortcut:w?void 0:vr.displayShortcut.primary("s"),showTooltip:!0,variant:"tertiary",icon:s?void 0:Yi,label:k||y,"aria-disabled":w},S&&(0,o.createElement)(qi,{icon:E?Qi:Xi}),k)}var Ji=(0,a.compose)([(0,i.withSelect)((e=>{var t;const{getCurrentPost:n,getCurrentPostType:r}=e(Jn);return{hasPublishAction:null!==(t=n()._links?.["wp:action-publish"])&&void 0!==t&&t,postType:r()}}))])((function({hasPublishAction:e,children:t}){return e?t:null}));function es({children:e}){return(0,o.createElement)(Gr,{supportKeys:"slug"},e)}class ts extends o.Component{constructor({postSlug:e,postTitle:t,postID:n}){super(...arguments),this.state={editedSlug:(0,y.safeDecodeURIComponent)(e)||(0,y.cleanForSlug)(t)||n},this.setSlug=this.setSlug.bind(this)}setSlug(e){const{postSlug:t,onUpdateSlug:n}=this.props,{value:r}=e.target,o=(0,y.cleanForSlug)(r);o!==t&&n(o)}render(){const{editedSlug:e}=this.state;return(0,o.createElement)(es,null,(0,o.createElement)(br.TextControl,{__nextHasNoMarginBottom:!0,label:(0,qt.__)("Slug"),autoComplete:"off",spellCheck:"false",value:e,onChange:e=>this.setState({editedSlug:e}),onBlur:this.setSlug,className:"editor-post-slug"}))}}var ns=(0,a.compose)([(0,i.withSelect)((e=>{const{getCurrentPost:t,getEditedPostAttribute:n}=e(Jn),{id:r}=t();return{postSlug:n("slug"),postTitle:n("title"),postID:r}})),(0,i.withDispatch)((e=>{const{editPost:t}=e(Jn);return{onUpdateSlug(e){t({slug:e})}}}))])(ts);var rs=(0,a.compose)([(0,i.withSelect)((e=>{var t;const n=e(Jn).getCurrentPost();return{hasStickyAction:null!==(t=n._links?.["wp:action-sticky"])&&void 0!==t&&t,postType:e(Jn).getCurrentPostType()}}))])((function({hasStickyAction:e,postType:t,children:n}){return"post"===t&&e?n:null}));var os=(0,a.compose)([(0,i.withSelect)((e=>({postSticky:e(Jn).getEditedPostAttribute("sticky")}))),(0,i.withDispatch)((e=>({onUpdateSticky(t){e(Jn).editPost({sticky:t})}})))])((function({onUpdateSticky:e,postSticky:t=!1}){return(0,o.createElement)(rs,null,(0,o.createElement)(br.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,qt.__)("Stick to the top of the blog"),checked:t,onChange:()=>e(!t)}))}));var is=(0,a.compose)([(0,i.withSelect)((e=>{const{isSavingPost:t,isCurrentPostPublished:n,isCurrentPostScheduled:r}=e(Jn);return{isSaving:t(),isPublished:n(),isScheduled:r()}})),(0,i.withDispatch)((e=>{const{editPost:t,savePost:n}=e(Jn);return{onClick:()=>{t({status:"draft"}),n()}}}))])((function({isSaving:e,isPublished:t,isScheduled:n,onClick:r}){const[i,s]=(0,o.useState)(!1);if(!t&&!n)return null;let a;return t?a=(0,qt.__)("Are you sure you want to unpublish this post?"):n&&(a=(0,qt.__)("Are you sure you want to unschedule this post?")),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(br.Button,{className:"editor-post-switch-to-draft",onClick:()=>{s(!0)},disabled:e,variant:"secondary",style:{flexGrow:"1",justifyContent:"center"}},(0,qt.__)("Switch to draft")),(0,o.createElement)(br.__experimentalConfirmDialog,{isOpen:i,onConfirm:()=>{s(!1),r()},onCancel:()=>s(!1)},a))})),ss=window.wp.privateApis;const{lock:as,unlock:ls}=(0,ss.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/editor"),{ReusableBlocksRenameHint:cs}=ls(c.privateApis);function us(){const{syncStatus:e,postType:t}=(0,i.useSelect)((e=>{const{getEditedPostAttribute:t}=e(Jn),n=t("meta");return{syncStatus:"unsynced"===n?.wp_pattern_sync_status?"unsynced":t("wp_pattern_sync_status"),postType:t("type")}}));return"wp_block"!==t?null:(0,o.createElement)(br.PanelRow,{className:"edit-post-sync-status"},(0,o.createElement)("span",null,(0,qt.__)("Sync status")),(0,o.createElement)("div",null,"unsynced"===e?(0,qt.__)("Not synced"):(0,qt.__)("Fully synced")))}function ds(){const{editPost:e}=(0,i.useDispatch)(Jn),[t,n]=(0,o.useState)(!1),[r,s]=(0,o.useState)(void 0),{postType:a,isNewPost:l}=(0,i.useSelect)((e=>{const{getEditedPostAttribute:t,isCleanNewPost:n}=e(Jn);return{postType:t("type"),isNewPost:n()}}),[]);(0,o.useEffect)((()=>{l&&"wp_block"===a&&n(!0)}),[]);return"wp_block"===a&&l?(0,o.createElement)(o.Fragment,null,t&&(0,o.createElement)(br.Modal,{title:(0,qt.__)("Set pattern sync status"),onRequestClose:()=>{n(!1)},overlayClassName:"reusable-blocks-menu-items__convert-modal"},(0,o.createElement)("form",{onSubmit:t=>{t.preventDefault(),n(!1),e({meta:{wp_pattern_sync_status:r}})}},(0,o.createElement)(br.__experimentalVStack,{spacing:"5"},(0,o.createElement)(cs,null),(0,o.createElement)(br.ToggleControl,{label:(0,qt._x)("Synced","Option that makes an individual pattern synchronized"),help:(0,qt.__)("Editing the pattern will update it anywhere it is used."),checked:!r,onChange:()=>{s(r?void 0:"unsynced")}}),(0,o.createElement)(br.__experimentalHStack,{justify:"right"},(0,o.createElement)(br.Button,{variant:"primary",type:"submit"},(0,qt.__)("Create"))))))):null}const ps=e=>e;var ms=(0,a.compose)([(0,i.withSelect)((e=>({postType:e(Jn).getCurrentPostType(),taxonomies:e(s.store).getTaxonomies({per_page:-1})})))])((function({postType:e,taxonomies:t,taxonomyWrapper:n=ps}){return(null!=t?t:[]).filter((t=>t.types.includes(e))).filter((e=>e.visibility?.show_ui)).map((e=>{const t=e.hierarchical?Ri:wi;return(0,o.createElement)(o.Fragment,{key:`taxonomy-${e.slug}`},n((0,o.createElement)(t,{slug:e.slug}),e))}))}));var hs=(0,a.compose)([(0,i.withSelect)((e=>({postType:e(Jn).getCurrentPostType(),taxonomies:e(s.store).getTaxonomies({per_page:-1})})))])((function({postType:e,taxonomies:t,children:n}){const r=t?.some((t=>t.types.includes(e)));return r?n:null})),gs=n(773);function fs(){const e=(0,a.useInstanceId)(fs),{content:t,blocks:n,type:r,id:l}=(0,i.useSelect)((e=>{const{getEditedEntityRecord:t}=e(s.store),{getCurrentPostType:n,getCurrentPostId:r}=e(Jn),o=n(),i=r(),a=t("postType",o,i);return{content:a?.content,blocks:a?.blocks,type:o,id:i}}),[]),{editEntityRecord:c}=(0,i.useDispatch)(s.store),u=(0,o.useMemo)((()=>t instanceof Function?t({blocks:n}):n?(0,_.__unstableSerializeAndClean)(n):t),[t,n]);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(br.VisuallyHidden,{as:"label",htmlFor:`post-content-${e}`},(0,qt.__)("Type text or HTML")),(0,o.createElement)(gs.Z,{autoComplete:"off",dir:"auto",value:u,onChange:e=>{c("postType",r,l,{content:e.target.value,blocks:void 0,selection:void 0})},className:"editor-post-text-editor",id:`post-content-${e}`,placeholder:(0,qt.__)("Start writing with text or HTML")}))}var _s=window.wp.dom;const vs=/[\r\n]+/g;var ys=(0,o.forwardRef)((function(e,t){const n=(0,o.useRef)(),[r,s]=(0,o.useState)(!1),{editPost:l}=(0,i.useDispatch)(Jn),{insertDefaultBlock:u,clearSelectedBlock:d,insertBlocks:p}=(0,i.useDispatch)(c.store),{isCleanNewPost:m,title:h,placeholder:g,hasFixedToolbar:f}=(0,i.useSelect)((e=>{const{getEditedPostAttribute:t,isCleanNewPost:n}=e(Jn),{getSettings:r}=e(c.store),{titlePlaceholder:o,hasFixedToolbar:i}=r();return{isCleanNewPost:n(),title:t("title"),placeholder:o,hasFixedToolbar:i}}),[]);function v(e){p(e,0)}function y(e){l({title:e})}(0,o.useImperativeHandle)(t,(()=>({focus:()=>{n?.current?.focus()}}))),(0,o.useEffect)((()=>{if(!n.current)return;const{defaultView:e}=n.current.ownerDocument,{name:t,parent:r}=e,o="editor-canvas"===t?r.document:e.document,{activeElement:i,body:s}=o;!m||i&&s!==i||n.current.focus()}),[m]);const[b,E]=(0,o.useState)({});function S(){s(!1),E({})}const w=lr()("wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",{"is-selected":r,"has-fixed-toolbar":f}),k=(0,xr.decodeEntities)(g)||(0,qt.__)("Add title"),{ref:P}=(0,sr.__unstableUseRichText)({value:h,onChange:function(e){y(e.replace(vs," "))},placeholder:k,selectionStart:b.start,selectionEnd:b.end,onSelectionChange(e,t){E((n=>{const{start:r,end:o}=n;return r===e&&o===t?n:{start:e,end:t}}))},__unstableDisableFormats:!0,preserveWhiteSpace:!0});return(0,o.createElement)(Gr,{supportKeys:"title"},(0,o.createElement)("h1",{ref:(0,a.useMergeRefs)([P,n]),contentEditable:!0,className:w,"aria-label":k,role:"textbox","aria-multiline":"true",onFocus:function(){s(!0),d()},onBlur:S,onKeyDown:function(e){e.keyCode===vr.ENTER&&(e.preventDefault(),u(void 0,void 0,0))},onKeyPress:S,onPaste:function(e){const t=e.clipboardData;let n="",r="";try{n=t.getData("text/plain"),r=t.getData("text/html")}catch(e){try{r=t.getData("Text")}catch(e){return}}window.console.log("Received HTML:\n\n",r),window.console.log("Received plain text:\n\n",n);const o=(0,_.pasteHandler)({HTML:r,plainText:n});if(e.preventDefault(),o.length)if("string"!=typeof o){const[e]=o;h||"core/heading"!==e.name&&"core/paragraph"!==e.name?v(o):(y((0,_s.__unstableStripHTML)(e.attributes.content)),v(o.slice(1)))}else{const e={...(0,sr.create)({html:h}),...b},t=(0,sr.insert)(e,(0,sr.create)({html:(0,_s.__unstableStripHTML)(o)}));y((0,sr.toHTMLString)({value:t})),E({start:t.start,end:t.end})}}}))}));function bs(){const{isNew:e,isDeleting:t,postId:n}=(0,i.useSelect)((e=>{const t=e(Jn);return{isNew:t.isEditedPostNew(),isDeleting:t.isDeletingPost(),postId:t.getCurrentPostId()}}),[]),{trashPost:r}=(0,i.useDispatch)(Jn);return e||!n?null:(0,o.createElement)(br.Button,{className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:t,"aria-disabled":t,onClick:t?void 0:()=>r()},(0,qt.__)("Move to trash"))}var Es=(0,i.withSelect)((e=>{const{isEditedPostNew:t,getCurrentPostId:n,getCurrentPostType:r}=e(Jn),{getPostType:o,canUser:i}=e(s.store),a=n(),l=o(r()),c=l?.rest_base||"";return{isNew:t(),postId:a,canUserDelete:!(!a||!c)&&i("delete",c,a)}}))((function({isNew:e,postId:t,canUserDelete:n,children:r}){return!e&&t&&n?r:null}));function Ss({onClose:e}){const{isEditable:t,postSlug:n,viewPostLabel:r,postLink:a,permalinkPrefix:l,permalinkSuffix:u}=(0,i.useSelect)((e=>{var t;const n=e(Jn).getCurrentPost(),r=e(Jn).getCurrentPostType(),o=e(s.store).getPostType(r),i=e(Jn).getPermalinkParts(),a=null!==(t=n?._links?.["wp:action-publish"])&&void 0!==t&&t;return{isEditable:e(Jn).isPermalinkEditable()&&a,postSlug:(0,y.safeDecodeURIComponent)(e(Jn).getEditedPostSlug()),viewPostLabel:o?.labels.view_item,postLink:n.link,permalinkPrefix:i?.prefix,permalinkSuffix:i?.suffix}}),[]),{editPost:d}=(0,i.useDispatch)(Jn),[p,m]=(0,o.useState)(!1);return(0,o.createElement)("div",{className:"editor-post-url"},(0,o.createElement)(c.__experimentalInspectorPopoverHeader,{title:(0,qt.__)("URL"),onClose:e}),t&&(0,o.createElement)(br.TextControl,{__nextHasNoMarginBottom:!0,label:(0,qt.__)("Permalink"),value:p?"":n,autoComplete:"off",spellCheck:"false",help:(0,o.createElement)(o.Fragment,null,(0,qt.__)("The last part of the URL.")," ",(0,o.createElement)(br.ExternalLink,{href:(0,qt.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink")},(0,qt.__)("Learn more."))),onChange:e=>{d({slug:e}),e?p&&m(!1):p||m(!0)},onBlur:e=>{d({slug:(0,y.cleanForSlug)(e.target.value)}),p&&m(!1)}}),t&&(0,o.createElement)("h3",{className:"editor-post-url__link-label"},null!=r?r:(0,qt.__)("View post")),(0,o.createElement)("p",null,(0,o.createElement)(br.ExternalLink,{className:"editor-post-url__link",href:a,target:"_blank"},t?(0,o.createElement)(o.Fragment,null,(0,o.createElement)("span",{className:"editor-post-url__link-prefix"},l),(0,o.createElement)("span",{className:"editor-post-url__link-slug"},n),(0,o.createElement)("span",{className:"editor-post-url__link-suffix"},u)):a)))}function ws({children:e}){const t=(0,i.useSelect)((e=>{const t=e(Jn).getCurrentPostType(),n=e(s.store).getPostType(t);if(!n?.viewable)return!1;if(!e(Jn).getCurrentPost().link)return!1;return!!e(Jn).getPermalinkParts()}),[]);return t?e:null}function ks(){return Ps()}function Ps(){const e=(0,i.useSelect)((e=>e(Jn).getPermalink()),[]);return(0,y.filterURLForDisplay)((0,y.safeDecodeURIComponent)(e))}var Cs=(0,a.compose)([(0,i.withSelect)((e=>{var t;const{getCurrentPost:n,getCurrentPostType:r}=e(Jn);return{hasPublishAction:null!==(t=n()._links?.["wp:action-publish"])&&void 0!==t&&t,postType:r()}}))])((function({hasPublishAction:e,render:t}){return t({canEdit:e})}));var Ts=(0,o.createElement)(S.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(S.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),xs=window.wp.wordcount;function Bs(){const e=(0,i.useSelect)((e=>e(Jn).getEditedPostAttribute("content")),[]),t=(0,qt._x)("words","Word count type. Do not translate!");return(0,o.createElement)("span",{className:"word-count"},(0,xs.count)(e,t))}const As=189;function Is(){const e=(0,i.useSelect)((e=>e(Jn).getEditedPostAttribute("content")),[]),t=(0,qt._x)("words","Word count type. Do not translate!"),n=Math.round((0,xs.count)(e,t)/As),r=0===n?(0,o.createInterpolateElement)((0,qt.__)("< 1 minute"),{span:(0,o.createElement)("span",null)}):(0,o.createInterpolateElement)((0,qt.sprintf)((0,qt._n)("%d minute","%d minutes",n),n),{span:(0,o.createElement)("span",null)});return(0,o.createElement)("span",{className:"time-to-read"},r)}function Ns(){const e=(0,i.useSelect)((e=>e(Jn).getEditedPostAttribute("content")),[]);return(0,xs.count)(e,"characters_including_spaces")}var Ds=function({hasOutlineItemsDisabled:e,onRequestClose:t}){const{headingCount:n,paragraphCount:r,numberOfBlocks:s}=(0,i.useSelect)((e=>{const{getGlobalBlockCount:t}=e(c.store);return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}}),[]);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":(0,qt.__)("Document Statistics"),tabIndex:"0"},(0,o.createElement)("ul",{role:"list",className:"table-of-contents__counts"},(0,o.createElement)("li",{className:"table-of-contents__count"},(0,qt.__)("Words"),(0,o.createElement)(Bs,null)),(0,o.createElement)("li",{className:"table-of-contents__count"},(0,qt.__)("Characters"),(0,o.createElement)("span",{className:"table-of-contents__number"},(0,o.createElement)(Ns,null))),(0,o.createElement)("li",{className:"table-of-contents__count"},(0,qt.__)("Time to read"),(0,o.createElement)(Is,null)),(0,o.createElement)("li",{className:"table-of-contents__count"},(0,qt.__)("Headings"),(0,o.createElement)("span",{className:"table-of-contents__number"},n)),(0,o.createElement)("li",{className:"table-of-contents__count"},(0,qt.__)("Paragraphs"),(0,o.createElement)("span",{className:"table-of-contents__number"},r)),(0,o.createElement)("li",{className:"table-of-contents__count"},(0,qt.__)("Blocks"),(0,o.createElement)("span",{className:"table-of-contents__number"},s)))),n>0&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("hr",null),(0,o.createElement)("h2",{className:"table-of-contents__title"},(0,qt.__)("Document Outline")),(0,o.createElement)(fr,{onSelect:t,hasOutlineItemsDisabled:e})))};var Rs=(0,o.forwardRef)((function({hasOutlineItemsDisabled:e,repositionDropdown:t,...n},r){const s=(0,i.useSelect)((e=>!!e(c.store).getBlockCount()),[]);return(0,o.createElement)(br.Dropdown,{popoverProps:{placement:t?"right":"bottom"},className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:({isOpen:e,onToggle:t})=>(0,o.createElement)(br.Button,{...n,ref:r,onClick:s?t:void 0,icon:Ts,"aria-expanded":e,"aria-haspopup":"true",label:(0,qt.__)("Details"),tooltipPosition:"bottom","aria-disabled":!s}),renderContent:({onClose:t})=>(0,o.createElement)(Ds,{onRequestClose:t,hasOutlineItemsDisabled:e})})}));function Os(){const{__experimentalGetDirtyEntityRecords:e}=(0,i.useSelect)(s.store);return(0,o.useEffect)((()=>{const t=t=>{if(e().length>0)return t.returnValue=(0,qt.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}}),[e]),null}var Ls=window.wp.patterns;var Us=(0,a.createHigherOrderComponent)((e=>(0,i.withRegistry)((t=>{const{useSubRegistry:n=!0,registry:r,...s}=t;if(!n)return(0,o.createElement)(e,{...s});const[a,l]=(0,o.useState)(null);return(0,o.useEffect)((()=>{const e=(0,i.createRegistry)({"core/block-editor":c.storeConfig},r);e.registerStore("core/editor",Zn),l(e)}),[r]),a?(0,o.createElement)(i.RegistryProvider,{value:a},(0,o.createElement)(e,{...s})):null}))),"withRegistryProvider");const Ms=(e,t)=>`${t}`,Fs=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,zs=e=>{const{title:t,foreign_landing_url:n,creator:r,creator_url:o,license:i,license_version:s,license_url:a}=e,l=((e,t)=>{let n=e.trim();return"pdm"!==e&&(n=e.toUpperCase().replace("SAMPLING","Sampling")),t&&(n+=` ${t}`),["pdm","cc0"].includes(e)||(n=`CC ${n}`),n})(i,s),c=(0,xr.decodeEntities)(r);let u;return u=c?t?(0,qt.sprintf)((0,qt._x)('"%1$s" by %2$s/ %3$s',"caption"),Ms(n,(0,xr.decodeEntities)(t)),o?Ms(o,c):c,a?Ms(`${a}?ref=openverse`,l):l):(0,qt.sprintf)((0,qt._x)("Work by %2$s/ %3$s","caption"),Fs(n),o?Ms(o,c):c,a?Ms(`${a}?ref=openverse`,l):l):t?(0,qt.sprintf)((0,qt._x)('"%1$s"/ %2$s',"caption"),Ms(n,(0,xr.decodeEntities)(t)),a?Ms(`${a}?ref=openverse`,l):l):(0,qt.sprintf)((0,qt._x)("Work/ %2$s","caption"),Fs(n),a?Ms(`${a}?ref=openverse`,l):l),u.replace(/\s{2}/g," ")},Hs=async(e={})=>(await(0,i.resolveSelect)(s.store).getMediaItems({...e,orderBy:e?.search?"relevance":"date"})).map((e=>({...e,alt:e.alt_text,url:e.source_url,previewUrl:e.media_details?.sizes?.medium?.source_url,caption:e.caption?.raw})));var Vs=[{name:"images",labels:{name:(0,qt.__)("Images"),search_items:(0,qt.__)("Search images")},mediaType:"image",async fetch(e={}){return Hs({...e,media_type:"image"})}},{name:"videos",labels:{name:(0,qt.__)("Videos"),search_items:(0,qt.__)("Search videos")},mediaType:"video",async fetch(e={}){return Hs({...e,media_type:"video"})}},{name:"audio",labels:{name:(0,qt.__)("Audio"),search_items:(0,qt.__)("Search audio")},mediaType:"audio",async fetch(e={}){return Hs({...e,media_type:"audio"})}},{name:"openverse",labels:{name:(0,qt.__)("Openverse"),search_items:(0,qt.__)("Search Openverse")},mediaType:"image",async fetch(e={}){const t={...e,mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"},n={per_page:"page_size",search:"q"},r=new URL("https://api.openverse.engineering/v1/images/");Object.entries(t).forEach((([e,t])=>{const o=n[e]||e;r.searchParams.set(o,t)}));const o=await window.fetch(r,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}});return(await o.json()).results.map((e=>({...e,title:e.title?.toLowerCase().startsWith("file:")?e.title.slice(5):e.title,sourceId:e.id,id:void 0,caption:zs(e),previewUrl:e.thumbnail})))},getReportUrl:({sourceId:e})=>`https://wordpress.org/openverse/image/${e}/report/`,isExternalResource:!0}],js=window.wp.mediaUtils;const Ws=()=>{};function $s({additionalData:e={},allowedTypes:t,filesList:n,maxUploadFileSize:r,onError:o=Ws,onFileChange:s}){const{getCurrentPostId:a,getEditorSettings:l}=(0,i.select)(Jn),c=l().allowedMimeTypes;r=r||l().maxUploadFileSize,(0,js.uploadMedia)({allowedTypes:t,filesList:n,onFileChange:s,additionalData:{post:a(),...e},maxUploadFileSize:r,onError:({message:e})=>o(e),wpAllowedMimeTypes:c})}const Gs=[],Ks=["__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","__experimentalPreferredStyleVariations","__experimentalSetIsInserterOpened","__unstableGalleryWithImageBlocks","alignWide","allowedBlockTypes","blockInspectorTabs","allowedMimeTypes","bodyPlaceholder","canLockBlocks","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","focusMode","distractionFree","fontSizes","gradients","generateAnchors","hasFixedToolbar","hasInlineToolbar","isDistractionFree","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isRTL","keepCaretInsideBlock","locale","maxWidth","onUpdateDefaultBlockStyles","postContentAttributes","postsPerPage","readOnly","styles","template","templateLock","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableIsPreviewMode","__unstableResolvedAssets","__unstableIsBlockBasedTheme"];var Ys=function(e,t){var n,r;const{reusableBlocks:a,hasUploadPermissions:l,canUseUnfilteredHTML:c,userCanCreatePages:u,pageOnFront:d,postType:p,userPatternCategories:m}=(0,i.useSelect)((e=>{var t;const{canUserUseUnfilteredHTML:n,getCurrentPostType:r}=e(Jn),i="web"===o.Platform.OS,{canUser:a,getEntityRecord:l,getUserPatternCategories:c}=e(s.store),u=a("read","settings")?l("root","site"):void 0;return{canUseUnfilteredHTML:n(),reusableBlocks:i?e(s.store).getEntityRecords("postType","wp_block",{per_page:-1}):Gs,hasUploadPermissions:null===(t=a("create","media"))||void 0===t||t,userCanCreatePages:a("create","pages"),pageOnFront:u?.page_on_front,postType:r(),userPatternCategories:c()}}),[]),h=null!==(n=e.__experimentalAdditionalBlockPatterns)&&void 0!==n?n:e.__experimentalBlockPatterns,g=null!==(r=e.__experimentalAdditionalBlockPatternCategories)&&void 0!==r?r:e.__experimentalBlockPatternCategories,{restBlockPatterns:f,restBlockPatternCategories:_}=(0,i.useSelect)((e=>({restBlockPatterns:e(s.store).getBlockPatterns(),restBlockPatternCategories:e(s.store).getBlockPatternCategories()})),[]),v=(0,o.useMemo)((()=>[...h||[],...f||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name)))).filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(p)))),[h,f,p]),y=(0,o.useMemo)((()=>[...g||[],..._||[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))),[g,_]),{undo:b}=(0,i.useDispatch)(Jn),{saveEntityRecord:E}=(0,i.useDispatch)(s.store),S=(0,o.useCallback)((e=>u?E("postType","page",e):Promise.reject({message:(0,qt.__)("You do not have permission to create Pages.")})),[E,u]);return(0,o.useMemo)((()=>({...Object.fromEntries(Object.entries(e).filter((([e])=>Ks.includes(e)))),mediaUpload:l?$s:void 0,__experimentalReusableBlocks:a,__experimentalBlockPatterns:v,__experimentalBlockPatternCategories:y,__experimentalUserPatternCategories:m,__experimentalFetchLinkSuggestions:(t,n)=>(0,s.__experimentalFetchLinkSuggestions)(t,n,e),inserterMediaCategories:Vs,__experimentalFetchRichUrlData:s.__experimentalFetchUrlData,__experimentalCanUserUseUnfilteredHTML:c,__experimentalUndo:b,outlineMode:t,__experimentalCreatePageEntity:S,__experimentalUserCanCreatePages:u,pageOnFront:d,__experimentalPreferPatternsOnRoot:t})),[e,l,a,m,v,y,c,b,t,S,u,d])};const{ExperimentalBlockEditorProvider:qs}=ls(c.privateApis),{PatternsMenuItems:Qs}=ls(Ls.privateApis),Xs=Us((({__unstableTemplate:e,post:t,settings:n,recovery:r,initialEdits:a,children:l,BlockEditorProviderComponent:u=qs})=>{const d=(0,o.useMemo)((()=>"wp_template"===t.type?{}:{postId:t.id,postType:t.type}),[t.id,t.type]),{editorSettings:p,selection:m,isReady:h}=(0,i.useSelect)((e=>{const{getEditorSettings:t,getEditorSelection:n,__unstableIsEditorReady:r}=e(Jn);return{editorSettings:t(),isReady:r(),selection:n()}}),[]),{id:g,type:f}=null!=e?e:t,[_,v,y]=(0,s.useEntityBlockEditor)("postType",f,{id:g}),b=Ys(p,!!e),{updatePostLock:E,setupEditor:S,updateEditorSettings:w,__experimentalTearDownEditor:k}=(0,i.useDispatch)(Jn),{createWarningNotice:P}=(0,i.useDispatch)(Gt.store);return(0,o.useLayoutEffect)((()=>{if(!r)return E(n.postLock),S(t,a,n.template),n.autosave&&P((0,qt.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:(0,qt.__)("View the autosave"),url:n.autosave.editLink}]}),()=>{k()}}),[]),(0,o.useEffect)((()=>{w(n)}),[n]),h?(0,o.createElement)(s.EntityProvider,{kind:"root",type:"site"},(0,o.createElement)(s.EntityProvider,{kind:"postType",type:t.type,id:t.id},(0,o.createElement)(c.BlockContextProvider,{value:d},(0,o.createElement)(u,{value:_,onChange:y,onInput:v,selection:m,settings:b,useSubRegistry:!1},l,(0,o.createElement)(Qs,null))))):null}));var Zs=function(e){return(0,o.createElement)(Xs,{...e,BlockEditorProviderComponent:c.BlockEditorProvider},e.children)},Js=window.wp.serverSideRender,ea=n.n(Js);function ta(e,t,n=[]){const r=(0,o.forwardRef)(((n,r)=>(E()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),(0,o.createElement)(t,{ref:r,...n}))));return n.forEach((n=>{r[n]=ta(e+"."+n,t[n])})),r}function na(e,t){return(...n)=>(E()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),t(...n))}const ra=ta("RichText",c.RichText,["Content"]);ra.isEmpty=na("RichText.isEmpty",c.RichText.isEmpty);const oa=ta("Autocomplete",c.Autocomplete),ia=ta("AlignmentToolbar",c.AlignmentToolbar),sa=ta("BlockAlignmentToolbar",c.BlockAlignmentToolbar),aa=ta("BlockControls",c.BlockControls,["Slot"]),la=ta("BlockEdit",c.BlockEdit),ca=ta("BlockEditorKeyboardShortcuts",c.BlockEditorKeyboardShortcuts),ua=ta("BlockFormatControls",c.BlockFormatControls,["Slot"]),da=ta("BlockIcon",c.BlockIcon),pa=ta("BlockInspector",c.BlockInspector),ma=ta("BlockList",c.BlockList),ha=ta("BlockMover",c.BlockMover),ga=ta("BlockNavigationDropdown",c.BlockNavigationDropdown),fa=ta("BlockSelectionClearer",c.BlockSelectionClearer),_a=ta("BlockSettingsMenu",c.BlockSettingsMenu),va=ta("BlockTitle",c.BlockTitle),ya=ta("BlockToolbar",c.BlockToolbar),ba=ta("ColorPalette",c.ColorPalette),Ea=ta("ContrastChecker",c.ContrastChecker),Sa=ta("CopyHandler",c.CopyHandler),wa=ta("DefaultBlockAppender",c.DefaultBlockAppender),ka=ta("FontSizePicker",c.FontSizePicker),Pa=ta("Inserter",c.Inserter),Ca=ta("InnerBlocks",c.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),Ta=ta("InspectorAdvancedControls",c.InspectorAdvancedControls,["Slot"]),xa=ta("InspectorControls",c.InspectorControls,["Slot"]),Ba=ta("PanelColorSettings",c.PanelColorSettings),Aa=ta("PlainText",c.PlainText),Ia=ta("RichTextShortcut",c.RichTextShortcut),Na=ta("RichTextToolbarButton",c.RichTextToolbarButton),Da=ta("__unstableRichTextInputEvent",c.__unstableRichTextInputEvent),Ra=ta("MediaPlaceholder",c.MediaPlaceholder),Oa=ta("MediaUpload",c.MediaUpload),La=ta("MediaUploadCheck",c.MediaUploadCheck),Ua=ta("MultiSelectScrollIntoView",c.MultiSelectScrollIntoView),Ma=ta("NavigableToolbar",c.NavigableToolbar),Fa=ta("ObserveTyping",c.ObserveTyping),za=ta("SkipToSelectedBlock",c.SkipToSelectedBlock),Ha=ta("URLInput",c.URLInput),Va=ta("URLInputButton",c.URLInputButton),ja=ta("URLPopover",c.URLPopover),Wa=ta("Warning",c.Warning),$a=ta("WritingFlow",c.WritingFlow),Ga=na("createCustomColorsHOC",c.createCustomColorsHOC),Ka=na("getColorClassName",c.getColorClassName),Ya=na("getColorObjectByAttributeValues",c.getColorObjectByAttributeValues),qa=na("getColorObjectByColorValue",c.getColorObjectByColorValue),Qa=na("getFontSize",c.getFontSize),Xa=na("getFontSizeClass",c.getFontSizeClass),Za=na("withColorContext",c.withColorContext),Ja=na("withColors",c.withColors),el=na("withFontSizes",c.withFontSizes),tl=rr,nl=rr;function rl(e){return E()("wp.editor.cleanForSlug",{since:"12.7",plugin:"Gutenberg",alternative:"wp.url.cleanForSlug"}),(0,y.cleanForSlug)(e)}const ol={};as(ol,{ExperimentalEditorProvider:Xs,EntitiesSavedStatesExtensible:Lr})}(),(window.wp=window.wp||{}).editor=r}();