axios.js 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058
  1. import "./chunk-S5KM4IGW.js";
  2. // node_modules/axios/lib/helpers/bind.js
  3. function bind(fn, thisArg) {
  4. return function wrap() {
  5. return fn.apply(thisArg, arguments);
  6. };
  7. }
  8. // node_modules/axios/lib/utils.js
  9. var { toString } = Object.prototype;
  10. var { getPrototypeOf } = Object;
  11. var kindOf = ((cache) => (thing) => {
  12. const str = toString.call(thing);
  13. return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
  14. })(/* @__PURE__ */ Object.create(null));
  15. var kindOfTest = (type) => {
  16. type = type.toLowerCase();
  17. return (thing) => kindOf(thing) === type;
  18. };
  19. var typeOfTest = (type) => (thing) => typeof thing === type;
  20. var { isArray } = Array;
  21. var isUndefined = typeOfTest("undefined");
  22. function isBuffer(val) {
  23. return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
  24. }
  25. var isArrayBuffer = kindOfTest("ArrayBuffer");
  26. function isArrayBufferView(val) {
  27. let result;
  28. if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
  29. result = ArrayBuffer.isView(val);
  30. } else {
  31. result = val && val.buffer && isArrayBuffer(val.buffer);
  32. }
  33. return result;
  34. }
  35. var isString = typeOfTest("string");
  36. var isFunction = typeOfTest("function");
  37. var isNumber = typeOfTest("number");
  38. var isObject = (thing) => thing !== null && typeof thing === "object";
  39. var isBoolean = (thing) => thing === true || thing === false;
  40. var isPlainObject = (val) => {
  41. if (kindOf(val) !== "object") {
  42. return false;
  43. }
  44. const prototype3 = getPrototypeOf(val);
  45. return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
  46. };
  47. var isDate = kindOfTest("Date");
  48. var isFile = kindOfTest("File");
  49. var isBlob = kindOfTest("Blob");
  50. var isFileList = kindOfTest("FileList");
  51. var isStream = (val) => isObject(val) && isFunction(val.pipe);
  52. var isFormData = (thing) => {
  53. let kind;
  54. return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
  55. };
  56. var isURLSearchParams = kindOfTest("URLSearchParams");
  57. var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
  58. function forEach(obj, fn, { allOwnKeys = false } = {}) {
  59. if (obj === null || typeof obj === "undefined") {
  60. return;
  61. }
  62. let i;
  63. let l;
  64. if (typeof obj !== "object") {
  65. obj = [obj];
  66. }
  67. if (isArray(obj)) {
  68. for (i = 0, l = obj.length; i < l; i++) {
  69. fn.call(null, obj[i], i, obj);
  70. }
  71. } else {
  72. const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
  73. const len = keys.length;
  74. let key;
  75. for (i = 0; i < len; i++) {
  76. key = keys[i];
  77. fn.call(null, obj[key], key, obj);
  78. }
  79. }
  80. }
  81. function findKey(obj, key) {
  82. key = key.toLowerCase();
  83. const keys = Object.keys(obj);
  84. let i = keys.length;
  85. let _key;
  86. while (i-- > 0) {
  87. _key = keys[i];
  88. if (key === _key.toLowerCase()) {
  89. return _key;
  90. }
  91. }
  92. return null;
  93. }
  94. var _global = (() => {
  95. if (typeof globalThis !== "undefined")
  96. return globalThis;
  97. return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
  98. })();
  99. var isContextDefined = (context) => !isUndefined(context) && context !== _global;
  100. function merge() {
  101. const { caseless } = isContextDefined(this) && this || {};
  102. const result = {};
  103. const assignValue = (val, key) => {
  104. const targetKey = caseless && findKey(result, key) || key;
  105. if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
  106. result[targetKey] = merge(result[targetKey], val);
  107. } else if (isPlainObject(val)) {
  108. result[targetKey] = merge({}, val);
  109. } else if (isArray(val)) {
  110. result[targetKey] = val.slice();
  111. } else {
  112. result[targetKey] = val;
  113. }
  114. };
  115. for (let i = 0, l = arguments.length; i < l; i++) {
  116. arguments[i] && forEach(arguments[i], assignValue);
  117. }
  118. return result;
  119. }
  120. var extend = (a, b, thisArg, { allOwnKeys } = {}) => {
  121. forEach(b, (val, key) => {
  122. if (thisArg && isFunction(val)) {
  123. a[key] = bind(val, thisArg);
  124. } else {
  125. a[key] = val;
  126. }
  127. }, { allOwnKeys });
  128. return a;
  129. };
  130. var stripBOM = (content) => {
  131. if (content.charCodeAt(0) === 65279) {
  132. content = content.slice(1);
  133. }
  134. return content;
  135. };
  136. var inherits = (constructor, superConstructor, props, descriptors2) => {
  137. constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
  138. constructor.prototype.constructor = constructor;
  139. Object.defineProperty(constructor, "super", {
  140. value: superConstructor.prototype
  141. });
  142. props && Object.assign(constructor.prototype, props);
  143. };
  144. var toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
  145. let props;
  146. let i;
  147. let prop;
  148. const merged = {};
  149. destObj = destObj || {};
  150. if (sourceObj == null)
  151. return destObj;
  152. do {
  153. props = Object.getOwnPropertyNames(sourceObj);
  154. i = props.length;
  155. while (i-- > 0) {
  156. prop = props[i];
  157. if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
  158. destObj[prop] = sourceObj[prop];
  159. merged[prop] = true;
  160. }
  161. }
  162. sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
  163. } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
  164. return destObj;
  165. };
  166. var endsWith = (str, searchString, position) => {
  167. str = String(str);
  168. if (position === void 0 || position > str.length) {
  169. position = str.length;
  170. }
  171. position -= searchString.length;
  172. const lastIndex = str.indexOf(searchString, position);
  173. return lastIndex !== -1 && lastIndex === position;
  174. };
  175. var toArray = (thing) => {
  176. if (!thing)
  177. return null;
  178. if (isArray(thing))
  179. return thing;
  180. let i = thing.length;
  181. if (!isNumber(i))
  182. return null;
  183. const arr = new Array(i);
  184. while (i-- > 0) {
  185. arr[i] = thing[i];
  186. }
  187. return arr;
  188. };
  189. var isTypedArray = ((TypedArray) => {
  190. return (thing) => {
  191. return TypedArray && thing instanceof TypedArray;
  192. };
  193. })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
  194. var forEachEntry = (obj, fn) => {
  195. const generator = obj && obj[Symbol.iterator];
  196. const iterator = generator.call(obj);
  197. let result;
  198. while ((result = iterator.next()) && !result.done) {
  199. const pair = result.value;
  200. fn.call(obj, pair[0], pair[1]);
  201. }
  202. };
  203. var matchAll = (regExp, str) => {
  204. let matches;
  205. const arr = [];
  206. while ((matches = regExp.exec(str)) !== null) {
  207. arr.push(matches);
  208. }
  209. return arr;
  210. };
  211. var isHTMLForm = kindOfTest("HTMLFormElement");
  212. var toCamelCase = (str) => {
  213. return str.toLowerCase().replace(
  214. /[-_\s]([a-z\d])(\w*)/g,
  215. function replacer(m, p1, p2) {
  216. return p1.toUpperCase() + p2;
  217. }
  218. );
  219. };
  220. var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
  221. var isRegExp = kindOfTest("RegExp");
  222. var reduceDescriptors = (obj, reducer) => {
  223. const descriptors2 = Object.getOwnPropertyDescriptors(obj);
  224. const reducedDescriptors = {};
  225. forEach(descriptors2, (descriptor, name) => {
  226. let ret;
  227. if ((ret = reducer(descriptor, name, obj)) !== false) {
  228. reducedDescriptors[name] = ret || descriptor;
  229. }
  230. });
  231. Object.defineProperties(obj, reducedDescriptors);
  232. };
  233. var freezeMethods = (obj) => {
  234. reduceDescriptors(obj, (descriptor, name) => {
  235. if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
  236. return false;
  237. }
  238. const value = obj[name];
  239. if (!isFunction(value))
  240. return;
  241. descriptor.enumerable = false;
  242. if ("writable" in descriptor) {
  243. descriptor.writable = false;
  244. return;
  245. }
  246. if (!descriptor.set) {
  247. descriptor.set = () => {
  248. throw Error("Can not rewrite read-only method '" + name + "'");
  249. };
  250. }
  251. });
  252. };
  253. var toObjectSet = (arrayOrString, delimiter) => {
  254. const obj = {};
  255. const define = (arr) => {
  256. arr.forEach((value) => {
  257. obj[value] = true;
  258. });
  259. };
  260. isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
  261. return obj;
  262. };
  263. var noop = () => {
  264. };
  265. var toFiniteNumber = (value, defaultValue) => {
  266. value = +value;
  267. return Number.isFinite(value) ? value : defaultValue;
  268. };
  269. var ALPHA = "abcdefghijklmnopqrstuvwxyz";
  270. var DIGIT = "0123456789";
  271. var ALPHABET = {
  272. DIGIT,
  273. ALPHA,
  274. ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
  275. };
  276. var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
  277. let str = "";
  278. const { length } = alphabet;
  279. while (size--) {
  280. str += alphabet[Math.random() * length | 0];
  281. }
  282. return str;
  283. };
  284. function isSpecCompliantForm(thing) {
  285. return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
  286. }
  287. var toJSONObject = (obj) => {
  288. const stack = new Array(10);
  289. const visit = (source, i) => {
  290. if (isObject(source)) {
  291. if (stack.indexOf(source) >= 0) {
  292. return;
  293. }
  294. if (!("toJSON" in source)) {
  295. stack[i] = source;
  296. const target = isArray(source) ? [] : {};
  297. forEach(source, (value, key) => {
  298. const reducedValue = visit(value, i + 1);
  299. !isUndefined(reducedValue) && (target[key] = reducedValue);
  300. });
  301. stack[i] = void 0;
  302. return target;
  303. }
  304. }
  305. return source;
  306. };
  307. return visit(obj, 0);
  308. };
  309. var isAsyncFn = kindOfTest("AsyncFunction");
  310. var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
  311. var utils_default = {
  312. isArray,
  313. isArrayBuffer,
  314. isBuffer,
  315. isFormData,
  316. isArrayBufferView,
  317. isString,
  318. isNumber,
  319. isBoolean,
  320. isObject,
  321. isPlainObject,
  322. isUndefined,
  323. isDate,
  324. isFile,
  325. isBlob,
  326. isRegExp,
  327. isFunction,
  328. isStream,
  329. isURLSearchParams,
  330. isTypedArray,
  331. isFileList,
  332. forEach,
  333. merge,
  334. extend,
  335. trim,
  336. stripBOM,
  337. inherits,
  338. toFlatObject,
  339. kindOf,
  340. kindOfTest,
  341. endsWith,
  342. toArray,
  343. forEachEntry,
  344. matchAll,
  345. isHTMLForm,
  346. hasOwnProperty,
  347. hasOwnProp: hasOwnProperty,
  348. reduceDescriptors,
  349. freezeMethods,
  350. toObjectSet,
  351. toCamelCase,
  352. noop,
  353. toFiniteNumber,
  354. findKey,
  355. global: _global,
  356. isContextDefined,
  357. ALPHABET,
  358. generateString,
  359. isSpecCompliantForm,
  360. toJSONObject,
  361. isAsyncFn,
  362. isThenable
  363. };
  364. // node_modules/axios/lib/core/AxiosError.js
  365. function AxiosError(message, code, config, request, response) {
  366. Error.call(this);
  367. if (Error.captureStackTrace) {
  368. Error.captureStackTrace(this, this.constructor);
  369. } else {
  370. this.stack = new Error().stack;
  371. }
  372. this.message = message;
  373. this.name = "AxiosError";
  374. code && (this.code = code);
  375. config && (this.config = config);
  376. request && (this.request = request);
  377. response && (this.response = response);
  378. }
  379. utils_default.inherits(AxiosError, Error, {
  380. toJSON: function toJSON() {
  381. return {
  382. message: this.message,
  383. name: this.name,
  384. description: this.description,
  385. number: this.number,
  386. fileName: this.fileName,
  387. lineNumber: this.lineNumber,
  388. columnNumber: this.columnNumber,
  389. stack: this.stack,
  390. config: utils_default.toJSONObject(this.config),
  391. code: this.code,
  392. status: this.response && this.response.status ? this.response.status : null
  393. };
  394. }
  395. });
  396. var prototype = AxiosError.prototype;
  397. var descriptors = {};
  398. [
  399. "ERR_BAD_OPTION_VALUE",
  400. "ERR_BAD_OPTION",
  401. "ECONNABORTED",
  402. "ETIMEDOUT",
  403. "ERR_NETWORK",
  404. "ERR_FR_TOO_MANY_REDIRECTS",
  405. "ERR_DEPRECATED",
  406. "ERR_BAD_RESPONSE",
  407. "ERR_BAD_REQUEST",
  408. "ERR_CANCELED",
  409. "ERR_NOT_SUPPORT",
  410. "ERR_INVALID_URL"
  411. ].forEach((code) => {
  412. descriptors[code] = { value: code };
  413. });
  414. Object.defineProperties(AxiosError, descriptors);
  415. Object.defineProperty(prototype, "isAxiosError", { value: true });
  416. AxiosError.from = (error, code, config, request, response, customProps) => {
  417. const axiosError = Object.create(prototype);
  418. utils_default.toFlatObject(error, axiosError, function filter2(obj) {
  419. return obj !== Error.prototype;
  420. }, (prop) => {
  421. return prop !== "isAxiosError";
  422. });
  423. AxiosError.call(axiosError, error.message, code, config, request, response);
  424. axiosError.cause = error;
  425. axiosError.name = error.name;
  426. customProps && Object.assign(axiosError, customProps);
  427. return axiosError;
  428. };
  429. var AxiosError_default = AxiosError;
  430. // node_modules/axios/lib/helpers/null.js
  431. var null_default = null;
  432. // node_modules/axios/lib/helpers/toFormData.js
  433. function isVisitable(thing) {
  434. return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
  435. }
  436. function removeBrackets(key) {
  437. return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
  438. }
  439. function renderKey(path, key, dots) {
  440. if (!path)
  441. return key;
  442. return path.concat(key).map(function each(token, i) {
  443. token = removeBrackets(token);
  444. return !dots && i ? "[" + token + "]" : token;
  445. }).join(dots ? "." : "");
  446. }
  447. function isFlatArray(arr) {
  448. return utils_default.isArray(arr) && !arr.some(isVisitable);
  449. }
  450. var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) {
  451. return /^is[A-Z]/.test(prop);
  452. });
  453. function toFormData(obj, formData, options) {
  454. if (!utils_default.isObject(obj)) {
  455. throw new TypeError("target must be an object");
  456. }
  457. formData = formData || new (null_default || FormData)();
  458. options = utils_default.toFlatObject(options, {
  459. metaTokens: true,
  460. dots: false,
  461. indexes: false
  462. }, false, function defined(option, source) {
  463. return !utils_default.isUndefined(source[option]);
  464. });
  465. const metaTokens = options.metaTokens;
  466. const visitor = options.visitor || defaultVisitor;
  467. const dots = options.dots;
  468. const indexes = options.indexes;
  469. const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
  470. const useBlob = _Blob && utils_default.isSpecCompliantForm(formData);
  471. if (!utils_default.isFunction(visitor)) {
  472. throw new TypeError("visitor must be a function");
  473. }
  474. function convertValue(value) {
  475. if (value === null)
  476. return "";
  477. if (utils_default.isDate(value)) {
  478. return value.toISOString();
  479. }
  480. if (!useBlob && utils_default.isBlob(value)) {
  481. throw new AxiosError_default("Blob is not supported. Use a Buffer instead.");
  482. }
  483. if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) {
  484. return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
  485. }
  486. return value;
  487. }
  488. function defaultVisitor(value, key, path) {
  489. let arr = value;
  490. if (value && !path && typeof value === "object") {
  491. if (utils_default.endsWith(key, "{}")) {
  492. key = metaTokens ? key : key.slice(0, -2);
  493. value = JSON.stringify(value);
  494. } else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) {
  495. key = removeBrackets(key);
  496. arr.forEach(function each(el, index) {
  497. !(utils_default.isUndefined(el) || el === null) && formData.append(
  498. indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
  499. convertValue(el)
  500. );
  501. });
  502. return false;
  503. }
  504. }
  505. if (isVisitable(value)) {
  506. return true;
  507. }
  508. formData.append(renderKey(path, key, dots), convertValue(value));
  509. return false;
  510. }
  511. const stack = [];
  512. const exposedHelpers = Object.assign(predicates, {
  513. defaultVisitor,
  514. convertValue,
  515. isVisitable
  516. });
  517. function build(value, path) {
  518. if (utils_default.isUndefined(value))
  519. return;
  520. if (stack.indexOf(value) !== -1) {
  521. throw Error("Circular reference detected in " + path.join("."));
  522. }
  523. stack.push(value);
  524. utils_default.forEach(value, function each(el, key) {
  525. const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(
  526. formData,
  527. el,
  528. utils_default.isString(key) ? key.trim() : key,
  529. path,
  530. exposedHelpers
  531. );
  532. if (result === true) {
  533. build(el, path ? path.concat(key) : [key]);
  534. }
  535. });
  536. stack.pop();
  537. }
  538. if (!utils_default.isObject(obj)) {
  539. throw new TypeError("data must be an object");
  540. }
  541. build(obj);
  542. return formData;
  543. }
  544. var toFormData_default = toFormData;
  545. // node_modules/axios/lib/helpers/AxiosURLSearchParams.js
  546. function encode(str) {
  547. const charMap = {
  548. "!": "%21",
  549. "'": "%27",
  550. "(": "%28",
  551. ")": "%29",
  552. "~": "%7E",
  553. "%20": "+",
  554. "%00": "\0"
  555. };
  556. return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
  557. return charMap[match];
  558. });
  559. }
  560. function AxiosURLSearchParams(params, options) {
  561. this._pairs = [];
  562. params && toFormData_default(params, this, options);
  563. }
  564. var prototype2 = AxiosURLSearchParams.prototype;
  565. prototype2.append = function append(name, value) {
  566. this._pairs.push([name, value]);
  567. };
  568. prototype2.toString = function toString2(encoder) {
  569. const _encode = encoder ? function(value) {
  570. return encoder.call(this, value, encode);
  571. } : encode;
  572. return this._pairs.map(function each(pair) {
  573. return _encode(pair[0]) + "=" + _encode(pair[1]);
  574. }, "").join("&");
  575. };
  576. var AxiosURLSearchParams_default = AxiosURLSearchParams;
  577. // node_modules/axios/lib/helpers/buildURL.js
  578. function encode2(val) {
  579. return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
  580. }
  581. function buildURL(url, params, options) {
  582. if (!params) {
  583. return url;
  584. }
  585. const _encode = options && options.encode || encode2;
  586. const serializeFn = options && options.serialize;
  587. let serializedParams;
  588. if (serializeFn) {
  589. serializedParams = serializeFn(params, options);
  590. } else {
  591. serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, options).toString(_encode);
  592. }
  593. if (serializedParams) {
  594. const hashmarkIndex = url.indexOf("#");
  595. if (hashmarkIndex !== -1) {
  596. url = url.slice(0, hashmarkIndex);
  597. }
  598. url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
  599. }
  600. return url;
  601. }
  602. // node_modules/axios/lib/core/InterceptorManager.js
  603. var InterceptorManager = class {
  604. constructor() {
  605. this.handlers = [];
  606. }
  607. use(fulfilled, rejected, options) {
  608. this.handlers.push({
  609. fulfilled,
  610. rejected,
  611. synchronous: options ? options.synchronous : false,
  612. runWhen: options ? options.runWhen : null
  613. });
  614. return this.handlers.length - 1;
  615. }
  616. eject(id) {
  617. if (this.handlers[id]) {
  618. this.handlers[id] = null;
  619. }
  620. }
  621. clear() {
  622. if (this.handlers) {
  623. this.handlers = [];
  624. }
  625. }
  626. forEach(fn) {
  627. utils_default.forEach(this.handlers, function forEachHandler(h) {
  628. if (h !== null) {
  629. fn(h);
  630. }
  631. });
  632. }
  633. };
  634. var InterceptorManager_default = InterceptorManager;
  635. // node_modules/axios/lib/defaults/transitional.js
  636. var transitional_default = {
  637. silentJSONParsing: true,
  638. forcedJSONParsing: true,
  639. clarifyTimeoutError: false
  640. };
  641. // node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
  642. var URLSearchParams_default = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams_default;
  643. // node_modules/axios/lib/platform/browser/classes/FormData.js
  644. var FormData_default = typeof FormData !== "undefined" ? FormData : null;
  645. // node_modules/axios/lib/platform/browser/classes/Blob.js
  646. var Blob_default = typeof Blob !== "undefined" ? Blob : null;
  647. // node_modules/axios/lib/platform/browser/index.js
  648. var isStandardBrowserEnv = (() => {
  649. let product;
  650. if (typeof navigator !== "undefined" && ((product = navigator.product) === "ReactNative" || product === "NativeScript" || product === "NS")) {
  651. return false;
  652. }
  653. return typeof window !== "undefined" && typeof document !== "undefined";
  654. })();
  655. var isStandardBrowserWebWorkerEnv = (() => {
  656. return typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
  657. })();
  658. var browser_default = {
  659. isBrowser: true,
  660. classes: {
  661. URLSearchParams: URLSearchParams_default,
  662. FormData: FormData_default,
  663. Blob: Blob_default
  664. },
  665. isStandardBrowserEnv,
  666. isStandardBrowserWebWorkerEnv,
  667. protocols: ["http", "https", "file", "blob", "url", "data"]
  668. };
  669. // node_modules/axios/lib/helpers/toURLEncodedForm.js
  670. function toURLEncodedForm(data, options) {
  671. return toFormData_default(data, new browser_default.classes.URLSearchParams(), Object.assign({
  672. visitor: function(value, key, path, helpers) {
  673. if (browser_default.isNode && utils_default.isBuffer(value)) {
  674. this.append(key, value.toString("base64"));
  675. return false;
  676. }
  677. return helpers.defaultVisitor.apply(this, arguments);
  678. }
  679. }, options));
  680. }
  681. // node_modules/axios/lib/helpers/formDataToJSON.js
  682. function parsePropPath(name) {
  683. return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
  684. return match[0] === "[]" ? "" : match[1] || match[0];
  685. });
  686. }
  687. function arrayToObject(arr) {
  688. const obj = {};
  689. const keys = Object.keys(arr);
  690. let i;
  691. const len = keys.length;
  692. let key;
  693. for (i = 0; i < len; i++) {
  694. key = keys[i];
  695. obj[key] = arr[key];
  696. }
  697. return obj;
  698. }
  699. function formDataToJSON(formData) {
  700. function buildPath(path, value, target, index) {
  701. let name = path[index++];
  702. const isNumericKey = Number.isFinite(+name);
  703. const isLast = index >= path.length;
  704. name = !name && utils_default.isArray(target) ? target.length : name;
  705. if (isLast) {
  706. if (utils_default.hasOwnProp(target, name)) {
  707. target[name] = [target[name], value];
  708. } else {
  709. target[name] = value;
  710. }
  711. return !isNumericKey;
  712. }
  713. if (!target[name] || !utils_default.isObject(target[name])) {
  714. target[name] = [];
  715. }
  716. const result = buildPath(path, value, target[name], index);
  717. if (result && utils_default.isArray(target[name])) {
  718. target[name] = arrayToObject(target[name]);
  719. }
  720. return !isNumericKey;
  721. }
  722. if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) {
  723. const obj = {};
  724. utils_default.forEachEntry(formData, (name, value) => {
  725. buildPath(parsePropPath(name), value, obj, 0);
  726. });
  727. return obj;
  728. }
  729. return null;
  730. }
  731. var formDataToJSON_default = formDataToJSON;
  732. // node_modules/axios/lib/defaults/index.js
  733. function stringifySafely(rawValue, parser, encoder) {
  734. if (utils_default.isString(rawValue)) {
  735. try {
  736. (parser || JSON.parse)(rawValue);
  737. return utils_default.trim(rawValue);
  738. } catch (e) {
  739. if (e.name !== "SyntaxError") {
  740. throw e;
  741. }
  742. }
  743. }
  744. return (encoder || JSON.stringify)(rawValue);
  745. }
  746. var defaults = {
  747. transitional: transitional_default,
  748. adapter: browser_default.isNode ? "http" : "xhr",
  749. transformRequest: [function transformRequest(data, headers) {
  750. const contentType = headers.getContentType() || "";
  751. const hasJSONContentType = contentType.indexOf("application/json") > -1;
  752. const isObjectPayload = utils_default.isObject(data);
  753. if (isObjectPayload && utils_default.isHTMLForm(data)) {
  754. data = new FormData(data);
  755. }
  756. const isFormData2 = utils_default.isFormData(data);
  757. if (isFormData2) {
  758. if (!hasJSONContentType) {
  759. return data;
  760. }
  761. return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
  762. }
  763. if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data)) {
  764. return data;
  765. }
  766. if (utils_default.isArrayBufferView(data)) {
  767. return data.buffer;
  768. }
  769. if (utils_default.isURLSearchParams(data)) {
  770. headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
  771. return data.toString();
  772. }
  773. let isFileList2;
  774. if (isObjectPayload) {
  775. if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
  776. return toURLEncodedForm(data, this.formSerializer).toString();
  777. }
  778. if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
  779. const _FormData = this.env && this.env.FormData;
  780. return toFormData_default(
  781. isFileList2 ? { "files[]": data } : data,
  782. _FormData && new _FormData(),
  783. this.formSerializer
  784. );
  785. }
  786. }
  787. if (isObjectPayload || hasJSONContentType) {
  788. headers.setContentType("application/json", false);
  789. return stringifySafely(data);
  790. }
  791. return data;
  792. }],
  793. transformResponse: [function transformResponse(data) {
  794. const transitional2 = this.transitional || defaults.transitional;
  795. const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
  796. const JSONRequested = this.responseType === "json";
  797. if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
  798. const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
  799. const strictJSONParsing = !silentJSONParsing && JSONRequested;
  800. try {
  801. return JSON.parse(data);
  802. } catch (e) {
  803. if (strictJSONParsing) {
  804. if (e.name === "SyntaxError") {
  805. throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, this.response);
  806. }
  807. throw e;
  808. }
  809. }
  810. }
  811. return data;
  812. }],
  813. timeout: 0,
  814. xsrfCookieName: "XSRF-TOKEN",
  815. xsrfHeaderName: "X-XSRF-TOKEN",
  816. maxContentLength: -1,
  817. maxBodyLength: -1,
  818. env: {
  819. FormData: browser_default.classes.FormData,
  820. Blob: browser_default.classes.Blob
  821. },
  822. validateStatus: function validateStatus(status) {
  823. return status >= 200 && status < 300;
  824. },
  825. headers: {
  826. common: {
  827. "Accept": "application/json, text/plain, */*",
  828. "Content-Type": void 0
  829. }
  830. }
  831. };
  832. utils_default.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
  833. defaults.headers[method] = {};
  834. });
  835. var defaults_default = defaults;
  836. // node_modules/axios/lib/helpers/parseHeaders.js
  837. var ignoreDuplicateOf = utils_default.toObjectSet([
  838. "age",
  839. "authorization",
  840. "content-length",
  841. "content-type",
  842. "etag",
  843. "expires",
  844. "from",
  845. "host",
  846. "if-modified-since",
  847. "if-unmodified-since",
  848. "last-modified",
  849. "location",
  850. "max-forwards",
  851. "proxy-authorization",
  852. "referer",
  853. "retry-after",
  854. "user-agent"
  855. ]);
  856. var parseHeaders_default = (rawHeaders) => {
  857. const parsed = {};
  858. let key;
  859. let val;
  860. let i;
  861. rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
  862. i = line.indexOf(":");
  863. key = line.substring(0, i).trim().toLowerCase();
  864. val = line.substring(i + 1).trim();
  865. if (!key || parsed[key] && ignoreDuplicateOf[key]) {
  866. return;
  867. }
  868. if (key === "set-cookie") {
  869. if (parsed[key]) {
  870. parsed[key].push(val);
  871. } else {
  872. parsed[key] = [val];
  873. }
  874. } else {
  875. parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
  876. }
  877. });
  878. return parsed;
  879. };
  880. // node_modules/axios/lib/core/AxiosHeaders.js
  881. var $internals = Symbol("internals");
  882. function normalizeHeader(header) {
  883. return header && String(header).trim().toLowerCase();
  884. }
  885. function normalizeValue(value) {
  886. if (value === false || value == null) {
  887. return value;
  888. }
  889. return utils_default.isArray(value) ? value.map(normalizeValue) : String(value);
  890. }
  891. function parseTokens(str) {
  892. const tokens = /* @__PURE__ */ Object.create(null);
  893. const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
  894. let match;
  895. while (match = tokensRE.exec(str)) {
  896. tokens[match[1]] = match[2];
  897. }
  898. return tokens;
  899. }
  900. var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
  901. function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
  902. if (utils_default.isFunction(filter2)) {
  903. return filter2.call(this, value, header);
  904. }
  905. if (isHeaderNameFilter) {
  906. value = header;
  907. }
  908. if (!utils_default.isString(value))
  909. return;
  910. if (utils_default.isString(filter2)) {
  911. return value.indexOf(filter2) !== -1;
  912. }
  913. if (utils_default.isRegExp(filter2)) {
  914. return filter2.test(value);
  915. }
  916. }
  917. function formatHeader(header) {
  918. return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
  919. return char.toUpperCase() + str;
  920. });
  921. }
  922. function buildAccessors(obj, header) {
  923. const accessorName = utils_default.toCamelCase(" " + header);
  924. ["get", "set", "has"].forEach((methodName) => {
  925. Object.defineProperty(obj, methodName + accessorName, {
  926. value: function(arg1, arg2, arg3) {
  927. return this[methodName].call(this, header, arg1, arg2, arg3);
  928. },
  929. configurable: true
  930. });
  931. });
  932. }
  933. var AxiosHeaders = class {
  934. constructor(headers) {
  935. headers && this.set(headers);
  936. }
  937. set(header, valueOrRewrite, rewrite) {
  938. const self2 = this;
  939. function setHeader(_value, _header, _rewrite) {
  940. const lHeader = normalizeHeader(_header);
  941. if (!lHeader) {
  942. throw new Error("header name must be a non-empty string");
  943. }
  944. const key = utils_default.findKey(self2, lHeader);
  945. if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
  946. self2[key || _header] = normalizeValue(_value);
  947. }
  948. }
  949. const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
  950. if (utils_default.isPlainObject(header) || header instanceof this.constructor) {
  951. setHeaders(header, valueOrRewrite);
  952. } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
  953. setHeaders(parseHeaders_default(header), valueOrRewrite);
  954. } else {
  955. header != null && setHeader(valueOrRewrite, header, rewrite);
  956. }
  957. return this;
  958. }
  959. get(header, parser) {
  960. header = normalizeHeader(header);
  961. if (header) {
  962. const key = utils_default.findKey(this, header);
  963. if (key) {
  964. const value = this[key];
  965. if (!parser) {
  966. return value;
  967. }
  968. if (parser === true) {
  969. return parseTokens(value);
  970. }
  971. if (utils_default.isFunction(parser)) {
  972. return parser.call(this, value, key);
  973. }
  974. if (utils_default.isRegExp(parser)) {
  975. return parser.exec(value);
  976. }
  977. throw new TypeError("parser must be boolean|regexp|function");
  978. }
  979. }
  980. }
  981. has(header, matcher) {
  982. header = normalizeHeader(header);
  983. if (header) {
  984. const key = utils_default.findKey(this, header);
  985. return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
  986. }
  987. return false;
  988. }
  989. delete(header, matcher) {
  990. const self2 = this;
  991. let deleted = false;
  992. function deleteHeader(_header) {
  993. _header = normalizeHeader(_header);
  994. if (_header) {
  995. const key = utils_default.findKey(self2, _header);
  996. if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
  997. delete self2[key];
  998. deleted = true;
  999. }
  1000. }
  1001. }
  1002. if (utils_default.isArray(header)) {
  1003. header.forEach(deleteHeader);
  1004. } else {
  1005. deleteHeader(header);
  1006. }
  1007. return deleted;
  1008. }
  1009. clear(matcher) {
  1010. const keys = Object.keys(this);
  1011. let i = keys.length;
  1012. let deleted = false;
  1013. while (i--) {
  1014. const key = keys[i];
  1015. if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
  1016. delete this[key];
  1017. deleted = true;
  1018. }
  1019. }
  1020. return deleted;
  1021. }
  1022. normalize(format) {
  1023. const self2 = this;
  1024. const headers = {};
  1025. utils_default.forEach(this, (value, header) => {
  1026. const key = utils_default.findKey(headers, header);
  1027. if (key) {
  1028. self2[key] = normalizeValue(value);
  1029. delete self2[header];
  1030. return;
  1031. }
  1032. const normalized = format ? formatHeader(header) : String(header).trim();
  1033. if (normalized !== header) {
  1034. delete self2[header];
  1035. }
  1036. self2[normalized] = normalizeValue(value);
  1037. headers[normalized] = true;
  1038. });
  1039. return this;
  1040. }
  1041. concat(...targets) {
  1042. return this.constructor.concat(this, ...targets);
  1043. }
  1044. toJSON(asStrings) {
  1045. const obj = /* @__PURE__ */ Object.create(null);
  1046. utils_default.forEach(this, (value, header) => {
  1047. value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value);
  1048. });
  1049. return obj;
  1050. }
  1051. [Symbol.iterator]() {
  1052. return Object.entries(this.toJSON())[Symbol.iterator]();
  1053. }
  1054. toString() {
  1055. return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
  1056. }
  1057. get [Symbol.toStringTag]() {
  1058. return "AxiosHeaders";
  1059. }
  1060. static from(thing) {
  1061. return thing instanceof this ? thing : new this(thing);
  1062. }
  1063. static concat(first, ...targets) {
  1064. const computed = new this(first);
  1065. targets.forEach((target) => computed.set(target));
  1066. return computed;
  1067. }
  1068. static accessor(header) {
  1069. const internals = this[$internals] = this[$internals] = {
  1070. accessors: {}
  1071. };
  1072. const accessors = internals.accessors;
  1073. const prototype3 = this.prototype;
  1074. function defineAccessor(_header) {
  1075. const lHeader = normalizeHeader(_header);
  1076. if (!accessors[lHeader]) {
  1077. buildAccessors(prototype3, _header);
  1078. accessors[lHeader] = true;
  1079. }
  1080. }
  1081. utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
  1082. return this;
  1083. }
  1084. };
  1085. AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
  1086. utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
  1087. let mapped = key[0].toUpperCase() + key.slice(1);
  1088. return {
  1089. get: () => value,
  1090. set(headerValue) {
  1091. this[mapped] = headerValue;
  1092. }
  1093. };
  1094. });
  1095. utils_default.freezeMethods(AxiosHeaders);
  1096. var AxiosHeaders_default = AxiosHeaders;
  1097. // node_modules/axios/lib/core/transformData.js
  1098. function transformData(fns, response) {
  1099. const config = this || defaults_default;
  1100. const context = response || config;
  1101. const headers = AxiosHeaders_default.from(context.headers);
  1102. let data = context.data;
  1103. utils_default.forEach(fns, function transform(fn) {
  1104. data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
  1105. });
  1106. headers.normalize();
  1107. return data;
  1108. }
  1109. // node_modules/axios/lib/cancel/isCancel.js
  1110. function isCancel(value) {
  1111. return !!(value && value.__CANCEL__);
  1112. }
  1113. // node_modules/axios/lib/cancel/CanceledError.js
  1114. function CanceledError(message, config, request) {
  1115. AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
  1116. this.name = "CanceledError";
  1117. }
  1118. utils_default.inherits(CanceledError, AxiosError_default, {
  1119. __CANCEL__: true
  1120. });
  1121. var CanceledError_default = CanceledError;
  1122. // node_modules/axios/lib/core/settle.js
  1123. function settle(resolve, reject, response) {
  1124. const validateStatus2 = response.config.validateStatus;
  1125. if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
  1126. resolve(response);
  1127. } else {
  1128. reject(new AxiosError_default(
  1129. "Request failed with status code " + response.status,
  1130. [AxiosError_default.ERR_BAD_REQUEST, AxiosError_default.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
  1131. response.config,
  1132. response.request,
  1133. response
  1134. ));
  1135. }
  1136. }
  1137. // node_modules/axios/lib/helpers/cookies.js
  1138. var cookies_default = browser_default.isStandardBrowserEnv ? function standardBrowserEnv() {
  1139. return {
  1140. write: function write(name, value, expires, path, domain, secure) {
  1141. const cookie = [];
  1142. cookie.push(name + "=" + encodeURIComponent(value));
  1143. if (utils_default.isNumber(expires)) {
  1144. cookie.push("expires=" + new Date(expires).toGMTString());
  1145. }
  1146. if (utils_default.isString(path)) {
  1147. cookie.push("path=" + path);
  1148. }
  1149. if (utils_default.isString(domain)) {
  1150. cookie.push("domain=" + domain);
  1151. }
  1152. if (secure === true) {
  1153. cookie.push("secure");
  1154. }
  1155. document.cookie = cookie.join("; ");
  1156. },
  1157. read: function read(name) {
  1158. const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
  1159. return match ? decodeURIComponent(match[3]) : null;
  1160. },
  1161. remove: function remove(name) {
  1162. this.write(name, "", Date.now() - 864e5);
  1163. }
  1164. };
  1165. }() : function nonStandardBrowserEnv() {
  1166. return {
  1167. write: function write() {
  1168. },
  1169. read: function read() {
  1170. return null;
  1171. },
  1172. remove: function remove() {
  1173. }
  1174. };
  1175. }();
  1176. // node_modules/axios/lib/helpers/isAbsoluteURL.js
  1177. function isAbsoluteURL(url) {
  1178. return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
  1179. }
  1180. // node_modules/axios/lib/helpers/combineURLs.js
  1181. function combineURLs(baseURL, relativeURL) {
  1182. return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
  1183. }
  1184. // node_modules/axios/lib/core/buildFullPath.js
  1185. function buildFullPath(baseURL, requestedURL) {
  1186. if (baseURL && !isAbsoluteURL(requestedURL)) {
  1187. return combineURLs(baseURL, requestedURL);
  1188. }
  1189. return requestedURL;
  1190. }
  1191. // node_modules/axios/lib/helpers/isURLSameOrigin.js
  1192. var isURLSameOrigin_default = browser_default.isStandardBrowserEnv ? function standardBrowserEnv2() {
  1193. const msie = /(msie|trident)/i.test(navigator.userAgent);
  1194. const urlParsingNode = document.createElement("a");
  1195. let originURL;
  1196. function resolveURL(url) {
  1197. let href = url;
  1198. if (msie) {
  1199. urlParsingNode.setAttribute("href", href);
  1200. href = urlParsingNode.href;
  1201. }
  1202. urlParsingNode.setAttribute("href", href);
  1203. return {
  1204. href: urlParsingNode.href,
  1205. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
  1206. host: urlParsingNode.host,
  1207. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
  1208. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
  1209. hostname: urlParsingNode.hostname,
  1210. port: urlParsingNode.port,
  1211. pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
  1212. };
  1213. }
  1214. originURL = resolveURL(window.location.href);
  1215. return function isURLSameOrigin(requestURL) {
  1216. const parsed = utils_default.isString(requestURL) ? resolveURL(requestURL) : requestURL;
  1217. return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
  1218. };
  1219. }() : function nonStandardBrowserEnv2() {
  1220. return function isURLSameOrigin() {
  1221. return true;
  1222. };
  1223. }();
  1224. // node_modules/axios/lib/helpers/parseProtocol.js
  1225. function parseProtocol(url) {
  1226. const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
  1227. return match && match[1] || "";
  1228. }
  1229. // node_modules/axios/lib/helpers/speedometer.js
  1230. function speedometer(samplesCount, min) {
  1231. samplesCount = samplesCount || 10;
  1232. const bytes = new Array(samplesCount);
  1233. const timestamps = new Array(samplesCount);
  1234. let head = 0;
  1235. let tail = 0;
  1236. let firstSampleTS;
  1237. min = min !== void 0 ? min : 1e3;
  1238. return function push(chunkLength) {
  1239. const now = Date.now();
  1240. const startedAt = timestamps[tail];
  1241. if (!firstSampleTS) {
  1242. firstSampleTS = now;
  1243. }
  1244. bytes[head] = chunkLength;
  1245. timestamps[head] = now;
  1246. let i = tail;
  1247. let bytesCount = 0;
  1248. while (i !== head) {
  1249. bytesCount += bytes[i++];
  1250. i = i % samplesCount;
  1251. }
  1252. head = (head + 1) % samplesCount;
  1253. if (head === tail) {
  1254. tail = (tail + 1) % samplesCount;
  1255. }
  1256. if (now - firstSampleTS < min) {
  1257. return;
  1258. }
  1259. const passed = startedAt && now - startedAt;
  1260. return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
  1261. };
  1262. }
  1263. var speedometer_default = speedometer;
  1264. // node_modules/axios/lib/adapters/xhr.js
  1265. function progressEventReducer(listener, isDownloadStream) {
  1266. let bytesNotified = 0;
  1267. const _speedometer = speedometer_default(50, 250);
  1268. return (e) => {
  1269. const loaded = e.loaded;
  1270. const total = e.lengthComputable ? e.total : void 0;
  1271. const progressBytes = loaded - bytesNotified;
  1272. const rate = _speedometer(progressBytes);
  1273. const inRange = loaded <= total;
  1274. bytesNotified = loaded;
  1275. const data = {
  1276. loaded,
  1277. total,
  1278. progress: total ? loaded / total : void 0,
  1279. bytes: progressBytes,
  1280. rate: rate ? rate : void 0,
  1281. estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
  1282. event: e
  1283. };
  1284. data[isDownloadStream ? "download" : "upload"] = true;
  1285. listener(data);
  1286. };
  1287. }
  1288. var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
  1289. var xhr_default = isXHRAdapterSupported && function(config) {
  1290. return new Promise(function dispatchXhrRequest(resolve, reject) {
  1291. let requestData = config.data;
  1292. const requestHeaders = AxiosHeaders_default.from(config.headers).normalize();
  1293. const responseType = config.responseType;
  1294. let onCanceled;
  1295. function done() {
  1296. if (config.cancelToken) {
  1297. config.cancelToken.unsubscribe(onCanceled);
  1298. }
  1299. if (config.signal) {
  1300. config.signal.removeEventListener("abort", onCanceled);
  1301. }
  1302. }
  1303. if (utils_default.isFormData(requestData)) {
  1304. if (browser_default.isStandardBrowserEnv || browser_default.isStandardBrowserWebWorkerEnv) {
  1305. requestHeaders.setContentType(false);
  1306. } else {
  1307. requestHeaders.setContentType("multipart/form-data;", false);
  1308. }
  1309. }
  1310. let request = new XMLHttpRequest();
  1311. if (config.auth) {
  1312. const username = config.auth.username || "";
  1313. const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
  1314. requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
  1315. }
  1316. const fullPath = buildFullPath(config.baseURL, config.url);
  1317. request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
  1318. request.timeout = config.timeout;
  1319. function onloadend() {
  1320. if (!request) {
  1321. return;
  1322. }
  1323. const responseHeaders = AxiosHeaders_default.from(
  1324. "getAllResponseHeaders" in request && request.getAllResponseHeaders()
  1325. );
  1326. const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
  1327. const response = {
  1328. data: responseData,
  1329. status: request.status,
  1330. statusText: request.statusText,
  1331. headers: responseHeaders,
  1332. config,
  1333. request
  1334. };
  1335. settle(function _resolve(value) {
  1336. resolve(value);
  1337. done();
  1338. }, function _reject(err) {
  1339. reject(err);
  1340. done();
  1341. }, response);
  1342. request = null;
  1343. }
  1344. if ("onloadend" in request) {
  1345. request.onloadend = onloadend;
  1346. } else {
  1347. request.onreadystatechange = function handleLoad() {
  1348. if (!request || request.readyState !== 4) {
  1349. return;
  1350. }
  1351. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
  1352. return;
  1353. }
  1354. setTimeout(onloadend);
  1355. };
  1356. }
  1357. request.onabort = function handleAbort() {
  1358. if (!request) {
  1359. return;
  1360. }
  1361. reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request));
  1362. request = null;
  1363. };
  1364. request.onerror = function handleError() {
  1365. reject(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request));
  1366. request = null;
  1367. };
  1368. request.ontimeout = function handleTimeout() {
  1369. let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
  1370. const transitional2 = config.transitional || transitional_default;
  1371. if (config.timeoutErrorMessage) {
  1372. timeoutErrorMessage = config.timeoutErrorMessage;
  1373. }
  1374. reject(new AxiosError_default(
  1375. timeoutErrorMessage,
  1376. transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
  1377. config,
  1378. request
  1379. ));
  1380. request = null;
  1381. };
  1382. if (browser_default.isStandardBrowserEnv) {
  1383. const xsrfValue = (config.withCredentials || isURLSameOrigin_default(fullPath)) && config.xsrfCookieName && cookies_default.read(config.xsrfCookieName);
  1384. if (xsrfValue) {
  1385. requestHeaders.set(config.xsrfHeaderName, xsrfValue);
  1386. }
  1387. }
  1388. requestData === void 0 && requestHeaders.setContentType(null);
  1389. if ("setRequestHeader" in request) {
  1390. utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
  1391. request.setRequestHeader(key, val);
  1392. });
  1393. }
  1394. if (!utils_default.isUndefined(config.withCredentials)) {
  1395. request.withCredentials = !!config.withCredentials;
  1396. }
  1397. if (responseType && responseType !== "json") {
  1398. request.responseType = config.responseType;
  1399. }
  1400. if (typeof config.onDownloadProgress === "function") {
  1401. request.addEventListener("progress", progressEventReducer(config.onDownloadProgress, true));
  1402. }
  1403. if (typeof config.onUploadProgress === "function" && request.upload) {
  1404. request.upload.addEventListener("progress", progressEventReducer(config.onUploadProgress));
  1405. }
  1406. if (config.cancelToken || config.signal) {
  1407. onCanceled = (cancel) => {
  1408. if (!request) {
  1409. return;
  1410. }
  1411. reject(!cancel || cancel.type ? new CanceledError_default(null, config, request) : cancel);
  1412. request.abort();
  1413. request = null;
  1414. };
  1415. config.cancelToken && config.cancelToken.subscribe(onCanceled);
  1416. if (config.signal) {
  1417. config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled);
  1418. }
  1419. }
  1420. const protocol = parseProtocol(fullPath);
  1421. if (protocol && browser_default.protocols.indexOf(protocol) === -1) {
  1422. reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
  1423. return;
  1424. }
  1425. request.send(requestData || null);
  1426. });
  1427. };
  1428. // node_modules/axios/lib/adapters/adapters.js
  1429. var knownAdapters = {
  1430. http: null_default,
  1431. xhr: xhr_default
  1432. };
  1433. utils_default.forEach(knownAdapters, (fn, value) => {
  1434. if (fn) {
  1435. try {
  1436. Object.defineProperty(fn, "name", { value });
  1437. } catch (e) {
  1438. }
  1439. Object.defineProperty(fn, "adapterName", { value });
  1440. }
  1441. });
  1442. var adapters_default = {
  1443. getAdapter: (adapters) => {
  1444. adapters = utils_default.isArray(adapters) ? adapters : [adapters];
  1445. const { length } = adapters;
  1446. let nameOrAdapter;
  1447. let adapter;
  1448. for (let i = 0; i < length; i++) {
  1449. nameOrAdapter = adapters[i];
  1450. if (adapter = utils_default.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter) {
  1451. break;
  1452. }
  1453. }
  1454. if (!adapter) {
  1455. if (adapter === false) {
  1456. throw new AxiosError_default(
  1457. `Adapter ${nameOrAdapter} is not supported by the environment`,
  1458. "ERR_NOT_SUPPORT"
  1459. );
  1460. }
  1461. throw new Error(
  1462. utils_default.hasOwnProp(knownAdapters, nameOrAdapter) ? `Adapter '${nameOrAdapter}' is not available in the build` : `Unknown adapter '${nameOrAdapter}'`
  1463. );
  1464. }
  1465. if (!utils_default.isFunction(adapter)) {
  1466. throw new TypeError("adapter is not a function");
  1467. }
  1468. return adapter;
  1469. },
  1470. adapters: knownAdapters
  1471. };
  1472. // node_modules/axios/lib/core/dispatchRequest.js
  1473. function throwIfCancellationRequested(config) {
  1474. if (config.cancelToken) {
  1475. config.cancelToken.throwIfRequested();
  1476. }
  1477. if (config.signal && config.signal.aborted) {
  1478. throw new CanceledError_default(null, config);
  1479. }
  1480. }
  1481. function dispatchRequest(config) {
  1482. throwIfCancellationRequested(config);
  1483. config.headers = AxiosHeaders_default.from(config.headers);
  1484. config.data = transformData.call(
  1485. config,
  1486. config.transformRequest
  1487. );
  1488. if (["post", "put", "patch"].indexOf(config.method) !== -1) {
  1489. config.headers.setContentType("application/x-www-form-urlencoded", false);
  1490. }
  1491. const adapter = adapters_default.getAdapter(config.adapter || defaults_default.adapter);
  1492. return adapter(config).then(function onAdapterResolution(response) {
  1493. throwIfCancellationRequested(config);
  1494. response.data = transformData.call(
  1495. config,
  1496. config.transformResponse,
  1497. response
  1498. );
  1499. response.headers = AxiosHeaders_default.from(response.headers);
  1500. return response;
  1501. }, function onAdapterRejection(reason) {
  1502. if (!isCancel(reason)) {
  1503. throwIfCancellationRequested(config);
  1504. if (reason && reason.response) {
  1505. reason.response.data = transformData.call(
  1506. config,
  1507. config.transformResponse,
  1508. reason.response
  1509. );
  1510. reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
  1511. }
  1512. }
  1513. return Promise.reject(reason);
  1514. });
  1515. }
  1516. // node_modules/axios/lib/core/mergeConfig.js
  1517. var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? thing.toJSON() : thing;
  1518. function mergeConfig(config1, config2) {
  1519. config2 = config2 || {};
  1520. const config = {};
  1521. function getMergedValue(target, source, caseless) {
  1522. if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
  1523. return utils_default.merge.call({ caseless }, target, source);
  1524. } else if (utils_default.isPlainObject(source)) {
  1525. return utils_default.merge({}, source);
  1526. } else if (utils_default.isArray(source)) {
  1527. return source.slice();
  1528. }
  1529. return source;
  1530. }
  1531. function mergeDeepProperties(a, b, caseless) {
  1532. if (!utils_default.isUndefined(b)) {
  1533. return getMergedValue(a, b, caseless);
  1534. } else if (!utils_default.isUndefined(a)) {
  1535. return getMergedValue(void 0, a, caseless);
  1536. }
  1537. }
  1538. function valueFromConfig2(a, b) {
  1539. if (!utils_default.isUndefined(b)) {
  1540. return getMergedValue(void 0, b);
  1541. }
  1542. }
  1543. function defaultToConfig2(a, b) {
  1544. if (!utils_default.isUndefined(b)) {
  1545. return getMergedValue(void 0, b);
  1546. } else if (!utils_default.isUndefined(a)) {
  1547. return getMergedValue(void 0, a);
  1548. }
  1549. }
  1550. function mergeDirectKeys(a, b, prop) {
  1551. if (prop in config2) {
  1552. return getMergedValue(a, b);
  1553. } else if (prop in config1) {
  1554. return getMergedValue(void 0, a);
  1555. }
  1556. }
  1557. const mergeMap = {
  1558. url: valueFromConfig2,
  1559. method: valueFromConfig2,
  1560. data: valueFromConfig2,
  1561. baseURL: defaultToConfig2,
  1562. transformRequest: defaultToConfig2,
  1563. transformResponse: defaultToConfig2,
  1564. paramsSerializer: defaultToConfig2,
  1565. timeout: defaultToConfig2,
  1566. timeoutMessage: defaultToConfig2,
  1567. withCredentials: defaultToConfig2,
  1568. adapter: defaultToConfig2,
  1569. responseType: defaultToConfig2,
  1570. xsrfCookieName: defaultToConfig2,
  1571. xsrfHeaderName: defaultToConfig2,
  1572. onUploadProgress: defaultToConfig2,
  1573. onDownloadProgress: defaultToConfig2,
  1574. decompress: defaultToConfig2,
  1575. maxContentLength: defaultToConfig2,
  1576. maxBodyLength: defaultToConfig2,
  1577. beforeRedirect: defaultToConfig2,
  1578. transport: defaultToConfig2,
  1579. httpAgent: defaultToConfig2,
  1580. httpsAgent: defaultToConfig2,
  1581. cancelToken: defaultToConfig2,
  1582. socketPath: defaultToConfig2,
  1583. responseEncoding: defaultToConfig2,
  1584. validateStatus: mergeDirectKeys,
  1585. headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
  1586. };
  1587. utils_default.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
  1588. const merge2 = mergeMap[prop] || mergeDeepProperties;
  1589. const configValue = merge2(config1[prop], config2[prop], prop);
  1590. utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
  1591. });
  1592. return config;
  1593. }
  1594. // node_modules/axios/lib/env/data.js
  1595. var VERSION = "1.5.0";
  1596. // node_modules/axios/lib/helpers/validator.js
  1597. var validators = {};
  1598. ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
  1599. validators[type] = function validator(thing) {
  1600. return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
  1601. };
  1602. });
  1603. var deprecatedWarnings = {};
  1604. validators.transitional = function transitional(validator, version, message) {
  1605. function formatMessage(opt, desc) {
  1606. return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
  1607. }
  1608. return (value, opt, opts) => {
  1609. if (validator === false) {
  1610. throw new AxiosError_default(
  1611. formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
  1612. AxiosError_default.ERR_DEPRECATED
  1613. );
  1614. }
  1615. if (version && !deprecatedWarnings[opt]) {
  1616. deprecatedWarnings[opt] = true;
  1617. console.warn(
  1618. formatMessage(
  1619. opt,
  1620. " has been deprecated since v" + version + " and will be removed in the near future"
  1621. )
  1622. );
  1623. }
  1624. return validator ? validator(value, opt, opts) : true;
  1625. };
  1626. };
  1627. function assertOptions(options, schema, allowUnknown) {
  1628. if (typeof options !== "object") {
  1629. throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
  1630. }
  1631. const keys = Object.keys(options);
  1632. let i = keys.length;
  1633. while (i-- > 0) {
  1634. const opt = keys[i];
  1635. const validator = schema[opt];
  1636. if (validator) {
  1637. const value = options[opt];
  1638. const result = value === void 0 || validator(value, opt, options);
  1639. if (result !== true) {
  1640. throw new AxiosError_default("option " + opt + " must be " + result, AxiosError_default.ERR_BAD_OPTION_VALUE);
  1641. }
  1642. continue;
  1643. }
  1644. if (allowUnknown !== true) {
  1645. throw new AxiosError_default("Unknown option " + opt, AxiosError_default.ERR_BAD_OPTION);
  1646. }
  1647. }
  1648. }
  1649. var validator_default = {
  1650. assertOptions,
  1651. validators
  1652. };
  1653. // node_modules/axios/lib/core/Axios.js
  1654. var validators2 = validator_default.validators;
  1655. var Axios = class {
  1656. constructor(instanceConfig) {
  1657. this.defaults = instanceConfig;
  1658. this.interceptors = {
  1659. request: new InterceptorManager_default(),
  1660. response: new InterceptorManager_default()
  1661. };
  1662. }
  1663. request(configOrUrl, config) {
  1664. if (typeof configOrUrl === "string") {
  1665. config = config || {};
  1666. config.url = configOrUrl;
  1667. } else {
  1668. config = configOrUrl || {};
  1669. }
  1670. config = mergeConfig(this.defaults, config);
  1671. const { transitional: transitional2, paramsSerializer, headers } = config;
  1672. if (transitional2 !== void 0) {
  1673. validator_default.assertOptions(transitional2, {
  1674. silentJSONParsing: validators2.transitional(validators2.boolean),
  1675. forcedJSONParsing: validators2.transitional(validators2.boolean),
  1676. clarifyTimeoutError: validators2.transitional(validators2.boolean)
  1677. }, false);
  1678. }
  1679. if (paramsSerializer != null) {
  1680. if (utils_default.isFunction(paramsSerializer)) {
  1681. config.paramsSerializer = {
  1682. serialize: paramsSerializer
  1683. };
  1684. } else {
  1685. validator_default.assertOptions(paramsSerializer, {
  1686. encode: validators2.function,
  1687. serialize: validators2.function
  1688. }, true);
  1689. }
  1690. }
  1691. config.method = (config.method || this.defaults.method || "get").toLowerCase();
  1692. let contextHeaders = headers && utils_default.merge(
  1693. headers.common,
  1694. headers[config.method]
  1695. );
  1696. headers && utils_default.forEach(
  1697. ["delete", "get", "head", "post", "put", "patch", "common"],
  1698. (method) => {
  1699. delete headers[method];
  1700. }
  1701. );
  1702. config.headers = AxiosHeaders_default.concat(contextHeaders, headers);
  1703. const requestInterceptorChain = [];
  1704. let synchronousRequestInterceptors = true;
  1705. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  1706. if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
  1707. return;
  1708. }
  1709. synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
  1710. requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
  1711. });
  1712. const responseInterceptorChain = [];
  1713. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  1714. responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
  1715. });
  1716. let promise;
  1717. let i = 0;
  1718. let len;
  1719. if (!synchronousRequestInterceptors) {
  1720. const chain = [dispatchRequest.bind(this), void 0];
  1721. chain.unshift.apply(chain, requestInterceptorChain);
  1722. chain.push.apply(chain, responseInterceptorChain);
  1723. len = chain.length;
  1724. promise = Promise.resolve(config);
  1725. while (i < len) {
  1726. promise = promise.then(chain[i++], chain[i++]);
  1727. }
  1728. return promise;
  1729. }
  1730. len = requestInterceptorChain.length;
  1731. let newConfig = config;
  1732. i = 0;
  1733. while (i < len) {
  1734. const onFulfilled = requestInterceptorChain[i++];
  1735. const onRejected = requestInterceptorChain[i++];
  1736. try {
  1737. newConfig = onFulfilled(newConfig);
  1738. } catch (error) {
  1739. onRejected.call(this, error);
  1740. break;
  1741. }
  1742. }
  1743. try {
  1744. promise = dispatchRequest.call(this, newConfig);
  1745. } catch (error) {
  1746. return Promise.reject(error);
  1747. }
  1748. i = 0;
  1749. len = responseInterceptorChain.length;
  1750. while (i < len) {
  1751. promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
  1752. }
  1753. return promise;
  1754. }
  1755. getUri(config) {
  1756. config = mergeConfig(this.defaults, config);
  1757. const fullPath = buildFullPath(config.baseURL, config.url);
  1758. return buildURL(fullPath, config.params, config.paramsSerializer);
  1759. }
  1760. };
  1761. utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
  1762. Axios.prototype[method] = function(url, config) {
  1763. return this.request(mergeConfig(config || {}, {
  1764. method,
  1765. url,
  1766. data: (config || {}).data
  1767. }));
  1768. };
  1769. });
  1770. utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
  1771. function generateHTTPMethod(isForm) {
  1772. return function httpMethod(url, data, config) {
  1773. return this.request(mergeConfig(config || {}, {
  1774. method,
  1775. headers: isForm ? {
  1776. "Content-Type": "multipart/form-data"
  1777. } : {},
  1778. url,
  1779. data
  1780. }));
  1781. };
  1782. }
  1783. Axios.prototype[method] = generateHTTPMethod();
  1784. Axios.prototype[method + "Form"] = generateHTTPMethod(true);
  1785. });
  1786. var Axios_default = Axios;
  1787. // node_modules/axios/lib/cancel/CancelToken.js
  1788. var CancelToken = class {
  1789. constructor(executor) {
  1790. if (typeof executor !== "function") {
  1791. throw new TypeError("executor must be a function.");
  1792. }
  1793. let resolvePromise;
  1794. this.promise = new Promise(function promiseExecutor(resolve) {
  1795. resolvePromise = resolve;
  1796. });
  1797. const token = this;
  1798. this.promise.then((cancel) => {
  1799. if (!token._listeners)
  1800. return;
  1801. let i = token._listeners.length;
  1802. while (i-- > 0) {
  1803. token._listeners[i](cancel);
  1804. }
  1805. token._listeners = null;
  1806. });
  1807. this.promise.then = (onfulfilled) => {
  1808. let _resolve;
  1809. const promise = new Promise((resolve) => {
  1810. token.subscribe(resolve);
  1811. _resolve = resolve;
  1812. }).then(onfulfilled);
  1813. promise.cancel = function reject() {
  1814. token.unsubscribe(_resolve);
  1815. };
  1816. return promise;
  1817. };
  1818. executor(function cancel(message, config, request) {
  1819. if (token.reason) {
  1820. return;
  1821. }
  1822. token.reason = new CanceledError_default(message, config, request);
  1823. resolvePromise(token.reason);
  1824. });
  1825. }
  1826. throwIfRequested() {
  1827. if (this.reason) {
  1828. throw this.reason;
  1829. }
  1830. }
  1831. subscribe(listener) {
  1832. if (this.reason) {
  1833. listener(this.reason);
  1834. return;
  1835. }
  1836. if (this._listeners) {
  1837. this._listeners.push(listener);
  1838. } else {
  1839. this._listeners = [listener];
  1840. }
  1841. }
  1842. unsubscribe(listener) {
  1843. if (!this._listeners) {
  1844. return;
  1845. }
  1846. const index = this._listeners.indexOf(listener);
  1847. if (index !== -1) {
  1848. this._listeners.splice(index, 1);
  1849. }
  1850. }
  1851. static source() {
  1852. let cancel;
  1853. const token = new CancelToken(function executor(c) {
  1854. cancel = c;
  1855. });
  1856. return {
  1857. token,
  1858. cancel
  1859. };
  1860. }
  1861. };
  1862. var CancelToken_default = CancelToken;
  1863. // node_modules/axios/lib/helpers/spread.js
  1864. function spread(callback) {
  1865. return function wrap(arr) {
  1866. return callback.apply(null, arr);
  1867. };
  1868. }
  1869. // node_modules/axios/lib/helpers/isAxiosError.js
  1870. function isAxiosError(payload) {
  1871. return utils_default.isObject(payload) && payload.isAxiosError === true;
  1872. }
  1873. // node_modules/axios/lib/helpers/HttpStatusCode.js
  1874. var HttpStatusCode = {
  1875. Continue: 100,
  1876. SwitchingProtocols: 101,
  1877. Processing: 102,
  1878. EarlyHints: 103,
  1879. Ok: 200,
  1880. Created: 201,
  1881. Accepted: 202,
  1882. NonAuthoritativeInformation: 203,
  1883. NoContent: 204,
  1884. ResetContent: 205,
  1885. PartialContent: 206,
  1886. MultiStatus: 207,
  1887. AlreadyReported: 208,
  1888. ImUsed: 226,
  1889. MultipleChoices: 300,
  1890. MovedPermanently: 301,
  1891. Found: 302,
  1892. SeeOther: 303,
  1893. NotModified: 304,
  1894. UseProxy: 305,
  1895. Unused: 306,
  1896. TemporaryRedirect: 307,
  1897. PermanentRedirect: 308,
  1898. BadRequest: 400,
  1899. Unauthorized: 401,
  1900. PaymentRequired: 402,
  1901. Forbidden: 403,
  1902. NotFound: 404,
  1903. MethodNotAllowed: 405,
  1904. NotAcceptable: 406,
  1905. ProxyAuthenticationRequired: 407,
  1906. RequestTimeout: 408,
  1907. Conflict: 409,
  1908. Gone: 410,
  1909. LengthRequired: 411,
  1910. PreconditionFailed: 412,
  1911. PayloadTooLarge: 413,
  1912. UriTooLong: 414,
  1913. UnsupportedMediaType: 415,
  1914. RangeNotSatisfiable: 416,
  1915. ExpectationFailed: 417,
  1916. ImATeapot: 418,
  1917. MisdirectedRequest: 421,
  1918. UnprocessableEntity: 422,
  1919. Locked: 423,
  1920. FailedDependency: 424,
  1921. TooEarly: 425,
  1922. UpgradeRequired: 426,
  1923. PreconditionRequired: 428,
  1924. TooManyRequests: 429,
  1925. RequestHeaderFieldsTooLarge: 431,
  1926. UnavailableForLegalReasons: 451,
  1927. InternalServerError: 500,
  1928. NotImplemented: 501,
  1929. BadGateway: 502,
  1930. ServiceUnavailable: 503,
  1931. GatewayTimeout: 504,
  1932. HttpVersionNotSupported: 505,
  1933. VariantAlsoNegotiates: 506,
  1934. InsufficientStorage: 507,
  1935. LoopDetected: 508,
  1936. NotExtended: 510,
  1937. NetworkAuthenticationRequired: 511
  1938. };
  1939. Object.entries(HttpStatusCode).forEach(([key, value]) => {
  1940. HttpStatusCode[value] = key;
  1941. });
  1942. var HttpStatusCode_default = HttpStatusCode;
  1943. // node_modules/axios/lib/axios.js
  1944. function createInstance(defaultConfig) {
  1945. const context = new Axios_default(defaultConfig);
  1946. const instance = bind(Axios_default.prototype.request, context);
  1947. utils_default.extend(instance, Axios_default.prototype, context, { allOwnKeys: true });
  1948. utils_default.extend(instance, context, null, { allOwnKeys: true });
  1949. instance.create = function create(instanceConfig) {
  1950. return createInstance(mergeConfig(defaultConfig, instanceConfig));
  1951. };
  1952. return instance;
  1953. }
  1954. var axios = createInstance(defaults_default);
  1955. axios.Axios = Axios_default;
  1956. axios.CanceledError = CanceledError_default;
  1957. axios.CancelToken = CancelToken_default;
  1958. axios.isCancel = isCancel;
  1959. axios.VERSION = VERSION;
  1960. axios.toFormData = toFormData_default;
  1961. axios.AxiosError = AxiosError_default;
  1962. axios.Cancel = axios.CanceledError;
  1963. axios.all = function all(promises) {
  1964. return Promise.all(promises);
  1965. };
  1966. axios.spread = spread;
  1967. axios.isAxiosError = isAxiosError;
  1968. axios.mergeConfig = mergeConfig;
  1969. axios.AxiosHeaders = AxiosHeaders_default;
  1970. axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing);
  1971. axios.getAdapter = adapters_default.getAdapter;
  1972. axios.HttpStatusCode = HttpStatusCode_default;
  1973. axios.default = axios;
  1974. var axios_default = axios;
  1975. // node_modules/axios/index.js
  1976. var {
  1977. Axios: Axios2,
  1978. AxiosError: AxiosError2,
  1979. CanceledError: CanceledError2,
  1980. isCancel: isCancel2,
  1981. CancelToken: CancelToken2,
  1982. VERSION: VERSION2,
  1983. all: all2,
  1984. Cancel,
  1985. isAxiosError: isAxiosError2,
  1986. spread: spread2,
  1987. toFormData: toFormData2,
  1988. AxiosHeaders: AxiosHeaders2,
  1989. HttpStatusCode: HttpStatusCode2,
  1990. formToJSON,
  1991. getAdapter,
  1992. mergeConfig: mergeConfig2
  1993. } = axios_default;
  1994. // dep:axios
  1995. var axios_default2 = axios_default;
  1996. export {
  1997. Axios2 as Axios,
  1998. AxiosError2 as AxiosError,
  1999. AxiosHeaders2 as AxiosHeaders,
  2000. Cancel,
  2001. CancelToken2 as CancelToken,
  2002. CanceledError2 as CanceledError,
  2003. HttpStatusCode2 as HttpStatusCode,
  2004. VERSION2 as VERSION,
  2005. all2 as all,
  2006. axios_default2 as default,
  2007. formToJSON,
  2008. getAdapter,
  2009. isAxiosError2 as isAxiosError,
  2010. isCancel2 as isCancel,
  2011. mergeConfig2 as mergeConfig,
  2012. spread2 as spread,
  2013. toFormData2 as toFormData
  2014. };
  2015. //# sourceMappingURL=axios.js.map