if (process.type === 'browser') { try { require('source-map-support').install(); } catch(ignored) {} }var log = require('common/utils/logger').debugLogger(__filename); var logError = require('common/utils/logger').errorLogger(__filename, false); var logFatal = require('common/utils/logger').errorLogger(__filename, true);"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getIterator2 = require("babel-runtime/core-js/get-iterator");

var _getIterator3 = _interopRequireDefault(_getIterator2);

exports.findItemByLabel = findItemByLabel;

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function findItemByLabel(submenu, label) {
  var _iteratorNormalCompletion = true;
  var _didIteratorError = false;
  var _iteratorError = undefined;

  try {
    for (var _iterator = (0, _getIterator3.default)(submenu), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
      var item = _step.value;

      if (item.label === label) {
        return item;
      }

      if (item.submenu) {
        var subItem = findItemByLabel(item.submenu.items, label);
        if (subItem) {
          return subItem;
        }
      }
    }
  } catch (err) {
    _didIteratorError = true;
    _iteratorError = err;
  } finally {
    try {
      if (!_iteratorNormalCompletion && _iterator.return) {
        _iterator.return();
      }
    } finally {
      if (_didIteratorError) {
        throw _iteratorError;
      }
    }
  }

  return null;
}
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJyb3dzZXIvbWVudXMvdXRpbHMuanMiXSwibmFtZXMiOlsiZmluZEl0ZW1CeUxhYmVsIiwic3VibWVudSIsImxhYmVsIiwiaXRlbSIsInN1Ykl0ZW0iLCJpdGVtcyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztRQUFnQkEsZSxHQUFBQSxlOzs7O0FBQVQsU0FBU0EsZUFBVCxDQUEwQkMsT0FBMUIsRUFBbUNDLEtBQW5DLEVBQTBDO0FBQUE7QUFBQTtBQUFBOztBQUFBO0FBQy9DLG9EQUFpQkQsT0FBakIsNEdBQTBCO0FBQUEsVUFBakJFLElBQWlCOztBQUN4QixVQUFJQSxL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