"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.PluginMoreMenuItem = PluginMoreMenuItem;
exports.PluginSidebar = PluginSidebar;
exports.PluginSidebarMoreMenuItem = PluginSidebarMoreMenuItem;
var _editor = require("@wordpress/editor");
var _url = require("@wordpress/url");
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */

const isSiteEditor = (0, _url.getPath)(window.location.href)?.includes('site-editor.php');
const deprecateSlot = name => {
  (0, _deprecated.default)(`wp.editPost.${name}`, {
    since: '6.6',
    alternative: `wp.editor.${name}`
  });
};

/* eslint-disable jsdoc/require-param */
/**
 * @see PluginMoreMenuItem in @wordpress/editor package.
 */
function PluginMoreMenuItem(props) {
  if (!isSiteEditor) {
    return null;
  }
  deprecateSlot('PluginMoreMenuItem');
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.PluginMoreMenuItem, {
    ...props
  });
}

/**
 * @see PluginSidebar in @wordpress/editor package.
 */
function PluginSidebar(props) {
  if (!isSiteEditor) {
    return null;
  }
  deprecateSlot('PluginSidebar');
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.PluginSidebar, {
    ...props
  });
}

/**
 * @see PluginSidebarMoreMenuItem in @wordpress/editor package.
 */
function PluginSidebarMoreMenuItem(props) {
  if (!isSiteEditor) {
    return null;
  }
  deprecateSlot('PluginSidebarMoreMenuItem');
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.PluginSidebarMoreMenuItem, {
    ...props
  });
}
/* eslint-enable jsdoc/require-param */
//# sourceMappingURL=deprecated.js.map