const e=require(`./fetch-timeout-BygUD0rd.cjs`),t=Symbol.for(`openclaw.fetch.abort-signal-wrapped`);function n(e,t){let n=e?.body!=null,r=!n&&typeof Request<`u`&&t instanceof Request&&t.body!=null;return!n&&!r||e&&`duplex`in e?e:e?{...e,duplex:`half`}:{duplex:`half`}}function r(r){if(r[t])return r;let i=Object.assign(((t,i)=>{let a=n(i,t),o=a?.signal;if(!o||typeof AbortSignal<`u`&&o instanceof AbortSignal||typeof AbortController>`u`||typeof o.addEventListener!=`function`)return r(t,a);let s=new AbortController,c=e.t(s),l=!1;o.aborted?s.abort():(o.addEventListener(`abort`,c,{once:!0}),l=!0);let u=()=>{if(!(!l||typeof o.removeEventListener!=`function`)){l=!1;try{o.removeEventListener(`abort`,c)}catch{}}};try{return r(t,{...a,signal:s.signal}).finally(u)}catch(e){throw u(),e}}),r),a=r;return i.preconnect=typeof a.preconnect==`function`?a.preconnect.bind(a):()=>{},Object.defineProperty(i,t,{value:!0,enumerable:!1,configurable:!1,writable:!1}),i}function i(e){let t=e??globalThis.fetch;if(t)return r(t)}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
