"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = buildNavigationLabel;
var _i18n = require("@wordpress/i18n");
var _htmlEntities = require("@wordpress/html-entities");
/**
 * WordPress dependencies
 */

// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.
function buildNavigationLabel(title, id, status) {
  if (!title?.rendered) {
    /* translators: %s: the index of the menu in the list of menus. */
    return (0, _i18n.sprintf)((0, _i18n.__)('(no title %s)'), id);
  }
  if (status === 'publish') {
    return (0, _htmlEntities.decodeEntities)(title?.rendered);
  }
  return (0, _i18n.sprintf)(
  // translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).
  (0, _i18n._x)('%1$s (%2$s)', 'menu label'), (0, _htmlEntities.decodeEntities)(title?.rendered), status);
}
//# sourceMappingURL=build-navigation-label.js.map