: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
return timerId !== undefined;
function debounced(...args) {
const isInvoking = shouldInvoke(time);
return leadingEdge(lastCallTime);
// Handle invocations in a tight loop.
startTimer(timerExpired, wait);
return invokeFunc(lastCallTime);
startTimer(timerExpired, wait);
debounced.cancel = cancel;
debounced.pending = pending;
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/utils/throttle/index.js
* Parts of this source were derived and modified from lodash,
* released under the MIT license.
* https://github.com/lodash/lodash
* Copyright JS Foundation and other contributors <https://js.foundation/>
* Based on Underscore.js, copyright Jeremy Ashkenas,
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
* This software consists of voluntary contributions made by many
* individuals. For exact contribution history, see the revision history
* available at https://github.com/lodash/lodash
* The following license applies to all parts of this software except as
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* A simplified and properly typed version of lodash's `throttle`, that
* always uses timers instead of sometimes using rAF.
* Creates a throttled function that only invokes `func` at most once per
* every `wait` milliseconds. The throttled function comes with a `cancel`
* method to cancel delayed `func` invocations and a `flush` method to
* immediately invoke them. Provide `options` to indicate whether `func`
* should be invoked on the leading and/or trailing edge of the `wait`
* timeout. The `func` is invoked with the last arguments provided to the
* throttled function. Subsequent calls to the throttled function return
* the result of the last `func` invocation.
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the throttled function
* is invoked more than once during the `wait` timeout.
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until the next tick, similar to `setTimeout` with a timeout of `0`.
* @param {Function} func The function to throttle.
* @param {number} wait The number of milliseconds to throttle invocations to.
* @param {Partial< ThrottleOptions >} options The options object.
* @param {boolean} options.leading Specify invoking on the leading edge of the timeout.
* @param {boolean} options.trailing Specify invoking on the trailing edge of the timeout.
* @return Returns the new throttled function.
const throttle = (func, wait, options) => {
leading = 'leading' in options ? !!options.leading : leading;
trailing = 'trailing' in options ? !!options.trailing : trailing;
return debounce(func, wait, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/utils/observable-map/index.js
* A constructor (factory) for `ObservableMap`, a map-like key/value data structure
* where the individual entries are observable: using the `subscribe` method, you can
* subscribe to updates for a particular keys. Each subscriber always observes one
* specific key and is not notified about any unrelated changes (for different keys)
* in the `ObservableMap`.
* @template K The type of the keys in the map.
* @template V The type of the values in the map.
* @return A new instance of the `ObservableMap` type.
function observableMap() {
const listeners = new Map();
function callListeners(name) {
const list = listeners.get(name);
for (const listener of list) {
subscribe(name, listener) {
let list = listeners.get(name);
listeners.set(name, list);
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/pipe.js
* Parts of this source were derived and modified from lodash,
* released under the MIT license.
* https://github.com/lodash/lodash
* Copyright JS Foundation and other contributors <https://js.foundation/>
* Based on Underscore.js, copyright Jeremy Ashkenas,
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
* This software consists of voluntary contributions made by many
* individuals. For exact contribution history, see the revision history
* available at https://github.com/lodash/lodash
* The following license applies to all parts of this software except as
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Creates a pipe function.
* Allows to choose whether to perform left-to-right or right-to-left composition.
* @see https://lodash.com/docs/4#flow
* @param {boolean} reverse True if right-to-left, false for left-to-right composition.
const basePipe = (reverse = false) => (...funcs) => (...args) => {
const functions = funcs.flat();
return functions.reduce((prev, func) => [func(...prev)], args)[0];
* Composes multiple higher-order components into a single higher-order component. Performs left-to-right function
* composition, where each successive invocation is supplied the return value of the previous.
* This is inspired by `lodash`'s `flow` function.
* @see https://lodash.com/docs/4#flow
/* harmony default export */ const higher_order_pipe = (pipe);
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/compose.js
* Composes multiple higher-order components into a single higher-order component. Performs right-to-left function
* composition, where each successive invocation is supplied the return value of the previous.
* This is inspired by `lodash`'s `flowRight` function.
* @see https://lodash.com/docs/4#flow-right
const compose = basePipe(true);
/* harmony default export */ const higher_order_compose = (compose);
;// CONCATENATED MODULE: external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/if-condition/index.js
* Higher-order component creator, creating a new component which renders if
* the given condition is satisfied or with the given optional prop name.
* type Props = { foo: string };
* const Component = ( props: Props ) => <div>{ props.foo }</div>;
* const ConditionalComponent = ifCondition( ( props: Props ) => props.foo.length !== 0 )( Component );
* <ConditionalComponent foo="" />; // => null
* <ConditionalComponent foo="bar" />; // => <div>bar</div>;
* @param predicate Function to test condition.
* @return Higher-order component.
function ifCondition(predicate) {
return createHigherOrderComponent(WrappedComponent => props => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
/* harmony default export */ const if_condition = (ifCondition);
// EXTERNAL MODULE: external ["wp","isShallowEqual"]
var external_wp_isShallowEqual_ = __webpack_require__(923);
var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_);
;// CONCATENATED MODULE: external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/pure/index.js
* Given a component returns the enhanced component augmented with a component
* only re-rendering when its props/state change
* @deprecated Use `memo` or `PureComponent` instead.
const pure = createHigherOrderComponent(function (WrappedComponent) {
if (WrappedComponent.prototype instanceof external_wp_element_namespaceObject.Component) {
return class extends WrappedComponent {
shouldComponentUpdate(nextProps, nextState) {
return !external_wp_isShallowEqual_default()(nextProps, this.props) || !external_wp_isShallowEqual_default()(nextState, this.state);
return class extends external_wp_element_namespaceObject.Component {
shouldComponentUpdate(nextProps) {
return !external_wp_isShallowEqual_default()(nextProps, this.props);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
/* harmony default export */ const higher_order_pure = (pure);
;// CONCATENATED MODULE: external ["wp","deprecated"]
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/listener.js
* Class responsible for orchestrating event handling on the global window,
* binding a single event to be shared across all handling instances, and
* removing the handler when no instances are listening for the event.
this.handleEvent = this.handleEvent.bind(this);
add( /** @type {any} */eventType, /** @type {any} */instance) {
if (!this.listeners[eventType]) {
// Adding first listener for this type, so bind event.
window.addEventListener(eventType, this.handleEvent);
this.listeners[eventType] = [];
this.listeners[eventType].push(instance);
remove( /** @type {any} */eventType, /** @type {any} */instance) {
if (!this.listeners[eventType]) {
this.listeners[eventType] = this.listeners[eventType].filter(( /** @type {any} */listener) => listener !== instance);
if (!this.listeners[eventType].length) {
// Removing last listener for this type, so unbind event.
window.removeEventListener(eventType, this.handleEvent);
delete this.listeners[eventType];
handleEvent( /** @type {any} */event) {
this.listeners[event.type]?.forEach(( /** @type {any} */instance) => {
instance.handleEvent(event);
/* harmony default export */ const listener = (Listener);
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/index.js
* Listener instance responsible for managing document event handling.
const with_global_events_listener = new listener();
/* eslint-disable jsdoc/no-undefined-types */
* Higher-order component creator which, given an object of DOM event types and
* values corresponding to a callback function name on the component, will
* create or update a window event handler to invoke the callback when an event
* occurs. On behalf of the consuming developer, the higher-order component
* manages unbinding when the component unmounts, and binding at most a single
* event handler for the entire application.
* @param {Record<keyof GlobalEventHandlersEventMap, string>} eventTypesToHandlers Object with keys of DOM
* event type, the value a
* name of the function on
* the original component's
* @return {any} Higher-order component.
function withGlobalEvents(eventTypesToHandlers) {
external_wp_deprecated_default()('wp.compose.withGlobalEvents', {
// @ts-ignore We don't need to fix the type-related issues because this is deprecated.
return createHigherOrderComponent(WrappedComponent => {
class Wrapper extends external_wp_element_namespaceObject.Component {
constructor( /** @type {any} */props) {
this.handleEvent = this.handleEvent.bind(this);
this.handleRef = this.handleRef.bind(this);
Object.keys(eventTypesToHandlers).forEach(eventType => {
with_global_events_listener.add(eventType, this);
Object.keys(eventTypesToHandlers).forEach(eventType => {
with_global_events_listener.remove(eventType, this);
handleEvent( /** @type {any} */event) {
const handler = eventTypesToHandlers[( /** @type {keyof GlobalEventHandlersEventMap} */
/* eslint-enable jsdoc/no-undefined-types */)];
if (typeof this.wrappedRef[handler] === 'function') {
this.wrappedRef[handler](event);
handleRef( /** @type {any} */el) {
// Any component using `withGlobalEvents` that is not setting a `ref`
// will cause `this.props.forwardedRef` to be `null`, so we need this
if (this.props.forwardedRef) {
this.props.forwardedRef(el);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
return (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Wrapper, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-instance-id/index.js
const instanceMap = new WeakMap();
* Creates a new id for a given object.
* @param object Object reference to create an id for.
* @return The instance id (index).
function createId(object) {
const instances = instanceMap.get(object) || 0;