"use strict";const f=require("./index.cjs233.js"),s=require("./index.cjs238.js"),E=require("./index.cjs227.js"),d=(r,t)=>{const{length:a}=r=r?r.filter(Boolean):[];if(t||a){let u=new AbortController,i;const n=function(e){if(!i){i=!0,b();const o=e instanceof Error?e:this.reason;u.abort(o instanceof s?o:new f(o instanceof Error?o.message:o))}};let c=t&&setTimeout(()=>{c=null,n(new s(`timeout ${t} of ms exceeded`,s.ETIMEDOUT))},t);const b=()=>{r&&(c&&clearTimeout(c),c=null,r.forEach(e=>{e.unsubscribe?e.unsubscribe(n):e.removeEventListener("abort",n)}),r=null)};r.forEach(e=>e.addEventListener("abort",n));const{signal:l}=u;return l.unsubscribe=()=>E.asap(b),l}};module.exports=d;
//# sourceMappingURL=index.cjs385.js.map
