You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1741 lines
46 KiB

  1. /* axios v0.20.0 | (c) 2020 by Matt Zabriskie */
  2. (function webpackUniversalModuleDefinition(root, factory) {
  3. if(typeof exports === 'object' && typeof module === 'object')
  4. module.exports = factory();
  5. else if(typeof define === 'function' && define.amd)
  6. define([], factory);
  7. else if(typeof exports === 'object')
  8. exports["axios"] = factory();
  9. else
  10. root["axios"] = factory();
  11. })(this, function() {
  12. return /******/ (function(modules) { // webpackBootstrap
  13. /******/ // The module cache
  14. /******/ var installedModules = {};
  15. /******/
  16. /******/ // The require function
  17. /******/ function __webpack_require__(moduleId) {
  18. /******/
  19. /******/ // Check if module is in cache
  20. /******/ if(installedModules[moduleId])
  21. /******/ return installedModules[moduleId].exports;
  22. /******/
  23. /******/ // Create a new module (and put it into the cache)
  24. /******/ var module = installedModules[moduleId] = {
  25. /******/ exports: {},
  26. /******/ id: moduleId,
  27. /******/ loaded: false
  28. /******/ };
  29. /******/
  30. /******/ // Execute the module function
  31. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  32. /******/
  33. /******/ // Flag the module as loaded
  34. /******/ module.loaded = true;
  35. /******/
  36. /******/ // Return the exports of the module
  37. /******/ return module.exports;
  38. /******/ }
  39. /******/
  40. /******/
  41. /******/ // expose the modules object (__webpack_modules__)
  42. /******/ __webpack_require__.m = modules;
  43. /******/
  44. /******/ // expose the module cache
  45. /******/ __webpack_require__.c = installedModules;
  46. /******/
  47. /******/ // __webpack_public_path__
  48. /******/ __webpack_require__.p = "";
  49. /******/
  50. /******/ // Load entry module and return exports
  51. /******/ return __webpack_require__(0);
  52. /******/ })
  53. /************************************************************************/
  54. /******/ ([
  55. /* 0 */
  56. /***/ (function(module, exports, __webpack_require__) {
  57. module.exports = __webpack_require__(1);
  58. /***/ }),
  59. /* 1 */
  60. /***/ (function(module, exports, __webpack_require__) {
  61. 'use strict';
  62. var utils = __webpack_require__(2);
  63. var bind = __webpack_require__(3);
  64. var Axios = __webpack_require__(4);
  65. var mergeConfig = __webpack_require__(22);
  66. var defaults = __webpack_require__(10);
  67. /**
  68. * Create an instance of Axios
  69. *
  70. * @param {Object} defaultConfig The default config for the instance
  71. * @return {Axios} A new instance of Axios
  72. */
  73. function createInstance(defaultConfig) {
  74. var context = new Axios(defaultConfig);
  75. var instance = bind(Axios.prototype.request, context);
  76. // Copy axios.prototype to instance
  77. utils.extend(instance, Axios.prototype, context);
  78. // Copy context to instance
  79. utils.extend(instance, context);
  80. return instance;
  81. }
  82. // Create the default instance to be exported
  83. var axios = createInstance(defaults);
  84. // Expose Axios class to allow class inheritance
  85. axios.Axios = Axios;
  86. // Factory for creating new instances
  87. axios.create = function create(instanceConfig) {
  88. return createInstance(mergeConfig(axios.defaults, instanceConfig));
  89. };
  90. // Expose Cancel & CancelToken
  91. axios.Cancel = __webpack_require__(23);
  92. axios.CancelToken = __webpack_require__(24);
  93. axios.isCancel = __webpack_require__(9);
  94. // Expose all/spread
  95. axios.all = function all(promises) {
  96. return Promise.all(promises);
  97. };
  98. axios.spread = __webpack_require__(25);
  99. module.exports = axios;
  100. // Allow use of default import syntax in TypeScript
  101. module.exports.default = axios;
  102. /***/ }),
  103. /* 2 */
  104. /***/ (function(module, exports, __webpack_require__) {
  105. 'use strict';
  106. var bind = __webpack_require__(3);
  107. /*global toString:true*/
  108. // utils is a library of generic helper functions non-specific to axios
  109. var toString = Object.prototype.toString;
  110. /**
  111. * Determine if a value is an Array
  112. *
  113. * @param {Object} val The value to test
  114. * @returns {boolean} True if value is an Array, otherwise false
  115. */
  116. function isArray(val) {
  117. return toString.call(val) === '[object Array]';
  118. }
  119. /**
  120. * Determine if a value is undefined
  121. *
  122. * @param {Object} val The value to test
  123. * @returns {boolean} True if the value is undefined, otherwise false
  124. */
  125. function isUndefined(val) {
  126. return typeof val === 'undefined';
  127. }
  128. /**
  129. * Determine if a value is a Buffer
  130. *
  131. * @param {Object} val The value to test
  132. * @returns {boolean} True if value is a Buffer, otherwise false
  133. */
  134. function isBuffer(val) {
  135. return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
  136. && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
  137. }
  138. /**
  139. * Determine if a value is an ArrayBuffer
  140. *
  141. * @param {Object} val The value to test
  142. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  143. */
  144. function isArrayBuffer(val) {
  145. return toString.call(val) === '[object ArrayBuffer]';
  146. }
  147. /**
  148. * Determine if a value is a FormData
  149. *
  150. * @param {Object} val The value to test
  151. * @returns {boolean} True if value is an FormData, otherwise false
  152. */
  153. function isFormData(val) {
  154. return (typeof FormData !== 'undefined') && (val instanceof FormData);
  155. }
  156. /**
  157. * Determine if a value is a view on an ArrayBuffer
  158. *
  159. * @param {Object} val The value to test
  160. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  161. */
  162. function isArrayBufferView(val) {
  163. var result;
  164. if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
  165. result = ArrayBuffer.isView(val);
  166. } else {
  167. result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
  168. }
  169. return result;
  170. }
  171. /**
  172. * Determine if a value is a String
  173. *
  174. * @param {Object} val The value to test
  175. * @returns {boolean} True if value is a String, otherwise false
  176. */
  177. function isString(val) {
  178. return typeof val === 'string';
  179. }
  180. /**
  181. * Determine if a value is a Number
  182. *
  183. * @param {Object} val The value to test
  184. * @returns {boolean} True if value is a Number, otherwise false
  185. */
  186. function isNumber(val) {
  187. return typeof val === 'number';
  188. }
  189. /**
  190. * Determine if a value is an Object
  191. *
  192. * @param {Object} val The value to test
  193. * @returns {boolean} True if value is an Object, otherwise false
  194. */
  195. function isObject(val) {
  196. return val !== null && typeof val === 'object';
  197. }
  198. /**
  199. * Determine if a value is a plain Object
  200. *
  201. * @param {Object} val The value to test
  202. * @return {boolean} True if value is a plain Object, otherwise false
  203. */
  204. function isPlainObject(val) {
  205. if (toString.call(val) !== '[object Object]') {
  206. return false;
  207. }
  208. var prototype = Object.getPrototypeOf(val);
  209. return prototype === null || prototype === Object.prototype;
  210. }
  211. /**
  212. * Determine if a value is a Date
  213. *
  214. * @param {Object} val The value to test
  215. * @returns {boolean} True if value is a Date, otherwise false
  216. */
  217. function isDate(val) {
  218. return toString.call(val) === '[object Date]';
  219. }
  220. /**
  221. * Determine if a value is a File
  222. *
  223. * @param {Object} val The value to test
  224. * @returns {boolean} True if value is a File, otherwise false
  225. */
  226. function isFile(val) {
  227. return toString.call(val) === '[object File]';
  228. }
  229. /**
  230. * Determine if a value is a Blob
  231. *
  232. * @param {Object} val The value to test
  233. * @returns {boolean} True if value is a Blob, otherwise false
  234. */
  235. function isBlob(val) {
  236. return toString.call(val) === '[object Blob]';
  237. }
  238. /**
  239. * Determine if a value is a Function
  240. *
  241. * @param {Object} val The value to test
  242. * @returns {boolean} True if value is a Function, otherwise false
  243. */
  244. function isFunction(val) {
  245. return toString.call(val) === '[object Function]';
  246. }
  247. /**
  248. * Determine if a value is a Stream
  249. *
  250. * @param {Object} val The value to test
  251. * @returns {boolean} True if value is a Stream, otherwise false
  252. */
  253. function isStream(val) {
  254. return isObject(val) && isFunction(val.pipe);
  255. }
  256. /**
  257. * Determine if a value is a URLSearchParams object
  258. *
  259. * @param {Object} val The value to test
  260. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  261. */
  262. function isURLSearchParams(val) {
  263. return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
  264. }
  265. /**
  266. * Trim excess whitespace off the beginning and end of a string
  267. *
  268. * @param {String} str The String to trim
  269. * @returns {String} The String freed of excess whitespace
  270. */
  271. function trim(str) {
  272. return str.replace(/^\s*/, '').replace(/\s*$/, '');
  273. }
  274. /**
  275. * Determine if we're running in a standard browser environment
  276. *
  277. * This allows axios to run in a web worker, and react-native.
  278. * Both environments support XMLHttpRequest, but not fully standard globals.
  279. *
  280. * web workers:
  281. * typeof window -> undefined
  282. * typeof document -> undefined
  283. *
  284. * react-native:
  285. * navigator.product -> 'ReactNative'
  286. * nativescript
  287. * navigator.product -> 'NativeScript' or 'NS'
  288. */
  289. function isStandardBrowserEnv() {
  290. if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
  291. navigator.product === 'NativeScript' ||
  292. navigator.product === 'NS')) {
  293. return false;
  294. }
  295. return (
  296. typeof window !== 'undefined' &&
  297. typeof document !== 'undefined'
  298. );
  299. }
  300. /**
  301. * Iterate over an Array or an Object invoking a function for each item.
  302. *
  303. * If `obj` is an Array callback will be called passing
  304. * the value, index, and complete array for each item.
  305. *
  306. * If 'obj' is an Object callback will be called passing
  307. * the value, key, and complete object for each property.
  308. *
  309. * @param {Object|Array} obj The object to iterate
  310. * @param {Function} fn The callback to invoke for each item
  311. */
  312. function forEach(obj, fn) {
  313. // Don't bother if no value provided
  314. if (obj === null || typeof obj === 'undefined') {
  315. return;
  316. }
  317. // Force an array if not already something iterable
  318. if (typeof obj !== 'object') {
  319. /*eslint no-param-reassign:0*/
  320. obj = [obj];
  321. }
  322. if (isArray(obj)) {
  323. // Iterate over array values
  324. for (var i = 0, l = obj.length; i < l; i++) {
  325. fn.call(null, obj[i], i, obj);
  326. }
  327. } else {
  328. // Iterate over object keys
  329. for (var key in obj) {
  330. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  331. fn.call(null, obj[key], key, obj);
  332. }
  333. }
  334. }
  335. }
  336. /**
  337. * Accepts varargs expecting each argument to be an object, then
  338. * immutably merges the properties of each object and returns result.
  339. *
  340. * When multiple objects contain the same key the later object in
  341. * the arguments list will take precedence.
  342. *
  343. * Example:
  344. *
  345. * ```js
  346. * var result = merge({foo: 123}, {foo: 456});
  347. * console.log(result.foo); // outputs 456
  348. * ```
  349. *
  350. * @param {Object} obj1 Object to merge
  351. * @returns {Object} Result of all merge properties
  352. */
  353. function merge(/* obj1, obj2, obj3, ... */) {
  354. var result = {};
  355. function assignValue(val, key) {
  356. if (isPlainObject(result[key]) && isPlainObject(val)) {
  357. result[key] = merge(result[key], val);
  358. } else if (isPlainObject(val)) {
  359. result[key] = merge({}, val);
  360. } else if (isArray(val)) {
  361. result[key] = val.slice();
  362. } else {
  363. result[key] = val;
  364. }
  365. }
  366. for (var i = 0, l = arguments.length; i < l; i++) {
  367. forEach(arguments[i], assignValue);
  368. }
  369. return result;
  370. }
  371. /**
  372. * Extends object a by mutably adding to it the properties of object b.
  373. *
  374. * @param {Object} a The object to be extended
  375. * @param {Object} b The object to copy properties from
  376. * @param {Object} thisArg The object to bind function to
  377. * @return {Object} The resulting value of object a
  378. */
  379. function extend(a, b, thisArg) {
  380. forEach(b, function assignValue(val, key) {
  381. if (thisArg && typeof val === 'function') {
  382. a[key] = bind(val, thisArg);
  383. } else {
  384. a[key] = val;
  385. }
  386. });
  387. return a;
  388. }
  389. /**
  390. * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
  391. *
  392. * @param {string} content with BOM
  393. * @return {string} content value without BOM
  394. */
  395. function stripBOM(content) {
  396. if (content.charCodeAt(0) === 0xFEFF) {
  397. content = content.slice(1);
  398. }
  399. return content;
  400. }
  401. module.exports = {
  402. isArray: isArray,
  403. isArrayBuffer: isArrayBuffer,
  404. isBuffer: isBuffer,
  405. isFormData: isFormData,
  406. isArrayBufferView: isArrayBufferView,
  407. isString: isString,
  408. isNumber: isNumber,
  409. isObject: isObject,
  410. isPlainObject: isPlainObject,
  411. isUndefined: isUndefined,
  412. isDate: isDate,
  413. isFile: isFile,
  414. isBlob: isBlob,
  415. isFunction: isFunction,
  416. isStream: isStream,
  417. isURLSearchParams: isURLSearchParams,
  418. isStandardBrowserEnv: isStandardBrowserEnv,
  419. forEach: forEach,
  420. merge: merge,
  421. extend: extend,
  422. trim: trim,
  423. stripBOM: stripBOM
  424. };
  425. /***/ }),
  426. /* 3 */
  427. /***/ (function(module, exports) {
  428. 'use strict';
  429. module.exports = function bind(fn, thisArg) {
  430. return function wrap() {
  431. var args = new Array(arguments.length);
  432. for (var i = 0; i < args.length; i++) {
  433. args[i] = arguments[i];
  434. }
  435. return fn.apply(thisArg, args);
  436. };
  437. };
  438. /***/ }),
  439. /* 4 */
  440. /***/ (function(module, exports, __webpack_require__) {
  441. 'use strict';
  442. var utils = __webpack_require__(2);
  443. var buildURL = __webpack_require__(5);
  444. var InterceptorManager = __webpack_require__(6);
  445. var dispatchRequest = __webpack_require__(7);
  446. var mergeConfig = __webpack_require__(22);
  447. /**
  448. * Create a new instance of Axios
  449. *
  450. * @param {Object} instanceConfig The default config for the instance
  451. */
  452. function Axios(instanceConfig) {
  453. this.defaults = instanceConfig;
  454. this.interceptors = {
  455. request: new InterceptorManager(),
  456. response: new InterceptorManager()
  457. };
  458. }
  459. /**
  460. * Dispatch a request
  461. *
  462. * @param {Object} config The config specific for this request (merged with this.defaults)
  463. */
  464. Axios.prototype.request = function request(config) {
  465. /*eslint no-param-reassign:0*/
  466. // Allow for axios('example/url'[, config]) a la fetch API
  467. if (typeof config === 'string') {
  468. config = arguments[1] || {};
  469. config.url = arguments[0];
  470. } else {
  471. config = config || {};
  472. }
  473. config = mergeConfig(this.defaults, config);
  474. // Set config.method
  475. if (config.method) {
  476. config.method = config.method.toLowerCase();
  477. } else if (this.defaults.method) {
  478. config.method = this.defaults.method.toLowerCase();
  479. } else {
  480. config.method = 'get';
  481. }
  482. // Hook up interceptors middleware
  483. var chain = [dispatchRequest, undefined];
  484. var promise = Promise.resolve(config);
  485. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  486. chain.unshift(interceptor.fulfilled, interceptor.rejected);
  487. });
  488. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  489. chain.push(interceptor.fulfilled, interceptor.rejected);
  490. });
  491. while (chain.length) {
  492. promise = promise.then(chain.shift(), chain.shift());
  493. }
  494. return promise;
  495. };
  496. Axios.prototype.getUri = function getUri(config) {
  497. config = mergeConfig(this.defaults, config);
  498. return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
  499. };
  500. // Provide aliases for supported request methods
  501. utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
  502. /*eslint func-names:0*/
  503. Axios.prototype[method] = function(url, config) {
  504. return this.request(mergeConfig(config || {}, {
  505. method: method,
  506. url: url
  507. }));
  508. };
  509. });
  510. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  511. /*eslint func-names:0*/
  512. Axios.prototype[method] = function(url, data, config) {
  513. return this.request(mergeConfig(config || {}, {
  514. method: method,
  515. url: url,
  516. data: data
  517. }));
  518. };
  519. });
  520. module.exports = Axios;
  521. /***/ }),
  522. /* 5 */
  523. /***/ (function(module, exports, __webpack_require__) {
  524. 'use strict';
  525. var utils = __webpack_require__(2);
  526. function encode(val) {
  527. return encodeURIComponent(val).
  528. replace(/%3A/gi, ':').
  529. replace(/%24/g, '$').
  530. replace(/%2C/gi, ',').
  531. replace(/%20/g, '+').
  532. replace(/%5B/gi, '[').
  533. replace(/%5D/gi, ']');
  534. }
  535. /**
  536. * Build a URL by appending params to the end
  537. *
  538. * @param {string} url The base of the url (e.g., http://www.google.com)
  539. * @param {object} [params] The params to be appended
  540. * @returns {string} The formatted url
  541. */
  542. module.exports = function buildURL(url, params, paramsSerializer) {
  543. /*eslint no-param-reassign:0*/
  544. if (!params) {
  545. return url;
  546. }
  547. var serializedParams;
  548. if (paramsSerializer) {
  549. serializedParams = paramsSerializer(params);
  550. } else if (utils.isURLSearchParams(params)) {
  551. serializedParams = params.toString();
  552. } else {
  553. var parts = [];
  554. utils.forEach(params, function serialize(val, key) {
  555. if (val === null || typeof val === 'undefined') {
  556. return;
  557. }
  558. if (utils.isArray(val)) {
  559. key = key + '[]';
  560. } else {
  561. val = [val];
  562. }
  563. utils.forEach(val, function parseValue(v) {
  564. if (utils.isDate(v)) {
  565. v = v.toISOString();
  566. } else if (utils.isObject(v)) {
  567. v = JSON.stringify(v);
  568. }
  569. parts.push(encode(key) + '=' + encode(v));
  570. });
  571. });
  572. serializedParams = parts.join('&');
  573. }
  574. if (serializedParams) {
  575. var hashmarkIndex = url.indexOf('#');
  576. if (hashmarkIndex !== -1) {
  577. url = url.slice(0, hashmarkIndex);
  578. }
  579. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  580. }
  581. return url;
  582. };
  583. /***/ }),
  584. /* 6 */
  585. /***/ (function(module, exports, __webpack_require__) {
  586. 'use strict';
  587. var utils = __webpack_require__(2);
  588. function InterceptorManager() {
  589. this.handlers = [];
  590. }
  591. /**
  592. * Add a new interceptor to the stack
  593. *
  594. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  595. * @param {Function} rejected The function to handle `reject` for a `Promise`
  596. *
  597. * @return {Number} An ID used to remove interceptor later
  598. */
  599. InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  600. this.handlers.push({
  601. fulfilled: fulfilled,
  602. rejected: rejected
  603. });
  604. return this.handlers.length - 1;
  605. };
  606. /**
  607. * Remove an interceptor from the stack
  608. *
  609. * @param {Number} id The ID that was returned by `use`
  610. */
  611. InterceptorManager.prototype.eject = function eject(id) {
  612. if (this.handlers[id]) {
  613. this.handlers[id] = null;
  614. }
  615. };
  616. /**
  617. * Iterate over all the registered interceptors
  618. *
  619. * This method is particularly useful for skipping over any
  620. * interceptors that may have become `null` calling `eject`.
  621. *
  622. * @param {Function} fn The function to call for each interceptor
  623. */
  624. InterceptorManager.prototype.forEach = function forEach(fn) {
  625. utils.forEach(this.handlers, function forEachHandler(h) {
  626. if (h !== null) {
  627. fn(h);
  628. }
  629. });
  630. };
  631. module.exports = InterceptorManager;
  632. /***/ }),
  633. /* 7 */
  634. /***/ (function(module, exports, __webpack_require__) {
  635. 'use strict';
  636. var utils = __webpack_require__(2);
  637. var transformData = __webpack_require__(8);
  638. var isCancel = __webpack_require__(9);
  639. var defaults = __webpack_require__(10);
  640. /**
  641. * Throws a `Cancel` if cancellation has been requested.
  642. */
  643. function throwIfCancellationRequested(config) {
  644. if (config.cancelToken) {
  645. config.cancelToken.throwIfRequested();
  646. }
  647. }
  648. /**
  649. * Dispatch a request to the server using the configured adapter.
  650. *
  651. * @param {object} config The config that is to be used for the request
  652. * @returns {Promise} The Promise to be fulfilled
  653. */
  654. module.exports = function dispatchRequest(config) {
  655. throwIfCancellationRequested(config);
  656. // Ensure headers exist
  657. config.headers = config.headers || {};
  658. // Transform request data
  659. config.data = transformData(
  660. config.data,
  661. config.headers,
  662. config.transformRequest
  663. );
  664. // Flatten headers
  665. config.headers = utils.merge(
  666. config.headers.common || {},
  667. config.headers[config.method] || {},
  668. config.headers
  669. );
  670. utils.forEach(
  671. ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
  672. function cleanHeaderConfig(method) {
  673. delete config.headers[method];
  674. }
  675. );
  676. var adapter = config.adapter || defaults.adapter;
  677. return adapter(config).then(function onAdapterResolution(response) {
  678. throwIfCancellationRequested(config);
  679. // Transform response data
  680. response.data = transformData(
  681. response.data,
  682. response.headers,
  683. config.transformResponse
  684. );
  685. return response;
  686. }, function onAdapterRejection(reason) {
  687. if (!isCancel(reason)) {
  688. throwIfCancellationRequested(config);
  689. // Transform response data
  690. if (reason && reason.response) {
  691. reason.response.data = transformData(
  692. reason.response.data,
  693. reason.response.headers,
  694. config.transformResponse
  695. );
  696. }
  697. }
  698. return Promise.reject(reason);
  699. });
  700. };
  701. /***/ }),
  702. /* 8 */
  703. /***/ (function(module, exports, __webpack_require__) {
  704. 'use strict';
  705. var utils = __webpack_require__(2);
  706. /**
  707. * Transform the data for a request or a response
  708. *
  709. * @param {Object|String} data The data to be transformed
  710. * @param {Array} headers The headers for the request or response
  711. * @param {Array|Function} fns A single function or Array of functions
  712. * @returns {*} The resulting transformed data
  713. */
  714. module.exports = function transformData(data, headers, fns) {
  715. /*eslint no-param-reassign:0*/
  716. utils.forEach(fns, function transform(fn) {
  717. data = fn(data, headers);
  718. });
  719. return data;
  720. };
  721. /***/ }),
  722. /* 9 */
  723. /***/ (function(module, exports) {
  724. 'use strict';
  725. module.exports = function isCancel(value) {
  726. return !!(value && value.__CANCEL__);
  727. };
  728. /***/ }),
  729. /* 10 */
  730. /***/ (function(module, exports, __webpack_require__) {
  731. 'use strict';
  732. var utils = __webpack_require__(2);
  733. var normalizeHeaderName = __webpack_require__(11);
  734. var DEFAULT_CONTENT_TYPE = {
  735. 'Content-Type': 'application/x-www-form-urlencoded'
  736. };
  737. function setContentTypeIfUnset(headers, value) {
  738. if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
  739. headers['Content-Type'] = value;
  740. }
  741. }
  742. function getDefaultAdapter() {
  743. var adapter;
  744. if (typeof XMLHttpRequest !== 'undefined') {
  745. // For browsers use XHR adapter
  746. adapter = __webpack_require__(12);
  747. } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
  748. // For node use HTTP adapter
  749. adapter = __webpack_require__(12);
  750. }
  751. return adapter;
  752. }
  753. var defaults = {
  754. adapter: getDefaultAdapter(),
  755. transformRequest: [function transformRequest(data, headers) {
  756. normalizeHeaderName(headers, 'Accept');
  757. normalizeHeaderName(headers, 'Content-Type');
  758. if (utils.isFormData(data) ||
  759. utils.isArrayBuffer(data) ||
  760. utils.isBuffer(data) ||
  761. utils.isStream(data) ||
  762. utils.isFile(data) ||
  763. utils.isBlob(data)
  764. ) {
  765. return data;
  766. }
  767. if (utils.isArrayBufferView(data)) {
  768. return data.buffer;
  769. }
  770. if (utils.isURLSearchParams(data)) {
  771. setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
  772. return data.toString();
  773. }
  774. if (utils.isObject(data)) {
  775. setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
  776. return JSON.stringify(data);
  777. }
  778. return data;
  779. }],
  780. transformResponse: [function transformResponse(data) {
  781. /*eslint no-param-reassign:0*/
  782. if (typeof data === 'string') {
  783. try {
  784. data = JSON.parse(data);
  785. } catch (e) { /* Ignore */ }
  786. }
  787. return data;
  788. }],
  789. /**
  790. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  791. * timeout is not created.
  792. */
  793. timeout: 0,
  794. xsrfCookieName: 'XSRF-TOKEN',
  795. xsrfHeaderName: 'X-XSRF-TOKEN',
  796. maxContentLength: -1,
  797. maxBodyLength: -1,
  798. validateStatus: function validateStatus(status) {
  799. return status >= 200 && status < 300;
  800. }
  801. };
  802. defaults.headers = {
  803. common: {
  804. 'Accept': 'application/json, text/plain, */*'
  805. }
  806. };
  807. utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
  808. defaults.headers[method] = {};
  809. });
  810. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  811. defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
  812. });
  813. module.exports = defaults;
  814. /***/ }),
  815. /* 11 */
  816. /***/ (function(module, exports, __webpack_require__) {
  817. 'use strict';
  818. var utils = __webpack_require__(2);
  819. module.exports = function normalizeHeaderName(headers, normalizedName) {
  820. utils.forEach(headers, function processHeader(value, name) {
  821. if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
  822. headers[normalizedName] = value;
  823. delete headers[name];
  824. }
  825. });
  826. };
  827. /***/ }),
  828. /* 12 */
  829. /***/ (function(module, exports, __webpack_require__) {
  830. 'use strict';
  831. var utils = __webpack_require__(2);
  832. var settle = __webpack_require__(13);
  833. var cookies = __webpack_require__(16);
  834. var buildURL = __webpack_require__(5);
  835. var buildFullPath = __webpack_require__(17);
  836. var parseHeaders = __webpack_require__(20);
  837. var isURLSameOrigin = __webpack_require__(21);
  838. var createError = __webpack_require__(14);
  839. module.exports = function xhrAdapter(config) {
  840. return new Promise(function dispatchXhrRequest(resolve, reject) {
  841. var requestData = config.data;
  842. var requestHeaders = config.headers;
  843. if (utils.isFormData(requestData)) {
  844. delete requestHeaders['Content-Type']; // Let the browser set it
  845. }
  846. if (
  847. (utils.isBlob(requestData) || utils.isFile(requestData)) &&
  848. requestData.type
  849. ) {
  850. delete requestHeaders['Content-Type']; // Let the browser set it
  851. }
  852. var request = new XMLHttpRequest();
  853. // HTTP basic authentication
  854. if (config.auth) {
  855. var username = config.auth.username || '';
  856. var password = unescape(encodeURIComponent(config.auth.password)) || '';
  857. requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
  858. }
  859. var fullPath = buildFullPath(config.baseURL, config.url);
  860. request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
  861. // Set the request timeout in MS
  862. request.timeout = config.timeout;
  863. // Listen for ready state
  864. request.onreadystatechange = function handleLoad() {
  865. if (!request || request.readyState !== 4) {
  866. return;
  867. }
  868. // The request errored out and we didn't get a response, this will be
  869. // handled by onerror instead
  870. // With one exception: request that using file: protocol, most browsers
  871. // will return status as 0 even though it's a successful request
  872. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
  873. return;
  874. }
  875. // Prepare the response
  876. var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
  877. var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
  878. var response = {
  879. data: responseData,
  880. status: request.status,
  881. statusText: request.statusText,
  882. headers: responseHeaders,
  883. config: config,
  884. request: request
  885. };
  886. settle(resolve, reject, response);
  887. // Clean up request
  888. request = null;
  889. };
  890. // Handle browser request cancellation (as opposed to a manual cancellation)
  891. request.onabort = function handleAbort() {
  892. if (!request) {
  893. return;
  894. }
  895. reject(createError('Request aborted', config, 'ECONNABORTED', request));
  896. // Clean up request
  897. request = null;
  898. };
  899. // Handle low level network errors
  900. request.onerror = function handleError() {
  901. // Real errors are hidden from us by the browser
  902. // onerror should only fire if it's a network error
  903. reject(createError('Network Error', config, null, request));
  904. // Clean up request
  905. request = null;
  906. };
  907. // Handle timeout
  908. request.ontimeout = function handleTimeout() {
  909. var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
  910. if (config.timeoutErrorMessage) {
  911. timeoutErrorMessage = config.timeoutErrorMessage;
  912. }
  913. reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
  914. request));
  915. // Clean up request
  916. request = null;
  917. };
  918. // Add xsrf header
  919. // This is only done if running in a standard browser environment.
  920. // Specifically not if we're in a web worker, or react-native.
  921. if (utils.isStandardBrowserEnv()) {
  922. // Add xsrf header
  923. var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
  924. cookies.read(config.xsrfCookieName) :
  925. undefined;
  926. if (xsrfValue) {
  927. requestHeaders[config.xsrfHeaderName] = xsrfValue;
  928. }
  929. }
  930. // Add headers to the request
  931. if ('setRequestHeader' in request) {
  932. utils.forEach(requestHeaders, function setRequestHeader(val, key) {
  933. if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
  934. // Remove Content-Type if data is undefined
  935. delete requestHeaders[key];
  936. } else {
  937. // Otherwise add header to the request
  938. request.setRequestHeader(key, val);
  939. }
  940. });
  941. }
  942. // Add withCredentials to request if needed
  943. if (!utils.isUndefined(config.withCredentials)) {
  944. request.withCredentials = !!config.withCredentials;
  945. }
  946. // Add responseType to request if needed
  947. if (config.responseType) {
  948. try {
  949. request.responseType = config.responseType;
  950. } catch (e) {
  951. // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
  952. // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
  953. if (config.responseType !== 'json') {
  954. throw e;
  955. }
  956. }
  957. }
  958. // Handle progress if needed
  959. if (typeof config.onDownloadProgress === 'function') {
  960. request.addEventListener('progress', config.onDownloadProgress);
  961. }
  962. // Not all browsers support upload events
  963. if (typeof config.onUploadProgress === 'function' && request.upload) {
  964. request.upload.addEventListener('progress', config.onUploadProgress);
  965. }
  966. if (config.cancelToken) {
  967. // Handle cancellation
  968. config.cancelToken.promise.then(function onCanceled(cancel) {
  969. if (!request) {
  970. return;
  971. }
  972. request.abort();
  973. reject(cancel);
  974. // Clean up request
  975. request = null;
  976. });
  977. }
  978. if (!requestData) {
  979. requestData = null;
  980. }
  981. // Send the request
  982. request.send(requestData);
  983. });
  984. };
  985. /***/ }),
  986. /* 13 */
  987. /***/ (function(module, exports, __webpack_require__) {
  988. 'use strict';
  989. var createError = __webpack_require__(14);
  990. /**
  991. * Resolve or reject a Promise based on response status.
  992. *
  993. * @param {Function} resolve A function that resolves the promise.
  994. * @param {Function} reject A function that rejects the promise.
  995. * @param {object} response The response.
  996. */
  997. module.exports = function settle(resolve, reject, response) {
  998. var validateStatus = response.config.validateStatus;
  999. if (!response.status || !validateStatus || validateStatus(response.status)) {
  1000. resolve(response);
  1001. } else {
  1002. reject(createError(
  1003. 'Request failed with status code ' + response.status,
  1004. response.config,
  1005. null,
  1006. response.request,
  1007. response
  1008. ));
  1009. }
  1010. };
  1011. /***/ }),
  1012. /* 14 */
  1013. /***/ (function(module, exports, __webpack_require__) {
  1014. 'use strict';
  1015. var enhanceError = __webpack_require__(15);
  1016. /**
  1017. * Create an Error with the specified message, config, error code, request and response.
  1018. *
  1019. * @param {string} message The error message.
  1020. * @param {Object} config The config.
  1021. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  1022. * @param {Object} [request] The request.
  1023. * @param {Object} [response] The response.
  1024. * @returns {Error} The created error.
  1025. */
  1026. module.exports = function createError(message, config, code, request, response) {
  1027. var error = new Error(message);
  1028. return enhanceError(error, config, code, request, response);
  1029. };
  1030. /***/ }),
  1031. /* 15 */
  1032. /***/ (function(module, exports) {
  1033. 'use strict';
  1034. /**
  1035. * Update an Error with the specified config, error code, and response.
  1036. *
  1037. * @param {Error} error The error to update.
  1038. * @param {Object} config The config.
  1039. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  1040. * @param {Object} [request] The request.
  1041. * @param {Object} [response] The response.
  1042. * @returns {Error} The error.
  1043. */
  1044. module.exports = function enhanceError(error, config, code, request, response) {
  1045. error.config = config;
  1046. if (code) {
  1047. error.code = code;
  1048. }
  1049. error.request = request;
  1050. error.response = response;
  1051. error.isAxiosError = true;
  1052. error.toJSON = function toJSON() {
  1053. return {
  1054. // Standard
  1055. message: this.message,
  1056. name: this.name,
  1057. // Microsoft
  1058. description: this.description,
  1059. number: this.number,
  1060. // Mozilla
  1061. fileName: this.fileName,
  1062. lineNumber: this.lineNumber,
  1063. columnNumber: this.columnNumber,
  1064. stack: this.stack,
  1065. // Axios
  1066. config: this.config,
  1067. code: this.code
  1068. };
  1069. };
  1070. return error;
  1071. };
  1072. /***/ }),
  1073. /* 16 */
  1074. /***/ (function(module, exports, __webpack_require__) {
  1075. 'use strict';
  1076. var utils = __webpack_require__(2);
  1077. module.exports = (
  1078. utils.isStandardBrowserEnv() ?
  1079. // Standard browser envs support document.cookie
  1080. (function standardBrowserEnv() {
  1081. return {
  1082. write: function write(name, value, expires, path, domain, secure) {
  1083. var cookie = [];
  1084. cookie.push(name + '=' + encodeURIComponent(value));
  1085. if (utils.isNumber(expires)) {
  1086. cookie.push('expires=' + new Date(expires).toGMTString());
  1087. }
  1088. if (utils.isString(path)) {
  1089. cookie.push('path=' + path);
  1090. }
  1091. if (utils.isString(domain)) {
  1092. cookie.push('domain=' + domain);
  1093. }
  1094. if (secure === true) {
  1095. cookie.push('secure');
  1096. }
  1097. document.cookie = cookie.join('; ');
  1098. },
  1099. read: function read(name) {
  1100. var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
  1101. return (match ? decodeURIComponent(match[3]) : null);
  1102. },
  1103. remove: function remove(name) {
  1104. this.write(name, '', Date.now() - 86400000);
  1105. }
  1106. };
  1107. })() :
  1108. // Non standard browser env (web workers, react-native) lack needed support.
  1109. (function nonStandardBrowserEnv() {
  1110. return {
  1111. write: function write() {},
  1112. read: function read() { return null; },
  1113. remove: function remove() {}
  1114. };
  1115. })()
  1116. );
  1117. /***/ }),
  1118. /* 17 */
  1119. /***/ (function(module, exports, __webpack_require__) {
  1120. 'use strict';
  1121. var isAbsoluteURL = __webpack_require__(18);
  1122. var combineURLs = __webpack_require__(19);
  1123. /**
  1124. * Creates a new URL by combining the baseURL with the requestedURL,
  1125. * only when the requestedURL is not already an absolute URL.
  1126. * If the requestURL is absolute, this function returns the requestedURL untouched.
  1127. *
  1128. * @param {string} baseURL The base URL
  1129. * @param {string} requestedURL Absolute or relative URL to combine
  1130. * @returns {string} The combined full path
  1131. */
  1132. module.exports = function buildFullPath(baseURL, requestedURL) {
  1133. if (baseURL && !isAbsoluteURL(requestedURL)) {
  1134. return combineURLs(baseURL, requestedURL);
  1135. }
  1136. return requestedURL;
  1137. };
  1138. /***/ }),
  1139. /* 18 */
  1140. /***/ (function(module, exports) {
  1141. 'use strict';
  1142. /**
  1143. * Determines whether the specified URL is absolute
  1144. *
  1145. * @param {string} url The URL to test
  1146. * @returns {boolean} True if the specified URL is absolute, otherwise false
  1147. */
  1148. module.exports = function isAbsoluteURL(url) {
  1149. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  1150. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  1151. // by any combination of letters, digits, plus, period, or hyphen.
  1152. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
  1153. };
  1154. /***/ }),
  1155. /* 19 */
  1156. /***/ (function(module, exports) {
  1157. 'use strict';
  1158. /**
  1159. * Creates a new URL by combining the specified URLs
  1160. *
  1161. * @param {string} baseURL The base URL
  1162. * @param {string} relativeURL The relative URL
  1163. * @returns {string} The combined URL
  1164. */
  1165. module.exports = function combineURLs(baseURL, relativeURL) {
  1166. return relativeURL
  1167. ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
  1168. : baseURL;
  1169. };
  1170. /***/ }),
  1171. /* 20 */
  1172. /***/ (function(module, exports, __webpack_require__) {
  1173. 'use strict';
  1174. var utils = __webpack_require__(2);
  1175. // Headers whose duplicates are ignored by node
  1176. // c.f. https://nodejs.org/api/http.html#http_message_headers
  1177. var ignoreDuplicateOf = [
  1178. 'age', 'authorization', 'content-length', 'content-type', 'etag',
  1179. 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
  1180. 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
  1181. 'referer', 'retry-after', 'user-agent'
  1182. ];
  1183. /**
  1184. * Parse headers into an object
  1185. *
  1186. * ```
  1187. * Date: Wed, 27 Aug 2014 08:58:49 GMT
  1188. * Content-Type: application/json
  1189. * Connection: keep-alive
  1190. * Transfer-Encoding: chunked
  1191. * ```
  1192. *
  1193. * @param {String} headers Headers needing to be parsed
  1194. * @returns {Object} Headers parsed into an object
  1195. */
  1196. module.exports = function parseHeaders(headers) {
  1197. var parsed = {};
  1198. var key;
  1199. var val;
  1200. var i;
  1201. if (!headers) { return parsed; }
  1202. utils.forEach(headers.split('\n'), function parser(line) {
  1203. i = line.indexOf(':');
  1204. key = utils.trim(line.substr(0, i)).toLowerCase();
  1205. val = utils.trim(line.substr(i + 1));
  1206. if (key) {
  1207. if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
  1208. return;
  1209. }
  1210. if (key === 'set-cookie') {
  1211. parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
  1212. } else {
  1213. parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
  1214. }
  1215. }
  1216. });
  1217. return parsed;
  1218. };
  1219. /***/ }),
  1220. /* 21 */
  1221. /***/ (function(module, exports, __webpack_require__) {
  1222. 'use strict';
  1223. var utils = __webpack_require__(2);
  1224. module.exports = (
  1225. utils.isStandardBrowserEnv() ?
  1226. // Standard browser envs have full support of the APIs needed to test
  1227. // whether the request URL is of the same origin as current location.
  1228. (function standardBrowserEnv() {
  1229. var msie = /(msie|trident)/i.test(navigator.userAgent);
  1230. var urlParsingNode = document.createElement('a');
  1231. var originURL;
  1232. /**
  1233. * Parse a URL to discover it's components
  1234. *
  1235. * @param {String} url The URL to be parsed
  1236. * @returns {Object}
  1237. */
  1238. function resolveURL(url) {
  1239. var href = url;
  1240. if (msie) {
  1241. // IE needs attribute set twice to normalize properties
  1242. urlParsingNode.setAttribute('href', href);
  1243. href = urlParsingNode.href;
  1244. }
  1245. urlParsingNode.setAttribute('href', href);
  1246. // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
  1247. return {
  1248. href: urlParsingNode.href,
  1249. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
  1250. host: urlParsingNode.host,
  1251. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
  1252. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
  1253. hostname: urlParsingNode.hostname,
  1254. port: urlParsingNode.port,
  1255. pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
  1256. urlParsingNode.pathname :
  1257. '/' + urlParsingNode.pathname
  1258. };
  1259. }
  1260. originURL = resolveURL(window.location.href);
  1261. /**
  1262. * Determine if a URL shares the same origin as the current location
  1263. *
  1264. * @param {String} requestURL The URL to test
  1265. * @returns {boolean} True if URL shares the same origin, otherwise false
  1266. */
  1267. return function isURLSameOrigin(requestURL) {
  1268. var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
  1269. return (parsed.protocol === originURL.protocol &&
  1270. parsed.host === originURL.host);
  1271. };
  1272. })() :
  1273. // Non standard browser envs (web workers, react-native) lack needed support.
  1274. (function nonStandardBrowserEnv() {
  1275. return function isURLSameOrigin() {
  1276. return true;
  1277. };
  1278. })()
  1279. );
  1280. /***/ }),
  1281. /* 22 */
  1282. /***/ (function(module, exports, __webpack_require__) {
  1283. 'use strict';
  1284. var utils = __webpack_require__(2);
  1285. /**
  1286. * Config-specific merge-function which creates a new config-object
  1287. * by merging two configuration objects together.
  1288. *
  1289. * @param {Object} config1
  1290. * @param {Object} config2
  1291. * @returns {Object} New object resulting from merging config2 to config1
  1292. */
  1293. module.exports = function mergeConfig(config1, config2) {
  1294. // eslint-disable-next-line no-param-reassign
  1295. config2 = config2 || {};
  1296. var config = {};
  1297. var valueFromConfig2Keys = ['url', 'method', 'data'];
  1298. var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];
  1299. var defaultToConfig2Keys = [
  1300. 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',
  1301. 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
  1302. 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',
  1303. 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',
  1304. 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'
  1305. ];
  1306. var directMergeKeys = ['validateStatus'];
  1307. function getMergedValue(target, source) {
  1308. if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
  1309. return utils.merge(target, source);
  1310. } else if (utils.isPlainObject(source)) {
  1311. return utils.merge({}, source);
  1312. } else if (utils.isArray(source)) {
  1313. return source.slice();
  1314. }
  1315. return source;
  1316. }
  1317. function mergeDeepProperties(prop) {
  1318. if (!utils.isUndefined(config2[prop])) {
  1319. config[prop] = getMergedValue(config1[prop], config2[prop]);
  1320. } else if (!utils.isUndefined(config1[prop])) {
  1321. config[prop] = getMergedValue(undefined, config1[prop]);
  1322. }
  1323. }
  1324. utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
  1325. if (!utils.isUndefined(config2[prop])) {
  1326. config[prop] = getMergedValue(undefined, config2[prop]);
  1327. }
  1328. });
  1329. utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
  1330. utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
  1331. if (!utils.isUndefined(config2[prop])) {
  1332. config[prop] = getMergedValue(undefined, config2[prop]);
  1333. } else if (!utils.isUndefined(config1[prop])) {
  1334. config[prop] = getMergedValue(undefined, config1[prop]);
  1335. }
  1336. });
  1337. utils.forEach(directMergeKeys, function merge(prop) {
  1338. if (prop in config2) {
  1339. config[prop] = getMergedValue(config1[prop], config2[prop]);
  1340. } else if (prop in config1) {
  1341. config[prop] = getMergedValue(undefined, config1[prop]);
  1342. }
  1343. });
  1344. var axiosKeys = valueFromConfig2Keys
  1345. .concat(mergeDeepPropertiesKeys)
  1346. .concat(defaultToConfig2Keys)
  1347. .concat(directMergeKeys);
  1348. var otherKeys = Object
  1349. .keys(config1)
  1350. .concat(Object.keys(config2))
  1351. .filter(function filterAxiosKeys(key) {
  1352. return axiosKeys.indexOf(key) === -1;
  1353. });
  1354. utils.forEach(otherKeys, mergeDeepProperties);
  1355. return config;
  1356. };
  1357. /***/ }),
  1358. /* 23 */
  1359. /***/ (function(module, exports) {
  1360. 'use strict';
  1361. /**
  1362. * A `Cancel` is an object that is thrown when an operation is canceled.
  1363. *
  1364. * @class
  1365. * @param {string=} message The message.
  1366. */
  1367. function Cancel(message) {
  1368. this.message = message;
  1369. }
  1370. Cancel.prototype.toString = function toString() {
  1371. return 'Cancel' + (this.message ? ': ' + this.message : '');
  1372. };
  1373. Cancel.prototype.__CANCEL__ = true;
  1374. module.exports = Cancel;
  1375. /***/ }),
  1376. /* 24 */
  1377. /***/ (function(module, exports, __webpack_require__) {
  1378. 'use strict';
  1379. var Cancel = __webpack_require__(23);
  1380. /**
  1381. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  1382. *
  1383. * @class
  1384. * @param {Function} executor The executor function.
  1385. */
  1386. function CancelToken(executor) {
  1387. if (typeof executor !== 'function') {
  1388. throw new TypeError('executor must be a function.');
  1389. }
  1390. var resolvePromise;
  1391. this.promise = new Promise(function promiseExecutor(resolve) {
  1392. resolvePromise = resolve;
  1393. });
  1394. var token = this;
  1395. executor(function cancel(message) {
  1396. if (token.reason) {
  1397. // Cancellation has already been requested
  1398. return;
  1399. }
  1400. token.reason = new Cancel(message);
  1401. resolvePromise(token.reason);
  1402. });
  1403. }
  1404. /**
  1405. * Throws a `Cancel` if cancellation has been requested.
  1406. */
  1407. CancelToken.prototype.throwIfRequested = function throwIfRequested() {
  1408. if (this.reason) {
  1409. throw this.reason;
  1410. }
  1411. };
  1412. /**
  1413. * Returns an object that contains a new `CancelToken` and a function that, when called,
  1414. * cancels the `CancelToken`.
  1415. */
  1416. CancelToken.source = function source() {
  1417. var cancel;
  1418. var token = new CancelToken(function executor(c) {
  1419. cancel = c;
  1420. });
  1421. return {
  1422. token: token,
  1423. cancel: cancel
  1424. };
  1425. };
  1426. module.exports = CancelToken;
  1427. /***/ }),
  1428. /* 25 */
  1429. /***/ (function(module, exports) {
  1430. 'use strict';
  1431. /**
  1432. * Syntactic sugar for invoking a function and expanding an array for arguments.
  1433. *
  1434. * Common use case would be to use `Function.prototype.apply`.
  1435. *
  1436. * ```js
  1437. * function f(x, y, z) {}
  1438. * var args = [1, 2, 3];
  1439. * f.apply(null, args);
  1440. * ```
  1441. *
  1442. * With `spread` this example can be re-written.
  1443. *
  1444. * ```js
  1445. * spread(function(x, y, z) {})([1, 2, 3]);
  1446. * ```
  1447. *
  1448. * @param {Function} callback
  1449. * @returns {Function}
  1450. */
  1451. module.exports = function spread(callback) {
  1452. return function wrap(arr) {
  1453. return callback.apply(null, arr);
  1454. };
  1455. };
  1456. /***/ })
  1457. /******/ ])
  1458. });
  1459. ;
  1460. //# sourceMappingURL=axios.map