mw-common-components 0.0.1-security → 99.99.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of mw-common-components might be problematic. Click here for more details.

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