var menu_menu = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
xmlns: "http://www.w3.org/2000/svg",
}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
d: "M5 5.5V7h14V5.5H5zM5 13h14v-1.5H5V13zm0 6h14v-1.5H5V19z"
/* harmony default export */ var library_menu = (menu_menu);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigable-container/container.js
function container_createSuper(Derived) { var hasNativeReflectConstruct = container_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
function container_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var MENU_ITEM_ROLES = ['menuitem', 'menuitemradio', 'menuitemcheckbox'];
function cycleValue(value, total, offset) {
var nextValue = value + offset;
return total + nextValue;
} else if (nextValue >= total) {
return nextValue - total;
var container_NavigableContainer = /*#__PURE__*/function (_Component) {
Object(inherits["a" /* default */])(NavigableContainer, _Component);
var _super = container_createSuper(NavigableContainer);
function NavigableContainer() {
Object(classCallCheck["a" /* default */])(this, NavigableContainer);
_this = _super.apply(this, arguments);
_this.onKeyDown = _this.onKeyDown.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.bindContainer = _this.bindContainer.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.getFocusableContext = _this.getFocusableContext.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.getFocusableIndex = _this.getFocusableIndex.bind(Object(assertThisInitialized["a" /* default */])(_this));
Object(createClass["a" /* default */])(NavigableContainer, [{
key: "componentDidMount",
value: function componentDidMount() {
// We use DOM event listeners instead of React event listeners
// because we want to catch events from the underlying DOM tree
// The React Tree can be different from the DOM tree when using
// portals. Block Toolbars for instance are rendered in a separate
this.container.addEventListener('keydown', this.onKeyDown);
this.container.addEventListener('focus', this.onFocus);
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.container.removeEventListener('keydown', this.onKeyDown);
this.container.removeEventListener('focus', this.onFocus);
value: function bindContainer(ref) {
var forwardedRef = this.props.forwardedRef;
if (Object(external_lodash_["isFunction"])(forwardedRef)) {
} else if (forwardedRef && 'current' in forwardedRef) {
forwardedRef.current = ref;
key: "getFocusableContext",
value: function getFocusableContext(target) {
var onlyBrowserTabstops = this.props.onlyBrowserTabstops;
var finder = onlyBrowserTabstops ? external_wp_dom_["focus"].tabbable : external_wp_dom_["focus"].focusable;
var focusables = finder.find(this.container);
var index = this.getFocusableIndex(focusables, target);
if (index > -1 && target) {
key: "getFocusableIndex",
value: function getFocusableIndex(focusables, target) {
var directIndex = focusables.indexOf(target);
if (directIndex !== -1) {
value: function onKeyDown(event) {
if (this.props.onKeyDown) {
this.props.onKeyDown(event);
var getFocusableContext = this.getFocusableContext;
var _this$props = this.props,
_this$props$cycle = _this$props.cycle,
cycle = _this$props$cycle === void 0 ? true : _this$props$cycle,
eventToOffset = _this$props.eventToOffset,
_this$props$onNavigat = _this$props.onNavigate,
onNavigate = _this$props$onNavigat === void 0 ? external_lodash_["noop"] : _this$props$onNavigat,
stopNavigationEvents = _this$props.stopNavigationEvents;
var offset = eventToOffset(event); // eventToOffset returns undefined if the event is not handled by the component
if (offset !== undefined && stopNavigationEvents) {
// Prevents arrow key handlers bound to the document directly interfering
event.stopImmediatePropagation(); // When navigating a collection of items, prevent scroll containers
// from scrolling. The preventDefault also prevents Voiceover from
// 'handling' the event, as voiceover will try to use arrow keys
// for highlighting text.
var targetRole = event.target.getAttribute('role');
if (MENU_ITEM_ROLES.includes(targetRole)) {
var context = getFocusableContext(event.target.ownerDocument.activeElement);
var index = context.index,
focusables = context.focusables;
var nextIndex = cycle ? cycleValue(index, focusables.length, offset) : index + offset;
if (nextIndex >= 0 && nextIndex < focusables.length) {
focusables[nextIndex].focus();
onNavigate(nextIndex, focusables[nextIndex]);
value: function render() {
var _this$props2 = this.props,
children = _this$props2.children,
props = Object(objectWithoutProperties["a" /* default */])(_this$props2, ["children"]);
return Object(external_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({
}, Object(external_lodash_["omit"])(props, ['stopNavigationEvents', 'eventToOffset', 'onNavigate', 'onKeyDown', 'cycle', 'onlyBrowserTabstops', 'forwardedRef'])), children);
return NavigableContainer;
}(external_wp_element_["Component"]);
var container_forwardedNavigableContainer = function forwardedNavigableContainer(props, ref) {
return Object(external_wp_element_["createElement"])(container_NavigableContainer, Object(esm_extends["a" /* default */])({}, props, {
container_forwardedNavigableContainer.displayName = 'NavigableContainer';
/* harmony default export */ var navigable_container_container = (Object(external_wp_element_["forwardRef"])(container_forwardedNavigableContainer));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigable-container/menu.js
function NavigableMenu(_ref, ref) {
var _ref$role = _ref.role,
role = _ref$role === void 0 ? 'menu' : _ref$role,
_ref$orientation = _ref.orientation,
orientation = _ref$orientation === void 0 ? 'vertical' : _ref$orientation,
rest = Object(objectWithoutProperties["a" /* default */])(_ref, ["role", "orientation"]);
var eventToOffset = function eventToOffset(evt) {
var keyCode = evt.keyCode;
var next = [external_wp_keycodes_["DOWN"]];
var previous = [external_wp_keycodes_["UP"]];
if (orientation === 'horizontal') {
next = [external_wp_keycodes_["RIGHT"]];
previous = [external_wp_keycodes_["LEFT"]];
if (orientation === 'both') {
next = [external_wp_keycodes_["RIGHT"], external_wp_keycodes_["DOWN"]];
previous = [external_wp_keycodes_["LEFT"], external_wp_keycodes_["UP"]];
if (Object(external_lodash_["includes"])(next, keyCode)) {
} else if (Object(external_lodash_["includes"])(previous, keyCode)) {
} else if (Object(external_lodash_["includes"])([external_wp_keycodes_["DOWN"], external_wp_keycodes_["UP"], external_wp_keycodes_["LEFT"], external_wp_keycodes_["RIGHT"]], keyCode)) {
// Key press should be handled, e.g. have event propagation and
// default behavior handled by NavigableContainer but not result
return Object(external_wp_element_["createElement"])(navigable_container_container, Object(esm_extends["a" /* default */])({
stopNavigationEvents: true,
onlyBrowserTabstops: false,
"aria-orientation": role === 'presentation' ? null : orientation,
eventToOffset: eventToOffset
/* harmony default export */ var navigable_container_menu = (Object(external_wp_element_["forwardRef"])(NavigableMenu));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dropdown-menu/index.js
function dropdown_menu_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function dropdown_menu_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { dropdown_menu_ownKeys(Object(source), true).forEach(function (key) { Object(esm_defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { dropdown_menu_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var defaultProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var mergedProps = dropdown_menu_objectSpread(dropdown_menu_objectSpread({}, defaultProps), props);
if (props.className && defaultProps.className) {
mergedProps.className = classnames_default()(props.className, defaultProps.className);
function DropdownMenu(_ref) {
var children = _ref.children,
className = _ref.className,
controls = _ref.controls,
icon = _ref$icon === void 0 ? library_menu : _ref$icon,
popoverProps = _ref.popoverProps,
toggleProps = _ref.toggleProps,
menuProps = _ref.menuProps,
_ref$disableOpenOnArr = _ref.disableOpenOnArrowDown,
disableOpenOnArrowDown = _ref$disableOpenOnArr === void 0 ? false : _ref$disableOpenOnArr,
menuLabel = _ref.menuLabel,
position = _ref.position,
external_wp_deprecated_default()('`menuLabel` prop in `DropdownComponent`', {
alternative: '`menuProps` object and its `aria-label` property',
external_wp_deprecated_default()('`position` prop in `DropdownComponent`', {
alternative: '`popoverProps` object and its `position` property',
if (Object(external_lodash_["isEmpty"])(controls) && !Object(external_lodash_["isFunction"])(children)) {
} // Normalize controls to nested array of objects (sets of controls)
if (!Object(external_lodash_["isEmpty"])(controls)) {
if (!Array.isArray(controlSets[0])) {
controlSets = [controlSets];
var mergedPopoverProps = mergeProps({
className: 'components-dropdown-menu__popover',
return Object(external_wp_element_["createElement"])(Dropdown, {
className: classnames_default()('components-dropdown-menu', className),
popoverProps: mergedPopoverProps,
renderToggle: function renderToggle(_ref2) {
var _toggleProps$showTool;
var isOpen = _ref2.isOpen,
onToggle = _ref2.onToggle;
var openOnArrowDown = function openOnArrowDown(event) {
if (disableOpenOnArrowDown) {
if (!isOpen && event.keyCode === external_wp_keycodes_["DOWN"]) {
var mergedToggleProps = mergeProps({
className: classnames_default()('components-dropdown-menu__toggle', {
return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({}, mergedToggleProps, {
onClick: function onClick(event) {
if (mergedToggleProps.onClick) {
mergedToggleProps.onClick(event);
onKeyDown: function onKeyDown(event) {
if (mergedToggleProps.onKeyDown) {
mergedToggleProps.onKeyDown(event);
showTooltip: (_toggleProps$showTool = toggleProps === null || toggleProps === void 0 ? void 0 : toggleProps.showTooltip) !== null && _toggleProps$showTool !== void 0 ? _toggleProps$showTool : true
}), mergedToggleProps.children);
renderContent: function renderContent(props) {
var mergedMenuProps = mergeProps({
'aria-label': menuLabel || label,
className: classnames_default()('components-dropdown-menu__menu', {
return Object(external_wp_element_["createElement"])(navigable_container_menu, Object(esm_extends["a" /* default */])({}, mergedMenuProps, {
}), Object(external_lodash_["isFunction"])(children) ? children(props) : null, Object(external_lodash_["flatMap"])(controlSets, function (controlSet, indexOfSet) {
return controlSet.map(function (control, indexOfControl) {
return Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
key: [indexOfSet, indexOfControl].join(),
onClick: function onClick(event) {
className: classnames_default()('components-dropdown-menu__menu-item', {
'has-separator': indexOfSet > 0 && indexOfControl === 0,
'is-active': control.isActive
"aria-checked": control.role === 'menuitemcheckbox' || control.role === 'menuitemradio' ? control.isActive : undefined,
role: control.role === 'menuitemcheckbox' || control.role === 'menuitemradio' ? control.role : 'menuitem',
disabled: control.isDisabled
/* harmony default export */ var dropdown_menu = (DropdownMenu);
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js
var external = __webpack_require__("K+tz");
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/external-link/styles/external-link-styles.js
function external_link_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
var StyledIcon = /*#__PURE__*/styled_base_browser_esm(build_module_icon["a" /* default */], {
styles: "width:1.4em;height:1.4em;margin:-0.2em 0.1em 0;vertical-align:middle;fill:currentColor;"
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/external-link/index.js
function ExternalLink(_ref, ref) {
children = _ref.children,
className = _ref.className,
rel = _ref$rel === void 0 ? '' : _ref$rel,
additionalProps = Object(objectWithoutProperties["a" /* default */])(_ref, ["href", "children", "className", "rel"]);
rel = Object(external_lodash_["uniq"])(Object(external_lodash_["compact"])([].concat(Object(toConsumableArray["a" /* default */])(rel.split(' ')), ['external', 'noreferrer', 'noopener']))).join(' ');
var classes = classnames_default()('components-external-link', className);
/* eslint-disable react/jsx-no-target-blank */