'use strict';

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

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _mediaStorage = require('./mediaStorage');

Object.keys(_mediaStorage).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function get() {
      return _mediaStorage[key];
    }
  });
});

var _initialize2 = require('./initialize');

var _initialize3 = _interopRequireDefault(_initialize2);

var _load_routes = require('./load_routes');

var _load_routes2 = _interopRequireDefault(_load_routes);

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

// compile
var compileConfiguration = function compileConfiguration() {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var bitsConfig = arguments[1];
  return _extends({}, options, bitsConfig);
};

var load = function load(func, options, bitsConfig) {
  return func(compileConfiguration(options, bitsConfig));
};

exports.default = function (options) {
  return {
    initialize: function initialize(bitsConfig) {
      return load(_initialize3.default, options, bitsConfig);
    },
    loadRoutes: function loadRoutes(bitsConfig) {
      return load(_load_routes2.default, options, bitsConfig);
    }
  };
};