"use strict";

require("core-js/modules/es.object.keys.js");

require("core-js/modules/es.symbol.js");

require("core-js/modules/es.array.filter.js");

require("core-js/modules/es.object.to-string.js");

require("core-js/modules/es.object.get-own-property-descriptor.js");

require("core-js/modules/es.array.for-each.js");

require("core-js/modules/web.dom-collections.for-each.js");

require("core-js/modules/es.object.get-own-property-descriptors.js");

require("core-js/modules/es.object.define-properties.js");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.globalServerConfig = void 0;

require("core-js/modules/es.array.concat.js");

require("core-js/modules/es.object.define-property.js");

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var GlobalServerConfig = /*#__PURE__*/function () {
  function GlobalServerConfig() {
    _classCallCheck(this, GlobalServerConfig);

    _defineProperty(this, "baseurl", void 0);

    _defineProperty(this, "retries", void 0);

    _defineProperty(this, "timeout", void 0);

    _defineProperty(this, "_headers", void 0);

    var hostname = window.location.hostname;
    var protocol = window.location.protocol;
    this.baseurl = "".concat(protocol, "//").concat(hostname);
    this.timeout = 10000;
    this.retries = 3;
    this._headers = {};
  }

  _createClass(GlobalServerConfig, [{
    key: "headers",
    get:
    /**
     * The baseurl for each server request. Default is `protocol`://`hostname`
     */

    /**
     * The max retries to use for each server request. Default is 3
     */

    /**
     * The timeout to use for each server request. Default is 10000
     */

    /**
     * The headers to add to every API server request. Default is {}
     */
    function get() {
      return _objectSpread({}, this._headers);
    },
    set: function set(headers) {
      this._headers = _objectSpread({}, headers);
    }
  }]);

  return GlobalServerConfig;
}();

var globalServerConfig = new GlobalServerConfig();
exports.globalServerConfig = globalServerConfig;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21tb24vc2VydmVyL3NlcnZlci1jb25maWcudHMiXSwibmFtZXMiOlsiR2xvYmFsU2VydmVyQ29uZmlnIiwiaG9zdG5hbWUiLCJ3aW5kb3ciLCJsb2NhdGlvbiIsInByb3RvY29sIiwiYmFzZXVybCIsInRpbWVvdXQiLCJyZXRyaWVzIiwiX2hlYWRlcnMiLCJoZWFkZXJzIiwiZ2xvYmFsU2VydmVyQ29uZmlnIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztJQUVNQSxrQjtBQTZCSixnQ0FBYztBQUFBOztBQUFBOztBQUFBOztBQUFBOztBQUFBOztBQUNaLFFBQU1DLFFBQVEsR0FBR0MsTUFBTSxDQUFDQyxRQUFQLENBQWdCRixRQUFqQztBQUNBLFFBQU1HLFFBQVEs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