Skip to content
Snippets Groups Projects
index.js 7.57 MiB
Newer Older
Hugo SUBTIL's avatar
Hugo SUBTIL committed
      method: method,
      url: url,
      data: (config || {}).data
    }));
  };
});
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  /*eslint func-names:0*/
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  function generateHTTPMethod(isForm) {
    return function httpMethod(url, data, config) {
      return this.request(mergeConfig(config || {}, {
        method: method,
        headers: isForm ? {
          'Content-Type': 'multipart/form-data'
        } : {},
        url: url,
        data: data
      }));
Hugo NOUTS's avatar
Hugo NOUTS committed
    };
Hugo SUBTIL's avatar
Hugo SUBTIL committed
  }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  Axios.prototype[method] = generateHTTPMethod();
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
});
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
module.exports = Axios;
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ }),
/* 1569 */
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
"use strict";
var utils = __webpack_require__(1566);
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
function encode(val) {
  return encodeURIComponent(val).
    replace(/%3A/gi, ':').
    replace(/%24/g, '$').
    replace(/%2C/gi, ',').
    replace(/%20/g, '+').
    replace(/%5B/gi, '[').
    replace(/%5D/gi, ']');
}
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
/**
 * Build a URL by appending params to the end
 *
 * @param {string} url The base of the url (e.g., http://www.google.com)
 * @param {object} [params] The params to be appended
 * @returns {string} The formatted url
 */
module.exports = function buildURL(url, params, paramsSerializer) {
  /*eslint no-param-reassign:0*/
  if (!params) {
    return url;
  }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  var serializedParams;
  if (paramsSerializer) {
    serializedParams = paramsSerializer(params);
  } else if (utils.isURLSearchParams(params)) {
    serializedParams = params.toString();
  } else {
    var parts = [];
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
    utils.forEach(params, function serialize(val, key) {
      if (val === null || typeof val === 'undefined') {
        return;
Hugo SUBTIL's avatar
Hugo SUBTIL committed
      if (utils.isArray(val)) {
        key = key + '[]';
      } else {
        val = [val];
Hugo SUBTIL's avatar
Hugo SUBTIL committed
      utils.forEach(val, function parseValue(v) {
        if (utils.isDate(v)) {
          v = v.toISOString();
        } else if (utils.isObject(v)) {
          v = JSON.stringify(v);
        }
        parts.push(encode(key) + '=' + encode(v));
      });
    });
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
    serializedParams = parts.join('&');
  }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  if (serializedParams) {
    var hashmarkIndex = url.indexOf('#');
    if (hashmarkIndex !== -1) {
      url = url.slice(0, hashmarkIndex);
    }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
    url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  return url;
};
/* 1570 */
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
"use strict";
var utils = __webpack_require__(1566);
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
function InterceptorManager() {
  this.handlers = [];
}
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
/**
 * Add a new interceptor to the stack
 *
 * @param {Function} fulfilled The function to handle `then` for a `Promise`
 * @param {Function} rejected The function to handle `reject` for a `Promise`
 *
 * @return {Number} An ID used to remove interceptor later
 */
InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
  this.handlers.push({
    fulfilled: fulfilled,
    rejected: rejected,
    synchronous: options ? options.synchronous : false,
    runWhen: options ? options.runWhen : null
  });
  return this.handlers.length - 1;
};
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
/**
 * Remove an interceptor from the stack
 *
 * @param {Number} id The ID that was returned by `use`
 */
InterceptorManager.prototype.eject = function eject(id) {
  if (this.handlers[id]) {
    this.handlers[id] = null;
  }
};
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
/**
 * Iterate over all the registered interceptors
 *
 * This method is particularly useful for skipping over any
 * interceptors that may have become `null` calling `eject`.
 *
 * @param {Function} fn The function to call for each interceptor
 */
InterceptorManager.prototype.forEach = function forEach(fn) {
  utils.forEach(this.handlers, function forEachHandler(h) {
    if (h !== null) {
      fn(h);
    }
  });
};
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
module.exports = InterceptorManager;
/* 1571 */
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
"use strict";
var utils = __webpack_require__(1566);
var transformData = __webpack_require__(1572);
var isCancel = __webpack_require__(1595);
var defaults = __webpack_require__(1573);
var CanceledError = __webpack_require__(1586);
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
/**
 * Throws a `CanceledError` if cancellation has been requested.
 */
function throwIfCancellationRequested(config) {
  if (config.cancelToken) {
    config.cancelToken.throwIfRequested();
  }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  if (config.signal && config.signal.aborted) {
    throw new CanceledError();
  }
}
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
/**
 * Dispatch a request to the server using the configured adapter.
 *
 * @param {object} config The config that is to be used for the request
 * @returns {Promise} The Promise to be fulfilled
 */
module.exports = function dispatchRequest(config) {
  throwIfCancellationRequested(config);
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  // Ensure headers exist
  config.headers = config.headers || {};
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  // Transform request data
  config.data = transformData.call(
    config,
    config.data,
    config.headers,
    config.transformRequest
  );
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  // Flatten headers
  config.headers = utils.merge(
    config.headers.common || {},
    config.headers[config.method] || {},
    config.headers
  );
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  utils.forEach(
    ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
    function cleanHeaderConfig(method) {
      delete config.headers[method];
    }
  );
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  var adapter = config.adapter || defaults.adapter;
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  return adapter(config).then(function onAdapterResolution(response) {
    throwIfCancellationRequested(config);
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
    // Transform response data
    response.data = transformData.call(
      config,
      response.data,
      response.headers,
      config.transformResponse
    );
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
    return response;
  }, function onAdapterRejection(reason) {
    if (!isCancel(reason)) {
      throwIfCancellationRequested(config);
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
      // Transform response data
      if (reason && reason.response) {
        reason.response.data = transformData.call(
          config,
          reason.response.data,
          reason.response.headers,
          config.transformResponse
        );
      }
    }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
    return Promise.reject(reason);
  });
};
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ }),
/* 1572 */
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
"use strict";
var utils = __webpack_require__(1566);
var defaults = __webpack_require__(1573);
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
/**
 * Transform the data for a request or a response
 *
 * @param {Object|String} data The data to be transformed
 * @param {Array} headers The headers for the request or response
 * @param {Array|Function} fns A single function or Array of functions
 * @returns {*} The resulting transformed data
 */
