import{g as w}from"./react-CXoDaX02.js";import{r as d}from"./retry-DnOCoHzM.js";var n={exports:{}},f;function x(){if(f)return n.exports;f=1;const E=d(),l=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class a extends Error{constructor(r){super(),r instanceof Error?(this.originalError=r,{message:r}=r):(this.originalError=new Error(r),this.originalError.stack=this.stack),this.name="AbortError",this.message=r}}const u=(e,r,i)=>{const o=i.retries-(r-1);return e.attemptNumber=r,e.retriesLeft=o,e},h=e=>l.includes(e),c=(e,r)=>new Promise((i,o)=>{r={onFailedAttempt:()=>{},retries:10,...r};const s=E.operation(r);s.attempt(async p=>{try{i(await e(p))}catch(t){if(!(t instanceof Error)){o(new TypeError(`Non-error was thrown: "${t}". You should only throw errors.`));return}if(t instanceof a)s.stop(),o(t.originalError);else if(t instanceof TypeError&&!h(t.message))s.stop(),o(t);else{u(t,p,r);try{await r.onFailedAttempt(t)}catch(y){o(y);return}s.retry(t)||o(s.mainError())}}})});return n.exports=c,n.exports.default=c,n.exports.AbortError=a,n.exports}var R=x();const g=w(R);export{R as a,g as p};
