System.register(["./chunk-legacy-DcCKlgmr.js"],function(e){"use strict";var t;return{setters:[e=>{t=e.i}],execute:function(n,r){const o="axios-retry";function s(e){return!e.response&&!!e.code&&!["ERR_CANCELED","ECONNABORTED"].includes(e.code)&&t(e)}const i=["get","head","options"],u=i.concat(["put","delete"]);function a(e){return"ECONNABORTED"!==e.code&&(!e.response||429===e.response.status||e.response.status>=500&&e.response.status<=599)}function c(e){var t;return!(null===(t=e.config)||void 0===t||!t.method)&&a(e)&&-1!==u.indexOf(e.config.method)}function l(e){return s(e)||c(e)}function d(e=void 0){var t;const n=null==e||null===(t=e.response)||void 0===t?void 0:t.headers["retry-after"];if(!n)return 0;let r=1e3*(Number(n)||0);return 0===r&&(r=(new Date(n).valueOf()||0)-Date.now()),Math.max(0,r)}const f={retries:3,retryCondition:l,retryDelay:function(e=0,t=void 0){return Math.max(0,d(t))},shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function v(e,t,n=!1){const r=function(e,t){return{...f,...t,...e[o]}}(e,t||{});return r.retryCount=r.retryCount||0,r.lastRequestTime&&!n||(r.lastRequestTime=Date.now()),e[o]=r,r}const m=e("a",(e,t)=>{const n=e.interceptors.request.use(e=>{var n;return v(e,t,!0),null!==(n=e[o])&&void 0!==n&&n.validateResponse&&(e.validateStatus=()=>!1),e}),r=e.interceptors.response.use(null,async n=>{var r;const{config:o}=n;if(!o)return Promise.reject(n);const s=v(o,t);return n.response&&null!==(r=s.validateResponse)&&void 0!==r&&r.call(s,n.response)?n.response:await async function(e,t){const{retries:n,retryCondition:r}=e,o=(e.retryCount||0)<n&&r(t);if("object"==typeof o)try{return!1!==await o}catch(e){return!1}return o}(s,n)?async function(e,t,n,r,o){t.retryCount+=1;const{retryDelay:s,shouldResetTimeout:i,onRetry:u}=t,a=s(t.retryCount,n);if(function(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}(e,r),!i&&r.timeout&&t.lastRequestTime){const e=Date.now()-t.lastRequestTime,o=r.timeout-e-a;if(o<=0)return Promise.reject(n);r.timeout=o}return r.transformRequest=[e=>e],await u(t.retryCount,n,r),null!==(o=r.signal)&&void 0!==o&&o.aborted?Promise.resolve(e(r)):new Promise(t=>{var n;const o=()=>{clearTimeout(s),t(e(r))},s=setTimeout(()=>{var n;t(e(r)),(null===(n=r.signal)||void 0===n?void 0:n.removeEventListener)&&r.signal.removeEventListener("abort",o)},a);(null===(n=r.signal)||void 0===n?void 0:n.addEventListener)&&r.signal.addEventListener("abort",o,{once:!0})})}(e,s,n,o):(await async function(e,t){e.retryCount>=e.retries&&await e.onMaxRetryTimesExceeded(t,e.retryCount)}(s,n),Promise.reject(n))});return{requestInterceptorId:n,responseInterceptorId:r}});m.isNetworkError=s,m.isSafeRequestError=function(e){var t;return!(null===(t=e.config)||void 0===t||!t.method)&&a(e)&&-1!==i.indexOf(e.config.method)},m.isIdempotentRequestError=c,m.isNetworkOrIdempotentRequestError=l,m.exponentialDelay=function(e=0,t=void 0,n=100){const r=2**e*n,o=Math.max(r,d(t));return o+.2*o*Math.random()},m.linearDelay=function(e=100){return(t=0,n=void 0)=>{const r=t*e;return Math.max(r,d(n))}},m.isRetryableError=a}}});