module.exports = function transformData(data, headers, fns) {
  var context = this || defaults;
  /*eslint no-param-reassign:0*/
  utils.forEach(fns, function transform(fn) {
    data = fn.call(context, data, headers);
  });
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  return data;
};
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ }),
/* 1573 */
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
"use strict";
var utils = __webpack_require__(1566);
var normalizeHeaderName = __webpack_require__(1574);
var AxiosError = __webpack_require__(1575);
var transitionalDefaults = __webpack_require__(1576);
var toFormData = __webpack_require__(1577);
Hugo SUBTIL's avatar
Hugo SUBTIL committed

var DEFAULT_CONTENT_TYPE = {
  'Content-Type': 'application/x-www-form-urlencoded'
};

function setContentTypeIfUnset(headers, value) {
  if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
    headers['Content-Type'] = value;
  }
}

function getDefaultAdapter() {
  var adapter;
  if (typeof XMLHttpRequest !== 'undefined') {
    // For browsers use XHR adapter
    adapter = __webpack_require__(1578);
Hugo SUBTIL's avatar
Hugo SUBTIL committed
  } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
    // For node use HTTP adapter
    adapter = __webpack_require__(1588);
Hugo SUBTIL's avatar
Hugo SUBTIL committed
  }
  return adapter;
}
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
function stringifySafely(rawValue, parser, encoder) {
  if (utils.isString(rawValue)) {
    try {
      (parser || JSON.parse)(rawValue);
      return utils.trim(rawValue);
    } catch (e) {
      if (e.name !== 'SyntaxError') {
        throw e;
Hugo NOUTS's avatar
Hugo NOUTS committed
      }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  return (encoder || JSON.stringify)(rawValue);
}
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
var defaults = {
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  transitional: transitionalDefaults,
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  adapter: getDefaultAdapter(),
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  transformRequest: [function transformRequest(data, headers) {
    normalizeHeaderName(headers, 'Accept');
    normalizeHeaderName(headers, 'Content-Type');

    if (utils.isFormData(data) ||
      utils.isArrayBuffer(data) ||
      utils.isBuffer(data) ||
      utils.isStream(data) ||
      utils.isFile(data) ||
      utils.isBlob(data)
    ) {
      return data;
    }
    if (utils.isArrayBufferView(data)) {
      return data.buffer;
    }
    if (utils.isURLSearchParams(data)) {
      setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
      return data.toString();
    }

    var isObjectPayload = utils.isObject(data);
    var contentType = headers && headers['Content-Type'];

    var isFileList;

    if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) {
      var _FormData = this.env && this.env.FormData;
      return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData());
    } else if (isObjectPayload || contentType === 'application/json') {
      setContentTypeIfUnset(headers, 'application/json');
      return stringifySafely(data);
    }

    return data;
  }],

  transformResponse: [function transformResponse(data) {
    var transitional = this.transitional || defaults.transitional;
    var silentJSONParsing = transitional && transitional.silentJSONParsing;
    var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
    var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';

    if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {
      try {
        return JSON.parse(data);
      } catch (e) {
        if (strictJSONParsing) {
          if (e.name === 'SyntaxError') {
            throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
          }
          throw e;
Hugo SUBTIL's avatar
Hugo SUBTIL committed
    }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
    return data;
  }],
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  /**
   * A timeout in milliseconds to abort a request. If set to 0 (default) a
   * timeout is not created.
   */
  timeout: 0,
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  xsrfCookieName: 'XSRF-TOKEN',
  xsrfHeaderName: 'X-XSRF-TOKEN',
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  maxContentLength: -1,
  maxBodyLength: -1,
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  env: {
    FormData: __webpack_require__(1592)
Hugo SUBTIL's avatar
Hugo SUBTIL committed
  },
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  validateStatus: function validateStatus(status) {
    return status >= 200 && status < 300;
  },
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  headers: {
    common: {
      'Accept': 'application/json, text/plain, */*'
    }
  }
};
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
  defaults.headers[method] = {};
});

utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
});

module.exports = defaults;
/* 1574 */
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
"use strict";
Hugo NOUTS's avatar
Hugo NOUTS committed

var utils = __webpack_require__(1566);
Hugo SUBTIL's avatar
Hugo SUBTIL committed

module.exports = function normalizeHeaderName(headers, normalizedName) {
  utils.forEach(headers, function processHeader(value, name) {
    if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
      headers[normalizedName] = value;
      delete headers[name];
    }
  });
};
/* 1575 */
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
var utils = __webpack_require__(1566);
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
/**
 * Create an Error with the specified message, config, error code, request and response.
 *
 * @param {string} message The error message.
 * @param {string} [code] The error code (for example, 'ECONNABORTED').
 * @param {Object} [config] The config.
 * @param {Object} [request] The request.
 * @param {Object} [response] The response.
 * @returns {Error} The created error.
 */
function AxiosError(message, code, config, request, response) {
  Error.call(this);
  this.message = message;
  this.name = 'AxiosError';
  code && (this.code = code);
  config && (this.config = config);
  request && (this.request = request);
  response && (this.response = response);
}
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
utils.inherits(AxiosError, Error, {
  toJSON: function toJSON() {
    return {
      // Standard
      message: this.message,
      name: this.name,
      // Microsoft
      description: this.description,
      number: this.number,
      // Mozilla
      fileName: this.fileName,
      lineNumber: this.lineNumber,
      columnNumber: this.columnNumber,
      stack: this.stack,
      // Axios
      config: this.config,
      code: this.code,
      status: this.response && this.response.status ? this.response.status : null
    };
  }
});
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
var prototype = AxiosError.prototype;
var descriptors = {};
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
[
  'ERR_BAD_OPTION_VALUE',
  'ERR_BAD_OPTION',
  'ECONNABORTED',
  'ETIMEDOUT',
  'ERR_NETWORK',
  'ERR_FR_TOO_MANY_REDIRECTS',
  'ERR_DEPRECATED',
  'ERR_BAD_RESPONSE',
  'ERR_BAD_REQUEST',
  'ERR_CANCELED'
// eslint-disable-next-line func-names
].forEach(function(code) {
  descriptors[code] = {value: code};
});
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
Object.defineProperties(AxiosError, descriptors);
Object.defineProperty(prototype, 'isAxiosError', {value: true});
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
// eslint-disable-next-line func-names
AxiosError.from = function(error, code, config, request, response, customProps) {
  var axiosError = Object.create(prototype);
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  utils.toFlatObject(error, axiosError, function filter(obj) {
    return obj !== Error.prototype;
  });
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  AxiosError.call(axiosError, error.message, code, config, request, response);
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  axiosError.name = error.name;
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  customProps && Object.assign(axiosError, customProps);
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  return axiosError;
};
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
module.exports = AxiosError;
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ }),
/* 1576 */
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ ((module) => {
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
"use strict";
Hugo SUBTIL's avatar
Hugo SUBTIL committed
module.exports = {
  silentJSONParsing: true,
  forcedJSONParsing: true,
  clarifyTimeoutError: false
};
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ }),
/* 1577 */
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var utils = __webpack_require__(1566);
Hugo SUBTIL's avatar
Hugo SUBTIL committed

