`)},O=function($){return i(void 0,void 0,void 0,function(){var C,G;return l(this,function(Y){switch(Y.label){case 0:if(!$.alwaysRun&&(!process.stdout.isTTY||E&&!$.shouldNotifyInNpmScript))return $.debug&&console.error("Opting out of running simpleUpdateNotifier()"),[2];Y.label=1;case 1:return Y.trys.push([1,3,,4]),[4,b($)];case 2:return C=Y.sent(),C&&console.error(g("New version of ".concat($.pkg.name,`available!
${t}`,Jy=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Qy=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Zy=(e,t,r)=>{const n=r===""?"":`with${r.trim()}()`,o=Yy.bind(null,n,t.toString());Object.defineProperty(o,"name",Qy),Object.defineProperty(e,"toString",{...Jy,value:o})};function ew(e,t,{ignoreNonConfigurable:r=!1}={}){const{name:n}=e;for(const o of Reflect.ownKeys(t))Wy(e,t,o,r);return Ky(e,t),Zy(e,t,n),e}const mn=new WeakMap,Rp=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,n=0;const o=e.displayName||e.name||"<anonymous>",s=function(...i){if(mn.set(s,++n),n===1)r=e.apply(this,i),e=null;else if(t.throw===!0)throw new Error(`Function\`${o}\` can only be called once`);returnr};returnew(s,e),mn.set(s,n),s};Rp.callCount=e=>{if(!mn.has(e))thrownewError(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);returnmn.get(e)};consttw=()=>{conste=$p-Op+1;returnArray.from({length:e},rw)},rw=(e,t)=>({name:`SIGRT${t+1}`,number:Op+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Op=34,$p=64,nw=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standar
`);return h?(n.originalMessage=n.message,n.message=w):n=new Error(w),n.shortMessage=y,n.command=i,n.escapedCommand=l,n.exitCode=s,n.signal=o,n.signalDescription=v,n.stdout=e,n.stderr=t,n.cwd=p,r!==void 0&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!u,n.isCanceled=a,n.killed=c&&!u,n},nn=["stdin","stdout","stderr"],dw=e=>nn.some(t=>e[t]!==void 0),pw=e=>{if(!e)return;const{stdio:t}=e;if(t===void 0)return nn.map(n=>e[n]);if(dw(e))throw new Error(`It'snotpossibletoprovide\`stdio\` in combination with one of ${nn.map(n=>`\`${n}\``).join(", ")}`);if(typeoft=="string")returnt;if(!Array.isArray(t))thrownewTypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeoft}\``);constr=Math.max(t.length,nn.length);returnArray.from({length:r},(n,o)=>t[o])};varzt={exports:{}},Hi={exports:{}},xu;functionhw(){returnxu||(xu=1,function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}(Hi)),Hi.exports}varCu;functionmw(){if(Cu)returnzt.exports;Cu=1;vare=et.process;constt=function(f){returnf&&typeoff=="object"&&typeoff.removeListener=="function"&&typeoff.emit=="function"&&typeoff.reallyExit=="function"&&typeoff.listeners=="function"&&typeoff.kill=="function"&&typeoff.pid=="number"&&typeoff.on=="function"};if(!t(e))zt.exports=function(){returnfunction(){}};else{varr=kr,n=hw(),o=/^win/i.test(e.platform),s=On;typeofs!="function"&&(s=s.EventEmitter);vari;e.__signal_exit_emitter__?i=e.__signal_exit_emitter__:(i=e.__signal_exit_emitter__=news,i.count=0,i.emitted={}),i.infinite||(i.setMaxListeners(1/0),i.infinite=!0),zt.exports=function(f,h){if(!t(et.process))returnfunction(){};r.equal(typeoff,"function","a callback must be provided for exit handler"),c===!1&&m();vary="exit";h&&h.alwaysLast&&(y="afterexit");varw=function(){i.removeListener(y,f),i.listeners("exit").length===0&&i.listeners("afterexit").length===0&&l()};returni.on(y,f),w};varl=function(){!c||!t(et.process)||(c=!1,n.forEach(function(h){try{e.removeListener(h,a[h])}catch{}}),e.emit=E,e.reallyExit=p,i.count-=1)};zt.exports.unload=l;varu=function(h,y,w){i.emitted[h]||(i.emitted[h]=!0,i.emit(h,y,w))},a={};n.forEach(function(f){a[f]=function(){if(t(et.process)){vary=e.listeners(f);y.length===i.count&&(l(),u("exit",null,f),u("afterexit",null,f),o&&f==="SIGHUP"&&(f="SIGINT"),e.kill(e.pid,f))}}}),zt.exports.signals=function(){returnn};varc=!1,m=function(){c||!t(et.process)||(c=!0,i.count+=1,n=n.filter(function(h){try{returne.on(h,a[h]),!0}catch{return!1}}),e.emit=d,e.reallyExit=v)};zt.exports.load=m;varp=e.reallyExit,v=function(h){t(et.process)&&(e.exitCode=h||0,u("exit",e.exitCode,null),u("afterexit",e.exitCode,null),p.call(e,e.exitCode))},E=e.emit,d=function(h,y){if(h==="exit"&&t(et.process)){y!==void0&&(e.exitCode=y);varw=E.apply(this,arguments);returnu("exit",e.exitCode,null),u("afterexit",e.exitCode,null),w}elsereturnE.apply(this,arguments)}}returnzt.exports}varyw=mw();constww=Oe(yw),vw=1e3*5,gw=(e,t="SIGTERM",r={})=>{constn=e(t);return_w(e,t,r,n),n},_w=(e,t,r,n)=>{if(!Ew(t,r,n))return;consto=bw(r),s=setTimeout(()=>{e("SIGKILL")},o);s.unref&&s.unref()},Ew=(e,{forceKillAfterTimeout:t},r)=>Sw(e)&&t!==!1&&r,Sw=e=>e===le.constants.signals.SIGTERM||typeofe=="string"&&e.toUpperCase()==="SIGTERM",bw=({forceKillAfterTimeout:e=!0})=>{if(e===!0)returnvw;if(!Number.isFinite(e)||e<0)thrownewTypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeofe})`);returne},Rw=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Ow=(e,t,r)=>{e.kill(t),r(Object.assign(newError("Timed out"),{timedOut:!0,signal:t}))},$w=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(t===0||t===void0)returnn;leto;consts=newPromise((l,u)=>{o=setTimeout(()=>{Ow(e,r,u)},t)}),i=n.finally(()=>{clearTimeout(o)});returnPromise.race([s,i])},Iw=({timeout:e})=>
`),W(`"${e}"wasaddedto"${t.rcPath}"`);return}default:return}}const d_=[/\/usr\/bin\/?/,/\/usr\/local\/bin\/?/];function p_(e){var t,r;return d_.some(n=>n.test(e))?((r=(t=process.env.PATH)==null?void 0:t.split(T.delimiter))!=null?r:[]).includes(e):!1}function Va(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var sn={exports:{}},h_=sn.exports,Lf;function Zp(){return Lf||(Lf=1,function(e){(function(){var t={},r={create:n,addLocale:o,pluralize:s};e.exports=r;function n(a){return l(a),{pluralize:function(c,m){return s(a,c,m)}}}function o(a,c){t[a]=c}function s(a,c,m){if(l(a),typeof m!="object")throw new Error("List of variants should be specified as an object");var p=t[a](c);return typeof m[p]<"u"?m[p]:null}function i(a){return typeof t[a]<"u"}function l(a){i(a)||u(a)}function u(a){try{Va(__dirname+"/../locales/"+a+".js")}catch{throw Error("Failed to load the following locale: "+a)}}}).call(h_)}(sn)),sn.exports}var Rs,Df;function eh(){return Df||(Df=1,Rs=Zp()),Rs}var m_=eh();const y_=Oe(m_);var Os={},kf;function w_(){return kf||(kf=1,function(){var e=this,t;typeof Va=="function"?t=Zp():t=e.numerous,t.addLocale("en",function(n){var o=Math.floor(Math.abs(n)),s=n.toString().replace(/^[^.]*\.?/,"").length;return typeof n=="string"&&(n=parseInt(n,10)),o===1&&s===0?"one":"other"})}.call(Os)),Os}var v_=w_();const g_=Oe(v_);var $s={exports:{}},qf;function __(){return qf||(qf=1,function(e,t){e.exports=!!(typeof process<"u"&&process.versions&&process.versions.node)}($s)),$s.exports}var Is,Ff;function E_(){if(Ff)return Is;Ff=1;const e=eh(),t=__(),r=[["years",12*4*7*24*60*60*1e3],["months",4*7*24*60*60*1e3],["weeks",7*24*60*60*1e3],["days",24*60*60*1e3],["hours",60*60*1e3],["minutes",60*1e3],["seconds",1e3]],n={locale:"en",span:2,delimiter:", ",unitType:"long",unitTypeLookupOrder:["long","short","narrow"],autoloadLocales:!0},o={};Is={create:i,addLocale:s,defaultConfig:n};function s(d){Array.isArray(d)||(d=[d]);for(const f of d){const{id:h,data:y}=f;o[h]=y}}function i(d){return d=Object.assign({},n,d||{}),{format:function(f,h,y){return y=Object.assign({},d,y||{}),l(f,h,y)}}}function l(d,f,h){if(u(h.locale,{autoload:h.autoloadLocales}),!d)throw new Error("Missing first date argument");if(!f)throw new Error("Missing second date argument");const y=m(d,f),w=[];for(const S of y){const[_,b]=S;if(b>0&&w.push(p(_,b,h)),w.length>=h.span)break}return w.join(h.delimiter)}function u(d,f){const{autoload:h}=f;if(!a(d))if(t&&h)c(d);else throw new Error(`Missinglocale:${d},youmustloaditmanuallybeforeusingit`)}function a(d){return!!o[d]}function c(d){try{s(Va(`../locales/${d}.js`))}catch(f){throw Error(`Failedtoloadlocale:${d}from../locales/${d}.js.Ifusingabundledtime-delta,set'autoloadLocales: false'intheconfig:${f}`)}}function m(d,f){let h=f-d;const y=[];return r.some(function(w){const S=w[0],_=w[1],b=Math.floor(h/_);if(h-=b*_,y.push([S,b]),h<=0)return!0}),y}function p(d,f,h){const y=v(h);return e.pluralize(h.locale,f,y[d]).replace("{0}",f)}function v(d){const f=o[d.locale];let h=d.unitTypeLookupOrder.slice();h.unshift(d.unitType),h=E(h);let y=null;if(h.some(function(w){if(typeof f[w]<"u")return y=f[w],!0}),y===null)throw new Error("Can not find any unit type data for locale: "+d.locale);return y}function E(d){return Array.from(new Set(d))}return Is}var Ps,jf;function S_(){return jf||(jf=1,Ps=E_()),Ps}var b_=S_();const Uf=Oe(b_);var Ts,Mf;function R_(){return Mf||(Mf=1,Ts={id:"en",data:{long:{years:{one:"{0} year",other:"{0} years"},months:{one:"{0} month",other:"{0} months"},weeks:{one:"{0} week",other:"{0} weeks"},days:{one:"{0} day",other:"{0} days"},hours:{one:"{0} hour",other:"{0} hours"},minutes:{one:"{0} minute",other:"{0} minutes"},seconds:{one:"{0} second",other:"{0} seconds"}},narrow:{years:{one:"{0}y",other:"{0}y"},months:{one:"{0}m",other:"{0}m"},weeks:{one:"{0}w",other:"{0}w"},days:{one:"{0}d",other:"{0}d"},hours:{one:"{0}h",other:"{0}h"},minutes:
`),await vn.clear(),await vn(),W(`Successfullyaddedrepository:${e}`),!0}catch(t){throw new Error(`Failedtoaddrepository${e}:${t}`)}}async function ph(){const e=(await G_()).split(".").slice(0,2).join(".");return M_(`https://dl-cdn.alpinelinux.org/alpine/v${e}/community/`)}async function G_(){const e="/etc/alpine-release";if(!await we(e))throw new Error(`Alpine release file not found at ${e}`);return Qt(e,"utf8")}async function V_(e){try{const{exitCode:t}=await vt("apk",["info","-e",e.name],{reject:!1,stdio:["ignore","pipe","ignore"]});if(t!==0)return!1;if(e.version===void 0||e.version==="")return!0;const{stdout:r}=await vt("apk",["info","-v",e.name],{stdio:["ignore","pipe","ignore"]});return r.trim().split("-").slice(-1)[0]===e.version}catch{return!1}}async function hh(e){return(await Promise.all(e.map(async r=>await V_(r)?void 0:r))).filter(r=>r!==void 0).map(mh)}function mh(e){return e.version!==void 0&&e.version!==""?`${e.name}=${e.version}`:e.name}async function B_(){const e=await hh([{name:"bash"}]);e.length!==0&&me("apk",["add",...e],{...it})}const z_=Fe(B_,{promise:!0});async function ke(e,t=!1){if(!await Ie())throw new Error("apk is not available on this system");try{await z_(),t&&await vn.clear(),await vn();const r=await hh(e);return r.length===0?(W("All packages are already installed"),{binDir:"/usr/bin"}):(W(`Installing ${r.join(" ")}`),await vt("apk",["add",...r]),W(`Successfully installed ${r.join(" ")}`),{binDir:"/usr/bin"})}catch(r){throw ve(`Failed to install ${e.map(n=>mh(n)).join(" ")}: ${r}`),r}}const{GITHUB_ACTIONS:H_}=Et,{appendFile:W_}=ae.promises;async function X_(e,t,r=40){await vt("update-alternatives",["--install",`/usr/bin/${e}`,e,t,r.toString()])}async function wt(e,t,r,n=40){H_?await X_(e,t,n):(await Ga(r),await W_(r.rcPath,`
`))}var Cs={},Bf;function K_(){return Bf||(Bf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DownloaderHelper=e.DH_STATES=void 0;var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},r=function(){function y(w,S){for(var _,b=0;b<S.length;b++)_=S[b],_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(w,_.key,_)}return function(w,S,_){return S&&y(w.prototype,S),_&&y(w,_),w}}(),n=ae,o=v(n),s=lt,i=T,l=v(i),u=ba,a=v(u),c=Rn,m=v(c),p=On;function v(y){if(y&&y.__esModule)return y;var w={};if(y!=null)for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(w[S]=y[S]);return w.default=y,w}function E(y,w){if(!(y instanceof w))throw new TypeError("Cannot call a class as a function")}function d(y,w){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:y}function f(y,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);y.prototype=Object.create(w&&w.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(y,w):y.__proto__=w)}var h=e.DH_STATES={IDLE:"IDLE",SKIPPED:"SKIPPED",STARTED:"STARTED",DOWNLOADING:"DOWNLOADING",RETRY:"RETRY",PAUSED:"PAUSED",RESUMED:"RESUMED",STOPPED:"STOPPED",FINISHED:"FINISHED",FAILED:"FAILED"};e.DownloaderHelper=function(y){function w(S,_){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};E(this,w);var g=d(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,{captureRejections:!0}));return g.__validate(S,_)?(g.url=g.requestURL=S.trim(),g.state=h.IDLE,g.__defaultOpts={body:null,retry:!1,method:"GET",headers:{},fileName:"",timeout:-1,metadata:null,override:!1,forceResume:!1,removeOnStop:!0,removeOnFail:!0,progressThrottle:1e3,httpRequestOptions:{},httpsRequestOptions:{},resumeOnIncomplete:!0,resumeIfFileExists:!1,resumeOnIncompleteMaxRetry:5},g.__opts=Object.assign({},g.__defaultOpts),g.__pipes=[],g.__total=0,g.__downloaded=0,g.__progress=0,g.__retryCount=0,g.__retryTimeout=null,g.__resumeRetryCount=0,g.__states=h,g.__promise=null,g.__request=null,g.__response=null,g.__isAborted=!1,g.__isResumed=!1,g.__isResumable=!1,g.__isRedirected=!1,g.__destFolder=_,g.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0},g.__fileName="",g.__filePath="",g.updateOptions(b),g):d(g)}return f(w,y),r(w,[{key:"start",value:function(){var _=this,b=function(){return new Promise(function(g,O){_.__promise={resolve:g,reject:O},_.__start()})};return this.__opts.resumeIfFileExists&&this.state!==this.__states.RESUMED?this.getTotalSize().then(function(g){var O=g.name,$=g.total,C=_.__opts.override;if(_.__opts.override=!0,_.__filePath=_.__getFilePath(O),_.__opts.override=C,_.__filePath&&o.existsSync(_.__filePath)){var G=_.__getFilesizeInBytes(_.__filePath);return G===$?b():_.resumeFromFile(_.__filePath,{total:$,fileName:O})}return b()}):b()}},{key:"pause",value:function(){var _=this;return this.state===this.__states.STOPPED?Promise.resolve(!0):(this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(b){return b.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return _.__setState(_.__states.PAUSED),_.emit("pause"),!0}))}},{key:"resume",value:function(){return this.__promise?this.state===this.__states.STOPPED?Promise.resolve(!1):(this.__setState(this.__states.RESUMED),this.__isResumable&&(this.__isResumed=!0,this.__reqOptions.headers.range="bytes="+this.__downloaded+"-"),this.emit("resume",this.__isResumed),this.__start()):this.start()}},{key:"stop",value:function(){var _=this;if(this.state===this.__states.STOPPED)return Promise.resolve(!0);var b=function(){return new Promise(function(g,O){o.access(_.__filePath,function($){return $?(_.__emitStop(),g(!0)):void o.unlink(_.
`).some(n=>n.startsWith("Status: install ok installed"))}catch{return!1}}async function eE(e){try{const{stdout:t}=await fe("dpkg",["-l",e],{env:ut("apt-get"),stdio:"pipe"});return typeof t!="string"?!1:t.split(`
`).some(n=>n.startsWith("ii"))}catch{return!1}}let _h=!1;function tE(e=Ur()){me(e,["update","-o",Er],{...it,env:ut(e)}),_h=!0}const lr=Fe(tE);var Pt;(function(e){e[e.NameDashVersion=0]="NameDashVersion",e[e.NameEqualsVersion=1]="NameEqualsVersion",e[e.Name=2]="Name",e[e.None=3]="None"})(Pt||(Pt={}));async function Eh(e,t=Ur()){return(await Promise.all(e.map(r=>ga(r,t)))).filter(r=>r!==void 0)}async function ga(e,t=Ur()){const r=await nE(t,e);return await Ba(r)?void 0:r}async function Sh(e,t,r,n){const o=r!==void 0&&r!=="",s=!o||n;if(o){if(await rE(e,t,r))return Pt.NameDashVersion;if(await Hf(e,`${t}=${r}`))return Pt.NameEqualsVersion}const i=()=>{o&&n&&W(`Couldnotfindpackage${t}${r}.Fallingbacktolatestversion.`)};return s&&await Hf(e,t)?(i(),Pt.Name):_h?s?(i(),Pt.Name):Pt.None:(lr(e),Sh(e,t,r,n))}async function rE(e,t,r){try{const{stdout:n}=await fe("apt-cache",["search","--names-only",`^${wn(t)}-${wn(r)}$`],{env:ut(e),stdio:"pipe"});if(n.trim()!=="")return!0}catch{}return!1}async function Hf(e,t){try{const{stdout:r}=await fe("apt-cache",["show",t],{env:ut(e),stdio:"pipe",verbose:!0});if(r.trim()!=="")return!0}catch{}return!1}async function nE(e,t){const{name:r,version:n,fallBackToLatest:o=!1}=t;switch(await Sh(e,r,n,o)){case Pt.NameDashVersion:return`${r}-${n}`;case Pt.NameEqualsVersion:return`${r}=${n}`;case Pt.Name:return r;default:throw new Error(`Couldnotfindpackage'${r}'${n!=null?n:"with unspecified version"}`)}}async function iE(e){lr(e);const t=await Eh([{name:"ca-certificates"},{name:"gnupg"},{name:"apt-utils"}],e);t.length!==0&&me(e,["install","-y","--fix-broken","-o",Er,...t],{...it,env:ut(e)})}const bh=Fe(iE,{promise:!0});function oE(e="apt-get"){try{const{stdout:t}=me("add-apt-repository",["--help"],{...it,env:ut(e),stdio:"pipe"});return t.includes("--no-update")}catch{return!1}}const Rh=Fe(oE);async function sE(e,t=Ur()){await bh(t),await Oh();try{me("add-apt-repository",["-y",Rh(t)?"--no-update":void 0,e].filter(r=>r!==void 0),{...it,env:ut(t)})}catch{me("add-apt-repository",["-y",e],{...it,env:ut(t)})}lr.clear(),lr(t)}async function Oh(){if(await Ba("software-properties-common"))return;const e="apt-get";me(e,["install","-y","--fix-broken","-o",Er,"software-properties-common"],{...it,env:ut(e)})}const aE=["E: Could not get lock","dpkg: error processing archive","dpkg: error: dpkg status database is locked by another process"];async function pe(e,t=!1){try{const r=Ur();for(const{name:o,version:s}of e)W(`Installing${o}${s!=null?s:""}via${r}`);t&&lr.clear(),lr(r),await cE(r,e);const n=await Eh(e,r);if(n.length===0)return W("All packages are already installed"),{binDir:"/usr/bin/"};await bh(r);try{await uE(e),me(r,["install","--fix-broken","-y",...n],{...it,env:ut(r)})}catch(o){if(lE(o))aE.some(s=>typeof o.stderr=="string"&&o.stderr.includes(s))&&(ve(`Failedtoinstallpackages${n}.Retrying...`),me(r,["install","--fix-broken","-y","-o",Er,...n],{...it,env:ut(r)}));else throw o}return{binDir:"/usr/bin/"}}catch(r){const n=r instanceof Error?`${r.message}
${r.stack}`:String(r);throw new Error(`Failedtoinstallaptpackages:${n}`)}}async function cE(e,t){const r=[...new Set(t.flatMap(n=>{var o;return(o=n.repository)!=null?o:[]}))];await Promise.all(r.map(n=>sE(n,e)))}async function uE(e){await Promise.all(e.map(async t=>{t.key!==void 0&&await J_(t.key)}))}function lE(e){return typeof e.stderr=="string"}let ar;async function Wf(){if(!ye())return;if(typeof ar=="string")return{binDir:ar};const e=de.sync("apt-fast",{nothrow:!0});return e!==null?(ar=T.dirname(e),{binDir:ar}):(ar="/usr/bin",await fE(),{binDir:ar})}async function fE(){const e=pe([{name:"bash"},{name:"wget"}]),t=new _r.DownloaderHelper("https://raw.githubusercontent.com/ilikenwf/apt-fast/c2cd0a0420d3f2d647dc82cf749bfd58c4697dac/quick-install.sh",le.tmpdir(),{fileName:"install-apt-fast.sh"});t.on("error",u=>{throw new Error(`Failedtodownloadinstall-apt-fast.sh:${u}`)}),await t.start();const r=T.join(le.tmpdir(),"install-apt-fast.sh");let n=await Qt(r,"utf8");n=n.replace(/sudo/g,"").replace("https://raw.githubusercontent.com/ilikenwf/apt-fast/master","https://raw.githubusercontent.com/Rongronggg9/apt-fast/ac82051792f764220e5e303d4560de0f1952826b"),await Lr(r,n),await e;try{me("bash",[r])}catch(u){Ae(`Failedtoinstallapt-fastviainstaller:${u}`)}const o="/etc/apt-fast.conf";let s=await Qt(o,"utf8");const i=["_APTMGR","DOWNLOADBEFORE"];for(const u of i)s=s.replace(new RegExp(`^#\\s*${u}`,"m"),u);const l=T.join(le.tmpdir(),"apt-fast.conf");await Lr(l,s),me("mv",[l,o])}let Dt;async function dE({version:e}={}){if(!ye())return;if(typeof Dt=="string")return{binDir:Dt};const t=de.sync("nala",{nothrow:!0});if(t!==null)return Dt=T.dirname(t),{binDir:Dt};await pe([{name:"python3-apt"}]),Dt="/usr/bin";try{const r=await ga({name:"nala",version:e});if(r!==void 0)return await pe([{name:r}]),{binDir:Dt}}catch(r){W(`Failedtoinstallnala:${r}`)}try{const r=await ga({name:"nala-legacy"});if(r!==void 0)return await pe([{name:r}],!0),{binDir:Dt}}catch(r){W(`Failedtoinstallnala-legacy:${r}`)}return await pE(),{binDir:Dt}}async function pE(){const e=new _r.DownloaderHelper("https://gitlab.com/volian/volian-archive/-/raw/1939afc3f80638dca2bbedde74bbd86731703cc8/install-nala.sh",le.tmpdir(),{fileName:"install-nala.sh"});e.on("error",n=>{throw new Error(`Failedtodownloadinstall-nala.sh:${n}`)}),await e.start();const t=T.join(le.tmpdir(),"install-nala.sh"),r=await Qt(t,"utf8");await Lr(t,r.replace(/sudo/g,"")),await pe([{name:"wget"}]);try{me("bash",[t])}catch(n){Ae(`Failedtoinstallnalaviainstaller:${n}`),me("apt",["install","-y","-t","nala","nala"])}}let Kt;async function za(e={}){if(!["darwin","linux"].includes(process.platform)||process.platform==="linux"&&process.arch!=="x64"){ve(`Brewisnotsupportedon${process.platform}${process.arch}`);return}if(typeof Kt=="string")return{binDir:Kt};const t=await de("brew",{nothrow:!0});if(t!==null)return Kt=T.dirname(t),{binDir:Kt};await pe([{name:"ca-certificates"}]);const r=new _r.DownloaderHelper("https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh",le.tmpdir(),{fileName:"install-brew.sh"});return r.on("error",n=>{throw new Error(`Failedtodownloadthebrewinstallerscript:${n}`)}),await r.start(),ze("/bin/bash",[r.getDownloadPath()],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),Kt=Ha(),await $e(Kt,e.rcOptions),{binDir:Kt}}function Ha(){return T.join(Wa(),"bin")}function $h(){return T.join(Ha(),"brew")}function Wa(){if(process.platform==="darwin")return process.arch==="arm64"?"/opt/homebrew":"/usr/local";if(process.platform==="linux")return"/home/linuxbrew/.linuxbrew";throw new Error("Unsupported platform for brew")}function Ih(e,t){return t!==void 0&&t!==""?`${e}@${t}`:e}async function hE(e,t){const r=Ih(e,t),n=await Xf(r);if(n!==void 0)return n;const o=await Xf(e);return o!==void 0?o:mE(e,r)}async function Xf(e){try{const t=$h();return(await fe(t,["--prefix",e],{stdio:"pipe"})).stdout}catch{return}}function mE(e,t){const r=Wa(),n=T.join(r,"opt",t);if(ae.existsSync(n))return n;const o=T.join(r,"opt",e);if(ae.existsSync(o))return o;const s=T.join(r,"C
`);for(const y of h){const w=y.split("=");if(w.length===2&&(w[0].trim()==="VERSION_ID"||w[0].trim()==="DISTRIB_RELEASE")){d=w[1].trim().replace(/^"/,"").replace(/"$/,"");break}}}}return d}t._getOsVersion=p;function v(){const E="/etc/lsb-release",d="/etc/os-release";let f="";return c.existsSync(E)?f=c.readFileSync(E).toString():c.existsSync(d)&&(f=c.readFileSync(d).toString()),f}t._readLinuxVersionFile=v}(Pr,Pr.exports)),Pr.exports}var Ze={},Dd;function ZE(){if(Dd)return Ze;Dd=1;var e=Ze&&Ze.__createBinding||(Object.create?function(i,l,u,a){a===void 0&&(a=u);var c=Object.getOwnPropertyDescriptor(l,u);(!c||("get"in c?!l.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return l[u]}}),Object.defineProperty(i,a,c)}:function(i,l,u,a){a===void 0&&(a=u),i[a]=l[u]}),t=Ze&&Ze.__setModuleDefault||(Object.create?function(i,l){Object.defineProperty(i,"default",{enumerable:!0,value:l})}:function(i,l){i.default=l}),r=Ze&&Ze.__importStar||function(i){if(i&&i.__esModule)return i;var l={};if(i!=null)for(var u in i)u!=="default"&&Object.prototype.hasOwnProperty.call(i,u)&&e(l,i,u);return t(l,i),l},n=Ze&&Ze.__awaiter||function(i,l,u,a){function c(m){return m instanceof u?m:new u(function(p){p(m)})}return new(u||(u=Promise))(function(m,p){function v(f){try{d(a.next(f))}catch(h){p(h)}}function E(f){try{d(a.throw(f))}catch(h){p(h)}}function d(f){f.done?m(f.value):c(f.value).then(v,E)}d((a=a.apply(i,l||[])).next())})};Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.RetryHelper=void 0;const o=r(mr());class s{constructor(l,u,a){if(l<1)throw new Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=l,this.minSeconds=Math.floor(u),this.maxSeconds=Math.floor(a),this.minSeconds>this.maxSeconds)throw new Error("min seconds should be less than or equal to max seconds")}execute(l,u){return n(this,void 0,void 0,function*(){let a=1;for(;a<this.maxAttempts;){try{return yield l()}catch(m){if(u&&!u(m))throw m;o.info(m.message)}const c=this.getSleepAmount();o.info(`Waiting${c}secondsbeforetryingagain`),yield this.sleep(c),a++}return yield l()})}getSleepAmount(){return Math.floor(Math.random()*(this.maxSeconds-this.minSeconds+1))+this.minSeconds}sleep(l){return n(this,void 0,void 0,function*(){return new Promise(u=>setTimeout(u,l*1e3))})}}return Ze.RetryHelper=s,Ze}var kd;function eS(){if(kd)return ce;kd=1;var e=ce&&ce.__createBinding||(Object.create?function(k,D,L,M){M===void 0&&(M=L);var z=Object.getOwnPropertyDescriptor(D,L);(!z||("get"in z?!D.__esModule:z.writable||z.configurable))&&(z={enumerable:!0,get:function(){return D[L]}}),Object.defineProperty(k,M,z)}:function(k,D,L,M){M===void 0&&(M=L),k[M]=D[L]}),t=ce&&ce.__setModuleDefault||(Object.create?function(k,D){Object.defineProperty(k,"default",{enumerable:!0,value:D})}:function(k,D){k.default=D}),r=ce&&ce.__importStar||function(k){if(k&&k.__esModule)return k;var D={};if(k!=null)for(var L in k)L!=="default"&&Object.prototype.hasOwnProperty.call(k,L)&&e(D,k,L);return t(D,k),D},n=ce&&ce.__awaiter||function(k,D,L,M){function z(ee){return ee instanceof L?ee:new L(function(J){J(ee)})}return new(L||(L=Promise))(function(ee,J){function qe(Ce){try{Xe(M.next(Ce))}catch(At){J(At)}}function xe(Ce){try{Xe(M.throw(Ce))}catch(At){J(At)}}function Xe(Ce){Ce.done?ee(Ce.value):z(Ce.value).then(qe,xe)}Xe((M=M.apply(k,D||[])).next())})};Object.defineProperty(ce,"__esModule",{value:!0}),ce.evaluateVersions=ce.isExplicitVersion=ce.findFromManifest=ce.getManifestFromRepo=ce.findAllVersions=ce.find=ce.cacheFile=ce.cacheDir=ce.extractZip=ce.extractXar=ce.extractTar=ce.extract7z=ce.downloadTool=ce.HTTPError=void 0;const o=r(mr()),s=r(Ep()),i=r(Aa),l=r(ae),u=r(QE()),a=r(le),c=r(T),m=r(gp),p=r(Dh()),v=r(qr),E=r(pr),d=kr,f=Na(),h=ZE();class y extends Error{constructor(D){super(`UnexpectedHTTPresponse:${D}`),this.httpStatusCode=D,Object.setPrototypeOf(this,new.target.prototype)}}ce.HTTPError=y;const w=process.platform==="win32",S=process.platform==="darwin",_="actions/tool-cache";function b(k,D,L,M){return n(this,void 0,void 0,function*(){D=D||c.join(ie(),i.randomUUID())
${v.stack}`:String(v);if(Se.info(`Failedtoinstall${t}via${c}:${E}`),await Dr(t)===null)throw new Error(`Failedtoinstall${t}via${c}:${v}.`)}else if(await Dr(t)===null)throw new Error(`Failedtoinstall${t}asitwasnotfoundvia${c}orthesystempackagemanager`);return{binDir:u?await Xd():await Kd(e,m)}}function Xd(){return Xh()}async function Kd(e,t){const r=await QS(e),n=await YS(r,t);return await $e(n,ne),n}async function MS(){return await de("pipx",{nothrow:!0})!==null}async function ln(e){return(await fe(e,["-m","pipx","--help"],{stdio:"ignore",reject:!1})).exitCode===0}async function GS(){let e=process.env.PIPX_HOME;if(e!==void 0)return e;const t=rt("~/.local/pipx");if(await we(t))return t;switch(process.platform){case"win32":{e=rt("~/AppData/Local/pipx");break}case"darwin":{e=rt("~/Library/Application Support/pipx");break}default:{e=rt("~/.local/share/pipx");break}}return await Tr(e),await Tr(T.join(e,"trash")),await Tr(T.join(e,"shared")),await Tr(T.join(e,"venv")),e}const VS=Fe(GS,{promise:!0});async function BS(){if(process.env.PIPX_BIN_DIR!==void 0)return process.env.PIPX_BIN_DIR;const e=rt("~/.local/bin");return await $e(e,ne),await Tr(e),e}const Xh=Fe(BS,{promise:!0});let rn;async function zS(e){if(rn!==void 0)return rn;const t=e!=null?e:nt("python",void 0,await Ft());return rn=(await Hh({version:t,setupDir:"",arch:process.arch})).bin,rn}function HS(e){return e.replace(/\[.*]/g,"").trim()}async function WS(e,t){try{return(await fe(e,["-m","pip","-qq","show",t],{stdio:"ignore",reject:!1})).exitCode===0}catch{return!1}}async function XS(e,t){try{const r=await fe(e,["-m","pipx","list","--json"],{stdio:"ignore",reject:!1});if(r.exitCode!==0||typeof r.stdout!="string")return!1;const n=JSON.parse(r.stdout);if(t in n.venvs)return!0;for(const o of Object.values(n.venvs))if(o.metadata.main_package.package_or_url===t||o.metadata.main_package.package===t)return!0}catch{}return!1}async function KS(e,t){return(await fe(e,["-m","pip","-qq","index","versions",t],{stdio:"ignore",reject:!1})).exitCode===0}async function YS(e,t){const n=(await Promise.all(e.map(s=>we(T.join(s,Ee(t)))))).findIndex(s=>s);if(n!==-1)return e[n];const o=de.sync(Ee(t),{nothrow:!0});return o!==null?T.dirname(o):e[e.length-1]}async function Dr(e,t){if(process.platform==="linux"){Se.info(`Installing${e}viathesystempackagemanager`);const r=e==="pipx"?Te():!0;if(Te())return be(r?`python-${e}`:e);if(Le())return Ne([{name:r?`python3-${e}`:e}]);if(ye())return pe([{name:r?`python3-${e}`:e}]);if(await Ie())return ke([{name:r?`py3-${e}`:e}])}else if(process.platform==="darwin")return["venv"].includes(e)?null:Me(e);return null}async function JS(e){const t=[];process.platform==="linux"?t.push("/home/runner/.local/bin/"):process.platform==="darwin"&&t.push("/usr/local/bin/");const r=await Kh(e);return t.push(T.join(r,"Scripts"),T.join(r,"Scripts","bin"),T.join(r,"bin")),US(t)}const QS=Fe(JS,{promise:!0});async function ZS(e){return(await qn.getExecOutput(`${e}-c"import sys;print(sys.base_exec_prefix);"`)).stdout.trim()}const Kh=Fe(ZS,{promise:!0});async function eb(e){try{const t=await Kh(e),r=await Ch(e);if(r===void 0)return ve(`Failedtogettheversionof${e}`),!1;const n=T.join(t,"lib",`python${r.major}.${r.minor}`,"EXTERNALLY-MANAGED");return we(n)}catch(t){return ve(`Failedtocheckif${e}isexternallymanaged:${t}`),!1}}const Yh=Fe(eb,{promise:!0});function tb({version:e}={}){return ye()&&(e===void 0||e==="")?pe([{name:"gcovr",version:e}]):or("gcovr",e)}function rb(){return Pe("GCOV","llvm-cov gcov",ne)}function Yd(e){const t=kn(e),r=t!==null?fh(t):e,n=r!==""?`gcov-${r}`:"gcov";return Pe("GCOV",n,ne)}const st=["x64","amd64","x86_64","win64","64","amd64_x86","amd64_arm64"],ur=["x86","i386","ia32","win32","32","x32"],ct=["aarch64","arm64","woa64","arm"],nb=["armv7","armv7a"],ib=["powerpc64le","ppc64le"],ob=["sparc64"],sb=["sparcv9"];function Jh(e){return ct.includes(e)?"arm64":st.includes(e)?"amd64":e}async function ab({version:e}={}){switch(process.platform){case"win32":return De("bazelisk",e);case"darwin":return Me("bazelisk",
apt-getupdate-o${Er}`)}async function Kb(e){let t=e.replace(/apt-get install -y/g,`apt-getinstall-oDpkg::Options::="--force-overwrite"-o${Er}-y--fix-broken`);const r=["libc++-$LLVM_VERSION-dev","libc++abi-$LLVM_VERSION-dev","libunwind-$LLVM_VERSION-dev"];return await Promise.all(r.map(async n=>{const o=n.replace("$LLVM_VERSION","*");await eE(o)&&(pn.info(`Removingconflictingpackage${o}`),t=t.replace(n,""))})),t}function Yb(e){return yh()?e.replace(/apt-get/g,"nala"):e}function Jb(e,t,r){return e===1?t.replace(/ -y \$PKG/g,`-yclang-format-${r}`):t}const Jd=typeof __dirname=="string"?__dirname:T.dirname(lt.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:ge&&ge.tagName.toUpperCase()==="SCRIPT"&&ge.src||new URL("setup-cpp.js",document.baseURI).href));async function Qb(e,t,r){const n=await Zb(t,r,e);W(`DownloadingLLVMfrom${n}`);const o=jh(n);return{url:n,extractedFolderName:"",binRelativeDir:"bin",binFileName:Ee("clang"),extractFunction:o===cn.Tar||o===cn.TarGz||o===cn.TarXz?(s,i)=>process.platform==="win32"?dr(s,i,!0):Za(s,i,1):Uh(o)}}async function Zb(e,t,r){const{keywords:n,optionalKeywords:o}=await eR(e,t),s=await gn(T.join(Jd,"github_llvm_llvm-project.json")),i=_n(s,{version:r,keywords:n,optionalKeywords:o,filterMapTag(a){return a.replace(/^llvmorg-/,"")}});if(i!==void 0)return`https://github.com/llvm/llvm-project/releases/download/${i.tag}/${i.name}`;const l=await gn(T.join(Jd,"llvm_org_releases.json")),u=_n(l,{version:r,keywords:n,optionalKeywords:o});if(u!==void 0)return`https://releases.llvm.org/${u.tag}/${u.name}`;throw new Error(`No asset found for version ${r} matching ${n} and ${o}`)}async function eR(e,t){const r=[],n=[];switch(e){case"win32":{n.push(".tar.xz",".tar.xz");const o=[];st.includes(t)?(o.push("win64"),n.push(["x86_64","X64"])):ur.includes(t)?o.push("win32"):ct.includes(t)?o.push("woa64"):(W(`Using arch ${t} for LLVM`),o.push(t)),o.push("windows","Windows"),r.push(o);break}case"linux":{const o=["linux","Linux"];if(ye()){n.push("ubuntu");const s=await Ft();if(s!==null){n.push(`${s[0]}`);const i=s[1]<10?`0${s[1]}`:`${s[1]}`;n.push(`${s[0]}.${i}`),n.push(`${s[0]}.${i}.${s[2]}`)}}else Le()&&n.push("rhel");st.includes(t)?r.push(["x86_64","X64"]):ur.includes(t)?r.push("x86"):ct.includes(t)?r.push("aarch64"):nb.includes(t)?r.push("armv7a"):ib.includes(t)?r.push("powerpc64le"):ob.includes(t)?r.push("sparc64"):(W(`Using arch ${t} for LLVM`),r.push(t)),r.push(o);break}case"darwin":{r.push(["apple","macos","macOS"]),st.includes(t)?n.push(["x86_64","X64"]):ct.includes(t)?n.push(["arm64","ARM64"]):(W(`Using arch ${t} for LLVM`),r.push(t));break}case"freebsd":{r.push("freebsd"),st.includes(t)?r.push("amd64"):ur.includes(t)?r.push("i386"):(W(`Using arch ${t} for LLVM`),r.push(t));break}case"solaris":{r.push("solaris"),st.includes(t)?r.push("amd64"):sb.includes(t)?r.push("sparcv9"):(W(`Using arch ${t} for LLVM`),r.push(t));break}default:W(`Using ${e} ${t} for LLVM`),r.push(e,t);break}return{keywords:r,optionalKeywords:n}}async function tR({version:e,setupDir:t,arch:r}){const n=await gt("llvm",e,Qb,t,r);return await nR(br(e),r),n}async function rR(e,t){if(ye())for(const r of["libtinfo5","libtinfo6"])try{await pe([{name:r}])}catch{try{if(r==="libtinfo5"){W(`Failed to install ${r}
Manuallyinstallingthepackage`);const o=`libtinfo5_6.3-2ubuntu0.1_${Jh(t)}.deb`,s=`https://launchpad.net/ubuntu/+archive/primary/+files/${o}`,i=new _r.DownloaderHelper(s,le.tmpdir(),{fileName:o});i.on("error",async l=>{W(`Failed to download ${s}: ${l}`),await i.stop()}),await i.start(),me("dpkg",["-i",T.join(le.tmpdir(),o)])}}catch{W(`Failed to install ${r}. Ignoring`)}}else Te()?await be("ncurses5-compat-libs",void 0,"yay"):Le()&&await Ne([{name:"ncurses-compat-libs"}])}const nR=Fe(rR,{promise:!0});async function iR({version:e}){if(process.platform!=="darwin")return Promise.resolve(void 0);try{return await oR({version:e})}catch(t){W(`Failed to install llvm via brew: ${t}`);return}}async function oR({version:e}){const t=br(e),r=await Me("llvm",`${t}`,{"force-bottle":!0});return await $e(r.binDir,ne),r}const{GITHUB_ACTIONS:sR}=Et,aR=typeof __dirname=="string"?__dirname:T.dirname(lt.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:ge&&ge.tagName.toUpperCase()==="SCRIPT"&&ge.src||new URL("setup-cpp.js",document.baseURI).href));async function dn({version:e,setupDir:t,arch:r}){const n=await ic(e,t,r);return await uR(r),await fR(),n.installDir!==void 0&&await lR(n.installDir,e),n}async function ic(e,t,r,n=nc.All){const o=await Bb(e,n);if(o!==void 0)return o;const s=await Mb(e);if(s!==void 0)return s;const i=await iR({version:e});return i!==void 0?i:tR({version:e,setupDir:t,arch:r})}async function cR(e){process.platform==="linux"&&await En({version:nt("gcc",void 0,await Ft()),setupDir:"",arch:e,priority:40})}const uR=Fe(cR,{promise:!0});async function lR(e,t){var i,l;const r=(i=process.env.LD_LIBRARY_PATH)!=null?i:"",n=(l=process.env.DYLD_LIBRARY_PATH)!=null?l:"",o=br(t),s=[Pe("CC",Ee(`${e}/bin/clang`),ne),Pe("CXX",Ee(`${e}/bin/clang++`),ne),Pe("LLVM_PATH",e,ne),Pe("LLVM_LD_LIBRARY_PATH",`${r}${T.delimiter}${e}/lib`,ne),Pe("LLVM_DYLD_LIBRARY_PATH",`${n}${T.delimiter}${e}/lib`,ne),Pe("LLVM_LDFLAGS",`-L${Wd(`${e}/lib`)}`,ne),Pe("LLVM_CPPFLAGS",`-I${Wd(`${e}/include`)}`,ne),await we(`${e}/lib/clang/${t}/include`)?Pe("LLVM_CPATH",`${e}/lib/clang/${t}/include`,ne):await we(`${e}/lib/clang/${o}/include`)?Pe("LLVM_CPATH",`${e}/lib/clang/${o}/include`,ne):Promise.resolve(),Pe("LLVM_LIBRARY_PATH",`${e}/lib`,ne),Ph()];ye()&&s.push(wt("cc",`${e}/bin/clang`,ne,60),wt("cxx",`${e}/bin/clang++`,ne,60),wt("clang",`${e}/bin/clang`,ne),wt("clang++",`${e}/bin/clang++`,ne),wt("lld",`${e}/bin/lld`,ne),wt("ld.lld",`${e}/bin/ld.lld`,ne),wt("llvm-ar",`${e}/bin/llvm-ar`,ne)),await Promise.all(s)}async function fR(){if(!sR)return;const e=T.join(aR,"llvm_matcher.json");if(!await we(e))return ve("the llvm_matcher.json file does not exist in the same folder as setup-cpp.js");W(`::add-matcher::${e}`)}function Qd({version:e,setupDir:t,arch:r}){return ic(e,t,r,nc.ClangFormat)}function Zd({version:e,setupDir:t,arch:r}){return ic(e,t,r)}async function dR({version:e}={}){switch(process.platform){case"win32":return De("make",e);case"darwin":{await Me("make",e);const t=T.join(Wa(),"opt/make/libexec/gnubin");return await $e(t,ne),{binDir:t}}case"linux":{if(Te())return be("make",e);if(Le())return Ne([{name:"make",version:e}]);if(ye())return pe([{name:"make",version:e}]);if(await Ie())return ke([{name:"make",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}function pR({version:e}={}){return or("meson",e)}var Yt={},ep;function hR(){if(ep)return Yt;ep=1;const e=mr(),t=Nt,r=ae,n=T,o=at,s=o.env["ProgramFiles(x86)"],i=[o.env["ProgramFiles(x86)"],o.env.ProgramFiles],l=["Enterprise","Professional","Community","BuildTools"],u=["2022","2019","2017"],a={2022:"17.0",2019:"16.0",2017:"15.0",2015:"14.0",2013:"12.0"};function c(y){return Object.values(a).includes(y)?y:y in a?a[y]:y}Yt.vsversion_to_versionnumber=c;function m(y){if(Object.keys(a).includes(y))return y;for(const[w,S]of Object.entries(a))if(S===y)return w;return y}Yt.vsversion_to_year=m;const p=`${s}\\Microsoft Visual Studio\\Installer`;function v(y,w){try{return t.execSync(`vswhere -products * ${w} -prerelease -property in
`),F=A.filter(q=>!!(q.match(/^\[ERROR.*\]/)&&!q.match(/Error in script usage. The correct usage is:$/)));if(F.length>0)throw new Error(`invalidparameters\r
-Thebinarydirectoryis${t.binDir}`)),r}const CR=/[.-]((?:\d{4}|\d+(?:\.\d+)*(?:-[\w.-]+)?(?:\+[\w.-]+)?)$)/;function AR(e){try{const t=e.match(CR);if(t===null)return{compiler:e,version:void 0};const r=t[1],n=e.slice(0,t.index).replace(/[.-]$/,"");return!r.match(/^\d{4}$/)&&kn(r)===null&&W(`Non-semverversionformat:${r}`),{compiler:n,version:r}}catch(t){return Ae(`Failedtoparsethecompilerinfo${e}:${t}`),{compiler:e,version:void 0}}}async function NR(e,t,r,n,o,s,i){var u;let l;try{if(Se.startGroup(`Installing${e}${t!=null?t:""}`),e in tm)l=await dn({version:nt("llvm",t,r),setupDir:T.join(n,"llvm"),arch:o}),await rb();else if(e in rm){const a=nt("gcc",t,r);l=await En({version:a,setupDir:T.join(n,"gcc"),arch:o}),await Yd(a)}else if(e in nm){const a=nt("mingw",t,r);l=await ec({version:a,setupDir:T.join(n,"gcc"),arch:o}),await Yd(a)}else e in im?l=await Cr({version:nt("msvc",t,r),setupDir:T.join(n,"msvc"),arch:o}):e in om?await xr():(l=null,i.push(`Unsupportedcompiler${e}`))}catch(a){Ae(a),a instanceof Error&&Ae((u=a.stack)!=null?u:""),i.push(`Failedtoinstallthe${e}compiler${t}`)}l!==null&&s.push(lm(e,l)),Se.endGroup()}async function LR(e,t="npm"){try{return await de("setup-cpp",{nothrow:!0})!==null?`setup-cpp@${e}alreadyinstalled`:(W(`Installingsetup-cpp@${e}via${t}...`),await fe(t,["install","-g",`setup-cpp@${e}`],{stdio:"inherit",timeout:1e3*60*1}),`setup-cpp@${e}installedsuccessfully`)}catch(r){return new Error(`Failedtoinstallthesetup-cpp@${e}CLI:${r}.Ignoring...`)}}async function DR(e={}){var E,d;const t=(E=e.architecture)!=null?E:process.arch,r=(d=process.env.SETUP_CPP_DIR)!=null?d:rt("~"),n=[],o=[],s=Uf.create({autoloadLocales:!0});Uf.addLocale($_),y_.addLocale(g_);let i,l;const u=await Ft(),a=e.compiler!==void 0?AR(e.compiler):void 0;if(!$S(e,[...sm,"compiler"],a))return{successMessages:[],errorMessages:["The same version must be used for llvm, clang-format and clang-tidy"]};Te()&&typeof e.cppcheck=="string"&&typeof e.gcovr=="string"&&(W("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await be("python-pygments"));const c=cm.filter(f=>{const h=e[f];return h!==void 0&&h!=="false"}),m=e["setup-cpp"]===void 0||e["setup-cpp"]?LR(xa.version,e["node-package-manager"]):Promise.resolve(void 0);let p=!1;for(const f of c){const h=e[f],y=e.timeout!==void 0?Number.parseFloat(e.timeout)*60*1e3:void 0;if(i=Date.now(),await TR(f,h,u,t,r,n,o,y),l=Date.now(),W(`took${s.format(i,l)||"0 seconds"}`),o.length!==0&&hn.isCI){p=!0;break}}if(!p&&a!==void 0){const f=Date.now();await NR(a.compiler,a.version,u,r,t,n,o);const h=Date.now();W(`took${s.format(f,h)||"0 seconds"}`)}const v=await m;return typeof v=="string"&&n.push(v),await Zg(ne),{successMessages:n,errorMessages:o}}async function kR(e){const t=hn.GITHUB_ACTIONS?Promise.resolve():qR(),r=fm(e);if(r.help)return FR(),0;if(r.version)return W(`${xa.version}`),0;const{successMessages:n,errorMessages:o}=await DR(r);for(const s of n)$y(s);for(const s of o)Ae(s);if((n.length!==0||o.length!==0)&&(W("setup-cpp finished"),!hn.GITHUB_ACTIONS))switch(process.platform){case"win32":{ve("Run `RefreshEnv.cmd` or restart your shell to update the environment.");break}case"linux":case"darwin":{ve("Run `source~/.cpprc`orrestartyourshelltoupdatetheenvironment.");break}}returnawaitt,o.length===0?0:1}asyncfunctionqR(){try{awaitty({pkg:xa})}catch(e){ve(`Failedtocheckforupdates:${einstanceofError?e.message+e.stack:e}`)}}functionfm(e){constt=Object.fromEntries(op.map(r=>[r,Sp(r)]));returnCm(e,{string:[...op,"timeout","node-package-manager"],default:t,alias:{h:"help",v:"version"},boolean:["help","version","setup-cpp"]})}functionFR(){W(`