Path: blob/master/node_modules/axios/dist/axios.js
2591 views
(function webpackUniversalModuleDefinition(root, factory) {1if(typeof exports === 'object' && typeof module === 'object')2module.exports = factory();3else if(typeof define === 'function' && define.amd)4define([], factory);5else if(typeof exports === 'object')6exports["axios"] = factory();7else8root["axios"] = factory();9})(this, function() {10return /******/ (function(modules) { // webpackBootstrap11/******/ // The module cache12/******/ var installedModules = {};13/******/14/******/ // The require function15/******/ function __webpack_require__(moduleId) {16/******/17/******/ // Check if module is in cache18/******/ if(installedModules[moduleId]) {19/******/ return installedModules[moduleId].exports;20/******/ }21/******/ // Create a new module (and put it into the cache)22/******/ var module = installedModules[moduleId] = {23/******/ i: moduleId,24/******/ l: false,25/******/ exports: {}26/******/ };27/******/28/******/ // Execute the module function29/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);30/******/31/******/ // Flag the module as loaded32/******/ module.l = true;33/******/34/******/ // Return the exports of the module35/******/ return module.exports;36/******/ }37/******/38/******/39/******/ // expose the modules object (__webpack_modules__)40/******/ __webpack_require__.m = modules;41/******/42/******/ // expose the module cache43/******/ __webpack_require__.c = installedModules;44/******/45/******/ // define getter function for harmony exports46/******/ __webpack_require__.d = function(exports, name, getter) {47/******/ if(!__webpack_require__.o(exports, name)) {48/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });49/******/ }50/******/ };51/******/52/******/ // define __esModule on exports53/******/ __webpack_require__.r = function(exports) {54/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {55/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });56/******/ }57/******/ Object.defineProperty(exports, '__esModule', { value: true });58/******/ };59/******/60/******/ // create a fake namespace object61/******/ // mode & 1: value is a module id, require it62/******/ // mode & 2: merge all properties of value into the ns63/******/ // mode & 4: return value when already ns object64/******/ // mode & 8|1: behave like require65/******/ __webpack_require__.t = function(value, mode) {66/******/ if(mode & 1) value = __webpack_require__(value);67/******/ if(mode & 8) return value;68/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;69/******/ var ns = Object.create(null);70/******/ __webpack_require__.r(ns);71/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });72/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));73/******/ return ns;74/******/ };75/******/76/******/ // getDefaultExport function for compatibility with non-harmony modules77/******/ __webpack_require__.n = function(module) {78/******/ var getter = module && module.__esModule ?79/******/ function getDefault() { return module['default']; } :80/******/ function getModuleExports() { return module; };81/******/ __webpack_require__.d(getter, 'a', getter);82/******/ return getter;83/******/ };84/******/85/******/ // Object.prototype.hasOwnProperty.call86/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };87/******/88/******/ // __webpack_public_path__89/******/ __webpack_require__.p = "";90/******/91/******/92/******/ // Load entry module and return exports93/******/ return __webpack_require__(__webpack_require__.s = "./index.js");94/******/ })95/************************************************************************/96/******/ ({9798/***/ "./index.js":99/*!******************!*\100!*** ./index.js ***!101\******************/102/*! no static exports found */103/***/ (function(module, exports, __webpack_require__) {104105module.exports = __webpack_require__(/*! ./lib/axios */ "./lib/axios.js");106107/***/ }),108109/***/ "./lib/adapters/xhr.js":110/*!*****************************!*\111!*** ./lib/adapters/xhr.js ***!112\*****************************/113/*! no static exports found */114/***/ (function(module, exports, __webpack_require__) {115116"use strict";117118119var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");120var settle = __webpack_require__(/*! ./../core/settle */ "./lib/core/settle.js");121var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./lib/helpers/cookies.js");122var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./lib/helpers/buildURL.js");123var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./lib/core/buildFullPath.js");124var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./lib/helpers/parseHeaders.js");125var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./lib/helpers/isURLSameOrigin.js");126var createError = __webpack_require__(/*! ../core/createError */ "./lib/core/createError.js");127var defaults = __webpack_require__(/*! ../defaults */ "./lib/defaults.js");128var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./lib/cancel/Cancel.js");129130module.exports = function xhrAdapter(config) {131return new Promise(function dispatchXhrRequest(resolve, reject) {132var requestData = config.data;133var requestHeaders = config.headers;134var responseType = config.responseType;135var onCanceled;136function done() {137if (config.cancelToken) {138config.cancelToken.unsubscribe(onCanceled);139}140141if (config.signal) {142config.signal.removeEventListener('abort', onCanceled);143}144}145146if (utils.isFormData(requestData)) {147delete requestHeaders['Content-Type']; // Let the browser set it148}149150var request = new XMLHttpRequest();151152// HTTP basic authentication153if (config.auth) {154var username = config.auth.username || '';155var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';156requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);157}158159var fullPath = buildFullPath(config.baseURL, config.url);160request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);161162// Set the request timeout in MS163request.timeout = config.timeout;164165function onloadend() {166if (!request) {167return;168}169// Prepare the response170var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;171var responseData = !responseType || responseType === 'text' || responseType === 'json' ?172request.responseText : request.response;173var response = {174data: responseData,175status: request.status,176statusText: request.statusText,177headers: responseHeaders,178config: config,179request: request180};181182settle(function _resolve(value) {183resolve(value);184done();185}, function _reject(err) {186reject(err);187done();188}, response);189190// Clean up request191request = null;192}193194if ('onloadend' in request) {195// Use onloadend if available196request.onloadend = onloadend;197} else {198// Listen for ready state to emulate onloadend199request.onreadystatechange = function handleLoad() {200if (!request || request.readyState !== 4) {201return;202}203204// The request errored out and we didn't get a response, this will be205// handled by onerror instead206// With one exception: request that using file: protocol, most browsers207// will return status as 0 even though it's a successful request208if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {209return;210}211// readystate handler is calling before onerror or ontimeout handlers,212// so we should call onloadend on the next 'tick'213setTimeout(onloadend);214};215}216217// Handle browser request cancellation (as opposed to a manual cancellation)218request.onabort = function handleAbort() {219if (!request) {220return;221}222223reject(createError('Request aborted', config, 'ECONNABORTED', request));224225// Clean up request226request = null;227};228229// Handle low level network errors230request.onerror = function handleError() {231// Real errors are hidden from us by the browser232// onerror should only fire if it's a network error233reject(createError('Network Error', config, null, request));234235// Clean up request236request = null;237};238239// Handle timeout240request.ontimeout = function handleTimeout() {241var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';242var transitional = config.transitional || defaults.transitional;243if (config.timeoutErrorMessage) {244timeoutErrorMessage = config.timeoutErrorMessage;245}246reject(createError(247timeoutErrorMessage,248config,249transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',250request));251252// Clean up request253request = null;254};255256// Add xsrf header257// This is only done if running in a standard browser environment.258// Specifically not if we're in a web worker, or react-native.259if (utils.isStandardBrowserEnv()) {260// Add xsrf header261var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?262cookies.read(config.xsrfCookieName) :263undefined;264265if (xsrfValue) {266requestHeaders[config.xsrfHeaderName] = xsrfValue;267}268}269270// Add headers to the request271if ('setRequestHeader' in request) {272utils.forEach(requestHeaders, function setRequestHeader(val, key) {273if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {274// Remove Content-Type if data is undefined275delete requestHeaders[key];276} else {277// Otherwise add header to the request278request.setRequestHeader(key, val);279}280});281}282283// Add withCredentials to request if needed284if (!utils.isUndefined(config.withCredentials)) {285request.withCredentials = !!config.withCredentials;286}287288// Add responseType to request if needed289if (responseType && responseType !== 'json') {290request.responseType = config.responseType;291}292293// Handle progress if needed294if (typeof config.onDownloadProgress === 'function') {295request.addEventListener('progress', config.onDownloadProgress);296}297298// Not all browsers support upload events299if (typeof config.onUploadProgress === 'function' && request.upload) {300request.upload.addEventListener('progress', config.onUploadProgress);301}302303if (config.cancelToken || config.signal) {304// Handle cancellation305// eslint-disable-next-line func-names306onCanceled = function(cancel) {307if (!request) {308return;309}310reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);311request.abort();312request = null;313};314315config.cancelToken && config.cancelToken.subscribe(onCanceled);316if (config.signal) {317config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);318}319}320321if (!requestData) {322requestData = null;323}324325// Send the request326request.send(requestData);327});328};329330331/***/ }),332333/***/ "./lib/axios.js":334/*!**********************!*\335!*** ./lib/axios.js ***!336\**********************/337/*! no static exports found */338/***/ (function(module, exports, __webpack_require__) {339340"use strict";341342343var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js");344var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js");345var Axios = __webpack_require__(/*! ./core/Axios */ "./lib/core/Axios.js");346var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./lib/core/mergeConfig.js");347var defaults = __webpack_require__(/*! ./defaults */ "./lib/defaults.js");348349/**350* Create an instance of Axios351*352* @param {Object} defaultConfig The default config for the instance353* @return {Axios} A new instance of Axios354*/355function createInstance(defaultConfig) {356var context = new Axios(defaultConfig);357var instance = bind(Axios.prototype.request, context);358359// Copy axios.prototype to instance360utils.extend(instance, Axios.prototype, context);361362// Copy context to instance363utils.extend(instance, context);364365// Factory for creating new instances366instance.create = function create(instanceConfig) {367return createInstance(mergeConfig(defaultConfig, instanceConfig));368};369370return instance;371}372373// Create the default instance to be exported374var axios = createInstance(defaults);375376// Expose Axios class to allow class inheritance377axios.Axios = Axios;378379// Expose Cancel & CancelToken380axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./lib/cancel/Cancel.js");381axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./lib/cancel/CancelToken.js");382axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./lib/cancel/isCancel.js");383axios.VERSION = __webpack_require__(/*! ./env/data */ "./lib/env/data.js").version;384385// Expose all/spread386axios.all = function all(promises) {387return Promise.all(promises);388};389axios.spread = __webpack_require__(/*! ./helpers/spread */ "./lib/helpers/spread.js");390391// Expose isAxiosError392axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./lib/helpers/isAxiosError.js");393394module.exports = axios;395396// Allow use of default import syntax in TypeScript397module.exports.default = axios;398399400/***/ }),401402/***/ "./lib/cancel/Cancel.js":403/*!******************************!*\404!*** ./lib/cancel/Cancel.js ***!405\******************************/406/*! no static exports found */407/***/ (function(module, exports, __webpack_require__) {408409"use strict";410411412/**413* A `Cancel` is an object that is thrown when an operation is canceled.414*415* @class416* @param {string=} message The message.417*/418function Cancel(message) {419this.message = message;420}421422Cancel.prototype.toString = function toString() {423return 'Cancel' + (this.message ? ': ' + this.message : '');424};425426Cancel.prototype.__CANCEL__ = true;427428module.exports = Cancel;429430431/***/ }),432433/***/ "./lib/cancel/CancelToken.js":434/*!***********************************!*\435!*** ./lib/cancel/CancelToken.js ***!436\***********************************/437/*! no static exports found */438/***/ (function(module, exports, __webpack_require__) {439440"use strict";441442443var Cancel = __webpack_require__(/*! ./Cancel */ "./lib/cancel/Cancel.js");444445/**446* A `CancelToken` is an object that can be used to request cancellation of an operation.447*448* @class449* @param {Function} executor The executor function.450*/451function CancelToken(executor) {452if (typeof executor !== 'function') {453throw new TypeError('executor must be a function.');454}455456var resolvePromise;457458this.promise = new Promise(function promiseExecutor(resolve) {459resolvePromise = resolve;460});461462var token = this;463464// eslint-disable-next-line func-names465this.promise.then(function(cancel) {466if (!token._listeners) return;467468var i;469var l = token._listeners.length;470471for (i = 0; i < l; i++) {472token._listeners[i](cancel);473}474token._listeners = null;475});476477// eslint-disable-next-line func-names478this.promise.then = function(onfulfilled) {479var _resolve;480// eslint-disable-next-line func-names481var promise = new Promise(function(resolve) {482token.subscribe(resolve);483_resolve = resolve;484}).then(onfulfilled);485486promise.cancel = function reject() {487token.unsubscribe(_resolve);488};489490return promise;491};492493executor(function cancel(message) {494if (token.reason) {495// Cancellation has already been requested496return;497}498499token.reason = new Cancel(message);500resolvePromise(token.reason);501});502}503504/**505* Throws a `Cancel` if cancellation has been requested.506*/507CancelToken.prototype.throwIfRequested = function throwIfRequested() {508if (this.reason) {509throw this.reason;510}511};512513/**514* Subscribe to the cancel signal515*/516517CancelToken.prototype.subscribe = function subscribe(listener) {518if (this.reason) {519listener(this.reason);520return;521}522523if (this._listeners) {524this._listeners.push(listener);525} else {526this._listeners = [listener];527}528};529530/**531* Unsubscribe from the cancel signal532*/533534CancelToken.prototype.unsubscribe = function unsubscribe(listener) {535if (!this._listeners) {536return;537}538var index = this._listeners.indexOf(listener);539if (index !== -1) {540this._listeners.splice(index, 1);541}542};543544/**545* Returns an object that contains a new `CancelToken` and a function that, when called,546* cancels the `CancelToken`.547*/548CancelToken.source = function source() {549var cancel;550var token = new CancelToken(function executor(c) {551cancel = c;552});553return {554token: token,555cancel: cancel556};557};558559module.exports = CancelToken;560561562/***/ }),563564/***/ "./lib/cancel/isCancel.js":565/*!********************************!*\566!*** ./lib/cancel/isCancel.js ***!567\********************************/568/*! no static exports found */569/***/ (function(module, exports, __webpack_require__) {570571"use strict";572573574module.exports = function isCancel(value) {575return !!(value && value.__CANCEL__);576};577578579/***/ }),580581/***/ "./lib/core/Axios.js":582/*!***************************!*\583!*** ./lib/core/Axios.js ***!584\***************************/585/*! no static exports found */586/***/ (function(module, exports, __webpack_require__) {587588"use strict";589590591var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");592var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./lib/helpers/buildURL.js");593var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./lib/core/InterceptorManager.js");594var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./lib/core/dispatchRequest.js");595var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./lib/core/mergeConfig.js");596var validator = __webpack_require__(/*! ../helpers/validator */ "./lib/helpers/validator.js");597598var validators = validator.validators;599/**600* Create a new instance of Axios601*602* @param {Object} instanceConfig The default config for the instance603*/604function Axios(instanceConfig) {605this.defaults = instanceConfig;606this.interceptors = {607request: new InterceptorManager(),608response: new InterceptorManager()609};610}611612/**613* Dispatch a request614*615* @param {Object} config The config specific for this request (merged with this.defaults)616*/617Axios.prototype.request = function request(config) {618/*eslint no-param-reassign:0*/619// Allow for axios('example/url'[, config]) a la fetch API620if (typeof config === 'string') {621config = arguments[1] || {};622config.url = arguments[0];623} else {624config = config || {};625}626627config = mergeConfig(this.defaults, config);628629// Set config.method630if (config.method) {631config.method = config.method.toLowerCase();632} else if (this.defaults.method) {633config.method = this.defaults.method.toLowerCase();634} else {635config.method = 'get';636}637638var transitional = config.transitional;639640if (transitional !== undefined) {641validator.assertOptions(transitional, {642silentJSONParsing: validators.transitional(validators.boolean),643forcedJSONParsing: validators.transitional(validators.boolean),644clarifyTimeoutError: validators.transitional(validators.boolean)645}, false);646}647648// filter out skipped interceptors649var requestInterceptorChain = [];650var synchronousRequestInterceptors = true;651this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {652if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {653return;654}655656synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;657658requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);659});660661var responseInterceptorChain = [];662this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {663responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);664});665666var promise;667668if (!synchronousRequestInterceptors) {669var chain = [dispatchRequest, undefined];670671Array.prototype.unshift.apply(chain, requestInterceptorChain);672chain = chain.concat(responseInterceptorChain);673674promise = Promise.resolve(config);675while (chain.length) {676promise = promise.then(chain.shift(), chain.shift());677}678679return promise;680}681682683var newConfig = config;684while (requestInterceptorChain.length) {685var onFulfilled = requestInterceptorChain.shift();686var onRejected = requestInterceptorChain.shift();687try {688newConfig = onFulfilled(newConfig);689} catch (error) {690onRejected(error);691break;692}693}694695try {696promise = dispatchRequest(newConfig);697} catch (error) {698return Promise.reject(error);699}700701while (responseInterceptorChain.length) {702promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());703}704705return promise;706};707708Axios.prototype.getUri = function getUri(config) {709config = mergeConfig(this.defaults, config);710return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');711};712713// Provide aliases for supported request methods714utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {715/*eslint func-names:0*/716Axios.prototype[method] = function(url, config) {717return this.request(mergeConfig(config || {}, {718method: method,719url: url,720data: (config || {}).data721}));722};723});724725utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {726/*eslint func-names:0*/727Axios.prototype[method] = function(url, data, config) {728return this.request(mergeConfig(config || {}, {729method: method,730url: url,731data: data732}));733};734});735736module.exports = Axios;737738739/***/ }),740741/***/ "./lib/core/InterceptorManager.js":742/*!****************************************!*\743!*** ./lib/core/InterceptorManager.js ***!744\****************************************/745/*! no static exports found */746/***/ (function(module, exports, __webpack_require__) {747748"use strict";749750751var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");752753function InterceptorManager() {754this.handlers = [];755}756757/**758* Add a new interceptor to the stack759*760* @param {Function} fulfilled The function to handle `then` for a `Promise`761* @param {Function} rejected The function to handle `reject` for a `Promise`762*763* @return {Number} An ID used to remove interceptor later764*/765InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {766this.handlers.push({767fulfilled: fulfilled,768rejected: rejected,769synchronous: options ? options.synchronous : false,770runWhen: options ? options.runWhen : null771});772return this.handlers.length - 1;773};774775/**776* Remove an interceptor from the stack777*778* @param {Number} id The ID that was returned by `use`779*/780InterceptorManager.prototype.eject = function eject(id) {781if (this.handlers[id]) {782this.handlers[id] = null;783}784};785786/**787* Iterate over all the registered interceptors788*789* This method is particularly useful for skipping over any790* interceptors that may have become `null` calling `eject`.791*792* @param {Function} fn The function to call for each interceptor793*/794InterceptorManager.prototype.forEach = function forEach(fn) {795utils.forEach(this.handlers, function forEachHandler(h) {796if (h !== null) {797fn(h);798}799});800};801802module.exports = InterceptorManager;803804805/***/ }),806807/***/ "./lib/core/buildFullPath.js":808/*!***********************************!*\809!*** ./lib/core/buildFullPath.js ***!810\***********************************/811/*! no static exports found */812/***/ (function(module, exports, __webpack_require__) {813814"use strict";815816817var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./lib/helpers/isAbsoluteURL.js");818var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./lib/helpers/combineURLs.js");819820/**821* Creates a new URL by combining the baseURL with the requestedURL,822* only when the requestedURL is not already an absolute URL.823* If the requestURL is absolute, this function returns the requestedURL untouched.824*825* @param {string} baseURL The base URL826* @param {string} requestedURL Absolute or relative URL to combine827* @returns {string} The combined full path828*/829module.exports = function buildFullPath(baseURL, requestedURL) {830if (baseURL && !isAbsoluteURL(requestedURL)) {831return combineURLs(baseURL, requestedURL);832}833return requestedURL;834};835836837/***/ }),838839/***/ "./lib/core/createError.js":840/*!*********************************!*\841!*** ./lib/core/createError.js ***!842\*********************************/843/*! no static exports found */844/***/ (function(module, exports, __webpack_require__) {845846"use strict";847848849var enhanceError = __webpack_require__(/*! ./enhanceError */ "./lib/core/enhanceError.js");850851/**852* Create an Error with the specified message, config, error code, request and response.853*854* @param {string} message The error message.855* @param {Object} config The config.856* @param {string} [code] The error code (for example, 'ECONNABORTED').857* @param {Object} [request] The request.858* @param {Object} [response] The response.859* @returns {Error} The created error.860*/861module.exports = function createError(message, config, code, request, response) {862var error = new Error(message);863return enhanceError(error, config, code, request, response);864};865866867/***/ }),868869/***/ "./lib/core/dispatchRequest.js":870/*!*************************************!*\871!*** ./lib/core/dispatchRequest.js ***!872\*************************************/873/*! no static exports found */874/***/ (function(module, exports, __webpack_require__) {875876"use strict";877878879var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");880var transformData = __webpack_require__(/*! ./transformData */ "./lib/core/transformData.js");881var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./lib/cancel/isCancel.js");882var defaults = __webpack_require__(/*! ../defaults */ "./lib/defaults.js");883var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./lib/cancel/Cancel.js");884885/**886* Throws a `Cancel` if cancellation has been requested.887*/888function throwIfCancellationRequested(config) {889if (config.cancelToken) {890config.cancelToken.throwIfRequested();891}892893if (config.signal && config.signal.aborted) {894throw new Cancel('canceled');895}896}897898/**899* Dispatch a request to the server using the configured adapter.900*901* @param {object} config The config that is to be used for the request902* @returns {Promise} The Promise to be fulfilled903*/904module.exports = function dispatchRequest(config) {905throwIfCancellationRequested(config);906907// Ensure headers exist908config.headers = config.headers || {};909910// Transform request data911config.data = transformData.call(912config,913config.data,914config.headers,915config.transformRequest916);917918// Flatten headers919config.headers = utils.merge(920config.headers.common || {},921config.headers[config.method] || {},922config.headers923);924925utils.forEach(926['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],927function cleanHeaderConfig(method) {928delete config.headers[method];929}930);931932var adapter = config.adapter || defaults.adapter;933934return adapter(config).then(function onAdapterResolution(response) {935throwIfCancellationRequested(config);936937// Transform response data938response.data = transformData.call(939config,940response.data,941response.headers,942config.transformResponse943);944945return response;946}, function onAdapterRejection(reason) {947if (!isCancel(reason)) {948throwIfCancellationRequested(config);949950// Transform response data951if (reason && reason.response) {952reason.response.data = transformData.call(953config,954reason.response.data,955reason.response.headers,956config.transformResponse957);958}959}960961return Promise.reject(reason);962});963};964965966/***/ }),967968/***/ "./lib/core/enhanceError.js":969/*!**********************************!*\970!*** ./lib/core/enhanceError.js ***!971\**********************************/972/*! no static exports found */973/***/ (function(module, exports, __webpack_require__) {974975"use strict";976977978/**979* Update an Error with the specified config, error code, and response.980*981* @param {Error} error The error to update.982* @param {Object} config The config.983* @param {string} [code] The error code (for example, 'ECONNABORTED').984* @param {Object} [request] The request.985* @param {Object} [response] The response.986* @returns {Error} The error.987*/988module.exports = function enhanceError(error, config, code, request, response) {989error.config = config;990if (code) {991error.code = code;992}993994error.request = request;995error.response = response;996error.isAxiosError = true;997998error.toJSON = function toJSON() {999return {1000// Standard1001message: this.message,1002name: this.name,1003// Microsoft1004description: this.description,1005number: this.number,1006// Mozilla1007fileName: this.fileName,1008lineNumber: this.lineNumber,1009columnNumber: this.columnNumber,1010stack: this.stack,1011// Axios1012config: this.config,1013code: this.code,1014status: this.response && this.response.status ? this.response.status : null1015};1016};1017return error;1018};101910201021/***/ }),10221023/***/ "./lib/core/mergeConfig.js":1024/*!*********************************!*\1025!*** ./lib/core/mergeConfig.js ***!1026\*********************************/1027/*! no static exports found */1028/***/ (function(module, exports, __webpack_require__) {10291030"use strict";103110321033var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js");10341035/**1036* Config-specific merge-function which creates a new config-object1037* by merging two configuration objects together.1038*1039* @param {Object} config11040* @param {Object} config21041* @returns {Object} New object resulting from merging config2 to config11042*/1043module.exports = function mergeConfig(config1, config2) {1044// eslint-disable-next-line no-param-reassign1045config2 = config2 || {};1046var config = {};10471048function getMergedValue(target, source) {1049if (utils.isPlainObject(target) && utils.isPlainObject(source)) {1050return utils.merge(target, source);1051} else if (utils.isPlainObject(source)) {1052return utils.merge({}, source);1053} else if (utils.isArray(source)) {1054return source.slice();1055}1056return source;1057}10581059// eslint-disable-next-line consistent-return1060function mergeDeepProperties(prop) {1061if (!utils.isUndefined(config2[prop])) {1062return getMergedValue(config1[prop], config2[prop]);1063} else if (!utils.isUndefined(config1[prop])) {1064return getMergedValue(undefined, config1[prop]);1065}1066}10671068// eslint-disable-next-line consistent-return1069function valueFromConfig2(prop) {1070if (!utils.isUndefined(config2[prop])) {1071return getMergedValue(undefined, config2[prop]);1072}1073}10741075// eslint-disable-next-line consistent-return1076function defaultToConfig2(prop) {1077if (!utils.isUndefined(config2[prop])) {1078return getMergedValue(undefined, config2[prop]);1079} else if (!utils.isUndefined(config1[prop])) {1080return getMergedValue(undefined, config1[prop]);1081}1082}10831084// eslint-disable-next-line consistent-return1085function mergeDirectKeys(prop) {1086if (prop in config2) {1087return getMergedValue(config1[prop], config2[prop]);1088} else if (prop in config1) {1089return getMergedValue(undefined, config1[prop]);1090}1091}10921093var mergeMap = {1094'url': valueFromConfig2,1095'method': valueFromConfig2,1096'data': valueFromConfig2,1097'baseURL': defaultToConfig2,1098'transformRequest': defaultToConfig2,1099'transformResponse': defaultToConfig2,1100'paramsSerializer': defaultToConfig2,1101'timeout': defaultToConfig2,1102'timeoutMessage': defaultToConfig2,1103'withCredentials': defaultToConfig2,1104'adapter': defaultToConfig2,1105'responseType': defaultToConfig2,1106'xsrfCookieName': defaultToConfig2,1107'xsrfHeaderName': defaultToConfig2,1108'onUploadProgress': defaultToConfig2,1109'onDownloadProgress': defaultToConfig2,1110'decompress': defaultToConfig2,1111'maxContentLength': defaultToConfig2,1112'maxBodyLength': defaultToConfig2,1113'transport': defaultToConfig2,1114'httpAgent': defaultToConfig2,1115'httpsAgent': defaultToConfig2,1116'cancelToken': defaultToConfig2,1117'socketPath': defaultToConfig2,1118'responseEncoding': defaultToConfig2,1119'validateStatus': mergeDirectKeys1120};11211122utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {1123var merge = mergeMap[prop] || mergeDeepProperties;1124var configValue = merge(prop);1125(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);1126});11271128return config;1129};113011311132/***/ }),11331134/***/ "./lib/core/settle.js":1135/*!****************************!*\1136!*** ./lib/core/settle.js ***!1137\****************************/1138/*! no static exports found */1139/***/ (function(module, exports, __webpack_require__) {11401141"use strict";114211431144var createError = __webpack_require__(/*! ./createError */ "./lib/core/createError.js");11451146/**1147* Resolve or reject a Promise based on response status.1148*1149* @param {Function} resolve A function that resolves the promise.1150* @param {Function} reject A function that rejects the promise.1151* @param {object} response The response.1152*/1153module.exports = function settle(resolve, reject, response) {1154var validateStatus = response.config.validateStatus;1155if (!response.status || !validateStatus || validateStatus(response.status)) {1156resolve(response);1157} else {1158reject(createError(1159'Request failed with status code ' + response.status,1160response.config,1161null,1162response.request,1163response1164));1165}1166};116711681169/***/ }),11701171/***/ "./lib/core/transformData.js":1172/*!***********************************!*\1173!*** ./lib/core/transformData.js ***!1174\***********************************/1175/*! no static exports found */1176/***/ (function(module, exports, __webpack_require__) {11771178"use strict";117911801181var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");1182var defaults = __webpack_require__(/*! ./../defaults */ "./lib/defaults.js");11831184/**1185* Transform the data for a request or a response1186*1187* @param {Object|String} data The data to be transformed1188* @param {Array} headers The headers for the request or response1189* @param {Array|Function} fns A single function or Array of functions1190* @returns {*} The resulting transformed data1191*/1192module.exports = function transformData(data, headers, fns) {1193var context = this || defaults;1194/*eslint no-param-reassign:0*/1195utils.forEach(fns, function transform(fn) {1196data = fn.call(context, data, headers);1197});11981199return data;1200};120112021203/***/ }),12041205/***/ "./lib/defaults.js":1206/*!*************************!*\1207!*** ./lib/defaults.js ***!1208\*************************/1209/*! no static exports found */1210/***/ (function(module, exports, __webpack_require__) {12111212"use strict";121312141215var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js");1216var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./lib/helpers/normalizeHeaderName.js");1217var enhanceError = __webpack_require__(/*! ./core/enhanceError */ "./lib/core/enhanceError.js");12181219var DEFAULT_CONTENT_TYPE = {1220'Content-Type': 'application/x-www-form-urlencoded'1221};12221223function setContentTypeIfUnset(headers, value) {1224if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {1225headers['Content-Type'] = value;1226}1227}12281229function getDefaultAdapter() {1230var adapter;1231if (typeof XMLHttpRequest !== 'undefined') {1232// For browsers use XHR adapter1233adapter = __webpack_require__(/*! ./adapters/xhr */ "./lib/adapters/xhr.js");1234} else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {1235// For node use HTTP adapter1236adapter = __webpack_require__(/*! ./adapters/http */ "./lib/adapters/xhr.js");1237}1238return adapter;1239}12401241function stringifySafely(rawValue, parser, encoder) {1242if (utils.isString(rawValue)) {1243try {1244(parser || JSON.parse)(rawValue);1245return utils.trim(rawValue);1246} catch (e) {1247if (e.name !== 'SyntaxError') {1248throw e;1249}1250}1251}12521253return (encoder || JSON.stringify)(rawValue);1254}12551256var defaults = {12571258transitional: {1259silentJSONParsing: true,1260forcedJSONParsing: true,1261clarifyTimeoutError: false1262},12631264adapter: getDefaultAdapter(),12651266transformRequest: [function transformRequest(data, headers) {1267normalizeHeaderName(headers, 'Accept');1268normalizeHeaderName(headers, 'Content-Type');12691270if (utils.isFormData(data) ||1271utils.isArrayBuffer(data) ||1272utils.isBuffer(data) ||1273utils.isStream(data) ||1274utils.isFile(data) ||1275utils.isBlob(data)1276) {1277return data;1278}1279if (utils.isArrayBufferView(data)) {1280return data.buffer;1281}1282if (utils.isURLSearchParams(data)) {1283setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');1284return data.toString();1285}1286if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {1287setContentTypeIfUnset(headers, 'application/json');1288return stringifySafely(data);1289}1290return data;1291}],12921293transformResponse: [function transformResponse(data) {1294var transitional = this.transitional || defaults.transitional;1295var silentJSONParsing = transitional && transitional.silentJSONParsing;1296var forcedJSONParsing = transitional && transitional.forcedJSONParsing;1297var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';12981299if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {1300try {1301return JSON.parse(data);1302} catch (e) {1303if (strictJSONParsing) {1304if (e.name === 'SyntaxError') {1305throw enhanceError(e, this, 'E_JSON_PARSE');1306}1307throw e;1308}1309}1310}13111312return data;1313}],13141315/**1316* A timeout in milliseconds to abort a request. If set to 0 (default) a1317* timeout is not created.1318*/1319timeout: 0,13201321xsrfCookieName: 'XSRF-TOKEN',1322xsrfHeaderName: 'X-XSRF-TOKEN',13231324maxContentLength: -1,1325maxBodyLength: -1,13261327validateStatus: function validateStatus(status) {1328return status >= 200 && status < 300;1329},13301331headers: {1332common: {1333'Accept': 'application/json, text/plain, */*'1334}1335}1336};13371338utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {1339defaults.headers[method] = {};1340});13411342utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {1343defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);1344});13451346module.exports = defaults;134713481349/***/ }),13501351/***/ "./lib/env/data.js":1352/*!*************************!*\1353!*** ./lib/env/data.js ***!1354\*************************/1355/*! no static exports found */1356/***/ (function(module, exports) {13571358module.exports = {1359"version": "0.24.0"1360};13611362/***/ }),13631364/***/ "./lib/helpers/bind.js":1365/*!*****************************!*\1366!*** ./lib/helpers/bind.js ***!1367\*****************************/1368/*! no static exports found */1369/***/ (function(module, exports, __webpack_require__) {13701371"use strict";137213731374module.exports = function bind(fn, thisArg) {1375return function wrap() {1376var args = new Array(arguments.length);1377for (var i = 0; i < args.length; i++) {1378args[i] = arguments[i];1379}1380return fn.apply(thisArg, args);1381};1382};138313841385/***/ }),13861387/***/ "./lib/helpers/buildURL.js":1388/*!*********************************!*\1389!*** ./lib/helpers/buildURL.js ***!1390\*********************************/1391/*! no static exports found */1392/***/ (function(module, exports, __webpack_require__) {13931394"use strict";139513961397var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");13981399function encode(val) {1400return encodeURIComponent(val).1401replace(/%3A/gi, ':').1402replace(/%24/g, '$').1403replace(/%2C/gi, ',').1404replace(/%20/g, '+').1405replace(/%5B/gi, '[').1406replace(/%5D/gi, ']');1407}14081409/**1410* Build a URL by appending params to the end1411*1412* @param {string} url The base of the url (e.g., http://www.google.com)1413* @param {object} [params] The params to be appended1414* @returns {string} The formatted url1415*/1416module.exports = function buildURL(url, params, paramsSerializer) {1417/*eslint no-param-reassign:0*/1418if (!params) {1419return url;1420}14211422var serializedParams;1423if (paramsSerializer) {1424serializedParams = paramsSerializer(params);1425} else if (utils.isURLSearchParams(params)) {1426serializedParams = params.toString();1427} else {1428var parts = [];14291430utils.forEach(params, function serialize(val, key) {1431if (val === null || typeof val === 'undefined') {1432return;1433}14341435if (utils.isArray(val)) {1436key = key + '[]';1437} else {1438val = [val];1439}14401441utils.forEach(val, function parseValue(v) {1442if (utils.isDate(v)) {1443v = v.toISOString();1444} else if (utils.isObject(v)) {1445v = JSON.stringify(v);1446}1447parts.push(encode(key) + '=' + encode(v));1448});1449});14501451serializedParams = parts.join('&');1452}14531454if (serializedParams) {1455var hashmarkIndex = url.indexOf('#');1456if (hashmarkIndex !== -1) {1457url = url.slice(0, hashmarkIndex);1458}14591460url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;1461}14621463return url;1464};146514661467/***/ }),14681469/***/ "./lib/helpers/combineURLs.js":1470/*!************************************!*\1471!*** ./lib/helpers/combineURLs.js ***!1472\************************************/1473/*! no static exports found */1474/***/ (function(module, exports, __webpack_require__) {14751476"use strict";147714781479/**1480* Creates a new URL by combining the specified URLs1481*1482* @param {string} baseURL The base URL1483* @param {string} relativeURL The relative URL1484* @returns {string} The combined URL1485*/1486module.exports = function combineURLs(baseURL, relativeURL) {1487return relativeURL1488? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')1489: baseURL;1490};149114921493/***/ }),14941495/***/ "./lib/helpers/cookies.js":1496/*!********************************!*\1497!*** ./lib/helpers/cookies.js ***!1498\********************************/1499/*! no static exports found */1500/***/ (function(module, exports, __webpack_require__) {15011502"use strict";150315041505var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");15061507module.exports = (1508utils.isStandardBrowserEnv() ?15091510// Standard browser envs support document.cookie1511(function standardBrowserEnv() {1512return {1513write: function write(name, value, expires, path, domain, secure) {1514var cookie = [];1515cookie.push(name + '=' + encodeURIComponent(value));15161517if (utils.isNumber(expires)) {1518cookie.push('expires=' + new Date(expires).toGMTString());1519}15201521if (utils.isString(path)) {1522cookie.push('path=' + path);1523}15241525if (utils.isString(domain)) {1526cookie.push('domain=' + domain);1527}15281529if (secure === true) {1530cookie.push('secure');1531}15321533document.cookie = cookie.join('; ');1534},15351536read: function read(name) {1537var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));1538return (match ? decodeURIComponent(match[3]) : null);1539},15401541remove: function remove(name) {1542this.write(name, '', Date.now() - 86400000);1543}1544};1545})() :15461547// Non standard browser env (web workers, react-native) lack needed support.1548(function nonStandardBrowserEnv() {1549return {1550write: function write() {},1551read: function read() { return null; },1552remove: function remove() {}1553};1554})()1555);155615571558/***/ }),15591560/***/ "./lib/helpers/isAbsoluteURL.js":1561/*!**************************************!*\1562!*** ./lib/helpers/isAbsoluteURL.js ***!1563\**************************************/1564/*! no static exports found */1565/***/ (function(module, exports, __webpack_require__) {15661567"use strict";156815691570/**1571* Determines whether the specified URL is absolute1572*1573* @param {string} url The URL to test1574* @returns {boolean} True if the specified URL is absolute, otherwise false1575*/1576module.exports = function isAbsoluteURL(url) {1577// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).1578// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed1579// by any combination of letters, digits, plus, period, or hyphen.1580return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);1581};158215831584/***/ }),15851586/***/ "./lib/helpers/isAxiosError.js":1587/*!*************************************!*\1588!*** ./lib/helpers/isAxiosError.js ***!1589\*************************************/1590/*! no static exports found */1591/***/ (function(module, exports, __webpack_require__) {15921593"use strict";159415951596/**1597* Determines whether the payload is an error thrown by Axios1598*1599* @param {*} payload The value to test1600* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false1601*/1602module.exports = function isAxiosError(payload) {1603return (typeof payload === 'object') && (payload.isAxiosError === true);1604};160516061607/***/ }),16081609/***/ "./lib/helpers/isURLSameOrigin.js":1610/*!****************************************!*\1611!*** ./lib/helpers/isURLSameOrigin.js ***!1612\****************************************/1613/*! no static exports found */1614/***/ (function(module, exports, __webpack_require__) {16151616"use strict";161716181619var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");16201621module.exports = (1622utils.isStandardBrowserEnv() ?16231624// Standard browser envs have full support of the APIs needed to test1625// whether the request URL is of the same origin as current location.1626(function standardBrowserEnv() {1627var msie = /(msie|trident)/i.test(navigator.userAgent);1628var urlParsingNode = document.createElement('a');1629var originURL;16301631/**1632* Parse a URL to discover it's components1633*1634* @param {String} url The URL to be parsed1635* @returns {Object}1636*/1637function resolveURL(url) {1638var href = url;16391640if (msie) {1641// IE needs attribute set twice to normalize properties1642urlParsingNode.setAttribute('href', href);1643href = urlParsingNode.href;1644}16451646urlParsingNode.setAttribute('href', href);16471648// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils1649return {1650href: urlParsingNode.href,1651protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',1652host: urlParsingNode.host,1653search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',1654hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',1655hostname: urlParsingNode.hostname,1656port: urlParsingNode.port,1657pathname: (urlParsingNode.pathname.charAt(0) === '/') ?1658urlParsingNode.pathname :1659'/' + urlParsingNode.pathname1660};1661}16621663originURL = resolveURL(window.location.href);16641665/**1666* Determine if a URL shares the same origin as the current location1667*1668* @param {String} requestURL The URL to test1669* @returns {boolean} True if URL shares the same origin, otherwise false1670*/1671return function isURLSameOrigin(requestURL) {1672var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;1673return (parsed.protocol === originURL.protocol &&1674parsed.host === originURL.host);1675};1676})() :16771678// Non standard browser envs (web workers, react-native) lack needed support.1679(function nonStandardBrowserEnv() {1680return function isURLSameOrigin() {1681return true;1682};1683})()1684);168516861687/***/ }),16881689/***/ "./lib/helpers/normalizeHeaderName.js":1690/*!********************************************!*\1691!*** ./lib/helpers/normalizeHeaderName.js ***!1692\********************************************/1693/*! no static exports found */1694/***/ (function(module, exports, __webpack_require__) {16951696"use strict";169716981699var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js");17001701module.exports = function normalizeHeaderName(headers, normalizedName) {1702utils.forEach(headers, function processHeader(value, name) {1703if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {1704headers[normalizedName] = value;1705delete headers[name];1706}1707});1708};170917101711/***/ }),17121713/***/ "./lib/helpers/parseHeaders.js":1714/*!*************************************!*\1715!*** ./lib/helpers/parseHeaders.js ***!1716\*************************************/1717/*! no static exports found */1718/***/ (function(module, exports, __webpack_require__) {17191720"use strict";172117221723var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");17241725// Headers whose duplicates are ignored by node1726// c.f. https://nodejs.org/api/http.html#http_message_headers1727var ignoreDuplicateOf = [1728'age', 'authorization', 'content-length', 'content-type', 'etag',1729'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',1730'last-modified', 'location', 'max-forwards', 'proxy-authorization',1731'referer', 'retry-after', 'user-agent'1732];17331734/**1735* Parse headers into an object1736*1737* ```1738* Date: Wed, 27 Aug 2014 08:58:49 GMT1739* Content-Type: application/json1740* Connection: keep-alive1741* Transfer-Encoding: chunked1742* ```1743*1744* @param {String} headers Headers needing to be parsed1745* @returns {Object} Headers parsed into an object1746*/1747module.exports = function parseHeaders(headers) {1748var parsed = {};1749var key;1750var val;1751var i;17521753if (!headers) { return parsed; }17541755utils.forEach(headers.split('\n'), function parser(line) {1756i = line.indexOf(':');1757key = utils.trim(line.substr(0, i)).toLowerCase();1758val = utils.trim(line.substr(i + 1));17591760if (key) {1761if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {1762return;1763}1764if (key === 'set-cookie') {1765parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);1766} else {1767parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;1768}1769}1770});17711772return parsed;1773};177417751776/***/ }),17771778/***/ "./lib/helpers/spread.js":1779/*!*******************************!*\1780!*** ./lib/helpers/spread.js ***!1781\*******************************/1782/*! no static exports found */1783/***/ (function(module, exports, __webpack_require__) {17841785"use strict";178617871788/**1789* Syntactic sugar for invoking a function and expanding an array for arguments.1790*1791* Common use case would be to use `Function.prototype.apply`.1792*1793* ```js1794* function f(x, y, z) {}1795* var args = [1, 2, 3];1796* f.apply(null, args);1797* ```1798*1799* With `spread` this example can be re-written.1800*1801* ```js1802* spread(function(x, y, z) {})([1, 2, 3]);1803* ```1804*1805* @param {Function} callback1806* @returns {Function}1807*/1808module.exports = function spread(callback) {1809return function wrap(arr) {1810return callback.apply(null, arr);1811};1812};181318141815/***/ }),18161817/***/ "./lib/helpers/validator.js":1818/*!**********************************!*\1819!*** ./lib/helpers/validator.js ***!1820\**********************************/1821/*! no static exports found */1822/***/ (function(module, exports, __webpack_require__) {18231824"use strict";182518261827var VERSION = __webpack_require__(/*! ../env/data */ "./lib/env/data.js").version;18281829var validators = {};18301831// eslint-disable-next-line func-names1832['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {1833validators[type] = function validator(thing) {1834return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;1835};1836});18371838var deprecatedWarnings = {};18391840/**1841* Transitional option validator1842* @param {function|boolean?} validator - set to false if the transitional option has been removed1843* @param {string?} version - deprecated version / removed since version1844* @param {string?} message - some message with additional info1845* @returns {function}1846*/1847validators.transitional = function transitional(validator, version, message) {1848function formatMessage(opt, desc) {1849return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');1850}18511852// eslint-disable-next-line func-names1853return function(value, opt, opts) {1854if (validator === false) {1855throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));1856}18571858if (version && !deprecatedWarnings[opt]) {1859deprecatedWarnings[opt] = true;1860// eslint-disable-next-line no-console1861console.warn(1862formatMessage(1863opt,1864' has been deprecated since v' + version + ' and will be removed in the near future'1865)1866);1867}18681869return validator ? validator(value, opt, opts) : true;1870};1871};18721873/**1874* Assert object's properties type1875* @param {object} options1876* @param {object} schema1877* @param {boolean?} allowUnknown1878*/18791880function assertOptions(options, schema, allowUnknown) {1881if (typeof options !== 'object') {1882throw new TypeError('options must be an object');1883}1884var keys = Object.keys(options);1885var i = keys.length;1886while (i-- > 0) {1887var opt = keys[i];1888var validator = schema[opt];1889if (validator) {1890var value = options[opt];1891var result = value === undefined || validator(value, opt, options);1892if (result !== true) {1893throw new TypeError('option ' + opt + ' must be ' + result);1894}1895continue;1896}1897if (allowUnknown !== true) {1898throw Error('Unknown option ' + opt);1899}1900}1901}19021903module.exports = {1904assertOptions: assertOptions,1905validators: validators1906};190719081909/***/ }),19101911/***/ "./lib/utils.js":1912/*!**********************!*\1913!*** ./lib/utils.js ***!1914\**********************/1915/*! no static exports found */1916/***/ (function(module, exports, __webpack_require__) {19171918"use strict";191919201921var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js");19221923// utils is a library of generic helper functions non-specific to axios19241925var toString = Object.prototype.toString;19261927/**1928* Determine if a value is an Array1929*1930* @param {Object} val The value to test1931* @returns {boolean} True if value is an Array, otherwise false1932*/1933function isArray(val) {1934return toString.call(val) === '[object Array]';1935}19361937/**1938* Determine if a value is undefined1939*1940* @param {Object} val The value to test1941* @returns {boolean} True if the value is undefined, otherwise false1942*/1943function isUndefined(val) {1944return typeof val === 'undefined';1945}19461947/**1948* Determine if a value is a Buffer1949*1950* @param {Object} val The value to test1951* @returns {boolean} True if value is a Buffer, otherwise false1952*/1953function isBuffer(val) {1954return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)1955&& typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);1956}19571958/**1959* Determine if a value is an ArrayBuffer1960*1961* @param {Object} val The value to test1962* @returns {boolean} True if value is an ArrayBuffer, otherwise false1963*/1964function isArrayBuffer(val) {1965return toString.call(val) === '[object ArrayBuffer]';1966}19671968/**1969* Determine if a value is a FormData1970*1971* @param {Object} val The value to test1972* @returns {boolean} True if value is an FormData, otherwise false1973*/1974function isFormData(val) {1975return (typeof FormData !== 'undefined') && (val instanceof FormData);1976}19771978/**1979* Determine if a value is a view on an ArrayBuffer1980*1981* @param {Object} val The value to test1982* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false1983*/1984function isArrayBufferView(val) {1985var result;1986if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {1987result = ArrayBuffer.isView(val);1988} else {1989result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);1990}1991return result;1992}19931994/**1995* Determine if a value is a String1996*1997* @param {Object} val The value to test1998* @returns {boolean} True if value is a String, otherwise false1999*/2000function isString(val) {2001return typeof val === 'string';2002}20032004/**2005* Determine if a value is a Number2006*2007* @param {Object} val The value to test2008* @returns {boolean} True if value is a Number, otherwise false2009*/2010function isNumber(val) {2011return typeof val === 'number';2012}20132014/**2015* Determine if a value is an Object2016*2017* @param {Object} val The value to test2018* @returns {boolean} True if value is an Object, otherwise false2019*/2020function isObject(val) {2021return val !== null && typeof val === 'object';2022}20232024/**2025* Determine if a value is a plain Object2026*2027* @param {Object} val The value to test2028* @return {boolean} True if value is a plain Object, otherwise false2029*/2030function isPlainObject(val) {2031if (toString.call(val) !== '[object Object]') {2032return false;2033}20342035var prototype = Object.getPrototypeOf(val);2036return prototype === null || prototype === Object.prototype;2037}20382039/**2040* Determine if a value is a Date2041*2042* @param {Object} val The value to test2043* @returns {boolean} True if value is a Date, otherwise false2044*/2045function isDate(val) {2046return toString.call(val) === '[object Date]';2047}20482049/**2050* Determine if a value is a File2051*2052* @param {Object} val The value to test2053* @returns {boolean} True if value is a File, otherwise false2054*/2055function isFile(val) {2056return toString.call(val) === '[object File]';2057}20582059/**2060* Determine if a value is a Blob2061*2062* @param {Object} val The value to test2063* @returns {boolean} True if value is a Blob, otherwise false2064*/2065function isBlob(val) {2066return toString.call(val) === '[object Blob]';2067}20682069/**2070* Determine if a value is a Function2071*2072* @param {Object} val The value to test2073* @returns {boolean} True if value is a Function, otherwise false2074*/2075function isFunction(val) {2076return toString.call(val) === '[object Function]';2077}20782079/**2080* Determine if a value is a Stream2081*2082* @param {Object} val The value to test2083* @returns {boolean} True if value is a Stream, otherwise false2084*/2085function isStream(val) {2086return isObject(val) && isFunction(val.pipe);2087}20882089/**2090* Determine if a value is a URLSearchParams object2091*2092* @param {Object} val The value to test2093* @returns {boolean} True if value is a URLSearchParams object, otherwise false2094*/2095function isURLSearchParams(val) {2096return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;2097}20982099/**2100* Trim excess whitespace off the beginning and end of a string2101*2102* @param {String} str The String to trim2103* @returns {String} The String freed of excess whitespace2104*/2105function trim(str) {2106return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');2107}21082109/**2110* Determine if we're running in a standard browser environment2111*2112* This allows axios to run in a web worker, and react-native.2113* Both environments support XMLHttpRequest, but not fully standard globals.2114*2115* web workers:2116* typeof window -> undefined2117* typeof document -> undefined2118*2119* react-native:2120* navigator.product -> 'ReactNative'2121* nativescript2122* navigator.product -> 'NativeScript' or 'NS'2123*/2124function isStandardBrowserEnv() {2125if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||2126navigator.product === 'NativeScript' ||2127navigator.product === 'NS')) {2128return false;2129}2130return (2131typeof window !== 'undefined' &&2132typeof document !== 'undefined'2133);2134}21352136/**2137* Iterate over an Array or an Object invoking a function for each item.2138*2139* If `obj` is an Array callback will be called passing2140* the value, index, and complete array for each item.2141*2142* If 'obj' is an Object callback will be called passing2143* the value, key, and complete object for each property.2144*2145* @param {Object|Array} obj The object to iterate2146* @param {Function} fn The callback to invoke for each item2147*/2148function forEach(obj, fn) {2149// Don't bother if no value provided2150if (obj === null || typeof obj === 'undefined') {2151return;2152}21532154// Force an array if not already something iterable2155if (typeof obj !== 'object') {2156/*eslint no-param-reassign:0*/2157obj = [obj];2158}21592160if (isArray(obj)) {2161// Iterate over array values2162for (var i = 0, l = obj.length; i < l; i++) {2163fn.call(null, obj[i], i, obj);2164}2165} else {2166// Iterate over object keys2167for (var key in obj) {2168if (Object.prototype.hasOwnProperty.call(obj, key)) {2169fn.call(null, obj[key], key, obj);2170}2171}2172}2173}21742175/**2176* Accepts varargs expecting each argument to be an object, then2177* immutably merges the properties of each object and returns result.2178*2179* When multiple objects contain the same key the later object in2180* the arguments list will take precedence.2181*2182* Example:2183*2184* ```js2185* var result = merge({foo: 123}, {foo: 456});2186* console.log(result.foo); // outputs 4562187* ```2188*2189* @param {Object} obj1 Object to merge2190* @returns {Object} Result of all merge properties2191*/2192function merge(/* obj1, obj2, obj3, ... */) {2193var result = {};2194function assignValue(val, key) {2195if (isPlainObject(result[key]) && isPlainObject(val)) {2196result[key] = merge(result[key], val);2197} else if (isPlainObject(val)) {2198result[key] = merge({}, val);2199} else if (isArray(val)) {2200result[key] = val.slice();2201} else {2202result[key] = val;2203}2204}22052206for (var i = 0, l = arguments.length; i < l; i++) {2207forEach(arguments[i], assignValue);2208}2209return result;2210}22112212/**2213* Extends object a by mutably adding to it the properties of object b.2214*2215* @param {Object} a The object to be extended2216* @param {Object} b The object to copy properties from2217* @param {Object} thisArg The object to bind function to2218* @return {Object} The resulting value of object a2219*/2220function extend(a, b, thisArg) {2221forEach(b, function assignValue(val, key) {2222if (thisArg && typeof val === 'function') {2223a[key] = bind(val, thisArg);2224} else {2225a[key] = val;2226}2227});2228return a;2229}22302231/**2232* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)2233*2234* @param {string} content with BOM2235* @return {string} content value without BOM2236*/2237function stripBOM(content) {2238if (content.charCodeAt(0) === 0xFEFF) {2239content = content.slice(1);2240}2241return content;2242}22432244module.exports = {2245isArray: isArray,2246isArrayBuffer: isArrayBuffer,2247isBuffer: isBuffer,2248isFormData: isFormData,2249isArrayBufferView: isArrayBufferView,2250isString: isString,2251isNumber: isNumber,2252isObject: isObject,2253isPlainObject: isPlainObject,2254isUndefined: isUndefined,2255isDate: isDate,2256isFile: isFile,2257isBlob: isBlob,2258isFunction: isFunction,2259isStream: isStream,2260isURLSearchParams: isURLSearchParams,2261isStandardBrowserEnv: isStandardBrowserEnv,2262forEach: forEach,2263merge: merge,2264extend: extend,2265trim: trim,2266stripBOM: stripBOM2267};226822692270/***/ })22712272/******/ });2273});2274//# sourceMappingURL=axios.map22752276