/**
 * Convert a data object to FormData
 * @param {Object} obj
 * @param {?Object} [formData]
 * @returns {Object}
 **/

function toFormData(obj, formData) {
  // eslint-disable-next-line no-param-reassign
  formData = formData || new FormData();

  var stack = [];

  function convertValue(value) {
    if (value === null) return '';

    if (utils.isDate(value)) {
      return value.toISOString();
Hugo SUBTIL's avatar
Hugo SUBTIL committed
    if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
      return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
    }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
    return value;
  }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  function build(data, parentKey) {
    if (utils.isPlainObject(data) || utils.isArray(data)) {
      if (stack.indexOf(data) !== -1) {
        throw Error('Circular reference detected in ' + parentKey);
Hugo SUBTIL's avatar
Hugo SUBTIL committed
      stack.push(data);

      utils.forEach(data, function each(value, key) {
        if (utils.isUndefined(value)) return;
        var fullKey = parentKey ? parentKey + '.' + key : key;
        var arr;

        if (value && !parentKey && typeof value === 'object') {
          if (utils.endsWith(key, '{}')) {
            // eslint-disable-next-line no-param-reassign
            value = JSON.stringify(value);
          } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {
            // eslint-disable-next-line func-names
            arr.forEach(function(el) {
              !utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
            });
            return;
Hugo SUBTIL's avatar
Hugo SUBTIL committed
        build(value, fullKey);
      });

      stack.pop();
    } else {
      formData.append(parentKey, convertValue(data));
    }
  }

  build(obj);

  return formData;
}

module.exports = toFormData;


/***/ }),
/* 1578 */
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var utils = __webpack_require__(1566);
var settle = __webpack_require__(1579);
var cookies = __webpack_require__(1580);
var buildURL = __webpack_require__(1569);
var buildFullPath = __webpack_require__(1581);
var parseHeaders = __webpack_require__(1584);
var isURLSameOrigin = __webpack_require__(1585);
var transitionalDefaults = __webpack_require__(1576);
var AxiosError = __webpack_require__(1575);
var CanceledError = __webpack_require__(1586);
var parseProtocol = __webpack_require__(1587);
Hugo SUBTIL's avatar
Hugo SUBTIL committed

module.exports = function xhrAdapter(config) {
  return new Promise(function dispatchXhrRequest(resolve, reject) {
    var requestData = config.data;
    var requestHeaders = config.headers;
    var responseType = config.responseType;
    var onCanceled;
    function done() {
      if (config.cancelToken) {
        config.cancelToken.unsubscribe(onCanceled);
Hugo NOUTS's avatar
Hugo NOUTS committed
      }
Hugo SUBTIL's avatar
Hugo SUBTIL committed

      if (config.signal) {
        config.signal.removeEventListener('abort', onCanceled);
Hugo NOUTS's avatar
Hugo NOUTS committed
      }
Hugo SUBTIL's avatar
Hugo SUBTIL committed
    }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
    if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {
      delete requestHeaders['Content-Type']; // Let the browser set it
    }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
    var request = new XMLHttpRequest();
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
    // HTTP basic authentication
    if (config.auth) {
      var username = config.auth.username || '';
      var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
      requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
    }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
    var fullPath = buildFullPath(config.baseURL, config.url);
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
    request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);

    // Set the request timeout in MS
    request.timeout = config.timeout;

    function onloadend() {
      if (!request) {
        return;
Hugo NOUTS's avatar
Hugo NOUTS committed
      }
Hugo SUBTIL's avatar
Hugo SUBTIL committed
      // Prepare the response
      var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
      var responseData = !responseType || responseType === 'text' ||  responseType === 'json' ?
        request.responseText : request.response;
      var response = {
        data: responseData,
        status: request.status,
        statusText: request.statusText,
        headers: responseHeaders,
        config: config,
        request: request
      };

      settle(function _resolve(value) {
        resolve(value);
        done();
      }, function _reject(err) {
        reject(err);
        done();
      }, response);

      // Clean up request
      request = null;
    }

    if ('onloadend' in request) {
      // Use onloadend if available
      request.onloadend = onloadend;
    } else {
      // Listen for ready state to emulate onloadend
      request.onreadystatechange = function handleLoad() {
        if (!request || request.readyState !== 4) {
          return;
Hugo NOUTS's avatar
Hugo NOUTS committed
        }
Hugo SUBTIL's avatar
Hugo SUBTIL committed

        // The request errored out and we didn't get a response, this will be
        // handled by onerror instead
        // With one exception: request that using file: protocol, most browsers
        // will return status as 0 even though it's a successful request
        if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
          return;
Hugo NOUTS's avatar
Hugo NOUTS committed
        }
Hugo SUBTIL's avatar
Hugo SUBTIL committed
        // readystate handler is calling before onerror or ontimeout handlers,
        // so we should call onloadend on the next 'tick'
        setTimeout(onloadend);
      };
    }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
    // Handle browser request cancellation (as opposed to a manual cancellation)
    request.onabort = function handleAbort() {
      if (!request) {
        return;
Hugo SUBTIL's avatar
Hugo SUBTIL committed
      reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
      // Clean up request
      request = null;
Hugo SUBTIL's avatar
Hugo SUBTIL committed
    // Handle low level network errors
    request.onerror = function handleError() {
      // Real errors are hidden from us by the browser
      // onerror should only fire if it's a network error
      reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, request));
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
      // Clean up request
      request = null;
Hugo SUBTIL's avatar
Hugo SUBTIL committed
    // Handle timeout
    request.ontimeout = function handleTimeout() {
      var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
      var transitional = config.transitional || transitionalDefaults;
      if (config.timeoutErrorMessage) {
        timeoutErrorMessage = config.timeoutErrorMessage;
      }
      reject(new AxiosError(
        timeoutErrorMessage,
        transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
        config,
        request));
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
      // Clean up request
      request = null;
Hugo SUBTIL's avatar
Hugo SUBTIL committed
    // Add xsrf header
    // This is only done if running in a standard browser environment.
    // Specifically not if we're in a web worker, or react-native.
    if (utils.isStandardBrowserEnv()) {
      // Add xsrf header
      var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
        cookies.read(config.xsrfCookieName) :
        undefined;

      if (xsrfValue) {
        requestHeaders[config.xsrfHeaderName] = xsrfValue;
Hugo NOUTS's avatar
Hugo NOUTS committed
      }
Hugo SUBTIL's avatar
Hugo SUBTIL committed
    }

    // Add headers to the request
    if ('setRequestHeader' in request) {
      utils.forEach(requestHeaders, function setRequestHeader(val, key) {
        if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
          // Remove Content-Type if data is undefined
          delete requestHeaders[key];
Hugo NOUTS's avatar
Hugo NOUTS committed
        } else {
Hugo SUBTIL's avatar
Hugo SUBTIL committed
          // Otherwise add header to the request
          request.setRequestHeader(key, val);
Hugo NOUTS's avatar
Hugo NOUTS committed
        }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
    // Add withCredentials to request if needed
    if (!utils.isUndefined(config.withCredentials)) {
      request.withCredentials = !!config.withCredentials;
    }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
    // Add responseType to request if needed
    if (responseType && responseType !== 'json') {
      request.responseType = config.responseType;
    }
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
    // Handle progress if needed
    if (typeof config.onDownloadProgress === 'function') {
      request.addEventListener('progress', config.onDownloadProgress);
    }

    // Not all browsers support upload events
    if (typeof config.onUploadProgress === 'function' && request.upload) {
      request.upload.addEventListener('progress', config.onUploadProgress);
    }

    if (config.cancelToken || config.signal) {
      // Handle cancellation
      // eslint-disable-next-line func-names
      onCanceled = function(cancel) {
        if (!request) {
          return;
Hugo NOUTS's avatar
Hugo NOUTS committed
        }
Hugo SUBTIL's avatar
Hugo SUBTIL committed
        reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel);
        request.abort();
        request = null;
      };

      config.cancelToken && config.cancelToken.subscribe(onCanceled);
      if (config.signal) {
        config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
      }
    }

    if (!requestData) {
      requestData = null;
    }

    var protocol = parseProtocol(fullPath);

    if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) {
      reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
      return;
    }


    // Send the request
    request.send(requestData);
  });
};


/***/ }),
/* 1579 */
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var AxiosError = __webpack_require__(1575);
Hugo SUBTIL's avatar
Hugo SUBTIL committed

