: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
function* iteratePath(tree, path) {
for (const branchName of path) {
const nextNode = currentNode.children[branchName];
function* iterateDescendants(node) {
const stack = Object.values(node.children);
const childNode = stack.pop();
stack.push(...Object.values(childNode.children));
function hasConflictingLock({
if (exclusive && locks.length) {
if (!exclusive && locks.filter(lock => lock.exclusive).length) {
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/locks/reducer.js
* Reducer returning locks.
* @param {Object} state Current state.
* @param {Object} action Dispatched action.
* @return {Object} Updated state.
function locks(state = DEFAULT_STATE, action) {
case 'ENQUEUE_LOCK_REQUEST':
requests: [request, ...state.requests]
case 'GRANT_LOCK_REQUEST':
const storePath = [store, ...path];
const newTree = deepCopyLocksTreePath(state.tree, storePath);
const node = getNode(newTree, storePath);
node.locks = [...node.locks, lock];
requests: state.requests.filter(r => r !== request),
const storePath = [lock.store, ...lock.path];
const newTree = deepCopyLocksTreePath(state.tree, storePath);
const node = getNode(newTree, storePath);
node.locks = node.locks.filter(l => l !== lock);
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/locks/selectors.js
function getPendingLockRequests(state) {
function isLockAvailable(state, store, path, {
const storePath = [store, ...path];
const locks = state.tree;
// Validate all parents and the node itself
for (const node of iteratePath(locks, storePath)) {
// iteratePath terminates early if path is unreachable, let's
// re-fetch the node and check it exists in the tree.
const node = getNode(locks, storePath);
// Validate all nested nodes
for (const descendant of iterateDescendants(node)) {
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/locks/engine.js
let state = locks(undefined, {
function processPendingLockRequests() {
for (const request of getPendingLockRequests(state)) {
if (isLockAvailable(state, store, path, {
type: 'GRANT_LOCK_REQUEST',
function acquire(store, path, exclusive) {
return new Promise(resolve => {
type: 'ENQUEUE_LOCK_REQUEST',
processPendingLockRequests();
processPendingLockRequests();
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/locks/actions.js
function createLocksActions() {
const locks = createLocks();
function __unstableAcquireStoreLock(store, path, {
return () => locks.acquire(store, path, exclusive);
function __unstableReleaseStoreLock(lock) {
return () => locks.release(lock);
__unstableAcquireStoreLock,
__unstableReleaseStoreLock
;// CONCATENATED MODULE: external ["wp","privateApis"]
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/private-apis.js
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/core-data');
;// CONCATENATED MODULE: external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// CONCATENATED MODULE: external ["wp","blocks"]
const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
;// CONCATENATED MODULE: external ["wp","blockEditor"]
const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/footnotes/get-rich-text-values-cached.js
// TODO: The following line should have been:
// const unlockedApis = unlock( blockEditorPrivateApis );
// But there are hidden circular dependencies in RNMobile code, specifically in
// certain native components in the `components` package that depend on
// `block-editor`. What follows is a workaround that defers the `unlock` call
// to prevent native code from failing.
// Fix once https://github.com/WordPress/gutenberg/issues/52692 is closed.
const cache = new WeakMap();
function getRichTextValuesCached(block) {
unlockedApis = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const values = unlockedApis.getRichTextValues([block]);
cache.set(block, values);
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/footnotes/get-footnotes-order.js
const get_footnotes_order_cache = new WeakMap();
function getBlockFootnotesOrder(block) {
if (!get_footnotes_order_cache.has(block)) {
for (const value of getRichTextValuesCached(block)) {
// replacements is a sparse array, use forEach to skip empty slots.
value.replacements.forEach(({
if (type === 'core/footnote') {
order.push(attributes['data-fn']);
get_footnotes_order_cache.set(block, order);
return get_footnotes_order_cache.get(block);
function getFootnotesOrder(blocks) {
// We can only separate getting order from blocks at the root level. For
// deeper inner blocks, this will not work since it's possible to have both
// inner blocks and block attributes, so order needs to be computed from the
// Edit functions as a whole.
return blocks.flatMap(getBlockFootnotesOrder);
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/footnotes/index.js
function updateFootnotesFromMeta(blocks, meta) {
// If meta.footnotes is empty, it means the meta is not registered.
if (meta.footnotes === undefined) {
const newOrder = getFootnotesOrder(blocks);
const footnotes = meta.footnotes ? JSON.parse(meta.footnotes) : [];
const currentOrder = footnotes.map(fn => fn.id);
if (currentOrder.join('') === newOrder.join('')) {
const newFootnotes = newOrder.map(fnId => footnotes.find(fn => fn.id === fnId) || oldFootnotes[fnId] || {
function updateAttributes(attributes) {
// Only attempt to update attributes, if attributes is an object.
if (!attributes || Array.isArray(attributes) || typeof attributes !== 'object') {
for (const key in attributes) {
const value = attributes[key];
if (Array.isArray(value)) {
attributes[key] = value.map(updateAttributes);
// To do, remove support for string values?
if (typeof value !== 'string' && !(value instanceof external_wp_richText_namespaceObject.RichTextData)) {
const richTextValue = typeof value === 'string' ? external_wp_richText_namespaceObject.RichTextData.fromHTMLString(value) : new external_wp_richText_namespaceObject.RichTextData(value);
richTextValue.replacements.forEach(replacement => {
if (replacement.type === 'core/footnote') {
const id = replacement.attributes['data-fn'];
const index = newOrder.indexOf(id);
// The innerHTML contains the count wrapped in a link.
const countValue = (0,external_wp_richText_namespaceObject.create)({
html: replacement.innerHTML
countValue.text = String(index + 1);
countValue.formats = Array.from({
length: countValue.text.length
}, () => countValue.formats[0]);
countValue.replacements = Array.from({
length: countValue.text.length
}, () => countValue.replacements[0]);
replacement.innerHTML = (0,external_wp_richText_namespaceObject.toHTMLString)({
attributes[key] = typeof value === 'string' ? richTextValue.toHTMLString() : richTextValue;
function updateBlocksAttributes(__blocks) {
return __blocks.map(block => {
attributes: updateAttributes(block.attributes),
innerBlocks: updateBlocksAttributes(block.innerBlocks)
// We need to go through all block attributes deeply and update the
// footnote anchor numbering (textContent) to match the new order.
const newBlocks = updateBlocksAttributes(blocks);
...footnotes.reduce((acc, fn) => {
if (!newOrder.includes(fn.id)) {
footnotes: JSON.stringify(newFootnotes)
;// CONCATENATED MODULE: external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/core-data/build-module/entity-provider.js
/** @typedef {import('@wordpress/blocks').WPBlock} WPBlock */
const EntityContext = (0,external_wp_element_namespaceObject.createContext)({});
* Context provider component for providing
* an entity for a specific entity.
* @param {Object} props The component's props.
* @param {string} props.kind The entity kind.
* @param {string} props.type The entity name.
* @param {number} props.id The entity ID.
* @param {*} props.children The children to wrap.
* @return {Object} The provided children, wrapped with
* the entity's context provider.
function EntityProvider({
const parent = (0,external_wp_element_namespaceObject.useContext)(EntityContext);
const childContext = (0,external_wp_element_namespaceObject.useMemo)(() => ({
}), [parent, kind, name, id]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EntityContext.Provider, {
* Hook that returns the ID for the nearest
* provided entity of the specified type.
* @param {string} kind The entity kind.
* @param {string} name The entity name.
function useEntityId(kind, name) {
const context = (0,external_wp_element_namespaceObject.useContext)(EntityContext);
return context?.[kind]?.[name];
* Hook that returns the value and a setter for the
* specified property of the nearest provided
* entity of the specified type.
* @param {string} kind The entity kind.