!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).superagent=t()}}((function(){var t={exports:{}};function e(t){if(t)return function(t){for(var r in e.prototype)t[r]=e.prototype[r];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,o=this._callbacks["$"+t];if(!o)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var n=0;nc.depthLimit)return void s("[...]",e,r,a);if(void 0!==c.edgesLimit&&n+1>c.edgesLimit)return void s("[...]",e,r,a);if(i.push(e),Array.isArray(e))for(l=0;le?1:0}function l(t,e,r,u){void 0===u&&(u=a());var l,f=function t(e,r,i,a,u,l,p){var f;if(l+=1,"object"==o(e)&&null!==e){for(f=0;fp.depthLimit)return void s("[...]",e,r,u);if(void 0!==p.edgesLimit&&i+1>p.edgesLimit)return void s("[...]",e,r,u);if(a.push(e),Array.isArray(e))for(f=0;f0)for(var o=0;o1&&"boolean"!=typeof e)throw new _('"allowMissing" argument must be a boolean');var r=function(t){var e=U(t,0,1),r=U(t,-1);if("%"===e&&"%"!==r)throw new S("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new S("invalid intrinsic syntax, expected opening `%`");var o=[];return D(t,M,(function(t,e,r,n){o[o.length]=r?D(n,L,"$1"):e||t})),o}(t),o=r.length>0?r[0]:"",n=q("%"+o+"%",e),i=n.name,a=n.value,u=!1,s=n.alias;s&&(o=s[0],F(r,N([0,1],s)));for(var c=1,l=!0;c=r.length){var h=O(a,p);a=(l=!!h)&&"get"in h&&!("originalValue"in h.get)?h.get:a[p]}else l=v(a,p),a=a[p];l&&!u&&(I[i]=a)}}return a},B=H("%Function.prototype.apply%"),W=H("%Function.prototype.call%"),z=H("%Reflect.apply%",!0)||b.call(W,B),$=H("%Object.getOwnPropertyDescriptor%",!0),G=H("%Object.defineProperty%",!0),J=H("%Math.max%");if(G)try{G({},"a",{value:1})}catch(Or){G=null}j=function(t){var e=z(b,W,arguments);return $&&G&&$(e,"length").configurable&&G(e,"length",{value:1+J(0,t.length-(arguments.length-1))}),e};var X=function(){return z(b,B,arguments)};G?G(j,"apply",{value:X}):j.apply=X;var V=j(H("String.prototype.indexOf")),Q=function(t,e){var r=H(t,!!e);return"function"==typeof r&&V(t,".prototype.")>-1?j(r):r},K={};function Y(t){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Z="function"==typeof Map&&Map.prototype,tt=Object.getOwnPropertyDescriptor&&Z?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,et=Z&&tt&&"function"==typeof tt.get?tt.get:null,rt=Z&&Map.prototype.forEach,ot="function"==typeof Set&&Set.prototype,nt=Object.getOwnPropertyDescriptor&&ot?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,it=ot&&nt&&"function"==typeof nt.get?nt.get:null,at=ot&&Set.prototype.forEach,ut="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,st="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,ct="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,lt=Boolean.prototype.valueOf,pt=Object.prototype.toString,ft=Function.prototype.toString,yt=String.prototype.match,ht=String.prototype.slice,dt=String.prototype.replace,mt=String.prototype.toUpperCase,bt=String.prototype.toLowerCase,vt=RegExp.prototype.test,gt=Array.prototype.concat,St=Array.prototype.join,wt=Array.prototype.slice,_t=Math.floor,At="function"==typeof BigInt?BigInt.prototype.valueOf:null,Ot=Object.getOwnPropertySymbols,jt="function"==typeof Symbol&&"symbol"==Y(Symbol.iterator)?Symbol.prototype.toString:null,Et="function"==typeof Symbol&&"object"==Y(Symbol.iterator),Tt="function"==typeof Symbol&&Symbol.toStringTag&&(Y(Symbol.toStringTag),1)?Symbol.toStringTag:null,Pt=Object.prototype.propertyIsEnumerable,xt=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function kt(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||vt.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var o=t<0?-_t(-t):_t(t);if(o!==t){var n=String(o),i=ht.call(e,n.length+1);return dt.call(n,r,"$&_")+"."+dt.call(dt.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return dt.call(e,r,"$&_")}var Rt=K.custom,It=Ut(Rt)?Rt:null;function Ct(t,e,r){var o="double"===(r.quoteStyle||e)?'"':"'";return o+t+o}function Nt(t){return dt.call(String(t),/"/g,""")}function Ft(t){return!("[object Array]"!==qt(t)||Tt&&"object"==Y(t)&&Tt in t)}function Dt(t){return!("[object RegExp]"!==qt(t)||Tt&&"object"==Y(t)&&Tt in t)}function Ut(t){if(Et)return t&&"object"==Y(t)&&t instanceof Symbol;if("symbol"==Y(t))return!0;if(!t||"object"!=Y(t)||!jt)return!1;try{return jt.call(t),!0}catch(Or){}return!1}var Mt=Object.prototype.hasOwnProperty||function(t){return t in this};function Lt(t,e){return Mt.call(t,e)}function qt(t){return pt.call(t)}function Ht(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,o=t.length;r0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Lt(i,"numericSeparator")&&"boolean"!=typeof i.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=i.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return function t(e,r){if(e.length>r.maxStringLength){var o=e.length-r.maxStringLength,n="... "+o+" more character"+(o>1?"s":"");return t(ht.call(e,0,r.maxStringLength),r)+n}return Ct(dt.call(dt.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Bt),"single",r)}(e,i);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var s=String(e);return u?kt(e,s):s}if("bigint"==typeof e){var c=String(e)+"n";return u?kt(e,c):c}var l=void 0===i.depth?5:i.depth;if(void 0===o&&(o=0),o>=l&&l>0&&"object"==Y(e))return Ft(e)?"[Array]":"[Object]";var p,f=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=St.call(Array(t.indent+1)," ")}return{base:r,prev:St.call(Array(e+1),r)}}(i,o);if(void 0===n)n=[];else if(Ht(n,e)>=0)return"[Circular]";function y(e,r,a){if(r&&(n=wt.call(n)).push(r),a){var u={depth:i.depth};return Lt(i,"quoteStyle")&&(u.quoteStyle=i.quoteStyle),t(e,u,o+1,n)}return t(e,i,o+1,n)}if("function"==typeof e&&!Dt(e)){var h=function(t){if(t.name)return t.name;var e=yt.call(ft.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),d=Jt(e,y);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(d.length>0?" { "+St.call(d,", ")+" }":"")}if(Ut(e)){var m=Et?dt.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):jt.call(e);return"object"!=Y(e)||Et?m:Wt(m)}if((p=e)&&"object"==Y(p)&&("undefined"!=typeof HTMLElement&&p instanceof HTMLElement||"string"==typeof p.nodeName&&"function"==typeof p.getAttribute)){for(var b="<"+bt.call(String(e.nodeName)),v=e.attributes||[],g=0;g"}if(Ft(e)){if(0===e.length)return"[]";var S=Jt(e,y);return f&&!function(t){for(var e=0;e=0)return!1;return!0}(S)?"["+Gt(S,f)+"]":"[ "+St.call(S,", ")+" ]"}if(function(t){return!("[object Error]"!==qt(t)||Tt&&"object"==Y(t)&&Tt in t)}(e)){var w=Jt(e,y);return"cause"in Error.prototype||!("cause"in e)||Pt.call(e,"cause")?0===w.length?"["+String(e)+"]":"{ ["+String(e)+"] "+St.call(w,", ")+" }":"{ ["+String(e)+"] "+St.call(gt.call("[cause]: "+y(e.cause),w),", ")+" }"}if("object"==Y(e)&&a){if(It&&"function"==typeof e[It]&&K)return K(e,{depth:l-o});if("symbol"!==a&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!et||!t||"object"!=Y(t))return!1;try{et.call(t);try{it.call(t)}catch(b){return!0}return t instanceof Map}catch(Or){}return!1}(e)){var _=[];return rt.call(e,(function(t,r){_.push(y(r,e,!0)+" => "+y(t,e))})),$t("Map",et.call(e),_,f)}if(function(t){if(!it||!t||"object"!=Y(t))return!1;try{it.call(t);try{et.call(t)}catch(e){return!0}return t instanceof Set}catch(Or){}return!1}(e)){var A=[];return at.call(e,(function(t){A.push(y(t,e))})),$t("Set",it.call(e),A,f)}if(function(t){if(!ut||!t||"object"!=Y(t))return!1;try{ut.call(t,ut);try{st.call(t,st)}catch(b){return!0}return t instanceof WeakMap}catch(Or){}return!1}(e))return zt("WeakMap");if(function(t){if(!st||!t||"object"!=Y(t))return!1;try{st.call(t,st);try{ut.call(t,ut)}catch(b){return!0}return t instanceof WeakSet}catch(Or){}return!1}(e))return zt("WeakSet");if(function(t){if(!ct||!t||"object"!=Y(t))return!1;try{return ct.call(t),!0}catch(Or){}return!1}(e))return zt("WeakRef");if(function(t){return!("[object Number]"!==qt(t)||Tt&&"object"==Y(t)&&Tt in t)}(e))return Wt(y(Number(e)));if(function(t){if(!t||"object"!=Y(t)||!At)return!1;try{return At.call(t),!0}catch(Or){}return!1}(e))return Wt(y(At.call(e)));if(function(t){return!("[object Boolean]"!==qt(t)||Tt&&"object"==Y(t)&&Tt in t)}(e))return Wt(lt.call(e));if(function(t){return!("[object String]"!==qt(t)||Tt&&"object"==Y(t)&&Tt in t)}(e))return Wt(y(String(e)));if(!function(t){return!("[object Date]"!==qt(t)||Tt&&"object"==Y(t)&&Tt in t)}(e)&&!Dt(e)){var O=Jt(e,y),j=xt?xt(e)===Object.prototype:e instanceof Object||e.constructor===Object,E=e instanceof Object?"":"null prototype",T=!j&&Tt&&Object(e)===e&&Tt in e?ht.call(qt(e),8,-1):E?"Object":"",P=(j||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(T||E?"["+St.call(gt.call([],T||[],E||[]),": ")+"] ":"");return 0===O.length?P+"{}":f?P+"{"+Gt(O,f)+"}":P+"{ "+St.call(O,", ")+" }"}return String(e)}(t))},get:function(o){if(Qt&&o&&("object"==Xt(o)||"function"==typeof o)){if(t)return Yt(t,o)}else if(Kt){if(e)return ee(e,o)}else if(r)return function(t,e){var r=ne(t,e);return r&&r.value}(r,o)},has:function(o){if(Qt&&o&&("object"==Xt(o)||"function"==typeof o)){if(t)return te(t,o)}else if(Kt){if(e)return oe(e,o)}else if(r)return function(t,e){return!!ne(t,e)}(r,o);return!1},set:function(o,n){Qt&&o&&("object"==Xt(o)||"function"==typeof o)?(t||(t=new Qt),Zt(t,o,n)):Kt?(e||(e=new Kt),re(e,o,n)):(r||(r={key:{},next:null}),function(t,e,r){var o=ne(t,e);o?o.value=r:t.next={key:e,next:t.next,value:r}}(r,o,n))}};return o},ae=String.prototype.replace,ue=/%20/g,se={default:"RFC3986",formatters:{RFC1738:function(t){return ae.call(t,ue,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:"RFC3986"};function ce(t){return(ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var le=Object.prototype.hasOwnProperty,pe=Array.isArray,fe=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),ye={combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],o=0;o1;){var e=t.pop(),r=e.obj[e.prop];if(pe(r)){for(var o=[],n=0;n=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||n===se.RFC1738&&(40===s||41===s)?a+=i.charAt(u):s<128?a+=fe[s]:s<2048?a+=fe[192|s>>6]+fe[128|63&s]:s<55296||s>=57344?a+=fe[224|s>>12]+fe[128|s>>6&63]+fe[128|63&s]:(u+=1,s=65536+((1023&s)<<10|1023&i.charCodeAt(u)),a+=fe[240|s>>18]+fe[128|s>>12&63]+fe[128|s>>6&63]+fe[128|63&s])}return a},isBuffer:function(t){return!(!t||"object"!=ce(t)||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(pe(t)){for(var r=[],o=0;o0?b.join(",")||null:void 0}];else if(be(u))E=u;else{var P=Object.keys(b);E=s?P.sort(s):P}for(var x=0;x0?f+p:""}}),Te={};function Pe(t){return(Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function xe(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return ke(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ke(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var o=0,n=function(){};return{s:n,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n}}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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function ke(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r1)for(var r=1;r=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(o){console.error(o)}if(e&&e.status&&a.has(e.status))return!0;if(t){if(t.code&&i.has(t.code))return!0;if(t.timeout&&"ECONNABORTED"===t.code)return!0;if(t.crossDomain)return!0}return!1},n.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},n.prototype.then=function(t,e){var r=this;if(!this._fullfilledPromise){var o=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(t,e){o.on("abort",(function(){if(!(r._maxRetries&&r._maxRetries>r._retries))if(r.timedout&&r.timedoutError)e(r.timedoutError);else{var t=new Error("Aborted");t.code="ABORTED",t.status=r.status,t.method=r.method,t.url=r.url,e(t)}})),o.end((function(r,o){r?e(r):t(o)}))}))}return this._fullfilledPromise.then(t,e)},n.prototype.catch=function(t){return this.then(void 0,t)},n.prototype.use=function(t){return t(this),this},n.prototype.ok=function(t){if("function"!=typeof t)throw new Error("Callback required");return this._okCallback=t,this},n.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},n.prototype.get=function(t){return this._header[t.toLowerCase()]},n.prototype.getHeader=n.prototype.get,n.prototype.set=function(t,e){if(r(t)){for(var n in t)o(t,n)&&this.set(n,t[n]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},n.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},n.prototype.field=function(t,e,n){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(r(t)){for(var i in t)o(t,i)&&this.field(i,t[i]);return this}if(Array.isArray(e)){for(var a in e)o(e,a)&&this.field(t,e[a]);return this}if(null==e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=String(e)),n?this._getFormData().append(t,e,n):this._getFormData().append(t,e),this},n.prototype.abort=function(){if(this._aborted)return this;if(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req){if(K.gte(t.version,"v13.0.0")&&K.lt(t.version,"v14.0.0"))throw new Error("Superagent does not work in v13 properly with abort() due to Node.js core changes");K.gte(t.version,"v14.0.0")&&(this.req.destroyed=!0),this.req.abort()}return this.clearTimeout(),this.emit("abort"),this},n.prototype._auth=function(t,e,r,o){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(o("".concat(t,":").concat(e))));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer ".concat(t))}return this},n.prototype.withCredentials=function(t){return void 0===t&&(t=!0),this._withCredentials=t,this},n.prototype.redirects=function(t){return this._maxRedirects=t,this},n.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw new TypeError("Invalid argument");return this._maxResponseSize=t,this},n.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},n.prototype.send=function(t){var e=r(t),n=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(e&&r(this._data))for(var i in t)o(t,i)&&(this._data[i]=t[i]);else"string"==typeof t?(n||this.type("form"),(n=this._header["content-type"])&&(n=n.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===n?this._data?"".concat(this._data,"&").concat(t):t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)||n||this.type("json"),this},n.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},n.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.includes("?")?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var r=this.url.slice(e+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.slice(0,e)+"?"+r.join("&")}}},n.prototype._appendQueryString=function(){console.warn("Unsupported")},n.prototype._timeoutError=function(t,e,r){if(!this._aborted){var o=new Error("".concat(t+e,"ms exceeded"));o.timeout=e,o.code="ECONNABORTED",o.errno=r,this.timedout=!0,this.timedoutError=o,this.abort(),this.callback(o)}},n.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}}).call(this)}).call(this,Re);var Je;function Xe(){}Je=Xe,Xe.prototype.get=function(t){return this.header[t.toLowerCase()]},Xe.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=Te.type(e);var r=Te.params(e);for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(this[o]=r[o]);this.links={};try{t.link&&(this.links=Te.parseLinks(t.link))}catch(n){}},Xe.prototype._setStatusProperties=function(t){var e=Math.trunc(t/100);this.statusCode=t,this.status=this.statusCode,this.statusType=e,this.info=1===e,this.ok=2===e,this.redirect=3===e,this.clientError=4===e,this.serverError=5===e,this.error=(4===e||5===e)&&this.toError(),this.created=201===t,this.accepted=202===t,this.noContent=204===t,this.badRequest=400===t,this.unauthorized=401===t,this.notAcceptable=406===t,this.forbidden=403===t,this.notFound=404===t,this.unprocessableEntity=422===t};var Ve={};function Qe(t){return function(t){if(Array.isArray(t))return Ye(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ke(t)||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 Ke(t,e){if(t){if("string"==typeof t)return Ye(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ye(t,e):void 0}}function Ye(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n}}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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(this._defaults);try{for(r.s();!(e=r.n()).done;){var o=e.value;t[o.fn].apply(t,Qe(o.args))}}catch(n){r.e(n)}finally{r.f()}},Ve=Ze;var or,nr={};function ir(t){return(ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ar(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return ur(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ur(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var o=0,n=function(){};return{s:n,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n}}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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function ur(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r0||t instanceof Object)?e(t):null)},vr.prototype.toError=function(){var t=this.req,e=t.method,r=t.url,o="cannot ".concat(e," ").concat(r," (").concat(this.status,")"),n=new Error(o);return n.status=this.status,n.method=e,n.url=r,n},fr.Response=vr,t(gr.prototype),cr(gr.prototype,Ge.prototype),gr.prototype.type=function(t){return this.set("Content-Type",fr.types[t]||t),this},gr.prototype.accept=function(t){return this.set("Accept",fr.types[t]||t),this},gr.prototype.auth=function(t,e,r){1===arguments.length&&(e=""),"object"==ir(e)&&null!==e&&(r=e,e=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});var o=r.encoder?r.encoder:function(t){if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(t,e,r,o)},gr.prototype.query=function(t){return"string"!=typeof t&&(t=hr(t)),t&&this._query.push(t),this},gr.prototype.attach=function(t,e,r){if(e){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,r||e.name)}return this},gr.prototype._getFormData=function(){return this._formData||(this._formData=new or.FormData),this._formData},gr.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();var r=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),r(t,e)},gr.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},gr.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},gr.prototype.ca=gr.prototype.agent,gr.prototype.buffer=gr.prototype.ca,gr.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},gr.prototype.pipe=gr.prototype.write,gr.prototype._isHost=function(t){return t&&"object"==ir(t)&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},gr.prototype.end=function(t){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||pr,this._finalizeQueryString(),this._end()},gr.prototype._setUploadTimeout=function(){var t=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){t._timeoutError("Upload timeout of ",t._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},gr.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var t=this;this.xhr=fr.getXHR();var e=this.xhr,r=this._formData||this._data;this._setTimeouts(),e.addEventListener("readystatechange",(function(){var r=e.readyState;if(r>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4===r){var o;try{o=e.status}catch(n){o=0}if(!o){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}}));var o=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(t._uploadTimeoutTimer)),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.addEventListener("progress",o.bind(null,"download")),e.upload&&e.upload.addEventListener("progress",o.bind(null,"upload"))}catch(u){}e.upload&&this._setUploadTimeout();try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(s){return this.callback(s)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){var n=this._header["content-type"],i=this._serializer||fr.serialize[n?n.split(";")[0]:""];!i&&br(n)&&(i=fr.serialize["application/json"]),i&&(r=i(r))}for(var a in this.header)null!==this.header[a]&&lr(this.header,a)&&e.setRequestHeader(a,this.header[a]);this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0===r?null:r)},fr.agent=function(){return new Ve};for(var Sr=function(){var t=_r[wr];Ve.prototype[t.toLowerCase()]=function(e,r){var o=new fr.Request(t,e);return this._setDefaults(o),r&&o.end(r),o}},wr=0,_r=["GET","POST","OPTIONS","PATCH","PUT","DELETE"];wr<_r.length;wr++)Sr();function Ar(t,e,r){var o=fr("DELETE",t);return"function"==typeof e&&(r=e,e=null),e&&o.send(e),r&&o.end(r),o}return Ve.prototype.del=Ve.prototype.delete,fr.get=function(t,e,r){var o=fr("GET",t);return"function"==typeof e&&(r=e,e=null),e&&o.query(e),r&&o.end(r),o},fr.head=function(t,e,r){var o=fr("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&o.query(e),r&&o.end(r),o},fr.options=function(t,e,r){var o=fr("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&o.send(e),r&&o.end(r),o},fr.del=Ar,fr.delete=Ar,fr.patch=function(t,e,r){var o=fr("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&o.send(e),r&&o.end(r),o},fr.post=function(t,e,r){var o=fr("POST",t);return"function"==typeof e&&(r=e,e=null),e&&o.send(e),r&&o.end(r),o},fr.put=function(t,e,r){var o=fr("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&o.send(e),r&&o.end(r),o},nr}));