module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;
/******/
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// identity function for calling harmory imports with the correct context
/******/ 	__webpack_require__.i = function(value) { return value; };
/******/
/******/ 	// define getter function for harmory exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		Object.defineProperty(exports, name, {
/******/ 			configurable: false,
/******/ 			enumerable: true,
/******/ 			get: getter
/******/ 		});
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "/";
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 129);
/******/ })
/************************************************************************/
/******/ ({

/***/ "./src/document-types/babel-es6.js":
/***/ function(module, exports, __webpack_require__) {

"use strict";
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.decorate = exports.transpile = exports.toAST = exports.compile = exports.testDocument = exports.rules = exports.docblockParser = undefined;

var _assign = __webpack_require__(1);

var _assign2 = _interopRequireDefault(_assign);

var _pathMatcher = __webpack_require__(21);

var _pathMatcher2 = _interopRequireDefault(_pathMatcher);

var _pick = __webpack_require__(30);

var _pick2 = _interopRequireDefault(_pick);

var _omit = __webpack_require__(29);

var _omit2 = _interopRequireDefault(_omit);

var _mapValues = __webpack_require__(23);

var _mapValues2 = _interopRequireDefault(_mapValues);

var _omitBy = __webpack_require__(67);

var _omitBy2 = _interopRequireDefault(_omitBy);

var _isEmpty = __webpack_require__(28);

var _isEmpty2 = _interopRequireDefault(_isEmpty);

var _docblockParser = __webpack_require__(20);

var _docblockParser2 = _interopRequireDefault(_docblockParser);

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

var docblockParser = exports.docblockParser = (0, _docblockParser2.default)({
  tags: {
    name: _docblockParser2.default.singleParameterTag
  }
});

var rules = exports.rules = [/\.(js|es6|jsx)$/];

var testDocument = exports.testDocument = function testDocument(doc) {
  return typeof rules.find(function (rule) {
    return (0, _pathMatcher2.default)(rule, doc.fileBaseName);
  }) !== 'undefined';
};

var compile = exports.compile = function compile(code, options) {
  return transpile(code, options).code;
};

var toAST = exports.toAST = function toAST(code, options) {
  return __webpack_require__(27).transform(code, babelOptions(options)).ast;
};

var transpile = exports.transpile = function transpile() {
  var code = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  return __webpack_require__(27).transform(code, babelOptions(options));
};

var decorate = exports.decorate = function decorate(doc) {
  (0, _assign2.default)(doc, {
    toEntity: function toEntity() {
      var exportables = doc.exportables;
      var frontmatter = exportables.frontmatter;

      return __webpack_require__("./src/entity.js").default((0, _assign2.default)({ id: doc.id }, frontmatter, {
        imports: exportables.imports,
        exports: exportables.exports
      }));
    },


    /**
      multilineTilTag
      multilineTilEmptyLineOrTag
      booleanTag
      singleParameterTag
      multiParameterTag(delimiter)
    */
    docblockParser: function docblockParser() {
      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      var parser = (0, _docblockParser2.default)({
        tags: (0, _assign2.default)({
          name: _docblockParser2.default.singleParameterTag
        }, options)
      });

      return parser.parse;
    },
    createExportable: function createExportable() {
      var exportable = __webpack_require__("./src/entity.js").default({
        id: doc.id,
        file: (0, _omit2.default)(doc.file, 'contents')
      });

      exportable.lazy('babel', function () {
        return doc.transformBabel();
      });
      exportable.lazy('ast', function () {
        return exportable.babel.ast;
      });
      exportable.lazy('code', function () {
        return exportable.babel.code;
      });
      exportable.lazy('meta', function () {
        return exportable.babel.metadata;
      });
      exportable.lazy('imports', function () {
        return exportable.get('babel.metadata.modules.imports', []).map(function (m) {
          return m.source;
        });
      });
      exportable.lazy('exports', function () {
        return exportable.get('babel.metadata.modules.exports.exported', []);
      });

      exportable.getter('contents', function () {
        return doc.readFile().getFileContents();
      });

      exportable.lazy('frontmatter', function () {
        try {
          var result = docblockParser.parse(exportable.get('ast.comments[0].value', "/**\n**/"));
          var _result$tags = result.tags,
              tags = _result$tags === undefined ? {} : _result$tags,
              _result$text = result.text,
              text = _result$text === undefined ? '' : _result$text;

          var values = (0, _mapValues2.default)((0, _assign2.default)({ text: text, id: doc.id }, tags), function (v) {
            return typeof v === 'string' ? v.trim() : v;
          });

          return (0, _omitBy2.default)(values, function (v) {
            return (0, _isEmpty2.default)(v);
          });
        } catch (error) {
          return {};
        }
      });

      return exportable;
    },
    readFrontmatter: function readFrontmatter() {
      return doc.exportables.frontmatter;
    },
    transformBabel: function transformBabel(options) {
      options = options || doc.project.babelRc || { presets: ['skypager'] };
      var code = options.code || doc.file.contents.toString();
      return __webpack_require__(27).transform(code, babelOptions(options));
    }
  });

  doc.lazy('exportables', function () {
    return doc.createExportable();
  });

  return doc;
};

exports.default = decorate;


var babelOptions = function babelOptions(options) {
  return (0, _pick2.default)(options, "filename", "filenameRelative", "presets", "plugins", "parserOpts", "generatorOpts", "highlightCode", "only", "ignore", "auxiliaryCommentBefore", "auxiliaryCommentAfter", "sourceMaps", "inputSourceMap", "sourceMapTarget", "sourceFileName", "sourceRoot", "moduleRoot", "moduleIds", "moduleId", "getModuleId", "resolveModuleSource", "code", "no-babelrc", "ast", "compact", "minified", "comments", "shouldPrintComment", "env", "retainLines", "extends");
};

/***/ },

/***/ "./src/entity.js":
/***/ function(module, exports, __webpack_require__) {

"use strict";
'use strict';

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

var _keys = __webpack_require__(7);

var _keys2 = _interopRequireDefault(_keys);

var _assign = __webpack_require__(1);

var _assign2 = _interopRequireDefault(_assign);

exports.create = create;

var _properties = __webpack_require__(16);

var _lodash = __webpack_require__(8);

var _lodash2 = _interopRequireDefault(_lodash);

var _object = __webpack_require__(47);

var _object2 = _interopRequireDefault(_object);

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

function create(sourceObject) {
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
}

var createEntity = exports.createEntity = function createEntity() {
  var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

  var instance = (0, _properties.mixinPropertyUtils)((0, _assign2.default)({}, object), false);

  (0, _keys2.default)(_object2.default).forEach(function (meth) {
    return instance.hide(meth, function () {
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }

      return _object2.default[meth].apply(_object2.default, [instance].concat(args));
    });
  });

  if (options !== false && options && options.includeChain !== false) {
    instance.hideGetter('chain', function () {
      return _lodash2.default.chain(instance);
    });
  }

  instance.hide('toJSON', function () {
    return _lodash2.default.omit(instance, 'chain');
  });

  return instance;
};

exports.default = createEntity;

/***/ },

/***/ 1:
/***/ function(module, exports) {

module.exports = require("babel-runtime/core-js/object/assign");

/***/ },

/***/ 129:
/***/ function(module, exports, __webpack_require__) {

module.exports = __webpack_require__("./src/document-types/babel-es6.js");


/***/ },

/***/ 16:
/***/ function(module, exports) {

module.exports = require("skypager-util/lib/properties");

/***/ },

/***/ 20:
/***/ function(module, exports) {

module.exports = require("docblock-parser");

/***/ },

/***/ 21:
/***/ function(module, exports) {

module.exports = require("skypager-util/lib/path-matcher");

/***/ },

/***/ 23:
/***/ function(module, exports) {

module.exports = require("lodash/mapValues");

/***/ },

/***/ 27:
/***/ function(module, exports) {

module.exports = require("babel-core");

/***/ },

/***/ 28:
/***/ function(module, exports) {

module.exports = require("lodash/isEmpty");

/***/ },

/***/ 29:
/***/ function(module, exports) {

module.exports = require("lodash/omit");

/***/ },

/***/ 30:
/***/ function(module, exports) {

module.exports = require("lodash/pick");

/***/ },

/***/ 47:
/***/ function(module, exports) {

module.exports = require("lodash/object");

/***/ },

/***/ 67:
/***/ function(module, exports) {

module.exports = require("lodash/omitBy");

/***/ },

/***/ 7:
/***/ function(module, exports) {

module.exports = require("babel-runtime/core-js/object/keys");

/***/ },

/***/ 8:
/***/ function(module, exports) {

module.exports = require("lodash");

/***/ }

/******/ });
//# sourceMappingURL=babel-es6.js.map