"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");

var _Object$defineProperty2 = require("@babel/runtime-corejs2/core-js/object/define-property");

_Object$defineProperty2(exports, "__esModule", {
  value: true
});

exports.registerModule = registerModule;
exports["default"] = void 0;

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));

var _getPrototypeOf3 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));

var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));

var _defineProperty3 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));

var _events = _interopRequireDefault(require("events"));

var _VERSION = _interopRequireDefault(require("./VERSION"));

var _connection = _interopRequireDefault(require("./connection"));

var _oauth = _interopRequireDefault(require("./oauth2"));

var _date = _interopRequireDefault(require("./date"));

var _registry = _interopRequireDefault(require("./registry"));

/**
 *
 */
var JSforce =
/*#__PURE__*/
function (_EventEmitter) {
  (0, _inherits2["default"])(JSforce, _EventEmitter);

  function JSforce() {
    var _getPrototypeOf2;

    var _this;

    (0, _classCallCheck2["default"])(this, JSforce);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = (0, _possibleConstructorReturn2["default"])(this, (_getPrototypeOf2 = (0, _getPrototypeOf3["default"])(JSforce)).call.apply(_getPrototypeOf2, [this].concat(args)));
    (0, _defineProperty3["default"])((0, _assertThisInitialized2["default"])(_this), "VERSION", _VERSION["default"]);
    (0, _defineProperty3["default"])((0, _assertThisInitialized2["default"])(_this), "Connection", _connection["default"]);
    (0, _defineProperty3["default"])((0, _assertThisInitialized2["default"])(_this), "OAuth2", _oauth["default"]);
    (0, _defineProperty3["default"])((0, _assertThisInitialized2["default"])(_this), "SfDate", _date["default"]);
    (0, _defineProperty3["default"])((0, _assertThisInitialized2["default"])(_this), "Date", _date["default"]);
    (0, _defineProperty3["default"])((0, _assertThisInitialized2["default"])(_this), "registry", _registry["default"]);
    return _this;
  }

  return JSforce;
}(_events["default"]);

function registerModule(name, factory) {
  jsforce.on('connection:new', function (conn) {
    (0, _defineProperty2["default"])(conn, name, {
      get: function get() {
        return factory(conn);
      },
      enumerable: true,
      configurable: true
    });
  });
}

var jsforce = new JSforce();
var _default = jsforce;
exports["default"] = _default;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9qc2ZvcmNlLnRzIl0sIm5hbWVzIjpbIkpTZm9yY2UiLCJWRVJTSU9OIiwiQ29ubmVjdGlvbiIsIk9BdXRoMiIsIlNmRGF0ZSIsInJlZ2lzdHJ5IiwiRXZlbnRFbWl0dGVyIiwicmVnaXN0ZXJNb2R1bGUiLCJuYW1lIiwiZmFjdG9yeSIsImpzZm9yY2UiLCJvbiIsImNvbm4iLCJnZXQiLCJlbnVtZXJhYmxlIiwiY29uZmlndXJhYmxlIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFDQTs7QUFFQTs7O0lBR01BLE87Ozs7Ozs7Ozs7Ozs7Ozs7O2dHQUNzQkMsbUI7bUdBQ01DLHNCOytGQUNSQyxpQjsrRkFDQUMsZ0I7NkZBQ0ZBLGdCO2lHQUNEQyxvQjs7Ozs7RUFOREMsa0I7O0FBU2YsU0FBU0MsY0FBVCxDQUNMQyxJQURLLEVBRUxDLE9BRkssRUFHTDtBQUNBQyxFQUFBQSxPQUFPLENBQUNDLEVBQVIsQ0FBVyxnQkFBWCxF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