: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* The module also checks for sessionStorage support and conditionally exports the `LocalAutosaveMonitor` component based on that.
* @module LocalAutosaveMonitor
/* harmony default export */ const local_autosave_monitor = ((0,external_wp_compose_namespaceObject.ifCondition)(hasSessionStorageSupport)(LocalAutosaveMonitor));
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/page-attributes/check.js
* Wrapper component that renders its children only if the post type supports page attributes.
* @param {Object} props - The component props.
* @param {Element} props.children - The child components to render.
* @return {Component|null} The rendered child components or null if page attributes are not supported.
function PageAttributesCheck({
const supportsPageAttributes = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_coreData_namespaceObject.store);
const postType = getPostType(getEditedPostAttribute('type'));
return !!postType?.supports?.['page-attributes'];
// Only render fields if post type supports page attributes or available templates exist.
if (!supportsPageAttributes) {
/* harmony default export */ const page_attributes_check = (PageAttributesCheck);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-panel-row/index.js
const PostPanelRow = (0,external_wp_element_namespaceObject.forwardRef)(({
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
className: dist_clsx('editor-post-panel__row', className),
children: [label && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-post-panel__row-label",
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-post-panel__row-control",
/* harmony default export */ const post_panel_row = (PostPanelRow);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-type-support-check/index.js
* A component which renders its own children only if the current editor post
* type supports one of the given `supportKeys` prop.
* @param {Object} props Props.
* @param {Element} props.children Children to be rendered if post
* @param {(string|string[])} props.supportKeys String or string array of keys
* @return {Component} The component to be rendered.
function PostTypeSupportCheck({
const postType = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_coreData_namespaceObject.store);
return getPostType(getEditedPostAttribute('type'));
let isSupported = !!postType;
isSupported = (Array.isArray(supportKeys) ? supportKeys : [supportKeys]).some(key => !!postType.supports[key]);
/* harmony default export */ const post_type_support_check = (PostTypeSupportCheck);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/page-attributes/order.js
function PageAttributesOrder() {
const order = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _select$getEditedPost;
return (_select$getEditedPost = select(store_store).getEditedPostAttribute('menu_order')) !== null && _select$getEditedPost !== void 0 ? _select$getEditedPost : 0;
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const [orderInput, setOrderInput] = (0,external_wp_element_namespaceObject.useState)(null);
const setUpdatedOrder = value => {
const newOrder = Number(value);
if (Number.isInteger(newOrder) && value.trim?.() !== '') {
const value = orderInput !== null && orderInput !== void 0 ? orderInput : order;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, {
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Order'),
help: (0,external_wp_i18n_namespaceObject.__)('Set the page order.'),
onChange: setUpdatedOrder,
hideLabelFromVision: true,
* Renders the Page Attributes Order component. A number input in an editor interface
* for setting the order of a given page.
* @return {Component} The component to be rendered.
function PageAttributesOrderWithChecks() {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, {
supportKeys: "page-attributes",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageAttributesOrder, {})
function PostOrderToggle({
const order = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _select$getEditedPost2;
return (_select$getEditedPost2 = select(store_store).getEditedPostAttribute('menu_order')) !== null && _select$getEditedPost2 !== void 0 ? _select$getEditedPost2 : 0;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
className: "editor-post-order__panel-toggle",
// translators: %s: Current post parent.
"aria-label": (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Change order: %s'), order),
// Use internal state instead of a ref to make sure that the component
// re-renders when the popover's anchor updates.
const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
// Memoize popoverProps to avoid returning a new object every time.
const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
// Anchor the popover to the middle of the entire row so that it doesn't
// move around when the label changes.
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
label: (0,external_wp_i18n_namespaceObject.__)('Order'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
popoverProps: popoverProps,
className: "editor-post-order__panel-dropdown",
contentClassName: "editor-post-order__panel-dialog",
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostOrderToggle, {
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "editor-post-order",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
title: (0,external_wp_i18n_namespaceObject.__)('Order'),
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
children: [(0,external_wp_i18n_namespaceObject.__)('This attribute determines the order of pages in the Pages List block.'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children: (0,external_wp_i18n_namespaceObject.__)('Pages with the same order value will sorted alphabetically. Negative order values are also supported.')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageAttributesOrder, {})]
// EXTERNAL MODULE: ./node_modules/remove-accents/index.js
var remove_accents = __webpack_require__(9681);
var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/utils/terms.js
* Returns terms in a tree form.
* @param {Array} flatTerms Array of terms in flat format.
* @return {Array} Array of terms in tree format.
function buildTermsTree(flatTerms) {
const flatTermsWithParentAndChildren = flatTerms.map(term => {
// All terms should have a `parent` because we're about to index them by it.
if (flatTermsWithParentAndChildren.some(({
}) => parent === null)) {
return flatTermsWithParentAndChildren;
const termsByParent = flatTermsWithParentAndChildren.reduce((acc, term) => {
const fillWithChildren = terms => {
return terms.map(term => {
const children = termsByParent[term.id];
children: children && children.length ? fillWithChildren(children) : []
return fillWithChildren(termsByParent['0'] || []);
const unescapeString = arg => {
return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(arg);
* Returns a term object with name unescaped.
* @param {Object} term The term object to unescape.
* @return {Object} Term object with name property unescaped.
const unescapeTerm = term => {
name: unescapeString(term.name)
* Returns an array of term objects with names unescaped.
* The unescape of each term is performed using the unescapeTerm function.
* @param {Object[]} terms Array of term objects to unescape.
* @return {Object[]} Array of term objects unescaped.
const unescapeTerms = terms => {
return (terms !== null && terms !== void 0 ? terms : []).map(unescapeTerm);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/page-attributes/parent.js
function getTitle(post) {
return post?.title?.rendered ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(post.title.rendered) : `#${post.id} (${(0,external_wp_i18n_namespaceObject.__)('no title')})`;
const getItemPriority = (name, searchValue) => {
const normalizedName = remove_accents_default()(name || '').toLowerCase();
const normalizedSearch = remove_accents_default()(searchValue || '').toLowerCase();
if (normalizedName === normalizedSearch) {
if (normalizedName.startsWith(normalizedSearch)) {
return normalizedName.length;
* Renders the Page Attributes Parent component. A dropdown menu in an editor interface
* for selecting the parent page of a given page.
* @return {Component|null} The component to be rendered. Return null if post type is not hierarchical.
function PageAttributesParent() {
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const [fieldValue, setFieldValue] = (0,external_wp_element_namespaceObject.useState)(false);
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_coreData_namespaceObject.store);
const postTypeSlug = getEditedPostAttribute('type');
const pageId = getEditedPostAttribute('parent');
const pType = getPostType(postTypeSlug);
const postId = getCurrentPostId();
const postIsHierarchical = (_pType$hierarchical = pType?.hierarchical) !== null && _pType$hierarchical !== void 0 ? _pType$hierarchical : false;
_fields: 'id,title,parent'
// Perform a search when the field is changed.
query.search = fieldValue;
const parentPost = pageId ? getEntityRecord('postType', postTypeSlug, pageId) : null;
isHierarchical: postIsHierarchical,
parentPostTitle: parentPost ? getTitle(parentPost) : '',
pageItems: postIsHierarchical ? getEntityRecords('postType', postTypeSlug, query) : null
const parentOptions = (0,external_wp_element_namespaceObject.useMemo)(() => {
const getOptionsFromTree = (tree, level = 0) => {
const mappedNodes = tree.map(treeNode => [{
label: '— '.repeat(level) + (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(treeNode.name),
}, ...getOptionsFromTree(treeNode.children || [], level + 1)]);
const sortedNodes = mappedNodes.sort(([a], [b]) => {
const priorityA = getItemPriority(a.rawName, fieldValue);
const priorityB = getItemPriority(b.rawName, fieldValue);
return priorityA >= priorityB ? 1 : -1;
return sortedNodes.flat();
let tree = pageItems.map(item => ({
// Only build a hierarchical tree when not searching.
tree = buildTermsTree(tree);
const opts = getOptionsFromTree(tree);
// Ensure the current parent is in the options list.
const optsHasParent = opts.find(item => item.value === parentPostId);
if (parentPostTitle && !optsHasParent) {
}, [pageItems, fieldValue, parentPostTitle, parentPostId]);
* @param {string} inputValue The current value of the input field.
const handleKeydown = inputValue => {
setFieldValue(inputValue);
* Handle author selection.
* @param {Object} selectedPostId The selected Author.
const handleChange = selectedPostId => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ComboboxControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,