: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const uuidCache = new Set();
// Use a weak map so that when the container is detached it's automatically
// dereferenced to avoid memory leak.
const containerCacheMap = new WeakMap();
const memoizedCreateCacheWithContainer = container => {
if (containerCacheMap.has(container)) {
return containerCacheMap.get(container);
// Emotion only accepts alphabetical and hyphenated keys so we just
// strip the numbers from the UUID. It _should_ be fine.
let key = esm_browser_v4().replace(/[0-9]/g, '');
while (uuidCache.has(key)) {
key = esm_browser_v4().replace(/[0-9]/g, '');
const cache = emotion_cache_browser_esm({
containerCacheMap.set(container, cache);
function StyleProvider(props) {
const cache = memoizedCreateCacheWithContainer(document.head);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CacheProvider, {
/* harmony default export */ const style_provider = (StyleProvider);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/fill.js
function fill_useForceUpdate() {
const [, setState] = (0,external_wp_element_namespaceObject.useState)({});
const mounted = (0,external_wp_element_namespaceObject.useRef)(true);
(0,external_wp_element_namespaceObject.useEffect)(() => {
function fill_Fill(props) {
const rerender = fill_useForceUpdate();
const ref = (0,external_wp_element_namespaceObject.useRef)({
(0,external_wp_element_namespaceObject.useEffect)(() => {
// We register fills so we can keep track of their existence.
// Some Slot implementations need to know if there're already fills
// registered so they can choose to render themselves or not.
}, [registerFill, unregisterFill]);
if (!slot.ref || !slot.ref.current) {
// When using a `Fill`, the `children` will be rendered in the document of the
// `Slot`. This means that we need to wrap the `children` in a `StyleProvider`
// to make sure we're referencing the right document/iframe (instead of the
// context of the `Fill`'s parent).
const wrappedChildren = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(style_provider, {
document: slot.ref.current.ownerDocument,
children: typeof children === 'function' ? children((_slot$fillProps = slot.fillProps) !== null && _slot$fillProps !== void 0 ? _slot$fillProps : {}) : children
return (0,external_wp_element_namespaceObject.createPortal)(wrappedChildren, slot.ref.current);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot.js
function slot_Slot(props, forwardedRef) {
// `children` is not allowed. However, if it is passed,
// it will be displayed as is, so remove `children`.
} = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context);
const ref = (0,external_wp_element_namespaceObject.useRef)(null);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
registerSlot(name, ref, fillProps);
unregisterSlot(name, ref);
// Ignore reason: We don't want to unregister and register the slot whenever
// `fillProps` change, which would cause the fill to be re-mounted. Instead,
// we can just update the slot (see hook below).
// For more context, see https://github.com/WordPress/gutenberg/pull/44403#discussion_r994415973
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [registerSlot, unregisterSlot, name]);
// fillProps may be an update that interacts with the layout, so we
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
registry.updateSlot(name, fillProps);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(component, {
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, ref]),
/* harmony default export */ const bubbles_virtually_slot = ((0,external_wp_element_namespaceObject.forwardRef)(slot_Slot));
;// 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/components/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js
function createSlotRegistry() {
const slots = (0,external_wp_compose_namespaceObject.observableMap)();
const fills = (0,external_wp_compose_namespaceObject.observableMap)();
const registerSlot = (name, ref, fillProps) => {
const slot = slots.get(name);
fillProps: fillProps || slot?.fillProps || {}
const unregisterSlot = (name, ref) => {
// Make sure we're not unregistering a slot registered by another element
// See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412
if (slots.get(name)?.ref === ref) {
const updateSlot = (name, fillProps) => {
const slot = slots.get(name);
if (external_wp_isShallowEqual_default()(slot.fillProps, fillProps)) {
slot.fillProps = fillProps;
const slotFills = fills.get(name);
slotFills.forEach(fill => fill.current.rerender());
const registerFill = (name, ref) => {
fills.set(name, [...(fills.get(name) || []), ref]);
const unregisterFill = (name, ref) => {
const fillsForName = fills.get(name);
fills.set(name, fillsForName.filter(fillRef => fillRef !== ref));
function SlotFillProvider({
const [registry] = (0,external_wp_element_namespaceObject.useState)(createSlotRegistry);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_context.Provider, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/provider.js
function provider_createSlotRegistry() {
function registerSlot(name, slot) {
const previousSlot = slots[name];
// Sometimes the fills are registered after the initial render of slot
// But before the registerSlot call, we need to rerender the slot.
// If a new instance of a slot is being mounted while another with the
// same name exists, force its update _after_ the new slot has been
// assigned into the instance, such that its own rendering of children
// will be empty (the new Slot will subsume all fills for this name).
previousSlot.forceUpdate();
function registerFill(name, instance) {
fills[name] = [...(fills[name] || []), instance];
function unregisterSlot(name, instance) {
// If a previous instance of a Slot by this name unmounts, do nothing,
// as the slot and its fills should only be removed for the current
if (slots[name] !== instance) {
function unregisterFill(name, instance) {
fills[name] = (_fills$name$filter = fills[name]?.filter(fill => fill !== instance)) !== null && _fills$name$filter !== void 0 ? _fills$name$filter : [];
function getFills(name, slotInstance) {
// Fills should only be returned for the current instance of the slot
if (slots[name] !== slotInstance) {
function forceUpdateSlot(name) {
const slot = getSlot(name);
function triggerListeners() {
listeners.forEach(listener => listener());
function subscribe(listener) {
listeners.push(listener);
listeners = listeners.filter(l => l !== listener);
function provider_SlotFillProvider({
const [contextValue] = (0,external_wp_element_namespaceObject.useState)(provider_createSlotRegistry);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(context.Provider, {
/* harmony default export */ const provider = (provider_SlotFillProvider);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js
function slot_fill_Fill(props) {
// We're adding both Fills here so they can register themselves before
// their respective slot has been registered. Only the Fill that has a slot
// will render. The other one will return null.
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Fill, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fill_Fill, {
function UnforwardedSlot(props, ref) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(bubbles_virtually_slot, {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(slot, {
const slot_fill_Slot = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSlot);
const parent = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context);
if (!parent.isDefault && passthrough) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(provider, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SlotFillProvider, {
function createSlotFill(key) {
const baseName = typeof key === 'symbol' ? key.description : key;
const FillComponent = props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_Fill, {
FillComponent.displayName = `${baseName}Fill`;
const SlotComponent = props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(slot_fill_Slot, {
SlotComponent.displayName = `${baseName}Slot`;
SlotComponent.__unstableName = key;
const createPrivateSlotFill = name => {
const privateKey = Symbol(name);
const privateSlotFill = createSlotFill(privateKey);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/overlay-middlewares.js
function overlayMiddlewares() {
}, floating_ui_dom_size({
} = (_elements$floating = elements.floating) !== null && _elements$floating !== void 0 ? _elements$floating : {};
// Only HTMLElement instances have the `style` property.
if (!(firstElementChild instanceof HTMLElement)) {
// Reduce the height of the popover to the available space.
Object.assign(firstElementChild.style, {
width: `${rects.reference.width}px`,
height: `${rects.reference.height}px`
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/index.js
// eslint-disable-next-line no-restricted-imports
// eslint-disable-next-line no-restricted-imports