/**
 * Resolve or reject a Promise based on response status.
 *
 * @param {Function} resolve A function that resolves the promise.
 * @param {Function} reject A function that rejects the promise.
 * @param {object} response The response.
 */
module.exports = function settle(resolve, reject, response) {
  var validateStatus = response.config.validateStatus;
  if (!response.status || !validateStatus || validateStatus(response.status)) {
    resolve(response);
  } else {
    reject(new AxiosError(
      'Request failed with status code ' + response.status,
      [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
      response.config,
      response.request,
      response
    ));
  }
};


/***/ }),
/* 1580 */
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var utils = __webpack_require__(1566);
Hugo SUBTIL's avatar
Hugo SUBTIL committed

module.exports = (
  utils.isStandardBrowserEnv() ?

  // Standard browser envs support document.cookie
    (function standardBrowserEnv() {
      return {
        write: function write(name, value, expires, path, domain, secure) {
          var cookie = [];
          cookie.push(name + '=' + encodeURIComponent(value));

          if (utils.isNumber(expires)) {
            cookie.push('expires=' + new Date(expires).toGMTString());
Hugo NOUTS's avatar
Hugo NOUTS committed
          }
Hugo SUBTIL's avatar
Hugo SUBTIL committed

          if (utils.isString(path)) {
            cookie.push('path=' + path);
Hugo NOUTS's avatar
Hugo NOUTS committed
          }
Hugo SUBTIL's avatar
Hugo SUBTIL committed

          if (utils.isString(domain)) {
            cookie.push('domain=' + domain);
Hugo SUBTIL's avatar
Hugo SUBTIL committed
          if (secure === true) {
            cookie.push('secure');
          }

          document.cookie = cookie.join('; ');
        },

        read: function read(name) {
          var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
          return (match ? decodeURIComponent(match[3]) : null);
        },

        remove: function remove(name) {
          this.write(name, '', Date.now() - 86400000);
Hugo NOUTS's avatar
Hugo NOUTS committed
        }
Hugo SUBTIL's avatar
Hugo SUBTIL committed
      };
    })() :
Hugo NOUTS's avatar
Hugo NOUTS committed

Hugo SUBTIL's avatar
Hugo SUBTIL committed
  // Non standard browser env (web workers, react-native) lack needed support.
    (function nonStandardBrowserEnv() {
      return {
        write: function write() {},
        read: function read() { return null; },
        remove: function remove() {}
      };
    })()
);


/***/ }),
/* 1581 */
Hugo SUBTIL's avatar
Hugo SUBTIL committed
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var isAbsoluteURL = __webpack_require__(1582);
var combineURLs = __webpack_require__(1583);
Hugo SUBTIL's avatar
Hugo SUBTIL committed

/**
 * Creates a new URL by combining the baseURL with the requestedURL,
 * only when the requestedURL is not already an absolute URL.
 * If the requestURL is absolute, this function returns the requestedURL untouched.
 *
 * @param {string} baseURL The base URL
 * @param {string} requestedURL Absolute or relative URL to combine
 * @returns {string} The combined full path
 */
module.exports = function buildFullPath(baseURL, requestedURL) {
  if (baseURL && !isAbsoluteURL(requestedURL)) {
    return combineURLs(baseURL, requestedURL);
  }
  return requestedURL;
};


/***/ }),
/* 1582 */