: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/default-registry.js
/* harmony default export */ const default_registry = (createRegistry());
;// CONCATENATED MODULE: ./node_modules/is-plain-object/dist/is-plain-object.mjs
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
function is_plain_object_isObject(o) {
return Object.prototype.toString.call(o) === '[object Object]';
function is_plain_object_isPlainObject(o) {
if (is_plain_object_isObject(o) === false) return false;
// If has modified constructor
if (ctor === undefined) return true;
// If has modified prototype
if (is_plain_object_isObject(prot) === false) return false;
// If constructor does not have an Object-specific method
if (prot.hasOwnProperty('isPrototypeOf') === false) {
// Most likely a plain Object
// EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js
var cjs = __webpack_require__(66);
var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/object.js
if (!objectStorage || !objectStorage[key]) {
return objectStorage[key];
objectStorage[key] = String(value);
objectStorage = Object.create(null);
/* harmony default export */ const object = (storage);
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/default.js
// Private Browsing in Safari 10 and earlier will throw an error when
// attempting to set into localStorage. The test here is intentional in
// causing a thrown error as condition for using fallback object storage.
default_storage = window.localStorage;
default_storage.setItem('__wpDataTestLocalStorage', '');
default_storage.removeItem('__wpDataTestLocalStorage');
default_storage = object;
/* harmony default export */ const storage_default = (default_storage);
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/index.js
/** @typedef {import('../../registry').WPDataRegistry} WPDataRegistry */
/** @typedef {import('../../registry').WPDataPlugin} WPDataPlugin */
* @typedef {Object} WPDataPersistencePluginOptions Persistence plugin options.
* @property {Storage} storage Persistent storage implementation. This must
* at least implement `getItem` and `setItem` of
* @property {string} storageKey Key on which to set in persistent storage.
* Default plugin storage.
const DEFAULT_STORAGE = storage_default;
* Default plugin storage key.
const DEFAULT_STORAGE_KEY = 'WP_DATA';
* Higher-order reducer which invokes the original reducer only if state is
* inequal from that of the action's `nextState` property, otherwise returning
* the original state reference.
* @param {Function} reducer Original reducer.
* @return {Function} Enhanced reducer.
const withLazySameState = reducer => (state, action) => {
if (action.nextState === state) {
return reducer(state, action);
* Creates a persistence interface, exposing getter and setter methods (`get`
* and `set` respectively).
* @param {WPDataPersistencePluginOptions} options Plugin options.
* @return {Object} Persistence interface.
function createPersistenceInterface(options) {
storage = DEFAULT_STORAGE,
storageKey = DEFAULT_STORAGE_KEY
* Returns the persisted data as an object, defaulting to an empty object.
* @return {Object} Persisted data.
if (data === undefined) {
// If unset, getItem is expected to return null. Fall back to
const persisted = storage.getItem(storageKey);
if (persisted === null) {
data = JSON.parse(persisted);
// Similarly, should any error be thrown during parse of
// the string (malformed JSON), fall back to empty object.
* Merges an updated reducer state into the persisted data.
* @param {string} key Key to update.
* @param {*} value Updated value.
function setData(key, value) {
storage.setItem(storageKey, JSON.stringify(data));
* Data plugin to persist store state into a single storage key.
* @param {WPDataRegistry} registry Data registry.
* @param {?WPDataPersistencePluginOptions} pluginOptions Plugin options.
* @return {WPDataPlugin} Data plugin.
function persistencePlugin(registry, pluginOptions) {
const persistence = createPersistenceInterface(pluginOptions);
* Creates an enhanced store dispatch function, triggering the state of the
* given store name to be persisted when changed.
* @param {Function} getState Function which returns current state.
* @param {string} storeName Store name.
* @param {?Array<string>} keys Optional subset of keys to save.
* @return {Function} Enhanced dispatch function.
function createPersistOnChange(getState, storeName, keys) {
if (Array.isArray(keys)) {
// Given keys, the persisted state should by produced as an object
// of the subset of keys. This implementation uses combineReducers
// to leverage its behavior of returning the same object when none
// of the property values changes. This allows a strict reference
// equality to bypass a persistence set on an unchanging state.
const reducers = keys.reduce((accumulator, key) => Object.assign(accumulator, {
[key]: (state, action) => action.nextState[key]
getPersistedState = withLazySameState(build_module_combineReducers(reducers));
getPersistedState = (state, action) => action.nextState;
let lastState = getPersistedState(undefined, {
const state = getPersistedState(lastState, {
if (state !== lastState) {
persistence.set(storeName, state);
registerStore(storeName, options) {
return registry.registerStore(storeName, options);
// Load from persistence to use as initial state.
const persistedState = persistence.get()[storeName];
if (persistedState !== undefined) {
let initialState = options.reducer(options.initialState, {
type: '@@WP/PERSISTENCE_RESTORE'
if (is_plain_object_isPlainObject(initialState) && is_plain_object_isPlainObject(persistedState)) {
// If state is an object, ensure that:
// - Other keys are left intact when persisting only a
// - New keys in what would otherwise be used as initial
// state are deeply merged as base for persisted value.
initialState = cjs_default()(initialState, persistedState, {
isMergeableObject: is_plain_object_isPlainObject
// If there is a mismatch in object-likeness of default
// initial or persisted state, defer to persisted value.
initialState = persistedState;
const store = registry.registerStore(storeName, options);
store.subscribe(createPersistOnChange(store.getState, storeName, options.persist));
persistencePlugin.__unstableMigrate = () => {};
/* harmony default export */ const persistence = (persistencePlugin);
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/index.js
;// CONCATENATED MODULE: external ["wp","priorityQueue"]
const external_wp_priorityQueue_namespaceObject = window["wp"]["priorityQueue"];
;// CONCATENATED MODULE: external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// CONCATENATED MODULE: external ["wp","isShallowEqual"]
const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"];
var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject);
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/registry-provider/context.js
const Context = (0,external_wp_element_namespaceObject.createContext)(default_registry);
* A custom react Context consumer exposing the provided `registry` to
* children components. Used along with the RegistryProvider.
* You can read more about the react context api here:
* https://reactjs.org/docs/context.html#contextprovider
* } from '@wordpress/data';
* const registry = createRegistry( {} );
* const App = ( { props } ) => {
* return <RegistryProvider value={ registry }>
* <ComponentUsingRegistry
const RegistryConsumer = Consumer;
* A custom Context provider for exposing the provided `registry` to children
* components via a consumer.
* See <a name="#RegistryConsumer">RegistryConsumer</a> documentation for
/* harmony default export */ const context = (Provider);
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js
* A custom react hook exposing the registry context for use.
* This exposes the `registry` value provided via the
* <a href="#RegistryProvider">Registry Provider</a> to a component implementing
* It acts similarly to the `useContext` react hook.
* Note: Generally speaking, `useRegistry` is a low level hook that in most cases
* won't be needed for implementation. Most interactions with the `@wordpress/data`
* API can be performed via the `useSelect` hook, or the `withSelect` and
* `withDispatch` higher order components.
* } from '@wordpress/data';
* const registry = createRegistry( {} );
* const SomeChildUsingRegistry = ( props ) => {
* const registry = useRegistry();
* // ...logic implementing the registry in other react hooks.
* const ParentProvidingRegistry = ( props ) => {
* return <RegistryProvider value={ registry }>
* <SomeChildUsingRegistry { ...props } />
* @return {Function} A custom react hook exposing the registry context value.
return (0,external_wp_element_namespaceObject.useContext)(Context);
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/async-mode-provider/context.js
const context_Context = (0,external_wp_element_namespaceObject.createContext)(false);
Consumer: context_Consumer,
Provider: context_Provider
const AsyncModeConsumer = (/* unused pure expression or super */ null && (context_Consumer));
* Context Provider Component used to switch the data module component rerendering
* between Sync and Async modes.
* import { useSelect, AsyncModeProvider } from '@wordpress/data';
* import { store as blockEditorStore } from '@wordpress/block-editor';
* function BlockCount() {
* const count = useSelect( ( select ) => {
* return select( blockEditorStore ).getBlockCount()
* <AsyncModeProvider value={ true }>
* In this example, the BlockCount component is rerendered asynchronously.
* It means if a more critical task is being performed (like typing in an input),
* the rerendering is delayed until the browser becomes IDLE.
* It is possible to nest multiple levels of AsyncModeProvider to fine-tune the rendering behavior.
* @param {boolean} props.value Enable Async Mode.
* @return {Component} The component to be rendered.
/* harmony default export */ const async_mode_provider_context = (context_Provider);
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/async-mode-provider/use-async-mode.js
function useAsyncMode() {
return (0,external_wp_element_namespaceObject.useContext)(context_Context);
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-select/index.js
const renderQueue = (0,external_wp_priorityQueue_namespaceObject.createQueue)();
* @typedef {import('../../types').StoreDescriptor<C>} StoreDescriptor
* @template {import('../../types').AnyConfig} C
* @typedef {import('../../types').ReduxStoreConfig<State,Actions,Selectors>} ReduxStoreConfig
* @template {Record<string,import('../../types').ActionCreator>} Actions