index.js 78 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645
  1. module.exports = (function() {
  2. var __MODS__ = {};
  3. var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
  4. var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
  5. var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
  6. var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
  7. __DEFINE__(1662612701730, function(require, module, exports) {
  8. module.exports = require('./lib/axios');
  9. }, function(modId) {var map = {"./lib/axios":1662612701731}; return __REQUIRE__(map[modId], modId); })
  10. __DEFINE__(1662612701731, function(require, module, exports) {
  11. var utils = require('./utils');
  12. var bind = require('./helpers/bind');
  13. var Axios = require('./core/Axios');
  14. var mergeConfig = require('./core/mergeConfig');
  15. var defaults = require('./defaults');
  16. /**
  17. * Create an instance of Axios
  18. *
  19. * @param {Object} defaultConfig The default config for the instance
  20. * @return {Axios} A new instance of Axios
  21. */
  22. function createInstance(defaultConfig) {
  23. var context = new Axios(defaultConfig);
  24. var instance = bind(Axios.prototype.request, context);
  25. // Copy axios.prototype to instance
  26. utils.extend(instance, Axios.prototype, context);
  27. // Copy context to instance
  28. utils.extend(instance, context);
  29. // Factory for creating new instances
  30. instance.create = function create(instanceConfig) {
  31. return createInstance(mergeConfig(defaultConfig, instanceConfig));
  32. };
  33. return instance;
  34. }
  35. // Create the default instance to be exported
  36. var axios = createInstance(defaults);
  37. // Expose Axios class to allow class inheritance
  38. axios.Axios = Axios;
  39. // Expose Cancel & CancelToken
  40. axios.CanceledError = require('./cancel/CanceledError');
  41. axios.CancelToken = require('./cancel/CancelToken');
  42. axios.isCancel = require('./cancel/isCancel');
  43. axios.VERSION = require('./env/data').version;
  44. axios.toFormData = require('./helpers/toFormData');
  45. // Expose AxiosError class
  46. axios.AxiosError = require('../lib/core/AxiosError');
  47. // alias for CanceledError for backward compatibility
  48. axios.Cancel = axios.CanceledError;
  49. // Expose all/spread
  50. axios.all = function all(promises) {
  51. return Promise.all(promises);
  52. };
  53. axios.spread = require('./helpers/spread');
  54. // Expose isAxiosError
  55. axios.isAxiosError = require('./helpers/isAxiosError');
  56. module.exports = axios;
  57. // Allow use of default import syntax in TypeScript
  58. module.exports.default = axios;
  59. }, function(modId) { var map = {"./utils":1662612701732,"./helpers/bind":1662612701733,"./core/Axios":1662612701734,"./core/mergeConfig":1662612701758,"./defaults":1662612701739,"./cancel/CanceledError":1662612701752,"./cancel/CancelToken":1662612701760,"./cancel/isCancel":1662612701757,"./env/data":1662612701755,"./helpers/toFormData":1662612701743,"../lib/core/AxiosError":1662612701741,"./helpers/spread":1662612701761,"./helpers/isAxiosError":1662612701762}; return __REQUIRE__(map[modId], modId); })
  60. __DEFINE__(1662612701732, function(require, module, exports) {
  61. var bind = require('./helpers/bind');
  62. // utils is a library of generic helper functions non-specific to axios
  63. var toString = Object.prototype.toString;
  64. // eslint-disable-next-line func-names
  65. var kindOf = (function(cache) {
  66. // eslint-disable-next-line func-names
  67. return function(thing) {
  68. var str = toString.call(thing);
  69. return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
  70. };
  71. })(Object.create(null));
  72. function kindOfTest(type) {
  73. type = type.toLowerCase();
  74. return function isKindOf(thing) {
  75. return kindOf(thing) === type;
  76. };
  77. }
  78. /**
  79. * Determine if a value is an Array
  80. *
  81. * @param {Object} val The value to test
  82. * @returns {boolean} True if value is an Array, otherwise false
  83. */
  84. function isArray(val) {
  85. return Array.isArray(val);
  86. }
  87. /**
  88. * Determine if a value is undefined
  89. *
  90. * @param {Object} val The value to test
  91. * @returns {boolean} True if the value is undefined, otherwise false
  92. */
  93. function isUndefined(val) {
  94. return typeof val === 'undefined';
  95. }
  96. /**
  97. * Determine if a value is a Buffer
  98. *
  99. * @param {Object} val The value to test
  100. * @returns {boolean} True if value is a Buffer, otherwise false
  101. */
  102. function isBuffer(val) {
  103. return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
  104. && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
  105. }
  106. /**
  107. * Determine if a value is an ArrayBuffer
  108. *
  109. * @function
  110. * @param {Object} val The value to test
  111. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  112. */
  113. var isArrayBuffer = kindOfTest('ArrayBuffer');
  114. /**
  115. * Determine if a value is a view on an ArrayBuffer
  116. *
  117. * @param {Object} val The value to test
  118. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  119. */
  120. function isArrayBufferView(val) {
  121. var result;
  122. if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
  123. result = ArrayBuffer.isView(val);
  124. } else {
  125. result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
  126. }
  127. return result;
  128. }
  129. /**
  130. * Determine if a value is a String
  131. *
  132. * @param {Object} val The value to test
  133. * @returns {boolean} True if value is a String, otherwise false
  134. */
  135. function isString(val) {
  136. return typeof val === 'string';
  137. }
  138. /**
  139. * Determine if a value is a Number
  140. *
  141. * @param {Object} val The value to test
  142. * @returns {boolean} True if value is a Number, otherwise false
  143. */
  144. function isNumber(val) {
  145. return typeof val === 'number';
  146. }
  147. /**
  148. * Determine if a value is an Object
  149. *
  150. * @param {Object} val The value to test
  151. * @returns {boolean} True if value is an Object, otherwise false
  152. */
  153. function isObject(val) {
  154. return val !== null && typeof val === 'object';
  155. }
  156. /**
  157. * Determine if a value is a plain Object
  158. *
  159. * @param {Object} val The value to test
  160. * @return {boolean} True if value is a plain Object, otherwise false
  161. */
  162. function isPlainObject(val) {
  163. if (kindOf(val) !== 'object') {
  164. return false;
  165. }
  166. var prototype = Object.getPrototypeOf(val);
  167. return prototype === null || prototype === Object.prototype;
  168. }
  169. /**
  170. * Determine if a value is a Date
  171. *
  172. * @function
  173. * @param {Object} val The value to test
  174. * @returns {boolean} True if value is a Date, otherwise false
  175. */
  176. var isDate = kindOfTest('Date');
  177. /**
  178. * Determine if a value is a File
  179. *
  180. * @function
  181. * @param {Object} val The value to test
  182. * @returns {boolean} True if value is a File, otherwise false
  183. */
  184. var isFile = kindOfTest('File');
  185. /**
  186. * Determine if a value is a Blob
  187. *
  188. * @function
  189. * @param {Object} val The value to test
  190. * @returns {boolean} True if value is a Blob, otherwise false
  191. */
  192. var isBlob = kindOfTest('Blob');
  193. /**
  194. * Determine if a value is a FileList
  195. *
  196. * @function
  197. * @param {Object} val The value to test
  198. * @returns {boolean} True if value is a File, otherwise false
  199. */
  200. var isFileList = kindOfTest('FileList');
  201. /**
  202. * Determine if a value is a Function
  203. *
  204. * @param {Object} val The value to test
  205. * @returns {boolean} True if value is a Function, otherwise false
  206. */
  207. function isFunction(val) {
  208. return toString.call(val) === '[object Function]';
  209. }
  210. /**
  211. * Determine if a value is a Stream
  212. *
  213. * @param {Object} val The value to test
  214. * @returns {boolean} True if value is a Stream, otherwise false
  215. */
  216. function isStream(val) {
  217. return isObject(val) && isFunction(val.pipe);
  218. }
  219. /**
  220. * Determine if a value is a FormData
  221. *
  222. * @param {Object} thing The value to test
  223. * @returns {boolean} True if value is an FormData, otherwise false
  224. */
  225. function isFormData(thing) {
  226. var pattern = '[object FormData]';
  227. return thing && (
  228. (typeof FormData === 'function' && thing instanceof FormData) ||
  229. toString.call(thing) === pattern ||
  230. (isFunction(thing.toString) && thing.toString() === pattern)
  231. );
  232. }
  233. /**
  234. * Determine if a value is a URLSearchParams object
  235. * @function
  236. * @param {Object} val The value to test
  237. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  238. */
  239. var isURLSearchParams = kindOfTest('URLSearchParams');
  240. /**
  241. * Trim excess whitespace off the beginning and end of a string
  242. *
  243. * @param {String} str The String to trim
  244. * @returns {String} The String freed of excess whitespace
  245. */
  246. function trim(str) {
  247. return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
  248. }
  249. /**
  250. * Determine if we're running in a standard browser environment
  251. *
  252. * This allows axios to run in a web worker, and react-native.
  253. * Both environments support XMLHttpRequest, but not fully standard globals.
  254. *
  255. * web workers:
  256. * typeof window -> undefined
  257. * typeof document -> undefined
  258. *
  259. * react-native:
  260. * navigator.product -> 'ReactNative'
  261. * nativescript
  262. * navigator.product -> 'NativeScript' or 'NS'
  263. */
  264. function isStandardBrowserEnv() {
  265. if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
  266. navigator.product === 'NativeScript' ||
  267. navigator.product === 'NS')) {
  268. return false;
  269. }
  270. return (
  271. typeof window !== 'undefined' &&
  272. typeof document !== 'undefined'
  273. );
  274. }
  275. /**
  276. * Iterate over an Array or an Object invoking a function for each item.
  277. *
  278. * If `obj` is an Array callback will be called passing
  279. * the value, index, and complete array for each item.
  280. *
  281. * If 'obj' is an Object callback will be called passing
  282. * the value, key, and complete object for each property.
  283. *
  284. * @param {Object|Array} obj The object to iterate
  285. * @param {Function} fn The callback to invoke for each item
  286. */
  287. function forEach(obj, fn) {
  288. // Don't bother if no value provided
  289. if (obj === null || typeof obj === 'undefined') {
  290. return;
  291. }
  292. // Force an array if not already something iterable
  293. if (typeof obj !== 'object') {
  294. /*eslint no-param-reassign:0*/
  295. obj = [obj];
  296. }
  297. if (isArray(obj)) {
  298. // Iterate over array values
  299. for (var i = 0, l = obj.length; i < l; i++) {
  300. fn.call(null, obj[i], i, obj);
  301. }
  302. } else {
  303. // Iterate over object keys
  304. for (var key in obj) {
  305. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  306. fn.call(null, obj[key], key, obj);
  307. }
  308. }
  309. }
  310. }
  311. /**
  312. * Accepts varargs expecting each argument to be an object, then
  313. * immutably merges the properties of each object and returns result.
  314. *
  315. * When multiple objects contain the same key the later object in
  316. * the arguments list will take precedence.
  317. *
  318. * Example:
  319. *
  320. * ```js
  321. * var result = merge({foo: 123}, {foo: 456});
  322. * console.log(result.foo); // outputs 456
  323. * ```
  324. *
  325. * @param {Object} obj1 Object to merge
  326. * @returns {Object} Result of all merge properties
  327. */
  328. function merge(/* obj1, obj2, obj3, ... */) {
  329. var result = {};
  330. function assignValue(val, key) {
  331. if (isPlainObject(result[key]) && isPlainObject(val)) {
  332. result[key] = merge(result[key], val);
  333. } else if (isPlainObject(val)) {
  334. result[key] = merge({}, val);
  335. } else if (isArray(val)) {
  336. result[key] = val.slice();
  337. } else {
  338. result[key] = val;
  339. }
  340. }
  341. for (var i = 0, l = arguments.length; i < l; i++) {
  342. forEach(arguments[i], assignValue);
  343. }
  344. return result;
  345. }
  346. /**
  347. * Extends object a by mutably adding to it the properties of object b.
  348. *
  349. * @param {Object} a The object to be extended
  350. * @param {Object} b The object to copy properties from
  351. * @param {Object} thisArg The object to bind function to
  352. * @return {Object} The resulting value of object a
  353. */
  354. function extend(a, b, thisArg) {
  355. forEach(b, function assignValue(val, key) {
  356. if (thisArg && typeof val === 'function') {
  357. a[key] = bind(val, thisArg);
  358. } else {
  359. a[key] = val;
  360. }
  361. });
  362. return a;
  363. }
  364. /**
  365. * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
  366. *
  367. * @param {string} content with BOM
  368. * @return {string} content value without BOM
  369. */
  370. function stripBOM(content) {
  371. if (content.charCodeAt(0) === 0xFEFF) {
  372. content = content.slice(1);
  373. }
  374. return content;
  375. }
  376. /**
  377. * Inherit the prototype methods from one constructor into another
  378. * @param {function} constructor
  379. * @param {function} superConstructor
  380. * @param {object} [props]
  381. * @param {object} [descriptors]
  382. */
  383. function inherits(constructor, superConstructor, props, descriptors) {
  384. constructor.prototype = Object.create(superConstructor.prototype, descriptors);
  385. constructor.prototype.constructor = constructor;
  386. props && Object.assign(constructor.prototype, props);
  387. }
  388. /**
  389. * Resolve object with deep prototype chain to a flat object
  390. * @param {Object} sourceObj source object
  391. * @param {Object} [destObj]
  392. * @param {Function} [filter]
  393. * @returns {Object}
  394. */
  395. function toFlatObject(sourceObj, destObj, filter) {
  396. var props;
  397. var i;
  398. var prop;
  399. var merged = {};
  400. destObj = destObj || {};
  401. do {
  402. props = Object.getOwnPropertyNames(sourceObj);
  403. i = props.length;
  404. while (i-- > 0) {
  405. prop = props[i];
  406. if (!merged[prop]) {
  407. destObj[prop] = sourceObj[prop];
  408. merged[prop] = true;
  409. }
  410. }
  411. sourceObj = Object.getPrototypeOf(sourceObj);
  412. } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
  413. return destObj;
  414. }
  415. /*
  416. * determines whether a string ends with the characters of a specified string
  417. * @param {String} str
  418. * @param {String} searchString
  419. * @param {Number} [position= 0]
  420. * @returns {boolean}
  421. */
  422. function endsWith(str, searchString, position) {
  423. str = String(str);
  424. if (position === undefined || position > str.length) {
  425. position = str.length;
  426. }
  427. position -= searchString.length;
  428. var lastIndex = str.indexOf(searchString, position);
  429. return lastIndex !== -1 && lastIndex === position;
  430. }
  431. /**
  432. * Returns new array from array like object
  433. * @param {*} [thing]
  434. * @returns {Array}
  435. */
  436. function toArray(thing) {
  437. if (!thing) return null;
  438. var i = thing.length;
  439. if (isUndefined(i)) return null;
  440. var arr = new Array(i);
  441. while (i-- > 0) {
  442. arr[i] = thing[i];
  443. }
  444. return arr;
  445. }
  446. // eslint-disable-next-line func-names
  447. var isTypedArray = (function(TypedArray) {
  448. // eslint-disable-next-line func-names
  449. return function(thing) {
  450. return TypedArray && thing instanceof TypedArray;
  451. };
  452. })(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
  453. module.exports = {
  454. isArray: isArray,
  455. isArrayBuffer: isArrayBuffer,
  456. isBuffer: isBuffer,
  457. isFormData: isFormData,
  458. isArrayBufferView: isArrayBufferView,
  459. isString: isString,
  460. isNumber: isNumber,
  461. isObject: isObject,
  462. isPlainObject: isPlainObject,
  463. isUndefined: isUndefined,
  464. isDate: isDate,
  465. isFile: isFile,
  466. isBlob: isBlob,
  467. isFunction: isFunction,
  468. isStream: isStream,
  469. isURLSearchParams: isURLSearchParams,
  470. isStandardBrowserEnv: isStandardBrowserEnv,
  471. forEach: forEach,
  472. merge: merge,
  473. extend: extend,
  474. trim: trim,
  475. stripBOM: stripBOM,
  476. inherits: inherits,
  477. toFlatObject: toFlatObject,
  478. kindOf: kindOf,
  479. kindOfTest: kindOfTest,
  480. endsWith: endsWith,
  481. toArray: toArray,
  482. isTypedArray: isTypedArray,
  483. isFileList: isFileList
  484. };
  485. }, function(modId) { var map = {"./helpers/bind":1662612701733}; return __REQUIRE__(map[modId], modId); })
  486. __DEFINE__(1662612701733, function(require, module, exports) {
  487. module.exports = function bind(fn, thisArg) {
  488. return function wrap() {
  489. var args = new Array(arguments.length);
  490. for (var i = 0; i < args.length; i++) {
  491. args[i] = arguments[i];
  492. }
  493. return fn.apply(thisArg, args);
  494. };
  495. };
  496. }, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
  497. __DEFINE__(1662612701734, function(require, module, exports) {
  498. var utils = require('./../utils');
  499. var buildURL = require('../helpers/buildURL');
  500. var InterceptorManager = require('./InterceptorManager');
  501. var dispatchRequest = require('./dispatchRequest');
  502. var mergeConfig = require('./mergeConfig');
  503. var buildFullPath = require('./buildFullPath');
  504. var validator = require('../helpers/validator');
  505. var validators = validator.validators;
  506. /**
  507. * Create a new instance of Axios
  508. *
  509. * @param {Object} instanceConfig The default config for the instance
  510. */
  511. function Axios(instanceConfig) {
  512. this.defaults = instanceConfig;
  513. this.interceptors = {
  514. request: new InterceptorManager(),
  515. response: new InterceptorManager()
  516. };
  517. }
  518. /**
  519. * Dispatch a request
  520. *
  521. * @param {Object} config The config specific for this request (merged with this.defaults)
  522. */
  523. Axios.prototype.request = function request(configOrUrl, config) {
  524. /*eslint no-param-reassign:0*/
  525. // Allow for axios('example/url'[, config]) a la fetch API
  526. if (typeof configOrUrl === 'string') {
  527. config = config || {};
  528. config.url = configOrUrl;
  529. } else {
  530. config = configOrUrl || {};
  531. }
  532. config = mergeConfig(this.defaults, config);
  533. // Set config.method
  534. if (config.method) {
  535. config.method = config.method.toLowerCase();
  536. } else if (this.defaults.method) {
  537. config.method = this.defaults.method.toLowerCase();
  538. } else {
  539. config.method = 'get';
  540. }
  541. var transitional = config.transitional;
  542. if (transitional !== undefined) {
  543. validator.assertOptions(transitional, {
  544. silentJSONParsing: validators.transitional(validators.boolean),
  545. forcedJSONParsing: validators.transitional(validators.boolean),
  546. clarifyTimeoutError: validators.transitional(validators.boolean)
  547. }, false);
  548. }
  549. // filter out skipped interceptors
  550. var requestInterceptorChain = [];
  551. var synchronousRequestInterceptors = true;
  552. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  553. if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
  554. return;
  555. }
  556. synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
  557. requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
  558. });
  559. var responseInterceptorChain = [];
  560. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  561. responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
  562. });
  563. var promise;
  564. if (!synchronousRequestInterceptors) {
  565. var chain = [dispatchRequest, undefined];
  566. Array.prototype.unshift.apply(chain, requestInterceptorChain);
  567. chain = chain.concat(responseInterceptorChain);
  568. promise = Promise.resolve(config);
  569. while (chain.length) {
  570. promise = promise.then(chain.shift(), chain.shift());
  571. }
  572. return promise;
  573. }
  574. var newConfig = config;
  575. while (requestInterceptorChain.length) {
  576. var onFulfilled = requestInterceptorChain.shift();
  577. var onRejected = requestInterceptorChain.shift();
  578. try {
  579. newConfig = onFulfilled(newConfig);
  580. } catch (error) {
  581. onRejected(error);
  582. break;
  583. }
  584. }
  585. try {
  586. promise = dispatchRequest(newConfig);
  587. } catch (error) {
  588. return Promise.reject(error);
  589. }
  590. while (responseInterceptorChain.length) {
  591. promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
  592. }
  593. return promise;
  594. };
  595. Axios.prototype.getUri = function getUri(config) {
  596. config = mergeConfig(this.defaults, config);
  597. var fullPath = buildFullPath(config.baseURL, config.url);
  598. return buildURL(fullPath, config.params, config.paramsSerializer);
  599. };
  600. // Provide aliases for supported request methods
  601. utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
  602. /*eslint func-names:0*/
  603. Axios.prototype[method] = function(url, config) {
  604. return this.request(mergeConfig(config || {}, {
  605. method: method,
  606. url: url,
  607. data: (config || {}).data
  608. }));
  609. };
  610. });
  611. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  612. /*eslint func-names:0*/
  613. function generateHTTPMethod(isForm) {
  614. return function httpMethod(url, data, config) {
  615. return this.request(mergeConfig(config || {}, {
  616. method: method,
  617. headers: isForm ? {
  618. 'Content-Type': 'multipart/form-data'
  619. } : {},
  620. url: url,
  621. data: data
  622. }));
  623. };
  624. }
  625. Axios.prototype[method] = generateHTTPMethod();
  626. Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
  627. });
  628. module.exports = Axios;
  629. }, function(modId) { var map = {"./../utils":1662612701732,"../helpers/buildURL":1662612701735,"./InterceptorManager":1662612701736,"./dispatchRequest":1662612701737,"./mergeConfig":1662612701758,"./buildFullPath":1662612701747,"../helpers/validator":1662612701759}; return __REQUIRE__(map[modId], modId); })
  630. __DEFINE__(1662612701735, function(require, module, exports) {
  631. var utils = require('./../utils');
  632. function encode(val) {
  633. return encodeURIComponent(val).
  634. replace(/%3A/gi, ':').
  635. replace(/%24/g, '$').
  636. replace(/%2C/gi, ',').
  637. replace(/%20/g, '+').
  638. replace(/%5B/gi, '[').
  639. replace(/%5D/gi, ']');
  640. }
  641. /**
  642. * Build a URL by appending params to the end
  643. *
  644. * @param {string} url The base of the url (e.g., http://www.google.com)
  645. * @param {object} [params] The params to be appended
  646. * @returns {string} The formatted url
  647. */
  648. module.exports = function buildURL(url, params, paramsSerializer) {
  649. /*eslint no-param-reassign:0*/
  650. if (!params) {
  651. return url;
  652. }
  653. var serializedParams;
  654. if (paramsSerializer) {
  655. serializedParams = paramsSerializer(params);
  656. } else if (utils.isURLSearchParams(params)) {
  657. serializedParams = params.toString();
  658. } else {
  659. var parts = [];
  660. utils.forEach(params, function serialize(val, key) {
  661. if (val === null || typeof val === 'undefined') {
  662. return;
  663. }
  664. if (utils.isArray(val)) {
  665. key = key + '[]';
  666. } else {
  667. val = [val];
  668. }
  669. utils.forEach(val, function parseValue(v) {
  670. if (utils.isDate(v)) {
  671. v = v.toISOString();
  672. } else if (utils.isObject(v)) {
  673. v = JSON.stringify(v);
  674. }
  675. parts.push(encode(key) + '=' + encode(v));
  676. });
  677. });
  678. serializedParams = parts.join('&');
  679. }
  680. if (serializedParams) {
  681. var hashmarkIndex = url.indexOf('#');
  682. if (hashmarkIndex !== -1) {
  683. url = url.slice(0, hashmarkIndex);
  684. }
  685. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  686. }
  687. return url;
  688. };
  689. }, function(modId) { var map = {"./../utils":1662612701732}; return __REQUIRE__(map[modId], modId); })
  690. __DEFINE__(1662612701736, function(require, module, exports) {
  691. var utils = require('./../utils');
  692. function InterceptorManager() {
  693. this.handlers = [];
  694. }
  695. /**
  696. * Add a new interceptor to the stack
  697. *
  698. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  699. * @param {Function} rejected The function to handle `reject` for a `Promise`
  700. *
  701. * @return {Number} An ID used to remove interceptor later
  702. */
  703. InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
  704. this.handlers.push({
  705. fulfilled: fulfilled,
  706. rejected: rejected,
  707. synchronous: options ? options.synchronous : false,
  708. runWhen: options ? options.runWhen : null
  709. });
  710. return this.handlers.length - 1;
  711. };
  712. /**
  713. * Remove an interceptor from the stack
  714. *
  715. * @param {Number} id The ID that was returned by `use`
  716. */
  717. InterceptorManager.prototype.eject = function eject(id) {
  718. if (this.handlers[id]) {
  719. this.handlers[id] = null;
  720. }
  721. };
  722. /**
  723. * Iterate over all the registered interceptors
  724. *
  725. * This method is particularly useful for skipping over any
  726. * interceptors that may have become `null` calling `eject`.
  727. *
  728. * @param {Function} fn The function to call for each interceptor
  729. */
  730. InterceptorManager.prototype.forEach = function forEach(fn) {
  731. utils.forEach(this.handlers, function forEachHandler(h) {
  732. if (h !== null) {
  733. fn(h);
  734. }
  735. });
  736. };
  737. module.exports = InterceptorManager;
  738. }, function(modId) { var map = {"./../utils":1662612701732}; return __REQUIRE__(map[modId], modId); })
  739. __DEFINE__(1662612701737, function(require, module, exports) {
  740. var utils = require('./../utils');
  741. var transformData = require('./transformData');
  742. var isCancel = require('../cancel/isCancel');
  743. var defaults = require('../defaults');
  744. var CanceledError = require('../cancel/CanceledError');
  745. /**
  746. * Throws a `CanceledError` if cancellation has been requested.
  747. */
  748. function throwIfCancellationRequested(config) {
  749. if (config.cancelToken) {
  750. config.cancelToken.throwIfRequested();
  751. }
  752. if (config.signal && config.signal.aborted) {
  753. throw new CanceledError();
  754. }
  755. }
  756. /**
  757. * Dispatch a request to the server using the configured adapter.
  758. *
  759. * @param {object} config The config that is to be used for the request
  760. * @returns {Promise} The Promise to be fulfilled
  761. */
  762. module.exports = function dispatchRequest(config) {
  763. throwIfCancellationRequested(config);
  764. // Ensure headers exist
  765. config.headers = config.headers || {};
  766. // Transform request data
  767. config.data = transformData.call(
  768. config,
  769. config.data,
  770. config.headers,
  771. config.transformRequest
  772. );
  773. // Flatten headers
  774. config.headers = utils.merge(
  775. config.headers.common || {},
  776. config.headers[config.method] || {},
  777. config.headers
  778. );
  779. utils.forEach(
  780. ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
  781. function cleanHeaderConfig(method) {
  782. delete config.headers[method];
  783. }
  784. );
  785. var adapter = config.adapter || defaults.adapter;
  786. return adapter(config).then(function onAdapterResolution(response) {
  787. throwIfCancellationRequested(config);
  788. // Transform response data
  789. response.data = transformData.call(
  790. config,
  791. response.data,
  792. response.headers,
  793. config.transformResponse
  794. );
  795. return response;
  796. }, function onAdapterRejection(reason) {
  797. if (!isCancel(reason)) {
  798. throwIfCancellationRequested(config);
  799. // Transform response data
  800. if (reason && reason.response) {
  801. reason.response.data = transformData.call(
  802. config,
  803. reason.response.data,
  804. reason.response.headers,
  805. config.transformResponse
  806. );
  807. }
  808. }
  809. return Promise.reject(reason);
  810. });
  811. };
  812. }, function(modId) { var map = {"./../utils":1662612701732,"./transformData":1662612701738,"../cancel/isCancel":1662612701757,"../defaults":1662612701739,"../cancel/CanceledError":1662612701752}; return __REQUIRE__(map[modId], modId); })
  813. __DEFINE__(1662612701738, function(require, module, exports) {
  814. var utils = require('./../utils');
  815. var defaults = require('../defaults');
  816. /**
  817. * Transform the data for a request or a response
  818. *
  819. * @param {Object|String} data The data to be transformed
  820. * @param {Array} headers The headers for the request or response
  821. * @param {Array|Function} fns A single function or Array of functions
  822. * @returns {*} The resulting transformed data
  823. */
  824. module.exports = function transformData(data, headers, fns) {
  825. var context = this || defaults;
  826. /*eslint no-param-reassign:0*/
  827. utils.forEach(fns, function transform(fn) {
  828. data = fn.call(context, data, headers);
  829. });
  830. return data;
  831. };
  832. }, function(modId) { var map = {"./../utils":1662612701732,"../defaults":1662612701739}; return __REQUIRE__(map[modId], modId); })
  833. __DEFINE__(1662612701739, function(require, module, exports) {
  834. var utils = require('../utils');
  835. var normalizeHeaderName = require('../helpers/normalizeHeaderName');
  836. var AxiosError = require('../core/AxiosError');
  837. var transitionalDefaults = require('./transitional');
  838. var toFormData = require('../helpers/toFormData');
  839. var DEFAULT_CONTENT_TYPE = {
  840. 'Content-Type': 'application/x-www-form-urlencoded'
  841. };
  842. function setContentTypeIfUnset(headers, value) {
  843. if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
  844. headers['Content-Type'] = value;
  845. }
  846. }
  847. function getDefaultAdapter() {
  848. var adapter;
  849. if (typeof XMLHttpRequest !== 'undefined') {
  850. // For browsers use XHR adapter
  851. adapter = require('../adapters/xhr');
  852. } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
  853. // For node use HTTP adapter
  854. adapter = require('../adapters/http');
  855. }
  856. return adapter;
  857. }
  858. function stringifySafely(rawValue, parser, encoder) {
  859. if (utils.isString(rawValue)) {
  860. try {
  861. (parser || JSON.parse)(rawValue);
  862. return utils.trim(rawValue);
  863. } catch (e) {
  864. if (e.name !== 'SyntaxError') {
  865. throw e;
  866. }
  867. }
  868. }
  869. return (encoder || JSON.stringify)(rawValue);
  870. }
  871. var defaults = {
  872. transitional: transitionalDefaults,
  873. adapter: getDefaultAdapter(),
  874. transformRequest: [function transformRequest(data, headers) {
  875. normalizeHeaderName(headers, 'Accept');
  876. normalizeHeaderName(headers, 'Content-Type');
  877. if (utils.isFormData(data) ||
  878. utils.isArrayBuffer(data) ||
  879. utils.isBuffer(data) ||
  880. utils.isStream(data) ||
  881. utils.isFile(data) ||
  882. utils.isBlob(data)
  883. ) {
  884. return data;
  885. }
  886. if (utils.isArrayBufferView(data)) {
  887. return data.buffer;
  888. }
  889. if (utils.isURLSearchParams(data)) {
  890. setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
  891. return data.toString();
  892. }
  893. var isObjectPayload = utils.isObject(data);
  894. var contentType = headers && headers['Content-Type'];
  895. var isFileList;
  896. if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) {
  897. var _FormData = this.env && this.env.FormData;
  898. return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData());
  899. } else if (isObjectPayload || contentType === 'application/json') {
  900. setContentTypeIfUnset(headers, 'application/json');
  901. return stringifySafely(data);
  902. }
  903. return data;
  904. }],
  905. transformResponse: [function transformResponse(data) {
  906. var transitional = this.transitional || defaults.transitional;
  907. var silentJSONParsing = transitional && transitional.silentJSONParsing;
  908. var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
  909. var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';
  910. if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {
  911. try {
  912. return JSON.parse(data);
  913. } catch (e) {
  914. if (strictJSONParsing) {
  915. if (e.name === 'SyntaxError') {
  916. throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
  917. }
  918. throw e;
  919. }
  920. }
  921. }
  922. return data;
  923. }],
  924. /**
  925. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  926. * timeout is not created.
  927. */
  928. timeout: 0,
  929. xsrfCookieName: 'XSRF-TOKEN',
  930. xsrfHeaderName: 'X-XSRF-TOKEN',
  931. maxContentLength: -1,
  932. maxBodyLength: -1,
  933. env: {
  934. FormData: require('./env/FormData')
  935. },
  936. validateStatus: function validateStatus(status) {
  937. return status >= 200 && status < 300;
  938. },
  939. headers: {
  940. common: {
  941. 'Accept': 'application/json, text/plain, */*'
  942. }
  943. }
  944. };
  945. utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
  946. defaults.headers[method] = {};
  947. });
  948. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  949. defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
  950. });
  951. module.exports = defaults;
  952. }, function(modId) { var map = {"../utils":1662612701732,"../helpers/normalizeHeaderName":1662612701740,"../core/AxiosError":1662612701741,"./transitional":1662612701742,"../helpers/toFormData":1662612701743,"../adapters/xhr":1662612701744,"../adapters/http":1662612701754,"./env/FormData":1662612701756}; return __REQUIRE__(map[modId], modId); })
  953. __DEFINE__(1662612701740, function(require, module, exports) {
  954. var utils = require('../utils');
  955. module.exports = function normalizeHeaderName(headers, normalizedName) {
  956. utils.forEach(headers, function processHeader(value, name) {
  957. if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
  958. headers[normalizedName] = value;
  959. delete headers[name];
  960. }
  961. });
  962. };
  963. }, function(modId) { var map = {"../utils":1662612701732}; return __REQUIRE__(map[modId], modId); })
  964. __DEFINE__(1662612701741, function(require, module, exports) {
  965. var utils = require('../utils');
  966. /**
  967. * Create an Error with the specified message, config, error code, request and response.
  968. *
  969. * @param {string} message The error message.
  970. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  971. * @param {Object} [config] The config.
  972. * @param {Object} [request] The request.
  973. * @param {Object} [response] The response.
  974. * @returns {Error} The created error.
  975. */
  976. function AxiosError(message, code, config, request, response) {
  977. Error.call(this);
  978. this.message = message;
  979. this.name = 'AxiosError';
  980. code && (this.code = code);
  981. config && (this.config = config);
  982. request && (this.request = request);
  983. response && (this.response = response);
  984. }
  985. utils.inherits(AxiosError, Error, {
  986. toJSON: function toJSON() {
  987. return {
  988. // Standard
  989. message: this.message,
  990. name: this.name,
  991. // Microsoft
  992. description: this.description,
  993. number: this.number,
  994. // Mozilla
  995. fileName: this.fileName,
  996. lineNumber: this.lineNumber,
  997. columnNumber: this.columnNumber,
  998. stack: this.stack,
  999. // Axios
  1000. config: this.config,
  1001. code: this.code,
  1002. status: this.response && this.response.status ? this.response.status : null
  1003. };
  1004. }
  1005. });
  1006. var prototype = AxiosError.prototype;
  1007. var descriptors = {};
  1008. [
  1009. 'ERR_BAD_OPTION_VALUE',
  1010. 'ERR_BAD_OPTION',
  1011. 'ECONNABORTED',
  1012. 'ETIMEDOUT',
  1013. 'ERR_NETWORK',
  1014. 'ERR_FR_TOO_MANY_REDIRECTS',
  1015. 'ERR_DEPRECATED',
  1016. 'ERR_BAD_RESPONSE',
  1017. 'ERR_BAD_REQUEST',
  1018. 'ERR_CANCELED'
  1019. // eslint-disable-next-line func-names
  1020. ].forEach(function(code) {
  1021. descriptors[code] = {value: code};
  1022. });
  1023. Object.defineProperties(AxiosError, descriptors);
  1024. Object.defineProperty(prototype, 'isAxiosError', {value: true});
  1025. // eslint-disable-next-line func-names
  1026. AxiosError.from = function(error, code, config, request, response, customProps) {
  1027. var axiosError = Object.create(prototype);
  1028. utils.toFlatObject(error, axiosError, function filter(obj) {
  1029. return obj !== Error.prototype;
  1030. });
  1031. AxiosError.call(axiosError, error.message, code, config, request, response);
  1032. axiosError.name = error.name;
  1033. customProps && Object.assign(axiosError, customProps);
  1034. return axiosError;
  1035. };
  1036. module.exports = AxiosError;
  1037. }, function(modId) { var map = {"../utils":1662612701732}; return __REQUIRE__(map[modId], modId); })
  1038. __DEFINE__(1662612701742, function(require, module, exports) {
  1039. module.exports = {
  1040. silentJSONParsing: true,
  1041. forcedJSONParsing: true,
  1042. clarifyTimeoutError: false
  1043. };
  1044. }, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
  1045. __DEFINE__(1662612701743, function(require, module, exports) {
  1046. var utils = require('../utils');
  1047. /**
  1048. * Convert a data object to FormData
  1049. * @param {Object} obj
  1050. * @param {?Object} [formData]
  1051. * @returns {Object}
  1052. **/
  1053. function toFormData(obj, formData) {
  1054. // eslint-disable-next-line no-param-reassign
  1055. formData = formData || new FormData();
  1056. var stack = [];
  1057. function convertValue(value) {
  1058. if (value === null) return '';
  1059. if (utils.isDate(value)) {
  1060. return value.toISOString();
  1061. }
  1062. if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
  1063. return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
  1064. }
  1065. return value;
  1066. }
  1067. function build(data, parentKey) {
  1068. if (utils.isPlainObject(data) || utils.isArray(data)) {
  1069. if (stack.indexOf(data) !== -1) {
  1070. throw Error('Circular reference detected in ' + parentKey);
  1071. }
  1072. stack.push(data);
  1073. utils.forEach(data, function each(value, key) {
  1074. if (utils.isUndefined(value)) return;
  1075. var fullKey = parentKey ? parentKey + '.' + key : key;
  1076. var arr;
  1077. if (value && !parentKey && typeof value === 'object') {
  1078. if (utils.endsWith(key, '{}')) {
  1079. // eslint-disable-next-line no-param-reassign
  1080. value = JSON.stringify(value);
  1081. } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {
  1082. // eslint-disable-next-line func-names
  1083. arr.forEach(function(el) {
  1084. !utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
  1085. });
  1086. return;
  1087. }
  1088. }
  1089. build(value, fullKey);
  1090. });
  1091. stack.pop();
  1092. } else {
  1093. formData.append(parentKey, convertValue(data));
  1094. }
  1095. }
  1096. build(obj);
  1097. return formData;
  1098. }
  1099. module.exports = toFormData;
  1100. }, function(modId) { var map = {"../utils":1662612701732}; return __REQUIRE__(map[modId], modId); })
  1101. __DEFINE__(1662612701744, function(require, module, exports) {
  1102. var utils = require('./../utils');
  1103. var settle = require('./../core/settle');
  1104. var cookies = require('./../helpers/cookies');
  1105. var buildURL = require('./../helpers/buildURL');
  1106. var buildFullPath = require('../core/buildFullPath');
  1107. var parseHeaders = require('./../helpers/parseHeaders');
  1108. var isURLSameOrigin = require('./../helpers/isURLSameOrigin');
  1109. var transitionalDefaults = require('../defaults/transitional');
  1110. var AxiosError = require('../core/AxiosError');
  1111. var CanceledError = require('../cancel/CanceledError');
  1112. var parseProtocol = require('../helpers/parseProtocol');
  1113. module.exports = function xhrAdapter(config) {
  1114. return new Promise(function dispatchXhrRequest(resolve, reject) {
  1115. var requestData = config.data;
  1116. var requestHeaders = config.headers;
  1117. var responseType = config.responseType;
  1118. var onCanceled;
  1119. function done() {
  1120. if (config.cancelToken) {
  1121. config.cancelToken.unsubscribe(onCanceled);
  1122. }
  1123. if (config.signal) {
  1124. config.signal.removeEventListener('abort', onCanceled);
  1125. }
  1126. }
  1127. if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {
  1128. delete requestHeaders['Content-Type']; // Let the browser set it
  1129. }
  1130. var request = new XMLHttpRequest();
  1131. // HTTP basic authentication
  1132. if (config.auth) {
  1133. var username = config.auth.username || '';
  1134. var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
  1135. requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
  1136. }
  1137. var fullPath = buildFullPath(config.baseURL, config.url);
  1138. request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
  1139. // Set the request timeout in MS
  1140. request.timeout = config.timeout;
  1141. function onloadend() {
  1142. if (!request) {
  1143. return;
  1144. }
  1145. // Prepare the response
  1146. var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
  1147. var responseData = !responseType || responseType === 'text' || responseType === 'json' ?
  1148. request.responseText : request.response;
  1149. var response = {
  1150. data: responseData,
  1151. status: request.status,
  1152. statusText: request.statusText,
  1153. headers: responseHeaders,
  1154. config: config,
  1155. request: request
  1156. };
  1157. settle(function _resolve(value) {
  1158. resolve(value);
  1159. done();
  1160. }, function _reject(err) {
  1161. reject(err);
  1162. done();
  1163. }, response);
  1164. // Clean up request
  1165. request = null;
  1166. }
  1167. if ('onloadend' in request) {
  1168. // Use onloadend if available
  1169. request.onloadend = onloadend;
  1170. } else {
  1171. // Listen for ready state to emulate onloadend
  1172. request.onreadystatechange = function handleLoad() {
  1173. if (!request || request.readyState !== 4) {
  1174. return;
  1175. }
  1176. // The request errored out and we didn't get a response, this will be
  1177. // handled by onerror instead
  1178. // With one exception: request that using file: protocol, most browsers
  1179. // will return status as 0 even though it's a successful request
  1180. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
  1181. return;
  1182. }
  1183. // readystate handler is calling before onerror or ontimeout handlers,
  1184. // so we should call onloadend on the next 'tick'
  1185. setTimeout(onloadend);
  1186. };
  1187. }
  1188. // Handle browser request cancellation (as opposed to a manual cancellation)
  1189. request.onabort = function handleAbort() {
  1190. if (!request) {
  1191. return;
  1192. }
  1193. reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
  1194. // Clean up request
  1195. request = null;
  1196. };
  1197. // Handle low level network errors
  1198. request.onerror = function handleError() {
  1199. // Real errors are hidden from us by the browser
  1200. // onerror should only fire if it's a network error
  1201. reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, request));
  1202. // Clean up request
  1203. request = null;
  1204. };
  1205. // Handle timeout
  1206. request.ontimeout = function handleTimeout() {
  1207. var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
  1208. var transitional = config.transitional || transitionalDefaults;
  1209. if (config.timeoutErrorMessage) {
  1210. timeoutErrorMessage = config.timeoutErrorMessage;
  1211. }
  1212. reject(new AxiosError(
  1213. timeoutErrorMessage,
  1214. transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
  1215. config,
  1216. request));
  1217. // Clean up request
  1218. request = null;
  1219. };
  1220. // Add xsrf header
  1221. // This is only done if running in a standard browser environment.
  1222. // Specifically not if we're in a web worker, or react-native.
  1223. if (utils.isStandardBrowserEnv()) {
  1224. // Add xsrf header
  1225. var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
  1226. cookies.read(config.xsrfCookieName) :
  1227. undefined;
  1228. if (xsrfValue) {
  1229. requestHeaders[config.xsrfHeaderName] = xsrfValue;
  1230. }
  1231. }
  1232. // Add headers to the request
  1233. if ('setRequestHeader' in request) {
  1234. utils.forEach(requestHeaders, function setRequestHeader(val, key) {
  1235. if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
  1236. // Remove Content-Type if data is undefined
  1237. delete requestHeaders[key];
  1238. } else {
  1239. // Otherwise add header to the request
  1240. request.setRequestHeader(key, val);
  1241. }
  1242. });
  1243. }
  1244. // Add withCredentials to request if needed
  1245. if (!utils.isUndefined(config.withCredentials)) {
  1246. request.withCredentials = !!config.withCredentials;
  1247. }
  1248. // Add responseType to request if needed
  1249. if (responseType && responseType !== 'json') {
  1250. request.responseType = config.responseType;
  1251. }
  1252. // Handle progress if needed
  1253. if (typeof config.onDownloadProgress === 'function') {
  1254. request.addEventListener('progress', config.onDownloadProgress);
  1255. }
  1256. // Not all browsers support upload events
  1257. if (typeof config.onUploadProgress === 'function' && request.upload) {
  1258. request.upload.addEventListener('progress', config.onUploadProgress);
  1259. }
  1260. if (config.cancelToken || config.signal) {
  1261. // Handle cancellation
  1262. // eslint-disable-next-line func-names
  1263. onCanceled = function(cancel) {
  1264. if (!request) {
  1265. return;
  1266. }
  1267. reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel);
  1268. request.abort();
  1269. request = null;
  1270. };
  1271. config.cancelToken && config.cancelToken.subscribe(onCanceled);
  1272. if (config.signal) {
  1273. config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
  1274. }
  1275. }
  1276. if (!requestData) {
  1277. requestData = null;
  1278. }
  1279. var protocol = parseProtocol(fullPath);
  1280. if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) {
  1281. reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
  1282. return;
  1283. }
  1284. // Send the request
  1285. request.send(requestData);
  1286. });
  1287. };
  1288. }, function(modId) { var map = {"./../utils":1662612701732,"./../core/settle":1662612701745,"./../helpers/cookies":1662612701746,"./../helpers/buildURL":1662612701735,"../core/buildFullPath":1662612701747,"./../helpers/parseHeaders":1662612701750,"./../helpers/isURLSameOrigin":1662612701751,"../defaults/transitional":1662612701742,"../core/AxiosError":1662612701741,"../cancel/CanceledError":1662612701752,"../helpers/parseProtocol":1662612701753}; return __REQUIRE__(map[modId], modId); })
  1289. __DEFINE__(1662612701745, function(require, module, exports) {
  1290. var AxiosError = require('./AxiosError');
  1291. /**
  1292. * Resolve or reject a Promise based on response status.
  1293. *
  1294. * @param {Function} resolve A function that resolves the promise.
  1295. * @param {Function} reject A function that rejects the promise.
  1296. * @param {object} response The response.
  1297. */
  1298. module.exports = function settle(resolve, reject, response) {
  1299. var validateStatus = response.config.validateStatus;
  1300. if (!response.status || !validateStatus || validateStatus(response.status)) {
  1301. resolve(response);
  1302. } else {
  1303. reject(new AxiosError(
  1304. 'Request failed with status code ' + response.status,
  1305. [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
  1306. response.config,
  1307. response.request,
  1308. response
  1309. ));
  1310. }
  1311. };
  1312. }, function(modId) { var map = {"./AxiosError":1662612701741}; return __REQUIRE__(map[modId], modId); })
  1313. __DEFINE__(1662612701746, function(require, module, exports) {
  1314. var utils = require('./../utils');
  1315. module.exports = (
  1316. utils.isStandardBrowserEnv() ?
  1317. // Standard browser envs support document.cookie
  1318. (function standardBrowserEnv() {
  1319. return {
  1320. write: function write(name, value, expires, path, domain, secure) {
  1321. var cookie = [];
  1322. cookie.push(name + '=' + encodeURIComponent(value));
  1323. if (utils.isNumber(expires)) {
  1324. cookie.push('expires=' + new Date(expires).toGMTString());
  1325. }
  1326. if (utils.isString(path)) {
  1327. cookie.push('path=' + path);
  1328. }
  1329. if (utils.isString(domain)) {
  1330. cookie.push('domain=' + domain);
  1331. }
  1332. if (secure === true) {
  1333. cookie.push('secure');
  1334. }
  1335. document.cookie = cookie.join('; ');
  1336. },
  1337. read: function read(name) {
  1338. var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
  1339. return (match ? decodeURIComponent(match[3]) : null);
  1340. },
  1341. remove: function remove(name) {
  1342. this.write(name, '', Date.now() - 86400000);
  1343. }
  1344. };
  1345. })() :
  1346. // Non standard browser env (web workers, react-native) lack needed support.
  1347. (function nonStandardBrowserEnv() {
  1348. return {
  1349. write: function write() {},
  1350. read: function read() { return null; },
  1351. remove: function remove() {}
  1352. };
  1353. })()
  1354. );
  1355. }, function(modId) { var map = {"./../utils":1662612701732}; return __REQUIRE__(map[modId], modId); })
  1356. __DEFINE__(1662612701747, function(require, module, exports) {
  1357. var isAbsoluteURL = require('../helpers/isAbsoluteURL');
  1358. var combineURLs = require('../helpers/combineURLs');
  1359. /**
  1360. * Creates a new URL by combining the baseURL with the requestedURL,
  1361. * only when the requestedURL is not already an absolute URL.
  1362. * If the requestURL is absolute, this function returns the requestedURL untouched.
  1363. *
  1364. * @param {string} baseURL The base URL
  1365. * @param {string} requestedURL Absolute or relative URL to combine
  1366. * @returns {string} The combined full path
  1367. */
  1368. module.exports = function buildFullPath(baseURL, requestedURL) {
  1369. if (baseURL && !isAbsoluteURL(requestedURL)) {
  1370. return combineURLs(baseURL, requestedURL);
  1371. }
  1372. return requestedURL;
  1373. };
  1374. }, function(modId) { var map = {"../helpers/isAbsoluteURL":1662612701748,"../helpers/combineURLs":1662612701749}; return __REQUIRE__(map[modId], modId); })
  1375. __DEFINE__(1662612701748, function(require, module, exports) {
  1376. /**
  1377. * Determines whether the specified URL is absolute
  1378. *
  1379. * @param {string} url The URL to test
  1380. * @returns {boolean} True if the specified URL is absolute, otherwise false
  1381. */
  1382. module.exports = function isAbsoluteURL(url) {
  1383. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  1384. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  1385. // by any combination of letters, digits, plus, period, or hyphen.
  1386. return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
  1387. };
  1388. }, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
  1389. __DEFINE__(1662612701749, function(require, module, exports) {
  1390. /**
  1391. * Creates a new URL by combining the specified URLs
  1392. *
  1393. * @param {string} baseURL The base URL
  1394. * @param {string} relativeURL The relative URL
  1395. * @returns {string} The combined URL
  1396. */
  1397. module.exports = function combineURLs(baseURL, relativeURL) {
  1398. return relativeURL
  1399. ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
  1400. : baseURL;
  1401. };
  1402. }, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
  1403. __DEFINE__(1662612701750, function(require, module, exports) {
  1404. var utils = require('./../utils');
  1405. // Headers whose duplicates are ignored by node
  1406. // c.f. https://nodejs.org/api/http.html#http_message_headers
  1407. var ignoreDuplicateOf = [
  1408. 'age', 'authorization', 'content-length', 'content-type', 'etag',
  1409. 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
  1410. 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
  1411. 'referer', 'retry-after', 'user-agent'
  1412. ];
  1413. /**
  1414. * Parse headers into an object
  1415. *
  1416. * ```
  1417. * Date: Wed, 27 Aug 2014 08:58:49 GMT
  1418. * Content-Type: application/json
  1419. * Connection: keep-alive
  1420. * Transfer-Encoding: chunked
  1421. * ```
  1422. *
  1423. * @param {String} headers Headers needing to be parsed
  1424. * @returns {Object} Headers parsed into an object
  1425. */
  1426. module.exports = function parseHeaders(headers) {
  1427. var parsed = {};
  1428. var key;
  1429. var val;
  1430. var i;
  1431. if (!headers) { return parsed; }
  1432. utils.forEach(headers.split('\n'), function parser(line) {
  1433. i = line.indexOf(':');
  1434. key = utils.trim(line.substr(0, i)).toLowerCase();
  1435. val = utils.trim(line.substr(i + 1));
  1436. if (key) {
  1437. if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
  1438. return;
  1439. }
  1440. if (key === 'set-cookie') {
  1441. parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
  1442. } else {
  1443. parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
  1444. }
  1445. }
  1446. });
  1447. return parsed;
  1448. };
  1449. }, function(modId) { var map = {"./../utils":1662612701732}; return __REQUIRE__(map[modId], modId); })
  1450. __DEFINE__(1662612701751, function(require, module, exports) {
  1451. var utils = require('./../utils');
  1452. module.exports = (
  1453. utils.isStandardBrowserEnv() ?
  1454. // Standard browser envs have full support of the APIs needed to test
  1455. // whether the request URL is of the same origin as current location.
  1456. (function standardBrowserEnv() {
  1457. var msie = /(msie|trident)/i.test(navigator.userAgent);
  1458. var urlParsingNode = document.createElement('a');
  1459. var originURL;
  1460. /**
  1461. * Parse a URL to discover it's components
  1462. *
  1463. * @param {String} url The URL to be parsed
  1464. * @returns {Object}
  1465. */
  1466. function resolveURL(url) {
  1467. var href = url;
  1468. if (msie) {
  1469. // IE needs attribute set twice to normalize properties
  1470. urlParsingNode.setAttribute('href', href);
  1471. href = urlParsingNode.href;
  1472. }
  1473. urlParsingNode.setAttribute('href', href);
  1474. // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
  1475. return {
  1476. href: urlParsingNode.href,
  1477. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
  1478. host: urlParsingNode.host,
  1479. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
  1480. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
  1481. hostname: urlParsingNode.hostname,
  1482. port: urlParsingNode.port,
  1483. pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
  1484. urlParsingNode.pathname :
  1485. '/' + urlParsingNode.pathname
  1486. };
  1487. }
  1488. originURL = resolveURL(window.location.href);
  1489. /**
  1490. * Determine if a URL shares the same origin as the current location
  1491. *
  1492. * @param {String} requestURL The URL to test
  1493. * @returns {boolean} True if URL shares the same origin, otherwise false
  1494. */
  1495. return function isURLSameOrigin(requestURL) {
  1496. var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
  1497. return (parsed.protocol === originURL.protocol &&
  1498. parsed.host === originURL.host);
  1499. };
  1500. })() :
  1501. // Non standard browser envs (web workers, react-native) lack needed support.
  1502. (function nonStandardBrowserEnv() {
  1503. return function isURLSameOrigin() {
  1504. return true;
  1505. };
  1506. })()
  1507. );
  1508. }, function(modId) { var map = {"./../utils":1662612701732}; return __REQUIRE__(map[modId], modId); })
  1509. __DEFINE__(1662612701752, function(require, module, exports) {
  1510. var AxiosError = require('../core/AxiosError');
  1511. var utils = require('../utils');
  1512. /**
  1513. * A `CanceledError` is an object that is thrown when an operation is canceled.
  1514. *
  1515. * @class
  1516. * @param {string=} message The message.
  1517. */
  1518. function CanceledError(message) {
  1519. // eslint-disable-next-line no-eq-null,eqeqeq
  1520. AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED);
  1521. this.name = 'CanceledError';
  1522. }
  1523. utils.inherits(CanceledError, AxiosError, {
  1524. __CANCEL__: true
  1525. });
  1526. module.exports = CanceledError;
  1527. }, function(modId) { var map = {"../core/AxiosError":1662612701741,"../utils":1662612701732}; return __REQUIRE__(map[modId], modId); })
  1528. __DEFINE__(1662612701753, function(require, module, exports) {
  1529. module.exports = function parseProtocol(url) {
  1530. var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
  1531. return match && match[1] || '';
  1532. };
  1533. }, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
  1534. __DEFINE__(1662612701754, function(require, module, exports) {
  1535. var utils = require('./../utils');
  1536. var settle = require('./../core/settle');
  1537. var buildFullPath = require('../core/buildFullPath');
  1538. var buildURL = require('./../helpers/buildURL');
  1539. var http = require('http');
  1540. var https = require('https');
  1541. var httpFollow = require('follow-redirects').http;
  1542. var httpsFollow = require('follow-redirects').https;
  1543. var url = require('url');
  1544. var zlib = require('zlib');
  1545. var VERSION = require('./../env/data').version;
  1546. var transitionalDefaults = require('../defaults/transitional');
  1547. var AxiosError = require('../core/AxiosError');
  1548. var CanceledError = require('../cancel/CanceledError');
  1549. var isHttps = /https:?/;
  1550. var supportedProtocols = [ 'http:', 'https:', 'file:' ];
  1551. /**
  1552. *
  1553. * @param {http.ClientRequestArgs} options
  1554. * @param {AxiosProxyConfig} proxy
  1555. * @param {string} location
  1556. */
  1557. function setProxy(options, proxy, location) {
  1558. options.hostname = proxy.host;
  1559. options.host = proxy.host;
  1560. options.port = proxy.port;
  1561. options.path = location;
  1562. // Basic proxy authorization
  1563. if (proxy.auth) {
  1564. var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');
  1565. options.headers['Proxy-Authorization'] = 'Basic ' + base64;
  1566. }
  1567. // If a proxy is used, any redirects must also pass through the proxy
  1568. options.beforeRedirect = function beforeRedirect(redirection) {
  1569. redirection.headers.host = redirection.host;
  1570. setProxy(redirection, proxy, redirection.href);
  1571. };
  1572. }
  1573. /*eslint consistent-return:0*/
  1574. module.exports = function httpAdapter(config) {
  1575. return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
  1576. var onCanceled;
  1577. function done() {
  1578. if (config.cancelToken) {
  1579. config.cancelToken.unsubscribe(onCanceled);
  1580. }
  1581. if (config.signal) {
  1582. config.signal.removeEventListener('abort', onCanceled);
  1583. }
  1584. }
  1585. var resolve = function resolve(value) {
  1586. done();
  1587. resolvePromise(value);
  1588. };
  1589. var rejected = false;
  1590. var reject = function reject(value) {
  1591. done();
  1592. rejected = true;
  1593. rejectPromise(value);
  1594. };
  1595. var data = config.data;
  1596. var headers = config.headers;
  1597. var headerNames = {};
  1598. Object.keys(headers).forEach(function storeLowerName(name) {
  1599. headerNames[name.toLowerCase()] = name;
  1600. });
  1601. // Set User-Agent (required by some servers)
  1602. // See https://github.com/axios/axios/issues/69
  1603. if ('user-agent' in headerNames) {
  1604. // User-Agent is specified; handle case where no UA header is desired
  1605. if (!headers[headerNames['user-agent']]) {
  1606. delete headers[headerNames['user-agent']];
  1607. }
  1608. // Otherwise, use specified value
  1609. } else {
  1610. // Only set header if it hasn't been set in config
  1611. headers['User-Agent'] = 'axios/' + VERSION;
  1612. }
  1613. // support for https://www.npmjs.com/package/form-data api
  1614. if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {
  1615. Object.assign(headers, data.getHeaders());
  1616. } else if (data && !utils.isStream(data)) {
  1617. if (Buffer.isBuffer(data)) {
  1618. // Nothing to do...
  1619. } else if (utils.isArrayBuffer(data)) {
  1620. data = Buffer.from(new Uint8Array(data));
  1621. } else if (utils.isString(data)) {
  1622. data = Buffer.from(data, 'utf-8');
  1623. } else {
  1624. return reject(new AxiosError(
  1625. 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
  1626. AxiosError.ERR_BAD_REQUEST,
  1627. config
  1628. ));
  1629. }
  1630. if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
  1631. return reject(new AxiosError(
  1632. 'Request body larger than maxBodyLength limit',
  1633. AxiosError.ERR_BAD_REQUEST,
  1634. config
  1635. ));
  1636. }
  1637. // Add Content-Length header if data exists
  1638. if (!headerNames['content-length']) {
  1639. headers['Content-Length'] = data.length;
  1640. }
  1641. }
  1642. // HTTP basic authentication
  1643. var auth = undefined;
  1644. if (config.auth) {
  1645. var username = config.auth.username || '';
  1646. var password = config.auth.password || '';
  1647. auth = username + ':' + password;
  1648. }
  1649. // Parse url
  1650. var fullPath = buildFullPath(config.baseURL, config.url);
  1651. var parsed = url.parse(fullPath);
  1652. var protocol = parsed.protocol || supportedProtocols[0];
  1653. if (supportedProtocols.indexOf(protocol) === -1) {
  1654. return reject(new AxiosError(
  1655. 'Unsupported protocol ' + protocol,
  1656. AxiosError.ERR_BAD_REQUEST,
  1657. config
  1658. ));
  1659. }
  1660. if (!auth && parsed.auth) {
  1661. var urlAuth = parsed.auth.split(':');
  1662. var urlUsername = urlAuth[0] || '';
  1663. var urlPassword = urlAuth[1] || '';
  1664. auth = urlUsername + ':' + urlPassword;
  1665. }
  1666. if (auth && headerNames.authorization) {
  1667. delete headers[headerNames.authorization];
  1668. }
  1669. var isHttpsRequest = isHttps.test(protocol);
  1670. var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
  1671. try {
  1672. buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, '');
  1673. } catch (err) {
  1674. var customErr = new Error(err.message);
  1675. customErr.config = config;
  1676. customErr.url = config.url;
  1677. customErr.exists = true;
  1678. reject(customErr);
  1679. }
  1680. var options = {
  1681. path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''),
  1682. method: config.method.toUpperCase(),
  1683. headers: headers,
  1684. agent: agent,
  1685. agents: { http: config.httpAgent, https: config.httpsAgent },
  1686. auth: auth
  1687. };
  1688. if (config.socketPath) {
  1689. options.socketPath = config.socketPath;
  1690. } else {
  1691. options.hostname = parsed.hostname;
  1692. options.port = parsed.port;
  1693. }
  1694. var proxy = config.proxy;
  1695. if (!proxy && proxy !== false) {
  1696. var proxyEnv = protocol.slice(0, -1) + '_proxy';
  1697. var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];
  1698. if (proxyUrl) {
  1699. var parsedProxyUrl = url.parse(proxyUrl);
  1700. var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;
  1701. var shouldProxy = true;
  1702. if (noProxyEnv) {
  1703. var noProxy = noProxyEnv.split(',').map(function trim(s) {
  1704. return s.trim();
  1705. });
  1706. shouldProxy = !noProxy.some(function proxyMatch(proxyElement) {
  1707. if (!proxyElement) {
  1708. return false;
  1709. }
  1710. if (proxyElement === '*') {
  1711. return true;
  1712. }
  1713. if (proxyElement[0] === '.' &&
  1714. parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {
  1715. return true;
  1716. }
  1717. return parsed.hostname === proxyElement;
  1718. });
  1719. }
  1720. if (shouldProxy) {
  1721. proxy = {
  1722. host: parsedProxyUrl.hostname,
  1723. port: parsedProxyUrl.port,
  1724. protocol: parsedProxyUrl.protocol
  1725. };
  1726. if (parsedProxyUrl.auth) {
  1727. var proxyUrlAuth = parsedProxyUrl.auth.split(':');
  1728. proxy.auth = {
  1729. username: proxyUrlAuth[0],
  1730. password: proxyUrlAuth[1]
  1731. };
  1732. }
  1733. }
  1734. }
  1735. }
  1736. if (proxy) {
  1737. options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');
  1738. setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
  1739. }
  1740. var transport;
  1741. var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);
  1742. if (config.transport) {
  1743. transport = config.transport;
  1744. } else if (config.maxRedirects === 0) {
  1745. transport = isHttpsProxy ? https : http;
  1746. } else {
  1747. if (config.maxRedirects) {
  1748. options.maxRedirects = config.maxRedirects;
  1749. }
  1750. if (config.beforeRedirect) {
  1751. options.beforeRedirect = config.beforeRedirect;
  1752. }
  1753. transport = isHttpsProxy ? httpsFollow : httpFollow;
  1754. }
  1755. if (config.maxBodyLength > -1) {
  1756. options.maxBodyLength = config.maxBodyLength;
  1757. }
  1758. if (config.insecureHTTPParser) {
  1759. options.insecureHTTPParser = config.insecureHTTPParser;
  1760. }
  1761. // Create the request
  1762. var req = transport.request(options, function handleResponse(res) {
  1763. if (req.aborted) return;
  1764. // uncompress the response body transparently if required
  1765. var stream = res;
  1766. // return the last request in case of redirects
  1767. var lastRequest = res.req || req;
  1768. // if no content, is HEAD request or decompress disabled we should not decompress
  1769. if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) {
  1770. switch (res.headers['content-encoding']) {
  1771. /*eslint default-case:0*/
  1772. case 'gzip':
  1773. case 'compress':
  1774. case 'deflate':
  1775. // add the unzipper to the body stream processing pipeline
  1776. stream = stream.pipe(zlib.createUnzip());
  1777. // remove the content-encoding in order to not confuse downstream operations
  1778. delete res.headers['content-encoding'];
  1779. break;
  1780. }
  1781. }
  1782. var response = {
  1783. status: res.statusCode,
  1784. statusText: res.statusMessage,
  1785. headers: res.headers,
  1786. config: config,
  1787. request: lastRequest
  1788. };
  1789. if (config.responseType === 'stream') {
  1790. response.data = stream;
  1791. settle(resolve, reject, response);
  1792. } else {
  1793. var responseBuffer = [];
  1794. var totalResponseBytes = 0;
  1795. stream.on('data', function handleStreamData(chunk) {
  1796. responseBuffer.push(chunk);
  1797. totalResponseBytes += chunk.length;
  1798. // make sure the content length is not over the maxContentLength if specified
  1799. if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
  1800. // stream.destoy() emit aborted event before calling reject() on Node.js v16
  1801. rejected = true;
  1802. stream.destroy();
  1803. reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
  1804. AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
  1805. }
  1806. });
  1807. stream.on('aborted', function handlerStreamAborted() {
  1808. if (rejected) {
  1809. return;
  1810. }
  1811. stream.destroy();
  1812. reject(new AxiosError(
  1813. 'maxContentLength size of ' + config.maxContentLength + ' exceeded',
  1814. AxiosError.ERR_BAD_RESPONSE,
  1815. config,
  1816. lastRequest
  1817. ));
  1818. });
  1819. stream.on('error', function handleStreamError(err) {
  1820. if (req.aborted) return;
  1821. reject(AxiosError.from(err, null, config, lastRequest));
  1822. });
  1823. stream.on('end', function handleStreamEnd() {
  1824. try {
  1825. var responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
  1826. if (config.responseType !== 'arraybuffer') {
  1827. responseData = responseData.toString(config.responseEncoding);
  1828. if (!config.responseEncoding || config.responseEncoding === 'utf8') {
  1829. responseData = utils.stripBOM(responseData);
  1830. }
  1831. }
  1832. response.data = responseData;
  1833. } catch (err) {
  1834. reject(AxiosError.from(err, null, config, response.request, response));
  1835. }
  1836. settle(resolve, reject, response);
  1837. });
  1838. }
  1839. });
  1840. // Handle errors
  1841. req.on('error', function handleRequestError(err) {
  1842. // @todo remove
  1843. // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return;
  1844. reject(AxiosError.from(err, null, config, req));
  1845. });
  1846. // set tcp keep alive to prevent drop connection by peer
  1847. req.on('socket', function handleRequestSocket(socket) {
  1848. // default interval of sending ack packet is 1 minute
  1849. socket.setKeepAlive(true, 1000 * 60);
  1850. });
  1851. // Handle request timeout
  1852. if (config.timeout) {
  1853. // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
  1854. var timeout = parseInt(config.timeout, 10);
  1855. if (isNaN(timeout)) {
  1856. reject(new AxiosError(
  1857. 'error trying to parse `config.timeout` to int',
  1858. AxiosError.ERR_BAD_OPTION_VALUE,
  1859. config,
  1860. req
  1861. ));
  1862. return;
  1863. }
  1864. // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
  1865. // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
  1866. // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
  1867. // And then these socket which be hang up will devoring CPU little by little.
  1868. // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
  1869. req.setTimeout(timeout, function handleRequestTimeout() {
  1870. req.abort();
  1871. var transitional = config.transitional || transitionalDefaults;
  1872. reject(new AxiosError(
  1873. 'timeout of ' + timeout + 'ms exceeded',
  1874. transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
  1875. config,
  1876. req
  1877. ));
  1878. });
  1879. }
  1880. if (config.cancelToken || config.signal) {
  1881. // Handle cancellation
  1882. // eslint-disable-next-line func-names
  1883. onCanceled = function(cancel) {
  1884. if (req.aborted) return;
  1885. req.abort();
  1886. reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel);
  1887. };
  1888. config.cancelToken && config.cancelToken.subscribe(onCanceled);
  1889. if (config.signal) {
  1890. config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
  1891. }
  1892. }
  1893. // Send the request
  1894. if (utils.isStream(data)) {
  1895. data.on('error', function handleStreamError(err) {
  1896. reject(AxiosError.from(err, config, null, req));
  1897. }).pipe(req);
  1898. } else {
  1899. req.end(data);
  1900. }
  1901. });
  1902. };
  1903. }, function(modId) { var map = {"./../utils":1662612701732,"./../core/settle":1662612701745,"../core/buildFullPath":1662612701747,"./../helpers/buildURL":1662612701735,"http":1662612701754,"./../env/data":1662612701755,"../defaults/transitional":1662612701742,"../core/AxiosError":1662612701741,"../cancel/CanceledError":1662612701752}; return __REQUIRE__(map[modId], modId); })
  1904. __DEFINE__(1662612701755, function(require, module, exports) {
  1905. module.exports = {
  1906. "version": "0.27.2"
  1907. };
  1908. }, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
  1909. __DEFINE__(1662612701756, function(require, module, exports) {
  1910. // eslint-disable-next-line strict
  1911. module.exports = require('form-data');
  1912. }, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
  1913. __DEFINE__(1662612701757, function(require, module, exports) {
  1914. module.exports = function isCancel(value) {
  1915. return !!(value && value.__CANCEL__);
  1916. };
  1917. }, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
  1918. __DEFINE__(1662612701758, function(require, module, exports) {
  1919. var utils = require('../utils');
  1920. /**
  1921. * Config-specific merge-function which creates a new config-object
  1922. * by merging two configuration objects together.
  1923. *
  1924. * @param {Object} config1
  1925. * @param {Object} config2
  1926. * @returns {Object} New object resulting from merging config2 to config1
  1927. */
  1928. module.exports = function mergeConfig(config1, config2) {
  1929. // eslint-disable-next-line no-param-reassign
  1930. config2 = config2 || {};
  1931. var config = {};
  1932. function getMergedValue(target, source) {
  1933. if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
  1934. return utils.merge(target, source);
  1935. } else if (utils.isPlainObject(source)) {
  1936. return utils.merge({}, source);
  1937. } else if (utils.isArray(source)) {
  1938. return source.slice();
  1939. }
  1940. return source;
  1941. }
  1942. // eslint-disable-next-line consistent-return
  1943. function mergeDeepProperties(prop) {
  1944. if (!utils.isUndefined(config2[prop])) {
  1945. return getMergedValue(config1[prop], config2[prop]);
  1946. } else if (!utils.isUndefined(config1[prop])) {
  1947. return getMergedValue(undefined, config1[prop]);
  1948. }
  1949. }
  1950. // eslint-disable-next-line consistent-return
  1951. function valueFromConfig2(prop) {
  1952. if (!utils.isUndefined(config2[prop])) {
  1953. return getMergedValue(undefined, config2[prop]);
  1954. }
  1955. }
  1956. // eslint-disable-next-line consistent-return
  1957. function defaultToConfig2(prop) {
  1958. if (!utils.isUndefined(config2[prop])) {
  1959. return getMergedValue(undefined, config2[prop]);
  1960. } else if (!utils.isUndefined(config1[prop])) {
  1961. return getMergedValue(undefined, config1[prop]);
  1962. }
  1963. }
  1964. // eslint-disable-next-line consistent-return
  1965. function mergeDirectKeys(prop) {
  1966. if (prop in config2) {
  1967. return getMergedValue(config1[prop], config2[prop]);
  1968. } else if (prop in config1) {
  1969. return getMergedValue(undefined, config1[prop]);
  1970. }
  1971. }
  1972. var mergeMap = {
  1973. 'url': valueFromConfig2,
  1974. 'method': valueFromConfig2,
  1975. 'data': valueFromConfig2,
  1976. 'baseURL': defaultToConfig2,
  1977. 'transformRequest': defaultToConfig2,
  1978. 'transformResponse': defaultToConfig2,
  1979. 'paramsSerializer': defaultToConfig2,
  1980. 'timeout': defaultToConfig2,
  1981. 'timeoutMessage': defaultToConfig2,
  1982. 'withCredentials': defaultToConfig2,
  1983. 'adapter': defaultToConfig2,
  1984. 'responseType': defaultToConfig2,
  1985. 'xsrfCookieName': defaultToConfig2,
  1986. 'xsrfHeaderName': defaultToConfig2,
  1987. 'onUploadProgress': defaultToConfig2,
  1988. 'onDownloadProgress': defaultToConfig2,
  1989. 'decompress': defaultToConfig2,
  1990. 'maxContentLength': defaultToConfig2,
  1991. 'maxBodyLength': defaultToConfig2,
  1992. 'beforeRedirect': defaultToConfig2,
  1993. 'transport': defaultToConfig2,
  1994. 'httpAgent': defaultToConfig2,
  1995. 'httpsAgent': defaultToConfig2,
  1996. 'cancelToken': defaultToConfig2,
  1997. 'socketPath': defaultToConfig2,
  1998. 'responseEncoding': defaultToConfig2,
  1999. 'validateStatus': mergeDirectKeys
  2000. };
  2001. utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
  2002. var merge = mergeMap[prop] || mergeDeepProperties;
  2003. var configValue = merge(prop);
  2004. (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
  2005. });
  2006. return config;
  2007. };
  2008. }, function(modId) { var map = {"../utils":1662612701732}; return __REQUIRE__(map[modId], modId); })
  2009. __DEFINE__(1662612701759, function(require, module, exports) {
  2010. var VERSION = require('../env/data').version;
  2011. var AxiosError = require('../core/AxiosError');
  2012. var validators = {};
  2013. // eslint-disable-next-line func-names
  2014. ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {
  2015. validators[type] = function validator(thing) {
  2016. return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
  2017. };
  2018. });
  2019. var deprecatedWarnings = {};
  2020. /**
  2021. * Transitional option validator
  2022. * @param {function|boolean?} validator - set to false if the transitional option has been removed
  2023. * @param {string?} version - deprecated version / removed since version
  2024. * @param {string?} message - some message with additional info
  2025. * @returns {function}
  2026. */
  2027. validators.transitional = function transitional(validator, version, message) {
  2028. function formatMessage(opt, desc) {
  2029. return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
  2030. }
  2031. // eslint-disable-next-line func-names
  2032. return function(value, opt, opts) {
  2033. if (validator === false) {
  2034. throw new AxiosError(
  2035. formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
  2036. AxiosError.ERR_DEPRECATED
  2037. );
  2038. }
  2039. if (version && !deprecatedWarnings[opt]) {
  2040. deprecatedWarnings[opt] = true;
  2041. // eslint-disable-next-line no-console
  2042. console.warn(
  2043. formatMessage(
  2044. opt,
  2045. ' has been deprecated since v' + version + ' and will be removed in the near future'
  2046. )
  2047. );
  2048. }
  2049. return validator ? validator(value, opt, opts) : true;
  2050. };
  2051. };
  2052. /**
  2053. * Assert object's properties type
  2054. * @param {object} options
  2055. * @param {object} schema
  2056. * @param {boolean?} allowUnknown
  2057. */
  2058. function assertOptions(options, schema, allowUnknown) {
  2059. if (typeof options !== 'object') {
  2060. throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
  2061. }
  2062. var keys = Object.keys(options);
  2063. var i = keys.length;
  2064. while (i-- > 0) {
  2065. var opt = keys[i];
  2066. var validator = schema[opt];
  2067. if (validator) {
  2068. var value = options[opt];
  2069. var result = value === undefined || validator(value, opt, options);
  2070. if (result !== true) {
  2071. throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
  2072. }
  2073. continue;
  2074. }
  2075. if (allowUnknown !== true) {
  2076. throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
  2077. }
  2078. }
  2079. }
  2080. module.exports = {
  2081. assertOptions: assertOptions,
  2082. validators: validators
  2083. };
  2084. }, function(modId) { var map = {"../env/data":1662612701755,"../core/AxiosError":1662612701741}; return __REQUIRE__(map[modId], modId); })
  2085. __DEFINE__(1662612701760, function(require, module, exports) {
  2086. var CanceledError = require('./CanceledError');
  2087. /**
  2088. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  2089. *
  2090. * @class
  2091. * @param {Function} executor The executor function.
  2092. */
  2093. function CancelToken(executor) {
  2094. if (typeof executor !== 'function') {
  2095. throw new TypeError('executor must be a function.');
  2096. }
  2097. var resolvePromise;
  2098. this.promise = new Promise(function promiseExecutor(resolve) {
  2099. resolvePromise = resolve;
  2100. });
  2101. var token = this;
  2102. // eslint-disable-next-line func-names
  2103. this.promise.then(function(cancel) {
  2104. if (!token._listeners) return;
  2105. var i;
  2106. var l = token._listeners.length;
  2107. for (i = 0; i < l; i++) {
  2108. token._listeners[i](cancel);
  2109. }
  2110. token._listeners = null;
  2111. });
  2112. // eslint-disable-next-line func-names
  2113. this.promise.then = function(onfulfilled) {
  2114. var _resolve;
  2115. // eslint-disable-next-line func-names
  2116. var promise = new Promise(function(resolve) {
  2117. token.subscribe(resolve);
  2118. _resolve = resolve;
  2119. }).then(onfulfilled);
  2120. promise.cancel = function reject() {
  2121. token.unsubscribe(_resolve);
  2122. };
  2123. return promise;
  2124. };
  2125. executor(function cancel(message) {
  2126. if (token.reason) {
  2127. // Cancellation has already been requested
  2128. return;
  2129. }
  2130. token.reason = new CanceledError(message);
  2131. resolvePromise(token.reason);
  2132. });
  2133. }
  2134. /**
  2135. * Throws a `CanceledError` if cancellation has been requested.
  2136. */
  2137. CancelToken.prototype.throwIfRequested = function throwIfRequested() {
  2138. if (this.reason) {
  2139. throw this.reason;
  2140. }
  2141. };
  2142. /**
  2143. * Subscribe to the cancel signal
  2144. */
  2145. CancelToken.prototype.subscribe = function subscribe(listener) {
  2146. if (this.reason) {
  2147. listener(this.reason);
  2148. return;
  2149. }
  2150. if (this._listeners) {
  2151. this._listeners.push(listener);
  2152. } else {
  2153. this._listeners = [listener];
  2154. }
  2155. };
  2156. /**
  2157. * Unsubscribe from the cancel signal
  2158. */
  2159. CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
  2160. if (!this._listeners) {
  2161. return;
  2162. }
  2163. var index = this._listeners.indexOf(listener);
  2164. if (index !== -1) {
  2165. this._listeners.splice(index, 1);
  2166. }
  2167. };
  2168. /**
  2169. * Returns an object that contains a new `CancelToken` and a function that, when called,
  2170. * cancels the `CancelToken`.
  2171. */
  2172. CancelToken.source = function source() {
  2173. var cancel;
  2174. var token = new CancelToken(function executor(c) {
  2175. cancel = c;
  2176. });
  2177. return {
  2178. token: token,
  2179. cancel: cancel
  2180. };
  2181. };
  2182. module.exports = CancelToken;
  2183. }, function(modId) { var map = {"./CanceledError":1662612701752}; return __REQUIRE__(map[modId], modId); })
  2184. __DEFINE__(1662612701761, function(require, module, exports) {
  2185. /**
  2186. * Syntactic sugar for invoking a function and expanding an array for arguments.
  2187. *
  2188. * Common use case would be to use `Function.prototype.apply`.
  2189. *
  2190. * ```js
  2191. * function f(x, y, z) {}
  2192. * var args = [1, 2, 3];
  2193. * f.apply(null, args);
  2194. * ```
  2195. *
  2196. * With `spread` this example can be re-written.
  2197. *
  2198. * ```js
  2199. * spread(function(x, y, z) {})([1, 2, 3]);
  2200. * ```
  2201. *
  2202. * @param {Function} callback
  2203. * @returns {Function}
  2204. */
  2205. module.exports = function spread(callback) {
  2206. return function wrap(arr) {
  2207. return callback.apply(null, arr);
  2208. };
  2209. };
  2210. }, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
  2211. __DEFINE__(1662612701762, function(require, module, exports) {
  2212. var utils = require('./../utils');
  2213. /**
  2214. * Determines whether the payload is an error thrown by Axios
  2215. *
  2216. * @param {*} payload The value to test
  2217. * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
  2218. */
  2219. module.exports = function isAxiosError(payload) {
  2220. return utils.isObject(payload) && (payload.isAxiosError === true);
  2221. };
  2222. }, function(modId) { var map = {"./../utils":1662612701732}; return __REQUIRE__(map[modId], modId); })
  2223. return __REQUIRE__(1662612701730);
  2224. })()
  2225. //miniprogram-npm-outsideDeps=["https","follow-redirects","url","zlib","form-data"]
  2226. //# sourceMappingURL=index.js.map