: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const footer = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
/* harmony default export */ const library_footer = (footer);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/sidebar.js
const sidebar = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
/* harmony default export */ const library_sidebar = (sidebar);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js
const symbolFilled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"
/* harmony default export */ const symbol_filled = (symbolFilled);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/utils/get-template-part-icon.js
* Helper function to retrieve the corresponding icon by name.
* @param {string} iconName The name of the icon.
* @return {Object} The corresponding icon.
function getTemplatePartIcon(iconName) {
if ('header' === iconName) {
} else if ('footer' === iconName) {
} else if ('sidebar' === iconName) {
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/selectors.js
* Shared reference to an empty object for cases where it is important to avoid
* returning a new object reference on every invocation, as in a connected or
* other pure component which performs `shouldComponentUpdate` check on props.
* This should be used as a last resort, since the normalized data should be
* maintained by the reducer result in state.
* Returns true if any past editor history snapshots exist, or false otherwise.
* @param {Object} state Global application state.
* @return {boolean} Whether undo history exists.
const hasEditorUndo = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
return select(external_wp_coreData_namespaceObject.store).hasUndo();
* Returns true if any future editor history snapshots exist, or false
* @param {Object} state Global application state.
* @return {boolean} Whether redo history exists.
const hasEditorRedo = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
return select(external_wp_coreData_namespaceObject.store).hasRedo();
* Returns true if the currently edited post is yet to be saved, or false if
* the post has been saved.
* @param {Object} state Global application state.
* @return {boolean} Whether the post is new.
function isEditedPostNew(state) {
return getCurrentPost(state).status === 'auto-draft';
* Returns true if content includes unsaved changes, or false otherwise.
* @param {Object} state Editor state.
* @return {boolean} Whether content includes unsaved changes.
function hasChangedContent(state) {
const edits = getPostEdits(state);
return 'content' in edits;
* Returns true if there are unsaved values for the current edit session, or
* false if the editing state matches the saved or new post.
* @param {Object} state Global application state.
* @return {boolean} Whether unsaved values exist.
const isEditedPostDirty = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
// Edits should contain only fields which differ from the saved post (reset
// at initial load and save complete). Thus, a non-empty edits state can be
// inferred to contain unsaved values.
const postType = getCurrentPostType(state);
const postId = getCurrentPostId(state);
return select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord('postType', postType, postId);
* Returns true if there are unsaved edits for entities other than
* the editor's post, and false otherwise.
* @param {Object} state Global application state.
* @return {boolean} Whether there are edits or not.
const hasNonPostEntityChanges = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
const dirtyEntityRecords = select(external_wp_coreData_namespaceObject.store).__experimentalGetDirtyEntityRecords();
} = getCurrentPost(state);
return dirtyEntityRecords.some(entityRecord => entityRecord.kind !== 'postType' || entityRecord.name !== type || entityRecord.key !== id);
* Returns true if there are no unsaved values for the current edit session and
* if the currently edited post is new (has never been saved before).
* @param {Object} state Global application state.
* @return {boolean} Whether new post and unsaved values exist.
function isCleanNewPost(state) {
return !isEditedPostDirty(state) && isEditedPostNew(state);
* Returns the post currently being edited in its last known saved state, not
* including unsaved edits. Returns an object containing relevant default post
* values if the post has not yet been saved.
* @param {Object} state Global application state.
* @return {Object} Post object.
const getCurrentPost = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
const postId = getCurrentPostId(state);
const postType = getCurrentPostType(state);
const post = select(external_wp_coreData_namespaceObject.store).getRawEntityRecord('postType', postType, postId);
// This exists for compatibility with the previous selector behavior
// which would guarantee an object return based on the editor reducer's
// default empty object state.
* Returns the post type of the post currently being edited.
* @param {Object} state Global application state.
* @return {string} Post type.
function getCurrentPostType(state) {
* Returns the ID of the post currently being edited, or null if the post has
* @param {Object} state Global application state.
* @return {?number} ID of current post.
function getCurrentPostId(state) {
* Returns the template ID currently being rendered/edited
* @param {Object} state Global application state.
* @return {string?} Template ID.
function getCurrentTemplateId(state) {
* Returns the number of revisions of the post currently being edited.
* @param {Object} state Global application state.
* @return {number} Number of revisions.
function getCurrentPostRevisionsCount(state) {
var _getCurrentPost$_link;
return (_getCurrentPost$_link = getCurrentPost(state)._links?.['version-history']?.[0]?.count) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : 0;
* Returns the last revision ID of the post currently being edited,
* or null if the post has no revisions.
* @param {Object} state Global application state.
* @return {?number} ID of the last revision.
function getCurrentPostLastRevisionId(state) {
var _getCurrentPost$_link2;
return (_getCurrentPost$_link2 = getCurrentPost(state)._links?.['predecessor-version']?.[0]?.id) !== null && _getCurrentPost$_link2 !== void 0 ? _getCurrentPost$_link2 : null;
* Returns any post values which have been changed in the editor but not yet
* @param {Object} state Global application state.
* @return {Object} Object of key value pairs comprising unsaved edits.
const getPostEdits = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
const postType = getCurrentPostType(state);
const postId = getCurrentPostId(state);
return select(external_wp_coreData_namespaceObject.store).getEntityRecordEdits('postType', postType, postId) || EMPTY_OBJECT;
* Returns an attribute value of the saved post.
* @param {Object} state Global application state.
* @param {string} attributeName Post attribute name.
* @return {*} Post attribute value.
function getCurrentPostAttribute(state, attributeName) {
return getCurrentPostType(state);
return getCurrentPostId(state);
const post = getCurrentPost(state);
if (!post.hasOwnProperty(attributeName)) {
return getPostRawValue(post[attributeName]);
* Returns a single attribute of the post being edited, preferring the unsaved
* edit if one exists, but merging with the attribute value for the last known
* saved state of the post (this is needed for some nested attributes like meta).
* @param {Object} state Global application state.
* @param {string} attributeName Post attribute name.
* @return {*} Post attribute value.
const getNestedEditedPostProperty = (0,external_wp_data_namespaceObject.createSelector)((state, attributeName) => {
const edits = getPostEdits(state);
if (!edits.hasOwnProperty(attributeName)) {
return getCurrentPostAttribute(state, attributeName);
...getCurrentPostAttribute(state, attributeName),
}, (state, attributeName) => [getCurrentPostAttribute(state, attributeName), getPostEdits(state)[attributeName]]);
* Returns a single attribute of the post being edited, preferring the unsaved
* edit if one exists, but falling back to the attribute for the last known
* saved state of the post.
* @param {Object} state Global application state.
* @param {string} attributeName Post attribute name.
* @return {*} Post attribute value.
function getEditedPostAttribute(state, attributeName) {
return getEditedPostContent(state);
// Fall back to saved post value if not edited.
const edits = getPostEdits(state);
if (!edits.hasOwnProperty(attributeName)) {
return getCurrentPostAttribute(state, attributeName);
// Merge properties are objects which contain only the patch edit in state,
// and thus must be merged with the current post attribute.
if (EDIT_MERGE_PROPERTIES.has(attributeName)) {
return getNestedEditedPostProperty(state, attributeName);
return edits[attributeName];
* Returns an attribute value of the current autosave revision for a post, or
* null if there is no autosave for the post.
* @deprecated since 5.6. Callers should use the `getAutosave( postType, postId, userId )` selector
* from the '@wordpress/core-data' package and access properties on the returned
* autosave object using getPostRawValue.
* @param {Object} state Global application state.
* @param {string} attributeName Autosave attribute name.
* @return {*} Autosave attribute value.
const getAutosaveAttribute = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, attributeName) => {
if (!AUTOSAVE_PROPERTIES.includes(attributeName) && attributeName !== 'preview_link') {
const postType = getCurrentPostType(state);
// Currently template autosaving is not supported.
if (postType === 'wp_template') {
const postId = getCurrentPostId(state);
const currentUserId = select(external_wp_coreData_namespaceObject.store).getCurrentUser()?.id;
const autosave = select(external_wp_coreData_namespaceObject.store).getAutosave(postType, postId, currentUserId);
return getPostRawValue(autosave[attributeName]);
* Returns the current visibility of the post being edited, preferring the
* unsaved value if different than the saved post. The return value is one of
* "private", "password", or "public".
* @param {Object} state Global application state.
* @return {string} Post visibility.
function getEditedPostVisibility(state) {
const status = getEditedPostAttribute(state, 'status');
if (status === 'private') {
const password = getEditedPostAttribute(state, 'password');
* Returns true if post is pending review.
* @param {Object} state Global application state.
* @return {boolean} Whether current post is pending review.
function isCurrentPostPending(state) {
return getCurrentPost(state).status === 'pending';
* Return true if the current post has already been published.
* @param {Object} state Global application state.
* @param {Object?} currentPost Explicit current post for bypassing registry selector.
* @return {boolean} Whether the post has been published.
function isCurrentPostPublished(state, currentPost) {
const post = currentPost || getCurrentPost(state);
return ['publish', 'private'].indexOf(post.status) !== -1 || post.status === 'future' && !(0,external_wp_date_namespaceObject.isInTheFuture)(new Date(Number((0,external_wp_date_namespaceObject.getDate)(post.date)) - ONE_MINUTE_IN_MS));
* Returns true if post is already scheduled.
* @param {Object} state Global application state.
* @return {boolean} Whether current post is scheduled to be posted.
function isCurrentPostScheduled(state) {
return getCurrentPost(state).status === 'future' && !isCurrentPostPublished(state);
* Return true if the post being edited can be published.
* @param {Object} state Global application state.
* @return {boolean} Whether the post can been published.
function isEditedPostPublishable(state) {
const post = getCurrentPost(state);
// TODO: Post being publishable should be superset of condition of post
// being saveable. Currently this restriction is imposed at UI.
// See: <PostPublishButton /> (`isButtonEnabled` assigned by `isSaveable`).
return isEditedPostDirty(state) || ['publish', 'private', 'future'].indexOf(post.status) === -1;
* Returns true if the post can be saved, or false otherwise. A post must
* contain a title, an excerpt, or non-empty content to be valid for save.
* @param {Object} state Global application state.
* @return {boolean} Whether the post can be saved.
function isEditedPostSaveable(state) {
if (isSavingPost(state)) {
// TODO: Post should not be saveable if not dirty. Cannot be added here at
// this time since posts where meta boxes are present can be saved even if
// the post is not dirty. Currently this restriction is imposed at UI, but
// See: `isEditedPostPublishable` (includes `isEditedPostDirty` condition)
// See: <PostSavedState /> (`forceIsDirty` prop)
// See: <PostPublishButton /> (`forceIsDirty` prop)
// See: https://github.com/WordPress/gutenberg/pull/4184.
return !!getEditedPostAttribute(state, 'title') || !!getEditedPostAttribute(state, 'excerpt') || !isEditedPostEmpty(state) || external_wp_element_namespaceObject.Platform.OS === 'native';
* Returns true if the edited post has content. A post has content if it has at
* least one saveable block or otherwise has a non-empty content property
* @param {Object} state Global application state.
* @return {boolean} Whether post has content.