import{n as e}from"./chunk-DR8-3Aex.js";import{E as t,k as n}from"./debug-otxXY3j-.js";import{n as r,t as i}from"./cwd--iizewsn.js";import{n as a,r as o,t as s}from"./execa-CGue6Z3n.js";import{o as c,s as l}from"./log-DSV4Ht5l.js";function u(e,t,r=10*f*d){let o;o=t===void 0?{}:t instanceof AbortSignal?{abortSignal:t,timeout:r}:t;let{abortSignal:s,timeout:c=10*f*d,input:l,stdio:u=[`ignore`,`pipe`,`pipe`]}=o;s?.throwIfAborted(),n`exec: ${e.slice(0,200)}`;try{let t=a(e,{env:process.env,maxBuffer:1e6,timeout:c,cwd:i(),stdio:u,shell:!0,reject:!1,input:l});return t.stdout&&t.stdout.trim()||null}catch{return null}}var d,f,p=e((()=>{o(),r(),t(),d=1e3,f=60}));function m(e,t,n={timeout:10*v*_,preserveOutputOnError:!0,useCwd:!0}){return g(e,t,{abortSignal:n.abortSignal,timeout:n.timeout,preserveOutputOnError:n.preserveOutputOnError,cwd:n.useCwd?i():void 0,env:n.env,stdin:n.stdin,input:n.input})}function h(e,t){return e.shortMessage?e.shortMessage:typeof e.signal==`string`?e.signal:String(t)}function g(e,t,{abortSignal:n,timeout:r=10*v*_,preserveOutputOnError:i=!0,cwd:a,env:o,maxBuffer:c,shell:u,stdin:d,input:f}={timeout:10*v*_,preserveOutputOnError:!0,maxBuffer:1e6}){return new Promise(p=>{s(e,t,{maxBuffer:c,cancelSignal:n,timeout:r,cwd:a,env:o,shell:u,stdin:d,input:f,reject:!1}).then(e=>{if(e.failed)if(i){let t=e.exitCode??1;p({stdout:e.stdout||``,stderr:e.stderr||``,code:t,error:h(e,t)})}else p({stdout:``,stderr:``,code:e.exitCode??1});else p({stdout:e.stdout,stderr:e.stderr,code:0})}).catch(e=>{l(e),p({stdout:``,stderr:``,code:1})})})}var _,v,y=e((()=>{o(),r(),c(),p(),_=1e3,v=60}));export{p as a,u as i,g as n,y as r,m as t};