"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getAutoConvertPatternsFromModule = getAutoConvertPatternsFromModule;
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
function getAutoConvertPatternsFromModule(_x) {
  return _getAutoConvertPatternsFromModule.apply(this, arguments);
}
function _getAutoConvertPatternsFromModule() {
  _getAutoConvertPatternsFromModule = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(extensions) {
    var _ref;
    var items;
    return _regenerator.default.wrap(function (_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
          _context.next = 1;
          return Promise.all(extensions.map(function (manifest) {
            if (manifest.modules.autoConvert && manifest.modules.autoConvert.url) {
              return manifest.modules.autoConvert.url;
            }
            return [];
          }));
        case 1:
          items = _context.sent;
          return _context.abrupt("return", (_ref = []).concat.apply(_ref, (0, _toConsumableArray2.default)(items)));
        case 2:
        case "end":
          return _context.stop();
      }
    }, _callee);
  }));
  return _getAutoConvertPatternsFromModule.apply(this, arguments);
}