@@ -1,5 +0,5 @@ | ||
| /*! Axios v1.13.5 Copyright (c) 2026 Matt Zabriskie and contributors */ | ||
| /*! Axios v1.13.6 Copyright (c) 2026 Matt Zabriskie and contributors */ | ||
| !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).axios=t()}(this,function(){"use strict";function e(e,t){this.v=e,this.k=t}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function n(t){var n={},r=!1;function o(n,o){return r=!0,o=new Promise(function(e){e(t[n](o))}),{done:!1,value:new e(o,1)}}return n["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},n.next=function(e){return r?(r=!1,e):o("next",e)},"function"==typeof t.throw&&(n.throw=function(e){if(r)throw r=!1,e;return o("throw",e)}),"function"==typeof t.return&&(n.return=function(e){return r?(r=!1,e):o("return",e)}),n}function r(e){var t,n,r,i=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&null!=(t=e[n]))return t.call(e);if(r&&null!=(t=e[r]))return new o(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function o(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return o=function(e){this.s=e,this.n=e.next},o.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return void 0===n?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return void 0===n?Promise.reject(e):t(n.apply(this.s,arguments))}},new o(e)}function i(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function u(e){i(a,r,o,u,s,"next",e)}function s(e){i(a,r,o,u,s,"throw",e)}u(void 0)})}}function u(t){return new e(t,0)}function s(e,t,n){return t=p(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,y()?Reflect.construct(t,n||[],p(e).constructor):t.apply(e,n))}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,S(r.key),r)}}function l(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e,t,n){return(t=S(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&O(e,t)}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(y=function(){return!!e})()}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach(function(t){d(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function m(){ | ||
| /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ | ||
| var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof u?r:u,c=Object.create(s.prototype);return g(c,"_invoke",function(n,r,o){var i,u,s,c=0,f=o||[],l=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,u=0,s=e,d.n=n,a}};function p(n,r){for(u=n,s=r,t=0;!l&&c&&!o&&t<f.length;t++){var o,i=f[t],p=d.p,h=i[2];n>3?(o=h===r)&&(s=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(u=0,d.v=r,d.n=i[1]):p<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,d.n=h,u=0))}if(o||n>1)return a;throw l=!0,r}return function(o,f,h){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&p(f,h),u=f,s=h;(t=u<2?e:s)||!l;){i||(u?u<3?(u>1&&(d.n=-1),p(u,s)):d.n=s:d.v=s);try{if(c=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(l=d.n<0)?s:n.call(r,d))!==a)break}catch(t){i=e,u=1,s=t}finally{c=1}}return{value:t,done:l}}}(n,o,i),!0),c}var a={};function u(){}function s(){}function c(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(g(t={},r,function(){return this}),t),l=c.prototype=u.prototype=Object.create(f);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,g(e,o,"GeneratorFunction")),e.prototype=Object.create(l),e}return s.prototype=c,g(l,"constructor",c),g(c,"constructor",s),s.displayName="GeneratorFunction",g(c,o,"GeneratorFunction"),g(l),g(l,o,"Generator"),g(l,r,function(){return this}),g(l,"toString",function(){return"[object Generator]"}),(m=function(){return{w:i,m:d}})()}function g(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}g=function(e,t,n,r){function i(t,n){g(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},g(e,t,n,r)}function w(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function O(e,t){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},O(e,t)}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(e,t)||A(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||A(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function A(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function j(e){return function(){return new k(e.apply(this,arguments))}}function k(t){var n,r;function o(n,r){try{var a=t[n](r),u=a.value,s=u instanceof e;Promise.resolve(s?u.v:u).then(function(e){if(s){var r="return"===n?"return":"next";if(!u.k||e.done)return o(r,e);e=t[r](e).value}i(a.done?"return":"normal",e)},function(e){o("throw",e)})}catch(e){i("throw",e)}}function i(e,t){switch(e){case"return":n.resolve({value:t,done:!0});break;case"throw":n.reject(t);break;default:n.resolve({value:t,done:!1})}(n=n.next)?o(n.key,n.arg):r=null}this._invoke=function(e,t){return new Promise(function(i,a){var u={key:e,arg:t,resolve:i,reject:a,next:null};r?r=r.next=u:(n=r=u,o(e,t))})},"function"!=typeof t.return&&(this.return=void 0)}function P(e){var t="function"==typeof Map?new Map:void 0;return P=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(y())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&O(o,n.prototype),o}(e,arguments,p(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),O(n,e)},P(e)}function _(e,t){return function(){return e.apply(t,arguments)}}k.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},k.prototype.next=function(e){return this._invoke("next",e)},k.prototype.throw=function(e){return this._invoke("throw",e)},k.prototype.return=function(e){return this._invoke("return",e)};var x,N=Object.prototype.toString,C=Object.getPrototypeOf,U=Symbol.iterator,F=Symbol.toStringTag,D=(x=Object.create(null),function(e){var t=N.call(e);return x[t]||(x[t]=t.slice(8,-1).toLowerCase())}),L=function(e){return e=e.toLowerCase(),function(t){return D(t)===e}},B=function(e){return function(t){return T(t)===e}},I=Array.isArray,q=B("undefined");function M(e){return null!==e&&!q(e)&&null!==e.constructor&&!q(e.constructor)&&J(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var z=L("ArrayBuffer");var H=B("string"),J=B("function"),W=B("number"),K=function(e){return null!==e&&"object"===T(e)},V=function(e){if("object"!==D(e))return!1;var t=C(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||F in e||U in e)},G=L("Date"),X=L("File"),$=L("Blob"),Q=L("FileList"),Y=L("URLSearchParams"),Z=E(["ReadableStream","Request","Response","Headers"].map(L),4),ee=Z[0],te=Z[1],ne=Z[2],re=Z[3];function oe(e,t){var n,r,o=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).allOwnKeys,i=void 0!==o&&o;if(null!=e)if("object"!==T(e)&&(e=[e]),I(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{if(M(e))return;var a,u=i?Object.getOwnPropertyNames(e):Object.keys(e),s=u.length;for(n=0;n<s;n++)a=u[n],t.call(null,e[a],a,e)}}function ie(e,t){if(M(e))return null;t=t.toLowerCase();for(var n,r=Object.keys(e),o=r.length;o-- >0;)if(t===(n=r[o]).toLowerCase())return n;return null}var ae="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ue=function(e){return!q(e)&&e!==ae};var se,ce=(se="undefined"!=typeof Uint8Array&&C(Uint8Array),function(e){return se&&e instanceof se}),fe=L("HTMLFormElement"),le=function(){var e=Object.prototype.hasOwnProperty;return function(t,n){return e.call(t,n)}}(),de=L("RegExp"),pe=function(e,t){var n=Object.getOwnPropertyDescriptors(e),r={};oe(n,function(n,o){var i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};var he,ye,ve,be,me=L("AsyncFunction"),ge=(he="function"==typeof setImmediate,ye=J(ae.postMessage),he?setImmediate:ye?(ve="axios@".concat(Math.random()),be=[],ae.addEventListener("message",function(e){var t=e.source,n=e.data;t===ae&&n===ve&&be.length&&be.shift()()},!1),function(e){be.push(e),ae.postMessage(ve,"*")}):function(e){return setTimeout(e)}),we="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ae):"undefined"!=typeof process&&process.nextTick||ge,Oe={isArray:I,isArrayBuffer:z,isBuffer:M,isFormData:function(e){var t;return e&&("function"==typeof FormData&&e instanceof FormData||J(e.append)&&("formdata"===(t=D(e))||"object"===t&&J(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&z(e.buffer)},isString:H,isNumber:W,isBoolean:function(e){return!0===e||!1===e},isObject:K,isPlainObject:V,isEmptyObject:function(e){if(!K(e)||M(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ee,isRequest:te,isResponse:ne,isHeaders:re,isUndefined:q,isDate:G,isFile:X,isBlob:$,isRegExp:de,isFunction:J,isStream:function(e){return K(e)&&J(e.pipe)},isURLSearchParams:Y,isTypedArray:ce,isFileList:Q,forEach:oe,merge:function e(){for(var t=ue(this)&&this||{},n=t.caseless,r=t.skipUndefined,o={},i=function(t,i){if("__proto__"!==i&&"constructor"!==i&&"prototype"!==i){var a=n&&ie(o,i)||i;V(o[a])&&V(t)?o[a]=e(o[a],t):V(t)?o[a]=e({},t):I(t)?o[a]=t.slice():r&&q(t)||(o[a]=t)}},a=0,u=arguments.length;a<u;a++)arguments[a]&&oe(arguments[a],i);return o},extend:function(e,t,n){return oe(t,function(t,r){n&&J(t)?Object.defineProperty(e,r,{value:_(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).allOwnKeys}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var o,i,a,u={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],r&&!r(a,e,t)||u[a]||(t[a]=e[a],u[a]=!0);e=!1!==n&&C(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:D,kindOfTest:L,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(I(e))return e;var t=e.length;if(!W(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},forEachEntry:function(e,t){for(var n,r=(e&&e[U]).call(e);(n=r.next())&&!n.done;){var o=n.value;t.call(e,o[0],o[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:fe,hasOwnProperty:le,hasOwnProp:le,reduceDescriptors:pe,freezeMethods:function(e){pe(e,function(t,n){if(J(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;var r=e[n];J(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:function(e,t){var n={},r=function(e){e.forEach(function(e){n[e]=!0})};return I(e)?r(e):r(String(e).split(t)),n},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n})},noop:function(){},toFiniteNumber:function(e,t){return null!=e&&Number.isFinite(e=+e)?e:t},findKey:ie,global:ae,isContextDefined:ue,isSpecCompliantForm:function(e){return!!(e&&J(e.append)&&"FormData"===e[F]&&e[U])},toJSONObject:function(e){var t=new Array(10),n=function(e,r){if(K(e)){if(t.indexOf(e)>=0)return;if(M(e))return e;if(!("toJSON"in e)){t[r]=e;var o=I(e)?[]:{};return oe(e,function(e,t){var i=n(e,r+1);!q(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:me,isThenable:function(e){return e&&(K(e)||J(e))&&J(e.then)&&J(e.catch)},setImmediate:ge,asap:we,isIterable:function(e){return null!=e&&J(e[U])}},Ee=function(e){function t(e,n,r,o,i){var a;return c(this,t),(a=s(this,t,[e])).name="AxiosError",a.isAxiosError=!0,n&&(a.code=n),r&&(a.config=r),o&&(a.request=o),i&&(a.response=i,a.status=i.status),a}return h(t,e),l(t,[{key:"toJSON",value:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Oe.toJSONObject(this.config),code:this.code,status:this.status}}}],[{key:"from",value:function(e,n,r,o,i,a){var u=new t(e.message,n||e.code,r,o,i);return u.cause=e,u.name=e.name,a&&Object.assign(u,a),u}}])}(P(Error));Ee.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Ee.ERR_BAD_OPTION="ERR_BAD_OPTION",Ee.ECONNABORTED="ECONNABORTED",Ee.ETIMEDOUT="ETIMEDOUT",Ee.ERR_NETWORK="ERR_NETWORK",Ee.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Ee.ERR_DEPRECATED="ERR_DEPRECATED",Ee.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Ee.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Ee.ERR_CANCELED="ERR_CANCELED",Ee.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Ee.ERR_INVALID_URL="ERR_INVALID_URL";var Re=Ee;function Se(e){return Oe.isPlainObject(e)||Oe.isArray(e)}function Te(e){return Oe.endsWith(e,"[]")?e.slice(0,-2):e}function Ae(e,t,n){return e?e.concat(t).map(function(e,t){return e=Te(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}var je=Oe.toFlatObject(Oe,{},null,function(e){return/^is[A-Z]/.test(e)});function ke(e,t,n){if(!Oe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;var r=(n=Oe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Oe.isUndefined(t[e])})).metaTokens,o=n.visitor||c,i=n.dots,a=n.indexes,u=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Oe.isSpecCompliantForm(t);if(!Oe.isFunction(o))throw new TypeError("visitor must be a function");function s(e){if(null===e)return"";if(Oe.isDate(e))return e.toISOString();if(Oe.isBoolean(e))return e.toString();if(!u&&Oe.isBlob(e))throw new Re("Blob is not supported. Use a Buffer instead.");return Oe.isArrayBuffer(e)||Oe.isTypedArray(e)?u&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,o){var u=e;if(e&&!o&&"object"===T(e))if(Oe.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Oe.isArray(e)&&function(e){return Oe.isArray(e)&&!e.some(Se)}(e)||(Oe.isFileList(e)||Oe.endsWith(n,"[]"))&&(u=Oe.toArray(e)))return n=Te(n),u.forEach(function(e,r){!Oe.isUndefined(e)&&null!==e&&t.append(!0===a?Ae([n],r,i):null===a?n:n+"[]",s(e))}),!1;return!!Se(e)||(t.append(Ae(o,n,i),s(e)),!1)}var f=[],l=Object.assign(je,{defaultVisitor:c,convertValue:s,isVisitable:Se});if(!Oe.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Oe.isUndefined(n)){if(-1!==f.indexOf(n))throw Error("Circular reference detected in "+r.join("."));f.push(n),Oe.forEach(n,function(n,i){!0===(!(Oe.isUndefined(n)||null===n)&&o.call(t,n,Oe.isString(i)?i.trim():i,r,l))&&e(n,r?r.concat(i):[i])}),f.pop()}}(e),t}function Pe(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function _e(e,t){this._pairs=[],e&&ke(e,this,t)}var xe=_e.prototype;function Ne(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ce(e,t,n){if(!t)return e;var r,o=n&&n.encode||Ne,i=Oe.isFunction(n)?{serialize:n}:n,a=i&&i.serialize;if(r=a?a(t,i):Oe.isURLSearchParams(t)?t.toString():new _e(t,i).toString(o)){var u=e.indexOf("#");-1!==u&&(e=e.slice(0,u)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}xe.append=function(e,t){this._pairs.push([e,t])},xe.toString=function(e){var t=e?function(t){return e.call(this,t,Pe)}:Pe;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};var Ue=function(){return l(function e(){c(this,e),this.handlers=[]},[{key:"use",value:function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(e){this.handlers[e]&&(this.handlers[e]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(e){Oe.forEach(this.handlers,function(t){null!==t&&e(t)})}}])}(),Fe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},De={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:_e,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Le="undefined"!=typeof window&&"undefined"!=typeof document,Be="object"===("undefined"==typeof navigator?"undefined":T(navigator))&&navigator||void 0,Ie=Le&&(!Be||["ReactNative","NativeScript","NS"].indexOf(Be.product)<0),qe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Me=Le&&window.location.href||"http://localhost",ze=b(b({},Object.freeze({__proto__:null,hasBrowserEnv:Le,hasStandardBrowserWebWorkerEnv:qe,hasStandardBrowserEnv:Ie,navigator:Be,origin:Me})),De);function He(e){function t(e,n,r,o){var i=e[o++];if("__proto__"===i)return!0;var a=Number.isFinite(+i),u=o>=e.length;return i=!i&&Oe.isArray(r)?r.length:i,u?(Oe.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a):(r[i]&&Oe.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&Oe.isArray(r[i])&&(r[i]=function(e){var t,n,r={},o=Object.keys(e),i=o.length;for(t=0;t<i;t++)r[n=o[t]]=e[n];return r}(r[i])),!a)}if(Oe.isFormData(e)&&Oe.isFunction(e.entries)){var n={};return Oe.forEachEntry(e,function(e,r){t(function(e){return Oe.matchAll(/\w+|\[(\w*)]/g,e).map(function(e){return"[]"===e[0]?"":e[1]||e[0]})}(e),r,n,0)}),n}return null}var Je={transitional:Fe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){var n,r=t.getContentType()||"",o=r.indexOf("application/json")>-1,i=Oe.isObject(e);if(i&&Oe.isHTMLForm(e)&&(e=new FormData(e)),Oe.isFormData(e))return o?JSON.stringify(He(e)):e;if(Oe.isArrayBuffer(e)||Oe.isBuffer(e)||Oe.isStream(e)||Oe.isFile(e)||Oe.isBlob(e)||Oe.isReadableStream(e))return e;if(Oe.isArrayBufferView(e))return e.buffer;if(Oe.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ke(e,new ze.classes.URLSearchParams,b({visitor:function(e,t,n,r){return ze.isNode&&Oe.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((n=Oe.isFileList(e))||r.indexOf("multipart/form-data")>-1){var a=this.env&&this.env.FormData;return ke(n?{"files[]":e}:e,a&&new a,this.formSerializer)}}return i||o?(t.setContentType("application/json",!1),function(e,t,n){if(Oe.isString(e))try{return(t||JSON.parse)(e),Oe.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||Je.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Oe.isResponse(e)||Oe.isReadableStream(e))return e;if(e&&Oe.isString(e)&&(n&&!this.responseType||r)){var o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(o){if("SyntaxError"===e.name)throw Re.from(e,Re.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ze.classes.FormData,Blob:ze.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Oe.forEach(["delete","get","head","post","put","patch"],function(e){Je.headers[e]={}});var We=Je,Ke=Oe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ve=Symbol("internals");function Ge(e){return e&&String(e).trim().toLowerCase()}function Xe(e){return!1===e||null==e?e:Oe.isArray(e)?e.map(Xe):String(e)}function $e(e,t,n,r,o){return Oe.isFunction(r)?r.call(this,t,n):(o&&(t=n),Oe.isString(t)?Oe.isString(r)?-1!==t.indexOf(r):Oe.isRegExp(r)?r.test(t):void 0:void 0)}var Qe=function(){return l(function e(t){c(this,e),t&&this.set(t)},[{key:"set",value:function(e,t,n){var r=this;function o(e,t,n){var o=Ge(t);if(!o)throw new Error("header name must be a non-empty string");var i=Oe.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Xe(e))}var i=function(e,t){return Oe.forEach(e,function(e,n){return o(e,n,t)})};if(Oe.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Oe.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i(function(e){var t,n,r,o={};return e&&e.split("\n").forEach(function(e){r=e.indexOf(":"),t=e.substring(0,r).trim().toLowerCase(),n=e.substring(r+1).trim(),!t||o[t]&&Ke[t]||("set-cookie"===t?o[t]?o[t].push(n):o[t]=[n]:o[t]=o[t]?o[t]+", "+n:n)}),o}(e),t);else if(Oe.isObject(e)&&Oe.isIterable(e)){var a,u,s,c={},f=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=A(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e);try{for(f.s();!(s=f.n()).done;){var l=s.value;if(!Oe.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(a=c[u])?Oe.isArray(a)?[].concat(R(a),[l[1]]):[a,l[1]]:l[1]}}catch(e){f.e(e)}finally{f.f()}i(c,t)}else null!=e&&o(t,e,n);return this}},{key:"get",value:function(e,t){if(e=Ge(e)){var n=Oe.findKey(this,e);if(n){var r=this[n];if(!t)return r;if(!0===t)return function(e){for(var t,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=r.exec(e);)n[t[1]]=t[2];return n}(r);if(Oe.isFunction(t))return t.call(this,r,n);if(Oe.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=Ge(e)){var n=Oe.findKey(this,e);return!(!n||void 0===this[n]||t&&!$e(0,this[n],n,t))}return!1}},{key:"delete",value:function(e,t){var n=this,r=!1;function o(e){if(e=Ge(e)){var o=Oe.findKey(n,e);!o||t&&!$e(0,n[o],o,t)||(delete n[o],r=!0)}}return Oe.isArray(e)?e.forEach(o):o(e),r}},{key:"clear",value:function(e){for(var t=Object.keys(this),n=t.length,r=!1;n--;){var o=t[n];e&&!$e(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}},{key:"normalize",value:function(e){var t=this,n={};return Oe.forEach(this,function(r,o){var i=Oe.findKey(n,o);if(i)return t[i]=Xe(r),void delete t[o];var a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n})}(o):String(o).trim();a!==o&&delete t[o],t[a]=Xe(r),n[a]=!0}),this}},{key:"concat",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=this.constructor).concat.apply(e,[this].concat(n))}},{key:"toJSON",value:function(e){var t=Object.create(null);return Oe.forEach(this,function(n,r){null!=n&&!1!==n&&(t[r]=e&&Oe.isArray(n)?n.join(", "):n)}),t}},{key:Symbol.iterator,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map(function(e){var t=E(e,2);return t[0]+": "+t[1]}).join("\n")}},{key:"getSetCookie",value:function(){return this.get("set-cookie")||[]}},{key:Symbol.toStringTag,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(e){return e instanceof this?e:new this(e)}},{key:"concat",value:function(e){for(var t=new this(e),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.forEach(function(e){return t.set(e)}),t}},{key:"accessor",value:function(e){var t=(this[Ve]=this[Ve]={accessors:{}}).accessors,n=this.prototype;function r(e){var r=Ge(e);t[r]||(!function(e,t){var n=Oe.toCamelCase(" "+t);["get","set","has"].forEach(function(r){Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Oe.isArray(e)?e.forEach(r):r(e),this}}])}();Qe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Oe.reduceDescriptors(Qe.prototype,function(e,t){var n=e.value,r=t[0].toUpperCase()+t.slice(1);return{get:function(){return n},set:function(e){this[r]=e}}}),Oe.freezeMethods(Qe);var Ye=Qe;function Ze(e,t){var n=this||We,r=t||n,o=Ye.from(r.headers),i=r.data;return Oe.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function et(e){return!(!e||!e.__CANCEL__)}var tt=function(e){function t(e,n,r){var o;return c(this,t),(o=s(this,t,[null==e?"canceled":e,Re.ERR_CANCELED,n,r])).name="CanceledError",o.__CANCEL__=!0,o}return h(t,e),l(t)}(Re);function nt(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Re("Request failed with status code "+n.status,[Re.ERR_BAD_REQUEST,Re.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}var rt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0,o=function(e,t){e=e||10;var n,r=new Array(e),o=new Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(u){var s=Date.now(),c=o[a];n||(n=s),r[i]=u,o[i]=s;for(var f=a,l=0;f!==i;)l+=r[f++],f%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),!(s-n<t)){var d=c&&s-c;return d?Math.round(1e3*l/d):void 0}}}(50,250);return function(e,t){var n,r,o=0,i=1e3/t,a=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(void 0,R(t))};return[function(){for(var e=Date.now(),t=e-o,u=arguments.length,s=new Array(u),c=0;c<u;c++)s[c]=arguments[c];t>=i?a(s,e):(n=s,r||(r=setTimeout(function(){r=null,a(n)},i-t)))},function(){return n&&a(n)}]}(function(n){var i=n.loaded,a=n.lengthComputable?n.total:void 0,u=i-r,s=o(u);r=i;var c=d({loaded:i,total:a,progress:a?i/a:void 0,bytes:u,rate:s||void 0,estimated:s&&a&&i<=a?(a-i)/s:void 0,event:n,lengthComputable:null!=a},t?"download":"upload",!0);e(c)},n)},ot=function(e,t){var n=null!=e;return[function(r){return t[0]({lengthComputable:n,total:e,loaded:r})},t[1]]},it=function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Oe.asap(function(){return e.apply(void 0,n)})}},at=ze.hasStandardBrowserEnv?function(e,t){return function(n){return n=new URL(n,ze.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)}}(new URL(ze.origin),ze.navigator&&/(msie|trident)/i.test(ze.navigator.userAgent)):function(){return!0},ut=ze.hasStandardBrowserEnv?{write:function(e,t,n,r,o,i,a){if("undefined"!=typeof document){var u=["".concat(e,"=").concat(encodeURIComponent(t))];Oe.isNumber(n)&&u.push("expires=".concat(new Date(n).toUTCString())),Oe.isString(r)&&u.push("path=".concat(r)),Oe.isString(o)&&u.push("domain=".concat(o)),!0===i&&u.push("secure"),Oe.isString(a)&&u.push("SameSite=".concat(a)),document.cookie=u.join("; ")}},read:function(e){if("undefined"==typeof document)return null;var t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove:function(e){this.write(e,"",Date.now()-864e5,"/")}}:{write:function(){},read:function(){return null},remove:function(){}};function st(e,t,n){var r,o=!("string"==typeof(r=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r));return e&&(o||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var ct=function(e){return e instanceof Ye?b({},e):e};function ft(e,t){t=t||{};var n={};function r(e,t,n,r){return Oe.isPlainObject(e)&&Oe.isPlainObject(t)?Oe.merge.call({caseless:r},e,t):Oe.isPlainObject(t)?Oe.merge({},t):Oe.isArray(t)?t.slice():t}function o(e,t,n,o){return Oe.isUndefined(t)?Oe.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Oe.isUndefined(t))return r(void 0,t)}function a(e,t){return Oe.isUndefined(t)?Oe.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function u(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}var s={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u,headers:function(e,t,n){return o(ct(e),ct(t),0,!0)}};return Oe.forEach(Object.keys(b(b({},e),t)),function(r){if("__proto__"!==r&&"constructor"!==r&&"prototype"!==r){var i=Oe.hasOwnProp(s,r)?s[r]:o,a=i(e[r],t[r],r);Oe.isUndefined(a)&&i!==u||(n[r]=a)}}),n}var lt,dt=function(e){var t=ft({},e),n=t.data,r=t.withXSRFToken,o=t.xsrfHeaderName,i=t.xsrfCookieName,a=t.headers,u=t.auth;if(t.headers=a=Ye.from(a),t.url=Ce(st(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&a.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),Oe.isFormData(n))if(ze.hasStandardBrowserEnv||ze.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(Oe.isFunction(n.getHeaders)){var s=n.getHeaders(),c=["content-type","content-length"];Object.entries(s).forEach(function(e){var t=E(e,2),n=t[0],r=t[1];c.includes(n.toLowerCase())&&a.set(n,r)})}if(ze.hasStandardBrowserEnv&&(r&&Oe.isFunction(r)&&(r=r(t)),r||!1!==r&&at(t.url))){var f=o&&i&&ut.read(i);f&&a.set(o,f)}return t},pt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){var r,o,i,a,u,s=dt(e),c=s.data,f=Ye.from(s.headers).normalize(),l=s.responseType,d=s.onUploadProgress,p=s.onDownloadProgress;function h(){a&&a(),u&&u(),s.cancelToken&&s.cancelToken.unsubscribe(r),s.signal&&s.signal.removeEventListener("abort",r)}var y=new XMLHttpRequest;function v(){if(y){var r=Ye.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());nt(function(e){t(e),h()},function(e){n(e),h()},{data:l&&"text"!==l&&"json"!==l?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y}),y=null}}if(y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout,"onloadend"in y?y.onloadend=v:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(v)},y.onabort=function(){y&&(n(new Re("Request aborted",Re.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){var r=t&&t.message?t.message:"Network Error",o=new Re(r,Re.ERR_NETWORK,e,y);o.event=t||null,n(o),y=null},y.ontimeout=function(){var t=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded",r=s.transitional||Fe;s.timeoutErrorMessage&&(t=s.timeoutErrorMessage),n(new Re(t,r.clarifyTimeoutError?Re.ETIMEDOUT:Re.ECONNABORTED,e,y)),y=null},void 0===c&&f.setContentType(null),"setRequestHeader"in y&&Oe.forEach(f.toJSON(),function(e,t){y.setRequestHeader(t,e)}),Oe.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),l&&"json"!==l&&(y.responseType=s.responseType),p){var b=E(rt(p,!0),2);i=b[0],u=b[1],y.addEventListener("progress",i)}if(d&&y.upload){var m=E(rt(d),2);o=m[0],a=m[1],y.upload.addEventListener("progress",o),y.upload.addEventListener("loadend",a)}(s.cancelToken||s.signal)&&(r=function(t){y&&(n(!t||t.type?new tt(null,e,y):t),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(r),s.signal&&(s.signal.aborted?r():s.signal.addEventListener("abort",r)));var g,w,O=(g=s.url,(w=/^([-+\w]{1,25})(:?\/\/|:)/.exec(g))&&w[1]||"");O&&-1===ze.protocols.indexOf(O)?n(new Re("Unsupported protocol "+O+":",Re.ERR_BAD_REQUEST,e)):y.send(c||null)})},ht=function(e,t){var n=(e=e?e.filter(Boolean):[]).length;if(t||n){var r,o=new AbortController,i=function(e){if(!r){r=!0,u();var t=e instanceof Error?e:this.reason;o.abort(t instanceof Re?t:new tt(t instanceof Error?t.message:t))}},a=t&&setTimeout(function(){a=null,i(new Re("timeout of ".concat(t,"ms exceeded"),Re.ETIMEDOUT))},t),u=function(){e&&(a&&clearTimeout(a),a=null,e.forEach(function(e){e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(function(e){return e.addEventListener("abort",i)});var s=o.signal;return s.unsubscribe=function(){return Oe.asap(u)},s}},yt=m().m(function e(t,n){var r,o,i;return m().w(function(e){for(;;)switch(e.n){case 0:if(r=t.byteLength,n&&!(r<n)){e.n=2;break}return e.n=1,t;case 1:return e.a(2);case 2:o=0;case 3:if(!(o<r)){e.n=5;break}return i=o+n,e.n=4,t.slice(o,i);case 4:o=i,e.n=3;break;case 5:return e.a(2)}},e)}),vt=function(){var e=j(m().m(function e(t,o){var i,a,s,c,f,l,d;return m().w(function(e){for(;;)switch(e.p=e.n){case 0:i=!1,a=!1,e.p=1,c=r(bt(t));case 2:return e.n=3,u(c.next());case 3:if(!(i=!(f=e.v).done)){e.n=5;break}return l=f.value,e.d(w(n(r(yt(l,o)))),4);case 4:i=!1,e.n=2;break;case 5:e.n=7;break;case 6:e.p=6,d=e.v,a=!0,s=d;case 7:if(e.p=7,e.p=8,!i||null==c.return){e.n=9;break}return e.n=9,u(c.return());case 9:if(e.p=9,!a){e.n=10;break}throw s;case 10:return e.f(9);case 11:return e.f(7);case 12:return e.a(2)}},e,null,[[8,,9,11],[1,6,7,12]])}));return function(t,n){return e.apply(this,arguments)}}(),bt=function(){var e=j(m().m(function e(t){var o,i,a,s;return m().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!t[Symbol.asyncIterator]){e.n=2;break}return e.d(w(n(r(t))),1);case 1:return e.a(2);case 2:o=t.getReader(),e.p=3;case 4:return e.n=5,u(o.read());case 5:if(i=e.v,a=i.done,s=i.value,!a){e.n=6;break}return e.a(3,8);case 6:return e.n=7,s;case 7:e.n=4;break;case 8:return e.p=8,e.n=9,u(o.cancel());case 9:return e.f(8);case 10:return e.a(2)}},e,null,[[3,,8,10]])}));return function(t){return e.apply(this,arguments)}}(),mt=function(e,t,n,r){var o,i=vt(e,t),u=0,s=function(e){o||(o=!0,r&&r(e))};return new ReadableStream({pull:function(e){return a(m().m(function t(){var r,o,a,c,f,l;return m().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,i.next();case 1:if(r=t.v,o=r.done,a=r.value,!o){t.n=2;break}return s(),e.close(),t.a(2);case 2:c=a.byteLength,n&&(f=u+=c,n(f)),e.enqueue(new Uint8Array(a)),t.n=4;break;case 3:throw t.p=3,l=t.v,s(l),l;case 4:return t.a(2)}},t,null,[[0,3]])}))()},cancel:function(e){return s(e),i.return()}},{highWaterMark:2})},gt=Oe.isFunction,wt={Request:(lt=Oe.global).Request,Response:lt.Response},Ot=Oe.global,Et=Ot.ReadableStream,Rt=Ot.TextEncoder,St=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return!!e.apply(void 0,n)}catch(e){return!1}},Tt=function(e){var t=e=Oe.merge.call({skipUndefined:!0},wt,e),n=t.fetch,r=t.Request,o=t.Response,i=n?gt(n):"function"==typeof fetch,u=gt(r),s=gt(o);if(!i)return!1;var c,f=i&>(Et),l=i&&("function"==typeof Rt?(c=new Rt,function(e){return c.encode(e)}):function(){var e=a(m().m(function e(t){var n,o;return m().w(function(e){for(;;)switch(e.n){case 0:return n=Uint8Array,e.n=1,new r(t).arrayBuffer();case 1:return o=e.v,e.a(2,new n(o))}},e)}));return function(t){return e.apply(this,arguments)}}()),d=u&&f&&St(function(){var e=!1,t=new r(ze.origin,{body:new Et,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),p=s&&f&&St(function(){return Oe.isReadableStream(new o("").body)}),h={stream:p&&function(e){return e.body}};i&&["text","arrayBuffer","blob","formData","stream"].forEach(function(e){!h[e]&&(h[e]=function(t,n){var r=t&&t[e];if(r)return r.call(t);throw new Re("Response type '".concat(e,"' is not supported"),Re.ERR_NOT_SUPPORT,n)})});var y=function(){var e=a(m().m(function e(t){var n;return m().w(function(e){for(;;)switch(e.n){case 0:if(null!=t){e.n=1;break}return e.a(2,0);case 1:if(!Oe.isBlob(t)){e.n=2;break}return e.a(2,t.size);case 2:if(!Oe.isSpecCompliantForm(t)){e.n=4;break}return n=new r(ze.origin,{method:"POST",body:t}),e.n=3,n.arrayBuffer();case 3:case 6:return e.a(2,e.v.byteLength);case 4:if(!Oe.isArrayBufferView(t)&&!Oe.isArrayBuffer(t)){e.n=5;break}return e.a(2,t.byteLength);case 5:if(Oe.isURLSearchParams(t)&&(t+=""),!Oe.isString(t)){e.n=7;break}return e.n=6,l(t);case 7:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),v=function(){var e=a(m().m(function e(t,n){var r;return m().w(function(e){for(;;)if(0===e.n)return r=Oe.toFiniteNumber(t.getContentLength()),e.a(2,null==r?y(n):r)},e)}));return function(t,n){return e.apply(this,arguments)}}();return function(){var e=a(m().m(function e(t){var i,a,s,c,f,l,y,g,w,O,R,S,T,A,j,k,P,_,x,N,C,U,F,D,L,B,I,q,M,z,H,J,W,K,V,G,X,$,Q;return m().w(function(e){for(;;)switch(e.p=e.n){case 0:if(i=dt(t),a=i.url,s=i.method,c=i.data,f=i.signal,l=i.cancelToken,y=i.timeout,g=i.onDownloadProgress,w=i.onUploadProgress,O=i.responseType,R=i.headers,S=i.withCredentials,T=void 0===S?"same-origin":S,A=i.fetchOptions,j=n||fetch,O=O?(O+"").toLowerCase():"text",k=ht([f,l&&l.toAbortSignal()],y),P=null,_=k&&k.unsubscribe&&function(){k.unsubscribe()},e.p=1,!(X=w&&d&&"get"!==s&&"head"!==s)){e.n=3;break}return e.n=2,v(R,c);case 2:$=x=e.v,X=0!==$;case 3:if(!X){e.n=4;break}N=new r(a,{method:"POST",body:c,duplex:"half"}),Oe.isFormData(c)&&(C=N.headers.get("content-type"))&&R.setContentType(C),N.body&&(U=ot(x,rt(it(w))),F=E(U,2),D=F[0],L=F[1],c=mt(N.body,65536,D,L));case 4:return Oe.isString(T)||(T=T?"include":"omit"),B=u&&"credentials"in r.prototype,I=b(b({},A),{},{signal:k,method:s.toUpperCase(),headers:R.normalize().toJSON(),body:c,duplex:"half",credentials:B?T:void 0}),P=u&&new r(a,I),e.n=5,u?j(P,A):j(a,I);case 5:return q=e.v,M=p&&("stream"===O||"response"===O),p&&(g||M&&_)&&(z={},["status","statusText","headers"].forEach(function(e){z[e]=q[e]}),H=Oe.toFiniteNumber(q.headers.get("content-length")),J=g&&ot(H,rt(it(g),!0))||[],W=E(J,2),K=W[0],V=W[1],q=new o(mt(q.body,65536,K,function(){V&&V(),_&&_()}),z)),O=O||"text",e.n=6,h[Oe.findKey(h,O)||"text"](q,t);case 6:return G=e.v,!M&&_&&_(),e.n=7,new Promise(function(e,n){nt(e,n,{data:G,headers:Ye.from(q.headers),status:q.status,statusText:q.statusText,config:t,request:P})});case 7:return e.a(2,e.v);case 8:if(e.p=8,Q=e.v,_&&_(),!Q||"TypeError"!==Q.name||!/Load failed|fetch/i.test(Q.message)){e.n=9;break}throw Object.assign(new Re("Network Error",Re.ERR_NETWORK,t,P,Q&&Q.response),{cause:Q.cause||Q});case 9:throw Re.from(Q,Q&&Q.code,t,P,Q&&Q.response);case 10:return e.a(2)}},e,null,[[1,8]])}));return function(t){return e.apply(this,arguments)}}()},At=new Map,jt=function(e){for(var t,n,r=e&&e.env||{},o=r.fetch,i=[r.Request,r.Response,o],a=i.length,u=At;a--;)t=i[a],void 0===(n=u.get(t))&&u.set(t,n=a?new Map:Tt(r)),u=n;return n};jt();var kt={http:null,xhr:pt,fetch:{get:jt}};Oe.forEach(kt,function(e,t){if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});var Pt=function(e){return"- ".concat(e)},_t=function(e){return Oe.isFunction(e)||null===e||!1===e};var xt={getAdapter:function(e,t){for(var n,r,o=(e=Oe.isArray(e)?e:[e]).length,i={},a=0;a<o;a++){var u=void 0;if(r=n=e[a],!_t(n)&&void 0===(r=kt[(u=String(n)).toLowerCase()]))throw new Re("Unknown adapter '".concat(u,"'"));if(r&&(Oe.isFunction(r)||(r=r.get(t))))break;i[u||"#"+a]=r}if(!r){var s=Object.entries(i).map(function(e){var t=E(e,2),n=t[0],r=t[1];return"adapter ".concat(n," ")+(!1===r?"is not supported by the environment":"is not available in the build")}),c=o?s.length>1?"since :\n"+s.map(Pt).join("\n"):" "+Pt(s[0]):"as no adapter specified";throw new Re("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return r},adapters:kt};function Nt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new tt(null,e)}function Ct(e){return Nt(e),e.headers=Ye.from(e.headers),e.data=Ze.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),xt.getAdapter(e.adapter||We.adapter,e)(e).then(function(t){return Nt(e),t.data=Ze.call(e,e.transformResponse,t),t.headers=Ye.from(t.headers),t},function(t){return et(t)||(Nt(e),t&&t.response&&(t.response.data=Ze.call(e,e.transformResponse,t.response),t.response.headers=Ye.from(t.response.headers))),Promise.reject(t)})}var Ut="1.13.5",Ft={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){Ft[e]=function(n){return T(n)===e||"a"+(t<1?"n ":" ")+e}});var Dt={};Ft.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Ut+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,o,i){if(!1===e)throw new Re(r(o," has been removed"+(t?" in "+t:"")),Re.ERR_DEPRECATED);return t&&!Dt[o]&&(Dt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},Ft.spelling=function(e){return function(t,n){return console.warn("".concat(n," is likely a misspelling of ").concat(e)),!0}};var Lt={assertOptions:function(e,t,n){if("object"!==T(e))throw new Re("options must be an object",Re.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],a=t[i];if(a){var u=e[i],s=void 0===u||a(u,i,e);if(!0!==s)throw new Re("option "+i+" must be "+s,Re.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Re("Unknown option "+i,Re.ERR_BAD_OPTION)}},validators:Ft},Bt=Lt.validators,It=function(){return l(function e(t){c(this,e),this.defaults=t||{},this.interceptors={request:new Ue,response:new Ue}},[{key:"request",value:(e=a(m().m(function e(t,n){var r,o,i;return m().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this._request(t,n);case 1:return e.a(2,e.v);case 2:if(e.p=2,(i=e.v)instanceof Error){r={},Error.captureStackTrace?Error.captureStackTrace(r):r=new Error,o=r.stack?r.stack.replace(/^.+\n/,""):"";try{i.stack?o&&!String(i.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(i.stack+="\n"+o):i.stack=o}catch(e){}}throw i;case 3:return e.a(2)}},e,this,[[0,2]])})),function(t,n){return e.apply(this,arguments)})},{key:"_request",value:function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{};var n=t=ft(this.defaults,t),r=n.transitional,o=n.paramsSerializer,i=n.headers;void 0!==r&&Lt.assertOptions(r,{silentJSONParsing:Bt.transitional(Bt.boolean),forcedJSONParsing:Bt.transitional(Bt.boolean),clarifyTimeoutError:Bt.transitional(Bt.boolean),legacyInterceptorReqResOrdering:Bt.transitional(Bt.boolean)},!1),null!=o&&(Oe.isFunction(o)?t.paramsSerializer={serialize:o}:Lt.assertOptions(o,{encode:Bt.function,serialize:Bt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Lt.assertOptions(t,{baseUrl:Bt.spelling("baseURL"),withXsrfToken:Bt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();var a=i&&Oe.merge(i.common,i[t.method]);i&&Oe.forEach(["delete","get","head","post","put","patch","common"],function(e){delete i[e]}),t.headers=Ye.concat(a,i);var u=[],s=!0;this.interceptors.request.forEach(function(e){if("function"!=typeof e.runWhen||!1!==e.runWhen(t)){s=s&&e.synchronous;var n=t.transitional||Fe;n&&n.legacyInterceptorReqResOrdering?u.unshift(e.fulfilled,e.rejected):u.push(e.fulfilled,e.rejected)}});var c,f=[];this.interceptors.response.forEach(function(e){f.push(e.fulfilled,e.rejected)});var l,d=0;if(!s){var p=[Ct.bind(this),void 0];for(p.unshift.apply(p,u),p.push.apply(p,f),l=p.length,c=Promise.resolve(t);d<l;)c=c.then(p[d++],p[d++]);return c}l=u.length;for(var h=t;d<l;){var y=u[d++],v=u[d++];try{h=y(h)}catch(e){v.call(this,e);break}}try{c=Ct.call(this,h)}catch(e){return Promise.reject(e)}for(d=0,l=f.length;d<l;)c=c.then(f[d++],f[d++]);return c}},{key:"getUri",value:function(e){return Ce(st((e=ft(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}]);var e}();Oe.forEach(["delete","get","head","options"],function(e){It.prototype[e]=function(t,n){return this.request(ft(n||{},{method:e,url:t,data:(n||{}).data}))}}),Oe.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(ft(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}It.prototype[e]=t(),It.prototype[e+"Form"]=t(!0)});var qt=It,Mt=function(){function e(t){if(c(this,e),"function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise(function(e){n=e});var r=this;this.promise.then(function(e){if(r._listeners){for(var t=r._listeners.length;t-- >0;)r._listeners[t](e);r._listeners=null}}),this.promise.then=function(e){var t,n=new Promise(function(e){r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},t(function(e,t,o){r.reason||(r.reason=new tt(e,t,o),n(r.reason))})}return l(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}},{key:"toAbortSignal",value:function(){var e=this,t=new AbortController,n=function(e){t.abort(e)};return this.subscribe(n),t.signal.unsubscribe=function(){return e.unsubscribe(n)},t.signal}}],[{key:"source",value:function(){var t;return{token:new e(function(e){t=e}),cancel:t}}}])}(),zt=Mt;var Ht={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ht).forEach(function(e){var t=E(e,2),n=t[0],r=t[1];Ht[r]=n});var Jt=Ht;var Wt=function e(t){var n=new qt(t),r=_(qt.prototype.request,n);return Oe.extend(r,qt.prototype,n,{allOwnKeys:!0}),Oe.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ft(t,n))},r}(We);return Wt.Axios=qt,Wt.CanceledError=tt,Wt.CancelToken=zt,Wt.isCancel=et,Wt.VERSION=Ut,Wt.toFormData=ke,Wt.AxiosError=Re,Wt.Cancel=Wt.CanceledError,Wt.all=function(e){return Promise.all(e)},Wt.spread=function(e){return function(t){return e.apply(null,t)}},Wt.isAxiosError=function(e){return Oe.isObject(e)&&!0===e.isAxiosError},Wt.mergeConfig=ft,Wt.AxiosHeaders=Ye,Wt.formToJSON=function(e){return He(Oe.isHTMLForm(e)?new FormData(e):e)},Wt.getAdapter=xt.getAdapter,Wt.HttpStatusCode=Jt,Wt.default=Wt,Wt}); | ||
| var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof u?r:u,c=Object.create(s.prototype);return g(c,"_invoke",function(n,r,o){var i,u,s,c=0,f=o||[],l=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,u=0,s=e,d.n=n,a}};function p(n,r){for(u=n,s=r,t=0;!l&&c&&!o&&t<f.length;t++){var o,i=f[t],p=d.p,h=i[2];n>3?(o=h===r)&&(s=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(u=0,d.v=r,d.n=i[1]):p<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,d.n=h,u=0))}if(o||n>1)return a;throw l=!0,r}return function(o,f,h){if(c>1)throw TypeError("Generator is already running");for(l&&1===f&&p(f,h),u=f,s=h;(t=u<2?e:s)||!l;){i||(u?u<3?(u>1&&(d.n=-1),p(u,s)):d.n=s:d.v=s);try{if(c=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(l=d.n<0)?s:n.call(r,d))!==a)break}catch(t){i=e,u=1,s=t}finally{c=1}}return{value:t,done:l}}}(n,o,i),!0),c}var a={};function u(){}function s(){}function c(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(g(t={},r,function(){return this}),t),l=c.prototype=u.prototype=Object.create(f);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,g(e,o,"GeneratorFunction")),e.prototype=Object.create(l),e}return s.prototype=c,g(l,"constructor",c),g(c,"constructor",s),s.displayName="GeneratorFunction",g(c,o,"GeneratorFunction"),g(l),g(l,o,"Generator"),g(l,r,function(){return this}),g(l,"toString",function(){return"[object Generator]"}),(m=function(){return{w:i,m:d}})()}function g(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}g=function(e,t,n,r){function i(t,n){g(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},g(e,t,n,r)}function w(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function O(e,t){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},O(e,t)}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(e,t)||j(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||j(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function j(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function A(e){return function(){return new k(e.apply(this,arguments))}}function k(t){var n,r;function o(n,r){try{var a=t[n](r),u=a.value,s=u instanceof e;Promise.resolve(s?u.v:u).then(function(e){if(s){var r="return"===n?"return":"next";if(!u.k||e.done)return o(r,e);e=t[r](e).value}i(a.done?"return":"normal",e)},function(e){o("throw",e)})}catch(e){i("throw",e)}}function i(e,t){switch(e){case"return":n.resolve({value:t,done:!0});break;case"throw":n.reject(t);break;default:n.resolve({value:t,done:!1})}(n=n.next)?o(n.key,n.arg):r=null}this._invoke=function(e,t){return new Promise(function(i,a){var u={key:e,arg:t,resolve:i,reject:a,next:null};r?r=r.next=u:(n=r=u,o(e,t))})},"function"!=typeof t.return&&(this.return=void 0)}function P(e){var t="function"==typeof Map?new Map:void 0;return P=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(y())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&O(o,n.prototype),o}(e,arguments,p(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),O(n,e)},P(e)}function _(e,t){return function(){return e.apply(t,arguments)}}k.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},k.prototype.next=function(e){return this._invoke("next",e)},k.prototype.throw=function(e){return this._invoke("throw",e)},k.prototype.return=function(e){return this._invoke("return",e)};var x,N=Object.prototype.toString,C=Object.getPrototypeOf,U=Symbol.iterator,F=Symbol.toStringTag,D=(x=Object.create(null),function(e){var t=N.call(e);return x[t]||(x[t]=t.slice(8,-1).toLowerCase())}),B=function(e){return e=e.toLowerCase(),function(t){return D(t)===e}},L=function(e){return function(t){return T(t)===e}},I=Array.isArray,q=L("undefined");function M(e){return null!==e&&!q(e)&&null!==e.constructor&&!q(e.constructor)&&J(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var z=B("ArrayBuffer");var H=L("string"),J=L("function"),W=L("number"),K=function(e){return null!==e&&"object"===T(e)},V=function(e){if("object"!==D(e))return!1;var t=C(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||F in e||U in e)},G=B("Date"),X=B("File"),$=B("Blob"),Q=B("FileList");var Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},Z=void 0!==Y.FormData?Y.FormData:void 0,ee=B("URLSearchParams"),te=E(["ReadableStream","Request","Response","Headers"].map(B),4),ne=te[0],re=te[1],oe=te[2],ie=te[3];function ae(e,t){var n,r,o=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).allOwnKeys,i=void 0!==o&&o;if(null!=e)if("object"!==T(e)&&(e=[e]),I(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{if(M(e))return;var a,u=i?Object.getOwnPropertyNames(e):Object.keys(e),s=u.length;for(n=0;n<s;n++)a=u[n],t.call(null,e[a],a,e)}}function ue(e,t){if(M(e))return null;t=t.toLowerCase();for(var n,r=Object.keys(e),o=r.length;o-- >0;)if(t===(n=r[o]).toLowerCase())return n;return null}var se="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ce=function(e){return!q(e)&&e!==se};var fe,le=(fe="undefined"!=typeof Uint8Array&&C(Uint8Array),function(e){return fe&&e instanceof fe}),de=B("HTMLFormElement"),pe=function(){var e=Object.prototype.hasOwnProperty;return function(t,n){return e.call(t,n)}}(),he=B("RegExp"),ye=function(e,t){var n=Object.getOwnPropertyDescriptors(e),r={};ae(n,function(n,o){var i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};var ve,be,me,ge,we=B("AsyncFunction"),Oe=(ve="function"==typeof setImmediate,be=J(se.postMessage),ve?setImmediate:be?(me="axios@".concat(Math.random()),ge=[],se.addEventListener("message",function(e){var t=e.source,n=e.data;t===se&&n===me&&ge.length&&ge.shift()()},!1),function(e){ge.push(e),se.postMessage(me,"*")}):function(e){return setTimeout(e)}),Ee="undefined"!=typeof queueMicrotask?queueMicrotask.bind(se):"undefined"!=typeof process&&process.nextTick||Oe,Re={isArray:I,isArrayBuffer:z,isBuffer:M,isFormData:function(e){var t;return e&&(Z&&e instanceof Z||J(e.append)&&("formdata"===(t=D(e))||"object"===t&&J(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&z(e.buffer)},isString:H,isNumber:W,isBoolean:function(e){return!0===e||!1===e},isObject:K,isPlainObject:V,isEmptyObject:function(e){if(!K(e)||M(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ne,isRequest:re,isResponse:oe,isHeaders:ie,isUndefined:q,isDate:G,isFile:X,isReactNativeBlob:function(e){return!(!e||void 0===e.uri)},isReactNative:function(e){return e&&void 0!==e.getParts},isBlob:$,isRegExp:he,isFunction:J,isStream:function(e){return K(e)&&J(e.pipe)},isURLSearchParams:ee,isTypedArray:le,isFileList:Q,forEach:ae,merge:function e(){for(var t=ce(this)&&this||{},n=t.caseless,r=t.skipUndefined,o={},i=function(t,i){if("__proto__"!==i&&"constructor"!==i&&"prototype"!==i){var a=n&&ue(o,i)||i;V(o[a])&&V(t)?o[a]=e(o[a],t):V(t)?o[a]=e({},t):I(t)?o[a]=t.slice():r&&q(t)||(o[a]=t)}},a=0,u=arguments.length;a<u;a++)arguments[a]&&ae(arguments[a],i);return o},extend:function(e,t,n){return ae(t,function(t,r){n&&J(t)?Object.defineProperty(e,r,{value:_(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).allOwnKeys}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var o,i,a,u={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],r&&!r(a,e,t)||u[a]||(t[a]=e[a],u[a]=!0);e=!1!==n&&C(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:D,kindOfTest:B,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(I(e))return e;var t=e.length;if(!W(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},forEachEntry:function(e,t){for(var n,r=(e&&e[U]).call(e);(n=r.next())&&!n.done;){var o=n.value;t.call(e,o[0],o[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:de,hasOwnProperty:pe,hasOwnProp:pe,reduceDescriptors:ye,freezeMethods:function(e){ye(e,function(t,n){if(J(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;var r=e[n];J(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:function(e,t){var n={},r=function(e){e.forEach(function(e){n[e]=!0})};return I(e)?r(e):r(String(e).split(t)),n},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n})},noop:function(){},toFiniteNumber:function(e,t){return null!=e&&Number.isFinite(e=+e)?e:t},findKey:ue,global:se,isContextDefined:ce,isSpecCompliantForm:function(e){return!!(e&&J(e.append)&&"FormData"===e[F]&&e[U])},toJSONObject:function(e){var t=new Array(10),n=function(e,r){if(K(e)){if(t.indexOf(e)>=0)return;if(M(e))return e;if(!("toJSON"in e)){t[r]=e;var o=I(e)?[]:{};return ae(e,function(e,t){var i=n(e,r+1);!q(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:we,isThenable:function(e){return e&&(K(e)||J(e))&&J(e.then)&&J(e.catch)},setImmediate:Oe,asap:Ee,isIterable:function(e){return null!=e&&J(e[U])}},Se=function(e){function t(e,n,r,o,i){var a;return c(this,t),a=s(this,t,[e]),Object.defineProperty(a,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),a.name="AxiosError",a.isAxiosError=!0,n&&(a.code=n),r&&(a.config=r),o&&(a.request=o),i&&(a.response=i,a.status=i.status),a}return h(t,e),l(t,[{key:"toJSON",value:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Re.toJSONObject(this.config),code:this.code,status:this.status}}}],[{key:"from",value:function(e,n,r,o,i,a){var u=new t(e.message,n||e.code,r,o,i);return u.cause=e,u.name=e.name,null!=e.status&&null==u.status&&(u.status=e.status),a&&Object.assign(u,a),u}}])}(P(Error));Se.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Se.ERR_BAD_OPTION="ERR_BAD_OPTION",Se.ECONNABORTED="ECONNABORTED",Se.ETIMEDOUT="ETIMEDOUT",Se.ERR_NETWORK="ERR_NETWORK",Se.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Se.ERR_DEPRECATED="ERR_DEPRECATED",Se.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Se.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Se.ERR_CANCELED="ERR_CANCELED",Se.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Se.ERR_INVALID_URL="ERR_INVALID_URL";var Te=Se;function je(e){return Re.isPlainObject(e)||Re.isArray(e)}function Ae(e){return Re.endsWith(e,"[]")?e.slice(0,-2):e}function ke(e,t,n){return e?e.concat(t).map(function(e,t){return e=Ae(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}var Pe=Re.toFlatObject(Re,{},null,function(e){return/^is[A-Z]/.test(e)});function _e(e,t,n){if(!Re.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;var r=(n=Re.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Re.isUndefined(t[e])})).metaTokens,o=n.visitor||c,i=n.dots,a=n.indexes,u=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Re.isSpecCompliantForm(t);if(!Re.isFunction(o))throw new TypeError("visitor must be a function");function s(e){if(null===e)return"";if(Re.isDate(e))return e.toISOString();if(Re.isBoolean(e))return e.toString();if(!u&&Re.isBlob(e))throw new Te("Blob is not supported. Use a Buffer instead.");return Re.isArrayBuffer(e)||Re.isTypedArray(e)?u&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,o){var u=e;if(Re.isReactNative(t)&&Re.isReactNativeBlob(e))return t.append(ke(o,n,i),s(e)),!1;if(e&&!o&&"object"===T(e))if(Re.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Re.isArray(e)&&function(e){return Re.isArray(e)&&!e.some(je)}(e)||(Re.isFileList(e)||Re.endsWith(n,"[]"))&&(u=Re.toArray(e)))return n=Ae(n),u.forEach(function(e,r){!Re.isUndefined(e)&&null!==e&&t.append(!0===a?ke([n],r,i):null===a?n:n+"[]",s(e))}),!1;return!!je(e)||(t.append(ke(o,n,i),s(e)),!1)}var f=[],l=Object.assign(Pe,{defaultVisitor:c,convertValue:s,isVisitable:je});if(!Re.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Re.isUndefined(n)){if(-1!==f.indexOf(n))throw Error("Circular reference detected in "+r.join("."));f.push(n),Re.forEach(n,function(n,i){!0===(!(Re.isUndefined(n)||null===n)&&o.call(t,n,Re.isString(i)?i.trim():i,r,l))&&e(n,r?r.concat(i):[i])}),f.pop()}}(e),t}function xe(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Ne(e,t){this._pairs=[],e&&_e(e,this,t)}var Ce=Ne.prototype;function Ue(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Fe(e,t,n){if(!t)return e;var r,o=n&&n.encode||Ue,i=Re.isFunction(n)?{serialize:n}:n,a=i&&i.serialize;if(r=a?a(t,i):Re.isURLSearchParams(t)?t.toString():new Ne(t,i).toString(o)){var u=e.indexOf("#");-1!==u&&(e=e.slice(0,u)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}Ce.append=function(e,t){this._pairs.push([e,t])},Ce.toString=function(e){var t=e?function(t){return e.call(this,t,xe)}:xe;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};var De=function(){return l(function e(){c(this,e),this.handlers=[]},[{key:"use",value:function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(e){this.handlers[e]&&(this.handlers[e]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(e){Re.forEach(this.handlers,function(t){null!==t&&e(t)})}}])}(),Be={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Le={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ne,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Ie="undefined"!=typeof window&&"undefined"!=typeof document,qe="object"===("undefined"==typeof navigator?"undefined":T(navigator))&&navigator||void 0,Me=Ie&&(!qe||["ReactNative","NativeScript","NS"].indexOf(qe.product)<0),ze="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,He=Ie&&window.location.href||"http://localhost",Je=b(b({},Object.freeze({__proto__:null,hasBrowserEnv:Ie,hasStandardBrowserWebWorkerEnv:ze,hasStandardBrowserEnv:Me,navigator:qe,origin:He})),Le);function We(e){function t(e,n,r,o){var i=e[o++];if("__proto__"===i)return!0;var a=Number.isFinite(+i),u=o>=e.length;return i=!i&&Re.isArray(r)?r.length:i,u?(Re.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a):(r[i]&&Re.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&Re.isArray(r[i])&&(r[i]=function(e){var t,n,r={},o=Object.keys(e),i=o.length;for(t=0;t<i;t++)r[n=o[t]]=e[n];return r}(r[i])),!a)}if(Re.isFormData(e)&&Re.isFunction(e.entries)){var n={};return Re.forEachEntry(e,function(e,r){t(function(e){return Re.matchAll(/\w+|\[(\w*)]/g,e).map(function(e){return"[]"===e[0]?"":e[1]||e[0]})}(e),r,n,0)}),n}return null}var Ke={transitional:Be,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){var n,r=t.getContentType()||"",o=r.indexOf("application/json")>-1,i=Re.isObject(e);if(i&&Re.isHTMLForm(e)&&(e=new FormData(e)),Re.isFormData(e))return o?JSON.stringify(We(e)):e;if(Re.isArrayBuffer(e)||Re.isBuffer(e)||Re.isStream(e)||Re.isFile(e)||Re.isBlob(e)||Re.isReadableStream(e))return e;if(Re.isArrayBufferView(e))return e.buffer;if(Re.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return _e(e,new Je.classes.URLSearchParams,b({visitor:function(e,t,n,r){return Je.isNode&&Re.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((n=Re.isFileList(e))||r.indexOf("multipart/form-data")>-1){var a=this.env&&this.env.FormData;return _e(n?{"files[]":e}:e,a&&new a,this.formSerializer)}}return i||o?(t.setContentType("application/json",!1),function(e,t,n){if(Re.isString(e))try{return(t||JSON.parse)(e),Re.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||Ke.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Re.isResponse(e)||Re.isReadableStream(e))return e;if(e&&Re.isString(e)&&(n&&!this.responseType||r)){var o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(o){if("SyntaxError"===e.name)throw Te.from(e,Te.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Je.classes.FormData,Blob:Je.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Re.forEach(["delete","get","head","post","put","patch"],function(e){Ke.headers[e]={}});var Ve=Ke,Ge=Re.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Xe=Symbol("internals");function $e(e){return e&&String(e).trim().toLowerCase()}function Qe(e){return!1===e||null==e?e:Re.isArray(e)?e.map(Qe):String(e)}function Ye(e,t,n,r,o){return Re.isFunction(r)?r.call(this,t,n):(o&&(t=n),Re.isString(t)?Re.isString(r)?-1!==t.indexOf(r):Re.isRegExp(r)?r.test(t):void 0:void 0)}var Ze=function(){return l(function e(t){c(this,e),t&&this.set(t)},[{key:"set",value:function(e,t,n){var r=this;function o(e,t,n){var o=$e(t);if(!o)throw new Error("header name must be a non-empty string");var i=Re.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Qe(e))}var i=function(e,t){return Re.forEach(e,function(e,n){return o(e,n,t)})};if(Re.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Re.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i(function(e){var t,n,r,o={};return e&&e.split("\n").forEach(function(e){r=e.indexOf(":"),t=e.substring(0,r).trim().toLowerCase(),n=e.substring(r+1).trim(),!t||o[t]&&Ge[t]||("set-cookie"===t?o[t]?o[t].push(n):o[t]=[n]:o[t]=o[t]?o[t]+", "+n:n)}),o}(e),t);else if(Re.isObject(e)&&Re.isIterable(e)){var a,u,s,c={},f=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=j(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e);try{for(f.s();!(s=f.n()).done;){var l=s.value;if(!Re.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(a=c[u])?Re.isArray(a)?[].concat(R(a),[l[1]]):[a,l[1]]:l[1]}}catch(e){f.e(e)}finally{f.f()}i(c,t)}else null!=e&&o(t,e,n);return this}},{key:"get",value:function(e,t){if(e=$e(e)){var n=Re.findKey(this,e);if(n){var r=this[n];if(!t)return r;if(!0===t)return function(e){for(var t,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=r.exec(e);)n[t[1]]=t[2];return n}(r);if(Re.isFunction(t))return t.call(this,r,n);if(Re.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=$e(e)){var n=Re.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ye(0,this[n],n,t))}return!1}},{key:"delete",value:function(e,t){var n=this,r=!1;function o(e){if(e=$e(e)){var o=Re.findKey(n,e);!o||t&&!Ye(0,n[o],o,t)||(delete n[o],r=!0)}}return Re.isArray(e)?e.forEach(o):o(e),r}},{key:"clear",value:function(e){for(var t=Object.keys(this),n=t.length,r=!1;n--;){var o=t[n];e&&!Ye(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}},{key:"normalize",value:function(e){var t=this,n={};return Re.forEach(this,function(r,o){var i=Re.findKey(n,o);if(i)return t[i]=Qe(r),void delete t[o];var a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n})}(o):String(o).trim();a!==o&&delete t[o],t[a]=Qe(r),n[a]=!0}),this}},{key:"concat",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=this.constructor).concat.apply(e,[this].concat(n))}},{key:"toJSON",value:function(e){var t=Object.create(null);return Re.forEach(this,function(n,r){null!=n&&!1!==n&&(t[r]=e&&Re.isArray(n)?n.join(", "):n)}),t}},{key:Symbol.iterator,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map(function(e){var t=E(e,2);return t[0]+": "+t[1]}).join("\n")}},{key:"getSetCookie",value:function(){return this.get("set-cookie")||[]}},{key:Symbol.toStringTag,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(e){return e instanceof this?e:new this(e)}},{key:"concat",value:function(e){for(var t=new this(e),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.forEach(function(e){return t.set(e)}),t}},{key:"accessor",value:function(e){var t=(this[Xe]=this[Xe]={accessors:{}}).accessors,n=this.prototype;function r(e){var r=$e(e);t[r]||(!function(e,t){var n=Re.toCamelCase(" "+t);["get","set","has"].forEach(function(r){Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Re.isArray(e)?e.forEach(r):r(e),this}}])}();Ze.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Re.reduceDescriptors(Ze.prototype,function(e,t){var n=e.value,r=t[0].toUpperCase()+t.slice(1);return{get:function(){return n},set:function(e){this[r]=e}}}),Re.freezeMethods(Ze);var et=Ze;function tt(e,t){var n=this||Ve,r=t||n,o=et.from(r.headers),i=r.data;return Re.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function nt(e){return!(!e||!e.__CANCEL__)}var rt=function(e){function t(e,n,r){var o;return c(this,t),(o=s(this,t,[null==e?"canceled":e,Te.ERR_CANCELED,n,r])).name="CanceledError",o.__CANCEL__=!0,o}return h(t,e),l(t)}(Te);function ot(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Te("Request failed with status code "+n.status,[Te.ERR_BAD_REQUEST,Te.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}var it=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0,o=function(e,t){e=e||10;var n,r=new Array(e),o=new Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(u){var s=Date.now(),c=o[a];n||(n=s),r[i]=u,o[i]=s;for(var f=a,l=0;f!==i;)l+=r[f++],f%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),!(s-n<t)){var d=c&&s-c;return d?Math.round(1e3*l/d):void 0}}}(50,250);return function(e,t){var n,r,o=0,i=1e3/t,a=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(void 0,R(t))};return[function(){for(var e=Date.now(),t=e-o,u=arguments.length,s=new Array(u),c=0;c<u;c++)s[c]=arguments[c];t>=i?a(s,e):(n=s,r||(r=setTimeout(function(){r=null,a(n)},i-t)))},function(){return n&&a(n)}]}(function(n){var i=n.loaded,a=n.lengthComputable?n.total:void 0,u=i-r,s=o(u);r=i;var c=d({loaded:i,total:a,progress:a?i/a:void 0,bytes:u,rate:s||void 0,estimated:s&&a&&i<=a?(a-i)/s:void 0,event:n,lengthComputable:null!=a},t?"download":"upload",!0);e(c)},n)},at=function(e,t){var n=null!=e;return[function(r){return t[0]({lengthComputable:n,total:e,loaded:r})},t[1]]},ut=function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Re.asap(function(){return e.apply(void 0,n)})}},st=Je.hasStandardBrowserEnv?function(e,t){return function(n){return n=new URL(n,Je.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)}}(new URL(Je.origin),Je.navigator&&/(msie|trident)/i.test(Je.navigator.userAgent)):function(){return!0},ct=Je.hasStandardBrowserEnv?{write:function(e,t,n,r,o,i,a){if("undefined"!=typeof document){var u=["".concat(e,"=").concat(encodeURIComponent(t))];Re.isNumber(n)&&u.push("expires=".concat(new Date(n).toUTCString())),Re.isString(r)&&u.push("path=".concat(r)),Re.isString(o)&&u.push("domain=".concat(o)),!0===i&&u.push("secure"),Re.isString(a)&&u.push("SameSite=".concat(a)),document.cookie=u.join("; ")}},read:function(e){if("undefined"==typeof document)return null;var t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove:function(e){this.write(e,"",Date.now()-864e5,"/")}}:{write:function(){},read:function(){return null},remove:function(){}};function ft(e,t,n){var r,o=!("string"==typeof(r=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r));return e&&(o||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var lt=function(e){return e instanceof et?b({},e):e};function dt(e,t){t=t||{};var n={};function r(e,t,n,r){return Re.isPlainObject(e)&&Re.isPlainObject(t)?Re.merge.call({caseless:r},e,t):Re.isPlainObject(t)?Re.merge({},t):Re.isArray(t)?t.slice():t}function o(e,t,n,o){return Re.isUndefined(t)?Re.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Re.isUndefined(t))return r(void 0,t)}function a(e,t){return Re.isUndefined(t)?Re.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function u(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}var s={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u,headers:function(e,t,n){return o(lt(e),lt(t),0,!0)}};return Re.forEach(Object.keys(b(b({},e),t)),function(r){if("__proto__"!==r&&"constructor"!==r&&"prototype"!==r){var i=Re.hasOwnProp(s,r)?s[r]:o,a=i(e[r],t[r],r);Re.isUndefined(a)&&i!==u||(n[r]=a)}}),n}var pt,ht=function(e){var t=dt({},e),n=t.data,r=t.withXSRFToken,o=t.xsrfHeaderName,i=t.xsrfCookieName,a=t.headers,u=t.auth;if(t.headers=a=et.from(a),t.url=Fe(ft(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&a.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),Re.isFormData(n))if(Je.hasStandardBrowserEnv||Je.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(Re.isFunction(n.getHeaders)){var s=n.getHeaders(),c=["content-type","content-length"];Object.entries(s).forEach(function(e){var t=E(e,2),n=t[0],r=t[1];c.includes(n.toLowerCase())&&a.set(n,r)})}if(Je.hasStandardBrowserEnv&&(r&&Re.isFunction(r)&&(r=r(t)),r||!1!==r&&st(t.url))){var f=o&&i&&ct.read(i);f&&a.set(o,f)}return t},yt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){var r,o,i,a,u,s=ht(e),c=s.data,f=et.from(s.headers).normalize(),l=s.responseType,d=s.onUploadProgress,p=s.onDownloadProgress;function h(){a&&a(),u&&u(),s.cancelToken&&s.cancelToken.unsubscribe(r),s.signal&&s.signal.removeEventListener("abort",r)}var y=new XMLHttpRequest;function v(){if(y){var r=et.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());ot(function(e){t(e),h()},function(e){n(e),h()},{data:l&&"text"!==l&&"json"!==l?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y}),y=null}}if(y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout,"onloadend"in y?y.onloadend=v:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(v)},y.onabort=function(){y&&(n(new Te("Request aborted",Te.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){var r=t&&t.message?t.message:"Network Error",o=new Te(r,Te.ERR_NETWORK,e,y);o.event=t||null,n(o),y=null},y.ontimeout=function(){var t=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded",r=s.transitional||Be;s.timeoutErrorMessage&&(t=s.timeoutErrorMessage),n(new Te(t,r.clarifyTimeoutError?Te.ETIMEDOUT:Te.ECONNABORTED,e,y)),y=null},void 0===c&&f.setContentType(null),"setRequestHeader"in y&&Re.forEach(f.toJSON(),function(e,t){y.setRequestHeader(t,e)}),Re.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),l&&"json"!==l&&(y.responseType=s.responseType),p){var b=E(it(p,!0),2);i=b[0],u=b[1],y.addEventListener("progress",i)}if(d&&y.upload){var m=E(it(d),2);o=m[0],a=m[1],y.upload.addEventListener("progress",o),y.upload.addEventListener("loadend",a)}(s.cancelToken||s.signal)&&(r=function(t){y&&(n(!t||t.type?new rt(null,e,y):t),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(r),s.signal&&(s.signal.aborted?r():s.signal.addEventListener("abort",r)));var g,w,O=(g=s.url,(w=/^([-+\w]{1,25})(:?\/\/|:)/.exec(g))&&w[1]||"");O&&-1===Je.protocols.indexOf(O)?n(new Te("Unsupported protocol "+O+":",Te.ERR_BAD_REQUEST,e)):y.send(c||null)})},vt=function(e,t){var n=(e=e?e.filter(Boolean):[]).length;if(t||n){var r,o=new AbortController,i=function(e){if(!r){r=!0,u();var t=e instanceof Error?e:this.reason;o.abort(t instanceof Te?t:new rt(t instanceof Error?t.message:t))}},a=t&&setTimeout(function(){a=null,i(new Te("timeout of ".concat(t,"ms exceeded"),Te.ETIMEDOUT))},t),u=function(){e&&(a&&clearTimeout(a),a=null,e.forEach(function(e){e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(function(e){return e.addEventListener("abort",i)});var s=o.signal;return s.unsubscribe=function(){return Re.asap(u)},s}},bt=m().m(function e(t,n){var r,o,i;return m().w(function(e){for(;;)switch(e.n){case 0:if(r=t.byteLength,n&&!(r<n)){e.n=2;break}return e.n=1,t;case 1:return e.a(2);case 2:o=0;case 3:if(!(o<r)){e.n=5;break}return i=o+n,e.n=4,t.slice(o,i);case 4:o=i,e.n=3;break;case 5:return e.a(2)}},e)}),mt=function(){var e=A(m().m(function e(t,o){var i,a,s,c,f,l,d;return m().w(function(e){for(;;)switch(e.p=e.n){case 0:i=!1,a=!1,e.p=1,c=r(gt(t));case 2:return e.n=3,u(c.next());case 3:if(!(i=!(f=e.v).done)){e.n=5;break}return l=f.value,e.d(w(n(r(bt(l,o)))),4);case 4:i=!1,e.n=2;break;case 5:e.n=7;break;case 6:e.p=6,d=e.v,a=!0,s=d;case 7:if(e.p=7,e.p=8,!i||null==c.return){e.n=9;break}return e.n=9,u(c.return());case 9:if(e.p=9,!a){e.n=10;break}throw s;case 10:return e.f(9);case 11:return e.f(7);case 12:return e.a(2)}},e,null,[[8,,9,11],[1,6,7,12]])}));return function(t,n){return e.apply(this,arguments)}}(),gt=function(){var e=A(m().m(function e(t){var o,i,a,s;return m().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!t[Symbol.asyncIterator]){e.n=2;break}return e.d(w(n(r(t))),1);case 1:return e.a(2);case 2:o=t.getReader(),e.p=3;case 4:return e.n=5,u(o.read());case 5:if(i=e.v,a=i.done,s=i.value,!a){e.n=6;break}return e.a(3,8);case 6:return e.n=7,s;case 7:e.n=4;break;case 8:return e.p=8,e.n=9,u(o.cancel());case 9:return e.f(8);case 10:return e.a(2)}},e,null,[[3,,8,10]])}));return function(t){return e.apply(this,arguments)}}(),wt=function(e,t,n,r){var o,i=mt(e,t),u=0,s=function(e){o||(o=!0,r&&r(e))};return new ReadableStream({pull:function(e){return a(m().m(function t(){var r,o,a,c,f,l;return m().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,i.next();case 1:if(r=t.v,o=r.done,a=r.value,!o){t.n=2;break}return s(),e.close(),t.a(2);case 2:c=a.byteLength,n&&(f=u+=c,n(f)),e.enqueue(new Uint8Array(a)),t.n=4;break;case 3:throw t.p=3,l=t.v,s(l),l;case 4:return t.a(2)}},t,null,[[0,3]])}))()},cancel:function(e){return s(e),i.return()}},{highWaterMark:2})},Ot=Re.isFunction,Et={Request:(pt=Re.global).Request,Response:pt.Response},Rt=Re.global,St=Rt.ReadableStream,Tt=Rt.TextEncoder,jt=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return!!e.apply(void 0,n)}catch(e){return!1}},At=function(e){var t=e=Re.merge.call({skipUndefined:!0},Et,e),n=t.fetch,r=t.Request,o=t.Response,i=n?Ot(n):"function"==typeof fetch,u=Ot(r),s=Ot(o);if(!i)return!1;var c,f=i&&Ot(St),l=i&&("function"==typeof Tt?(c=new Tt,function(e){return c.encode(e)}):function(){var e=a(m().m(function e(t){var n,o;return m().w(function(e){for(;;)switch(e.n){case 0:return n=Uint8Array,e.n=1,new r(t).arrayBuffer();case 1:return o=e.v,e.a(2,new n(o))}},e)}));return function(t){return e.apply(this,arguments)}}()),d=u&&f&&jt(function(){var e=!1,t=new r(Je.origin,{body:new St,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),p=s&&f&&jt(function(){return Re.isReadableStream(new o("").body)}),h={stream:p&&function(e){return e.body}};i&&["text","arrayBuffer","blob","formData","stream"].forEach(function(e){!h[e]&&(h[e]=function(t,n){var r=t&&t[e];if(r)return r.call(t);throw new Te("Response type '".concat(e,"' is not supported"),Te.ERR_NOT_SUPPORT,n)})});var y=function(){var e=a(m().m(function e(t){var n;return m().w(function(e){for(;;)switch(e.n){case 0:if(null!=t){e.n=1;break}return e.a(2,0);case 1:if(!Re.isBlob(t)){e.n=2;break}return e.a(2,t.size);case 2:if(!Re.isSpecCompliantForm(t)){e.n=4;break}return n=new r(Je.origin,{method:"POST",body:t}),e.n=3,n.arrayBuffer();case 3:case 6:return e.a(2,e.v.byteLength);case 4:if(!Re.isArrayBufferView(t)&&!Re.isArrayBuffer(t)){e.n=5;break}return e.a(2,t.byteLength);case 5:if(Re.isURLSearchParams(t)&&(t+=""),!Re.isString(t)){e.n=7;break}return e.n=6,l(t);case 7:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),v=function(){var e=a(m().m(function e(t,n){var r;return m().w(function(e){for(;;)if(0===e.n)return r=Re.toFiniteNumber(t.getContentLength()),e.a(2,null==r?y(n):r)},e)}));return function(t,n){return e.apply(this,arguments)}}();return function(){var e=a(m().m(function e(t){var i,a,s,c,f,l,y,g,w,O,R,S,T,j,A,k,P,_,x,N,C,U,F,D,B,L,I,q,M,z,H,J,W,K,V,G,X,$,Q;return m().w(function(e){for(;;)switch(e.p=e.n){case 0:if(i=ht(t),a=i.url,s=i.method,c=i.data,f=i.signal,l=i.cancelToken,y=i.timeout,g=i.onDownloadProgress,w=i.onUploadProgress,O=i.responseType,R=i.headers,S=i.withCredentials,T=void 0===S?"same-origin":S,j=i.fetchOptions,A=n||fetch,O=O?(O+"").toLowerCase():"text",k=vt([f,l&&l.toAbortSignal()],y),P=null,_=k&&k.unsubscribe&&function(){k.unsubscribe()},e.p=1,!(X=w&&d&&"get"!==s&&"head"!==s)){e.n=3;break}return e.n=2,v(R,c);case 2:$=x=e.v,X=0!==$;case 3:if(!X){e.n=4;break}N=new r(a,{method:"POST",body:c,duplex:"half"}),Re.isFormData(c)&&(C=N.headers.get("content-type"))&&R.setContentType(C),N.body&&(U=at(x,it(ut(w))),F=E(U,2),D=F[0],B=F[1],c=wt(N.body,65536,D,B));case 4:return Re.isString(T)||(T=T?"include":"omit"),L=u&&"credentials"in r.prototype,I=b(b({},j),{},{signal:k,method:s.toUpperCase(),headers:R.normalize().toJSON(),body:c,duplex:"half",credentials:L?T:void 0}),P=u&&new r(a,I),e.n=5,u?A(P,j):A(a,I);case 5:return q=e.v,M=p&&("stream"===O||"response"===O),p&&(g||M&&_)&&(z={},["status","statusText","headers"].forEach(function(e){z[e]=q[e]}),H=Re.toFiniteNumber(q.headers.get("content-length")),J=g&&at(H,it(ut(g),!0))||[],W=E(J,2),K=W[0],V=W[1],q=new o(wt(q.body,65536,K,function(){V&&V(),_&&_()}),z)),O=O||"text",e.n=6,h[Re.findKey(h,O)||"text"](q,t);case 6:return G=e.v,!M&&_&&_(),e.n=7,new Promise(function(e,n){ot(e,n,{data:G,headers:et.from(q.headers),status:q.status,statusText:q.statusText,config:t,request:P})});case 7:return e.a(2,e.v);case 8:if(e.p=8,Q=e.v,_&&_(),!Q||"TypeError"!==Q.name||!/Load failed|fetch/i.test(Q.message)){e.n=9;break}throw Object.assign(new Te("Network Error",Te.ERR_NETWORK,t,P,Q&&Q.response),{cause:Q.cause||Q});case 9:throw Te.from(Q,Q&&Q.code,t,P,Q&&Q.response);case 10:return e.a(2)}},e,null,[[1,8]])}));return function(t){return e.apply(this,arguments)}}()},kt=new Map,Pt=function(e){for(var t,n,r=e&&e.env||{},o=r.fetch,i=[r.Request,r.Response,o],a=i.length,u=kt;a--;)t=i[a],void 0===(n=u.get(t))&&u.set(t,n=a?new Map:At(r)),u=n;return n};Pt();var _t={http:null,xhr:yt,fetch:{get:Pt}};Re.forEach(_t,function(e,t){if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});var xt=function(e){return"- ".concat(e)},Nt=function(e){return Re.isFunction(e)||null===e||!1===e};var Ct={getAdapter:function(e,t){for(var n,r,o=(e=Re.isArray(e)?e:[e]).length,i={},a=0;a<o;a++){var u=void 0;if(r=n=e[a],!Nt(n)&&void 0===(r=_t[(u=String(n)).toLowerCase()]))throw new Te("Unknown adapter '".concat(u,"'"));if(r&&(Re.isFunction(r)||(r=r.get(t))))break;i[u||"#"+a]=r}if(!r){var s=Object.entries(i).map(function(e){var t=E(e,2),n=t[0],r=t[1];return"adapter ".concat(n," ")+(!1===r?"is not supported by the environment":"is not available in the build")}),c=o?s.length>1?"since :\n"+s.map(xt).join("\n"):" "+xt(s[0]):"as no adapter specified";throw new Te("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return r},adapters:_t};function Ut(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new rt(null,e)}function Ft(e){return Ut(e),e.headers=et.from(e.headers),e.data=tt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ct.getAdapter(e.adapter||Ve.adapter,e)(e).then(function(t){return Ut(e),t.data=tt.call(e,e.transformResponse,t),t.headers=et.from(t.headers),t},function(t){return nt(t)||(Ut(e),t&&t.response&&(t.response.data=tt.call(e,e.transformResponse,t.response),t.response.headers=et.from(t.response.headers))),Promise.reject(t)})}var Dt="1.13.6",Bt={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){Bt[e]=function(n){return T(n)===e||"a"+(t<1?"n ":" ")+e}});var Lt={};Bt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Dt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,o,i){if(!1===e)throw new Te(r(o," has been removed"+(t?" in "+t:"")),Te.ERR_DEPRECATED);return t&&!Lt[o]&&(Lt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},Bt.spelling=function(e){return function(t,n){return console.warn("".concat(n," is likely a misspelling of ").concat(e)),!0}};var It={assertOptions:function(e,t,n){if("object"!==T(e))throw new Te("options must be an object",Te.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],a=t[i];if(a){var u=e[i],s=void 0===u||a(u,i,e);if(!0!==s)throw new Te("option "+i+" must be "+s,Te.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Te("Unknown option "+i,Te.ERR_BAD_OPTION)}},validators:Bt},qt=It.validators,Mt=function(){return l(function e(t){c(this,e),this.defaults=t||{},this.interceptors={request:new De,response:new De}},[{key:"request",value:(e=a(m().m(function e(t,n){var r,o,i;return m().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this._request(t,n);case 1:return e.a(2,e.v);case 2:if(e.p=2,(i=e.v)instanceof Error){r={},Error.captureStackTrace?Error.captureStackTrace(r):r=new Error,o=r.stack?r.stack.replace(/^.+\n/,""):"";try{i.stack?o&&!String(i.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(i.stack+="\n"+o):i.stack=o}catch(e){}}throw i;case 3:return e.a(2)}},e,this,[[0,2]])})),function(t,n){return e.apply(this,arguments)})},{key:"_request",value:function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{};var n=t=dt(this.defaults,t),r=n.transitional,o=n.paramsSerializer,i=n.headers;void 0!==r&&It.assertOptions(r,{silentJSONParsing:qt.transitional(qt.boolean),forcedJSONParsing:qt.transitional(qt.boolean),clarifyTimeoutError:qt.transitional(qt.boolean),legacyInterceptorReqResOrdering:qt.transitional(qt.boolean)},!1),null!=o&&(Re.isFunction(o)?t.paramsSerializer={serialize:o}:It.assertOptions(o,{encode:qt.function,serialize:qt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),It.assertOptions(t,{baseUrl:qt.spelling("baseURL"),withXsrfToken:qt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();var a=i&&Re.merge(i.common,i[t.method]);i&&Re.forEach(["delete","get","head","post","put","patch","common"],function(e){delete i[e]}),t.headers=et.concat(a,i);var u=[],s=!0;this.interceptors.request.forEach(function(e){if("function"!=typeof e.runWhen||!1!==e.runWhen(t)){s=s&&e.synchronous;var n=t.transitional||Be;n&&n.legacyInterceptorReqResOrdering?u.unshift(e.fulfilled,e.rejected):u.push(e.fulfilled,e.rejected)}});var c,f=[];this.interceptors.response.forEach(function(e){f.push(e.fulfilled,e.rejected)});var l,d=0;if(!s){var p=[Ft.bind(this),void 0];for(p.unshift.apply(p,u),p.push.apply(p,f),l=p.length,c=Promise.resolve(t);d<l;)c=c.then(p[d++],p[d++]);return c}l=u.length;for(var h=t;d<l;){var y=u[d++],v=u[d++];try{h=y(h)}catch(e){v.call(this,e);break}}try{c=Ft.call(this,h)}catch(e){return Promise.reject(e)}for(d=0,l=f.length;d<l;)c=c.then(f[d++],f[d++]);return c}},{key:"getUri",value:function(e){return Fe(ft((e=dt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}]);var e}();Re.forEach(["delete","get","head","options"],function(e){Mt.prototype[e]=function(t,n){return this.request(dt(n||{},{method:e,url:t,data:(n||{}).data}))}}),Re.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(dt(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Mt.prototype[e]=t(),Mt.prototype[e+"Form"]=t(!0)});var zt=Mt,Ht=function(){function e(t){if(c(this,e),"function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise(function(e){n=e});var r=this;this.promise.then(function(e){if(r._listeners){for(var t=r._listeners.length;t-- >0;)r._listeners[t](e);r._listeners=null}}),this.promise.then=function(e){var t,n=new Promise(function(e){r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},t(function(e,t,o){r.reason||(r.reason=new rt(e,t,o),n(r.reason))})}return l(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}},{key:"toAbortSignal",value:function(){var e=this,t=new AbortController,n=function(e){t.abort(e)};return this.subscribe(n),t.signal.unsubscribe=function(){return e.unsubscribe(n)},t.signal}}],[{key:"source",value:function(){var t;return{token:new e(function(e){t=e}),cancel:t}}}])}(),Jt=Ht;var Wt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Wt).forEach(function(e){var t=E(e,2),n=t[0],r=t[1];Wt[r]=n});var Kt=Wt;var Vt=function e(t){var n=new zt(t),r=_(zt.prototype.request,n);return Re.extend(r,zt.prototype,n,{allOwnKeys:!0}),Re.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(dt(t,n))},r}(Ve);return Vt.Axios=zt,Vt.CanceledError=rt,Vt.CancelToken=Jt,Vt.isCancel=nt,Vt.VERSION=Dt,Vt.toFormData=_e,Vt.AxiosError=Te,Vt.Cancel=Vt.CanceledError,Vt.all=function(e){return Promise.all(e)},Vt.spread=function(e){return function(t){return e.apply(null,t)}},Vt.isAxiosError=function(e){return Re.isObject(e)&&!0===e.isAxiosError},Vt.mergeConfig=dt,Vt.AxiosHeaders=et,Vt.formToJSON=function(e){return We(Re.isHTMLForm(e)?new FormData(e):e)},Vt.getAdapter=Ct.getAdapter,Vt.HttpStatusCode=Kt,Vt.default=Vt,Vt}); | ||
| //# sourceMappingURL=axios.min.js.map |
@@ -1,3 +0,3 @@ | ||
| /*! Axios v1.13.5 Copyright (c) 2026 Matt Zabriskie and contributors */ | ||
| function e(e,t){return function(){return e.apply(t,arguments)}}const{toString:t}=Object.prototype,{getPrototypeOf:n}=Object,{iterator:r,toStringTag:o}=Symbol,s=(i=Object.create(null),e=>{const n=t.call(e);return i[n]||(i[n]=n.slice(8,-1).toLowerCase())});var i;const a=e=>(e=e.toLowerCase(),t=>s(t)===e),c=e=>t=>typeof t===e,{isArray:l}=Array,u=c("undefined");function f(e){return null!==e&&!u(e)&&null!==e.constructor&&!u(e.constructor)&&h(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const d=a("ArrayBuffer");const p=c("string"),h=c("function"),m=c("number"),b=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==s(e))return!1;const t=n(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||o in e||r in e)},g=a("Date"),w=a("File"),E=a("Blob"),R=a("FileList"),O=a("URLSearchParams"),[S,T,A,v]=["ReadableStream","Request","Response","Headers"].map(a);function C(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),l(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(f(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function _(e,t){if(f(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,x=e=>!u(e)&&e!==N;const j=(U="undefined"!=typeof Uint8Array&&n(Uint8Array),e=>U&&e instanceof U);var U;const P=a("HTMLFormElement"),F=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),L=a("RegExp"),D=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};C(n,(n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)}),Object.defineProperties(e,r)};const B=a("AsyncFunction"),k=(q="function"==typeof setImmediate,I=h(N.postMessage),q?setImmediate:I?(M=`axios@${Math.random()}`,z=[],N.addEventListener("message",({source:e,data:t})=>{e===N&&t===M&&z.length&&z.shift()()},!1),e=>{z.push(e),N.postMessage(M,"*")}):e=>setTimeout(e));var q,I,M,z;const H="undefined"!=typeof queueMicrotask?queueMicrotask.bind(N):"undefined"!=typeof process&&process.nextTick||k,J={isArray:l,isArrayBuffer:d,isBuffer:f,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||h(e.append)&&("formdata"===(t=s(e))||"object"===t&&h(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&d(e.buffer),t},isString:p,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:b,isPlainObject:y,isEmptyObject:e=>{if(!b(e)||f(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:S,isRequest:T,isResponse:A,isHeaders:v,isUndefined:u,isDate:g,isFile:w,isBlob:E,isRegExp:L,isFunction:h,isStream:e=>b(e)&&h(e.pipe),isURLSearchParams:O,isTypedArray:j,isFileList:R,forEach:C,merge:function e(){const{caseless:t,skipUndefined:n}=x(this)&&this||{},r={},o=(o,s)=>{if("__proto__"===s||"constructor"===s||"prototype"===s)return;const i=t&&_(r,s)||s;y(r[i])&&y(o)?r[i]=e(r[i],o):y(o)?r[i]=e({},o):l(o)?r[i]=o.slice():n&&u(o)||(r[i]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&C(arguments[e],o);return r},extend:(t,n,r,{allOwnKeys:o}={})=>(C(n,(n,o)=>{r&&h(n)?Object.defineProperty(t,o,{value:e(n,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,o,{value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),t),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,r,o)=>{let s,i,a;const c={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],o&&!o(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==r&&n(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:a,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(l(e))return e;let t=e.length;if(!m(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[r]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:P,hasOwnProperty:F,hasOwnProp:F,reduceDescriptors:D,freezeMethods:e=>{D(e,(t,n)=>{if(h(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];h(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return l(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:_,global:N,isContextDefined:x,isSpecCompliantForm:function(e){return!!(e&&h(e.append)&&"FormData"===e[o]&&e[r])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(b(e)){if(t.indexOf(e)>=0)return;if(f(e))return e;if(!("toJSON"in e)){t[r]=e;const o=l(e)?[]:{};return C(e,(e,t)=>{const s=n(e,r+1);!u(s)&&(o[t]=s)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:B,isThenable:e=>e&&(b(e)||h(e))&&h(e.then)&&h(e.catch),setImmediate:k,asap:H,isIterable:e=>null!=e&&h(e[r])};class W extends Error{static from(e,t,n,r,o,s){const i=new W(e.message,t||e.code,n,r,o);return i.cause=e,i.name=e.name,s&&Object.assign(i,s),i}constructor(e,t,n,r,o){super(e),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:J.toJSONObject(this.config),code:this.code,status:this.status}}}W.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",W.ERR_BAD_OPTION="ERR_BAD_OPTION",W.ECONNABORTED="ECONNABORTED",W.ETIMEDOUT="ETIMEDOUT",W.ERR_NETWORK="ERR_NETWORK",W.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",W.ERR_DEPRECATED="ERR_DEPRECATED",W.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",W.ERR_BAD_REQUEST="ERR_BAD_REQUEST",W.ERR_CANCELED="ERR_CANCELED",W.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",W.ERR_INVALID_URL="ERR_INVALID_URL";const V=W;function $(e){return J.isPlainObject(e)||J.isArray(e)}function K(e){return J.endsWith(e,"[]")?e.slice(0,-2):e}function X(e,t,n){return e?e.concat(t).map(function(e,t){return e=K(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const G=J.toFlatObject(J,{},null,function(e){return/^is[A-Z]/.test(e)});function Q(e,t,n){if(!J.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=J.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!J.isUndefined(t[e])})).metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&J.isSpecCompliantForm(t);if(!J.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(J.isDate(e))return e.toISOString();if(J.isBoolean(e))return e.toString();if(!a&&J.isBlob(e))throw new V("Blob is not supported. Use a Buffer instead.");return J.isArrayBuffer(e)||J.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(J.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(J.isArray(e)&&function(e){return J.isArray(e)&&!e.some($)}(e)||(J.isFileList(e)||J.endsWith(n,"[]"))&&(a=J.toArray(e)))return n=K(n),a.forEach(function(e,r){!J.isUndefined(e)&&null!==e&&t.append(!0===i?X([n],r,s):null===i?n:n+"[]",c(e))}),!1;return!!$(e)||(t.append(X(o,n,s),c(e)),!1)}const u=[],f=Object.assign(G,{defaultVisitor:l,convertValue:c,isVisitable:$});if(!J.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!J.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),J.forEach(n,function(n,s){!0===(!(J.isUndefined(n)||null===n)&&o.call(t,n,J.isString(s)?s.trim():s,r,f))&&e(n,r?r.concat(s):[s])}),u.pop()}}(e),t}function Y(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Z(e,t){this._pairs=[],e&&Q(e,this,t)}const ee=Z.prototype;function te(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ne(e,t,n){if(!t)return e;const r=n&&n.encode||te,o=J.isFunction(n)?{serialize:n}:n,s=o&&o.serialize;let i;if(i=s?s(t,o):J.isURLSearchParams(t)?t.toString():new Z(t,o).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}ee.append=function(e,t){this._pairs.push([e,t])},ee.toString=function(e){const t=e?function(t){return e.call(this,t,Y)}:Y;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const re=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){J.forEach(this.handlers,function(t){null!==t&&e(t)})}},oe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},se={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Z,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ie="undefined"!=typeof window&&"undefined"!=typeof document,ae="object"==typeof navigator&&navigator||void 0,ce=ie&&(!ae||["ReactNative","NativeScript","NS"].indexOf(ae.product)<0),le="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ue=ie&&window.location.href||"http://localhost",fe={...Object.freeze({__proto__:null,hasBrowserEnv:ie,hasStandardBrowserWebWorkerEnv:le,hasStandardBrowserEnv:ce,navigator:ae,origin:ue}),...se};function de(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&J.isArray(r)?r.length:s,a)return J.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&J.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&J.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i}if(J.isFormData(e)&&J.isFunction(e.entries)){const n={};return J.forEachEntry(e,(e,r)=>{t(function(e){return J.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const pe={transitional:oe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=J.isObject(e);o&&J.isHTMLForm(e)&&(e=new FormData(e));if(J.isFormData(e))return r?JSON.stringify(de(e)):e;if(J.isArrayBuffer(e)||J.isBuffer(e)||J.isStream(e)||J.isFile(e)||J.isBlob(e)||J.isReadableStream(e))return e;if(J.isArrayBufferView(e))return e.buffer;if(J.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Q(e,new fe.classes.URLSearchParams,{visitor:function(e,t,n,r){return fe.isNode&&J.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=J.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Q(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(J.isString(e))try{return(t||JSON.parse)(e),J.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||pe.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(J.isResponse(e)||J.isReadableStream(e))return e;if(e&&J.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw V.from(e,V.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:fe.classes.FormData,Blob:fe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};J.forEach(["delete","get","head","post","put","patch"],e=>{pe.headers[e]={}});const he=pe,me=J.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),be=Symbol("internals");function ye(e){return e&&String(e).trim().toLowerCase()}function ge(e){return!1===e||null==e?e:J.isArray(e)?e.map(ge):String(e)}function we(e,t,n,r,o){return J.isFunction(r)?r.call(this,t,n):(o&&(t=n),J.isString(t)?J.isString(r)?-1!==t.indexOf(r):J.isRegExp(r)?r.test(t):void 0:void 0)}class Ee{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=ye(t);if(!o)throw new Error("header name must be a non-empty string");const s=J.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=ge(e))}const s=(e,t)=>J.forEach(e,(e,n)=>o(e,n,t));if(J.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(J.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&me[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(J.isObject(e)&&J.isIterable(e)){let n,r,o={};for(const t of e){if(!J.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?J.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=ye(e)){const n=J.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(J.isFunction(t))return t.call(this,e,n);if(J.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ye(e)){const n=J.findKey(this,e);return!(!n||void 0===this[n]||t&&!we(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=ye(e)){const o=J.findKey(n,e);!o||t&&!we(0,n[o],o,t)||(delete n[o],r=!0)}}return J.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!we(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return J.forEach(this,(r,o)=>{const s=J.findKey(n,o);if(s)return t[s]=ge(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=ge(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return J.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&J.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[be]=this[be]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ye(e);t[r]||(!function(e,t){const n=J.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return J.isArray(e)?e.forEach(r):r(e),this}}Ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),J.reduceDescriptors(Ee.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),J.freezeMethods(Ee);const Re=Ee;function Oe(e,t){const n=this||he,r=t||n,o=Re.from(r.headers);let s=r.data;return J.forEach(e,function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Se(e){return!(!e||!e.__CANCEL__)}const Te=class extends V{constructor(e,t,n){super(null==e?"canceled":e,V.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Ae(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new V("Request failed with status code "+n.status,[V.ERR_BAD_REQUEST,V.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const ve=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let u=i,f=0;for(;u!==s;)f+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=l&&c-l;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},s-a)))},()=>n&&i(n)]}(n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-r,c=o(a);r=s;e({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},Ce=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},_e=e=>(...t)=>J.asap(()=>e(...t)),Ne=fe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,fe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(fe.origin),fe.navigator&&/(msie|trident)/i.test(fe.navigator.userAgent)):()=>!0,xe=fe.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];J.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),J.isString(r)&&a.push(`path=${r}`),J.isString(o)&&a.push(`domain=${o}`),!0===s&&a.push("secure"),J.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function je(e,t,n){let r=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ue=e=>e instanceof Re?{...e}:e;function Pe(e,t){t=t||{};const n={};function r(e,t,n,r){return J.isPlainObject(e)&&J.isPlainObject(t)?J.merge.call({caseless:r},e,t):J.isPlainObject(t)?J.merge({},t):J.isArray(t)?t.slice():t}function o(e,t,n,o){return J.isUndefined(t)?J.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!J.isUndefined(t))return r(void 0,t)}function i(e,t){return J.isUndefined(t)?J.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>o(Ue(e),Ue(t),0,!0)};return J.forEach(Object.keys({...e,...t}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const s=J.hasOwnProp(c,r)?c[r]:o,i=s(e[r],t[r],r);J.isUndefined(i)&&s!==a||(n[r]=i)}),n}const Fe=e=>{const t=Pe({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;if(t.headers=i=Re.from(i),t.url=ne(je(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),J.isFormData(n))if(fe.hasStandardBrowserEnv||fe.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(J.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)})}if(fe.hasStandardBrowserEnv&&(r&&J.isFunction(r)&&(r=r(t)),r||!1!==r&&Ne(t.url))){const e=o&&s&&xe.read(s);e&&i.set(o,e)}return t},Le="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Fe(e);let o=r.data;const s=Re.from(r.headers).normalize();let i,a,c,l,u,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=r;function h(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function b(){if(!m)return;const r=Re.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Ae(function(e){t(e),h()},function(e){n(e),h()},{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=b:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(b)},m.onabort=function(){m&&(n(new V("Request aborted",V.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new V(r,V.ERR_NETWORK,e,m);o.event=t||null,n(o),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||oe;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new V(t,o.clarifyTimeoutError?V.ETIMEDOUT:V.ECONNABORTED,e,m)),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&J.forEach(s.toJSON(),function(e,t){m.setRequestHeader(t,e)}),J.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),f&&"json"!==f&&(m.responseType=r.responseType),p&&([c,u]=ve(p,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,l]=ve(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new Te(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===fe.protocols.indexOf(y)?n(new V("Unsupported protocol "+y+":",V.ERR_BAD_REQUEST,e)):m.send(o||null)})},De=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof V?t:new Te(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new V(`timeout of ${t}ms exceeded`,V.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>J.asap(i),a}},Be=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},ke=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},qe=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of ke(e))yield*Be(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:Ie}=J,Me=(({Request:e,Response:t})=>({Request:e,Response:t}))(J.global),{ReadableStream:ze,TextEncoder:He}=J.global,Je=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},We=e=>{e=J.merge.call({skipUndefined:!0},Me,e);const{fetch:t,Request:n,Response:r}=e,o=t?Ie(t):"function"==typeof fetch,s=Ie(n),i=Ie(r);if(!o)return!1;const a=o&&Ie(ze),c=o&&("function"==typeof He?(l=new He,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const u=s&&a&&Je(()=>{let e=!1;const t=new n(fe.origin,{body:new ze,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),f=i&&a&&Je(()=>J.isReadableStream(new r("").body)),d={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new V(`Response type '${e}' is not supported`,V.ERR_NOT_SUPPORT,n)})});const p=async(e,t)=>{const r=J.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(J.isBlob(e))return e.size;if(J.isSpecCompliantForm(e)){const t=new n(fe.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return J.isArrayBufferView(e)||J.isArrayBuffer(e)?e.byteLength:(J.isURLSearchParams(e)&&(e+=""),J.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:i,data:a,signal:c,cancelToken:l,timeout:h,onDownloadProgress:m,onUploadProgress:b,responseType:y,headers:g,withCredentials:w="same-origin",fetchOptions:E}=Fe(e),R=t||fetch;y=y?(y+"").toLowerCase():"text";let O=De([c,l&&l.toAbortSignal()],h),S=null;const T=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let A;try{if(b&&u&&"get"!==i&&"head"!==i&&0!==(A=await p(g,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(J.isFormData(a)&&(e=t.headers.get("content-type"))&&g.setContentType(e),t.body){const[e,n]=Ce(A,ve(_e(b)));a=qe(t.body,65536,e,n)}}J.isString(w)||(w=w?"include":"omit");const t=s&&"credentials"in n.prototype,c={...E,signal:O,method:i.toUpperCase(),headers:g.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};S=s&&new n(o,c);let l=await(s?R(S,E):R(o,c));const h=f&&("stream"===y||"response"===y);if(f&&(m||h&&T)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=l[t]});const t=J.toFiniteNumber(l.headers.get("content-length")),[n,o]=m&&Ce(t,ve(_e(m),!0))||[];l=new r(qe(l.body,65536,n,()=>{o&&o(),T&&T()}),e)}y=y||"text";let v=await d[J.findKey(d,y)||"text"](l,e);return!h&&T&&T(),await new Promise((t,n)=>{Ae(t,n,{data:v,headers:Re.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:S})})}catch(t){if(T&&T(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new V("Network Error",V.ERR_NETWORK,e,S,t&&t.response),{cause:t.cause||t});throw V.from(t,t&&t.code,e,S,t&&t.response)}}},Ve=new Map,$e=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,l=Ve;for(;c--;)i=s[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:We(t)),l=a;return a};$e();const Ke={http:null,xhr:Le,fetch:{get:$e}};J.forEach(Ke,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Xe=e=>`- ${e}`,Ge=e=>J.isFunction(e)||null===e||!1===e;const Qe={getAdapter:function(e,t){e=J.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){let n;if(r=e[i],o=r,!Ge(r)&&(o=Ke[(n=String(r)).toLowerCase()],void 0===o))throw new V(`Unknown adapter '${n}'`);if(o&&(J.isFunction(o)||(o=o.get(t))))break;s[n||"#"+i]=o}if(!o){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(Xe).join("\n"):" "+Xe(e[0]):"as no adapter specified";throw new V("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:Ke};function Ye(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Te(null,e)}function Ze(e){Ye(e),e.headers=Re.from(e.headers),e.data=Oe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Qe.getAdapter(e.adapter||he.adapter,e)(e).then(function(t){return Ye(e),t.data=Oe.call(e,e.transformResponse,t),t.headers=Re.from(t.headers),t},function(t){return Se(t)||(Ye(e),t&&t.response&&(t.response.data=Oe.call(e,e.transformResponse,t.response),t.response.headers=Re.from(t.response.headers))),Promise.reject(t)})}const et="1.13.5",tt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{tt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const nt={};tt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+et+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new V(r(o," has been removed"+(t?" in "+t:"")),V.ERR_DEPRECATED);return t&&!nt[o]&&(nt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},tt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const rt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new V("options must be an object",V.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new V("option "+s+" must be "+n,V.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new V("Unknown option "+s,V.ERR_BAD_OPTION)}},validators:tt},ot=rt.validators;class st{constructor(e){this.defaults=e||{},this.interceptors={request:new re,response:new re}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Pe(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&rt.assertOptions(n,{silentJSONParsing:ot.transitional(ot.boolean),forcedJSONParsing:ot.transitional(ot.boolean),clarifyTimeoutError:ot.transitional(ot.boolean),legacyInterceptorReqResOrdering:ot.transitional(ot.boolean)},!1),null!=r&&(J.isFunction(r)?t.paramsSerializer={serialize:r}:rt.assertOptions(r,{encode:ot.function,serialize:ot.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),rt.assertOptions(t,{baseUrl:ot.spelling("baseURL"),withXsrfToken:ot.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&J.merge(o.common,o[t.method]);o&&J.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Re.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const n=t.transitional||oe;n&&n.legacyInterceptorReqResOrdering?i.unshift(e.fulfilled,e.rejected):i.push(e.fulfilled,e.rejected)});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,f=0;if(!a){const e=[Ze.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);f<u;)l=l.then(e[f++],e[f++]);return l}u=i.length;let d=t;for(;f<u;){const e=i[f++],t=i[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{l=Ze.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,u=c.length;f<u;)l=l.then(c[f++],c[f++]);return l}getUri(e){return ne(je((e=Pe(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}J.forEach(["delete","get","head","options"],function(e){st.prototype[e]=function(t,n){return this.request(Pe(n||{},{method:e,url:t,data:(n||{}).data}))}}),J.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(Pe(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}st.prototype[e]=t(),st.prototype[e+"Form"]=t(!0)});const it=st;class at{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new Te(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new at(function(t){e=t}),cancel:e}}}const ct=at;const lt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(lt).forEach(([e,t])=>{lt[t]=e});const ut=lt;const ft=function t(n){const r=new it(n),o=e(it.prototype.request,r);return J.extend(o,it.prototype,r,{allOwnKeys:!0}),J.extend(o,r,null,{allOwnKeys:!0}),o.create=function(e){return t(Pe(n,e))},o}(he);ft.Axios=it,ft.CanceledError=Te,ft.CancelToken=ct,ft.isCancel=Se,ft.VERSION=et,ft.toFormData=Q,ft.AxiosError=V,ft.Cancel=ft.CanceledError,ft.all=function(e){return Promise.all(e)},ft.spread=function(e){return function(t){return e.apply(null,t)}},ft.isAxiosError=function(e){return J.isObject(e)&&!0===e.isAxiosError},ft.mergeConfig=Pe,ft.AxiosHeaders=Re,ft.formToJSON=e=>de(J.isHTMLForm(e)?new FormData(e):e),ft.getAdapter=Qe.getAdapter,ft.HttpStatusCode=ut,ft.default=ft;const dt=ft,{Axios:pt,AxiosError:ht,CanceledError:mt,isCancel:bt,CancelToken:yt,VERSION:gt,all:wt,Cancel:Et,isAxiosError:Rt,spread:Ot,toFormData:St,AxiosHeaders:Tt,HttpStatusCode:At,formToJSON:vt,getAdapter:Ct,mergeConfig:_t}=dt;export{pt as Axios,ht as AxiosError,Tt as AxiosHeaders,Et as Cancel,yt as CancelToken,mt as CanceledError,At as HttpStatusCode,gt as VERSION,wt as all,dt as default,vt as formToJSON,Ct as getAdapter,Rt as isAxiosError,bt as isCancel,_t as mergeConfig,Ot as spread,St as toFormData}; | ||
| /*! Axios v1.13.6 Copyright (c) 2026 Matt Zabriskie and contributors */ | ||
| function e(e,t){return function(){return e.apply(t,arguments)}}const{toString:t}=Object.prototype,{getPrototypeOf:n}=Object,{iterator:r,toStringTag:o}=Symbol,s=(i=Object.create(null),e=>{const n=t.call(e);return i[n]||(i[n]=n.slice(8,-1).toLowerCase())});var i;const a=e=>(e=e.toLowerCase(),t=>s(t)===e),c=e=>t=>typeof t===e,{isArray:l}=Array,u=c("undefined");function f(e){return null!==e&&!u(e)&&null!==e.constructor&&!u(e.constructor)&&h(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const d=a("ArrayBuffer");const p=c("string"),h=c("function"),m=c("number"),b=e=>null!==e&&"object"==typeof e,g=e=>{if("object"!==s(e))return!1;const t=n(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||o in e||r in e)},y=a("Date"),w=a("File"),E=a("Blob"),R=a("FileList");const O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},S=void 0!==O.FormData?O.FormData:void 0,T=a("URLSearchParams"),[A,v,C,N]=["ReadableStream","Request","Response","Headers"].map(a);function _(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),l(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(f(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function x(e,t){if(f(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,P=e=>!u(e)&&e!==j;const U=(F="undefined"!=typeof Uint8Array&&n(Uint8Array),e=>F&&e instanceof F);var F;const L=a("HTMLFormElement"),B=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),D=a("RegExp"),k=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};_(n,(n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)}),Object.defineProperties(e,r)};const q=a("AsyncFunction"),I=(M="function"==typeof setImmediate,z=h(j.postMessage),M?setImmediate:z?(H=`axios@${Math.random()}`,J=[],j.addEventListener("message",({source:e,data:t})=>{e===j&&t===H&&J.length&&J.shift()()},!1),e=>{J.push(e),j.postMessage(H,"*")}):e=>setTimeout(e));var M,z,H,J;const W="undefined"!=typeof queueMicrotask?queueMicrotask.bind(j):"undefined"!=typeof process&&process.nextTick||I,V={isArray:l,isArrayBuffer:d,isBuffer:f,isFormData:e=>{let t;return e&&(S&&e instanceof S||h(e.append)&&("formdata"===(t=s(e))||"object"===t&&h(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&d(e.buffer),t},isString:p,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:b,isPlainObject:g,isEmptyObject:e=>{if(!b(e)||f(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:A,isRequest:v,isResponse:C,isHeaders:N,isUndefined:u,isDate:y,isFile:w,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:E,isRegExp:D,isFunction:h,isStream:e=>b(e)&&h(e.pipe),isURLSearchParams:T,isTypedArray:U,isFileList:R,forEach:_,merge:function e(){const{caseless:t,skipUndefined:n}=P(this)&&this||{},r={},o=(o,s)=>{if("__proto__"===s||"constructor"===s||"prototype"===s)return;const i=t&&x(r,s)||s;g(r[i])&&g(o)?r[i]=e(r[i],o):g(o)?r[i]=e({},o):l(o)?r[i]=o.slice():n&&u(o)||(r[i]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&_(arguments[e],o);return r},extend:(t,n,r,{allOwnKeys:o}={})=>(_(n,(n,o)=>{r&&h(n)?Object.defineProperty(t,o,{value:e(n,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,o,{value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),t),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,r,o)=>{let s,i,a;const c={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],o&&!o(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==r&&n(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:a,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(l(e))return e;let t=e.length;if(!m(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[r]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:L,hasOwnProperty:B,hasOwnProp:B,reduceDescriptors:k,freezeMethods:e=>{k(e,(t,n)=>{if(h(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];h(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return l(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:x,global:j,isContextDefined:P,isSpecCompliantForm:function(e){return!!(e&&h(e.append)&&"FormData"===e[o]&&e[r])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(b(e)){if(t.indexOf(e)>=0)return;if(f(e))return e;if(!("toJSON"in e)){t[r]=e;const o=l(e)?[]:{};return _(e,(e,t)=>{const s=n(e,r+1);!u(s)&&(o[t]=s)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:q,isThenable:e=>e&&(b(e)||h(e))&&h(e.then)&&h(e.catch),setImmediate:I,asap:W,isIterable:e=>null!=e&&h(e[r])};class $ extends Error{static from(e,t,n,r,o,s){const i=new $(e.message,t||e.code,n,r,o);return i.cause=e,i.name=e.name,null!=e.status&&null==i.status&&(i.status=e.status),s&&Object.assign(i,s),i}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:V.toJSONObject(this.config),code:this.code,status:this.status}}}$.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",$.ERR_BAD_OPTION="ERR_BAD_OPTION",$.ECONNABORTED="ECONNABORTED",$.ETIMEDOUT="ETIMEDOUT",$.ERR_NETWORK="ERR_NETWORK",$.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",$.ERR_DEPRECATED="ERR_DEPRECATED",$.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",$.ERR_BAD_REQUEST="ERR_BAD_REQUEST",$.ERR_CANCELED="ERR_CANCELED",$.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",$.ERR_INVALID_URL="ERR_INVALID_URL";const K=$;function X(e){return V.isPlainObject(e)||V.isArray(e)}function G(e){return V.endsWith(e,"[]")?e.slice(0,-2):e}function Q(e,t,n){return e?e.concat(t).map(function(e,t){return e=G(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Y=V.toFlatObject(V,{},null,function(e){return/^is[A-Z]/.test(e)});function Z(e,t,n){if(!V.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=V.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!V.isUndefined(t[e])})).metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&V.isSpecCompliantForm(t);if(!V.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(V.isDate(e))return e.toISOString();if(V.isBoolean(e))return e.toString();if(!a&&V.isBlob(e))throw new K("Blob is not supported. Use a Buffer instead.");return V.isArrayBuffer(e)||V.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if(V.isReactNative(t)&&V.isReactNativeBlob(e))return t.append(Q(o,n,s),c(e)),!1;if(e&&!o&&"object"==typeof e)if(V.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(V.isArray(e)&&function(e){return V.isArray(e)&&!e.some(X)}(e)||(V.isFileList(e)||V.endsWith(n,"[]"))&&(a=V.toArray(e)))return n=G(n),a.forEach(function(e,r){!V.isUndefined(e)&&null!==e&&t.append(!0===i?Q([n],r,s):null===i?n:n+"[]",c(e))}),!1;return!!X(e)||(t.append(Q(o,n,s),c(e)),!1)}const u=[],f=Object.assign(Y,{defaultVisitor:l,convertValue:c,isVisitable:X});if(!V.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!V.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),V.forEach(n,function(n,s){!0===(!(V.isUndefined(n)||null===n)&&o.call(t,n,V.isString(s)?s.trim():s,r,f))&&e(n,r?r.concat(s):[s])}),u.pop()}}(e),t}function ee(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function te(e,t){this._pairs=[],e&&Z(e,this,t)}const ne=te.prototype;function re(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function oe(e,t,n){if(!t)return e;const r=n&&n.encode||re,o=V.isFunction(n)?{serialize:n}:n,s=o&&o.serialize;let i;if(i=s?s(t,o):V.isURLSearchParams(t)?t.toString():new te(t,o).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}ne.append=function(e,t){this._pairs.push([e,t])},ne.toString=function(e){const t=e?function(t){return e.call(this,t,ee)}:ee;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const se=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){V.forEach(this.handlers,function(t){null!==t&&e(t)})}},ie={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ae={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:te,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ce="undefined"!=typeof window&&"undefined"!=typeof document,le="object"==typeof navigator&&navigator||void 0,ue=ce&&(!le||["ReactNative","NativeScript","NS"].indexOf(le.product)<0),fe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,de=ce&&window.location.href||"http://localhost",pe={...Object.freeze({__proto__:null,hasBrowserEnv:ce,hasStandardBrowserWebWorkerEnv:fe,hasStandardBrowserEnv:ue,navigator:le,origin:de}),...ae};function he(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&V.isArray(r)?r.length:s,a)return V.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&V.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&V.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i}if(V.isFormData(e)&&V.isFunction(e.entries)){const n={};return V.forEachEntry(e,(e,r)=>{t(function(e){return V.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const me={transitional:ie,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=V.isObject(e);o&&V.isHTMLForm(e)&&(e=new FormData(e));if(V.isFormData(e))return r?JSON.stringify(he(e)):e;if(V.isArrayBuffer(e)||V.isBuffer(e)||V.isStream(e)||V.isFile(e)||V.isBlob(e)||V.isReadableStream(e))return e;if(V.isArrayBufferView(e))return e.buffer;if(V.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Z(e,new pe.classes.URLSearchParams,{visitor:function(e,t,n,r){return pe.isNode&&V.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=V.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Z(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(V.isString(e))try{return(t||JSON.parse)(e),V.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||me.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(V.isResponse(e)||V.isReadableStream(e))return e;if(e&&V.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw K.from(e,K.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pe.classes.FormData,Blob:pe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};V.forEach(["delete","get","head","post","put","patch"],e=>{me.headers[e]={}});const be=me,ge=V.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ye=Symbol("internals");function we(e){return e&&String(e).trim().toLowerCase()}function Ee(e){return!1===e||null==e?e:V.isArray(e)?e.map(Ee):String(e)}function Re(e,t,n,r,o){return V.isFunction(r)?r.call(this,t,n):(o&&(t=n),V.isString(t)?V.isString(r)?-1!==t.indexOf(r):V.isRegExp(r)?r.test(t):void 0:void 0)}class Oe{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=we(t);if(!o)throw new Error("header name must be a non-empty string");const s=V.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=Ee(e))}const s=(e,t)=>V.forEach(e,(e,n)=>o(e,n,t));if(V.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(V.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&ge[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(V.isObject(e)&&V.isIterable(e)){let n,r,o={};for(const t of e){if(!V.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?V.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=we(e)){const n=V.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(V.isFunction(t))return t.call(this,e,n);if(V.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=we(e)){const n=V.findKey(this,e);return!(!n||void 0===this[n]||t&&!Re(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=we(e)){const o=V.findKey(n,e);!o||t&&!Re(0,n[o],o,t)||(delete n[o],r=!0)}}return V.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Re(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return V.forEach(this,(r,o)=>{const s=V.findKey(n,o);if(s)return t[s]=Ee(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=Ee(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return V.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&V.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[ye]=this[ye]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=we(e);t[r]||(!function(e,t){const n=V.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return V.isArray(e)?e.forEach(r):r(e),this}}Oe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),V.reduceDescriptors(Oe.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),V.freezeMethods(Oe);const Se=Oe;function Te(e,t){const n=this||be,r=t||n,o=Se.from(r.headers);let s=r.data;return V.forEach(e,function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Ae(e){return!(!e||!e.__CANCEL__)}const ve=class extends K{constructor(e,t,n){super(null==e?"canceled":e,K.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Ce(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new K("Request failed with status code "+n.status,[K.ERR_BAD_REQUEST,K.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Ne=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let u=i,f=0;for(;u!==s;)f+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=l&&c-l;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},s-a)))},()=>n&&i(n)]}(n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-r,c=o(a);r=s;e({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},_e=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},xe=e=>(...t)=>V.asap(()=>e(...t)),je=pe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,pe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(pe.origin),pe.navigator&&/(msie|trident)/i.test(pe.navigator.userAgent)):()=>!0,Pe=pe.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];V.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),V.isString(r)&&a.push(`path=${r}`),V.isString(o)&&a.push(`domain=${o}`),!0===s&&a.push("secure"),V.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Ue(e,t,n){let r=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Fe=e=>e instanceof Se?{...e}:e;function Le(e,t){t=t||{};const n={};function r(e,t,n,r){return V.isPlainObject(e)&&V.isPlainObject(t)?V.merge.call({caseless:r},e,t):V.isPlainObject(t)?V.merge({},t):V.isArray(t)?t.slice():t}function o(e,t,n,o){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!V.isUndefined(t))return r(void 0,t)}function i(e,t){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>o(Fe(e),Fe(t),0,!0)};return V.forEach(Object.keys({...e,...t}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const s=V.hasOwnProp(c,r)?c[r]:o,i=s(e[r],t[r],r);V.isUndefined(i)&&s!==a||(n[r]=i)}),n}const Be=e=>{const t=Le({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;if(t.headers=i=Se.from(i),t.url=oe(Ue(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),V.isFormData(n))if(pe.hasStandardBrowserEnv||pe.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(V.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)})}if(pe.hasStandardBrowserEnv&&(r&&V.isFunction(r)&&(r=r(t)),r||!1!==r&&je(t.url))){const e=o&&s&&Pe.read(s);e&&i.set(o,e)}return t},De="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Be(e);let o=r.data;const s=Se.from(r.headers).normalize();let i,a,c,l,u,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=r;function h(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function b(){if(!m)return;const r=Se.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Ce(function(e){t(e),h()},function(e){n(e),h()},{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=b:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(b)},m.onabort=function(){m&&(n(new K("Request aborted",K.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new K(r,K.ERR_NETWORK,e,m);o.event=t||null,n(o),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||ie;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new K(t,o.clarifyTimeoutError?K.ETIMEDOUT:K.ECONNABORTED,e,m)),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&V.forEach(s.toJSON(),function(e,t){m.setRequestHeader(t,e)}),V.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),f&&"json"!==f&&(m.responseType=r.responseType),p&&([c,u]=Ne(p,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,l]=Ne(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new ve(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);g&&-1===pe.protocols.indexOf(g)?n(new K("Unsupported protocol "+g+":",K.ERR_BAD_REQUEST,e)):m.send(o||null)})},ke=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof K?t:new ve(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new K(`timeout of ${t}ms exceeded`,K.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>V.asap(i),a}},qe=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Ie=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Me=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of Ie(e))yield*qe(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:ze}=V,He=(({Request:e,Response:t})=>({Request:e,Response:t}))(V.global),{ReadableStream:Je,TextEncoder:We}=V.global,Ve=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},$e=e=>{e=V.merge.call({skipUndefined:!0},He,e);const{fetch:t,Request:n,Response:r}=e,o=t?ze(t):"function"==typeof fetch,s=ze(n),i=ze(r);if(!o)return!1;const a=o&&ze(Je),c=o&&("function"==typeof We?(l=new We,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const u=s&&a&&Ve(()=>{let e=!1;const t=new n(pe.origin,{body:new Je,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),f=i&&a&&Ve(()=>V.isReadableStream(new r("").body)),d={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new K(`Response type '${e}' is not supported`,K.ERR_NOT_SUPPORT,n)})});const p=async(e,t)=>{const r=V.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(V.isBlob(e))return e.size;if(V.isSpecCompliantForm(e)){const t=new n(pe.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return V.isArrayBufferView(e)||V.isArrayBuffer(e)?e.byteLength:(V.isURLSearchParams(e)&&(e+=""),V.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:i,data:a,signal:c,cancelToken:l,timeout:h,onDownloadProgress:m,onUploadProgress:b,responseType:g,headers:y,withCredentials:w="same-origin",fetchOptions:E}=Be(e),R=t||fetch;g=g?(g+"").toLowerCase():"text";let O=ke([c,l&&l.toAbortSignal()],h),S=null;const T=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let A;try{if(b&&u&&"get"!==i&&"head"!==i&&0!==(A=await p(y,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(V.isFormData(a)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=_e(A,Ne(xe(b)));a=Me(t.body,65536,e,n)}}V.isString(w)||(w=w?"include":"omit");const t=s&&"credentials"in n.prototype,c={...E,signal:O,method:i.toUpperCase(),headers:y.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};S=s&&new n(o,c);let l=await(s?R(S,E):R(o,c));const h=f&&("stream"===g||"response"===g);if(f&&(m||h&&T)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=l[t]});const t=V.toFiniteNumber(l.headers.get("content-length")),[n,o]=m&&_e(t,Ne(xe(m),!0))||[];l=new r(Me(l.body,65536,n,()=>{o&&o(),T&&T()}),e)}g=g||"text";let v=await d[V.findKey(d,g)||"text"](l,e);return!h&&T&&T(),await new Promise((t,n)=>{Ce(t,n,{data:v,headers:Se.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:S})})}catch(t){if(T&&T(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new K("Network Error",K.ERR_NETWORK,e,S,t&&t.response),{cause:t.cause||t});throw K.from(t,t&&t.code,e,S,t&&t.response)}}},Ke=new Map,Xe=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,l=Ke;for(;c--;)i=s[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:$e(t)),l=a;return a};Xe();const Ge={http:null,xhr:De,fetch:{get:Xe}};V.forEach(Ge,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Qe=e=>`- ${e}`,Ye=e=>V.isFunction(e)||null===e||!1===e;const Ze={getAdapter:function(e,t){e=V.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){let n;if(r=e[i],o=r,!Ye(r)&&(o=Ge[(n=String(r)).toLowerCase()],void 0===o))throw new K(`Unknown adapter '${n}'`);if(o&&(V.isFunction(o)||(o=o.get(t))))break;s[n||"#"+i]=o}if(!o){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(Qe).join("\n"):" "+Qe(e[0]):"as no adapter specified";throw new K("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:Ge};function et(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ve(null,e)}function tt(e){et(e),e.headers=Se.from(e.headers),e.data=Te.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ze.getAdapter(e.adapter||be.adapter,e)(e).then(function(t){return et(e),t.data=Te.call(e,e.transformResponse,t),t.headers=Se.from(t.headers),t},function(t){return Ae(t)||(et(e),t&&t.response&&(t.response.data=Te.call(e,e.transformResponse,t.response),t.response.headers=Se.from(t.response.headers))),Promise.reject(t)})}const nt="1.13.6",rt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{rt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const ot={};rt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+nt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new K(r(o," has been removed"+(t?" in "+t:"")),K.ERR_DEPRECATED);return t&&!ot[o]&&(ot[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},rt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const st={assertOptions:function(e,t,n){if("object"!=typeof e)throw new K("options must be an object",K.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new K("option "+s+" must be "+n,K.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new K("Unknown option "+s,K.ERR_BAD_OPTION)}},validators:rt},it=st.validators;class at{constructor(e){this.defaults=e||{},this.interceptors={request:new se,response:new se}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Le(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&st.assertOptions(n,{silentJSONParsing:it.transitional(it.boolean),forcedJSONParsing:it.transitional(it.boolean),clarifyTimeoutError:it.transitional(it.boolean),legacyInterceptorReqResOrdering:it.transitional(it.boolean)},!1),null!=r&&(V.isFunction(r)?t.paramsSerializer={serialize:r}:st.assertOptions(r,{encode:it.function,serialize:it.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),st.assertOptions(t,{baseUrl:it.spelling("baseURL"),withXsrfToken:it.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&V.merge(o.common,o[t.method]);o&&V.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Se.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const n=t.transitional||ie;n&&n.legacyInterceptorReqResOrdering?i.unshift(e.fulfilled,e.rejected):i.push(e.fulfilled,e.rejected)});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,f=0;if(!a){const e=[tt.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);f<u;)l=l.then(e[f++],e[f++]);return l}u=i.length;let d=t;for(;f<u;){const e=i[f++],t=i[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{l=tt.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,u=c.length;f<u;)l=l.then(c[f++],c[f++]);return l}getUri(e){return oe(Ue((e=Le(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}V.forEach(["delete","get","head","options"],function(e){at.prototype[e]=function(t,n){return this.request(Le(n||{},{method:e,url:t,data:(n||{}).data}))}}),V.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(Le(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}at.prototype[e]=t(),at.prototype[e+"Form"]=t(!0)});const ct=at;class lt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new ve(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new lt(function(t){e=t}),cancel:e}}}const ut=lt;const ft={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ft).forEach(([e,t])=>{ft[t]=e});const dt=ft;const pt=function t(n){const r=new ct(n),o=e(ct.prototype.request,r);return V.extend(o,ct.prototype,r,{allOwnKeys:!0}),V.extend(o,r,null,{allOwnKeys:!0}),o.create=function(e){return t(Le(n,e))},o}(be);pt.Axios=ct,pt.CanceledError=ve,pt.CancelToken=ut,pt.isCancel=Ae,pt.VERSION=nt,pt.toFormData=Z,pt.AxiosError=K,pt.Cancel=pt.CanceledError,pt.all=function(e){return Promise.all(e)},pt.spread=function(e){return function(t){return e.apply(null,t)}},pt.isAxiosError=function(e){return V.isObject(e)&&!0===e.isAxiosError},pt.mergeConfig=Le,pt.AxiosHeaders=Se,pt.formToJSON=e=>he(V.isHTMLForm(e)?new FormData(e):e),pt.getAdapter=Ze.getAdapter,pt.HttpStatusCode=dt,pt.default=pt;const ht=pt,{Axios:mt,AxiosError:bt,CanceledError:gt,isCancel:yt,CancelToken:wt,VERSION:Et,all:Rt,Cancel:Ot,isAxiosError:St,spread:Tt,toFormData:At,AxiosHeaders:vt,HttpStatusCode:Ct,formToJSON:Nt,getAdapter:_t,mergeConfig:xt}=ht;export{mt as Axios,bt as AxiosError,vt as AxiosHeaders,Ot as Cancel,wt as CancelToken,gt as CanceledError,Ct as HttpStatusCode,Et as VERSION,Rt as all,ht as default,Nt as formToJSON,_t as getAdapter,St as isAxiosError,yt as isCancel,xt as mergeConfig,Tt as spread,At as toFormData}; | ||
| //# sourceMappingURL=axios.min.js.map |
+231
-106
@@ -5,15 +5,37 @@ interface RawAxiosHeaders { | ||
| type MethodsHeaders = Partial<{ | ||
| [Key in axios.Method as Lowercase<Key>]: AxiosHeaders; | ||
| } & {common: AxiosHeaders}>; | ||
| type MethodsHeaders = Partial< | ||
| { | ||
| [Key in axios.Method as Lowercase<Key>]: AxiosHeaders; | ||
| } & { common: AxiosHeaders } | ||
| >; | ||
| type AxiosHeaderMatcher = string | RegExp | ((this: AxiosHeaders, value: string, name: string) => boolean); | ||
| type AxiosHeaderMatcher = | ||
| | string | ||
| | RegExp | ||
| | ((this: AxiosHeaders, value: string, name: string) => boolean); | ||
| type AxiosHeaderParser = (this: AxiosHeaders, value: axios.AxiosHeaderValue, header: string) => any; | ||
| type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent'| 'Content-Encoding' | 'Authorization'; | ||
| type CommonRequestHeadersList = | ||
| | 'Accept' | ||
| | 'Content-Length' | ||
| | 'User-Agent' | ||
| | 'Content-Encoding' | ||
| | 'Authorization'; | ||
| type ContentType = axios.AxiosHeaderValue | 'text/html' | 'text/plain' | 'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded' | 'application/octet-stream'; | ||
| type ContentType = | ||
| | axios.AxiosHeaderValue | ||
| | 'text/html' | ||
| | 'text/plain' | ||
| | 'multipart/form-data' | ||
| | 'application/json' | ||
| | 'application/x-www-form-urlencoded' | ||
| | 'application/octet-stream'; | ||
| type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding'; | ||
| type CommonResponseHeadersList = | ||
| | 'Server' | ||
| | 'Content-Type' | ||
| | 'Content-Length' | ||
| | 'Cache-Control' | ||
| | 'Content-Encoding'; | ||
@@ -23,9 +45,11 @@ type BrowserProgressEvent = any; | ||
| declare class AxiosHeaders { | ||
| constructor( | ||
| headers?: RawAxiosHeaders | AxiosHeaders | string | ||
| ); | ||
| constructor(headers?: RawAxiosHeaders | AxiosHeaders | string); | ||
| [key: string]: any; | ||
| set(headerName?: string, value?: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; | ||
| set( | ||
| headerName?: string, | ||
| value?: axios.AxiosHeaderValue, | ||
| rewrite?: boolean | AxiosHeaderMatcher | ||
| ): AxiosHeaders; | ||
| set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders; | ||
@@ -44,3 +68,5 @@ | ||
| concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders; | ||
| concat( | ||
| ...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null> | ||
| ): AxiosHeaders; | ||
@@ -53,3 +79,5 @@ toJSON(asStrings?: boolean): RawAxiosHeaders; | ||
| static concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders; | ||
| static concat( | ||
| ...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null> | ||
| ): AxiosHeaders; | ||
@@ -61,3 +89,6 @@ setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; | ||
| setContentLength(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; | ||
| setContentLength( | ||
| value: axios.AxiosHeaderValue, | ||
| rewrite?: boolean | AxiosHeaderMatcher | ||
| ): AxiosHeaders; | ||
| getContentLength(parser?: RegExp): RegExpExecArray | null; | ||
@@ -77,3 +108,6 @@ getContentLength(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; | ||
| setContentEncoding(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; | ||
| setContentEncoding( | ||
| value: axios.AxiosHeaderValue, | ||
| rewrite?: boolean | AxiosHeaderMatcher | ||
| ): AxiosHeaders; | ||
| getContentEncoding(parser?: RegExp): RegExpExecArray | null; | ||
@@ -83,3 +117,6 @@ getContentEncoding(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; | ||
| setAuthorization(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; | ||
| setAuthorization( | ||
| value: axios.AxiosHeaderValue, | ||
| rewrite?: boolean | AxiosHeaderMatcher | ||
| ): AxiosHeaders; | ||
| getAuthorization(parser?: RegExp): RegExpExecArray | null; | ||
@@ -96,7 +133,7 @@ getAuthorization(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; | ||
| constructor( | ||
| message?: string, | ||
| code?: string, | ||
| config?: axios.InternalAxiosRequestConfig<D>, | ||
| request?: any, | ||
| response?: axios.AxiosResponse<T, D> | ||
| message?: string, | ||
| code?: string, | ||
| config?: axios.InternalAxiosRequestConfig<D>, | ||
| request?: any, | ||
| response?: axios.AxiosResponse<T, D> | ||
| ); | ||
@@ -119,20 +156,19 @@ | ||
| response?: axios.AxiosResponse<T, D>, | ||
| customProps?: object, | ||
| ): AxiosError<T, D>; | ||
| static readonly ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS"; | ||
| static readonly ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE"; | ||
| static readonly ERR_BAD_OPTION = "ERR_BAD_OPTION"; | ||
| static readonly ERR_NETWORK = "ERR_NETWORK"; | ||
| static readonly ERR_DEPRECATED = "ERR_DEPRECATED"; | ||
| static readonly ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE"; | ||
| static readonly ERR_BAD_REQUEST = "ERR_BAD_REQUEST"; | ||
| static readonly ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT"; | ||
| static readonly ERR_INVALID_URL = "ERR_INVALID_URL"; | ||
| static readonly ERR_CANCELED = "ERR_CANCELED"; | ||
| static readonly ECONNABORTED = "ECONNABORTED"; | ||
| static readonly ETIMEDOUT = "ETIMEDOUT"; | ||
| customProps?: object | ||
| ): AxiosError<T, D>; | ||
| static readonly ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS'; | ||
| static readonly ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE'; | ||
| static readonly ERR_BAD_OPTION = 'ERR_BAD_OPTION'; | ||
| static readonly ERR_NETWORK = 'ERR_NETWORK'; | ||
| static readonly ERR_DEPRECATED = 'ERR_DEPRECATED'; | ||
| static readonly ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE'; | ||
| static readonly ERR_BAD_REQUEST = 'ERR_BAD_REQUEST'; | ||
| static readonly ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT'; | ||
| static readonly ERR_INVALID_URL = 'ERR_INVALID_URL'; | ||
| static readonly ERR_CANCELED = 'ERR_CANCELED'; | ||
| static readonly ECONNABORTED = 'ECONNABORTED'; | ||
| static readonly ETIMEDOUT = 'ETIMEDOUT'; | ||
| } | ||
| declare class CanceledError<T> extends AxiosError<T> { | ||
| } | ||
| declare class CanceledError<T> extends AxiosError<T> {} | ||
@@ -147,13 +183,51 @@ declare class Axios { | ||
| getUri(config?: axios.AxiosRequestConfig): string; | ||
| request<T = any, R = axios.AxiosResponse<T>, D = any>(config: axios.AxiosRequestConfig<D>): Promise<R>; | ||
| get<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>; | ||
| delete<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>; | ||
| head<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>; | ||
| options<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>; | ||
| post<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>; | ||
| put<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>; | ||
| patch<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>; | ||
| postForm<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>; | ||
| putForm<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>; | ||
| patchForm<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>; | ||
| request<T = any, R = axios.AxiosResponse<T>, D = any>( | ||
| config: axios.AxiosRequestConfig<D> | ||
| ): Promise<R>; | ||
| get<T = any, R = axios.AxiosResponse<T>, D = any>( | ||
| url: string, | ||
| config?: axios.AxiosRequestConfig<D> | ||
| ): Promise<R>; | ||
| delete<T = any, R = axios.AxiosResponse<T>, D = any>( | ||
| url: string, | ||
| config?: axios.AxiosRequestConfig<D> | ||
| ): Promise<R>; | ||
| head<T = any, R = axios.AxiosResponse<T>, D = any>( | ||
| url: string, | ||
| config?: axios.AxiosRequestConfig<D> | ||
| ): Promise<R>; | ||
| options<T = any, R = axios.AxiosResponse<T>, D = any>( | ||
| url: string, | ||
| config?: axios.AxiosRequestConfig<D> | ||
| ): Promise<R>; | ||
| post<T = any, R = axios.AxiosResponse<T>, D = any>( | ||
| url: string, | ||
| data?: D, | ||
| config?: axios.AxiosRequestConfig<D> | ||
| ): Promise<R>; | ||
| put<T = any, R = axios.AxiosResponse<T>, D = any>( | ||
| url: string, | ||
| data?: D, | ||
| config?: axios.AxiosRequestConfig<D> | ||
| ): Promise<R>; | ||
| patch<T = any, R = axios.AxiosResponse<T>, D = any>( | ||
| url: string, | ||
| data?: D, | ||
| config?: axios.AxiosRequestConfig<D> | ||
| ): Promise<R>; | ||
| postForm<T = any, R = axios.AxiosResponse<T>, D = any>( | ||
| url: string, | ||
| data?: D, | ||
| config?: axios.AxiosRequestConfig<D> | ||
| ): Promise<R>; | ||
| putForm<T = any, R = axios.AxiosResponse<T>, D = any>( | ||
| url: string, | ||
| data?: D, | ||
| config?: axios.AxiosRequestConfig<D> | ||
| ): Promise<R>; | ||
| patchForm<T = any, R = axios.AxiosResponse<T>, D = any>( | ||
| url: string, | ||
| data?: D, | ||
| config?: axios.AxiosRequestConfig<D> | ||
| ): Promise<R>; | ||
| } | ||
@@ -232,7 +306,9 @@ | ||
| type RawAxiosRequestHeaders = Partial<RawAxiosHeaders & { | ||
| [Key in CommonRequestHeadersList]: AxiosHeaderValue; | ||
| } & { | ||
| 'Content-Type': ContentType | ||
| }>; | ||
| type RawAxiosRequestHeaders = Partial< | ||
| RawAxiosHeaders & { | ||
| [Key in CommonRequestHeadersList]: AxiosHeaderValue; | ||
| } & { | ||
| 'Content-Type': ContentType; | ||
| } | ||
| >; | ||
@@ -246,3 +322,3 @@ type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders; | ||
| } & { | ||
| "set-cookie": string[]; | ||
| 'set-cookie': string[]; | ||
| }; | ||
@@ -259,3 +335,8 @@ | ||
| interface AxiosResponseTransformer { | ||
| (this: InternalAxiosRequestConfig, data: any, headers: AxiosResponseHeaders, status?: number): any; | ||
| ( | ||
| this: InternalAxiosRequestConfig, | ||
| data: any, | ||
| headers: AxiosResponseHeaders, | ||
| status?: number | ||
| ): any; | ||
| } | ||
@@ -280,35 +361,50 @@ | ||
| type Method = | ||
| | 'get' | 'GET' | ||
| | 'delete' | 'DELETE' | ||
| | 'head' | 'HEAD' | ||
| | 'options' | 'OPTIONS' | ||
| | 'post' | 'POST' | ||
| | 'put' | 'PUT' | ||
| | 'patch' | 'PATCH' | ||
| | 'purge' | 'PURGE' | ||
| | 'link' | 'LINK' | ||
| | 'unlink' | 'UNLINK'; | ||
| | 'get' | ||
| | 'GET' | ||
| | 'delete' | ||
| | 'DELETE' | ||
| | 'head' | ||
| | 'HEAD' | ||
| | 'options' | ||
| | 'OPTIONS' | ||
| | 'post' | ||
| | 'POST' | ||
| | 'put' | ||
| | 'PUT' | ||
| | 'patch' | ||
| | 'PATCH' | ||
| | 'purge' | ||
| | 'PURGE' | ||
| | 'link' | ||
| | 'LINK' | ||
| | 'unlink' | ||
| | 'UNLINK'; | ||
| type ResponseType = | ||
| | 'arraybuffer' | ||
| | 'blob' | ||
| | 'document' | ||
| | 'json' | ||
| | 'text' | ||
| | 'stream' | ||
| | 'formdata'; | ||
| type ResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream' | 'formdata'; | ||
| type responseEncoding = | ||
| | 'ascii' | 'ASCII' | ||
| | 'ansi' | 'ANSI' | ||
| | 'binary' | 'BINARY' | ||
| | 'base64' | 'BASE64' | ||
| | 'base64url' | 'BASE64URL' | ||
| | 'hex' | 'HEX' | ||
| | 'latin1' | 'LATIN1' | ||
| | 'ucs-2' | 'UCS-2' | ||
| | 'ucs2' | 'UCS2' | ||
| | 'utf-8' | 'UTF-8' | ||
| | 'utf8' | 'UTF8' | ||
| | 'utf16le' | 'UTF16LE'; | ||
| | 'ascii' | ||
| | 'ASCII' | ||
| | 'ansi' | ||
| | 'ANSI' | ||
| | 'binary' | ||
| | 'BINARY' | ||
| | 'base64' | ||
| | 'BASE64' | ||
| | 'base64url' | ||
| | 'BASE64URL' | ||
| | 'hex' | ||
| | 'HEX' | ||
| | 'latin1' | ||
| | 'LATIN1' | ||
| | 'ucs-2' | ||
| | 'UCS-2' | ||
| | 'ucs2' | ||
| | 'UCS2' | ||
| | 'utf-8' | ||
| | 'UTF-8' | ||
| | 'utf8' | ||
| | 'UTF8' | ||
| | 'utf16le' | ||
| | 'UTF16LE'; | ||
@@ -337,7 +433,7 @@ interface TransitionalOptions { | ||
| ( | ||
| this: GenericFormData, | ||
| value: any, | ||
| key: string | number, | ||
| path: null | Array<string | number>, | ||
| helpers: FormDataVisitorHelpers | ||
| this: GenericFormData, | ||
| value: any, | ||
| key: string | number, | ||
| path: null | Array<string | number>, | ||
| helpers: FormDataVisitorHelpers | ||
| ): boolean; | ||
@@ -354,4 +450,3 @@ } | ||
| // tslint:disable-next-line | ||
| interface FormSerializerOptions extends SerializerOptions { | ||
| } | ||
| interface FormSerializerOptions extends SerializerOptions {} | ||
@@ -430,3 +525,6 @@ interface ParamEncoder { | ||
| maxRate?: number | [MaxUploadRate, MaxDownloadRate]; | ||
| beforeRedirect?: (options: Record<string, any>, responseDetails: {headers: Record<string, string>, statusCode: HttpStatusCode}) => void; | ||
| beforeRedirect?: ( | ||
| options: Record<string, any>, | ||
| responseDetails: { headers: Record<string, string>; statusCode: HttpStatusCode } | ||
| ) => void; | ||
| socketPath?: string | null; | ||
@@ -447,4 +545,4 @@ transport?: any; | ||
| Response?: new ( | ||
| body?: ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | string | null, | ||
| init?: ResponseInit | ||
| body?: ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | string | null, | ||
| init?: ResponseInit | ||
| ) => Response; | ||
@@ -454,6 +552,23 @@ }; | ||
| family?: AddressFamily; | ||
| lookup?: ((hostname: string, options: object, cb: (err: Error | null, address: LookupAddress | LookupAddress[], family?: AddressFamily) => void) => void) | | ||
| ((hostname: string, options: object) => Promise<[address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | LookupAddress>); | ||
| lookup?: | ||
| | (( | ||
| hostname: string, | ||
| options: object, | ||
| cb: ( | ||
| err: Error | null, | ||
| address: LookupAddress | LookupAddress[], | ||
| family?: AddressFamily | ||
| ) => void | ||
| ) => void) | ||
| | (( | ||
| hostname: string, | ||
| options: object | ||
| ) => Promise< | ||
| | [address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | ||
| | LookupAddress | ||
| >); | ||
| withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined); | ||
| fetchOptions?: Omit<RequestInit, 'body' | 'headers' | 'method' | 'signal'> | Record<string, any>; | ||
| fetchOptions?: | ||
| | Omit<RequestInit, 'body' | 'headers' | 'method' | 'signal'> | ||
| | Record<string, any>; | ||
| httpVersion?: 1 | 2; | ||
@@ -494,7 +609,7 @@ http2Options?: Record<string, any> & { | ||
| interface AxiosResponse<T = any, D = any, H = {}> { | ||
| interface AxiosResponse<T = any, D = any, H = {}> { | ||
| data: T; | ||
| status: number; | ||
| statusText: string; | ||
| headers: H & RawAxiosResponseHeaders | AxiosResponseHeaders; | ||
| headers: (H & RawAxiosResponseHeaders) | AxiosResponseHeaders; | ||
| config: InternalAxiosRequestConfig<D>; | ||
@@ -569,3 +684,6 @@ request?: any; | ||
| <T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>; | ||
| <T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>; | ||
| <T = any, R = AxiosResponse<T>, D = any>( | ||
| url: string, | ||
| config?: AxiosRequestConfig<D> | ||
| ): Promise<R>; | ||
@@ -575,4 +693,4 @@ create(config?: CreateAxiosDefaults): AxiosInstance; | ||
| headers: HeadersDefaults & { | ||
| [key: string]: AxiosHeaderValue | ||
| } | ||
| [key: string]: AxiosHeaderValue; | ||
| }; | ||
| }; | ||
@@ -603,7 +721,14 @@ } | ||
| isAxiosError<T = any, D = any>(payload: any): payload is AxiosError<T, D>; | ||
| toFormData(sourceObj: object, targetFormData?: GenericFormData, options?: FormSerializerOptions): GenericFormData; | ||
| formToJSON(form: GenericFormData|GenericHTMLFormElement): object; | ||
| toFormData( | ||
| sourceObj: object, | ||
| targetFormData?: GenericFormData, | ||
| options?: FormSerializerOptions | ||
| ): GenericFormData; | ||
| formToJSON(form: GenericFormData | GenericHTMLFormElement): object; | ||
| getAdapter(adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined): AxiosAdapter; | ||
| AxiosHeaders: typeof AxiosHeaders; | ||
| mergeConfig<D = any>(config1: AxiosRequestConfig<D>, config2: AxiosRequestConfig<D>): AxiosRequestConfig<D>; | ||
| mergeConfig<D = any>( | ||
| config1: AxiosRequestConfig<D>, | ||
| config2: AxiosRequestConfig<D> | ||
| ): AxiosRequestConfig<D>; | ||
| } | ||
@@ -610,0 +735,0 @@ } |
+3
-3
@@ -22,3 +22,3 @@ import axios from './lib/axios.js'; | ||
| getAdapter, | ||
| mergeConfig | ||
| mergeConfig, | ||
| } = axios; | ||
@@ -43,3 +43,3 @@ | ||
| getAdapter, | ||
| mergeConfig | ||
| } | ||
| mergeConfig, | ||
| }; |
+18
-14
@@ -5,3 +5,3 @@ import utils from '../utils.js'; | ||
| import * as fetchAdapter from './fetch.js'; | ||
| import AxiosError from "../core/AxiosError.js"; | ||
| import AxiosError from '../core/AxiosError.js'; | ||
@@ -14,3 +14,3 @@ /** | ||
| * - `fetch` for fetch API-based requests | ||
| * | ||
| * | ||
| * @type {Object<string, Function|Object>} | ||
@@ -23,3 +23,3 @@ */ | ||
| get: fetchAdapter.getFetch, | ||
| } | ||
| }, | ||
| }; | ||
@@ -41,3 +41,3 @@ | ||
| * Render a rejection reason string for unknown or unsupported adapters | ||
| * | ||
| * | ||
| * @param {string} reason | ||
@@ -50,7 +50,8 @@ * @returns {string} | ||
| * Check if the adapter is resolved (function, null, or false) | ||
| * | ||
| * | ||
| * @param {Function|null|false} adapter | ||
| * @returns {boolean} | ||
| */ | ||
| const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false; | ||
| const isResolvedHandle = (adapter) => | ||
| utils.isFunction(adapter) || adapter === null || adapter === false; | ||
@@ -61,3 +62,3 @@ /** | ||
| * Throws an AxiosError if no adapter is suitable. | ||
| * | ||
| * | ||
| * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function. | ||
@@ -99,10 +100,13 @@ * @param {Object} config - Axios request configuration | ||
| if (!adapter) { | ||
| const reasons = Object.entries(rejectedReasons) | ||
| .map(([id, state]) => `adapter ${id} ` + | ||
| const reasons = Object.entries(rejectedReasons).map( | ||
| ([id, state]) => | ||
| `adapter ${id} ` + | ||
| (state === false ? 'is not supported by the environment' : 'is not available in the build') | ||
| ); | ||
| ); | ||
| let s = length ? | ||
| (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : | ||
| 'as no adapter specified'; | ||
| let s = length | ||
| ? reasons.length > 1 | ||
| ? 'since :\n' + reasons.map(renderReason).join('\n') | ||
| : ' ' + renderReason(reasons[0]) | ||
| : 'as no adapter specified'; | ||
@@ -132,3 +136,3 @@ throw new AxiosError( | ||
| */ | ||
| adapters: knownAdapters | ||
| adapters: knownAdapters, | ||
| }; |
+133
-87
@@ -1,24 +0,26 @@ | ||
| import platform from "../platform/index.js"; | ||
| import utils from "../utils.js"; | ||
| import AxiosError from "../core/AxiosError.js"; | ||
| import composeSignals from "../helpers/composeSignals.js"; | ||
| import {trackStream} from "../helpers/trackStream.js"; | ||
| import AxiosHeaders from "../core/AxiosHeaders.js"; | ||
| import {progressEventReducer, progressEventDecorator, asyncDecorator} from "../helpers/progressEventReducer.js"; | ||
| import resolveConfig from "../helpers/resolveConfig.js"; | ||
| import settle from "../core/settle.js"; | ||
| import platform from '../platform/index.js'; | ||
| import utils from '../utils.js'; | ||
| import AxiosError from '../core/AxiosError.js'; | ||
| import composeSignals from '../helpers/composeSignals.js'; | ||
| import { trackStream } from '../helpers/trackStream.js'; | ||
| import AxiosHeaders from '../core/AxiosHeaders.js'; | ||
| import { | ||
| progressEventReducer, | ||
| progressEventDecorator, | ||
| asyncDecorator, | ||
| } from '../helpers/progressEventReducer.js'; | ||
| import resolveConfig from '../helpers/resolveConfig.js'; | ||
| import settle from '../core/settle.js'; | ||
| const DEFAULT_CHUNK_SIZE = 64 * 1024; | ||
| const {isFunction} = utils; | ||
| const { isFunction } = utils; | ||
| const globalFetchAPI = (({Request, Response}) => ({ | ||
| Request, Response | ||
| const globalFetchAPI = (({ Request, Response }) => ({ | ||
| Request, | ||
| Response, | ||
| }))(utils.global); | ||
| const { | ||
| ReadableStream, TextEncoder | ||
| } = utils.global; | ||
| const { ReadableStream, TextEncoder } = utils.global; | ||
| const test = (fn, ...args) => { | ||
@@ -28,12 +30,16 @@ try { | ||
| } catch (e) { | ||
| return false | ||
| return false; | ||
| } | ||
| } | ||
| }; | ||
| const factory = (env) => { | ||
| env = utils.merge.call({ | ||
| skipUndefined: true | ||
| }, globalFetchAPI, env); | ||
| env = utils.merge.call( | ||
| { | ||
| skipUndefined: true, | ||
| }, | ||
| globalFetchAPI, | ||
| env | ||
| ); | ||
| const {fetch: envFetch, Request, Response} = env; | ||
| const { fetch: envFetch, Request, Response } = env; | ||
| const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function'; | ||
@@ -49,42 +55,57 @@ const isRequestSupported = isFunction(Request); | ||
| const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? | ||
| ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : | ||
| async (str) => new Uint8Array(await new Request(str).arrayBuffer()) | ||
| ); | ||
| const encodeText = | ||
| isFetchSupported && | ||
| (typeof TextEncoder === 'function' | ||
| ? ( | ||
| (encoder) => (str) => | ||
| encoder.encode(str) | ||
| )(new TextEncoder()) | ||
| : async (str) => new Uint8Array(await new Request(str).arrayBuffer())); | ||
| const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { | ||
| let duplexAccessed = false; | ||
| const supportsRequestStream = | ||
| isRequestSupported && | ||
| isReadableStreamSupported && | ||
| test(() => { | ||
| let duplexAccessed = false; | ||
| const hasContentType = new Request(platform.origin, { | ||
| body: new ReadableStream(), | ||
| method: 'POST', | ||
| get duplex() { | ||
| duplexAccessed = true; | ||
| return 'half'; | ||
| }, | ||
| }).headers.has('Content-Type'); | ||
| const hasContentType = new Request(platform.origin, { | ||
| body: new ReadableStream(), | ||
| method: 'POST', | ||
| get duplex() { | ||
| duplexAccessed = true; | ||
| return 'half'; | ||
| }, | ||
| }).headers.has('Content-Type'); | ||
| return duplexAccessed && !hasContentType; | ||
| }); | ||
| return duplexAccessed && !hasContentType; | ||
| }); | ||
| const supportsResponseStream = isResponseSupported && isReadableStreamSupported && | ||
| const supportsResponseStream = | ||
| isResponseSupported && | ||
| isReadableStreamSupported && | ||
| test(() => utils.isReadableStream(new Response('').body)); | ||
| const resolvers = { | ||
| stream: supportsResponseStream && ((res) => res.body) | ||
| stream: supportsResponseStream && ((res) => res.body), | ||
| }; | ||
| isFetchSupported && ((() => { | ||
| ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => { | ||
| !resolvers[type] && (resolvers[type] = (res, config) => { | ||
| let method = res && res[type]; | ||
| isFetchSupported && | ||
| (() => { | ||
| ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => { | ||
| !resolvers[type] && | ||
| (resolvers[type] = (res, config) => { | ||
| let method = res && res[type]; | ||
| if (method) { | ||
| return method.call(res); | ||
| } | ||
| if (method) { | ||
| return method.call(res); | ||
| } | ||
| throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config); | ||
| }) | ||
| }); | ||
| })()); | ||
| throw new AxiosError( | ||
| `Response type '${type}' is not supported`, | ||
| AxiosError.ERR_NOT_SUPPORT, | ||
| config | ||
| ); | ||
| }); | ||
| }); | ||
| })(); | ||
@@ -119,3 +140,3 @@ const getBodyLength = async (body) => { | ||
| } | ||
| } | ||
| }; | ||
@@ -126,3 +147,3 @@ const resolveBodyLength = async (headers, body) => { | ||
| return length == null ? getBodyLength(body) : length; | ||
| } | ||
| }; | ||
@@ -142,3 +163,3 @@ return async (config) => { | ||
| withCredentials = 'same-origin', | ||
| fetchOptions | ||
| fetchOptions, | ||
| } = resolveConfig(config); | ||
@@ -150,9 +171,15 @@ | ||
| let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout); | ||
| let composedSignal = composeSignals( | ||
| [signal, cancelToken && cancelToken.toAbortSignal()], | ||
| timeout | ||
| ); | ||
| let request = null; | ||
| const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { | ||
| composedSignal.unsubscribe(); | ||
| }); | ||
| const unsubscribe = | ||
| composedSignal && | ||
| composedSignal.unsubscribe && | ||
| (() => { | ||
| composedSignal.unsubscribe(); | ||
| }); | ||
@@ -163,3 +190,6 @@ let requestContentLength; | ||
| if ( | ||
| onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' && | ||
| onUploadProgress && | ||
| supportsRequestStream && | ||
| method !== 'get' && | ||
| method !== 'head' && | ||
| (requestContentLength = await resolveBodyLength(headers, data)) !== 0 | ||
@@ -170,3 +200,3 @@ ) { | ||
| body: data, | ||
| duplex: "half" | ||
| duplex: 'half', | ||
| }); | ||
@@ -177,3 +207,3 @@ | ||
| if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { | ||
| headers.setContentType(contentTypeHeader) | ||
| headers.setContentType(contentTypeHeader); | ||
| } | ||
@@ -197,3 +227,3 @@ | ||
| // see https://github.com/cloudflare/workerd/issues/902 | ||
| const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; | ||
| const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype; | ||
@@ -206,4 +236,4 @@ const resolvedOptions = { | ||
| body: data, | ||
| duplex: "half", | ||
| credentials: isCredentialsSupported ? withCredentials : undefined | ||
| duplex: 'half', | ||
| credentials: isCredentialsSupported ? withCredentials : undefined, | ||
| }; | ||
@@ -213,5 +243,8 @@ | ||
| let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions)); | ||
| let response = await (isRequestSupported | ||
| ? _fetch(request, fetchOptions) | ||
| : _fetch(url, resolvedOptions)); | ||
| const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response'); | ||
| const isStreamResponse = | ||
| supportsResponseStream && (responseType === 'stream' || responseType === 'response'); | ||
@@ -221,3 +254,3 @@ if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) { | ||
| ['status', 'statusText', 'headers'].forEach(prop => { | ||
| ['status', 'statusText', 'headers'].forEach((prop) => { | ||
| options[prop] = response[prop]; | ||
@@ -228,6 +261,9 @@ }); | ||
| const [onProgress, flush] = onDownloadProgress && progressEventDecorator( | ||
| responseContentLength, | ||
| progressEventReducer(asyncDecorator(onDownloadProgress), true) | ||
| ) || []; | ||
| const [onProgress, flush] = | ||
| (onDownloadProgress && | ||
| progressEventDecorator( | ||
| responseContentLength, | ||
| progressEventReducer(asyncDecorator(onDownloadProgress), true) | ||
| )) || | ||
| []; | ||
@@ -245,3 +281,6 @@ response = new Response( | ||
| let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config); | ||
| let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text']( | ||
| response, | ||
| config | ||
| ); | ||
@@ -257,5 +296,5 @@ !isStreamResponse && unsubscribe && unsubscribe(); | ||
| config, | ||
| request | ||
| }) | ||
| }) | ||
| request, | ||
| }); | ||
| }); | ||
| } catch (err) { | ||
@@ -266,7 +305,13 @@ unsubscribe && unsubscribe(); | ||
| throw Object.assign( | ||
| new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, err && err.response), | ||
| new AxiosError( | ||
| 'Network Error', | ||
| AxiosError.ERR_NETWORK, | ||
| config, | ||
| request, | ||
| err && err.response | ||
| ), | ||
| { | ||
| cause: err.cause || err | ||
| cause: err.cause || err, | ||
| } | ||
| ) | ||
| ); | ||
| } | ||
@@ -276,4 +321,4 @@ | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| }; | ||
@@ -284,9 +329,10 @@ const seedCache = new Map(); | ||
| let env = (config && config.env) || {}; | ||
| const {fetch, Request, Response} = env; | ||
| const seeds = [ | ||
| Request, Response, fetch | ||
| ]; | ||
| const { fetch, Request, Response } = env; | ||
| const seeds = [Request, Response, fetch]; | ||
| let len = seeds.length, i = len, | ||
| seed, target, map = seedCache; | ||
| let len = seeds.length, | ||
| i = len, | ||
| seed, | ||
| target, | ||
| map = seedCache; | ||
@@ -297,3 +343,3 @@ while (i--) { | ||
| target === undefined && map.set(seed, target = (i ? new Map() : factory(env))) | ||
| target === undefined && map.set(seed, (target = i ? new Map() : factory(env))); | ||
@@ -300,0 +346,0 @@ map = target; |
+589
-538
@@ -12,3 +12,3 @@ import utils from '../utils.js'; | ||
| import zlib from 'zlib'; | ||
| import {VERSION} from '../env/data.js'; | ||
| import { VERSION } from '../env/data.js'; | ||
| import transitionalDefaults from '../defaults/transitional.js'; | ||
@@ -22,8 +22,12 @@ import AxiosError from '../core/AxiosError.js'; | ||
| import AxiosTransformStream from '../helpers/AxiosTransformStream.js'; | ||
| import {EventEmitter} from 'events'; | ||
| import formDataToStream from "../helpers/formDataToStream.js"; | ||
| import readBlob from "../helpers/readBlob.js"; | ||
| import { EventEmitter } from 'events'; | ||
| import formDataToStream from '../helpers/formDataToStream.js'; | ||
| import readBlob from '../helpers/readBlob.js'; | ||
| import ZlibHeaderTransformStream from '../helpers/ZlibHeaderTransformStream.js'; | ||
| import callbackify from "../helpers/callbackify.js"; | ||
| import {progressEventReducer, progressEventDecorator, asyncDecorator} from "../helpers/progressEventReducer.js"; | ||
| import callbackify from '../helpers/callbackify.js'; | ||
| import { | ||
| progressEventReducer, | ||
| progressEventDecorator, | ||
| asyncDecorator, | ||
| } from '../helpers/progressEventReducer.js'; | ||
| import estimateDataURLDecodedBytes from '../helpers/estimateDataURLDecodedBytes.js'; | ||
@@ -33,3 +37,3 @@ | ||
| flush: zlib.constants.Z_SYNC_FLUSH, | ||
| finishFlush: zlib.constants.Z_SYNC_FLUSH | ||
| finishFlush: zlib.constants.Z_SYNC_FLUSH, | ||
| }; | ||
@@ -39,23 +43,20 @@ | ||
| flush: zlib.constants.BROTLI_OPERATION_FLUSH, | ||
| finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH | ||
| } | ||
| finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH, | ||
| }; | ||
| const isBrotliSupported = utils.isFunction(zlib.createBrotliDecompress); | ||
| const {http: httpFollow, https: httpsFollow} = followRedirects; | ||
| const { http: httpFollow, https: httpsFollow } = followRedirects; | ||
| const isHttps = /https:?/; | ||
| const supportedProtocols = platform.protocols.map(protocol => { | ||
| const supportedProtocols = platform.protocols.map((protocol) => { | ||
| return protocol + ':'; | ||
| }); | ||
| const flushOnFinish = (stream, [throttled, flush]) => { | ||
| stream | ||
| .on('end', flush) | ||
| .on('error', flush); | ||
| stream.on('end', flush).on('error', flush); | ||
| return throttled; | ||
| } | ||
| }; | ||
@@ -68,5 +69,8 @@ class Http2Sessions { | ||
| getSession(authority, options) { | ||
| options = Object.assign({ | ||
| sessionTimeout: 1000 | ||
| }, options); | ||
| options = Object.assign( | ||
| { | ||
| sessionTimeout: 1000, | ||
| }, | ||
| options | ||
| ); | ||
@@ -80,3 +84,7 @@ let authoritySessions = this.sessions[authority]; | ||
| const [sessionHandle, sessionOptions] = authoritySessions[i]; | ||
| if (!sessionHandle.destroyed && !sessionHandle.closed && util.isDeepStrictEqual(sessionOptions, options)) { | ||
| if ( | ||
| !sessionHandle.destroyed && | ||
| !sessionHandle.closed && | ||
| util.isDeepStrictEqual(sessionOptions, options) | ||
| ) { | ||
| return sessionHandle; | ||
@@ -98,3 +106,5 @@ } | ||
| let entries = authoritySessions, len = entries.length, i = len; | ||
| let entries = authoritySessions, | ||
| len = entries.length, | ||
| i = len; | ||
@@ -115,6 +125,5 @@ while (i--) { | ||
| const {sessionTimeout} = options; | ||
| const { sessionTimeout } = options; | ||
| if(sessionTimeout != null) { | ||
| if (sessionTimeout != null) { | ||
| let timer; | ||
@@ -143,3 +152,3 @@ let streamsCount = 0; | ||
| return stream; | ||
| } | ||
| }; | ||
| } | ||
@@ -149,8 +158,7 @@ | ||
| let entry = [ | ||
| session, | ||
| options | ||
| ]; | ||
| let entry = [session, options]; | ||
| authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry]; | ||
| authoritySessions | ||
| ? authoritySessions.push(entry) | ||
| : (authoritySessions = this.sessions[authority] = [entry]); | ||
@@ -163,3 +171,2 @@ return session; | ||
| /** | ||
@@ -239,3 +246,4 @@ * If the proxy or config beforeRedirects functions are defined, call them with the options | ||
| const isHttpAdapterSupported = typeof process !== 'undefined' && utils.kindOf(process) === 'process'; | ||
| const isHttpAdapterSupported = | ||
| typeof process !== 'undefined' && utils.kindOf(process) === 'process'; | ||
@@ -253,3 +261,3 @@ // temporary hotfix | ||
| onDone && onDone(value, isRejected); | ||
| } | ||
| }; | ||
@@ -264,649 +272,692 @@ const _resolve = (value) => { | ||
| reject(reason); | ||
| } | ||
| }; | ||
| asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject); | ||
| }) | ||
| }); | ||
| }; | ||
| const resolveFamily = ({address, family}) => { | ||
| const resolveFamily = ({ address, family }) => { | ||
| if (!utils.isString(address)) { | ||
| throw TypeError('address must be a string'); | ||
| } | ||
| return ({ | ||
| return { | ||
| address, | ||
| family: family || (address.indexOf('.') < 0 ? 6 : 4) | ||
| }); | ||
| } | ||
| family: family || (address.indexOf('.') < 0 ? 6 : 4), | ||
| }; | ||
| }; | ||
| const buildAddressEntry = (address, family) => resolveFamily(utils.isObject(address) ? address : {address, family}); | ||
| const buildAddressEntry = (address, family) => | ||
| resolveFamily(utils.isObject(address) ? address : { address, family }); | ||
| const http2Transport = { | ||
| request(options, cb) { | ||
| const authority = options.protocol + '//' + options.hostname + ':' + (options.port ||(options.protocol === 'https:' ? 443 : 80)); | ||
| const authority = | ||
| options.protocol + | ||
| '//' + | ||
| options.hostname + | ||
| ':' + | ||
| (options.port || (options.protocol === 'https:' ? 443 : 80)); | ||
| const { http2Options, headers } = options; | ||
| const {http2Options, headers} = options; | ||
| const session = http2Sessions.getSession(authority, http2Options); | ||
| const session = http2Sessions.getSession(authority, http2Options); | ||
| const { HTTP2_HEADER_SCHEME, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS } = | ||
| http2.constants; | ||
| const { | ||
| HTTP2_HEADER_SCHEME, | ||
| HTTP2_HEADER_METHOD, | ||
| HTTP2_HEADER_PATH, | ||
| HTTP2_HEADER_STATUS | ||
| } = http2.constants; | ||
| const http2Headers = { | ||
| [HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''), | ||
| [HTTP2_HEADER_METHOD]: options.method, | ||
| [HTTP2_HEADER_PATH]: options.path, | ||
| }; | ||
| const http2Headers = { | ||
| [HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''), | ||
| [HTTP2_HEADER_METHOD]: options.method, | ||
| [HTTP2_HEADER_PATH]: options.path, | ||
| } | ||
| utils.forEach(headers, (header, name) => { | ||
| name.charAt(0) !== ':' && (http2Headers[name] = header); | ||
| }); | ||
| utils.forEach(headers, (header, name) => { | ||
| name.charAt(0) !== ':' && (http2Headers[name] = header); | ||
| }); | ||
| const req = session.request(http2Headers); | ||
| const req = session.request(http2Headers); | ||
| req.once('response', (responseHeaders) => { | ||
| const response = req; //duplex | ||
| req.once('response', (responseHeaders) => { | ||
| const response = req; //duplex | ||
| responseHeaders = Object.assign({}, responseHeaders); | ||
| responseHeaders = Object.assign({}, responseHeaders); | ||
| const status = responseHeaders[HTTP2_HEADER_STATUS]; | ||
| const status = responseHeaders[HTTP2_HEADER_STATUS]; | ||
| delete responseHeaders[HTTP2_HEADER_STATUS]; | ||
| delete responseHeaders[HTTP2_HEADER_STATUS]; | ||
| response.headers = responseHeaders; | ||
| response.headers = responseHeaders; | ||
| response.statusCode = +status; | ||
| response.statusCode = +status; | ||
| cb(response); | ||
| }); | ||
| cb(response); | ||
| }) | ||
| return req; | ||
| }, | ||
| }; | ||
| return req; | ||
| } | ||
| } | ||
| /*eslint consistent-return:0*/ | ||
| export default isHttpAdapterSupported && function httpAdapter(config) { | ||
| return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) { | ||
| let {data, lookup, family, httpVersion = 1, http2Options} = config; | ||
| const {responseType, responseEncoding} = config; | ||
| const method = config.method.toUpperCase(); | ||
| let isDone; | ||
| let rejected = false; | ||
| let req; | ||
| export default isHttpAdapterSupported && | ||
| function httpAdapter(config) { | ||
| return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) { | ||
| let { data, lookup, family, httpVersion = 1, http2Options } = config; | ||
| const { responseType, responseEncoding } = config; | ||
| const method = config.method.toUpperCase(); | ||
| let isDone; | ||
| let rejected = false; | ||
| let req; | ||
| httpVersion = +httpVersion; | ||
| httpVersion = +httpVersion; | ||
| if (Number.isNaN(httpVersion)) { | ||
| throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`); | ||
| } | ||
| if (Number.isNaN(httpVersion)) { | ||
| throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`); | ||
| } | ||
| if (httpVersion !== 1 && httpVersion !== 2) { | ||
| throw TypeError(`Unsupported protocol version '${httpVersion}'`); | ||
| } | ||
| if (httpVersion !== 1 && httpVersion !== 2) { | ||
| throw TypeError(`Unsupported protocol version '${httpVersion}'`); | ||
| } | ||
| const isHttp2 = httpVersion === 2; | ||
| const isHttp2 = httpVersion === 2; | ||
| if (lookup) { | ||
| const _lookup = callbackify(lookup, (value) => utils.isArray(value) ? value : [value]); | ||
| // hotfix to support opt.all option which is required for node 20.x | ||
| lookup = (hostname, opt, cb) => { | ||
| _lookup(hostname, opt, (err, arg0, arg1) => { | ||
| if (err) { | ||
| return cb(err); | ||
| } | ||
| if (lookup) { | ||
| const _lookup = callbackify(lookup, (value) => (utils.isArray(value) ? value : [value])); | ||
| // hotfix to support opt.all option which is required for node 20.x | ||
| lookup = (hostname, opt, cb) => { | ||
| _lookup(hostname, opt, (err, arg0, arg1) => { | ||
| if (err) { | ||
| return cb(err); | ||
| } | ||
| const addresses = utils.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)]; | ||
| const addresses = utils.isArray(arg0) | ||
| ? arg0.map((addr) => buildAddressEntry(addr)) | ||
| : [buildAddressEntry(arg0, arg1)]; | ||
| opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); | ||
| }); | ||
| opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); | ||
| }); | ||
| }; | ||
| } | ||
| } | ||
| const abortEmitter = new EventEmitter(); | ||
| const abortEmitter = new EventEmitter(); | ||
| function abort(reason) { | ||
| try { | ||
| abortEmitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason); | ||
| } catch(err) { | ||
| console.warn('emit error', err); | ||
| function abort(reason) { | ||
| try { | ||
| abortEmitter.emit( | ||
| 'abort', | ||
| !reason || reason.type ? new CanceledError(null, config, req) : reason | ||
| ); | ||
| } catch (err) { | ||
| console.warn('emit error', err); | ||
| } | ||
| } | ||
| } | ||
| abortEmitter.once('abort', reject); | ||
| abortEmitter.once('abort', reject); | ||
| const onFinished = () => { | ||
| if (config.cancelToken) { | ||
| config.cancelToken.unsubscribe(abort); | ||
| } | ||
| const onFinished = () => { | ||
| if (config.cancelToken) { | ||
| config.cancelToken.unsubscribe(abort); | ||
| } | ||
| if (config.signal) { | ||
| config.signal.removeEventListener('abort', abort); | ||
| } | ||
| if (config.signal) { | ||
| config.signal.removeEventListener('abort', abort); | ||
| } | ||
| abortEmitter.removeAllListeners(); | ||
| } | ||
| abortEmitter.removeAllListeners(); | ||
| }; | ||
| if (config.cancelToken || config.signal) { | ||
| config.cancelToken && config.cancelToken.subscribe(abort); | ||
| if (config.signal) { | ||
| config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort); | ||
| if (config.cancelToken || config.signal) { | ||
| config.cancelToken && config.cancelToken.subscribe(abort); | ||
| if (config.signal) { | ||
| config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort); | ||
| } | ||
| } | ||
| } | ||
| onDone((response, isRejected) => { | ||
| isDone = true; | ||
| onDone((response, isRejected) => { | ||
| isDone = true; | ||
| if (isRejected) { | ||
| rejected = true; | ||
| onFinished(); | ||
| return; | ||
| } | ||
| if (isRejected) { | ||
| rejected = true; | ||
| onFinished(); | ||
| return; | ||
| } | ||
| const {data} = response; | ||
| const { data } = response; | ||
| if (data instanceof stream.Readable || data instanceof stream.Duplex) { | ||
| const offListeners = stream.finished(data, () => { | ||
| offListeners(); | ||
| if (data instanceof stream.Readable || data instanceof stream.Duplex) { | ||
| const offListeners = stream.finished(data, () => { | ||
| offListeners(); | ||
| onFinished(); | ||
| }); | ||
| } else { | ||
| onFinished(); | ||
| }); | ||
| } else { | ||
| onFinished(); | ||
| } | ||
| }); | ||
| } | ||
| }); | ||
| // Parse url | ||
| const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); | ||
| const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined); | ||
| const protocol = parsed.protocol || supportedProtocols[0]; | ||
| if (protocol === 'data:') { | ||
| // Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set. | ||
| if (config.maxContentLength > -1) { | ||
| // Use the exact string passed to fromDataURI (config.url); fall back to fullPath if needed. | ||
| const dataUrl = String(config.url || fullPath || ''); | ||
| const estimated = estimateDataURLDecodedBytes(dataUrl); | ||
| if (estimated > config.maxContentLength) { | ||
| return reject( | ||
| new AxiosError( | ||
| 'maxContentLength size of ' + config.maxContentLength + ' exceeded', | ||
| AxiosError.ERR_BAD_RESPONSE, | ||
| config | ||
| ) | ||
| ); | ||
| } | ||
| } | ||
| let convertedData; | ||
| // Parse url | ||
| const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); | ||
| const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined); | ||
| const protocol = parsed.protocol || supportedProtocols[0]; | ||
| if (method !== 'GET') { | ||
| return settle(resolve, reject, { | ||
| status: 405, | ||
| statusText: 'method not allowed', | ||
| headers: {}, | ||
| config, | ||
| }); | ||
| } | ||
| if (protocol === 'data:') { | ||
| // Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set. | ||
| if (config.maxContentLength > -1) { | ||
| // Use the exact string passed to fromDataURI (config.url); fall back to fullPath if needed. | ||
| const dataUrl = String(config.url || fullPath || ''); | ||
| const estimated = estimateDataURLDecodedBytes(dataUrl); | ||
| try { | ||
| convertedData = fromDataURI(config.url, responseType === 'blob', { | ||
| Blob: config.env && config.env.Blob, | ||
| }); | ||
| } catch (err) { | ||
| throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config); | ||
| } | ||
| if (estimated > config.maxContentLength) { | ||
| return reject(new AxiosError( | ||
| 'maxContentLength size of ' + config.maxContentLength + ' exceeded', | ||
| AxiosError.ERR_BAD_RESPONSE, | ||
| config | ||
| )); | ||
| if (responseType === 'text') { | ||
| convertedData = convertedData.toString(responseEncoding); | ||
| if (!responseEncoding || responseEncoding === 'utf8') { | ||
| convertedData = utils.stripBOM(convertedData); | ||
| } | ||
| } else if (responseType === 'stream') { | ||
| convertedData = stream.Readable.from(convertedData); | ||
| } | ||
| } | ||
| let convertedData; | ||
| if (method !== 'GET') { | ||
| return settle(resolve, reject, { | ||
| status: 405, | ||
| statusText: 'method not allowed', | ||
| headers: {}, | ||
| config | ||
| data: convertedData, | ||
| status: 200, | ||
| statusText: 'OK', | ||
| headers: new AxiosHeaders(), | ||
| config, | ||
| }); | ||
| } | ||
| try { | ||
| convertedData = fromDataURI(config.url, responseType === 'blob', { | ||
| Blob: config.env && config.env.Blob | ||
| }); | ||
| } catch (err) { | ||
| throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config); | ||
| if (supportedProtocols.indexOf(protocol) === -1) { | ||
| return reject( | ||
| new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_BAD_REQUEST, config) | ||
| ); | ||
| } | ||
| if (responseType === 'text') { | ||
| convertedData = convertedData.toString(responseEncoding); | ||
| const headers = AxiosHeaders.from(config.headers).normalize(); | ||
| if (!responseEncoding || responseEncoding === 'utf8') { | ||
| convertedData = utils.stripBOM(convertedData); | ||
| } | ||
| } else if (responseType === 'stream') { | ||
| convertedData = stream.Readable.from(convertedData); | ||
| } | ||
| // Set User-Agent (required by some servers) | ||
| // See https://github.com/axios/axios/issues/69 | ||
| // User-Agent is specified; handle case where no UA header is desired | ||
| // Only set header if it hasn't been set in config | ||
| headers.set('User-Agent', 'axios/' + VERSION, false); | ||
| return settle(resolve, reject, { | ||
| data: convertedData, | ||
| status: 200, | ||
| statusText: 'OK', | ||
| headers: new AxiosHeaders(), | ||
| config | ||
| }); | ||
| } | ||
| const { onUploadProgress, onDownloadProgress } = config; | ||
| const maxRate = config.maxRate; | ||
| let maxUploadRate = undefined; | ||
| let maxDownloadRate = undefined; | ||
| if (supportedProtocols.indexOf(protocol) === -1) { | ||
| return reject(new AxiosError( | ||
| 'Unsupported protocol ' + protocol, | ||
| AxiosError.ERR_BAD_REQUEST, | ||
| config | ||
| )); | ||
| } | ||
| // support for spec compliant FormData objects | ||
| if (utils.isSpecCompliantForm(data)) { | ||
| const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i); | ||
| const headers = AxiosHeaders.from(config.headers).normalize(); | ||
| data = formDataToStream( | ||
| data, | ||
| (formHeaders) => { | ||
| headers.set(formHeaders); | ||
| }, | ||
| { | ||
| tag: `axios-${VERSION}-boundary`, | ||
| boundary: (userBoundary && userBoundary[1]) || undefined, | ||
| } | ||
| ); | ||
| // support for https://www.npmjs.com/package/form-data api | ||
| } else if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) { | ||
| headers.set(data.getHeaders()); | ||
| // Set User-Agent (required by some servers) | ||
| // See https://github.com/axios/axios/issues/69 | ||
| // User-Agent is specified; handle case where no UA header is desired | ||
| // Only set header if it hasn't been set in config | ||
| headers.set('User-Agent', 'axios/' + VERSION, false); | ||
| if (!headers.hasContentLength()) { | ||
| try { | ||
| const knownLength = await util.promisify(data.getLength).call(data); | ||
| Number.isFinite(knownLength) && | ||
| knownLength >= 0 && | ||
| headers.setContentLength(knownLength); | ||
| /*eslint no-empty:0*/ | ||
| } catch (e) {} | ||
| } | ||
| } else if (utils.isBlob(data) || utils.isFile(data)) { | ||
| data.size && headers.setContentType(data.type || 'application/octet-stream'); | ||
| headers.setContentLength(data.size || 0); | ||
| data = stream.Readable.from(readBlob(data)); | ||
| } else if (data && !utils.isStream(data)) { | ||
| if (Buffer.isBuffer(data)) { | ||
| // Nothing to do... | ||
| } else if (utils.isArrayBuffer(data)) { | ||
| data = Buffer.from(new Uint8Array(data)); | ||
| } else if (utils.isString(data)) { | ||
| data = Buffer.from(data, 'utf-8'); | ||
| } else { | ||
| return reject( | ||
| new AxiosError( | ||
| 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', | ||
| AxiosError.ERR_BAD_REQUEST, | ||
| config | ||
| ) | ||
| ); | ||
| } | ||
| const {onUploadProgress, onDownloadProgress} = config; | ||
| const maxRate = config.maxRate; | ||
| let maxUploadRate = undefined; | ||
| let maxDownloadRate = undefined; | ||
| // Add Content-Length header if data exists | ||
| headers.setContentLength(data.length, false); | ||
| // support for spec compliant FormData objects | ||
| if (utils.isSpecCompliantForm(data)) { | ||
| const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i); | ||
| data = formDataToStream(data, (formHeaders) => { | ||
| headers.set(formHeaders); | ||
| }, { | ||
| tag: `axios-${VERSION}-boundary`, | ||
| boundary: userBoundary && userBoundary[1] || undefined | ||
| }); | ||
| // support for https://www.npmjs.com/package/form-data api | ||
| } else if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) { | ||
| headers.set(data.getHeaders()); | ||
| if (!headers.hasContentLength()) { | ||
| try { | ||
| const knownLength = await util.promisify(data.getLength).call(data); | ||
| Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength); | ||
| /*eslint no-empty:0*/ | ||
| } catch (e) { | ||
| if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { | ||
| return reject( | ||
| new AxiosError( | ||
| 'Request body larger than maxBodyLength limit', | ||
| AxiosError.ERR_BAD_REQUEST, | ||
| config | ||
| ) | ||
| ); | ||
| } | ||
| } | ||
| } else if (utils.isBlob(data) || utils.isFile(data)) { | ||
| data.size && headers.setContentType(data.type || 'application/octet-stream'); | ||
| headers.setContentLength(data.size || 0); | ||
| data = stream.Readable.from(readBlob(data)); | ||
| } else if (data && !utils.isStream(data)) { | ||
| if (Buffer.isBuffer(data)) { | ||
| // Nothing to do... | ||
| } else if (utils.isArrayBuffer(data)) { | ||
| data = Buffer.from(new Uint8Array(data)); | ||
| } else if (utils.isString(data)) { | ||
| data = Buffer.from(data, 'utf-8'); | ||
| } else { | ||
| return reject(new AxiosError( | ||
| 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', | ||
| AxiosError.ERR_BAD_REQUEST, | ||
| config | ||
| )); | ||
| } | ||
| // Add Content-Length header if data exists | ||
| headers.setContentLength(data.length, false); | ||
| const contentLength = utils.toFiniteNumber(headers.getContentLength()); | ||
| if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { | ||
| return reject(new AxiosError( | ||
| 'Request body larger than maxBodyLength limit', | ||
| AxiosError.ERR_BAD_REQUEST, | ||
| config | ||
| )); | ||
| if (utils.isArray(maxRate)) { | ||
| maxUploadRate = maxRate[0]; | ||
| maxDownloadRate = maxRate[1]; | ||
| } else { | ||
| maxUploadRate = maxDownloadRate = maxRate; | ||
| } | ||
| } | ||
| const contentLength = utils.toFiniteNumber(headers.getContentLength()); | ||
| if (data && (onUploadProgress || maxUploadRate)) { | ||
| if (!utils.isStream(data)) { | ||
| data = stream.Readable.from(data, { objectMode: false }); | ||
| } | ||
| if (utils.isArray(maxRate)) { | ||
| maxUploadRate = maxRate[0]; | ||
| maxDownloadRate = maxRate[1]; | ||
| } else { | ||
| maxUploadRate = maxDownloadRate = maxRate; | ||
| } | ||
| data = stream.pipeline( | ||
| [ | ||
| data, | ||
| new AxiosTransformStream({ | ||
| maxRate: utils.toFiniteNumber(maxUploadRate), | ||
| }), | ||
| ], | ||
| utils.noop | ||
| ); | ||
| if (data && (onUploadProgress || maxUploadRate)) { | ||
| if (!utils.isStream(data)) { | ||
| data = stream.Readable.from(data, {objectMode: false}); | ||
| onUploadProgress && | ||
| data.on( | ||
| 'progress', | ||
| flushOnFinish( | ||
| data, | ||
| progressEventDecorator( | ||
| contentLength, | ||
| progressEventReducer(asyncDecorator(onUploadProgress), false, 3) | ||
| ) | ||
| ) | ||
| ); | ||
| } | ||
| data = stream.pipeline([data, new AxiosTransformStream({ | ||
| maxRate: utils.toFiniteNumber(maxUploadRate) | ||
| })], utils.noop); | ||
| // HTTP basic authentication | ||
| let auth = undefined; | ||
| if (config.auth) { | ||
| const username = config.auth.username || ''; | ||
| const password = config.auth.password || ''; | ||
| auth = username + ':' + password; | ||
| } | ||
| onUploadProgress && data.on('progress', flushOnFinish( | ||
| data, | ||
| progressEventDecorator( | ||
| contentLength, | ||
| progressEventReducer(asyncDecorator(onUploadProgress), false, 3) | ||
| ) | ||
| )); | ||
| } | ||
| if (!auth && parsed.username) { | ||
| const urlUsername = parsed.username; | ||
| const urlPassword = parsed.password; | ||
| auth = urlUsername + ':' + urlPassword; | ||
| } | ||
| // HTTP basic authentication | ||
| let auth = undefined; | ||
| if (config.auth) { | ||
| const username = config.auth.username || ''; | ||
| const password = config.auth.password || ''; | ||
| auth = username + ':' + password; | ||
| } | ||
| auth && headers.delete('authorization'); | ||
| if (!auth && parsed.username) { | ||
| const urlUsername = parsed.username; | ||
| const urlPassword = parsed.password; | ||
| auth = urlUsername + ':' + urlPassword; | ||
| } | ||
| let path; | ||
| auth && headers.delete('authorization'); | ||
| try { | ||
| path = buildURL( | ||
| parsed.pathname + parsed.search, | ||
| config.params, | ||
| config.paramsSerializer | ||
| ).replace(/^\?/, ''); | ||
| } catch (err) { | ||
| const customErr = new Error(err.message); | ||
| customErr.config = config; | ||
| customErr.url = config.url; | ||
| customErr.exists = true; | ||
| return reject(customErr); | ||
| } | ||
| let path; | ||
| try { | ||
| path = buildURL( | ||
| parsed.pathname + parsed.search, | ||
| config.params, | ||
| config.paramsSerializer | ||
| ).replace(/^\?/, ''); | ||
| } catch (err) { | ||
| const customErr = new Error(err.message); | ||
| customErr.config = config; | ||
| customErr.url = config.url; | ||
| customErr.exists = true; | ||
| return reject(customErr); | ||
| } | ||
| headers.set( | ||
| 'Accept-Encoding', | ||
| 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false | ||
| headers.set( | ||
| 'Accept-Encoding', | ||
| 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), | ||
| false | ||
| ); | ||
| const options = { | ||
| path, | ||
| method: method, | ||
| headers: headers.toJSON(), | ||
| agents: { http: config.httpAgent, https: config.httpsAgent }, | ||
| auth, | ||
| protocol, | ||
| family, | ||
| beforeRedirect: dispatchBeforeRedirect, | ||
| beforeRedirects: {}, | ||
| http2Options | ||
| }; | ||
| const options = { | ||
| path, | ||
| method: method, | ||
| headers: headers.toJSON(), | ||
| agents: { http: config.httpAgent, https: config.httpsAgent }, | ||
| auth, | ||
| protocol, | ||
| family, | ||
| beforeRedirect: dispatchBeforeRedirect, | ||
| beforeRedirects: {}, | ||
| http2Options, | ||
| }; | ||
| // cacheable-lookup integration hotfix | ||
| !utils.isUndefined(lookup) && (options.lookup = lookup); | ||
| // cacheable-lookup integration hotfix | ||
| !utils.isUndefined(lookup) && (options.lookup = lookup); | ||
| if (config.socketPath) { | ||
| options.socketPath = config.socketPath; | ||
| } else { | ||
| options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname; | ||
| options.port = parsed.port; | ||
| setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); | ||
| } | ||
| if (config.socketPath) { | ||
| options.socketPath = config.socketPath; | ||
| } else { | ||
| options.hostname = parsed.hostname.startsWith('[') | ||
| ? parsed.hostname.slice(1, -1) | ||
| : parsed.hostname; | ||
| options.port = parsed.port; | ||
| setProxy( | ||
| options, | ||
| config.proxy, | ||
| protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path | ||
| ); | ||
| } | ||
| let transport; | ||
| const isHttpsRequest = isHttps.test(options.protocol); | ||
| options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; | ||
| let transport; | ||
| const isHttpsRequest = isHttps.test(options.protocol); | ||
| options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; | ||
| if (isHttp2) { | ||
| transport = http2Transport; | ||
| } else { | ||
| if (config.transport) { | ||
| transport = config.transport; | ||
| } else if (config.maxRedirects === 0) { | ||
| transport = isHttpsRequest ? https : http; | ||
| if (isHttp2) { | ||
| transport = http2Transport; | ||
| } else { | ||
| if (config.maxRedirects) { | ||
| options.maxRedirects = config.maxRedirects; | ||
| if (config.transport) { | ||
| transport = config.transport; | ||
| } else if (config.maxRedirects === 0) { | ||
| transport = isHttpsRequest ? https : http; | ||
| } else { | ||
| if (config.maxRedirects) { | ||
| options.maxRedirects = config.maxRedirects; | ||
| } | ||
| if (config.beforeRedirect) { | ||
| options.beforeRedirects.config = config.beforeRedirect; | ||
| } | ||
| transport = isHttpsRequest ? httpsFollow : httpFollow; | ||
| } | ||
| if (config.beforeRedirect) { | ||
| options.beforeRedirects.config = config.beforeRedirect; | ||
| } | ||
| transport = isHttpsRequest ? httpsFollow : httpFollow; | ||
| } | ||
| } | ||
| if (config.maxBodyLength > -1) { | ||
| options.maxBodyLength = config.maxBodyLength; | ||
| } else { | ||
| // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited | ||
| options.maxBodyLength = Infinity; | ||
| } | ||
| if (config.maxBodyLength > -1) { | ||
| options.maxBodyLength = config.maxBodyLength; | ||
| } else { | ||
| // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited | ||
| options.maxBodyLength = Infinity; | ||
| } | ||
| if (config.insecureHTTPParser) { | ||
| options.insecureHTTPParser = config.insecureHTTPParser; | ||
| } | ||
| if (config.insecureHTTPParser) { | ||
| options.insecureHTTPParser = config.insecureHTTPParser; | ||
| } | ||
| // Create the request | ||
| req = transport.request(options, function handleResponse(res) { | ||
| if (req.destroyed) return; | ||
| // Create the request | ||
| req = transport.request(options, function handleResponse(res) { | ||
| if (req.destroyed) return; | ||
| const streams = [res]; | ||
| const streams = [res]; | ||
| const responseLength = utils.toFiniteNumber(res.headers['content-length']); | ||
| const responseLength = utils.toFiniteNumber(res.headers['content-length']); | ||
| if (onDownloadProgress || maxDownloadRate) { | ||
| const transformStream = new AxiosTransformStream({ | ||
| maxRate: utils.toFiniteNumber(maxDownloadRate) | ||
| }); | ||
| if (onDownloadProgress || maxDownloadRate) { | ||
| const transformStream = new AxiosTransformStream({ | ||
| maxRate: utils.toFiniteNumber(maxDownloadRate), | ||
| }); | ||
| onDownloadProgress && transformStream.on('progress', flushOnFinish( | ||
| transformStream, | ||
| progressEventDecorator( | ||
| responseLength, | ||
| progressEventReducer(asyncDecorator(onDownloadProgress), true, 3) | ||
| ) | ||
| )); | ||
| onDownloadProgress && | ||
| transformStream.on( | ||
| 'progress', | ||
| flushOnFinish( | ||
| transformStream, | ||
| progressEventDecorator( | ||
| responseLength, | ||
| progressEventReducer(asyncDecorator(onDownloadProgress), true, 3) | ||
| ) | ||
| ) | ||
| ); | ||
| streams.push(transformStream); | ||
| } | ||
| streams.push(transformStream); | ||
| } | ||
| // decompress the response body transparently if required | ||
| let responseStream = res; | ||
| // decompress the response body transparently if required | ||
| let responseStream = res; | ||
| // return the last request in case of redirects | ||
| const lastRequest = res.req || req; | ||
| // return the last request in case of redirects | ||
| const lastRequest = res.req || req; | ||
| // if decompress disabled we should not decompress | ||
| if (config.decompress !== false && res.headers['content-encoding']) { | ||
| // if no content, but headers still say that it is encoded, | ||
| // remove the header not confuse downstream operations | ||
| if (method === 'HEAD' || res.statusCode === 204) { | ||
| delete res.headers['content-encoding']; | ||
| } | ||
| // if decompress disabled we should not decompress | ||
| if (config.decompress !== false && res.headers['content-encoding']) { | ||
| // if no content, but headers still say that it is encoded, | ||
| // remove the header not confuse downstream operations | ||
| if (method === 'HEAD' || res.statusCode === 204) { | ||
| delete res.headers['content-encoding']; | ||
| } | ||
| switch ((res.headers['content-encoding'] || '').toLowerCase()) { | ||
| /*eslint default-case:0*/ | ||
| case 'gzip': | ||
| case 'x-gzip': | ||
| case 'compress': | ||
| case 'x-compress': | ||
| // add the unzipper to the body stream processing pipeline | ||
| streams.push(zlib.createUnzip(zlibOptions)); | ||
| switch ((res.headers['content-encoding'] || '').toLowerCase()) { | ||
| /*eslint default-case:0*/ | ||
| case 'gzip': | ||
| case 'x-gzip': | ||
| case 'compress': | ||
| case 'x-compress': | ||
| // add the unzipper to the body stream processing pipeline | ||
| streams.push(zlib.createUnzip(zlibOptions)); | ||
| // remove the content-encoding in order to not confuse downstream operations | ||
| delete res.headers['content-encoding']; | ||
| break; | ||
| case 'deflate': | ||
| streams.push(new ZlibHeaderTransformStream()); | ||
| // remove the content-encoding in order to not confuse downstream operations | ||
| delete res.headers['content-encoding']; | ||
| break; | ||
| case 'deflate': | ||
| streams.push(new ZlibHeaderTransformStream()); | ||
| // add the unzipper to the body stream processing pipeline | ||
| streams.push(zlib.createUnzip(zlibOptions)); | ||
| // add the unzipper to the body stream processing pipeline | ||
| streams.push(zlib.createUnzip(zlibOptions)); | ||
| // remove the content-encoding in order to not confuse downstream operations | ||
| delete res.headers['content-encoding']; | ||
| break; | ||
| case 'br': | ||
| if (isBrotliSupported) { | ||
| streams.push(zlib.createBrotliDecompress(brotliOptions)); | ||
| delete res.headers['content-encoding']; | ||
| // remove the content-encoding in order to not confuse downstream operations | ||
| delete res.headers['content-encoding']; | ||
| break; | ||
| case 'br': | ||
| if (isBrotliSupported) { | ||
| streams.push(zlib.createBrotliDecompress(brotliOptions)); | ||
| delete res.headers['content-encoding']; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| responseStream = streams.length > 1 ? stream.pipeline(streams, utils.noop) : streams[0]; | ||
| responseStream = streams.length > 1 ? stream.pipeline(streams, utils.noop) : streams[0]; | ||
| const response = { | ||
| status: res.statusCode, | ||
| statusText: res.statusMessage, | ||
| headers: new AxiosHeaders(res.headers), | ||
| config, | ||
| request: lastRequest, | ||
| }; | ||
| if (responseType === 'stream') { | ||
| response.data = responseStream; | ||
| settle(resolve, reject, response); | ||
| } else { | ||
| const responseBuffer = []; | ||
| let totalResponseBytes = 0; | ||
| const response = { | ||
| status: res.statusCode, | ||
| statusText: res.statusMessage, | ||
| headers: new AxiosHeaders(res.headers), | ||
| config, | ||
| request: lastRequest | ||
| }; | ||
| responseStream.on('data', function handleStreamData(chunk) { | ||
| responseBuffer.push(chunk); | ||
| totalResponseBytes += chunk.length; | ||
| if (responseType === 'stream') { | ||
| response.data = responseStream; | ||
| settle(resolve, reject, response); | ||
| } else { | ||
| const responseBuffer = []; | ||
| let totalResponseBytes = 0; | ||
| // make sure the content length is not over the maxContentLength if specified | ||
| if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { | ||
| // stream.destroy() emit aborted event before calling reject() on Node.js v16 | ||
| rejected = true; | ||
| responseStream.destroy(); | ||
| abort( | ||
| new AxiosError( | ||
| 'maxContentLength size of ' + config.maxContentLength + ' exceeded', | ||
| AxiosError.ERR_BAD_RESPONSE, | ||
| config, | ||
| lastRequest | ||
| ) | ||
| ); | ||
| } | ||
| }); | ||
| responseStream.on('data', function handleStreamData(chunk) { | ||
| responseBuffer.push(chunk); | ||
| totalResponseBytes += chunk.length; | ||
| responseStream.on('aborted', function handlerStreamAborted() { | ||
| if (rejected) { | ||
| return; | ||
| } | ||
| // make sure the content length is not over the maxContentLength if specified | ||
| if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { | ||
| // stream.destroy() emit aborted event before calling reject() on Node.js v16 | ||
| rejected = true; | ||
| responseStream.destroy(); | ||
| abort(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', | ||
| AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); | ||
| } | ||
| }); | ||
| const err = new AxiosError( | ||
| 'stream has been aborted', | ||
| AxiosError.ERR_BAD_RESPONSE, | ||
| config, | ||
| lastRequest | ||
| ); | ||
| responseStream.destroy(err); | ||
| reject(err); | ||
| }); | ||
| responseStream.on('aborted', function handlerStreamAborted() { | ||
| if (rejected) { | ||
| return; | ||
| } | ||
| responseStream.on('error', function handleStreamError(err) { | ||
| if (req.destroyed) return; | ||
| reject(AxiosError.from(err, null, config, lastRequest)); | ||
| }); | ||
| const err = new AxiosError( | ||
| 'stream has been aborted', | ||
| AxiosError.ERR_BAD_RESPONSE, | ||
| config, | ||
| lastRequest | ||
| ); | ||
| responseStream.destroy(err); | ||
| reject(err); | ||
| }); | ||
| responseStream.on('error', function handleStreamError(err) { | ||
| if (req.destroyed) return; | ||
| reject(AxiosError.from(err, null, config, lastRequest)); | ||
| }); | ||
| responseStream.on('end', function handleStreamEnd() { | ||
| try { | ||
| let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); | ||
| if (responseType !== 'arraybuffer') { | ||
| responseData = responseData.toString(responseEncoding); | ||
| if (!responseEncoding || responseEncoding === 'utf8') { | ||
| responseData = utils.stripBOM(responseData); | ||
| responseStream.on('end', function handleStreamEnd() { | ||
| try { | ||
| let responseData = | ||
| responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); | ||
| if (responseType !== 'arraybuffer') { | ||
| responseData = responseData.toString(responseEncoding); | ||
| if (!responseEncoding || responseEncoding === 'utf8') { | ||
| responseData = utils.stripBOM(responseData); | ||
| } | ||
| } | ||
| response.data = responseData; | ||
| } catch (err) { | ||
| return reject(AxiosError.from(err, null, config, response.request, response)); | ||
| } | ||
| response.data = responseData; | ||
| } catch (err) { | ||
| return reject(AxiosError.from(err, null, config, response.request, response)); | ||
| settle(resolve, reject, response); | ||
| }); | ||
| } | ||
| abortEmitter.once('abort', (err) => { | ||
| if (!responseStream.destroyed) { | ||
| responseStream.emit('error', err); | ||
| responseStream.destroy(); | ||
| } | ||
| settle(resolve, reject, response); | ||
| }); | ||
| } | ||
| }); | ||
| abortEmitter.once('abort', err => { | ||
| if (!responseStream.destroyed) { | ||
| responseStream.emit('error', err); | ||
| responseStream.destroy(); | ||
| abortEmitter.once('abort', (err) => { | ||
| if (req.close) { | ||
| req.close(); | ||
| } else { | ||
| req.destroy(err); | ||
| } | ||
| }); | ||
| }); | ||
| abortEmitter.once('abort', err => { | ||
| if (req.close) { | ||
| req.close(); | ||
| } else { | ||
| req.destroy(err); | ||
| } | ||
| }); | ||
| // Handle errors | ||
| req.on('error', function handleRequestError(err) { | ||
| reject(AxiosError.from(err, null, config, req)); | ||
| }); | ||
| // Handle errors | ||
| req.on('error', function handleRequestError(err) { | ||
| reject(AxiosError.from(err, null, config, req)); | ||
| }); | ||
| // set tcp keep alive to prevent drop connection by peer | ||
| req.on('socket', function handleRequestSocket(socket) { | ||
| // default interval of sending ack packet is 1 minute | ||
| socket.setKeepAlive(true, 1000 * 60); | ||
| }); | ||
| // set tcp keep alive to prevent drop connection by peer | ||
| req.on('socket', function handleRequestSocket(socket) { | ||
| // default interval of sending ack packet is 1 minute | ||
| socket.setKeepAlive(true, 1000 * 60); | ||
| }); | ||
| // Handle request timeout | ||
| if (config.timeout) { | ||
| // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. | ||
| const timeout = parseInt(config.timeout, 10); | ||
| // Handle request timeout | ||
| if (config.timeout) { | ||
| // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. | ||
| const timeout = parseInt(config.timeout, 10); | ||
| if (Number.isNaN(timeout)) { | ||
| abort( | ||
| new AxiosError( | ||
| 'error trying to parse `config.timeout` to int', | ||
| AxiosError.ERR_BAD_OPTION_VALUE, | ||
| config, | ||
| req | ||
| ) | ||
| ); | ||
| if (Number.isNaN(timeout)) { | ||
| abort(new AxiosError( | ||
| 'error trying to parse `config.timeout` to int', | ||
| AxiosError.ERR_BAD_OPTION_VALUE, | ||
| config, | ||
| req | ||
| )); | ||
| return; | ||
| } | ||
| return; | ||
| // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. | ||
| // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. | ||
| // 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. | ||
| // And then these socket which be hang up will devouring CPU little by little. | ||
| // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. | ||
| req.setTimeout(timeout, function handleRequestTimeout() { | ||
| if (isDone) return; | ||
| let timeoutErrorMessage = config.timeout | ||
| ? 'timeout of ' + config.timeout + 'ms exceeded' | ||
| : 'timeout exceeded'; | ||
| const transitional = config.transitional || transitionalDefaults; | ||
| if (config.timeoutErrorMessage) { | ||
| timeoutErrorMessage = config.timeoutErrorMessage; | ||
| } | ||
| abort( | ||
| new AxiosError( | ||
| timeoutErrorMessage, | ||
| transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, | ||
| config, | ||
| req | ||
| ) | ||
| ); | ||
| }); | ||
| } else { | ||
| // explicitly reset the socket timeout value for a possible `keep-alive` request | ||
| req.setTimeout(0); | ||
| } | ||
| // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. | ||
| // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. | ||
| // 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. | ||
| // And then these socket which be hang up will devouring CPU little by little. | ||
| // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. | ||
| req.setTimeout(timeout, function handleRequestTimeout() { | ||
| if (isDone) return; | ||
| let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; | ||
| const transitional = config.transitional || transitionalDefaults; | ||
| if (config.timeoutErrorMessage) { | ||
| timeoutErrorMessage = config.timeoutErrorMessage; | ||
| } | ||
| abort(new AxiosError( | ||
| timeoutErrorMessage, | ||
| transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, | ||
| config, | ||
| req | ||
| )); | ||
| }); | ||
| } else { | ||
| // explicitly reset the socket timeout value for a possible `keep-alive` request | ||
| req.setTimeout(0); | ||
| } | ||
| // Send the request | ||
| if (utils.isStream(data)) { | ||
| let ended = false; | ||
| let errored = false; | ||
| data.on('end', () => { | ||
| ended = true; | ||
| }); | ||
| // Send the request | ||
| if (utils.isStream(data)) { | ||
| let ended = false; | ||
| let errored = false; | ||
| data.once('error', (err) => { | ||
| errored = true; | ||
| req.destroy(err); | ||
| }); | ||
| data.on('end', () => { | ||
| ended = true; | ||
| }); | ||
| data.on('close', () => { | ||
| if (!ended && !errored) { | ||
| abort(new CanceledError('Request stream has been aborted', config, req)); | ||
| } | ||
| }); | ||
| data.once('error', err => { | ||
| errored = true; | ||
| req.destroy(err); | ||
| }); | ||
| data.pipe(req); | ||
| } else { | ||
| data && req.write(data); | ||
| req.end(); | ||
| } | ||
| }); | ||
| }; | ||
| data.on('close', () => { | ||
| if (!ended && !errored) { | ||
| abort(new CanceledError('Request stream has been aborted', config, req)); | ||
| } | ||
| }); | ||
| data.pipe(req); | ||
| } else { | ||
| data && req.write(data); | ||
| req.end(); | ||
| } | ||
| }); | ||
| } | ||
| export const __setProxy = setProxy; |
@@ -15,8 +15,7 @@ # axios // adapters | ||
| // - request interceptors have already run | ||
| // Make the request using config provided | ||
| // Upon response settle the Promise | ||
| return new Promise(function(resolve, reject) { | ||
| return new Promise(function (resolve, reject) { | ||
| var response = { | ||
@@ -28,3 +27,3 @@ data: responseData, | ||
| config: config, | ||
| request: request | ||
| request: request, | ||
| }; | ||
@@ -38,3 +37,3 @@ | ||
| }); | ||
| } | ||
| }; | ||
| ``` |
+178
-156
@@ -9,193 +9,215 @@ import utils from '../utils.js'; | ||
| import AxiosHeaders from '../core/AxiosHeaders.js'; | ||
| import {progressEventReducer} from '../helpers/progressEventReducer.js'; | ||
| import resolveConfig from "../helpers/resolveConfig.js"; | ||
| import { progressEventReducer } from '../helpers/progressEventReducer.js'; | ||
| import resolveConfig from '../helpers/resolveConfig.js'; | ||
| const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; | ||
| export default isXHRAdapterSupported && function (config) { | ||
| return new Promise(function dispatchXhrRequest(resolve, reject) { | ||
| const _config = resolveConfig(config); | ||
| let requestData = _config.data; | ||
| const requestHeaders = AxiosHeaders.from(_config.headers).normalize(); | ||
| let {responseType, onUploadProgress, onDownloadProgress} = _config; | ||
| let onCanceled; | ||
| let uploadThrottled, downloadThrottled; | ||
| let flushUpload, flushDownload; | ||
| export default isXHRAdapterSupported && | ||
| function (config) { | ||
| return new Promise(function dispatchXhrRequest(resolve, reject) { | ||
| const _config = resolveConfig(config); | ||
| let requestData = _config.data; | ||
| const requestHeaders = AxiosHeaders.from(_config.headers).normalize(); | ||
| let { responseType, onUploadProgress, onDownloadProgress } = _config; | ||
| let onCanceled; | ||
| let uploadThrottled, downloadThrottled; | ||
| let flushUpload, flushDownload; | ||
| function done() { | ||
| flushUpload && flushUpload(); // flush events | ||
| flushDownload && flushDownload(); // flush events | ||
| function done() { | ||
| flushUpload && flushUpload(); // flush events | ||
| flushDownload && flushDownload(); // flush events | ||
| _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); | ||
| _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); | ||
| _config.signal && _config.signal.removeEventListener('abort', onCanceled); | ||
| } | ||
| _config.signal && _config.signal.removeEventListener('abort', onCanceled); | ||
| } | ||
| let request = new XMLHttpRequest(); | ||
| let request = new XMLHttpRequest(); | ||
| request.open(_config.method.toUpperCase(), _config.url, true); | ||
| request.open(_config.method.toUpperCase(), _config.url, true); | ||
| // Set the request timeout in MS | ||
| request.timeout = _config.timeout; | ||
| // Set the request timeout in MS | ||
| request.timeout = _config.timeout; | ||
| function onloadend() { | ||
| if (!request) { | ||
| return; | ||
| function onloadend() { | ||
| if (!request) { | ||
| return; | ||
| } | ||
| // Prepare the response | ||
| const responseHeaders = AxiosHeaders.from( | ||
| 'getAllResponseHeaders' in request && request.getAllResponseHeaders() | ||
| ); | ||
| const responseData = | ||
| !responseType || responseType === 'text' || responseType === 'json' | ||
| ? request.responseText | ||
| : request.response; | ||
| const response = { | ||
| data: responseData, | ||
| status: request.status, | ||
| statusText: request.statusText, | ||
| headers: responseHeaders, | ||
| config, | ||
| request, | ||
| }; | ||
| settle( | ||
| function _resolve(value) { | ||
| resolve(value); | ||
| done(); | ||
| }, | ||
| function _reject(err) { | ||
| reject(err); | ||
| done(); | ||
| }, | ||
| response | ||
| ); | ||
| // Clean up request | ||
| request = null; | ||
| } | ||
| // Prepare the response | ||
| const responseHeaders = AxiosHeaders.from( | ||
| 'getAllResponseHeaders' in request && request.getAllResponseHeaders() | ||
| ); | ||
| const responseData = !responseType || responseType === 'text' || responseType === 'json' ? | ||
| request.responseText : request.response; | ||
| const response = { | ||
| data: responseData, | ||
| status: request.status, | ||
| statusText: request.statusText, | ||
| headers: responseHeaders, | ||
| config, | ||
| request | ||
| }; | ||
| settle(function _resolve(value) { | ||
| resolve(value); | ||
| done(); | ||
| }, function _reject(err) { | ||
| reject(err); | ||
| done(); | ||
| }, response); | ||
| if ('onloadend' in request) { | ||
| // Use onloadend if available | ||
| request.onloadend = onloadend; | ||
| } else { | ||
| // Listen for ready state to emulate onloadend | ||
| request.onreadystatechange = function handleLoad() { | ||
| if (!request || request.readyState !== 4) { | ||
| return; | ||
| } | ||
| // Clean up request | ||
| request = null; | ||
| } | ||
| // The request errored out and we didn't get a response, this will be | ||
| // handled by onerror instead | ||
| // With one exception: request that using file: protocol, most browsers | ||
| // will return status as 0 even though it's a successful request | ||
| if ( | ||
| request.status === 0 && | ||
| !(request.responseURL && request.responseURL.indexOf('file:') === 0) | ||
| ) { | ||
| return; | ||
| } | ||
| // readystate handler is calling before onerror or ontimeout handlers, | ||
| // so we should call onloadend on the next 'tick' | ||
| setTimeout(onloadend); | ||
| }; | ||
| } | ||
| if ('onloadend' in request) { | ||
| // Use onloadend if available | ||
| request.onloadend = onloadend; | ||
| } else { | ||
| // Listen for ready state to emulate onloadend | ||
| request.onreadystatechange = function handleLoad() { | ||
| if (!request || request.readyState !== 4) { | ||
| // Handle browser request cancellation (as opposed to a manual cancellation) | ||
| request.onabort = function handleAbort() { | ||
| if (!request) { | ||
| return; | ||
| } | ||
| // The request errored out and we didn't get a response, this will be | ||
| // handled by onerror instead | ||
| // With one exception: request that using file: protocol, most browsers | ||
| // will return status as 0 even though it's a successful request | ||
| if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { | ||
| return; | ||
| } | ||
| // readystate handler is calling before onerror or ontimeout handlers, | ||
| // so we should call onloadend on the next 'tick' | ||
| setTimeout(onloadend); | ||
| reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); | ||
| // Clean up request | ||
| request = null; | ||
| }; | ||
| } | ||
| // Handle browser request cancellation (as opposed to a manual cancellation) | ||
| request.onabort = function handleAbort() { | ||
| if (!request) { | ||
| return; | ||
| } | ||
| // Handle low level network errors | ||
| request.onerror = function handleError(event) { | ||
| // Browsers deliver a ProgressEvent in XHR onerror | ||
| // (message may be empty; when present, surface it) | ||
| // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event | ||
| const msg = event && event.message ? event.message : 'Network Error'; | ||
| const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request); | ||
| // attach the underlying event for consumers who want details | ||
| err.event = event || null; | ||
| reject(err); | ||
| request = null; | ||
| }; | ||
| reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); | ||
| // Handle timeout | ||
| request.ontimeout = function handleTimeout() { | ||
| let timeoutErrorMessage = _config.timeout | ||
| ? 'timeout of ' + _config.timeout + 'ms exceeded' | ||
| : 'timeout exceeded'; | ||
| const transitional = _config.transitional || transitionalDefaults; | ||
| if (_config.timeoutErrorMessage) { | ||
| timeoutErrorMessage = _config.timeoutErrorMessage; | ||
| } | ||
| reject( | ||
| new AxiosError( | ||
| timeoutErrorMessage, | ||
| transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, | ||
| config, | ||
| request | ||
| ) | ||
| ); | ||
| // Clean up request | ||
| request = null; | ||
| }; | ||
| // Clean up request | ||
| request = null; | ||
| }; | ||
| // Handle low level network errors | ||
| request.onerror = function handleError(event) { | ||
| // Browsers deliver a ProgressEvent in XHR onerror | ||
| // (message may be empty; when present, surface it) | ||
| // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event | ||
| const msg = event && event.message ? event.message : 'Network Error'; | ||
| const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request); | ||
| // attach the underlying event for consumers who want details | ||
| err.event = event || null; | ||
| reject(err); | ||
| request = null; | ||
| }; | ||
| // Handle timeout | ||
| request.ontimeout = function handleTimeout() { | ||
| let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded'; | ||
| const transitional = _config.transitional || transitionalDefaults; | ||
| if (_config.timeoutErrorMessage) { | ||
| timeoutErrorMessage = _config.timeoutErrorMessage; | ||
| // Remove Content-Type if data is undefined | ||
| requestData === undefined && requestHeaders.setContentType(null); | ||
| // Add headers to the request | ||
| if ('setRequestHeader' in request) { | ||
| utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { | ||
| request.setRequestHeader(key, val); | ||
| }); | ||
| } | ||
| reject(new AxiosError( | ||
| timeoutErrorMessage, | ||
| transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, | ||
| config, | ||
| request)); | ||
| // Clean up request | ||
| request = null; | ||
| }; | ||
| // Add withCredentials to request if needed | ||
| if (!utils.isUndefined(_config.withCredentials)) { | ||
| request.withCredentials = !!_config.withCredentials; | ||
| } | ||
| // Remove Content-Type if data is undefined | ||
| requestData === undefined && requestHeaders.setContentType(null); | ||
| // Add responseType to request if needed | ||
| if (responseType && responseType !== 'json') { | ||
| request.responseType = _config.responseType; | ||
| } | ||
| // Add headers to the request | ||
| if ('setRequestHeader' in request) { | ||
| utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { | ||
| request.setRequestHeader(key, val); | ||
| }); | ||
| } | ||
| // Handle progress if needed | ||
| if (onDownloadProgress) { | ||
| [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); | ||
| request.addEventListener('progress', downloadThrottled); | ||
| } | ||
| // Add withCredentials to request if needed | ||
| if (!utils.isUndefined(_config.withCredentials)) { | ||
| request.withCredentials = !!_config.withCredentials; | ||
| } | ||
| // Not all browsers support upload events | ||
| if (onUploadProgress && request.upload) { | ||
| [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); | ||
| // Add responseType to request if needed | ||
| if (responseType && responseType !== 'json') { | ||
| request.responseType = _config.responseType; | ||
| } | ||
| request.upload.addEventListener('progress', uploadThrottled); | ||
| // Handle progress if needed | ||
| if (onDownloadProgress) { | ||
| ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true)); | ||
| request.addEventListener('progress', downloadThrottled); | ||
| } | ||
| request.upload.addEventListener('loadend', flushUpload); | ||
| } | ||
| // Not all browsers support upload events | ||
| if (onUploadProgress && request.upload) { | ||
| ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress)); | ||
| if (_config.cancelToken || _config.signal) { | ||
| // Handle cancellation | ||
| // eslint-disable-next-line func-names | ||
| onCanceled = (cancel) => { | ||
| if (!request) { | ||
| return; | ||
| } | ||
| reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); | ||
| request.abort(); | ||
| request = null; | ||
| }; | ||
| request.upload.addEventListener('progress', uploadThrottled); | ||
| request.upload.addEventListener('loadend', flushUpload); | ||
| } | ||
| if (_config.cancelToken || _config.signal) { | ||
| // Handle cancellation | ||
| // eslint-disable-next-line func-names | ||
| onCanceled = cancel => { | ||
| if (!request) { | ||
| return; | ||
| _config.cancelToken && _config.cancelToken.subscribe(onCanceled); | ||
| if (_config.signal) { | ||
| _config.signal.aborted | ||
| ? onCanceled() | ||
| : _config.signal.addEventListener('abort', onCanceled); | ||
| } | ||
| reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); | ||
| request.abort(); | ||
| request = null; | ||
| }; | ||
| _config.cancelToken && _config.cancelToken.subscribe(onCanceled); | ||
| if (_config.signal) { | ||
| _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled); | ||
| } | ||
| } | ||
| const protocol = parseProtocol(_config.url); | ||
| const protocol = parseProtocol(_config.url); | ||
| if (protocol && platform.protocols.indexOf(protocol) === -1) { | ||
| reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); | ||
| return; | ||
| } | ||
| if (protocol && platform.protocols.indexOf(protocol) === -1) { | ||
| reject( | ||
| new AxiosError( | ||
| 'Unsupported protocol ' + protocol + ':', | ||
| AxiosError.ERR_BAD_REQUEST, | ||
| config | ||
| ) | ||
| ); | ||
| return; | ||
| } | ||
| // Send the request | ||
| request.send(requestData || null); | ||
| }); | ||
| } | ||
| // Send the request | ||
| request.send(requestData || null); | ||
| }); | ||
| }; |
+6
-6
@@ -12,3 +12,3 @@ 'use strict'; | ||
| import isCancel from './cancel/isCancel.js'; | ||
| import {VERSION} from './env/data.js'; | ||
| import { VERSION } from './env/data.js'; | ||
| import toFormData from './helpers/toFormData.js'; | ||
@@ -18,3 +18,3 @@ import AxiosError from './core/AxiosError.js'; | ||
| import isAxiosError from './helpers/isAxiosError.js'; | ||
| import AxiosHeaders from "./core/AxiosHeaders.js"; | ||
| import AxiosHeaders from './core/AxiosHeaders.js'; | ||
| import adapters from './adapters/adapters.js'; | ||
@@ -35,6 +35,6 @@ import HttpStatusCode from './helpers/HttpStatusCode.js'; | ||
| // Copy axios.prototype to instance | ||
| utils.extend(instance, Axios.prototype, context, {allOwnKeys: true}); | ||
| utils.extend(instance, Axios.prototype, context, { allOwnKeys: true }); | ||
| // Copy context to instance | ||
| utils.extend(instance, context, null, {allOwnKeys: true}); | ||
| utils.extend(instance, context, null, { allOwnKeys: true }); | ||
@@ -83,3 +83,3 @@ // Factory for creating new instances | ||
| axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing); | ||
| axios.formToJSON = (thing) => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing); | ||
@@ -93,2 +93,2 @@ axios.getAdapter = adapters.getAdapter; | ||
| // this module should only have a default export | ||
| export default axios | ||
| export default axios; |
@@ -27,3 +27,3 @@ 'use strict'; | ||
| // eslint-disable-next-line func-names | ||
| this.promise.then(cancel => { | ||
| this.promise.then((cancel) => { | ||
| if (!token._listeners) return; | ||
@@ -40,6 +40,6 @@ | ||
| // eslint-disable-next-line func-names | ||
| this.promise.then = onfulfilled => { | ||
| this.promise.then = (onfulfilled) => { | ||
| let _resolve; | ||
| // eslint-disable-next-line func-names | ||
| const promise = new Promise(resolve => { | ||
| const promise = new Promise((resolve) => { | ||
| token.subscribe(resolve); | ||
@@ -132,3 +132,3 @@ _resolve = resolve; | ||
| token, | ||
| cancel | ||
| cancel, | ||
| }; | ||
@@ -135,0 +135,0 @@ } |
+57
-43
@@ -27,3 +27,3 @@ 'use strict'; | ||
| request: new InterceptorManager(), | ||
| response: new InterceptorManager() | ||
| response: new InterceptorManager(), | ||
| }; | ||
@@ -56,3 +56,3 @@ } | ||
| } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) { | ||
| err.stack += '\n' + stack | ||
| err.stack += '\n' + stack; | ||
| } | ||
@@ -80,11 +80,15 @@ } catch (e) { | ||
| const {transitional, paramsSerializer, headers} = config; | ||
| const { transitional, paramsSerializer, headers } = config; | ||
| if (transitional !== undefined) { | ||
| validator.assertOptions(transitional, { | ||
| silentJSONParsing: validators.transitional(validators.boolean), | ||
| forcedJSONParsing: validators.transitional(validators.boolean), | ||
| clarifyTimeoutError: validators.transitional(validators.boolean), | ||
| legacyInterceptorReqResOrdering: validators.transitional(validators.boolean) | ||
| }, false); | ||
| validator.assertOptions( | ||
| transitional, | ||
| { | ||
| silentJSONParsing: validators.transitional(validators.boolean), | ||
| forcedJSONParsing: validators.transitional(validators.boolean), | ||
| clarifyTimeoutError: validators.transitional(validators.boolean), | ||
| legacyInterceptorReqResOrdering: validators.transitional(validators.boolean), | ||
| }, | ||
| false | ||
| ); | ||
| } | ||
@@ -95,9 +99,13 @@ | ||
| config.paramsSerializer = { | ||
| serialize: paramsSerializer | ||
| } | ||
| serialize: paramsSerializer, | ||
| }; | ||
| } else { | ||
| validator.assertOptions(paramsSerializer, { | ||
| encode: validators.function, | ||
| serialize: validators.function | ||
| }, true); | ||
| validator.assertOptions( | ||
| paramsSerializer, | ||
| { | ||
| encode: validators.function, | ||
| serialize: validators.function, | ||
| }, | ||
| true | ||
| ); | ||
| } | ||
@@ -115,6 +123,10 @@ } | ||
| validator.assertOptions(config, { | ||
| baseUrl: validators.spelling('baseURL'), | ||
| withXsrfToken: validators.spelling('withXSRFToken') | ||
| }, true); | ||
| validator.assertOptions( | ||
| config, | ||
| { | ||
| baseUrl: validators.spelling('baseURL'), | ||
| withXsrfToken: validators.spelling('withXSRFToken'), | ||
| }, | ||
| true | ||
| ); | ||
@@ -125,13 +137,8 @@ // Set config.method | ||
| // Flatten headers | ||
| let contextHeaders = headers && utils.merge( | ||
| headers.common, | ||
| headers[config.method] | ||
| ); | ||
| let contextHeaders = headers && utils.merge(headers.common, headers[config.method]); | ||
| headers && utils.forEach( | ||
| ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], | ||
| (method) => { | ||
| headers && | ||
| utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => { | ||
| delete headers[method]; | ||
| } | ||
| ); | ||
| }); | ||
@@ -151,3 +158,4 @@ config.headers = AxiosHeaders.concat(contextHeaders, headers); | ||
| const transitional = config.transitional || transitionalDefaults; | ||
| const legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering; | ||
| const legacyInterceptorReqResOrdering = | ||
| transitional && transitional.legacyInterceptorReqResOrdering; | ||
@@ -226,8 +234,10 @@ if (legacyInterceptorReqResOrdering) { | ||
| /*eslint func-names:0*/ | ||
| Axios.prototype[method] = function(url, config) { | ||
| return this.request(mergeConfig(config || {}, { | ||
| method, | ||
| url, | ||
| data: (config || {}).data | ||
| })); | ||
| Axios.prototype[method] = function (url, config) { | ||
| return this.request( | ||
| mergeConfig(config || {}, { | ||
| method, | ||
| url, | ||
| data: (config || {}).data, | ||
| }) | ||
| ); | ||
| }; | ||
@@ -241,10 +251,14 @@ }); | ||
| return function httpMethod(url, data, config) { | ||
| return this.request(mergeConfig(config || {}, { | ||
| method, | ||
| headers: isForm ? { | ||
| 'Content-Type': 'multipart/form-data' | ||
| } : {}, | ||
| url, | ||
| data | ||
| })); | ||
| return this.request( | ||
| mergeConfig(config || {}, { | ||
| method, | ||
| headers: isForm | ||
| ? { | ||
| 'Content-Type': 'multipart/form-data', | ||
| } | ||
| : {}, | ||
| url, | ||
| data, | ||
| }) | ||
| ); | ||
| }; | ||
@@ -251,0 +265,0 @@ } |
+52
-35
@@ -6,10 +6,16 @@ 'use strict'; | ||
| class AxiosError extends Error { | ||
| static from(error, code, config, request, response, customProps) { | ||
| const axiosError = new AxiosError(error.message, code || error.code, config, request, response); | ||
| axiosError.cause = error; | ||
| axiosError.name = error.name; | ||
| customProps && Object.assign(axiosError, customProps); | ||
| return axiosError; | ||
| static from(error, code, config, request, response, customProps) { | ||
| const axiosError = new AxiosError(error.message, code || error.code, config, request, response); | ||
| axiosError.cause = error; | ||
| axiosError.name = error.name; | ||
| // Preserve status from the original error if not already set from response | ||
| if (error.status != null && axiosError.status == null) { | ||
| axiosError.status = error.status; | ||
| } | ||
| customProps && Object.assign(axiosError, customProps); | ||
| return axiosError; | ||
| } | ||
| /** | ||
@@ -27,33 +33,44 @@ * Create an Error with the specified message, config, error code, request and response. | ||
| constructor(message, code, config, request, response) { | ||
| super(message); | ||
| this.name = 'AxiosError'; | ||
| this.isAxiosError = true; | ||
| code && (this.code = code); | ||
| config && (this.config = config); | ||
| request && (this.request = request); | ||
| if (response) { | ||
| this.response = response; | ||
| this.status = response.status; | ||
| } | ||
| super(message); | ||
| // Make message enumerable to maintain backward compatibility | ||
| // The native Error constructor sets message as non-enumerable, | ||
| // but axios < v1.13.3 had it as enumerable | ||
| Object.defineProperty(this, 'message', { | ||
| value: message, | ||
| enumerable: true, | ||
| writable: true, | ||
| configurable: true | ||
| }); | ||
| this.name = 'AxiosError'; | ||
| this.isAxiosError = true; | ||
| code && (this.code = code); | ||
| config && (this.config = config); | ||
| request && (this.request = request); | ||
| if (response) { | ||
| this.response = response; | ||
| this.status = response.status; | ||
| } | ||
| } | ||
| toJSON() { | ||
| return { | ||
| // Standard | ||
| message: this.message, | ||
| name: this.name, | ||
| // Microsoft | ||
| description: this.description, | ||
| number: this.number, | ||
| // Mozilla | ||
| fileName: this.fileName, | ||
| lineNumber: this.lineNumber, | ||
| columnNumber: this.columnNumber, | ||
| stack: this.stack, | ||
| // Axios | ||
| config: utils.toJSONObject(this.config), | ||
| code: this.code, | ||
| status: this.status, | ||
| }; | ||
| } | ||
| toJSON() { | ||
| return { | ||
| // Standard | ||
| message: this.message, | ||
| name: this.name, | ||
| // Microsoft | ||
| description: this.description, | ||
| number: this.number, | ||
| // Mozilla | ||
| fileName: this.fileName, | ||
| lineNumber: this.lineNumber, | ||
| columnNumber: this.columnNumber, | ||
| stack: this.stack, | ||
| // Axios | ||
| config: utils.toJSONObject(this.config), | ||
| code: this.code, | ||
| status: this.status, | ||
| }; | ||
| } | ||
| } | ||
@@ -60,0 +77,0 @@ |
+54
-24
@@ -55,4 +55,6 @@ 'use strict'; | ||
| function formatHeader(header) { | ||
| return header.trim() | ||
| .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { | ||
| return header | ||
| .trim() | ||
| .toLowerCase() | ||
| .replace(/([a-z\d])(\w*)/g, (w, char, str) => { | ||
| return char.toUpperCase() + str; | ||
@@ -65,8 +67,8 @@ }); | ||
| ['get', 'set', 'has'].forEach(methodName => { | ||
| ['get', 'set', 'has'].forEach((methodName) => { | ||
| Object.defineProperty(obj, methodName + accessorName, { | ||
| value: function(arg1, arg2, arg3) { | ||
| value: function (arg1, arg2, arg3) { | ||
| return this[methodName].call(this, header, arg1, arg2, arg3); | ||
| }, | ||
| configurable: true | ||
| configurable: true, | ||
| }); | ||
@@ -93,3 +95,8 @@ }); | ||
| if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { | ||
| if ( | ||
| !key || | ||
| self[key] === undefined || | ||
| _rewrite === true || | ||
| (_rewrite === undefined && self[key] !== false) | ||
| ) { | ||
| self[key || _header] = normalizeValue(_value); | ||
@@ -103,7 +110,9 @@ } | ||
| if (utils.isPlainObject(header) || header instanceof this.constructor) { | ||
| setHeaders(header, valueOrRewrite) | ||
| } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { | ||
| setHeaders(header, valueOrRewrite); | ||
| } else if (utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { | ||
| setHeaders(parseHeaders(header), valueOrRewrite); | ||
| } else if (utils.isObject(header) && utils.isIterable(header)) { | ||
| let obj = {}, dest, key; | ||
| let obj = {}, | ||
| dest, | ||
| key; | ||
| for (const entry of header) { | ||
@@ -114,7 +123,10 @@ if (!utils.isArray(entry)) { | ||
| obj[key = entry[0]] = (dest = obj[key]) ? | ||
| (utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1]; | ||
| obj[(key = entry[0])] = (dest = obj[key]) | ||
| ? utils.isArray(dest) | ||
| ? [...dest, entry[1]] | ||
| : [dest, entry[1]] | ||
| : entry[1]; | ||
| } | ||
| setHeaders(obj, valueOrRewrite) | ||
| setHeaders(obj, valueOrRewrite); | ||
| } else { | ||
@@ -163,3 +175,7 @@ header != null && setHeader(valueOrRewrite, header, rewrite); | ||
| return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); | ||
| return !!( | ||
| key && | ||
| this[key] !== undefined && | ||
| (!matcher || matchHeaderValue(this, this[key], key, matcher)) | ||
| ); | ||
| } | ||
@@ -204,3 +220,3 @@ | ||
| const key = keys[i]; | ||
| if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { | ||
| if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { | ||
| delete this[key]; | ||
@@ -249,3 +265,5 @@ deleted = true; | ||
| utils.forEach(this, (value, header) => { | ||
| value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value); | ||
| value != null && | ||
| value !== false && | ||
| (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value); | ||
| }); | ||
@@ -261,7 +279,9 @@ | ||
| toString() { | ||
| return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); | ||
| return Object.entries(this.toJSON()) | ||
| .map(([header, value]) => header + ': ' + value) | ||
| .join('\n'); | ||
| } | ||
| getSetCookie() { | ||
| return this.get("set-cookie") || []; | ||
| return this.get('set-cookie') || []; | ||
| } | ||
@@ -286,5 +306,8 @@ | ||
| static accessor(header) { | ||
| const internals = this[$internals] = (this[$internals] = { | ||
| accessors: {} | ||
| }); | ||
| const internals = | ||
| (this[$internals] = | ||
| this[$internals] = | ||
| { | ||
| accessors: {}, | ||
| }); | ||
@@ -309,6 +332,13 @@ const accessors = internals.accessors; | ||
| AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); | ||
| AxiosHeaders.accessor([ | ||
| 'Content-Type', | ||
| 'Content-Length', | ||
| 'Accept', | ||
| 'Accept-Encoding', | ||
| 'User-Agent', | ||
| 'Authorization', | ||
| ]); | ||
| // reserved names hotfix | ||
| utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => { | ||
| utils.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => { | ||
| let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` | ||
@@ -319,4 +349,4 @@ return { | ||
| this[mapped] = headerValue; | ||
| } | ||
| } | ||
| }, | ||
| }; | ||
| }); | ||
@@ -323,0 +353,0 @@ |
@@ -8,3 +8,3 @@ 'use strict'; | ||
| import AxiosHeaders from '../core/AxiosHeaders.js'; | ||
| import adapters from "../adapters/adapters.js"; | ||
| import adapters from '../adapters/adapters.js'; | ||
@@ -41,6 +41,3 @@ /** | ||
| // Transform request data | ||
| config.data = transformData.call( | ||
| config, | ||
| config.transformRequest | ||
| ); | ||
| config.data = transformData.call(config, config.transformRequest); | ||
@@ -53,32 +50,31 @@ if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { | ||
| return adapter(config).then(function onAdapterResolution(response) { | ||
| throwIfCancellationRequested(config); | ||
| return adapter(config).then( | ||
| function onAdapterResolution(response) { | ||
| throwIfCancellationRequested(config); | ||
| // Transform response data | ||
| response.data = transformData.call( | ||
| config, | ||
| config.transformResponse, | ||
| response | ||
| ); | ||
| // Transform response data | ||
| response.data = transformData.call(config, config.transformResponse, response); | ||
| response.headers = AxiosHeaders.from(response.headers); | ||
| response.headers = AxiosHeaders.from(response.headers); | ||
| return response; | ||
| }, function onAdapterRejection(reason) { | ||
| if (!isCancel(reason)) { | ||
| throwIfCancellationRequested(config); | ||
| return response; | ||
| }, | ||
| function onAdapterRejection(reason) { | ||
| if (!isCancel(reason)) { | ||
| throwIfCancellationRequested(config); | ||
| // Transform response data | ||
| if (reason && reason.response) { | ||
| reason.response.data = transformData.call( | ||
| config, | ||
| config.transformResponse, | ||
| reason.response | ||
| ); | ||
| reason.response.headers = AxiosHeaders.from(reason.response.headers); | ||
| // Transform response data | ||
| if (reason && reason.response) { | ||
| reason.response.data = transformData.call( | ||
| config, | ||
| config.transformResponse, | ||
| reason.response | ||
| ); | ||
| reason.response.headers = AxiosHeaders.from(reason.response.headers); | ||
| } | ||
| } | ||
| return Promise.reject(reason); | ||
| } | ||
| return Promise.reject(reason); | ||
| }); | ||
| ); | ||
| } |
@@ -24,3 +24,3 @@ 'use strict'; | ||
| synchronous: options ? options.synchronous : false, | ||
| runWhen: options ? options.runWhen : null | ||
| runWhen: options ? options.runWhen : null, | ||
| }); | ||
@@ -27,0 +27,0 @@ return this.handlers.length - 1; |
+10
-22
@@ -1,8 +0,7 @@ | ||
| "use strict"; | ||
| 'use strict'; | ||
| import utils from "../utils.js"; | ||
| import AxiosHeaders from "./AxiosHeaders.js"; | ||
| import utils from '../utils.js'; | ||
| import AxiosHeaders from './AxiosHeaders.js'; | ||
| const headersToObject = (thing) => | ||
| thing instanceof AxiosHeaders ? { ...thing } : thing; | ||
| const headersToObject = (thing) => (thing instanceof AxiosHeaders ? { ...thing } : thing); | ||
@@ -100,21 +99,10 @@ /** | ||
| utils.forEach( | ||
| Object.keys({ ...config1, ...config2 }), | ||
| function computeConfigValue(prop) { | ||
| if ( | ||
| prop === "__proto__" || | ||
| prop === "constructor" || | ||
| prop === "prototype" | ||
| ) | ||
| return; | ||
| const merge = utils.hasOwnProp(mergeMap, prop) | ||
| ? mergeMap[prop] | ||
| : mergeDeepProperties; | ||
| const configValue = merge(config1[prop], config2[prop], prop); | ||
| (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || | ||
| (config[prop] = configValue); | ||
| }, | ||
| ); | ||
| utils.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) { | ||
| if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return; | ||
| const merge = utils.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties; | ||
| const configValue = merge(config1[prop], config2[prop], prop); | ||
| (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); | ||
| }); | ||
| return config; | ||
| } |
+11
-7
@@ -19,10 +19,14 @@ 'use strict'; | ||
| } else { | ||
| reject(new AxiosError( | ||
| 'Request failed with status code ' + response.status, | ||
| [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], | ||
| response.config, | ||
| response.request, | ||
| response | ||
| )); | ||
| reject( | ||
| new AxiosError( | ||
| 'Request failed with status code ' + response.status, | ||
| [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][ | ||
| Math.floor(response.status / 100) - 4 | ||
| ], | ||
| response.config, | ||
| response.request, | ||
| response | ||
| ) | ||
| ); | ||
| } | ||
| } |
+83
-72
@@ -37,3 +37,2 @@ 'use strict'; | ||
| const defaults = { | ||
| transitional: transitionalDefaults, | ||
@@ -43,87 +42,99 @@ | ||
| transformRequest: [function transformRequest(data, headers) { | ||
| const contentType = headers.getContentType() || ''; | ||
| const hasJSONContentType = contentType.indexOf('application/json') > -1; | ||
| const isObjectPayload = utils.isObject(data); | ||
| transformRequest: [ | ||
| function transformRequest(data, headers) { | ||
| const contentType = headers.getContentType() || ''; | ||
| const hasJSONContentType = contentType.indexOf('application/json') > -1; | ||
| const isObjectPayload = utils.isObject(data); | ||
| if (isObjectPayload && utils.isHTMLForm(data)) { | ||
| data = new FormData(data); | ||
| } | ||
| if (isObjectPayload && utils.isHTMLForm(data)) { | ||
| data = new FormData(data); | ||
| } | ||
| const isFormData = utils.isFormData(data); | ||
| const isFormData = utils.isFormData(data); | ||
| if (isFormData) { | ||
| return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; | ||
| } | ||
| if (isFormData) { | ||
| return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; | ||
| } | ||
| if (utils.isArrayBuffer(data) || | ||
| utils.isBuffer(data) || | ||
| utils.isStream(data) || | ||
| utils.isFile(data) || | ||
| utils.isBlob(data) || | ||
| utils.isReadableStream(data) | ||
| ) { | ||
| return data; | ||
| } | ||
| if (utils.isArrayBufferView(data)) { | ||
| return data.buffer; | ||
| } | ||
| if (utils.isURLSearchParams(data)) { | ||
| headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); | ||
| return data.toString(); | ||
| } | ||
| if ( | ||
| utils.isArrayBuffer(data) || | ||
| utils.isBuffer(data) || | ||
| utils.isStream(data) || | ||
| utils.isFile(data) || | ||
| utils.isBlob(data) || | ||
| utils.isReadableStream(data) | ||
| ) { | ||
| return data; | ||
| } | ||
| if (utils.isArrayBufferView(data)) { | ||
| return data.buffer; | ||
| } | ||
| if (utils.isURLSearchParams(data)) { | ||
| headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); | ||
| return data.toString(); | ||
| } | ||
| let isFileList; | ||
| let isFileList; | ||
| if (isObjectPayload) { | ||
| if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { | ||
| return toURLEncodedForm(data, this.formSerializer).toString(); | ||
| } | ||
| if (isObjectPayload) { | ||
| if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { | ||
| return toURLEncodedForm(data, this.formSerializer).toString(); | ||
| } | ||
| if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { | ||
| const _FormData = this.env && this.env.FormData; | ||
| if ( | ||
| (isFileList = utils.isFileList(data)) || | ||
| contentType.indexOf('multipart/form-data') > -1 | ||
| ) { | ||
| const _FormData = this.env && this.env.FormData; | ||
| return toFormData( | ||
| isFileList ? {'files[]': data} : data, | ||
| _FormData && new _FormData(), | ||
| this.formSerializer | ||
| ); | ||
| return toFormData( | ||
| isFileList ? { 'files[]': data } : data, | ||
| _FormData && new _FormData(), | ||
| this.formSerializer | ||
| ); | ||
| } | ||
| } | ||
| } | ||
| if (isObjectPayload || hasJSONContentType ) { | ||
| headers.setContentType('application/json', false); | ||
| return stringifySafely(data); | ||
| } | ||
| if (isObjectPayload || hasJSONContentType) { | ||
| headers.setContentType('application/json', false); | ||
| return stringifySafely(data); | ||
| } | ||
| return data; | ||
| }], | ||
| return data; | ||
| }, | ||
| ], | ||
| transformResponse: [function transformResponse(data) { | ||
| const transitional = this.transitional || defaults.transitional; | ||
| const forcedJSONParsing = transitional && transitional.forcedJSONParsing; | ||
| const JSONRequested = this.responseType === 'json'; | ||
| transformResponse: [ | ||
| function transformResponse(data) { | ||
| const transitional = this.transitional || defaults.transitional; | ||
| const forcedJSONParsing = transitional && transitional.forcedJSONParsing; | ||
| const JSONRequested = this.responseType === 'json'; | ||
| if (utils.isResponse(data) || utils.isReadableStream(data)) { | ||
| return data; | ||
| } | ||
| if (utils.isResponse(data) || utils.isReadableStream(data)) { | ||
| return data; | ||
| } | ||
| if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { | ||
| const silentJSONParsing = transitional && transitional.silentJSONParsing; | ||
| const strictJSONParsing = !silentJSONParsing && JSONRequested; | ||
| if ( | ||
| data && | ||
| utils.isString(data) && | ||
| ((forcedJSONParsing && !this.responseType) || JSONRequested) | ||
| ) { | ||
| const silentJSONParsing = transitional && transitional.silentJSONParsing; | ||
| const strictJSONParsing = !silentJSONParsing && JSONRequested; | ||
| try { | ||
| return JSON.parse(data, this.parseReviver); | ||
| } catch (e) { | ||
| if (strictJSONParsing) { | ||
| if (e.name === 'SyntaxError') { | ||
| throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); | ||
| try { | ||
| return JSON.parse(data, this.parseReviver); | ||
| } catch (e) { | ||
| if (strictJSONParsing) { | ||
| if (e.name === 'SyntaxError') { | ||
| throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); | ||
| } | ||
| throw e; | ||
| } | ||
| throw e; | ||
| } | ||
| } | ||
| } | ||
| return data; | ||
| }], | ||
| return data; | ||
| }, | ||
| ], | ||
@@ -144,3 +155,3 @@ /** | ||
| FormData: platform.classes.FormData, | ||
| Blob: platform.classes.Blob | ||
| Blob: platform.classes.Blob, | ||
| }, | ||
@@ -154,6 +165,6 @@ | ||
| common: { | ||
| 'Accept': 'application/json, text/plain, */*', | ||
| 'Content-Type': undefined | ||
| } | ||
| } | ||
| Accept: 'application/json, text/plain, */*', | ||
| 'Content-Type': undefined, | ||
| }, | ||
| }, | ||
| }; | ||
@@ -160,0 +171,0 @@ |
@@ -7,3 +7,3 @@ 'use strict'; | ||
| clarifyTimeoutError: false, | ||
| legacyInterceptorReqResOrdering: true | ||
| legacyInterceptorReqResOrdering: true, | ||
| }; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| export const VERSION = "1.13.5"; | ||
| export const VERSION = "1.13.6"; |
@@ -8,20 +8,25 @@ 'use strict'; | ||
| class AxiosTransformStream extends stream.Transform{ | ||
| class AxiosTransformStream extends stream.Transform { | ||
| constructor(options) { | ||
| options = utils.toFlatObject(options, { | ||
| maxRate: 0, | ||
| chunkSize: 64 * 1024, | ||
| minChunkSize: 100, | ||
| timeWindow: 500, | ||
| ticksRate: 2, | ||
| samplesCount: 15 | ||
| }, null, (prop, source) => { | ||
| return !utils.isUndefined(source[prop]); | ||
| }); | ||
| options = utils.toFlatObject( | ||
| options, | ||
| { | ||
| maxRate: 0, | ||
| chunkSize: 64 * 1024, | ||
| minChunkSize: 100, | ||
| timeWindow: 500, | ||
| ticksRate: 2, | ||
| samplesCount: 15, | ||
| }, | ||
| null, | ||
| (prop, source) => { | ||
| return !utils.isUndefined(source[prop]); | ||
| } | ||
| ); | ||
| super({ | ||
| readableHighWaterMark: options.chunkSize | ||
| readableHighWaterMark: options.chunkSize, | ||
| }); | ||
| const internals = this[kInternals] = { | ||
| const internals = (this[kInternals] = { | ||
| timeWindow: options.timeWindow, | ||
@@ -36,6 +41,6 @@ chunkSize: options.chunkSize, | ||
| bytes: 0, | ||
| onReadCallback: null | ||
| }; | ||
| onReadCallback: null, | ||
| }); | ||
| this.on('newListener', event => { | ||
| this.on('newListener', (event) => { | ||
| if (event === 'progress') { | ||
@@ -68,4 +73,7 @@ if (!internals.isCaptured) { | ||
| const divider = 1000 / timeWindow; | ||
| const bytesThreshold = (maxRate / divider); | ||
| const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0; | ||
| const bytesThreshold = maxRate / divider; | ||
| const minChunkSize = | ||
| internals.minChunkSize !== false | ||
| ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) | ||
| : 0; | ||
@@ -87,3 +95,3 @@ const pushChunk = (_chunk, _callback) => { | ||
| } | ||
| } | ||
| }; | ||
@@ -100,3 +108,3 @@ const transformChunk = (_chunk, _callback) => { | ||
| if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) { | ||
| if (!internals.ts || (passed = now - internals.ts) >= timeWindow) { | ||
| internals.ts = now; | ||
@@ -124,3 +132,3 @@ bytesLeft = bytesThreshold - internals.bytes; | ||
| if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) { | ||
| if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) { | ||
| chunkRemainder = _chunk.subarray(maxChunkSize); | ||
@@ -130,5 +138,10 @@ _chunk = _chunk.subarray(0, maxChunkSize); | ||
| pushChunk(_chunk, chunkRemainder ? () => { | ||
| process.nextTick(_callback, null, chunkRemainder); | ||
| } : _callback); | ||
| pushChunk( | ||
| _chunk, | ||
| chunkRemainder | ||
| ? () => { | ||
| process.nextTick(_callback, null, chunkRemainder); | ||
| } | ||
| : _callback | ||
| ); | ||
| }; | ||
@@ -135,0 +148,0 @@ |
@@ -21,3 +21,3 @@ 'use strict'; | ||
| '%20': '+', | ||
| '%00': '\x00' | ||
| '%00': '\x00', | ||
| }; | ||
@@ -50,11 +50,15 @@ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { | ||
| prototype.toString = function toString(encoder) { | ||
| const _encode = encoder ? function(value) { | ||
| return encoder.call(this, value, encode); | ||
| } : encode; | ||
| const _encode = encoder | ||
| ? function (value) { | ||
| return encoder.call(this, value, encode); | ||
| } | ||
| : encode; | ||
| return this._pairs.map(function each(pair) { | ||
| return _encode(pair[0]) + '=' + _encode(pair[1]); | ||
| }, '').join('&'); | ||
| return this._pairs | ||
| .map(function each(pair) { | ||
| return _encode(pair[0]) + '=' + _encode(pair[1]); | ||
| }, '') | ||
| .join('&'); | ||
| }; | ||
| export default AxiosURLSearchParams; |
+15
-13
@@ -15,7 +15,7 @@ 'use strict'; | ||
| function encode(val) { | ||
| return encodeURIComponent(val). | ||
| replace(/%3A/gi, ':'). | ||
| replace(/%24/g, '$'). | ||
| replace(/%2C/gi, ','). | ||
| replace(/%20/g, '+'); | ||
| return encodeURIComponent(val) | ||
| .replace(/%3A/gi, ':') | ||
| .replace(/%24/g, '$') | ||
| .replace(/%2C/gi, ',') | ||
| .replace(/%20/g, '+'); | ||
| } | ||
@@ -37,7 +37,9 @@ | ||
| const _encode = options && options.encode || encode; | ||
| const _encode = (options && options.encode) || encode; | ||
| const _options = utils.isFunction(options) ? { | ||
| serialize: options | ||
| } : options; | ||
| const _options = utils.isFunction(options) | ||
| ? { | ||
| serialize: options, | ||
| } | ||
| : options; | ||
@@ -51,9 +53,9 @@ const serializeFn = _options && _options.serialize; | ||
| } else { | ||
| serializedParams = utils.isURLSearchParams(params) ? | ||
| params.toString() : | ||
| new AxiosURLSearchParams(params, _options).toString(_encode); | ||
| serializedParams = utils.isURLSearchParams(params) | ||
| ? params.toString() | ||
| : new AxiosURLSearchParams(params, _options).toString(_encode); | ||
| } | ||
| if (serializedParams) { | ||
| const hashmarkIndex = url.indexOf("#"); | ||
| const hashmarkIndex = url.indexOf('#'); | ||
@@ -60,0 +62,0 @@ if (hashmarkIndex !== -1) { |
@@ -1,16 +0,18 @@ | ||
| import utils from "../utils.js"; | ||
| import utils from '../utils.js'; | ||
| const callbackify = (fn, reducer) => { | ||
| return utils.isAsyncFn(fn) ? function (...args) { | ||
| const cb = args.pop(); | ||
| fn.apply(this, args).then((value) => { | ||
| try { | ||
| reducer ? cb(null, ...reducer(value)) : cb(null, value); | ||
| } catch (err) { | ||
| cb(err); | ||
| return utils.isAsyncFn(fn) | ||
| ? function (...args) { | ||
| const cb = args.pop(); | ||
| fn.apply(this, args).then((value) => { | ||
| try { | ||
| reducer ? cb(null, ...reducer(value)) : cb(null, value); | ||
| } catch (err) { | ||
| cb(err); | ||
| } | ||
| }, cb); | ||
| } | ||
| }, cb); | ||
| } : fn; | ||
| } | ||
| : fn; | ||
| }; | ||
| export default callbackify; |
@@ -1,7 +0,7 @@ | ||
| import CanceledError from "../cancel/CanceledError.js"; | ||
| import AxiosError from "../core/AxiosError.js"; | ||
| import CanceledError from '../cancel/CanceledError.js'; | ||
| import AxiosError from '../core/AxiosError.js'; | ||
| import utils from '../utils.js'; | ||
| const composeSignals = (signals, timeout) => { | ||
| const {length} = (signals = signals ? signals.filter(Boolean) : []); | ||
| const { length } = (signals = signals ? signals.filter(Boolean) : []); | ||
@@ -18,10 +18,16 @@ if (timeout || length) { | ||
| const err = reason instanceof Error ? reason : this.reason; | ||
| controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)); | ||
| controller.abort( | ||
| err instanceof AxiosError | ||
| ? err | ||
| : new CanceledError(err instanceof Error ? err.message : err) | ||
| ); | ||
| } | ||
| } | ||
| }; | ||
| let timer = timeout && setTimeout(() => { | ||
| timer = null; | ||
| onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT)) | ||
| }, timeout) | ||
| let timer = | ||
| timeout && | ||
| setTimeout(() => { | ||
| timer = null; | ||
| onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT)); | ||
| }, timeout); | ||
@@ -32,12 +38,14 @@ const unsubscribe = () => { | ||
| timer = null; | ||
| signals.forEach(signal => { | ||
| signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort); | ||
| signals.forEach((signal) => { | ||
| signal.unsubscribe | ||
| ? signal.unsubscribe(onabort) | ||
| : signal.removeEventListener('abort', onabort); | ||
| }); | ||
| signals = null; | ||
| } | ||
| } | ||
| }; | ||
| signals.forEach((signal) => signal.addEventListener('abort', onabort)); | ||
| const {signal} = controller; | ||
| const { signal } = controller; | ||
@@ -48,4 +56,4 @@ signal.unsubscribe = () => utils.asap(unsubscribe); | ||
| } | ||
| } | ||
| }; | ||
| export default composeSignals; |
+39
-44
| import utils from '../utils.js'; | ||
| import platform from '../platform/index.js'; | ||
| export default platform.hasStandardBrowserEnv ? | ||
| export default platform.hasStandardBrowserEnv | ||
| ? // Standard browser envs support document.cookie | ||
| { | ||
| write(name, value, expires, path, domain, secure, sameSite) { | ||
| if (typeof document === 'undefined') return; | ||
| // Standard browser envs support document.cookie | ||
| { | ||
| write(name, value, expires, path, domain, secure, sameSite) { | ||
| if (typeof document === 'undefined') return; | ||
| const cookie = [`${name}=${encodeURIComponent(value)}`]; | ||
| const cookie = [`${name}=${encodeURIComponent(value)}`]; | ||
| if (utils.isNumber(expires)) { | ||
| cookie.push(`expires=${new Date(expires).toUTCString()}`); | ||
| } | ||
| if (utils.isString(path)) { | ||
| cookie.push(`path=${path}`); | ||
| } | ||
| if (utils.isString(domain)) { | ||
| cookie.push(`domain=${domain}`); | ||
| } | ||
| if (secure === true) { | ||
| cookie.push('secure'); | ||
| } | ||
| if (utils.isString(sameSite)) { | ||
| cookie.push(`SameSite=${sameSite}`); | ||
| } | ||
| if (utils.isNumber(expires)) { | ||
| cookie.push(`expires=${new Date(expires).toUTCString()}`); | ||
| } | ||
| if (utils.isString(path)) { | ||
| cookie.push(`path=${path}`); | ||
| } | ||
| if (utils.isString(domain)) { | ||
| cookie.push(`domain=${domain}`); | ||
| } | ||
| if (secure === true) { | ||
| cookie.push('secure'); | ||
| } | ||
| if (utils.isString(sameSite)) { | ||
| cookie.push(`SameSite=${sameSite}`); | ||
| } | ||
| document.cookie = cookie.join('; '); | ||
| }, | ||
| document.cookie = cookie.join('; '); | ||
| }, | ||
| read(name) { | ||
| if (typeof document === 'undefined') return null; | ||
| const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)')); | ||
| return match ? decodeURIComponent(match[1]) : null; | ||
| }, | ||
| read(name) { | ||
| if (typeof document === 'undefined') return null; | ||
| const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)')); | ||
| return match ? decodeURIComponent(match[1]) : null; | ||
| }, | ||
| remove(name) { | ||
| this.write(name, '', Date.now() - 86400000, '/'); | ||
| remove(name) { | ||
| this.write(name, '', Date.now() - 86400000, '/'); | ||
| }, | ||
| } | ||
| } | ||
| : | ||
| // Non-standard browser env (web workers, react-native) lack needed support. | ||
| { | ||
| write() {}, | ||
| read() { | ||
| return null; | ||
| }, | ||
| remove() {} | ||
| }; | ||
| : // Non-standard browser env (web workers, react-native) lack needed support. | ||
| { | ||
| write() {}, | ||
| read() { | ||
| return null; | ||
| }, | ||
| remove() {}, | ||
| }; |
@@ -18,5 +18,8 @@ 'use strict'; | ||
| console.warn( | ||
| 'DEPRECATED method `' + method + '`.' + | ||
| (instead ? ' Use `' + instead + '` instead.' : '') + | ||
| ' This method will be removed in a future release.'); | ||
| 'DEPRECATED method `' + | ||
| method + | ||
| '`.' + | ||
| (instead ? ' Use `' + instead + '` instead.' : '') + | ||
| ' This method will be removed in a future release.' | ||
| ); | ||
@@ -26,3 +29,5 @@ if (docs) { | ||
| } | ||
| } catch (e) { /* Ignore */ } | ||
| } catch (e) { | ||
| /* Ignore */ | ||
| } | ||
| } |
@@ -17,3 +17,3 @@ 'use strict'; | ||
| // foo x y z | ||
| return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => { | ||
| return utils.matchAll(/\w+|\[(\w*)]/g, name).map((match) => { | ||
| return match[0] === '[]' ? '' : match[1] || match[0]; | ||
@@ -20,0 +20,0 @@ }); |
| import util from 'util'; | ||
| import {Readable} from 'stream'; | ||
| import utils from "../utils.js"; | ||
| import readBlob from "./readBlob.js"; | ||
| import platform from "../platform/index.js"; | ||
| import { Readable } from 'stream'; | ||
| import utils from '../utils.js'; | ||
| import readBlob from './readBlob.js'; | ||
| import platform from '../platform/index.js'; | ||
@@ -17,3 +17,3 @@ const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_'; | ||
| constructor(name, value) { | ||
| const {escapeName} = this.constructor; | ||
| const { escapeName } = this.constructor; | ||
| const isStringValue = utils.isString(value); | ||
@@ -28,3 +28,3 @@ | ||
| } else { | ||
| headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}` | ||
| headers += `Content-Type: ${value.type || 'application/octet-stream'}${CRLF}`; | ||
| } | ||
@@ -42,8 +42,8 @@ | ||
| async *encode(){ | ||
| async *encode() { | ||
| yield this.headers; | ||
| const {value} = this; | ||
| const { value } = this; | ||
| if(utils.isTypedArray(value)) { | ||
| if (utils.isTypedArray(value)) { | ||
| yield value; | ||
@@ -58,7 +58,11 @@ } else { | ||
| static escapeName(name) { | ||
| return String(name).replace(/[\r\n"]/g, (match) => ({ | ||
| '\r' : '%0D', | ||
| '\n' : '%0A', | ||
| '"' : '%22', | ||
| }[match])); | ||
| return String(name).replace( | ||
| /[\r\n"]/g, | ||
| (match) => | ||
| ({ | ||
| '\r': '%0D', | ||
| '\n': '%0A', | ||
| '"': '%22', | ||
| })[match] | ||
| ); | ||
| } | ||
@@ -71,6 +75,6 @@ } | ||
| size = 25, | ||
| boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET) | ||
| boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET), | ||
| } = options || {}; | ||
| if(!utils.isFormData(form)) { | ||
| if (!utils.isFormData(form)) { | ||
| throw TypeError('FormData instance required'); | ||
@@ -80,3 +84,3 @@ } | ||
| if (boundary.length < 1 || boundary.length > 70) { | ||
| throw Error('boundary must be 10-70 characters long') | ||
| throw Error('boundary must be 10-70 characters long'); | ||
| } | ||
@@ -99,4 +103,4 @@ | ||
| const computedHeaders = { | ||
| 'Content-Type': `multipart/form-data; boundary=${boundary}` | ||
| } | ||
| 'Content-Type': `multipart/form-data; boundary=${boundary}`, | ||
| }; | ||
@@ -109,12 +113,14 @@ if (Number.isFinite(contentLength)) { | ||
| return Readable.from((async function *() { | ||
| for(const part of parts) { | ||
| yield boundaryBytes; | ||
| yield* part.encode(); | ||
| } | ||
| return Readable.from( | ||
| (async function* () { | ||
| for (const part of parts) { | ||
| yield boundaryBytes; | ||
| yield* part.encode(); | ||
| } | ||
| yield footerBytes; | ||
| })()); | ||
| yield footerBytes; | ||
| })() | ||
| ); | ||
| }; | ||
| export default formDataToStream; |
@@ -20,3 +20,3 @@ 'use strict'; | ||
| export default function fromDataURI(uri, asBlob, options) { | ||
| const _Blob = options && options.Blob || platform.classes.Blob; | ||
| const _Blob = (options && options.Blob) || platform.classes.Blob; | ||
| const protocol = parseProtocol(uri); | ||
@@ -47,3 +47,3 @@ | ||
| return new _Blob([buffer], {type: mime}); | ||
| return new _Blob([buffer], { type: mime }); | ||
| } | ||
@@ -50,0 +50,0 @@ |
@@ -20,2 +20,1 @@ 'use strict'; | ||
| } | ||
@@ -13,3 +13,3 @@ 'use strict'; | ||
| export default function isAxiosError(payload) { | ||
| return utils.isObject(payload) && (payload.isAxiosError === true); | ||
| return utils.isObject(payload) && payload.isAxiosError === true; | ||
| } |
| import platform from '../platform/index.js'; | ||
| export default platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => { | ||
| url = new URL(url, platform.origin); | ||
| export default platform.hasStandardBrowserEnv | ||
| ? ((origin, isMSIE) => (url) => { | ||
| url = new URL(url, platform.origin); | ||
| return ( | ||
| origin.protocol === url.protocol && | ||
| origin.host === url.host && | ||
| (isMSIE || origin.port === url.port) | ||
| ); | ||
| })( | ||
| new URL(platform.origin), | ||
| platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) | ||
| ) : () => true; | ||
| return ( | ||
| origin.protocol === url.protocol && | ||
| origin.host === url.host && | ||
| (isMSIE || origin.port === url.port) | ||
| ); | ||
| })( | ||
| new URL(platform.origin), | ||
| platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) | ||
| ) | ||
| : () => true; |
@@ -8,6 +8,19 @@ 'use strict'; | ||
| const ignoreDuplicateOf = utils.toObjectSet([ | ||
| 'age', 'authorization', 'content-length', 'content-type', 'etag', | ||
| 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', | ||
| 'last-modified', 'location', 'max-forwards', 'proxy-authorization', | ||
| 'referer', 'retry-after', 'user-agent' | ||
| 'age', | ||
| 'authorization', | ||
| 'content-length', | ||
| 'content-type', | ||
| 'etag', | ||
| 'expires', | ||
| 'from', | ||
| 'host', | ||
| 'if-modified-since', | ||
| 'if-unmodified-since', | ||
| 'last-modified', | ||
| 'location', | ||
| 'max-forwards', | ||
| 'proxy-authorization', | ||
| 'referer', | ||
| 'retry-after', | ||
| 'user-agent', | ||
| ]); | ||
@@ -29,3 +42,3 @@ | ||
| */ | ||
| export default rawHeaders => { | ||
| export default (rawHeaders) => { | ||
| const parsed = {}; | ||
@@ -36,23 +49,24 @@ let key; | ||
| rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { | ||
| i = line.indexOf(':'); | ||
| key = line.substring(0, i).trim().toLowerCase(); | ||
| val = line.substring(i + 1).trim(); | ||
| rawHeaders && | ||
| rawHeaders.split('\n').forEach(function parser(line) { | ||
| i = line.indexOf(':'); | ||
| key = line.substring(0, i).trim().toLowerCase(); | ||
| val = line.substring(i + 1).trim(); | ||
| if (!key || (parsed[key] && ignoreDuplicateOf[key])) { | ||
| return; | ||
| } | ||
| if (!key || (parsed[key] && ignoreDuplicateOf[key])) { | ||
| return; | ||
| } | ||
| if (key === 'set-cookie') { | ||
| if (parsed[key]) { | ||
| parsed[key].push(val); | ||
| if (key === 'set-cookie') { | ||
| if (parsed[key]) { | ||
| parsed[key].push(val); | ||
| } else { | ||
| parsed[key] = [val]; | ||
| } | ||
| } else { | ||
| parsed[key] = [val]; | ||
| parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; | ||
| } | ||
| } else { | ||
| parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; | ||
| } | ||
| }); | ||
| }); | ||
| return parsed; | ||
| }; |
@@ -5,3 +5,3 @@ 'use strict'; | ||
| const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); | ||
| return match && match[1] || ''; | ||
| return (match && match[1]) || ''; | ||
| } |
@@ -1,4 +0,4 @@ | ||
| import speedometer from "./speedometer.js"; | ||
| import throttle from "./throttle.js"; | ||
| import utils from "../utils.js"; | ||
| import speedometer from './speedometer.js'; | ||
| import throttle from './throttle.js'; | ||
| import utils from '../utils.js'; | ||
@@ -9,3 +9,3 @@ export const progressEventReducer = (listener, isDownloadStream, freq = 3) => { | ||
| return throttle(e => { | ||
| return throttle((e) => { | ||
| const loaded = e.loaded; | ||
@@ -22,3 +22,3 @@ const total = e.lengthComputable ? e.total : undefined; | ||
| total, | ||
| progress: total ? (loaded / total) : undefined, | ||
| progress: total ? loaded / total : undefined, | ||
| bytes: progressBytes, | ||
@@ -29,3 +29,3 @@ rate: rate ? rate : undefined, | ||
| lengthComputable: total != null, | ||
| [isDownloadStream ? 'download' : 'upload']: true | ||
| [isDownloadStream ? 'download' : 'upload']: true, | ||
| }; | ||
@@ -35,3 +35,3 @@ | ||
| }, freq); | ||
| } | ||
| }; | ||
@@ -41,9 +41,16 @@ export const progressEventDecorator = (total, throttled) => { | ||
| return [(loaded) => throttled[0]({ | ||
| lengthComputable, | ||
| total, | ||
| loaded | ||
| }), throttled[1]]; | ||
| } | ||
| return [ | ||
| (loaded) => | ||
| throttled[0]({ | ||
| lengthComputable, | ||
| total, | ||
| loaded, | ||
| }), | ||
| throttled[1], | ||
| ]; | ||
| }; | ||
| export const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args)); | ||
| export const asyncDecorator = | ||
| (fn) => | ||
| (...args) => | ||
| utils.asap(() => fn(...args)); |
@@ -1,8 +0,8 @@ | ||
| const {asyncIterator} = Symbol; | ||
| const { asyncIterator } = Symbol; | ||
| const readBlob = async function* (blob) { | ||
| if (blob.stream) { | ||
| yield* blob.stream() | ||
| yield* blob.stream(); | ||
| } else if (blob.arrayBuffer) { | ||
| yield await blob.arrayBuffer() | ||
| yield await blob.arrayBuffer(); | ||
| } else if (blob[asyncIterator]) { | ||
@@ -13,4 +13,4 @@ yield* blob[asyncIterator](); | ||
| } | ||
| } | ||
| }; | ||
| export default readBlob; |
@@ -1,9 +0,9 @@ | ||
| import platform from "../platform/index.js"; | ||
| import utils from "../utils.js"; | ||
| import isURLSameOrigin from "./isURLSameOrigin.js"; | ||
| import cookies from "./cookies.js"; | ||
| import buildFullPath from "../core/buildFullPath.js"; | ||
| import mergeConfig from "../core/mergeConfig.js"; | ||
| import AxiosHeaders from "../core/AxiosHeaders.js"; | ||
| import buildURL from "./buildURL.js"; | ||
| import platform from '../platform/index.js'; | ||
| import utils from '../utils.js'; | ||
| import isURLSameOrigin from './isURLSameOrigin.js'; | ||
| import cookies from './cookies.js'; | ||
| import buildFullPath from '../core/buildFullPath.js'; | ||
| import mergeConfig from '../core/mergeConfig.js'; | ||
| import AxiosHeaders from '../core/AxiosHeaders.js'; | ||
| import buildURL from './buildURL.js'; | ||
@@ -17,8 +17,18 @@ export default (config) => { | ||
| newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); | ||
| newConfig.url = buildURL( | ||
| buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), | ||
| config.params, | ||
| config.paramsSerializer | ||
| ); | ||
| // HTTP basic authentication | ||
| if (auth) { | ||
| headers.set('Authorization', 'Basic ' + | ||
| btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : '')) | ||
| headers.set( | ||
| 'Authorization', | ||
| 'Basic ' + | ||
| btoa( | ||
| (auth.username || '') + | ||
| ':' + | ||
| (auth.password ? unescape(encodeURIComponent(auth.password)) : '') | ||
| ) | ||
| ); | ||
@@ -41,3 +51,3 @@ } | ||
| } | ||
| } | ||
| } | ||
@@ -62,3 +72,2 @@ // Add xsrf header | ||
| return newConfig; | ||
| } | ||
| }; |
@@ -51,3 +51,3 @@ 'use strict'; | ||
| return passed ? Math.round(bytesCount * 1000 / passed) : undefined; | ||
| return passed ? Math.round((bytesCount * 1000) / passed) : undefined; | ||
| }; | ||
@@ -54,0 +54,0 @@ } |
@@ -21,3 +21,3 @@ /** | ||
| fn(...args); | ||
| } | ||
| }; | ||
@@ -27,3 +27,3 @@ const throttled = (...args) => { | ||
| const passed = now - timestamp; | ||
| if ( passed >= threshold) { | ||
| if (passed >= threshold) { | ||
| invoke(args, now); | ||
@@ -35,7 +35,7 @@ } else { | ||
| timer = null; | ||
| invoke(lastArgs) | ||
| invoke(lastArgs); | ||
| }, threshold - passed); | ||
| } | ||
| } | ||
| } | ||
| }; | ||
@@ -42,0 +42,0 @@ const flush = () => lastArgs && invoke(lastArgs); |
@@ -41,7 +41,10 @@ 'use strict'; | ||
| if (!path) return key; | ||
| return path.concat(key).map(function each(token, i) { | ||
| // eslint-disable-next-line no-param-reassign | ||
| token = removeBrackets(token); | ||
| return !dots && i ? '[' + token + ']' : token; | ||
| }).join(dots ? '.' : ''); | ||
| return path | ||
| .concat(key) | ||
| .map(function each(token, i) { | ||
| // eslint-disable-next-line no-param-reassign | ||
| token = removeBrackets(token); | ||
| return !dots && i ? '[' + token + ']' : token; | ||
| }) | ||
| .join(dots ? '.' : ''); | ||
| } | ||
@@ -96,10 +99,15 @@ | ||
| // eslint-disable-next-line no-param-reassign | ||
| options = utils.toFlatObject(options, { | ||
| metaTokens: true, | ||
| dots: false, | ||
| indexes: false | ||
| }, false, function defined(option, source) { | ||
| // eslint-disable-next-line no-eq-null,eqeqeq | ||
| return !utils.isUndefined(source[option]); | ||
| }); | ||
| options = utils.toFlatObject( | ||
| options, | ||
| { | ||
| metaTokens: true, | ||
| dots: false, | ||
| indexes: false, | ||
| }, | ||
| false, | ||
| function defined(option, source) { | ||
| // eslint-disable-next-line no-eq-null,eqeqeq | ||
| return !utils.isUndefined(source[option]); | ||
| } | ||
| ); | ||
@@ -111,3 +119,3 @@ const metaTokens = options.metaTokens; | ||
| const indexes = options.indexes; | ||
| const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; | ||
| const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob); | ||
| const useBlob = _Blob && utils.isSpecCompliantForm(formData); | ||
@@ -154,2 +162,7 @@ | ||
| if (utils.isReactNative(formData) && utils.isReactNativeBlob(value)) { | ||
| formData.append(renderKey(path, key, dots), convertValue(value)); | ||
| return false; | ||
| } | ||
| if (value && !path && typeof value === 'object') { | ||
@@ -163,4 +176,4 @@ if (utils.endsWith(key, '{}')) { | ||
| (utils.isArray(value) && isFlatArray(value)) || | ||
| ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value)) | ||
| )) { | ||
| ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))) | ||
| ) { | ||
| // eslint-disable-next-line no-param-reassign | ||
@@ -170,7 +183,12 @@ key = removeBrackets(key); | ||
| arr.forEach(function each(el, index) { | ||
| !(utils.isUndefined(el) || el === null) && formData.append( | ||
| // eslint-disable-next-line no-nested-ternary | ||
| indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), | ||
| convertValue(el) | ||
| ); | ||
| !(utils.isUndefined(el) || el === null) && | ||
| formData.append( | ||
| // eslint-disable-next-line no-nested-ternary | ||
| indexes === true | ||
| ? renderKey([key], index, dots) | ||
| : indexes === null | ||
| ? key | ||
| : key + '[]', | ||
| convertValue(el) | ||
| ); | ||
| }); | ||
@@ -195,3 +213,3 @@ return false; | ||
| convertValue, | ||
| isVisitable | ||
| isVisitable, | ||
| }); | ||
@@ -209,5 +227,5 @@ | ||
| utils.forEach(value, function each(el, key) { | ||
| const result = !(utils.isUndefined(el) || el === null) && visitor.call( | ||
| formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers | ||
| ); | ||
| const result = | ||
| !(utils.isUndefined(el) || el === null) && | ||
| visitor.call(formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers); | ||
@@ -214,0 +232,0 @@ if (result === true) { |
@@ -9,3 +9,3 @@ 'use strict'; | ||
| return toFormData(data, new platform.classes.URLSearchParams(), { | ||
| visitor: function(value, key, path, helpers) { | ||
| visitor: function (value, key, path, helpers) { | ||
| if (platform.isNode && utils.isBuffer(value)) { | ||
@@ -18,4 +18,4 @@ this.append(key, value.toString('base64')); | ||
| }, | ||
| ...options | ||
| ...options, | ||
| }); | ||
| } |
@@ -1,2 +0,1 @@ | ||
| export const streamChunk = function* (chunk, chunkSize) { | ||
@@ -18,3 +17,3 @@ let len = chunk.byteLength; | ||
| } | ||
| } | ||
| }; | ||
@@ -25,3 +24,3 @@ export const readBytes = async function* (iterable, chunkSize) { | ||
| } | ||
| } | ||
| }; | ||
@@ -37,3 +36,3 @@ const readStream = async function* (stream) { | ||
| for (;;) { | ||
| const {done, value} = await reader.read(); | ||
| const { done, value } = await reader.read(); | ||
| if (done) { | ||
@@ -47,3 +46,3 @@ break; | ||
| } | ||
| } | ||
| }; | ||
@@ -60,33 +59,36 @@ export const trackStream = (stream, chunkSize, onProgress, onFinish) => { | ||
| } | ||
| } | ||
| }; | ||
| return new ReadableStream({ | ||
| async pull(controller) { | ||
| try { | ||
| const {done, value} = await iterator.next(); | ||
| return new ReadableStream( | ||
| { | ||
| async pull(controller) { | ||
| try { | ||
| const { done, value } = await iterator.next(); | ||
| if (done) { | ||
| _onFinish(); | ||
| controller.close(); | ||
| return; | ||
| } | ||
| if (done) { | ||
| _onFinish(); | ||
| controller.close(); | ||
| return; | ||
| } | ||
| let len = value.byteLength; | ||
| if (onProgress) { | ||
| let loadedBytes = bytes += len; | ||
| onProgress(loadedBytes); | ||
| let len = value.byteLength; | ||
| if (onProgress) { | ||
| let loadedBytes = (bytes += len); | ||
| onProgress(loadedBytes); | ||
| } | ||
| controller.enqueue(new Uint8Array(value)); | ||
| } catch (err) { | ||
| _onFinish(err); | ||
| throw err; | ||
| } | ||
| controller.enqueue(new Uint8Array(value)); | ||
| } catch (err) { | ||
| _onFinish(err); | ||
| throw err; | ||
| } | ||
| }, | ||
| cancel(reason) { | ||
| _onFinish(reason); | ||
| return iterator.return(); | ||
| }, | ||
| }, | ||
| cancel(reason) { | ||
| _onFinish(reason); | ||
| return iterator.return(); | ||
| { | ||
| highWaterMark: 2, | ||
| } | ||
| }, { | ||
| highWaterMark: 2 | ||
| }) | ||
| } | ||
| ); | ||
| }; |
| 'use strict'; | ||
| import {VERSION} from '../env/data.js'; | ||
| import { VERSION } from '../env/data.js'; | ||
| import AxiosError from '../core/AxiosError.js'; | ||
@@ -28,3 +28,11 @@ | ||
| function formatMessage(opt, desc) { | ||
| return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); | ||
| return ( | ||
| '[Axios v' + | ||
| VERSION + | ||
| "] Transitional option '" + | ||
| opt + | ||
| "'" + | ||
| desc + | ||
| (message ? '. ' + message : '') | ||
| ); | ||
| } | ||
@@ -61,3 +69,3 @@ | ||
| return true; | ||
| } | ||
| }; | ||
| }; | ||
@@ -88,3 +96,6 @@ | ||
| if (result !== true) { | ||
| throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); | ||
| throw new AxiosError( | ||
| 'option ' + opt + ' must be ' + result, | ||
| AxiosError.ERR_BAD_OPTION_VALUE | ||
| ); | ||
| } | ||
@@ -101,3 +112,3 @@ continue; | ||
| assertOptions, | ||
| validators | ||
| validators, | ||
| }; |
@@ -1,4 +0,4 @@ | ||
| "use strict"; | ||
| 'use strict'; | ||
| import stream from "stream"; | ||
| import stream from 'stream'; | ||
@@ -16,6 +16,7 @@ class ZlibHeaderTransformStream extends stream.Transform { | ||
| // Add Default Compression headers if no zlib headers are present | ||
| if (chunk[0] !== 120) { // Hex: 78 | ||
| if (chunk[0] !== 120) { | ||
| // Hex: 78 | ||
| const header = Buffer.alloc(2); | ||
| header[0] = 120; // Hex: 78 | ||
| header[1] = 156; // Hex: 9C | ||
| header[1] = 156; // Hex: 9C | ||
| this.push(header, encoding); | ||
@@ -22,0 +23,0 @@ } |
@@ -1,3 +0,3 @@ | ||
| 'use strict' | ||
| 'use strict'; | ||
| export default typeof Blob !== 'undefined' ? Blob : null | ||
| export default typeof Blob !== 'undefined' ? Blob : null; |
@@ -1,4 +0,4 @@ | ||
| import URLSearchParams from './classes/URLSearchParams.js' | ||
| import FormData from './classes/FormData.js' | ||
| import Blob from './classes/Blob.js' | ||
| import URLSearchParams from './classes/URLSearchParams.js'; | ||
| import FormData from './classes/FormData.js'; | ||
| import Blob from './classes/Blob.js'; | ||
@@ -10,5 +10,5 @@ export default { | ||
| FormData, | ||
| Blob | ||
| Blob, | ||
| }, | ||
| protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] | ||
| protocols: ['http', 'https', 'file', 'blob', 'url', 'data'], | ||
| }; |
| const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; | ||
| const _navigator = typeof navigator === 'object' && navigator || undefined; | ||
| const _navigator = (typeof navigator === 'object' && navigator) || undefined; | ||
@@ -22,3 +22,4 @@ /** | ||
| */ | ||
| const hasStandardBrowserEnv = hasBrowserEnv && | ||
| const hasStandardBrowserEnv = | ||
| hasBrowserEnv && | ||
| (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0); | ||
@@ -44,3 +45,3 @@ | ||
| const origin = hasBrowserEnv && window.location.href || 'http://localhost'; | ||
| const origin = (hasBrowserEnv && window.location.href) || 'http://localhost'; | ||
@@ -52,3 +53,3 @@ export { | ||
| _navigator as navigator, | ||
| origin | ||
| } | ||
| origin, | ||
| }; |
@@ -6,3 +6,3 @@ import platform from './node/index.js'; | ||
| ...utils, | ||
| ...platform | ||
| } | ||
| ...platform, | ||
| }; |
| import crypto from 'crypto'; | ||
| import URLSearchParams from './classes/URLSearchParams.js' | ||
| import FormData from './classes/FormData.js' | ||
| import URLSearchParams from './classes/URLSearchParams.js'; | ||
| import FormData from './classes/FormData.js'; | ||
| const ALPHA = 'abcdefghijklmnopqrstuvwxyz' | ||
| const ALPHA = 'abcdefghijklmnopqrstuvwxyz'; | ||
@@ -12,8 +12,8 @@ const DIGIT = '0123456789'; | ||
| ALPHA, | ||
| ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT | ||
| } | ||
| ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT, | ||
| }; | ||
| const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { | ||
| let str = ''; | ||
| const {length} = alphabet; | ||
| const { length } = alphabet; | ||
| const randomValues = new Uint32Array(size); | ||
@@ -26,5 +26,4 @@ crypto.randomFillSync(randomValues); | ||
| return str; | ||
| } | ||
| }; | ||
| export default { | ||
@@ -35,7 +34,7 @@ isNode: true, | ||
| FormData, | ||
| Blob: typeof Blob !== 'undefined' && Blob || null | ||
| Blob: (typeof Blob !== 'undefined' && Blob) || null, | ||
| }, | ||
| ALPHABET, | ||
| generateString, | ||
| protocols: [ 'http', 'https', 'file', 'data' ] | ||
| protocols: ['http', 'https', 'file', 'data'], | ||
| }; |
+149
-93
@@ -1,4 +0,4 @@ | ||
| "use strict"; | ||
| 'use strict'; | ||
| import bind from "./helpers/bind.js"; | ||
| import bind from './helpers/bind.js'; | ||
@@ -39,3 +39,3 @@ // utils is a library of generic helper functions non-specific to axios | ||
| */ | ||
| const isUndefined = typeOfTest("undefined"); | ||
| const isUndefined = typeOfTest('undefined'); | ||
@@ -67,3 +67,3 @@ /** | ||
| */ | ||
| const isArrayBuffer = kindOfTest("ArrayBuffer"); | ||
| const isArrayBuffer = kindOfTest('ArrayBuffer'); | ||
@@ -79,3 +79,3 @@ /** | ||
| let result; | ||
| if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { | ||
| if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { | ||
| result = ArrayBuffer.isView(val); | ||
@@ -95,3 +95,3 @@ } else { | ||
| */ | ||
| const isString = typeOfTest("string"); | ||
| const isString = typeOfTest('string'); | ||
@@ -104,3 +104,3 @@ /** | ||
| */ | ||
| const isFunction = typeOfTest("function"); | ||
| const isFunction = typeOfTest('function'); | ||
@@ -114,3 +114,3 @@ /** | ||
| */ | ||
| const isNumber = typeOfTest("number"); | ||
| const isNumber = typeOfTest('number'); | ||
@@ -124,3 +124,3 @@ /** | ||
| */ | ||
| const isObject = (thing) => thing !== null && typeof thing === "object"; | ||
| const isObject = (thing) => thing !== null && typeof thing === 'object'; | ||
@@ -143,3 +143,3 @@ /** | ||
| const isPlainObject = (val) => { | ||
| if (kindOf(val) !== "object") { | ||
| if (kindOf(val) !== 'object') { | ||
| return false; | ||
@@ -172,6 +172,3 @@ } | ||
| try { | ||
| return ( | ||
| Object.keys(val).length === 0 && | ||
| Object.getPrototypeOf(val) === Object.prototype | ||
| ); | ||
| return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; | ||
| } catch (e) { | ||
@@ -190,3 +187,3 @@ // Fallback for any other objects that might cause RangeError with Object.keys() | ||
| */ | ||
| const isDate = kindOfTest("Date"); | ||
| const isDate = kindOfTest('Date'); | ||
@@ -200,5 +197,30 @@ /** | ||
| */ | ||
| const isFile = kindOfTest("File"); | ||
| const isFile = kindOfTest('File'); | ||
| /** | ||
| * Determine if a value is a React Native Blob | ||
| * React Native "blob": an object with a `uri` attribute. Optionally, it can | ||
| * also have a `name` and `type` attribute to specify filename and content type | ||
| * | ||
| * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71 | ||
| * | ||
| * @param {*} value The value to test | ||
| * | ||
| * @returns {boolean} True if value is a React Native Blob, otherwise false | ||
| */ | ||
| const isReactNativeBlob = (value) => { | ||
| return !!(value && typeof value.uri !== 'undefined'); | ||
| } | ||
| /** | ||
| * Determine if environment is React Native | ||
| * ReactNative `FormData` has a non-standard `getParts()` method | ||
| * | ||
| * @param {*} formData The formData to test | ||
| * | ||
| * @returns {boolean} True if environment is React Native, otherwise false | ||
| */ | ||
| const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined'; | ||
| /** | ||
| * Determine if a value is a Blob | ||
@@ -210,3 +232,3 @@ * | ||
| */ | ||
| const isBlob = kindOfTest("Blob"); | ||
| const isBlob = kindOfTest('Blob'); | ||
@@ -220,3 +242,3 @@ /** | ||
| */ | ||
| const isFileList = kindOfTest("FileList"); | ||
| const isFileList = kindOfTest('FileList'); | ||
@@ -239,13 +261,23 @@ /** | ||
| */ | ||
| function getGlobal() { | ||
| if (typeof globalThis !== 'undefined') return globalThis; | ||
| if (typeof self !== 'undefined') return self; | ||
| if (typeof window !== 'undefined') return window; | ||
| if (typeof global !== 'undefined') return global; | ||
| return {}; | ||
| } | ||
| const G = getGlobal(); | ||
| const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined; | ||
| const isFormData = (thing) => { | ||
| let kind; | ||
| return ( | ||
| thing && | ||
| ((typeof FormData === "function" && thing instanceof FormData) || | ||
| (isFunction(thing.append) && | ||
| ((kind = kindOf(thing)) === "formdata" || | ||
| // detect form-data instance | ||
| (kind === "object" && | ||
| isFunction(thing.toString) && | ||
| thing.toString() === "[object FormData]")))) | ||
| return thing && ( | ||
| (FormDataCtor && thing instanceof FormDataCtor) || ( | ||
| isFunction(thing.append) && ( | ||
| (kind = kindOf(thing)) === 'formdata' || | ||
| // detect form-data instance | ||
| (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]') | ||
| ) | ||
| ) | ||
| ); | ||
@@ -261,9 +293,9 @@ }; | ||
| */ | ||
| const isURLSearchParams = kindOfTest("URLSearchParams"); | ||
| const isURLSearchParams = kindOfTest('URLSearchParams'); | ||
| const [isReadableStream, isRequest, isResponse, isHeaders] = [ | ||
| "ReadableStream", | ||
| "Request", | ||
| "Response", | ||
| "Headers", | ||
| 'ReadableStream', | ||
| 'Request', | ||
| 'Response', | ||
| 'Headers', | ||
| ].map(kindOfTest); | ||
@@ -278,5 +310,5 @@ | ||
| */ | ||
| const trim = (str) => | ||
| str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); | ||
| const trim = (str) => { | ||
| return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); | ||
| }; | ||
| /** | ||
@@ -300,3 +332,3 @@ * Iterate over an Array or an Object invoking a function for each item. | ||
| // Don't bother if no value provided | ||
| if (obj === null || typeof obj === "undefined") { | ||
| if (obj === null || typeof obj === 'undefined') { | ||
| return; | ||
@@ -309,3 +341,3 @@ } | ||
| // Force an array if not already something iterable | ||
| if (typeof obj !== "object") { | ||
| if (typeof obj !== 'object') { | ||
| /*eslint no-param-reassign:0*/ | ||
@@ -327,5 +359,3 @@ obj = [obj]; | ||
| // Iterate over object keys | ||
| const keys = allOwnKeys | ||
| ? Object.getOwnPropertyNames(obj) | ||
| : Object.keys(obj); | ||
| const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); | ||
| const len = keys.length; | ||
@@ -341,2 +371,10 @@ let key; | ||
| /** | ||
| * Finds a key in an object, case-insensitive, returning the actual key name. | ||
| * Returns null if the object is a Buffer or if no match is found. | ||
| * | ||
| * @param {Object} obj - The object to search. | ||
| * @param {string} key - The key to find (case-insensitive). | ||
| * @returns {?string} The actual key name if found, otherwise null. | ||
| */ | ||
| function findKey(obj, key) { | ||
@@ -362,12 +400,7 @@ if (isBuffer(obj)) { | ||
| /*eslint no-undef:0*/ | ||
| if (typeof globalThis !== "undefined") return globalThis; | ||
| return typeof self !== "undefined" | ||
| ? self | ||
| : typeof window !== "undefined" | ||
| ? window | ||
| : global; | ||
| if (typeof globalThis !== 'undefined') return globalThis; | ||
| return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global; | ||
| })(); | ||
| const isContextDefined = (context) => | ||
| !isUndefined(context) && context !== _global; | ||
| const isContextDefined = (context) => !isUndefined(context) && context !== _global; | ||
@@ -397,3 +430,3 @@ /** | ||
| // Skip dangerous property names to prevent prototype pollution | ||
| if (key === "__proto__" || key === "constructor" || key === "prototype") { | ||
| if (key === '__proto__' || key === 'constructor' || key === 'prototype') { | ||
| return; | ||
@@ -451,3 +484,3 @@ } | ||
| }, | ||
| { allOwnKeys }, | ||
| { allOwnKeys } | ||
| ); | ||
@@ -481,7 +514,4 @@ return a; | ||
| const inherits = (constructor, superConstructor, props, descriptors) => { | ||
| constructor.prototype = Object.create( | ||
| superConstructor.prototype, | ||
| descriptors, | ||
| ); | ||
| Object.defineProperty(constructor.prototype, "constructor", { | ||
| constructor.prototype = Object.create(superConstructor.prototype, descriptors); | ||
| Object.defineProperty(constructor.prototype, 'constructor', { | ||
| value: constructor, | ||
@@ -492,3 +522,3 @@ writable: true, | ||
| }); | ||
| Object.defineProperty(constructor, "super", { | ||
| Object.defineProperty(constructor, 'super', { | ||
| value: superConstructor.prototype, | ||
@@ -523,6 +553,3 @@ }); | ||
| prop = props[i]; | ||
| if ( | ||
| (!propFilter || propFilter(prop, sourceObj, destObj)) && | ||
| !merged[prop] | ||
| ) { | ||
| if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { | ||
| destObj[prop] = sourceObj[prop]; | ||
@@ -533,7 +560,3 @@ merged[prop] = true; | ||
| sourceObj = filter !== false && getPrototypeOf(sourceObj); | ||
| } while ( | ||
| sourceObj && | ||
| (!filter || filter(sourceObj, destObj)) && | ||
| sourceObj !== Object.prototype | ||
| ); | ||
| } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); | ||
@@ -595,3 +618,3 @@ return destObj; | ||
| }; | ||
| })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array)); | ||
| })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); | ||
@@ -639,10 +662,8 @@ /** | ||
| /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ | ||
| const isHTMLForm = kindOfTest("HTMLFormElement"); | ||
| const isHTMLForm = kindOfTest('HTMLFormElement'); | ||
| const toCamelCase = (str) => { | ||
| return str | ||
| .toLowerCase() | ||
| .replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) { | ||
| return p1.toUpperCase() + p2; | ||
| }); | ||
| return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) { | ||
| return p1.toUpperCase() + p2; | ||
| }); | ||
| }; | ||
@@ -664,3 +685,3 @@ | ||
| */ | ||
| const isRegExp = kindOfTest("RegExp"); | ||
| const isRegExp = kindOfTest('RegExp'); | ||
@@ -689,6 +710,3 @@ const reduceDescriptors = (obj, reducer) => { | ||
| // skip restricted props in strict mode | ||
| if ( | ||
| isFunction(obj) && | ||
| ["arguments", "caller", "callee"].indexOf(name) !== -1 | ||
| ) { | ||
| if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { | ||
| return false; | ||
@@ -703,3 +721,3 @@ } | ||
| if ("writable" in descriptor) { | ||
| if ('writable' in descriptor) { | ||
| descriptor.writable = false; | ||
@@ -717,2 +735,10 @@ return; | ||
| /** | ||
| * Converts an array or a delimited string into an object set with values as keys and true as values. | ||
| * Useful for fast membership checks. | ||
| * | ||
| * @param {Array|string} arrayOrString - The array or string to convert. | ||
| * @param {string} delimiter - The delimiter to use if input is a string. | ||
| * @returns {Object} An object with keys from the array or string, values set to true. | ||
| */ | ||
| const toObjectSet = (arrayOrString, delimiter) => { | ||
@@ -727,5 +753,3 @@ const obj = {}; | ||
| isArray(arrayOrString) | ||
| ? define(arrayOrString) | ||
| : define(String(arrayOrString).split(delimiter)); | ||
| isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); | ||
@@ -738,5 +762,3 @@ return obj; | ||
| const toFiniteNumber = (value, defaultValue) => { | ||
| return value != null && Number.isFinite((value = +value)) | ||
| ? value | ||
| : defaultValue; | ||
| return value != null && Number.isFinite((value = +value)) ? value : defaultValue; | ||
| }; | ||
@@ -755,3 +777,3 @@ | ||
| isFunction(thing.append) && | ||
| thing[toStringTag] === "FormData" && | ||
| thing[toStringTag] === 'FormData' && | ||
| thing[iterator] | ||
@@ -761,2 +783,8 @@ ); | ||
| /** | ||
| * Recursively converts an object to a JSON-compatible object, handling circular references and Buffers. | ||
| * | ||
| * @param {Object} obj - The object to convert. | ||
| * @returns {Object} The JSON-compatible object. | ||
| */ | ||
| const toJSONObject = (obj) => { | ||
@@ -776,3 +804,3 @@ const stack = new Array(10); | ||
| if (!("toJSON" in source)) { | ||
| if (!('toJSON' in source)) { | ||
| stack[i] = source; | ||
@@ -798,4 +826,16 @@ const target = isArray(source) ? [] : {}; | ||
| const isAsyncFn = kindOfTest("AsyncFunction"); | ||
| /** | ||
| * Determines if a value is an async function. | ||
| * | ||
| * @param {*} thing - The value to test. | ||
| * @returns {boolean} True if value is an async function, otherwise false. | ||
| */ | ||
| const isAsyncFn = kindOfTest('AsyncFunction'); | ||
| /** | ||
| * Determines if a value is thenable (has then and catch methods). | ||
| * | ||
| * @param {*} thing - The value to test. | ||
| * @returns {boolean} True if value is thenable, otherwise false. | ||
| */ | ||
| const isThenable = (thing) => | ||
@@ -810,2 +850,10 @@ thing && | ||
| /** | ||
| * Provides a cross-platform setImmediate implementation. | ||
| * Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout. | ||
| * | ||
| * @param {boolean} setImmediateSupported - Whether setImmediate is supported. | ||
| * @param {boolean} postMessageSupported - Whether postMessage is supported. | ||
| * @returns {Function} A function to schedule a callback asynchronously. | ||
| */ | ||
| const _setImmediate = ((setImmediateSupported, postMessageSupported) => { | ||
@@ -819,3 +867,3 @@ if (setImmediateSupported) { | ||
| _global.addEventListener( | ||
| "message", | ||
| 'message', | ||
| ({ source, data }) => { | ||
@@ -826,3 +874,3 @@ if (source === _global && data === token) { | ||
| }, | ||
| false, | ||
| false | ||
| ); | ||
@@ -832,12 +880,18 @@ | ||
| callbacks.push(cb); | ||
| _global.postMessage(token, "*"); | ||
| _global.postMessage(token, '*'); | ||
| }; | ||
| })(`axios@${Math.random()}`, []) | ||
| : (cb) => setTimeout(cb); | ||
| })(typeof setImmediate === "function", isFunction(_global.postMessage)); | ||
| })(typeof setImmediate === 'function', isFunction(_global.postMessage)); | ||
| /** | ||
| * Schedules a microtask or asynchronous callback as soon as possible. | ||
| * Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate. | ||
| * | ||
| * @type {Function} | ||
| */ | ||
| const asap = | ||
| typeof queueMicrotask !== "undefined" | ||
| typeof queueMicrotask !== 'undefined' | ||
| ? queueMicrotask.bind(_global) | ||
| : (typeof process !== "undefined" && process.nextTick) || _setImmediate; | ||
| : (typeof process !== 'undefined' && process.nextTick) || _setImmediate; | ||
@@ -867,2 +921,4 @@ // ********************* | ||
| isFile, | ||
| isReactNativeBlob, | ||
| isReactNative, | ||
| isBlob, | ||
@@ -869,0 +925,0 @@ isRegExp, |
+10
-4
| { | ||
| "name": "axios", | ||
| "version": "1.13.5", | ||
| "version": "1.13.6", | ||
| "description": "Promise based HTTP client for the browser and node.js", | ||
| "main": "./dist/node/axios.cjs", | ||
| "main": "./index.js", | ||
| "module": "./index.js", | ||
@@ -66,3 +66,2 @@ "exports": { | ||
| "examples": "node ./examples/server.js", | ||
| "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", | ||
| "fix": "eslint --fix lib/**/*.js", | ||
@@ -100,3 +99,3 @@ "prepare": "husky install && npm run prepare:hooks", | ||
| "@rollup/plugin-alias": "^5.1.1", | ||
| "@rollup/plugin-babel": "^5.3.1", | ||
| "@rollup/plugin-babel": "^6.1.0", | ||
| "@rollup/plugin-commonjs": "^15.1.0", | ||
@@ -136,2 +135,3 @@ "@rollup/plugin-json": "^4.1.0", | ||
| "karma-sourcemap-loader": "^0.4.0", | ||
| "lint-staged": "^15.2.10", | ||
| "memoizee": "^0.4.17", | ||
@@ -142,2 +142,3 @@ "minimist": "^1.2.8", | ||
| "pacote": "^20.0.0", | ||
| "prettier": "^3.8.1", | ||
| "pretty-bytes": "^6.1.1", | ||
@@ -156,2 +157,3 @@ "rollup": "^2.79.2", | ||
| "browser": { | ||
| "./dist/node/axios.cjs": "./dist/browser/axios.cjs", | ||
| "./lib/adapters/http.js": "./lib/helpers/null.js", | ||
@@ -162,2 +164,3 @@ "./lib/platform/node/index.js": "./lib/platform/browser/index.js", | ||
| "react-native": { | ||
| "./dist/node/axios.cjs": "./dist/browser/axios.cjs", | ||
| "./lib/adapters/http.js": "./lib/helpers/null.js", | ||
@@ -209,2 +212,5 @@ "./lib/platform/node/index.js": "./lib/platform/browser/index.js", | ||
| }, | ||
| "lint-staged": { | ||
| "*.{js,cjs,mjs,ts,json,md,yml,yaml}": "prettier --write" | ||
| }, | ||
| "c8": { | ||
@@ -211,0 +217,0 @@ "all": true, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 4 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 4 instances in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 4 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
2423319
3.62%22371
6.22%58
3.57%94
28.77%