mirror of https://github.com/aminya/setup-cpp.git
82 lines
318 KiB
JavaScript
82 lines
318 KiB
JavaScript
#!/usr/bin/env node
|
||
import up from"process";import it,{homedir as lp,tmpdir as Ue}from"os";import ue,{join as J,resolve as Ia,delimiter as mn,basename as er,extname as In,normalize as Lm,sep as fp,dirname as be,relative as Dm,parse as dp}from"path";import je,{promises as Pn,existsSync as Qt,mkdir as pp,stat as km,statSync as Fm,mkdirSync as hp}from"fs";import*as uc from"https";import Pa from"https";import mp from"crypto";import*as Vn from"http";import yp from"http";import"net";import qm from"tls";import Tn from"events";import xn from"util";import Um from"string_decoder";import Fr from"child_process";import qr from"assert";import jm from"timers";import{Buffer as Mm}from"node:buffer";import dr from"node:path";import ga,{ChildProcess as Gm}from"node:child_process";import Tt from"node:process";import{fileURLToPath as vp}from"node:url";import wp,{constants as gp}from"node:os";import Vm,{createWriteStream as Bm,createReadStream as Hm,readFileSync as zm,promises as Wm}from"node:fs";import Xm from"buffer";import Ur from"stream";import{debuglog as Km}from"node:util";import _p,{readFile as pr,appendFile as Ym,writeFile as yn,chmod as Ep,readdir as Sp}from"fs/promises";import Jm,{fileURLToPath as Lt}from"url";import Qm from"constants";import{error as Zm,info as _a}from"console";function Bn(e){return e==null?[]:Array.isArray(e)?e:[e]}function ey(e,t,r,n){var i,o=e[t],s=~n.string.indexOf(t)?r==null||r===!0?"":String(r):typeof r=="boolean"?r:~n.boolean.indexOf(t)?r==="false"?!1:r==="true"||(e._.push((i=+r,i*0===0?i:r)),!!r):(i=+r,i*0===0?i:r);e[t]=o==null?s:Array.isArray(o)?o.concat(s):[o,s]}function ty(e,t){e=e||[],t=t||{};var r,n,i,o,s,l={_:[]},u=0,a=0,c=0,m=e.length;const p=t.alias!==void 0,w=t.unknown!==void 0,E=t.default!==void 0;if(t.alias=t.alias||{},t.string=Bn(t.string),t.boolean=Bn(t.boolean),p)for(r in t.alias)for(n=t.alias[r]=Bn(t.alias[r]),u=0;u<n.length;u++)(t.alias[n[u]]=n.concat(r)).splice(u,1);for(u=t.boolean.length;u-- >0;)for(n=t.alias[t.boolean[u]]||[],a=n.length;a-- >0;)t.boolean.push(n[a]);for(u=t.string.length;u-- >0;)for(n=t.alias[t.string[u]]||[],a=n.length;a-- >0;)t.string.push(n[a]);if(E){for(r in t.default)if(o=typeof t.default[r],n=t.alias[r]=t.alias[r]||[],t[o]!==void 0)for(t[o].push(r),u=0;u<n.length;u++)t[o].push(n[u])}const d=w?Object.keys(t.alias):[];for(u=0;u<m;u++){if(i=e[u],i==="--"){l._=l._.concat(e.slice(++u));break}for(a=0;a<i.length&&i.charCodeAt(a)===45;a++);if(a===0)l._.push(i);else if(i.substring(a,a+3)==="no-"){if(o=i.substring(a+3),w&&!~d.indexOf(o))return t.unknown(i);l[o]=!1}else{for(c=a+1;c<i.length&&i.charCodeAt(c)!==61;c++);for(o=i.substring(a,c),s=i.substring(++c)||u+1===m||(""+e[u+1]).charCodeAt(0)===45||e[++u],n=a===2?[o]:o,c=0;c<n.length;c++){if(o=n[c],w&&!~d.indexOf(o))return t.unknown("-".repeat(a)+o);ey(l,o,c+1<n.length||s,t)}}}if(E)for(r in t.default)l[r]===void 0&&(l[r]=t.default[r]);if(p)for(r in l)for(n=t.alias[r]||[];n.length>0;)l[n.shift()]=l[r];return l}var at=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ry(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var Hr={exports:{}},Hn,lc;function An(){if(lc)return Hn;lc=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,i=t-6;return Hn={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Hn}var zn,fc;function Cn(){return fc||(fc=1,zn=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),zn}var dc;function jr(){return dc||(dc=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=An(),o=Cn();t=e.exports={};const s=t.re=[],l=t.safeRe=[],u=t.src=[],a=t.safeSrc=[],c=t.t={};let m=0;const p="[a-zA-Z0-9-]",w=[["\\s",1],["\\d",i],[p,n]],E=f=>{for(const[h,y]of w)f=f.split(`${h}*`).join(`${h}{0,${y}}`).split(`${h}+`).join(`${h}{1,${y}}`);return f},d=(f,h,y)=>{const v=E(h),S=m++;o(f,S,h),c[f]=S,u[S]=h,a[S]=v,s[S]=new RegExp(h,y?"g":void 0),l[S]=new RegExp(v,y?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),d("MAINVERSION",`(${u[c.NUMERICIDENTIFIER]})\\.(${u[c.NUMERICIDENTIFIER]})\\.(${u[c.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${u[c.NUMERICIDENTIFIERLOOSE]})\\.(${u[c.NUMERICIDENTIFIERLOOSE]})\\.(${u[c.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${u[c.NONNUMERICIDENTIFIER]}|${u[c.NUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${u[c.NONNUMERICIDENTIFIER]}|${u[c.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASE",`(?:-(${u[c.PRERELEASEIDENTIFIER]}(?:\\.${u[c.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${u[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[c.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",`${p}+`),d("BUILD",`(?:\\+(${u[c.BUILDIDENTIFIER]}(?:\\.${u[c.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${u[c.MAINVERSION]}${u[c.PRERELEASE]}?${u[c.BUILD]}?`),d("FULL",`^${u[c.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${u[c.MAINVERSIONLOOSE]}${u[c.PRERELEASELOOSE]}?${u[c.BUILD]}?`),d("LOOSE",`^${u[c.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${u[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${u[c.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${u[c.XRANGEIDENTIFIER]})(?:\\.(${u[c.XRANGEIDENTIFIER]})(?:\\.(${u[c.XRANGEIDENTIFIER]})(?:${u[c.PRERELEASE]})?${u[c.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${u[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[c.XRANGEIDENTIFIERLOOSE]})(?:${u[c.PRERELEASELOOSE]})?${u[c.BUILD]}?)?)?`),d("XRANGE",`^${u[c.GTLT]}\\s*${u[c.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${u[c.GTLT]}\\s*${u[c.XRANGEPLAINLOOSE]}$`),d("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),d("COERCE",`${u[c.COERCEPLAIN]}(?:$|[^\\d])`),d("COERCEFULL",u[c.COERCEPLAIN]+`(?:${u[c.PRERELEASE]})?(?:${u[c.BUILD]})?(?:$|[^\\d])`),d("COERCERTL",u[c.COERCE],!0),d("COERCERTLFULL",u[c.COERCEFULL],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${u[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",d("TILDE",`^${u[c.LONETILDE]}${u[c.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${u[c.LONETILDE]}${u[c.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${u[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",d("CARET",`^${u[c.LONECARET]}${u[c.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${u[c.LONECARET]}${u[c.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${u[c.GTLT]}\\s*(${u[c.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${u[c.GTLT]}\\s*(${u[c.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${u[c.GTLT]}\\s*(${u[c.LOOSEPLAIN]}|${u[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${u[c.XRANGEPLAIN]})\\s+-\\s+(${u[c.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${u[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[c.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Hr,Hr.exports)),Hr.exports}var Wn,pc;function Ta(){if(pc)return Wn;pc=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Wn=n=>n?typeof n!="object"?e:n:t,Wn}var Xn,hc;function bp(){if(hc)return Xn;hc=1;const e=/^[0-9]+$/,t=(n,i)=>{const o=e.test(n),s=e.test(i);return o&&s&&(n=+n,i=+i),n===i?0:o&&!s?-1:s&&!o?1:n<i?-1:1};return Xn={compareIdentifiers:t,rcompareIdentifiers:(n,i)=>t(i,n)},Xn}var Kn,mc;function We(){if(mc)return Kn;mc=1;const e=Cn(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=An(),{safeRe:n,t:i}=jr(),o=Ta(),{compareIdentifiers:s}=bp();class l{constructor(a,c){if(c=o(c),a instanceof l){if(a.loose===!!c.loose&&a.includePrerelease===!!c.includePrerelease)return a;a=a.version}else if(typeof a!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof a}".`);if(a.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",a,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const m=a.trim().match(c.loose?n[i.LOOSE]:n[i.FULL]);if(!m)throw new TypeError(`Invalid Version: ${a}`);if(this.raw=a,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(p=>{if(/^[0-9]+$/.test(p)){const w=+p;if(w>=0&&w<r)return w}return p}):this.prerelease=[],this.build=m[5]?m[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(a){if(e("SemVer.compare",this.version,this.options,a),!(a instanceof l)){if(typeof a=="string"&&a===this.version)return 0;a=new l(a,this.options)}return a.version===this.version?0:this.compareMain(a)||this.comparePre(a)}compareMain(a){return a instanceof l||(a=new l(a,this.options)),s(this.major,a.major)||s(this.minor,a.minor)||s(this.patch,a.patch)}comparePre(a){if(a instanceof l||(a=new l(a,this.options)),this.prerelease.length&&!a.prerelease.length)return-1;if(!this.prerelease.length&&a.prerelease.length)return 1;if(!this.prerelease.length&&!a.prerelease.length)return 0;let c=0;do{const m=this.prerelease[c],p=a.prerelease[c];if(e("prerelease compare",c,m,p),m===void 0&&p===void 0)return 0;if(p===void 0)return 1;if(m===void 0)return-1;if(m===p)continue;return s(m,p)}while(++c)}compareBuild(a){a instanceof l||(a=new l(a,this.options));let c=0;do{const m=this.build[c],p=a.build[c];if(e("build compare",c,m,p),m===void 0&&p===void 0)return 0;if(p===void 0)return 1;if(m===void 0)return-1;if(m===p)continue;return s(m,p)}while(++c)}inc(a,c,m){if(a.startsWith("pre")){if(!c&&m===!1)throw new Error("invalid increment argument: identifier is empty");if(c){const p=`-${c}`.match(this.options.loose?n[i.PRERELEASELOOSE]:n[i.PRERELEASE]);if(!p||p[1]!==c)throw new Error(`invalid identifier: ${c}`)}}switch(a){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",c,m);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",c,m);break;case"prepatch":this.prerelease.length=0,this.inc("patch",c,m),this.inc("pre",c,m);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",c,m),this.inc("pre",c,m);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const p=Number(m)?1:0;if(this.prerelease.length===0)this.prerelease=[p];else{let w=this.prerelease.length;for(;--w>=0;)typeof this.prerelease[w]=="number"&&(this.prerelease[w]++,w=-2);if(w===-1){if(c===this.prerelease.join(".")&&m===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(p)}}if(c){let w=[c,p];m===!1&&(w=[c]),s(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=w):this.prerelease=w}break}default:throw new Error(`invalid increment argument: ${a}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Kn=l,Kn}var Yn,yc;function vr(){if(yc)return Yn;yc=1;const e=We();return Yn=(r,n,i=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(o){if(!i)return null;throw o}},Yn}var Jn,vc;function Rp(){if(vc)return Jn;vc=1;const e=vr();return Jn=(r,n)=>{const i=e(r,n);return i?i.version:null},Jn}var Qn,wc;function ny(){if(wc)return Qn;wc=1;const e=vr();return Qn=(r,n)=>{const i=e(r.trim().replace(/^[=v]+/,""),n);return i?i.version:null},Qn}var Zn,gc;function iy(){if(gc)return Zn;gc=1;const e=We();return Zn=(r,n,i,o,s)=>{typeof i=="string"&&(s=o,o=i,i=void 0);try{return new e(r instanceof e?r.version:r,i).inc(n,o,s).version}catch{return null}},Zn}var ei,_c;function sy(){if(_c)return ei;_c=1;const e=vr();return ei=(r,n)=>{const i=e(r,null,!0),o=e(n,null,!0),s=i.compare(o);if(s===0)return null;const l=s>0,u=l?i:o,a=l?o:i,c=!!u.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(u)===0)return a.minor&&!a.patch?"minor":"patch"}const p=c?"pre":"";return i.major!==o.major?p+"major":i.minor!==o.minor?p+"minor":i.patch!==o.patch?p+"patch":"prerelease"},ei}var ti,Ec;function $p(){if(Ec)return ti;Ec=1;const e=We();return ti=(r,n)=>new e(r,n).major,ti}var ri,Sc;function oy(){if(Sc)return ri;Sc=1;const e=We();return ri=(r,n)=>new e(r,n).minor,ri}var ni,bc;function ay(){if(bc)return ni;bc=1;const e=We();return ni=(r,n)=>new e(r,n).patch,ni}var ii,Rc;function cy(){if(Rc)return ii;Rc=1;const e=vr();return ii=(r,n)=>{const i=e(r,n);return i&&i.prerelease.length?i.prerelease:null},ii}var si,$c;function ft(){if($c)return si;$c=1;const e=We();return si=(r,n,i)=>new e(r,i).compare(new e(n,i)),si}var oi,Oc;function uy(){if(Oc)return oi;Oc=1;const e=ft();return oi=(r,n,i)=>e(n,r,i),oi}var ai,Ic;function ly(){if(Ic)return ai;Ic=1;const e=ft();return ai=(r,n)=>e(r,n,!0),ai}var ci,Pc;function xa(){if(Pc)return ci;Pc=1;const e=We();return ci=(r,n,i)=>{const o=new e(r,i),s=new e(n,i);return o.compare(s)||o.compareBuild(s)},ci}var ui,Tc;function fy(){if(Tc)return ui;Tc=1;const e=xa();return ui=(r,n)=>r.sort((i,o)=>e(i,o,n)),ui}var li,xc;function dy(){if(xc)return li;xc=1;const e=xa();return li=(r,n)=>r.sort((i,o)=>e(o,i,n)),li}var fi,Ac;function Nn(){if(Ac)return fi;Ac=1;const e=ft();return fi=(r,n,i)=>e(r,n,i)>0,fi}var di,Cc;function Aa(){if(Cc)return di;Cc=1;const e=ft();return di=(r,n,i)=>e(r,n,i)<0,di}var pi,Nc;function Op(){if(Nc)return pi;Nc=1;const e=ft();return pi=(r,n,i)=>e(r,n,i)===0,pi}var hi,Lc;function Ip(){if(Lc)return hi;Lc=1;const e=ft();return hi=(r,n,i)=>e(r,n,i)!==0,hi}var mi,Dc;function Ca(){if(Dc)return mi;Dc=1;const e=ft();return mi=(r,n,i)=>e(r,n,i)>=0,mi}var yi,kc;function Ln(){if(kc)return yi;kc=1;const e=ft();return yi=(r,n,i)=>e(r,n,i)<=0,yi}var vi,Fc;function Pp(){if(Fc)return vi;Fc=1;const e=Op(),t=Ip(),r=Nn(),n=Ca(),i=Aa(),o=Ln();return vi=(l,u,a,c)=>{switch(u){case"===":return typeof l=="object"&&(l=l.version),typeof a=="object"&&(a=a.version),l===a;case"!==":return typeof l=="object"&&(l=l.version),typeof a=="object"&&(a=a.version),l!==a;case"":case"=":case"==":return e(l,a,c);case"!=":return t(l,a,c);case">":return r(l,a,c);case">=":return n(l,a,c);case"<":return i(l,a,c);case"<=":return o(l,a,c);default:throw new TypeError(`Invalid operator: ${u}`)}},vi}var wi,qc;function Tp(){if(qc)return wi;qc=1;const e=We(),t=vr(),{safeRe:r,t:n}=jr();return wi=(o,s)=>{if(o instanceof e)return o;if(typeof o=="number"&&(o=String(o)),typeof o!="string")return null;s=s||{};let l=null;if(!s.rtl)l=o.match(s.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const w=s.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let E;for(;(E=w.exec(o))&&(!l||l.index+l[0].length!==o.length);)(!l||E.index+E[0].length!==l.index+l[0].length)&&(l=E),w.lastIndex=E.index+E[1].length+E[2].length;w.lastIndex=-1}if(l===null)return null;const u=l[2],a=l[3]||"0",c=l[4]||"0",m=s.includePrerelease&&l[5]?`-${l[5]}`:"",p=s.includePrerelease&&l[6]?`+${l[6]}`:"";return t(`${u}.${a}.${c}${m}${p}`,s)},wi}var gi,Uc;function py(){if(Uc)return gi;Uc=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const o=this.map.keys().next().value;this.delete(o)}this.map.set(r,n)}return this}}return gi=e,gi}var _i,jc;function _t(){if(jc)return _i;jc=1;const e=/\s+/g;class t{constructor(T,F){if(F=i(F),T instanceof t)return T.loose===!!F.loose&&T.includePrerelease===!!F.includePrerelease?T:new t(T.raw,F);if(T instanceof o)return this.raw=T.value,this.set=[[T]],this.formatted=void 0,this;if(this.options=F,this.loose=!!F.loose,this.includePrerelease=!!F.includePrerelease,this.raw=T.trim().replace(e," "),this.set=this.raw.split("||").map(U=>this.parseRange(U.trim())).filter(U=>U.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const U=this.set[0];if(this.set=this.set.filter(k=>!d(k[0])),this.set.length===0)this.set=[U];else if(this.set.length>1){for(const k of this.set)if(k.length===1&&f(k[0])){this.set=[k];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let T=0;T<this.set.length;T++){T>0&&(this.formatted+="||");const F=this.set[T];for(let U=0;U<F.length;U++)U>0&&(this.formatted+=" "),this.formatted+=F[U].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(T){const U=((this.options.includePrerelease&&w)|(this.options.loose&&E))+":"+T,k=n.get(U);if(k)return k;const G=this.options.loose,C=G?u[a.HYPHENRANGELOOSE]:u[a.HYPHENRANGE];T=T.replace(C,K(this.options.includePrerelease)),s("hyphen replace",T),T=T.replace(u[a.COMPARATORTRIM],c),s("comparator trim",T),T=T.replace(u[a.TILDETRIM],m),s("tilde trim",T),T=T.replace(u[a.CARETTRIM],p),s("caret trim",T);let H=T.split(" ").map(X=>y(X,this.options)).join(" ").split(/\s+/).map(X=>M(X,this.options));G&&(H=H.filter(X=>(s("loose invalid filter",X,this.options),!!X.match(u[a.COMPARATORLOOSE])))),s("range list",H);const W=new Map,re=H.map(X=>new o(X,this.options));for(const X of re){if(d(X))return[X];W.set(X.value,X)}W.size>1&&W.has("")&&W.delete("");const ce=[...W.values()];return n.set(U,ce),ce}intersects(T,F){if(!(T instanceof t))throw new TypeError("a Range is required");return this.set.some(U=>h(U,F)&&T.set.some(k=>h(k,F)&&U.every(G=>k.every(C=>G.intersects(C,F)))))}test(T){if(!T)return!1;if(typeof T=="string")try{T=new l(T,this.options)}catch{return!1}for(let F=0;F<this.set.length;F++)if(Q(this.set[F],T,this.options))return!0;return!1}}_i=t;const r=py(),n=new r,i=Ta(),o=Dn(),s=Cn(),l=We(),{safeRe:u,t:a,comparatorTrimReplace:c,tildeTrimReplace:m,caretTrimReplace:p}=jr(),{FLAG_INCLUDE_PRERELEASE:w,FLAG_LOOSE:E}=An(),d=x=>x.value==="<0.0.0-0",f=x=>x.value==="",h=(x,T)=>{let F=!0;const U=x.slice();let k=U.pop();for(;F&&U.length;)F=U.every(G=>k.intersects(G,T)),k=U.pop();return F},y=(x,T)=>(s("comp",x,T),x=b(x,T),s("caret",x),x=S(x,T),s("tildes",x),x=$(x,T),s("xrange",x),x=A(x,T),s("stars",x),x),v=x=>!x||x.toLowerCase()==="x"||x==="*",S=(x,T)=>x.trim().split(/\s+/).map(F=>_(F,T)).join(" "),_=(x,T)=>{const F=T.loose?u[a.TILDELOOSE]:u[a.TILDE];return x.replace(F,(U,k,G,C,H)=>{s("tilde",x,U,k,G,C,H);let W;return v(k)?W="":v(G)?W=`>=${k}.0.0 <${+k+1}.0.0-0`:v(C)?W=`>=${k}.${G}.0 <${k}.${+G+1}.0-0`:H?(s("replaceTilde pr",H),W=`>=${k}.${G}.${C}-${H} <${k}.${+G+1}.0-0`):W=`>=${k}.${G}.${C} <${k}.${+G+1}.0-0`,s("tilde return",W),W})},b=(x,T)=>x.trim().split(/\s+/).map(F=>g(F,T)).join(" "),g=(x,T)=>{s("caret",x,T);const F=T.loose?u[a.CARETLOOSE]:u[a.CARET],U=T.includePrerelease?"-0":"";return x.replace(F,(k,G,C,H,W)=>{s("caret",x,k,G,C,H,W);let re;return v(G)?re="":v(C)?re=`>=${G}.0.0${U} <${+G+1}.0.0-0`:v(H)?G==="0"?re=`>=${G}.${C}.0${U} <${G}.${+C+1}.0-0`:re=`>=${G}.${C}.0${U} <${+G+1}.0.0-0`:W?(s("replaceCaret pr",W),G==="0"?C==="0"?re=`>=${G}.${C}.${H}-${W} <${G}.${C}.${+H+1}-0`:re=`>=${G}.${C}.${H}-${W} <${G}.${+C+1}.0-0`:re=`>=${G}.${C}.${H}-${W} <${+G+1}.0.0-0`):(s("no pr"),G==="0"?C==="0"?re=`>=${G}.${C}.${H}${U} <${G}.${C}.${+H+1}-0`:re=`>=${G}.${C}.${H}${U} <${G}.${+C+1}.0-0`:re=`>=${G}.${C}.${H} <${+G+1}.0.0-0`),s("caret return",re),re})},$=(x,T)=>(s("replaceXRanges",x,T),x.split(/\s+/).map(F=>I(F,T)).join(" ")),I=(x,T)=>{x=x.trim();const F=T.loose?u[a.XRANGELOOSE]:u[a.XRANGE];return x.replace(F,(U,k,G,C,H,W)=>{s("xRange",x,U,k,G,C,H,W);const re=v(G),ce=re||v(C),X=ce||v(H),ie=X;return k==="="&&ie&&(k=""),W=T.includePrerelease?"-0":"",re?k===">"||k==="<"?U="<0.0.0-0":U="*":k&&ie?(ce&&(C=0),H=0,k===">"?(k=">=",ce?(G=+G+1,C=0,H=0):(C=+C+1,H=0)):k==="<="&&(k="<",ce?G=+G+1:C=+C+1),k==="<"&&(W="-0"),U=`${k+G}.${C}.${H}${W}`):ce?U=`>=${G}.0.0${W} <${+G+1}.0.0-0`:X&&(U=`>=${G}.${C}.0${W} <${G}.${+C+1}.0-0`),s("xRange return",U),U})},A=(x,T)=>(s("replaceStars",x,T),x.trim().replace(u[a.STAR],"")),M=(x,T)=>(s("replaceGTE0",x,T),x.trim().replace(u[T.includePrerelease?a.GTE0PRE:a.GTE0],"")),K=x=>(T,F,U,k,G,C,H,W,re,ce,X,ie)=>(v(U)?F="":v(k)?F=`>=${U}.0.0${x?"-0":""}`:v(G)?F=`>=${U}.${k}.0${x?"-0":""}`:C?F=`>=${F}`:F=`>=${F}${x?"-0":""}`,v(re)?W="":v(ce)?W=`<${+re+1}.0.0-0`:v(X)?W=`<${re}.${+ce+1}.0-0`:ie?W=`<=${re}.${ce}.${X}-${ie}`:x?W=`<${re}.${ce}.${+X+1}-0`:W=`<=${W}`,`${F} ${W}`.trim()),Q=(x,T,F)=>{for(let U=0;U<x.length;U++)if(!x[U].test(T))return!1;if(T.prerelease.length&&!F.includePrerelease){for(let U=0;U<x.length;U++)if(s(x[U].semver),x[U].semver!==o.ANY&&x[U].semver.prerelease.length>0){const k=x[U].semver;if(k.major===T.major&&k.minor===T.minor&&k.patch===T.patch)return!0}return!1}return!0};return _i}var Ei,Mc;function Dn(){if(Mc)return Ei;Mc=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,m){if(m=r(m),c instanceof t){if(c.loose===!!m.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),s("comparator",c,m),this.options=m,this.loose=!!m.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(c){const m=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],p=c.match(m);if(!p)throw new TypeError(`Invalid comparator: ${c}`);this.operator=p[1]!==void 0?p[1]:"",this.operator==="="&&(this.operator=""),p[2]?this.semver=new l(p[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(s("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new l(c,this.options)}catch{return!1}return o(c,this.operator,this.semver,this.options)}intersects(c,m){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,m).test(this.value):c.operator===""?c.value===""?!0:new u(this.value,m).test(c.semver):(m=r(m),m.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||o(this.semver,"<",c.semver,m)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||o(this.semver,">",c.semver,m)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}Ei=t;const r=Ta(),{safeRe:n,t:i}=jr(),o=Pp(),s=Cn(),l=We(),u=_t();return Ei}var Si,Gc;function Mr(){if(Gc)return Si;Gc=1;const e=_t();return Si=(r,n,i)=>{try{n=new e(n,i)}catch{return!1}return n.test(r)},Si}var bi,Vc;function hy(){if(Vc)return bi;Vc=1;const e=_t();return bi=(r,n)=>new e(r,n).set.map(i=>i.map(o=>o.value).join(" ").trim().split(" ")),bi}var Ri,Bc;function my(){if(Bc)return Ri;Bc=1;const e=We(),t=_t();return Ri=(n,i,o)=>{let s=null,l=null,u=null;try{u=new t(i,o)}catch{return null}return n.forEach(a=>{u.test(a)&&(!s||l.compare(a)===-1)&&(s=a,l=new e(s,o))}),s},Ri}var $i,Hc;function yy(){if(Hc)return $i;Hc=1;const e=We(),t=_t();return $i=(n,i,o)=>{let s=null,l=null,u=null;try{u=new t(i,o)}catch{return null}return n.forEach(a=>{u.test(a)&&(!s||l.compare(a)===1)&&(s=a,l=new e(s,o))}),s},$i}var Oi,zc;function vy(){if(zc)return Oi;zc=1;const e=We(),t=_t(),r=Nn();return Oi=(i,o)=>{i=new t(i,o);let s=new e("0.0.0");if(i.test(s)||(s=new e("0.0.0-0"),i.test(s)))return s;s=null;for(let l=0;l<i.set.length;++l){const u=i.set[l];let a=null;u.forEach(c=>{const m=new e(c.semver.version);switch(c.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!a||r(m,a))&&(a=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),a&&(!s||r(s,a))&&(s=a)}return s&&i.test(s)?s:null},Oi}var Ii,Wc;function wy(){if(Wc)return Ii;Wc=1;const e=_t();return Ii=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},Ii}var Pi,Xc;function Na(){if(Xc)return Pi;Xc=1;const e=We(),t=Dn(),{ANY:r}=t,n=_t(),i=Mr(),o=Nn(),s=Aa(),l=Ln(),u=Ca();return Pi=(c,m,p,w)=>{c=new e(c,w),m=new n(m,w);let E,d,f,h,y;switch(p){case">":E=o,d=l,f=s,h=">",y=">=";break;case"<":E=s,d=u,f=o,h="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(c,m,w))return!1;for(let v=0;v<m.set.length;++v){const S=m.set[v];let _=null,b=null;if(S.forEach(g=>{g.semver===r&&(g=new t(">=0.0.0")),_=_||g,b=b||g,E(g.semver,_.semver,w)?_=g:f(g.semver,b.semver,w)&&(b=g)}),_.operator===h||_.operator===y||(!b.operator||b.operator===h)&&d(c,b.semver))return!1;if(b.operator===y&&f(c,b.semver))return!1}return!0},Pi}var Ti,Kc;function gy(){if(Kc)return Ti;Kc=1;const e=Na();return Ti=(r,n,i)=>e(r,n,">",i),Ti}var xi,Yc;function _y(){if(Yc)return xi;Yc=1;const e=Na();return xi=(r,n,i)=>e(r,n,"<",i),xi}var Ai,Jc;function Ey(){if(Jc)return Ai;Jc=1;const e=_t();return Ai=(r,n,i)=>(r=new e(r,i),n=new e(n,i),r.intersects(n,i)),Ai}var Ci,Qc;function Sy(){if(Qc)return Ci;Qc=1;const e=Mr(),t=ft();return Ci=(r,n,i)=>{const o=[];let s=null,l=null;const u=r.sort((p,w)=>t(p,w,i));for(const p of u)e(p,n,i)?(l=p,s||(s=p)):(l&&o.push([s,l]),l=null,s=null);s&&o.push([s,null]);const a=[];for(const[p,w]of o)p===w?a.push(p):!w&&p===u[0]?a.push("*"):w?p===u[0]?a.push(`<=${w}`):a.push(`${p} - ${w}`):a.push(`>=${p}`);const c=a.join(" || "),m=typeof n.raw=="string"?n.raw:String(n);return c.length<m.length?c:n},Ci}var Ni,Zc;function by(){if(Zc)return Ni;Zc=1;const e=_t(),t=Dn(),{ANY:r}=t,n=Mr(),i=ft(),o=(m,p,w={})=>{if(m===p)return!0;m=new e(m,w),p=new e(p,w);let E=!1;e:for(const d of m.set){for(const f of p.set){const h=u(d,f,w);if(E=E||h!==null,h)continue e}if(E)return!1}return!0},s=[new t(">=0.0.0-0")],l=[new t(">=0.0.0")],u=(m,p,w)=>{if(m===p)return!0;if(m.length===1&&m[0].semver===r){if(p.length===1&&p[0].semver===r)return!0;w.includePrerelease?m=s:m=l}if(p.length===1&&p[0].semver===r){if(w.includePrerelease)return!0;p=l}const E=new Set;let d,f;for(const $ of m)$.operator===">"||$.operator===">="?d=a(d,$,w):$.operator==="<"||$.operator==="<="?f=c(f,$,w):E.add($.semver);if(E.size>1)return null;let h;if(d&&f){if(h=i(d.semver,f.semver,w),h>0)return null;if(h===0&&(d.operator!==">="||f.operator!=="<="))return null}for(const $ of E){if(d&&!n($,String(d),w)||f&&!n($,String(f),w))return null;for(const I of p)if(!n($,String(I),w))return!1;return!0}let y,v,S,_,b=f&&!w.includePrerelease&&f.semver.prerelease.length?f.semver:!1,g=d&&!w.includePrerelease&&d.semver.prerelease.length?d.semver:!1;b&&b.prerelease.length===1&&f.operator==="<"&&b.prerelease[0]===0&&(b=!1);for(const $ of p){if(_=_||$.operator===">"||$.operator===">=",S=S||$.operator==="<"||$.operator==="<=",d){if(g&&$.semver.prerelease&&$.semver.prerelease.length&&$.semver.major===g.major&&$.semver.minor===g.minor&&$.semver.patch===g.patch&&(g=!1),$.operator===">"||$.operator===">="){if(y=a(d,$,w),y===$&&y!==d)return!1}else if(d.operator===">="&&!n(d.semver,String($),w))return!1}if(f){if(b&&$.semver.prerelease&&$.semver.prerelease.length&&$.semver.major===b.major&&$.semver.minor===b.minor&&$.semver.patch===b.patch&&(b=!1),$.operator==="<"||$.operator==="<="){if(v=c(f,$,w),v===$&&v!==f)return!1}else if(f.operator==="<="&&!n(f.semver,String($),w))return!1}if(!$.operator&&(f||d)&&h!==0)return!1}return!(d&&S&&!f&&h!==0||f&&_&&!d&&h!==0||g||b)},a=(m,p,w)=>{if(!m)return p;const E=i(m.semver,p.semver,w);return E>0?m:E<0||p.operator===">"&&m.operator===">="?p:m},c=(m,p,w)=>{if(!m)return p;const E=i(m.semver,p.semver,w);return E<0?m:E>0||p.operator==="<"&&m.operator==="<="?p:m};return Ni=o,Ni}var Li,eu;function Ry(){if(eu)return Li;eu=1;const e=jr(),t=An(),r=We(),n=bp(),i=vr(),o=Rp(),s=ny(),l=iy(),u=sy(),a=$p(),c=oy(),m=ay(),p=cy(),w=ft(),E=uy(),d=ly(),f=xa(),h=fy(),y=dy(),v=Nn(),S=Aa(),_=Op(),b=Ip(),g=Ca(),$=Ln(),I=Pp(),A=Tp(),M=Dn(),K=_t(),Q=Mr(),x=hy(),T=my(),F=yy(),U=vy(),k=wy(),G=Na(),C=gy(),H=_y(),W=Ey(),re=Sy(),ce=by();return Li={parse:i,valid:o,clean:s,inc:l,diff:u,major:a,minor:c,patch:m,prerelease:p,compare:w,rcompare:E,compareLoose:d,compareBuild:f,sort:h,rsort:y,gt:v,lt:S,eq:_,neq:b,gte:g,lte:$,cmp:I,coerce:A,Comparator:M,Range:K,satisfies:Q,toComparators:x,maxSatisfying:T,minSatisfying:F,minVersion:U,validRange:k,outside:G,gtr:C,ltr:H,intersects:W,simplifyRange:re,subset:ce,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},Li}var Di,tu;function $y(){if(tu)return Di;tu=1;var e=up,t=Ry(),r=it,n=ue,i=je,o=Pa;function s(I,A,M,K){function Q(x){return x instanceof M?x:new M(function(T){T(x)})}return new(M||(M=Promise))(function(x,T){function F(G){try{k(K.next(G))}catch(C){T(C)}}function U(G){try{k(K.throw(G))}catch(C){T(C)}}function k(G){G.done?x(G.value):Q(G.value).then(F,U)}k((K=K.apply(I,[])).next())})}function l(I,A){var M={label:0,sent:function(){if(x[0]&1)throw x[1];return x[1]},trys:[],ops:[]},K,Q,x,T;return T={next:F(0),throw:F(1),return:F(2)},typeof Symbol=="function"&&(T[Symbol.iterator]=function(){return this}),T;function F(k){return function(G){return U([k,G])}}function U(k){if(K)throw new TypeError("Generator is already executing.");for(;T&&(T=0,k[0]&&(M=0)),M;)try{if(K=1,Q&&(x=k[0]&2?Q.return:k[0]?Q.throw||((x=Q.return)&&x.call(Q),0):Q.next)&&!(x=x.call(Q,k[1])).done)return x;switch(Q=0,x&&(k=[k[0]&2,x.value]),k[0]){case 0:case 1:x=k;break;case 4:return M.label++,{value:k[1],done:!1};case 5:M.label++,Q=k[1],k=[0];continue;case 7:k=M.ops.pop(),M.trys.pop();continue;default:if(x=M.trys,!(x=x.length>0&&x[x.length-1])&&(k[0]===6||k[0]===2)){M=0;continue}if(k[0]===3&&(!x||k[1]>x[0]&&k[1]<x[3])){M.label=k[1];break}if(k[0]===6&&M.label<x[1]){M.label=x[1],x=k;break}if(x&&M.label<x[2]){M.label=x[2],M.ops.push(k);break}x[2]&&M.ops.pop(),M.trys.pop();continue}k=A.call(I,M)}catch(G){k=[6,G],Q=0}finally{K=x=0}if(k[0]&5)throw k[1];return{value:k[0]?k[1]:void 0,done:!0}}}var u=e.env.npm_package_json,a=e.env.npm_config_user_agent,c=!!(a&&a.startsWith("npm")),m=!!(u&&u.endsWith("package.json")),p=c||m,w=!!(a&&a.startsWith("yarn")),E=p||w,d=r.homedir(),f=process.env.XDG_CONFIG_HOME||n.join(d,".config","simple-update-notifier"),h=function(I){return n.join(f,"".concat(I.replace("@","").replace("/","__"),".json"))},y=function(){i.existsSync(f)||i.mkdirSync(f,{recursive:!0})},v=function(I){var A=h(I);try{if(!i.existsSync(A))return;var M=JSON.parse(i.readFileSync(A,"utf8"));return M.lastUpdateCheck}catch{return}},S=function(I){var A=h(I);i.writeFileSync(A,JSON.stringify({lastUpdateCheck:new Date().getTime()}))},_=function(I,A){return s(void 0,void 0,void 0,function(){var M;return l(this,function(K){return M="https://registry.npmjs.org/-/package/".concat(I,"/dist-tags"),[2,new Promise(function(Q,x){o.get(M,function(T){var F="";T.on("data",function(U){return F+=U}),T.on("end",function(){try{var U=JSON.parse(F),k=U[A];k||x(new Error("Error getting version")),Q(k)}catch{x(new Error("Could not parse version response"))}})}).on("error",function(T){return x(T)})})]})})},b=function(I){var A=I.pkg,M=I.updateCheckInterval,K=M===void 0?1e3*60*60*24:M,Q=I.distTag,x=Q===void 0?"latest":Q,T=I.alwaysRun,F=I.debug;return s(void 0,void 0,void 0,function(){var U,k;return l(this,function(G){switch(G.label){case 0:return y(),U=v(A.name),T||!U||U<new Date().getTime()-K?[4,_(A.name,x)]:[3,2];case 1:return k=G.sent(),S(A.name),t.gt(k,A.version)?[2,k]:(F&&console.error("Latest version (".concat(k,") not newer than current version (").concat(A.version,")")),[3,3]);case 2:F&&console.error("Too recent to check for a new update. simpleUpdateNotifier() interval set to ".concat(K,"ms but only ").concat(new Date().getTime()-U,"ms since last check.")),G.label=3;case 3:return[2,!1]}})})},g=function(I){for(var A=I.split(`
|
||
`),M=Math.max.apply(Math,A.map(function(F){return F.length})),K=["┌".concat("─".repeat(M+2),"┐")],Q=0,x=A;Q<x.length;Q++){var T=x[Q];K.push("│ ".concat(T.padEnd(M)," │"))}return K.push("└".concat("─".repeat(M+2),"┘")),K.join(`
|
||
`)},$=function(I){return s(void 0,void 0,void 0,function(){var A,M;return l(this,function(K){switch(K.label){case 0:if(!I.alwaysRun&&(!process.stdout.isTTY||E&&!I.shouldNotifyInNpmScript))return I.debug&&console.error("Opting out of running simpleUpdateNotifier()"),[2];K.label=1;case 1:return K.trys.push([1,3,,4]),[4,b(I)];case 2:return A=K.sent(),A&&console.error(g("New version of ".concat(I.pkg.name,` available!
|
||
Current Version: `).concat(I.pkg.version,`
|
||
Latest Version: `).concat(A))),[3,4];case 3:return M=K.sent(),I.debug&&M instanceof Error&&console.error("Unexpected error in simpleUpdateNotifier():",M),[3,4];case 4:return[2]}})})};return Di=$,Di}var Oy=$y();const Iy=$e(Oy),Py="setup-cpp",Ty="1.7.2",La={name:Py,version:Ty};var dt={},Je={},Gt={},ru;function Da(){if(ru)return Gt;ru=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.toCommandProperties=Gt.toCommandValue=void 0;function e(r){return r==null?"":typeof r=="string"||r instanceof String?r:JSON.stringify(r)}Gt.toCommandValue=e;function t(r){return Object.keys(r).length?{title:r.title,file:r.file,line:r.startLine,endLine:r.endLine,col:r.startColumn,endColumn:r.endColumn}:{}}return Gt.toCommandProperties=t,Gt}var nu;function xy(){if(nu)return Je;nu=1;var e=Je&&Je.__createBinding||(Object.create?function(m,p,w,E){E===void 0&&(E=w);var d=Object.getOwnPropertyDescriptor(p,w);(!d||("get"in d?!p.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return p[w]}}),Object.defineProperty(m,E,d)}:function(m,p,w,E){E===void 0&&(E=w),m[E]=p[w]}),t=Je&&Je.__setModuleDefault||(Object.create?function(m,p){Object.defineProperty(m,"default",{enumerable:!0,value:p})}:function(m,p){m.default=p}),r=Je&&Je.__importStar||function(m){if(m&&m.__esModule)return m;var p={};if(m!=null)for(var w in m)w!=="default"&&Object.prototype.hasOwnProperty.call(m,w)&&e(p,m,w);return t(p,m),p};Object.defineProperty(Je,"__esModule",{value:!0}),Je.issue=Je.issueCommand=void 0;const n=r(it),i=Da();function o(m,p,w){const E=new u(m,p,w);process.stdout.write(E.toString()+n.EOL)}Je.issueCommand=o;function s(m,p=""){o(m,{},p)}Je.issue=s;const l="::";class u{constructor(p,w,E){p||(p="missing.command"),this.command=p,this.properties=w,this.message=E}toString(){let p=l+this.command;if(this.properties&&Object.keys(this.properties).length>0){p+=" ";let w=!0;for(const E in this.properties)if(this.properties.hasOwnProperty(E)){const d=this.properties[E];d&&(w?w=!1:p+=",",p+=`${E}=${c(d)}`)}}return p+=`${l}${a(this.message)}`,p}}function a(m){return(0,i.toCommandValue)(m).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function c(m){return(0,i.toCommandValue)(m).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}return Je}var Qe={},iu;function Ay(){if(iu)return Qe;iu=1;var e=Qe&&Qe.__createBinding||(Object.create?function(a,c,m,p){p===void 0&&(p=m);var w=Object.getOwnPropertyDescriptor(c,m);(!w||("get"in w?!c.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return c[m]}}),Object.defineProperty(a,p,w)}:function(a,c,m,p){p===void 0&&(p=m),a[p]=c[m]}),t=Qe&&Qe.__setModuleDefault||(Object.create?function(a,c){Object.defineProperty(a,"default",{enumerable:!0,value:c})}:function(a,c){a.default=c}),r=Qe&&Qe.__importStar||function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var m in a)m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)&&e(c,a,m);return t(c,a),c};Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.prepareKeyValueMessage=Qe.issueFileCommand=void 0;const n=r(mp),i=r(je),o=r(it),s=Da();function l(a,c){const m=process.env[`GITHUB_${a}`];if(!m)throw new Error(`Unable to find environment variable for file command ${a}`);if(!i.existsSync(m))throw new Error(`Missing file at path: ${m}`);i.appendFileSync(m,`${(0,s.toCommandValue)(c)}${o.EOL}`,{encoding:"utf8"})}Qe.issueFileCommand=l;function u(a,c){const m=`ghadelimiter_${n.randomUUID()}`,p=(0,s.toCommandValue)(c);if(a.includes(m))throw new Error(`Unexpected input: name should not contain the delimiter "${m}"`);if(p.includes(m))throw new Error(`Unexpected input: value should not contain the delimiter "${m}"`);return`${a}<<${m}${o.EOL}${p}${o.EOL}${m}`}return Qe.prepareKeyValueMessage=u,Qe}var Vt={};function Ea(e){const t=e.protocol==="https:";if(Cy(e))return;const r=t?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY;if(r)try{return new su(r)}catch{if(!r.startsWith("http://")&&!r.startsWith("https://"))return new su(`http://${r}`)}else return}function Cy(e){if(!e.hostname)return!1;const t=e.hostname;if(Ny(t))return!0;const r=process.env.no_proxy||process.env.NO_PROXY||"";if(!r)return!1;let n;e.port?n=Number(e.port):e.protocol==="http:"?n=80:e.protocol==="https:"&&(n=443);const i=[e.hostname.toUpperCase()];typeof n=="number"&&i.push(`${i[0]}:${n}`);for(const o of r.split(",").map(s=>s.trim().toUpperCase()).filter(s=>s))if(o==="*"||i.some(s=>s===o||s.endsWith(`.${o}`)||o.startsWith(".")&&s.endsWith(`${o}`)))return!0;return!1}function Ny(e){const t=e.toLowerCase();return t==="localhost"||t.startsWith("127.")||t.startsWith("[::1]")||t.startsWith("[0:0:0:0:0:0:0:1]")}class su extends URL{_decodedUsername;_decodedPassword;constructor(t,r){super(t,r),this._decodedUsername=decodeURIComponent(super.username),this._decodedPassword=decodeURIComponent(super.password)}get username(){return this._decodedUsername}get password(){return this._decodedPassword}}var Bt={},ou;function Ly(){if(ou)return Bt;ou=1;var e=qm,t=yp,r=Pa,n=Tn,i=xn;Bt.httpOverHttp=o,Bt.httpsOverHttp=s,Bt.httpOverHttps=l,Bt.httpsOverHttps=u;function o(E){var d=new a(E);return d.request=t.request,d}function s(E){var d=new a(E);return d.request=t.request,d.createSocket=c,d.defaultPort=443,d}function l(E){var d=new a(E);return d.request=r.request,d}function u(E){var d=new a(E);return d.request=r.request,d.createSocket=c,d.defaultPort=443,d}function a(E){var d=this;d.options=E||{},d.proxyOptions=d.options.proxy||{},d.maxSockets=d.options.maxSockets||t.Agent.defaultMaxSockets,d.requests=[],d.sockets=[],d.on("free",function(h,y,v,S){for(var _=m(y,v,S),b=0,g=d.requests.length;b<g;++b){var $=d.requests[b];if($.host===_.host&&$.port===_.port){d.requests.splice(b,1),$.request.onSocket(h);return}}h.destroy(),d.removeSocket(h)})}i.inherits(a,n.EventEmitter),a.prototype.addRequest=function(d,f,h,y){var v=this,S=p({request:d},v.options,m(f,h,y));if(v.sockets.length>=this.maxSockets){v.requests.push(S);return}v.createSocket(S,function(_){_.on("free",b),_.on("close",g),_.on("agentRemove",g),d.onSocket(_);function b(){v.emit("free",_,S)}function g($){v.removeSocket(_),_.removeListener("free",b),_.removeListener("close",g),_.removeListener("agentRemove",g)}})},a.prototype.createSocket=function(d,f){var h=this,y={};h.sockets.push(y);var v=p({},h.proxyOptions,{method:"CONNECT",path:d.host+":"+d.port,agent:!1,headers:{host:d.host+":"+d.port}});d.localAddress&&(v.localAddress=d.localAddress),v.proxyAuth&&(v.headers=v.headers||{},v.headers["Proxy-Authorization"]="Basic "+new Buffer(v.proxyAuth).toString("base64")),w("making CONNECT request");var S=h.request(v);S.useChunkedEncodingByDefault=!1,S.once("response",_),S.once("upgrade",b),S.once("connect",g),S.once("error",$),S.end();function _(I){I.upgrade=!0}function b(I,A,M){process.nextTick(function(){g(I,A,M)})}function g(I,A,M){if(S.removeAllListeners(),A.removeAllListeners(),I.statusCode!==200){w("tunneling socket could not be established, statusCode=%d",I.statusCode),A.destroy();var K=new Error("tunneling socket could not be established, statusCode="+I.statusCode);K.code="ECONNRESET",d.request.emit("error",K),h.removeSocket(y);return}if(M.length>0){w("got illegal response body from proxy"),A.destroy();var K=new Error("got illegal response body from proxy");K.code="ECONNRESET",d.request.emit("error",K),h.removeSocket(y);return}return w("tunneling connection has established"),h.sockets[h.sockets.indexOf(y)]=A,f(A)}function $(I){S.removeAllListeners(),w(`tunneling socket could not be established, cause=%s
|
||
`,I.message,I.stack);var A=new Error("tunneling socket could not be established, cause="+I.message);A.code="ECONNRESET",d.request.emit("error",A),h.removeSocket(y)}},a.prototype.removeSocket=function(d){var f=this.sockets.indexOf(d);if(f!==-1){this.sockets.splice(f,1);var h=this.requests.shift();h&&this.createSocket(h,function(y){h.request.onSocket(y)})}};function c(E,d){var f=this;a.prototype.createSocket.call(f,E,function(h){var y=E.request.getHeader("host"),v=p({},f.options,{socket:h,servername:y?y.replace(/:.*$/,""):E.host}),S=e.connect(0,v);f.sockets[f.sockets.indexOf(h)]=S,d(S)})}function m(E,d,f){return typeof E=="string"?{host:E,port:d,localAddress:f}:E}function p(E){for(var d=1,f=arguments.length;d<f;++d){var h=arguments[d];if(typeof h=="object")for(var y=Object.keys(h),v=0,S=y.length;v<S;++v){var _=y[v];h[_]!==void 0&&(E[_]=h[_])}}return E}var w;return process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?w=function(){var E=Array.prototype.slice.call(arguments);typeof E[0]=="string"?E[0]="TUNNEL: "+E[0]:E.unshift("TUNNEL:"),console.error.apply(console,E)}:w=function(){},Bt.debug=w,Bt}var ki,au;function Dy(){return au||(au=1,ki=Ly()),ki}var zr=Dy(),tt;(function(e){e[e.OK=200]="OK",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.ResourceMoved=302]="ResourceMoved",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.SwitchProxy=306]="SwitchProxy",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.TooManyRequests=429]="TooManyRequests",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout"})(tt||(tt={}));var qe;(function(e){e.Accept="accept",e.ContentType="content-type"})(qe||(qe={}));var Ot;(function(e){e.ApplicationJson="application/json"})(Ot||(Ot={}));function ky(e){const t=Ea(new URL(e));return t?t.href:""}const Fy=[tt.MovedPermanently,tt.ResourceMoved,tt.SeeOther,tt.TemporaryRedirect,tt.PermanentRedirect],qy=[tt.BadGateway,tt.ServiceUnavailable,tt.GatewayTimeout],Uy=["OPTIONS","GET","DELETE","HEAD"],jy=10,My=5;class kn extends Error{constructor(t,r){super(t),this.name="HttpClientError",this.statusCode=r,Object.setPrototypeOf(this,kn.prototype)}statusCode;result}class xp{constructor(t){this.message=t}message;async readBody(){return new Promise(async t=>{let r=Buffer.alloc(0);this.message.on("data",n=>{r=Buffer.concat([r,n])}),this.message.on("end",()=>{t(r.toString())})})}async readBodyBuffer(){return new Promise(async t=>{const r=[];this.message.on("data",n=>{r.push(n)}),this.message.on("end",()=>{t(Buffer.concat(r))})})}}function Gy(e){return new URL(e).protocol==="https:"}class Vy{userAgent;handlers;requestOptions;_ignoreSslError=!1;_socketTimeout;_allowRedirects=!0;_allowRedirectDowngrade=!1;_maxRedirects=50;_allowRetries=!1;_maxRetries=1;_agent;_proxyAgent;_proxyAgentDispatcher;_keepAlive=!1;_disposed=!1;constructor(t,r,n){this.userAgent=t,this.handlers=r||[],this.requestOptions=n,n&&(n.ignoreSslError!=null&&(this._ignoreSslError=n.ignoreSslError),this._socketTimeout=n.socketTimeout,n.allowRedirects!=null&&(this._allowRedirects=n.allowRedirects),n.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=n.allowRedirectDowngrade),n.maxRedirects!=null&&(this._maxRedirects=Math.max(n.maxRedirects,0)),n.keepAlive!=null&&(this._keepAlive=n.keepAlive),n.allowRetries!=null&&(this._allowRetries=n.allowRetries),n.maxRetries!=null&&(this._maxRetries=n.maxRetries))}async options(t,r){return this.request("OPTIONS",t,null,r||{})}async get(t,r){return this.request("GET",t,null,r||{})}async del(t,r){return this.request("DELETE",t,null,r||{})}async post(t,r,n){return this.request("POST",t,r,n||{})}async patch(t,r,n){return this.request("PATCH",t,r,n||{})}async put(t,r,n){return this.request("PUT",t,r,n||{})}async head(t,r){return this.request("HEAD",t,null,r||{})}async sendStream(t,r,n,i){return this.request(t,r,n,i)}async getJson(t,r={}){r[qe.Accept]=this._getExistingOrDefaultHeader(r,qe.Accept,Ot.ApplicationJson);const n=await this.get(t,r);return this._processResponse(n,this.requestOptions)}async postJson(t,r,n={}){const i=JSON.stringify(r,null,2);n[qe.Accept]=this._getExistingOrDefaultHeader(n,qe.Accept,Ot.ApplicationJson),n[qe.ContentType]=this._getExistingOrDefaultHeader(n,qe.ContentType,Ot.ApplicationJson);const o=await this.post(t,i,n);return this._processResponse(o,this.requestOptions)}async putJson(t,r,n={}){const i=JSON.stringify(r,null,2);n[qe.Accept]=this._getExistingOrDefaultHeader(n,qe.Accept,Ot.ApplicationJson),n[qe.ContentType]=this._getExistingOrDefaultHeader(n,qe.ContentType,Ot.ApplicationJson);const o=await this.put(t,i,n);return this._processResponse(o,this.requestOptions)}async patchJson(t,r,n={}){const i=JSON.stringify(r,null,2);n[qe.Accept]=this._getExistingOrDefaultHeader(n,qe.Accept,Ot.ApplicationJson),n[qe.ContentType]=this._getExistingOrDefaultHeader(n,qe.ContentType,Ot.ApplicationJson);const o=await this.patch(t,i,n);return this._processResponse(o,this.requestOptions)}async request(t,r,n,i){if(this._disposed)throw new Error("Client has already been disposed.");const o=new URL(r);let s=this._prepareRequest(t,o,i);const l=this._allowRetries&&Uy.includes(t)?this._maxRetries+1:1;let u=0,a;do{if(a=await this.requestRaw(s,n),a&&a.message&&a.message.statusCode===tt.Unauthorized){let m;for(const p of this.handlers)if(p.canHandleAuthentication(a)){m=p;break}return m?m.handleAuthentication(this,s,n):a}let c=this._maxRedirects;for(;a.message.statusCode&&Fy.includes(a.message.statusCode)&&this._allowRedirects&&c>0;){const m=a.message.headers.location;if(!m)break;const p=new URL(m);if(o.protocol==="https:"&&o.protocol!==p.protocol&&!this._allowRedirectDowngrade)throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");if(await a.readBody(),p.hostname!==o.hostname)for(const w in i)w.toLowerCase()==="authorization"&&delete i[w];s=this._prepareRequest(t,p,i),a=await this.requestRaw(s,n),c--}if(!a.message.statusCode||!qy.includes(a.message.statusCode))return a;u+=1,u<l&&(await a.readBody(),await this._performExponentialBackoff(u))}while(u<l);return a}dispose(){this._agent&&this._agent.destroy(),this._disposed=!0}async requestRaw(t,r){return new Promise((n,i)=>{function o(s,l){s?i(s):l?n(l):i(new Error("Unknown error"))}this.requestRawWithCallback(t,r,o)})}requestRawWithCallback(t,r,n){typeof r=="string"&&(t.options.headers||(t.options.headers={}),t.options.headers["Content-Length"]=Buffer.byteLength(r,"utf8"));let i=!1;function o(u,a){i||(i=!0,n(u,a))}const s=t.httpModule.request(t.options,u=>{const a=new xp(u);o(void 0,a)});let l;s.on("socket",u=>{l=u}),s.setTimeout(this._socketTimeout||3*6e4,()=>{l&&l.end(),o(new Error(`Request timeout: ${t.options.path}`))}),s.on("error",function(u){o(u)}),r&&typeof r=="string"&&s.write(r,"utf8"),r&&typeof r!="string"?(r.on("close",function(){s.end()}),r.pipe(s)):s.end()}getAgent(t){const r=new URL(t);return this._getAgent(r)}async getAgentDispatcher(t){const r=new URL(t),n=Ea(r);if(n&&n.hostname)return await this._getProxyAgentDispatcher(r,n)}_prepareRequest(t,r,n){const i={};i.parsedUrl=r;const o=i.parsedUrl.protocol==="https:";i.httpModule=o?uc:Vn;const s=o?443:80;if(i.options={},i.options.host=i.parsedUrl.hostname,i.options.port=i.parsedUrl.port?parseInt(i.parsedUrl.port):s,i.options.path=(i.parsedUrl.pathname||"")+(i.parsedUrl.search||""),i.options.method=t,i.options.headers=this._mergeHeaders(n),this.userAgent!=null&&(i.options.headers["user-agent"]=this.userAgent),i.options.agent=this._getAgent(i.parsedUrl),this.handlers)for(const l of this.handlers)l.prepareRequest(i.options);return i}_mergeHeaders(t){return this.requestOptions&&this.requestOptions.headers?Object.assign({},Wr(this.requestOptions.headers),Wr(t||{})):Wr(t||{})}_getExistingOrDefaultHeader(t,r,n){let i;return this.requestOptions&&this.requestOptions.headers&&(i=Wr(this.requestOptions.headers)[r]),t[r]||i||n}_getAgent(t){let r;const n=Ea(t),i=n&&n.hostname;if(this._keepAlive&&i&&(r=this._proxyAgent),i||(r=this._agent),r)return r;const o=t.protocol==="https:";let s=100;if(this.requestOptions&&(s=this.requestOptions.maxSockets||Vn.globalAgent.maxSockets),n&&n.hostname){const l={maxSockets:s,keepAlive:this._keepAlive,proxy:{...(n.username||n.password)&&{proxyAuth:`${n.username}:${n.password}`},host:n.hostname,port:n.port}};let u;const a=n.protocol==="https:";o?u=a?zr.httpsOverHttps:zr.httpsOverHttp:u=a?zr.httpOverHttps:zr.httpOverHttp,r=u(l),this._proxyAgent=r}if(!r){const l={keepAlive:this._keepAlive,maxSockets:s};r=o?new uc.Agent(l):new Vn.Agent(l),this._agent=r}return o&&this._ignoreSslError&&(r.options=Object.assign(r.options||{},{rejectUnauthorized:!1})),r}async _getProxyAgentDispatcher(t,r){let n;if(this._keepAlive&&(n=this._proxyAgentDispatcher),n)return n;const i=t.protocol==="https:",o=await import("./assets/proxy-agent-DbKVJOmt.mjs").then(s=>s.p);return n=new o({uri:r.href,pipelining:this._keepAlive?1:0,...(r.username||r.password)&&{token:`Basic ${Buffer.from(`${r.username}:${r.password}`).toString("base64")}`}}),this._proxyAgentDispatcher=n,i&&this._ignoreSslError&&(n.options=Object.assign(n.options.requestTls||{},{rejectUnauthorized:!1})),n}async _performExponentialBackoff(t){t=Math.min(jy,t);const r=My*Math.pow(2,t);return new Promise(n=>setTimeout(()=>n(),r))}async _processResponse(t,r){return new Promise(async(n,i)=>{const o=t.message.statusCode||0,s={statusCode:o,result:null,headers:{}};o===tt.NotFound&&n(s);function l(c,m){if(typeof m=="string"){const p=new Date(m);if(!isNaN(p.valueOf()))return p}return m}let u,a;try{a=await t.readBody(),a&&a.length>0&&(r&&r.deserializeDates?u=JSON.parse(a,l):u=JSON.parse(a),s.result=u),s.headers=t.message.headers}catch{}if(o>299){let c;u&&u.message?c=u.message:a&&a.length>0?c=a:c=`Failed request: (${o})`;const m=new kn(c,o);m.result=s.result,i(m)}else n(s)})}}const Wr=e=>Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{}),By=Object.freeze(Object.defineProperty({__proto__:null,get Headers(){return qe},HttpClient:Vy,HttpClientError:kn,HttpClientResponse:xp,get HttpCodes(){return tt},get MediaTypes(){return Ot},getProxyUrl:ky,isHttps:Gy},Symbol.toStringTag,{value:"Module"})),Ap=ry(By);var pt={},cu;function Hy(){if(cu)return pt;cu=1;var e=pt&&pt.__awaiter||function(i,o,s,l){function u(a){return a instanceof s?a:new s(function(c){c(a)})}return new(s||(s=Promise))(function(a,c){function m(E){try{w(l.next(E))}catch(d){c(d)}}function p(E){try{w(l.throw(E))}catch(d){c(d)}}function w(E){E.done?a(E.value):u(E.value).then(m,p)}w((l=l.apply(i,o||[])).next())})};Object.defineProperty(pt,"__esModule",{value:!0}),pt.PersonalAccessTokenCredentialHandler=pt.BearerCredentialHandler=pt.BasicCredentialHandler=void 0;class t{constructor(o,s){this.username=o,this.password=s}prepareRequest(o){if(!o.headers)throw Error("The request has no headers");o.headers.Authorization=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return!1}handleAuthentication(){return e(this,void 0,void 0,function*(){throw new Error("not implemented")})}}pt.BasicCredentialHandler=t;class r{constructor(o){this.token=o}prepareRequest(o){if(!o.headers)throw Error("The request has no headers");o.headers.Authorization=`Bearer ${this.token}`}canHandleAuthentication(){return!1}handleAuthentication(){return e(this,void 0,void 0,function*(){throw new Error("not implemented")})}}pt.BearerCredentialHandler=r;class n{constructor(o){this.token=o}prepareRequest(o){if(!o.headers)throw Error("The request has no headers");o.headers.Authorization=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return!1}handleAuthentication(){return e(this,void 0,void 0,function*(){throw new Error("not implemented")})}}return pt.PersonalAccessTokenCredentialHandler=n,pt}var uu;function zy(){if(uu)return Vt;uu=1;var e=Vt&&Vt.__awaiter||function(o,s,l,u){function a(c){return c instanceof l?c:new l(function(m){m(c)})}return new(l||(l=Promise))(function(c,m){function p(d){try{E(u.next(d))}catch(f){m(f)}}function w(d){try{E(u.throw(d))}catch(f){m(f)}}function E(d){d.done?c(d.value):a(d.value).then(p,w)}E((u=u.apply(o,s||[])).next())})};Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.OidcClient=void 0;const t=Ap,r=Hy(),n=wr();class i{static createHttpClient(s=!0,l=10){const u={allowRetries:s,maxRetries:l};return new t.HttpClient("actions/oidc-client",[new r.BearerCredentialHandler(i.getRequestToken())],u)}static getRequestToken(){const s=process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;if(!s)throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable");return s}static getIDTokenUrl(){const s=process.env.ACTIONS_ID_TOKEN_REQUEST_URL;if(!s)throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable");return s}static getCall(s){var l;return e(this,void 0,void 0,function*(){const c=(l=(yield i.createHttpClient().getJson(s).catch(m=>{throw new Error(`Failed to get ID Token.
|
||
|
||
Error Code : ${m.statusCode}
|
||
|
||
Error Message: ${m.message}`)})).result)===null||l===void 0?void 0:l.value;if(!c)throw new Error("Response json body do not have ID Token field");return c})}static getIDToken(s){return e(this,void 0,void 0,function*(){try{let l=i.getIDTokenUrl();if(s){const a=encodeURIComponent(s);l=`${l}&audience=${a}`}(0,n.debug)(`ID token url is ${l}`);const u=yield i.getCall(l);return(0,n.setSecret)(u),u}catch(l){throw new Error(`Error message: ${l.message}`)}})}}return Vt.OidcClient=i,Vt}var Ir={},lu;function fu(){return lu||(lu=1,function(e){var t=Ir&&Ir.__awaiter||function(a,c,m,p){function w(E){return E instanceof m?E:new m(function(d){d(E)})}return new(m||(m=Promise))(function(E,d){function f(v){try{y(p.next(v))}catch(S){d(S)}}function h(v){try{y(p.throw(v))}catch(S){d(S)}}function y(v){v.done?E(v.value):w(v.value).then(f,h)}y((p=p.apply(a,c||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.summary=e.markdownSummary=e.SUMMARY_DOCS_URL=e.SUMMARY_ENV_VAR=void 0;const r=it,n=je,{access:i,appendFile:o,writeFile:s}=n.promises;e.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY",e.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";class l{constructor(){this._buffer=""}filePath(){return t(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;const c=process.env[e.SUMMARY_ENV_VAR];if(!c)throw new Error(`Unable to find environment variable for $${e.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield i(c,n.constants.R_OK|n.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${c}'. Check if the file has correct read/write permissions.`)}return this._filePath=c,this._filePath})}wrap(c,m,p={}){const w=Object.entries(p).map(([E,d])=>` ${E}="${d}"`).join("");return m?`<${c}${w}>${m}</${c}>`:`<${c}${w}>`}write(c){return t(this,void 0,void 0,function*(){const m=!!c?.overwrite,p=yield this.filePath();return yield(m?s:o)(p,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return t(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(c,m=!1){return this._buffer+=c,m?this.addEOL():this}addEOL(){return this.addRaw(r.EOL)}addCodeBlock(c,m){const p=Object.assign({},m&&{lang:m}),w=this.wrap("pre",this.wrap("code",c),p);return this.addRaw(w).addEOL()}addList(c,m=!1){const p=m?"ol":"ul",w=c.map(d=>this.wrap("li",d)).join(""),E=this.wrap(p,w);return this.addRaw(E).addEOL()}addTable(c){const m=c.map(w=>{const E=w.map(d=>{if(typeof d=="string")return this.wrap("td",d);const{header:f,data:h,colspan:y,rowspan:v}=d,S=f?"th":"td",_=Object.assign(Object.assign({},y&&{colspan:y}),v&&{rowspan:v});return this.wrap(S,h,_)}).join("");return this.wrap("tr",E)}).join(""),p=this.wrap("table",m);return this.addRaw(p).addEOL()}addDetails(c,m){const p=this.wrap("details",this.wrap("summary",c)+m);return this.addRaw(p).addEOL()}addImage(c,m,p){const{width:w,height:E}=p||{},d=Object.assign(Object.assign({},w&&{width:w}),E&&{height:E}),f=this.wrap("img",null,Object.assign({src:c,alt:m},d));return this.addRaw(f).addEOL()}addHeading(c,m){const p=`h${m}`,w=["h1","h2","h3","h4","h5","h6"].includes(p)?p:"h1",E=this.wrap(w,c);return this.addRaw(E).addEOL()}addSeparator(){const c=this.wrap("hr",null);return this.addRaw(c).addEOL()}addBreak(){const c=this.wrap("br",null);return this.addRaw(c).addEOL()}addQuote(c,m){const p=Object.assign({},m&&{cite:m}),w=this.wrap("blockquote",c,p);return this.addRaw(w).addEOL()}addLink(c,m){const p=this.wrap("a",c,{href:m});return this.addRaw(p).addEOL()}}const u=new l;e.markdownSummary=u,e.summary=u}(Ir)),Ir}var Ve={},du;function Wy(){if(du)return Ve;du=1;var e=Ve&&Ve.__createBinding||(Object.create?function(l,u,a,c){c===void 0&&(c=a);var m=Object.getOwnPropertyDescriptor(u,a);(!m||("get"in m?!u.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return u[a]}}),Object.defineProperty(l,c,m)}:function(l,u,a,c){c===void 0&&(c=a),l[c]=u[a]}),t=Ve&&Ve.__setModuleDefault||(Object.create?function(l,u){Object.defineProperty(l,"default",{enumerable:!0,value:u})}:function(l,u){l.default=u}),r=Ve&&Ve.__importStar||function(l){if(l&&l.__esModule)return l;var u={};if(l!=null)for(var a in l)a!=="default"&&Object.prototype.hasOwnProperty.call(l,a)&&e(u,l,a);return t(u,l),u};Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.toPlatformPath=Ve.toWin32Path=Ve.toPosixPath=void 0;const n=r(ue);function i(l){return l.replace(/[\\]/g,"/")}Ve.toPosixPath=i;function o(l){return l.replace(/[/]/g,"\\")}Ve.toWin32Path=o;function s(l){return l.replace(/[/\\]/g,n.sep)}return Ve.toPlatformPath=s,Ve}var Ze={},Be={},He={},Se={},ht={},pu;function Cp(){return pu||(pu=1,function(e){var t=ht&&ht.__createBinding||(Object.create?function(d,f,h,y){y===void 0&&(y=h),Object.defineProperty(d,y,{enumerable:!0,get:function(){return f[h]}})}:function(d,f,h,y){y===void 0&&(y=h),d[y]=f[h]}),r=ht&&ht.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),n=ht&&ht.__importStar||function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h in d)h!=="default"&&Object.hasOwnProperty.call(d,h)&&t(f,d,h);return r(f,d),f},i=ht&&ht.__awaiter||function(d,f,h,y){function v(S){return S instanceof h?S:new h(function(_){_(S)})}return new(h||(h=Promise))(function(S,_){function b(I){try{$(y.next(I))}catch(A){_(A)}}function g(I){try{$(y.throw(I))}catch(A){_(A)}}function $(I){I.done?S(I.value):v(I.value).then(b,g)}$((y=y.apply(d,f||[])).next())})},o;Object.defineProperty(e,"__esModule",{value:!0}),e.getCmdPath=e.tryGetExecutablePath=e.isRooted=e.isDirectory=e.exists=e.READONLY=e.UV_FS_O_EXLOCK=e.IS_WINDOWS=e.unlink=e.symlink=e.stat=e.rmdir=e.rm=e.rename=e.readlink=e.readdir=e.open=e.mkdir=e.lstat=e.copyFile=e.chmod=void 0;const s=n(je),l=n(ue);o=s.promises,e.chmod=o.chmod,e.copyFile=o.copyFile,e.lstat=o.lstat,e.mkdir=o.mkdir,e.open=o.open,e.readdir=o.readdir,e.readlink=o.readlink,e.rename=o.rename,e.rm=o.rm,e.rmdir=o.rmdir,e.stat=o.stat,e.symlink=o.symlink,e.unlink=o.unlink,e.IS_WINDOWS=process.platform==="win32",e.UV_FS_O_EXLOCK=268435456,e.READONLY=s.constants.O_RDONLY;function u(d){return i(this,void 0,void 0,function*(){try{yield e.stat(d)}catch(f){if(f.code==="ENOENT")return!1;throw f}return!0})}e.exists=u;function a(d,f=!1){return i(this,void 0,void 0,function*(){return(f?yield e.stat(d):yield e.lstat(d)).isDirectory()})}e.isDirectory=a;function c(d){if(d=p(d),!d)throw new Error('isRooted() parameter "p" cannot be empty');return e.IS_WINDOWS?d.startsWith("\\")||/^[A-Z]:/i.test(d):d.startsWith("/")}e.isRooted=c;function m(d,f){return i(this,void 0,void 0,function*(){let h;try{h=yield e.stat(d)}catch(v){v.code!=="ENOENT"&&console.log(`Unexpected error attempting to determine if executable file exists '${d}': ${v}`)}if(h&&h.isFile()){if(e.IS_WINDOWS){const v=l.extname(d).toUpperCase();if(f.some(S=>S.toUpperCase()===v))return d}else if(w(h))return d}const y=d;for(const v of f){d=y+v,h=void 0;try{h=yield e.stat(d)}catch(S){S.code!=="ENOENT"&&console.log(`Unexpected error attempting to determine if executable file exists '${d}': ${S}`)}if(h&&h.isFile()){if(e.IS_WINDOWS){try{const S=l.dirname(d),_=l.basename(d).toUpperCase();for(const b of yield e.readdir(S))if(_===b.toUpperCase()){d=l.join(S,b);break}}catch(S){console.log(`Unexpected error attempting to determine the actual case of the file '${d}': ${S}`)}return d}else if(w(h))return d}}return""})}e.tryGetExecutablePath=m;function p(d){return d=d||"",e.IS_WINDOWS?(d=d.replace(/\//g,"\\"),d.replace(/\\\\+/g,"\\")):d.replace(/\/\/+/g,"/")}function w(d){return(d.mode&1)>0||(d.mode&8)>0&&d.gid===process.getgid()||(d.mode&64)>0&&d.uid===process.getuid()}function E(){var d;return(d=process.env.COMSPEC)!==null&&d!==void 0?d:"cmd.exe"}e.getCmdPath=E}(ht)),ht}var hu;function Np(){if(hu)return Se;hu=1;var e=Se&&Se.__createBinding||(Object.create?function(f,h,y,v){v===void 0&&(v=y),Object.defineProperty(f,v,{enumerable:!0,get:function(){return h[y]}})}:function(f,h,y,v){v===void 0&&(v=y),f[v]=h[y]}),t=Se&&Se.__setModuleDefault||(Object.create?function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}:function(f,h){f.default=h}),r=Se&&Se.__importStar||function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var y in f)y!=="default"&&Object.hasOwnProperty.call(f,y)&&e(h,f,y);return t(h,f),h},n=Se&&Se.__awaiter||function(f,h,y,v){function S(_){return _ instanceof y?_:new y(function(b){b(_)})}return new(y||(y=Promise))(function(_,b){function g(A){try{I(v.next(A))}catch(M){b(M)}}function $(A){try{I(v.throw(A))}catch(M){b(M)}}function I(A){A.done?_(A.value):S(A.value).then(g,$)}I((v=v.apply(f,h||[])).next())})};Object.defineProperty(Se,"__esModule",{value:!0}),Se.findInPath=Se.which=Se.mkdirP=Se.rmRF=Se.mv=Se.cp=void 0;const i=qr,o=r(ue),s=r(Cp());function l(f,h,y={}){return n(this,void 0,void 0,function*(){const{force:v,recursive:S,copySourceDirectory:_}=w(y),b=(yield s.exists(h))?yield s.stat(h):null;if(b&&b.isFile()&&!v)return;const g=b&&b.isDirectory()&&_?o.join(h,o.basename(f)):h;if(!(yield s.exists(f)))throw new Error(`no such file or directory: ${f}`);if((yield s.stat(f)).isDirectory())if(S)yield E(f,g,0,v);else throw new Error(`Failed to copy. ${f} is a directory, but tried to copy without recursive flag.`);else{if(o.relative(f,g)==="")throw new Error(`'${g}' and '${f}' are the same file`);yield d(f,g,v)}})}Se.cp=l;function u(f,h,y={}){return n(this,void 0,void 0,function*(){if(yield s.exists(h)){let v=!0;if((yield s.isDirectory(h))&&(h=o.join(h,o.basename(f)),v=yield s.exists(h)),v)if(y.force==null||y.force)yield a(h);else throw new Error("Destination already exists")}yield c(o.dirname(h)),yield s.rename(f,h)})}Se.mv=u;function a(f){return n(this,void 0,void 0,function*(){if(s.IS_WINDOWS&&/[*"<>|]/.test(f))throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');try{yield s.rm(f,{force:!0,maxRetries:3,recursive:!0,retryDelay:300})}catch(h){throw new Error(`File was unable to be removed ${h}`)}})}Se.rmRF=a;function c(f){return n(this,void 0,void 0,function*(){i.ok(f,"a path argument must be provided"),yield s.mkdir(f,{recursive:!0})})}Se.mkdirP=c;function m(f,h){return n(this,void 0,void 0,function*(){if(!f)throw new Error("parameter 'tool' is required");if(h){const v=yield m(f,!1);if(!v)throw s.IS_WINDOWS?new Error(`Unable to locate executable file: ${f}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`):new Error(`Unable to locate executable file: ${f}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);return v}const y=yield p(f);return y&&y.length>0?y[0]:""})}Se.which=m;function p(f){return n(this,void 0,void 0,function*(){if(!f)throw new Error("parameter 'tool' is required");const h=[];if(s.IS_WINDOWS&&process.env.PATHEXT)for(const S of process.env.PATHEXT.split(o.delimiter))S&&h.push(S);if(s.isRooted(f)){const S=yield s.tryGetExecutablePath(f,h);return S?[S]:[]}if(f.includes(o.sep))return[];const y=[];if(process.env.PATH)for(const S of process.env.PATH.split(o.delimiter))S&&y.push(S);const v=[];for(const S of y){const _=yield s.tryGetExecutablePath(o.join(S,f),h);_&&v.push(_)}return v})}Se.findInPath=p;function w(f){const h=f.force==null?!0:f.force,y=!!f.recursive,v=f.copySourceDirectory==null?!0:!!f.copySourceDirectory;return{force:h,recursive:y,copySourceDirectory:v}}function E(f,h,y,v){return n(this,void 0,void 0,function*(){if(y>=255)return;y++,yield c(h);const S=yield s.readdir(f);for(const _ of S){const b=`${f}/${_}`,g=`${h}/${_}`;(yield s.lstat(b)).isDirectory()?yield E(b,g,y,v):yield d(b,g,v)}yield s.chmod(h,(yield s.stat(f)).mode)})}function d(f,h,y){return n(this,void 0,void 0,function*(){if((yield s.lstat(f)).isSymbolicLink()){try{yield s.lstat(h),yield s.unlink(h)}catch(S){S.code==="EPERM"&&(yield s.chmod(h,"0666"),yield s.unlink(h))}const v=yield s.readlink(f);yield s.symlink(v,h,s.IS_WINDOWS?"junction":null)}else(!(yield s.exists(h))||y)&&(yield s.copyFile(f,h))})}return Se}var mu;function Xy(){if(mu)return He;mu=1;var e=He&&He.__createBinding||(Object.create?function(d,f,h,y){y===void 0&&(y=h),Object.defineProperty(d,y,{enumerable:!0,get:function(){return f[h]}})}:function(d,f,h,y){y===void 0&&(y=h),d[y]=f[h]}),t=He&&He.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=He&&He.__importStar||function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var h in d)h!=="default"&&Object.hasOwnProperty.call(d,h)&&e(f,d,h);return t(f,d),f},n=He&&He.__awaiter||function(d,f,h,y){function v(S){return S instanceof h?S:new h(function(_){_(S)})}return new(h||(h=Promise))(function(S,_){function b(I){try{$(y.next(I))}catch(A){_(A)}}function g(I){try{$(y.throw(I))}catch(A){_(A)}}function $(I){I.done?S(I.value):v(I.value).then(b,g)}$((y=y.apply(d,f||[])).next())})};Object.defineProperty(He,"__esModule",{value:!0}),He.argStringToArray=He.ToolRunner=void 0;const i=r(it),o=r(Tn),s=r(Fr),l=r(ue),u=r(Np()),a=r(Cp()),c=jm,m=process.platform==="win32";class p extends o.EventEmitter{constructor(f,h,y){if(super(),!f)throw new Error("Parameter 'toolPath' cannot be null or empty.");this.toolPath=f,this.args=h||[],this.options=y||{}}_debug(f){this.options.listeners&&this.options.listeners.debug&&this.options.listeners.debug(f)}_getCommandString(f,h){const y=this._getSpawnFileName(),v=this._getSpawnArgs(f);let S=h?"":"[command]";if(m)if(this._isCmdFile()){S+=y;for(const _ of v)S+=` ${_}`}else if(f.windowsVerbatimArguments){S+=`"${y}"`;for(const _ of v)S+=` ${_}`}else{S+=this._windowsQuoteCmdArg(y);for(const _ of v)S+=` ${this._windowsQuoteCmdArg(_)}`}else{S+=y;for(const _ of v)S+=` ${_}`}return S}_processLineBuffer(f,h,y){try{let v=h+f.toString(),S=v.indexOf(i.EOL);for(;S>-1;){const _=v.substring(0,S);y(_),v=v.substring(S+i.EOL.length),S=v.indexOf(i.EOL)}return v}catch(v){return this._debug(`error processing line. Failed with error ${v}`),""}}_getSpawnFileName(){return m&&this._isCmdFile()?process.env.COMSPEC||"cmd.exe":this.toolPath}_getSpawnArgs(f){if(m&&this._isCmdFile()){let h=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(const y of this.args)h+=" ",h+=f.windowsVerbatimArguments?y:this._windowsQuoteCmdArg(y);return h+='"',[h]}return this.args}_endsWith(f,h){return f.endsWith(h)}_isCmdFile(){const f=this.toolPath.toUpperCase();return this._endsWith(f,".CMD")||this._endsWith(f,".BAT")}_windowsQuoteCmdArg(f){if(!this._isCmdFile())return this._uvQuoteCmdArg(f);if(!f)return'""';const h=[" "," ","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'];let y=!1;for(const _ of f)if(h.some(b=>b===_)){y=!0;break}if(!y)return f;let v='"',S=!0;for(let _=f.length;_>0;_--)v+=f[_-1],S&&f[_-1]==="\\"?v+="\\":f[_-1]==='"'?(S=!0,v+='"'):S=!1;return v+='"',v.split("").reverse().join("")}_uvQuoteCmdArg(f){if(!f)return'""';if(!f.includes(" ")&&!f.includes(" ")&&!f.includes('"'))return f;if(!f.includes('"')&&!f.includes("\\"))return`"${f}"`;let h='"',y=!0;for(let v=f.length;v>0;v--)h+=f[v-1],y&&f[v-1]==="\\"?h+="\\":f[v-1]==='"'?(y=!0,h+="\\"):y=!1;return h+='"',h.split("").reverse().join("")}_cloneExecOptions(f){f=f||{};const h={cwd:f.cwd||process.cwd(),env:f.env||process.env,silent:f.silent||!1,windowsVerbatimArguments:f.windowsVerbatimArguments||!1,failOnStdErr:f.failOnStdErr||!1,ignoreReturnCode:f.ignoreReturnCode||!1,delay:f.delay||1e4};return h.outStream=f.outStream||process.stdout,h.errStream=f.errStream||process.stderr,h}_getSpawnOptions(f,h){f=f||{};const y={};return y.cwd=f.cwd,y.env=f.env,y.windowsVerbatimArguments=f.windowsVerbatimArguments||this._isCmdFile(),f.windowsVerbatimArguments&&(y.argv0=`"${h}"`),y}exec(){return n(this,void 0,void 0,function*(){return!a.isRooted(this.toolPath)&&(this.toolPath.includes("/")||m&&this.toolPath.includes("\\"))&&(this.toolPath=l.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),this.toolPath=yield u.which(this.toolPath,!0),new Promise((f,h)=>n(this,void 0,void 0,function*(){this._debug(`exec tool: ${this.toolPath}`),this._debug("arguments:");for(const $ of this.args)this._debug(` ${$}`);const y=this._cloneExecOptions(this.options);!y.silent&&y.outStream&&y.outStream.write(this._getCommandString(y)+i.EOL);const v=new E(y,this.toolPath);if(v.on("debug",$=>{this._debug($)}),this.options.cwd&&!(yield a.exists(this.options.cwd)))return h(new Error(`The cwd: ${this.options.cwd} does not exist!`));const S=this._getSpawnFileName(),_=s.spawn(S,this._getSpawnArgs(y),this._getSpawnOptions(this.options,S));let b="";_.stdout&&_.stdout.on("data",$=>{this.options.listeners&&this.options.listeners.stdout&&this.options.listeners.stdout($),!y.silent&&y.outStream&&y.outStream.write($),b=this._processLineBuffer($,b,I=>{this.options.listeners&&this.options.listeners.stdline&&this.options.listeners.stdline(I)})});let g="";if(_.stderr&&_.stderr.on("data",$=>{v.processStderr=!0,this.options.listeners&&this.options.listeners.stderr&&this.options.listeners.stderr($),!y.silent&&y.errStream&&y.outStream&&(y.failOnStdErr?y.errStream:y.outStream).write($),g=this._processLineBuffer($,g,I=>{this.options.listeners&&this.options.listeners.errline&&this.options.listeners.errline(I)})}),_.on("error",$=>{v.processError=$.message,v.processExited=!0,v.processClosed=!0,v.CheckComplete()}),_.on("exit",$=>{v.processExitCode=$,v.processExited=!0,this._debug(`Exit code ${$} received from tool '${this.toolPath}'`),v.CheckComplete()}),_.on("close",$=>{v.processExitCode=$,v.processExited=!0,v.processClosed=!0,this._debug(`STDIO streams have closed for tool '${this.toolPath}'`),v.CheckComplete()}),v.on("done",($,I)=>{b.length>0&&this.emit("stdline",b),g.length>0&&this.emit("errline",g),_.removeAllListeners(),$?h($):f(I)}),this.options.input){if(!_.stdin)throw new Error("child process missing stdin");_.stdin.end(this.options.input)}}))})}}He.ToolRunner=p;function w(d){const f=[];let h=!1,y=!1,v="";function S(_){y&&_!=='"'&&(v+="\\"),v+=_,y=!1}for(let _=0;_<d.length;_++){const b=d.charAt(_);if(b==='"'){y?S(b):h=!h;continue}if(b==="\\"&&y){S(b);continue}if(b==="\\"&&h){y=!0;continue}if(b===" "&&!h){v.length>0&&(f.push(v),v="");continue}S(b)}return v.length>0&&f.push(v.trim()),f}He.argStringToArray=w;class E extends o.EventEmitter{constructor(f,h){if(super(),this.processClosed=!1,this.processError="",this.processExitCode=0,this.processExited=!1,this.processStderr=!1,this.delay=1e4,this.done=!1,this.timeout=null,!h)throw new Error("toolPath must not be empty");this.options=f,this.toolPath=h,f.delay&&(this.delay=f.delay)}CheckComplete(){this.done||(this.processClosed?this._setResult():this.processExited&&(this.timeout=c.setTimeout(E.HandleTimeout,this.delay,this)))}_debug(f){this.emit("debug",f)}_setResult(){let f;this.processExited&&(this.processError?f=new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`):this.processExitCode!==0&&!this.options.ignoreReturnCode?f=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`):this.processStderr&&this.options.failOnStdErr&&(f=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`))),this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.done=!0,this.emit("done",f,this.processExitCode)}static HandleTimeout(f){if(!f.done){if(!f.processClosed&&f.processExited){const h=`The STDIO streams did not close within ${f.delay/1e3} seconds of the exit event from process '${f.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;f._debug(h)}f._setResult()}}}return He}var yu;function ka(){if(yu)return Be;yu=1;var e=Be&&Be.__createBinding||(Object.create?function(u,a,c,m){m===void 0&&(m=c),Object.defineProperty(u,m,{enumerable:!0,get:function(){return a[c]}})}:function(u,a,c,m){m===void 0&&(m=c),u[m]=a[c]}),t=Be&&Be.__setModuleDefault||(Object.create?function(u,a){Object.defineProperty(u,"default",{enumerable:!0,value:a})}:function(u,a){u.default=a}),r=Be&&Be.__importStar||function(u){if(u&&u.__esModule)return u;var a={};if(u!=null)for(var c in u)c!=="default"&&Object.hasOwnProperty.call(u,c)&&e(a,u,c);return t(a,u),a},n=Be&&Be.__awaiter||function(u,a,c,m){function p(w){return w instanceof c?w:new c(function(E){E(w)})}return new(c||(c=Promise))(function(w,E){function d(y){try{h(m.next(y))}catch(v){E(v)}}function f(y){try{h(m.throw(y))}catch(v){E(v)}}function h(y){y.done?w(y.value):p(y.value).then(d,f)}h((m=m.apply(u,a||[])).next())})};Object.defineProperty(Be,"__esModule",{value:!0}),Be.getExecOutput=Be.exec=void 0;const i=Um,o=r(Xy());function s(u,a,c){return n(this,void 0,void 0,function*(){const m=o.argStringToArray(u);if(m.length===0)throw new Error("Parameter 'commandLine' cannot be null or empty.");const p=m[0];return a=m.slice(1).concat(a||[]),new o.ToolRunner(p,a,c).exec()})}Be.exec=s;function l(u,a,c){var m,p;return n(this,void 0,void 0,function*(){let w="",E="";const d=new i.StringDecoder("utf8"),f=new i.StringDecoder("utf8"),h=(m=c?.listeners)===null||m===void 0?void 0:m.stdout,y=(p=c?.listeners)===null||p===void 0?void 0:p.stderr,v=g=>{E+=f.write(g),y&&y(g)},S=g=>{w+=d.write(g),h&&h(g)},_=Object.assign(Object.assign({},c?.listeners),{stdout:S,stderr:v}),b=yield s(u,a,Object.assign(Object.assign({},c),{listeners:_}));return w+=d.end(),E+=f.end(),{exitCode:b,stdout:w,stderr:E}})}return Be.getExecOutput=l,Be}var vu;function Ky(){return vu||(vu=1,function(e){var t=Ze&&Ze.__createBinding||(Object.create?function(p,w,E,d){d===void 0&&(d=E);var f=Object.getOwnPropertyDescriptor(w,E);(!f||("get"in f?!w.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return w[E]}}),Object.defineProperty(p,d,f)}:function(p,w,E,d){d===void 0&&(d=E),p[d]=w[E]}),r=Ze&&Ze.__setModuleDefault||(Object.create?function(p,w){Object.defineProperty(p,"default",{enumerable:!0,value:w})}:function(p,w){p.default=w}),n=Ze&&Ze.__importStar||function(p){if(p&&p.__esModule)return p;var w={};if(p!=null)for(var E in p)E!=="default"&&Object.prototype.hasOwnProperty.call(p,E)&&t(w,p,E);return r(w,p),w},i=Ze&&Ze.__awaiter||function(p,w,E,d){function f(h){return h instanceof E?h:new E(function(y){y(h)})}return new(E||(E=Promise))(function(h,y){function v(b){try{_(d.next(b))}catch(g){y(g)}}function S(b){try{_(d.throw(b))}catch(g){y(g)}}function _(b){b.done?h(b.value):f(b.value).then(v,S)}_((d=d.apply(p,w||[])).next())})},o=Ze&&Ze.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.getDetails=e.isLinux=e.isMacOS=e.isWindows=e.arch=e.platform=void 0;const s=o(it),l=n(ka()),u=()=>i(void 0,void 0,void 0,function*(){const{stdout:p}=yield l.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"',void 0,{silent:!0}),{stdout:w}=yield l.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"',void 0,{silent:!0});return{name:w.trim(),version:p.trim()}}),a=()=>i(void 0,void 0,void 0,function*(){var p,w,E,d;const{stdout:f}=yield l.getExecOutput("sw_vers",void 0,{silent:!0}),h=(w=(p=f.match(/ProductVersion:\s*(.+)/))===null||p===void 0?void 0:p[1])!==null&&w!==void 0?w:"";return{name:(d=(E=f.match(/ProductName:\s*(.+)/))===null||E===void 0?void 0:E[1])!==null&&d!==void 0?d:"",version:h}}),c=()=>i(void 0,void 0,void 0,function*(){const{stdout:p}=yield l.getExecOutput("lsb_release",["-i","-r","-s"],{silent:!0}),[w,E]=p.trim().split(`
|
||
`);return{name:w,version:E}});e.platform=s.default.platform(),e.arch=s.default.arch(),e.isWindows=e.platform==="win32",e.isMacOS=e.platform==="darwin",e.isLinux=e.platform==="linux";function m(){return i(this,void 0,void 0,function*(){return Object.assign(Object.assign({},yield e.isWindows?u():e.isMacOS?a():c()),{platform:e.platform,arch:e.arch,isWindows:e.isWindows,isMacOS:e.isMacOS,isLinux:e.isLinux})})}e.getDetails=m}(Ze)),Ze}var wu;function wr(){return wu||(wu=1,function(e){var t=dt&&dt.__createBinding||(Object.create?function(C,H,W,re){re===void 0&&(re=W);var ce=Object.getOwnPropertyDescriptor(H,W);(!ce||("get"in ce?!H.__esModule:ce.writable||ce.configurable))&&(ce={enumerable:!0,get:function(){return H[W]}}),Object.defineProperty(C,re,ce)}:function(C,H,W,re){re===void 0&&(re=W),C[re]=H[W]}),r=dt&&dt.__setModuleDefault||(Object.create?function(C,H){Object.defineProperty(C,"default",{enumerable:!0,value:H})}:function(C,H){C.default=H}),n=dt&&dt.__importStar||function(C){if(C&&C.__esModule)return C;var H={};if(C!=null)for(var W in C)W!=="default"&&Object.prototype.hasOwnProperty.call(C,W)&&t(H,C,W);return r(H,C),H},i=dt&&dt.__awaiter||function(C,H,W,re){function ce(X){return X instanceof W?X:new W(function(ie){ie(X)})}return new(W||(W=Promise))(function(X,ie){function se(L){try{D(re.next(L))}catch(N){ie(N)}}function we(L){try{D(re.throw(L))}catch(N){ie(N)}}function D(L){L.done?X(L.value):ce(L.value).then(se,we)}D((re=re.apply(C,H||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.platform=e.toPlatformPath=e.toWin32Path=e.toPosixPath=e.markdownSummary=e.summary=e.getIDToken=e.getState=e.saveState=e.group=e.endGroup=e.startGroup=e.info=e.notice=e.warning=e.error=e.debug=e.isDebug=e.setFailed=e.setCommandEcho=e.setOutput=e.getBooleanInput=e.getMultilineInput=e.getInput=e.addPath=e.setSecret=e.exportVariable=e.ExitCode=void 0;const o=xy(),s=Ay(),l=Da(),u=n(it),a=n(ue),c=zy();var m;(function(C){C[C.Success=0]="Success",C[C.Failure=1]="Failure"})(m||(e.ExitCode=m={}));function p(C,H){const W=(0,l.toCommandValue)(H);if(process.env[C]=W,process.env.GITHUB_ENV||"")return(0,s.issueFileCommand)("ENV",(0,s.prepareKeyValueMessage)(C,H));(0,o.issueCommand)("set-env",{name:C},W)}e.exportVariable=p;function w(C){(0,o.issueCommand)("add-mask",{},C)}e.setSecret=w;function E(C){process.env.GITHUB_PATH||""?(0,s.issueFileCommand)("PATH",C):(0,o.issueCommand)("add-path",{},C),process.env.PATH=`${C}${a.delimiter}${process.env.PATH}`}e.addPath=E;function d(C,H){const W=process.env[`INPUT_${C.replace(/ /g,"_").toUpperCase()}`]||"";if(H&&H.required&&!W)throw new Error(`Input required and not supplied: ${C}`);return H&&H.trimWhitespace===!1?W:W.trim()}e.getInput=d;function f(C,H){const W=d(C,H).split(`
|
||
`).filter(re=>re!=="");return H&&H.trimWhitespace===!1?W:W.map(re=>re.trim())}e.getMultilineInput=f;function h(C,H){const W=["true","True","TRUE"],re=["false","False","FALSE"],ce=d(C,H);if(W.includes(ce))return!0;if(re.includes(ce))return!1;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${C}
|
||
Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}e.getBooleanInput=h;function y(C,H){if(process.env.GITHUB_OUTPUT||"")return(0,s.issueFileCommand)("OUTPUT",(0,s.prepareKeyValueMessage)(C,H));process.stdout.write(u.EOL),(0,o.issueCommand)("set-output",{name:C},(0,l.toCommandValue)(H))}e.setOutput=y;function v(C){(0,o.issue)("echo",C?"on":"off")}e.setCommandEcho=v;function S(C){process.exitCode=m.Failure,g(C)}e.setFailed=S;function _(){return process.env.RUNNER_DEBUG==="1"}e.isDebug=_;function b(C){(0,o.issueCommand)("debug",{},C)}e.debug=b;function g(C,H={}){(0,o.issueCommand)("error",(0,l.toCommandProperties)(H),C instanceof Error?C.toString():C)}e.error=g;function $(C,H={}){(0,o.issueCommand)("warning",(0,l.toCommandProperties)(H),C instanceof Error?C.toString():C)}e.warning=$;function I(C,H={}){(0,o.issueCommand)("notice",(0,l.toCommandProperties)(H),C instanceof Error?C.toString():C)}e.notice=I;function A(C){process.stdout.write(C+u.EOL)}e.info=A;function M(C){(0,o.issue)("group",C)}e.startGroup=M;function K(){(0,o.issue)("endgroup")}e.endGroup=K;function Q(C,H){return i(this,void 0,void 0,function*(){M(C);let W;try{W=yield H()}finally{K()}return W})}e.group=Q;function x(C,H){if(process.env.GITHUB_STATE||"")return(0,s.issueFileCommand)("STATE",(0,s.prepareKeyValueMessage)(C,H));(0,o.issueCommand)("save-state",{name:C},(0,l.toCommandValue)(H))}e.saveState=x;function T(C){return process.env[`STATE_${C}`]||""}e.getState=T;function F(C){return i(this,void 0,void 0,function*(){return yield c.OidcClient.getIDToken(C)})}e.getIDToken=F;var U=fu();Object.defineProperty(e,"summary",{enumerable:!0,get:function(){return U.summary}});var k=fu();Object.defineProperty(e,"markdownSummary",{enumerable:!0,get:function(){return k.markdownSummary}});var G=Wy();Object.defineProperty(e,"toPosixPath",{enumerable:!0,get:function(){return G.toPosixPath}}),Object.defineProperty(e,"toWin32Path",{enumerable:!0,get:function(){return G.toWin32Path}}),Object.defineProperty(e,"toPlatformPath",{enumerable:!0,get:function(){return G.toPlatformPath}}),e.platform=n(Ky())}(dt)),dt}var Ee=wr();function Lp(e){const t=Ee.getInput(e.toLowerCase());if(t!=="false"&&t!=="")return t}var Fi={};const Yy=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE",pr:{env:"AC_GIT_PR",ne:"false"}},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN",pr:{env:"CODEBUILD_WEBHOOK_EVENT",any:["PULL_REQUEST_CREATED","PULL_REQUEST_UPDATED","PULL_REQUEST_REOPENED"]}},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Cloudflare Pages",constant:"CLOUDFLARE_PAGES",env:"CF_PAGES"},{name:"Cloudflare Workers",constant:"CLOUDFLARE_WORKERS",env:"WORKERS_CI"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}];var gu;function Jy(){return gu||(gu=1,function(e){const t=Yy,r=process.env;Object.defineProperty(e,"_vendors",{value:t.map(function(o){return o.constant})}),e.name=null,e.isPR=null,e.id=null,t.forEach(function(o){const l=(Array.isArray(o.env)?o.env:[o.env]).every(function(u){return n(u)});e[o.constant]=l,l&&(e.name=o.name,e.isPR=i(o),e.id=o.constant)}),e.isCI=!!(r.CI!=="false"&&(r.BUILD_ID||r.BUILD_NUMBER||r.CI||r.CI_APP_ID||r.CI_BUILD_ID||r.CI_BUILD_NUMBER||r.CI_NAME||r.CONTINUOUS_INTEGRATION||r.RUN_ID||e.name));function n(o){return typeof o=="string"?!!r[o]:"env"in o?r[o.env]&&r[o.env].includes(o.includes):"any"in o?o.any.some(function(s){return!!r[s]}):Object.keys(o).every(function(s){return r[s]===o[s]})}function i(o){switch(typeof o.pr){case"string":return!!r[o.pr];case"object":return"env"in o.pr?"any"in o.pr?o.pr.any.some(function(s){return r[o.pr.env]===s}):o.pr.env in r&&r[o.pr.env]!==o.pr.ne:"any"in o.pr?o.pr.any.some(function(s){return!!r[s]}):n(o.pr);default:return null}}}(Fi)),Fi}var vn=Jy();const xt=$e(vn),{GITHUB_ACTIONS:Fn}=xt;function Ae(e){return Fn?Ee.error(e):console.log(`\x1B[31m${e}\x1B[0m`)}function Qy(e){return console.log(`\x1B[32m${e}\x1B[0m`)}function ve(e){return Fn?Ee.warning(e):console.log(`\x1B[33m${e}\x1B[0m`)}function Zt(e){return Fn?Ee.notice(e):console.log(`\x1B[94m${e}\x1B[0m`)}function z(e){return Fn?Ee.info(e):console.log(e)}var Ht={exports:{}},qi,_u;function Zy(){if(_u)return qi;_u=1,qi=n,n.sync=i;var e=je;function t(o,s){var l=s.pathExt!==void 0?s.pathExt:process.env.PATHEXT;if(!l||(l=l.split(";"),l.indexOf("")!==-1))return!0;for(var u=0;u<l.length;u++){var a=l[u].toLowerCase();if(a&&o.substr(-a.length).toLowerCase()===a)return!0}return!1}function r(o,s,l){return!o.isSymbolicLink()&&!o.isFile()?!1:t(s,l)}function n(o,s,l){e.stat(o,function(u,a){l(u,u?!1:r(a,o,s))})}function i(o,s){return r(e.statSync(o),o,s)}return qi}var Ui,Eu;function ev(){if(Eu)return Ui;Eu=1,Ui=t,t.sync=r;var e=je;function t(o,s,l){e.stat(o,function(u,a){l(u,u?!1:n(a,s))})}function r(o,s){return n(e.statSync(o),s)}function n(o,s){return o.isFile()&&i(o,s)}function i(o,s){var l=o.mode,u=o.uid,a=o.gid,c=s.uid!==void 0?s.uid:process.getuid&&process.getuid(),m=s.gid!==void 0?s.gid:process.getgid&&process.getgid(),p=parseInt("100",8),w=parseInt("010",8),E=parseInt("001",8),d=p|w,f=l&E||l&w&&a===m||l&p&&u===c||l&d&&c===0;return f}return Ui}var ji,Su;function tv(){if(Su)return ji;Su=1;var e;process.platform==="win32"||at.TESTING_WINDOWS?e=Zy():e=ev(),ji=t,t.sync=r;function t(n,i,o){if(typeof i=="function"&&(o=i,i={}),!o){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(s,l){t(n,i||{},function(u,a){u?l(u):s(a)})})}e(n,i||{},function(s,l){s&&(s.code==="EACCES"||i&&i.ignoreErrors)&&(s=null,l=!1),o(s,l)})}function r(n,i){try{return e.sync(n,i||{})}catch(o){if(i&&i.ignoreErrors||o.code==="EACCES")return!1;throw o}}return ji}var Mi,bu;function rv(){if(bu)return Mi;bu=1;const e=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",t=ue,r=e?";":":",n=tv(),i=u=>Object.assign(new Error(`not found: ${u}`),{code:"ENOENT"}),o=(u,a)=>{const c=a.colon||r,m=u.match(/\//)||e&&u.match(/\\/)?[""]:[...e?[process.cwd()]:[],...(a.path||process.env.PATH||"").split(c)],p=e?a.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",w=e?p.split(c):[""];return e&&u.indexOf(".")!==-1&&w[0]!==""&&w.unshift(""),{pathEnv:m,pathExt:w,pathExtExe:p}},s=(u,a,c)=>{typeof a=="function"&&(c=a,a={}),a||(a={});const{pathEnv:m,pathExt:p,pathExtExe:w}=o(u,a),E=[],d=h=>new Promise((y,v)=>{if(h===m.length)return a.all&&E.length?y(E):v(i(u));const S=m[h],_=/^".*"$/.test(S)?S.slice(1,-1):S,b=t.join(_,u),g=!_&&/^\.[\\\/]/.test(u)?u.slice(0,2)+b:b;y(f(g,h,0))}),f=(h,y,v)=>new Promise((S,_)=>{if(v===p.length)return S(d(y+1));const b=p[v];n(h+b,{pathExt:w},(g,$)=>{if(!g&&$)if(a.all)E.push(h+b);else return S(h+b);return S(f(h,y,v+1))})});return c?d(0).then(h=>c(null,h),c):d(0)},l=(u,a)=>{a=a||{};const{pathEnv:c,pathExt:m,pathExtExe:p}=o(u,a),w=[];for(let E=0;E<c.length;E++){const d=c[E],f=/^".*"$/.test(d)?d.slice(1,-1):d,h=t.join(f,u),y=!f&&/^\.[\\\/]/.test(u)?u.slice(0,2)+h:h;for(let v=0;v<m.length;v++){const S=y+m[v];try{if(n.sync(S,{pathExt:p}))if(a.all)w.push(S);else return S}catch{}}}if(a.all&&w.length)return w;if(a.nothrow)return null;throw i(u)};return Mi=s,s.sync=l,Mi}var Xr={exports:{}},Ru;function nv(){if(Ru)return Xr.exports;Ru=1;const e=(t={})=>{const r=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(r).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};return Xr.exports=e,Xr.exports.default=e,Xr.exports}var Gi,$u;function iv(){if($u)return Gi;$u=1;const e=ue,t=rv(),r=nv();function n(o,s){const l=o.options.env||process.env,u=process.cwd(),a=o.options.cwd!=null,c=a&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(o.options.cwd)}catch{}let m;try{m=t.sync(o.command,{path:l[r({env:l})],pathExt:s?e.delimiter:void 0})}catch{}finally{c&&process.chdir(u)}return m&&(m=e.resolve(a?o.options.cwd:"",m)),m}function i(o){return n(o)||n(o,!0)}return Gi=i,Gi}var Kr={},Ou;function sv(){if(Ou)return Kr;Ou=1;const e=/([()\][%!^"`<>&|;, *?])/g;function t(n){return n=n.replace(e,"^$1"),n}function r(n,i){return n=`${n}`,n=n.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),n=n.replace(/(?=(\\+?)?)\1$/,"$1$1"),n=`"${n}"`,n=n.replace(e,"^$1"),i&&(n=n.replace(e,"^$1")),n}return Kr.command=t,Kr.argument=r,Kr}var Vi,Iu;function ov(){return Iu||(Iu=1,Vi=/^#!(.*)/),Vi}var Bi,Pu;function av(){if(Pu)return Bi;Pu=1;const e=ov();return Bi=(t="")=>{const r=t.match(e);if(!r)return null;const[n,i]=r[0].replace(/#! ?/,"").split(" "),o=n.split("/").pop();return o==="env"?i:i?`${o} ${i}`:o},Bi}var Hi,Tu;function cv(){if(Tu)return Hi;Tu=1;const e=je,t=av();function r(n){const o=Buffer.alloc(150);let s;try{s=e.openSync(n,"r"),e.readSync(s,o,0,150,0),e.closeSync(s)}catch{}return t(o.toString())}return Hi=r,Hi}var zi,xu;function uv(){if(xu)return zi;xu=1;const e=ue,t=iv(),r=sv(),n=cv(),i=process.platform==="win32",o=/\.(?:com|exe)$/i,s=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(c){c.file=t(c);const m=c.file&&n(c.file);return m?(c.args.unshift(c.file),c.command=m,t(c)):c.file}function u(c){if(!i)return c;const m=l(c),p=!o.test(m);if(c.options.forceShell||p){const w=s.test(m);c.command=e.normalize(c.command),c.command=r.command(c.command),c.args=c.args.map(d=>r.argument(d,w));const E=[c.command].concat(c.args).join(" ");c.args=["/d","/s","/c",`"${E}"`],c.command=process.env.comspec||"cmd.exe",c.options.windowsVerbatimArguments=!0}return c}function a(c,m,p){m&&!Array.isArray(m)&&(p=m,m=null),m=m?m.slice(0):[],p=Object.assign({},p);const w={command:c,args:m,options:p,file:void 0,original:{command:c,args:m}};return p.shell?w:u(w)}return zi=a,zi}var Wi,Au;function lv(){if(Au)return Wi;Au=1;const e=process.platform==="win32";function t(o,s){return Object.assign(new Error(`${s} ${o.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${s} ${o.command}`,path:o.command,spawnargs:o.args})}function r(o,s){if(!e)return;const l=o.emit;o.emit=function(u,a){if(u==="exit"){const c=n(a,s);if(c)return l.call(o,"error",c)}return l.apply(o,arguments)}}function n(o,s){return e&&o===1&&!s.file?t(s.original,"spawn"):null}function i(o,s){return e&&o===1&&!s.file?t(s.original,"spawnSync"):null}return Wi={hookChildProcess:r,verifyENOENT:n,verifyENOENTSync:i,notFoundError:t},Wi}var Cu;function fv(){if(Cu)return Ht.exports;Cu=1;const e=Fr,t=uv(),r=lv();function n(o,s,l){const u=t(o,s,l),a=e.spawn(u.command,u.args,u.options);return r.hookChildProcess(a,u),a}function i(o,s,l){const u=t(o,s,l),a=e.spawnSync(u.command,u.args,u.options);return a.error=a.error||r.verifyENOENTSync(a.status,u),a}return Ht.exports=n,Ht.exports.spawn=n,Ht.exports.sync=i,Ht.exports._parse=t,Ht.exports._enoent=r,Ht.exports}var dv=fv();const pv=$e(dv);function hv(e){const t=typeof e=="string"?`
|
||
`:10,r=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===r&&(e=e.slice(0,-1)),e}function Dp(e={}){const{env:t=process.env,platform:r=process.platform}=e;return r!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}const mv=({cwd:e=Tt.cwd(),path:t=Tt.env[Dp()],preferLocal:r=!0,execPath:n=Tt.execPath,addExecPath:i=!0}={})=>{const o=e instanceof URL?vp(e):e,s=dr.resolve(o),l=[];return r&&yv(l,s),i&&vv(l,n,s),[...l,t].join(dr.delimiter)},yv=(e,t)=>{let r;for(;r!==t;)e.push(dr.join(t,"node_modules/.bin")),r=t,t=dr.resolve(t,"..")},vv=(e,t,r)=>{const n=t instanceof URL?vp(t):t;e.push(dr.resolve(r,n,".."))},wv=({env:e=Tt.env,...t}={})=>{e={...e};const r=Dp({env:e});return t.path=e[r],e[r]=mv(t),e},gv=(e,t,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;const i=Object.getOwnPropertyDescriptor(e,r),o=Object.getOwnPropertyDescriptor(t,r);!_v(i,o)&&n||Object.defineProperty(e,r,o)},_v=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Ev=(e,t)=>{const r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},Sv=(e,t)=>`/* Wrapped ${e}*/
|
||
${t}`,bv=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Rv=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),$v=(e,t,r)=>{const n=r===""?"":`with ${r.trim()}() `,i=Sv.bind(null,n,t.toString());Object.defineProperty(i,"name",Rv),Object.defineProperty(e,"toString",{...bv,value:i})};function Ov(e,t,{ignoreNonConfigurable:r=!1}={}){const{name:n}=e;for(const i of Reflect.ownKeys(t))gv(e,t,i,r);return Ev(e,t),$v(e,t,n),e}const wn=new WeakMap,kp=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,n=0;const i=e.displayName||e.name||"<anonymous>",o=function(...s){if(wn.set(o,++n),n===1)r=e.apply(this,s),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return r};return Ov(o,e),wn.set(o,n),o};kp.callCount=e=>{if(!wn.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return wn.get(e)};const Iv=()=>{const e=qp-Fp+1;return Array.from({length:e},Pv)},Pv=(e,t)=>({name:`SIGRT${t+1}`,number:Fp+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Fp=34,qp=64,Tv=[{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",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],Up=()=>{const e=Iv();return[...Tv,...e].map(xv)},xv=({name:e,number:t,description:r,action:n,forced:i=!1,standard:o})=>{const{signals:{[e]:s}}=gp,l=s!==void 0;return{name:e,number:l?s:t,description:r,supported:l,action:n,forced:i,standard:o}},Av=()=>{const e=Up();return Object.fromEntries(e.map(Cv))},Cv=({name:e,number:t,description:r,supported:n,action:i,forced:o,standard:s})=>[e,{name:e,number:t,description:r,supported:n,action:i,forced:o,standard:s}],Nv=Av(),Lv=()=>{const e=Up(),t=qp+1,r=Array.from({length:t},(n,i)=>Dv(i,e));return Object.assign({},...r)},Dv=(e,t)=>{const r=kv(e,t);if(r===void 0)return{};const{name:n,description:i,supported:o,action:s,forced:l,standard:u}=r;return{[e]:{name:n,number:e,description:i,supported:o,action:s,forced:l,standard:u}}},kv=(e,t)=>{const r=t.find(({name:n})=>gp.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)};Lv();const Fv=({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:i,exitCode:o,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":r!==void 0?`failed with ${r}`:n!==void 0?`was killed with ${n} (${i})`:o!==void 0?`failed with exit code ${o}`:"failed",gn=({stdout:e,stderr:t,all:r,error:n,signal:i,exitCode:o,command:s,escapedCommand:l,timedOut:u,isCanceled:a,killed:c,parsed:{options:{timeout:m,cwd:p=Tt.cwd()}}})=>{o=o===null?void 0:o,i=i===null?void 0:i;const w=i===void 0?void 0:Nv[i].description,E=n&&n.code,f=`Command ${Fv({timedOut:u,timeout:m,errorCode:E,signal:i,signalDescription:w,exitCode:o,isCanceled:a})}: ${s}`,h=Object.prototype.toString.call(n)==="[object Error]",y=h?`${f}
|
||
${n.message}`:f,v=[y,t,e].filter(Boolean).join(`
|
||
`);return h?(n.originalMessage=n.message,n.message=v):n=new Error(v),n.shortMessage=y,n.command=s,n.escapedCommand=l,n.exitCode=o,n.signal=i,n.signalDescription=w,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},on=["stdin","stdout","stderr"],qv=e=>on.some(t=>e[t]!==void 0),Uv=e=>{if(!e)return;const{stdio:t}=e;if(t===void 0)return on.map(n=>e[n]);if(qv(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${on.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const r=Math.max(t.length,on.length);return Array.from({length:r},(n,i)=>t[i])};var zt={exports:{}},Xi={exports:{}},Nu;function jv(){return Nu||(Nu=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")}(Xi)),Xi.exports}var Lu;function Mv(){if(Lu)return zt.exports;Lu=1;var e=at.process;const t=function(f){return f&&typeof f=="object"&&typeof f.removeListener=="function"&&typeof f.emit=="function"&&typeof f.reallyExit=="function"&&typeof f.listeners=="function"&&typeof f.kill=="function"&&typeof f.pid=="number"&&typeof f.on=="function"};if(!t(e))zt.exports=function(){return function(){}};else{var r=qr,n=jv(),i=/^win/i.test(e.platform),o=Tn;typeof o!="function"&&(o=o.EventEmitter);var s;e.__signal_exit_emitter__?s=e.__signal_exit_emitter__:(s=e.__signal_exit_emitter__=new o,s.count=0,s.emitted={}),s.infinite||(s.setMaxListeners(1/0),s.infinite=!0),zt.exports=function(f,h){if(!t(at.process))return function(){};r.equal(typeof f,"function","a callback must be provided for exit handler"),c===!1&&m();var y="exit";h&&h.alwaysLast&&(y="afterexit");var v=function(){s.removeListener(y,f),s.listeners("exit").length===0&&s.listeners("afterexit").length===0&&l()};return s.on(y,f),v};var l=function(){!c||!t(at.process)||(c=!1,n.forEach(function(h){try{e.removeListener(h,a[h])}catch{}}),e.emit=E,e.reallyExit=p,s.count-=1)};zt.exports.unload=l;var u=function(h,y,v){s.emitted[h]||(s.emitted[h]=!0,s.emit(h,y,v))},a={};n.forEach(function(f){a[f]=function(){if(t(at.process)){var y=e.listeners(f);y.length===s.count&&(l(),u("exit",null,f),u("afterexit",null,f),i&&f==="SIGHUP"&&(f="SIGINT"),e.kill(e.pid,f))}}}),zt.exports.signals=function(){return n};var c=!1,m=function(){c||!t(at.process)||(c=!0,s.count+=1,n=n.filter(function(h){try{return e.on(h,a[h]),!0}catch{return!1}}),e.emit=d,e.reallyExit=w)};zt.exports.load=m;var p=e.reallyExit,w=function(h){t(at.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(at.process)){y!==void 0&&(e.exitCode=y);var v=E.apply(this,arguments);return u("exit",e.exitCode,null),u("afterexit",e.exitCode,null),v}else return E.apply(this,arguments)}}return zt.exports}var Gv=Mv();const Vv=$e(Gv),Bv=1e3*5,Hv=(e,t="SIGTERM",r={})=>{const n=e(t);return zv(e,t,r,n),n},zv=(e,t,r,n)=>{if(!Wv(t,r,n))return;const i=Kv(r),o=setTimeout(()=>{e("SIGKILL")},i);o.unref&&o.unref()},Wv=(e,{forceKillAfterTimeout:t},r)=>Xv(e)&&t!==!1&&r,Xv=e=>e===wp.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Kv=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Bv;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Yv=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Jv=(e,t,r)=>{e.kill(t),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Qv=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(t===0||t===void 0)return n;let i;const o=new Promise((l,u)=>{i=setTimeout(()=>{Jv(e,r,u)},t)}),s=n.finally(()=>{clearTimeout(i)});return Promise.race([o,s])},Zv=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},ew=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;const i=Vv(()=>{e.kill()});return n.finally(()=>{i()})};function Fa(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}function Du(e){return Fa(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"}const tw=e=>e instanceof Gm&&typeof e.then=="function",Ki=(e,t,r)=>{if(typeof r=="string")return e[t].pipe(Bm(r)),e;if(Du(r))return e[t].pipe(r),e;if(!tw(r))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!Du(r.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(r.stdin),r},rw=e=>{e.stdout!==null&&(e.pipeStdout=Ki.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=Ki.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=Ki.bind(void 0,e,"all"))};var cr={exports:{}},Yi,ku;function nw(){if(ku)return Yi;ku=1;const{PassThrough:e}=Ur;return Yi=t=>{t={...t};const{array:r}=t;let{encoding:n}=t;const i=n==="buffer";let o=!1;r?o=!(n||i):n=n||"utf8",i&&(n=null);const s=new e({objectMode:o});n&&s.setEncoding(n);let l=0;const u=[];return s.on("data",a=>{u.push(a),o?l=u.length:l+=a.length}),s.getBufferedValue=()=>r?u:i?Buffer.concat(u,l):u.join(""),s.getBufferedLength=()=>l,s},Yi}var Fu;function iw(){if(Fu)return cr.exports;Fu=1;const{constants:e}=Xm,t=Ur,{promisify:r}=xn,n=nw(),i=r(t.pipeline);class o extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function s(l,u){if(!l)throw new Error("Expected a stream");u={maxBuffer:1/0,...u};const{maxBuffer:a}=u,c=n(u);return await new Promise((m,p)=>{const w=E=>{E&&c.getBufferedLength()<=e.MAX_LENGTH&&(E.bufferedData=c.getBufferedValue()),p(E)};(async()=>{try{await i(l,c),m()}catch(E){w(E)}})(),c.on("data",()=>{c.getBufferedLength()>a&&w(new o)})}),c.getBufferedValue()}return cr.exports=s,cr.exports.buffer=(l,u)=>s(l,{...u,encoding:"buffer"}),cr.exports.array=(l,u)=>s(l,{...u,array:!0}),cr.exports.MaxBufferError=o,cr.exports}var sw=iw();const qu=$e(sw);var Ji,Uu;function ow(){if(Uu)return Ji;Uu=1;const{PassThrough:e}=Ur;return Ji=function(){var t=[],r=new e({objectMode:!0});return r.setMaxListeners(0),r.add=n,r.isEmpty=i,r.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(n),r;function n(s){return Array.isArray(s)?(s.forEach(n),this):(t.push(s),s.once("end",o.bind(null,s)),s.once("error",r.emit.bind(r,"error")),s.pipe(r,{end:!1}),this)}function i(){return t.length==0}function o(s){t=t.filter(function(l){return l!==s}),!t.length&&r.readable&&r.end()}},Ji}var aw=ow();const cw=$e(aw),jp=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},uw=({input:e,inputFile:t})=>typeof t!="string"?e:(jp(e),zm(t)),lw=e=>{const t=uw(e);if(Fa(t))throw new TypeError("The `input` option cannot be a stream in sync mode");return t},fw=({input:e,inputFile:t})=>typeof t!="string"?e:(jp(e),Hm(t)),dw=(e,t)=>{const r=fw(t);r!==void 0&&(Fa(r)?r.pipe(e.stdin):e.stdin.end(r))},pw=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const r=cw();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r},Qi=async(e,t)=>{if(!(!e||t===void 0)){e.destroy();try{return await t}catch(r){return r.bufferedData}}},Zi=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(!(!e||!r))return t?qu(e,{encoding:t,maxBuffer:n}):qu.buffer(e,{maxBuffer:n})},hw=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:o},s)=>{const l=Zi(e,{encoding:n,buffer:i,maxBuffer:o}),u=Zi(t,{encoding:n,buffer:i,maxBuffer:o}),a=Zi(r,{encoding:n,buffer:i,maxBuffer:o*2});try{return await Promise.all([s,l,u,a])}catch(c){return Promise.all([{error:c,signal:c.signal,timedOut:c.timedOut},Qi(e,l),Qi(t,u),Qi(r,a)])}},mw=(async()=>{})().constructor.prototype,yw=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(mw,e)]),ju=(e,t)=>{for(const[r,n]of yw){const i=typeof t=="function"?(...o)=>Reflect.apply(n.value,t(),o):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:i})}},vw=e=>new Promise((t,r)=>{e.on("exit",(n,i)=>{t({exitCode:n,signal:i})}),e.on("error",n=>{r(n)}),e.stdin&&e.stdin.on("error",n=>{r(n)})}),Mp=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],ww=/^[\w.-]+$/,gw=/"/g,_w=e=>typeof e!="string"||ww.test(e)?e:`"${e.replace(gw,'\\"')}"`,Gp=(e,t)=>Mp(e,t).join(" "),Vp=(e,t)=>Mp(e,t).map(r=>_w(r)).join(" "),Ew=/ +/g,Bp=e=>{const t=[];for(const r of e.trim().split(Ew)){const n=t[t.length-1];n&&n.endsWith("\\")?t[t.length-1]=`${n.slice(0,-1)} ${r}`:t.push(r)}return t},Sw=Km("execa").enabled,Yr=(e,t)=>String(e).padStart(t,"0"),bw=()=>{const e=new Date;return`${Yr(e.getHours(),2)}:${Yr(e.getMinutes(),2)}:${Yr(e.getSeconds(),2)}.${Yr(e.getMilliseconds(),3)}`},Hp=(e,{verbose:t})=>{t&&Tt.stderr.write(`[${bw()}] ${e}
|
||
`)},Rw=1e3*1e3*100,$w=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{const o=t?{...Tt.env,...e}:e;return r?wv({env:o,cwd:n,execPath:i}):o},zp=(e,t,r={})=>{const n=pv._parse(e,t,r);return e=n.command,t=n.args,r=n.options,r={maxBuffer:Rw,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:r.cwd||Tt.cwd(),execPath:Tt.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:Sw,...r},r.env=$w(r),r.stdio=Uv(r),Tt.platform==="win32"&&dr.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n}},Dr=(e,t,r)=>typeof t!="string"&&!Mm.isBuffer(t)?r===void 0?void 0:"":e.stripFinalNewline?hv(t):t;function le(e,t,r){const n=zp(e,t,r),i=Gp(e,t),o=Vp(e,t);Hp(o,n.options),Zv(n.options);let s;try{s=ga.spawn(n.file,n.args,n.options)}catch(w){const E=new ga.ChildProcess,d=Promise.reject(gn({error:w,stdout:"",stderr:"",all:"",command:i,escapedCommand:o,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return ju(E,d),E}const l=vw(s),u=Qv(s,n.options,l),a=ew(s,n.options,u),c={isCanceled:!1};s.kill=Hv.bind(null,s.kill.bind(s)),s.cancel=Yv.bind(null,s,c);const p=kp(async()=>{const[{error:w,exitCode:E,signal:d,timedOut:f},h,y,v]=await hw(s,n.options,a),S=Dr(n.options,h),_=Dr(n.options,y),b=Dr(n.options,v);if(w||E!==0||d!==null){const g=gn({error:w,exitCode:E,signal:d,stdout:S,stderr:_,all:b,command:i,escapedCommand:o,parsed:n,timedOut:f,isCanceled:c.isCanceled||(n.options.signal?n.options.signal.aborted:!1),killed:s.killed});if(!n.options.reject)return g;throw g}return{command:i,escapedCommand:o,exitCode:0,stdout:S,stderr:_,all:b,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return dw(s,n.options),s.all=pw(s,n.options),rw(s),ju(s,p),s}function ze(e,t,r){const n=zp(e,t,r),i=Gp(e,t),o=Vp(e,t);Hp(o,n.options);const s=lw(n.options);let l;try{l=ga.spawnSync(n.file,n.args,{...n.options,input:s})}catch(c){throw gn({error:c,stdout:"",stderr:"",all:"",command:i,escapedCommand:o,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}const u=Dr(n.options,l.stdout,l.error),a=Dr(n.options,l.stderr,l.error);if(l.error||l.status!==0||l.signal!==null){const c=gn({stdout:u,stderr:a,error:l.error,signal:l.signal,exitCode:l.status,command:i,escapedCommand:o,parsed:n,timedOut:l.error&&l.error.code==="ETIMEDOUT",isCanceled:!1,killed:l.signal!==null});if(!n.options.reject)return c;throw c}return{command:i,escapedCommand:o,exitCode:0,stdout:u,stderr:a,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}function Ow(e,t){const[r,...n]=Bp(e);return le(r,n,t)}function Iw(e,t){const[r,...n]=Bp(e);return ze(r,n,t)}var mt={},Wt={},Mu;function Pw(){if(Mu)return Wt;Mu=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.sync=Wt.isexe=void 0;const e=je,t=_p,r=async(s,l={})=>{const{ignoreErrors:u=!1}=l;try{return i(await(0,t.stat)(s),l)}catch(a){const c=a;if(u||c.code==="EACCES")return!1;throw c}};Wt.isexe=r;const n=(s,l={})=>{const{ignoreErrors:u=!1}=l;try{return i((0,e.statSync)(s),l)}catch(a){const c=a;if(u||c.code==="EACCES")return!1;throw c}};Wt.sync=n;const i=(s,l)=>s.isFile()&&o(s,l),o=(s,l)=>{const u=l.uid??process.getuid?.(),a=l.groups??process.getgroups?.()??[],c=l.gid??process.getgid?.()??a[0];if(u===void 0||c===void 0)throw new Error("cannot get uid or gid");const m=new Set([c,...a]),p=s.mode,w=s.uid,E=s.gid,d=parseInt("100",8),f=parseInt("010",8),h=parseInt("001",8),y=d|f;return!!(p&h||p&f&&m.has(E)||p&d&&w===u||p&y&&u===0)};return Wt}var Xt={},Gu;function Tw(){if(Gu)return Xt;Gu=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.sync=Xt.isexe=void 0;const e=je,t=_p,r=async(s,l={})=>{const{ignoreErrors:u=!1}=l;try{return o(await(0,t.stat)(s),s,l)}catch(a){const c=a;if(u||c.code==="EACCES")return!1;throw c}};Xt.isexe=r;const n=(s,l={})=>{const{ignoreErrors:u=!1}=l;try{return o((0,e.statSync)(s),s,l)}catch(a){const c=a;if(u||c.code==="EACCES")return!1;throw c}};Xt.sync=n;const i=(s,l)=>{const{pathExt:u=process.env.PATHEXT||""}=l,a=u.split(";");if(a.indexOf("")!==-1)return!0;for(let c=0;c<a.length;c++){const m=a[c].toLowerCase(),p=s.substring(s.length-m.length).toLowerCase();if(m&&p===m)return!0}return!1},o=(s,l,u)=>s.isFile()&&i(l,u);return Xt}var es={},Vu;function xw(){return Vu||(Vu=1,Object.defineProperty(es,"__esModule",{value:!0})),es}var Bu;function Aw(){return Bu||(Bu=1,function(e){var t=mt&&mt.__createBinding||(Object.create?function(a,c,m,p){p===void 0&&(p=m);var w=Object.getOwnPropertyDescriptor(c,m);(!w||("get"in w?!c.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return c[m]}}),Object.defineProperty(a,p,w)}:function(a,c,m,p){p===void 0&&(p=m),a[p]=c[m]}),r=mt&&mt.__setModuleDefault||(Object.create?function(a,c){Object.defineProperty(a,"default",{enumerable:!0,value:c})}:function(a,c){a.default=c}),n=mt&&mt.__importStar||function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var m in a)m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)&&t(c,a,m);return r(c,a),c},i=mt&&mt.__exportStar||function(a,c){for(var m in a)m!=="default"&&!Object.prototype.hasOwnProperty.call(c,m)&&t(c,a,m)};Object.defineProperty(e,"__esModule",{value:!0}),e.sync=e.isexe=e.posix=e.win32=void 0;const o=n(Pw());e.posix=o;const s=n(Tw());e.win32=s,i(xw(),e);const u=(process.env._ISEXE_TEST_PLATFORM_||process.platform)==="win32"?s:o;e.isexe=u.isexe,e.sync=u.sync}(mt)),mt}var ts,Hu;function Cw(){if(Hu)return ts;Hu=1;const{isexe:e,sync:t}=Aw(),{join:r,delimiter:n,sep:i,posix:o}=ue,s=process.platform==="win32",l=new RegExp(`[${o.sep}${i===o.sep?"":i}]`.replace(/(\\)/g,"\\$1")),u=new RegExp(`^\\.${l.source}`),a=E=>Object.assign(new Error(`not found: ${E}`),{code:"ENOENT"}),c=(E,{path:d=process.env.PATH,pathExt:f=process.env.PATHEXT,delimiter:h=n})=>{const y=E.match(l)?[""]:[...s?[process.cwd()]:[],...(d||"").split(h)];if(s){const v=f||[".EXE",".CMD",".BAT",".COM"].join(h),S=v.split(h).flatMap(_=>[_,_.toLowerCase()]);return E.includes(".")&&S[0]!==""&&S.unshift(""),{pathEnv:y,pathExt:S,pathExtExe:v}}return{pathEnv:y,pathExt:[""]}},m=(E,d)=>{const f=/^".*"$/.test(E)?E.slice(1,-1):E;return(!f&&u.test(d)?d.slice(0,2):"")+r(f,d)},p=async(E,d={})=>{const{pathEnv:f,pathExt:h,pathExtExe:y}=c(E,d),v=[];for(const S of f){const _=m(S,E);for(const b of h){const g=_+b;if(await e(g,{pathExt:y,ignoreErrors:!0})){if(!d.all)return g;v.push(g)}}}if(d.all&&v.length)return v;if(d.nothrow)return null;throw a(E)},w=(E,d={})=>{const{pathEnv:f,pathExt:h,pathExtExe:y}=c(E,d),v=[];for(const S of f){const _=m(S,E);for(const b of h){const g=_+b;if(t(g,{pathExt:y,ignoreErrors:!0})){if(!d.all)return g;v.push(g)}}}if(d.all&&v.length)return v;if(d.nothrow)return null;throw a(E)};return ts=p,p.sync=w,ts}var Nw=Cw();const fe=$e(Nw);let Pr;function Wp(e,t=["-NoProfile","-NoLogo","-NonInteractive"],r={stdio:"inherit"}){return le(Lw(),[...t,"-c",e],r)}function Lw(){if(Pr===void 0){const e=fe.sync("pwsh",{nothrow:!0});e!==null&&(Pr=e);const t=fe.sync("powershell",{nothrow:!0});t!==null&&(Pr=t)}if(Pr===void 0)throw new Error("Could not find powershell");return Pr}function yt(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function Xp(){return fe.sync("sudo",{nothrow:!0})!==null}function gr(){return process.getuid?.()===0||!!process.env.CI}function _r(){return gr()&&Xp()}function Dw(e){return _r()?`sudo ${e}`:e}function he(e,t=[],r=st){return _r()?Iw(Kp(e,t),r):ze(e,qa(t),r)}function wt(e,t=[],r=st){return _r()?Ow(Kp(e,t),r):le(e,qa(t),r)}function Kp(e,t){return`sudo ${qa([e,...t]).join(" ")}`}function qa(e){return e.map(t=>`'${t}'`)}async function kw(){try{return await le("fltmc"),!0}catch{return!1}}async function Fw(){if(process.platform!=="win32")return!1;try{return await le("fsutil",["dirty","query",process.env.systemdrive??""]),!0}catch(e){return e.code==="ENOENT"?kw():!1}}function qw(){return process.platform==="win32"?Yp():gr()}async function Er(e){if((process.platform==="linux"||process.platform==="darwin")&&_r()&&process.env.SUDO_USER!==void 0){let t=je.statSync(e).isDirectory();await wt("chown",[...t?["-R"]:[],process.env.SUDO_USER,e],st)}}var rs,Kt={};yt(Kt,"hasSudo",()=>Xp),yt(Kt,"isRoot",()=>gr),yt(Kt,"isSudo",()=>_r),yt(Kt,"prependSudo",()=>Dw),yt(Kt,"defaultExecOptions",()=>st),yt(Kt,"execRootSync",()=>he),yt(Kt,"execRoot",()=>wt);let st={stdio:"inherit",shell:!0};yt(rs={},"isAdminWindows",()=>Yp),yt(rs,"isAdminPosix",()=>Uw),yt(rs,"isAdmin",()=>qw);let Yp=Fw,Uw=gr;yt({},"grantUserWriteAccess",()=>Er);var ns,zu;function jw(){return zu||(zu=1,ns=function(){}),ns}var is,Wu;function rr(){if(Wu)return is;Wu=1;var e=jw()();return is=function(t){return t!==e&&t!==null},is}var ss,Xu;function Jp(){if(Xu)return ss;Xu=1;var e=rr(),t=Array.prototype.forEach,r=Object.create,n=function(i,o){var s;for(s in i)o[s]=i[s]};return ss=function(i){var o=r(null);return t.call(arguments,function(s){e(s)&&n(Object(s),o)}),o},ss}var os,Ku;function Mw(){return Ku||(Ku=1,os=function(){var e=Math.sign;return typeof e!="function"?!1:e(10)===1&&e(-20)===-1}),os}var as,Yu;function Gw(){return Yu||(Yu=1,as=function(e){return e=Number(e),isNaN(e)||e===0?e:e>0?1:-1}),as}var cs,Ju;function Vw(){return Ju||(Ju=1,cs=Mw()()?Math.sign:Gw()),cs}var us,Qu;function Bw(){if(Qu)return us;Qu=1;var e=Vw(),t=Math.abs,r=Math.floor;return us=function(n){return isNaN(n)?0:(n=Number(n),n===0||!isFinite(n)?n:e(n)*r(t(n)))},us}var ls,Zu;function nr(){if(Zu)return ls;Zu=1;var e=Bw(),t=Math.max;return ls=function(r){return t(0,e(r))},ls}var fs,el;function Qp(){if(el)return fs;el=1;var e=nr();return fs=function(t,r,n){var i;return isNaN(t)?(i=r,i>=0?n&&i?i-1:i:1):t===!1?!1:e(t)},fs}var ds,tl;function jt(){return tl||(tl=1,ds=function(e){if(typeof e!="function")throw new TypeError(e+" is not a function");return e}),ds}var ps,rl;function Sr(){if(rl)return ps;rl=1;var e=rr();return ps=function(t){if(!e(t))throw new TypeError("Cannot use null or undefined");return t},ps}var hs,nl;function Hw(){if(nl)return hs;nl=1;var e=jt(),t=Sr(),r=Function.prototype.bind,n=Function.prototype.call,i=Object.keys,o=Object.prototype.propertyIsEnumerable;return hs=function(s,l){return function(u,a){var c,m=arguments[2],p=arguments[3];return u=Object(t(u)),e(a),c=i(u),p&&c.sort(typeof p=="function"?r.call(p,u):void 0),typeof s!="function"&&(s=c[s]),n.call(s,c,function(w,E){return o.call(u,w)?n.call(a,m,u[w],w,u,E):l})}},hs}var ms,il;function qn(){return il||(il=1,ms=Hw()("forEach")),ms}var sl={},ol;function ir(){return ol||(ol=1),sl}var ys={exports:{}},vs,al;function zw(){return al||(al=1,vs=function(){var e=Object.assign,t;return typeof e!="function"?!1:(t={foo:"raz"},e(t,{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}),vs}var ws,cl;function Ww(){return cl||(cl=1,ws=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),ws}var gs,ul;function Xw(){if(ul)return gs;ul=1;var e=rr(),t=Object.keys;return gs=function(r){return t(e(r)?Object(r):r)},gs}var _s,ll;function Kw(){return ll||(ll=1,_s=Ww()()?Object.keys:Xw()),_s}var Es,fl;function Yw(){if(fl)return Es;fl=1;var e=Kw(),t=Sr(),r=Math.max;return Es=function(n,i){var o,s,l=r(arguments.length,2),u;for(n=Object(t(n)),u=function(a){try{n[a]=i[a]}catch(c){o||(o=c)}},s=1;s<l;++s)i=arguments[s],e(i).forEach(u);if(o!==void 0)throw o;return n},Es}var Ss,dl;function Zp(){return dl||(dl=1,Ss=zw()()?Object.assign:Yw()),Ss}var bs,pl;function Jw(){if(pl)return bs;pl=1;var e=rr(),t={function:!0,object:!0};return bs=function(r){return e(r)&&t[typeof r]||!1},bs}var hl;function Qw(){return hl||(hl=1,function(e){var t=Zp(),r=Jw(),n=rr(),i=Error.captureStackTrace;e.exports=function(o){var s=new Error(o),l=arguments[1],u=arguments[2];return n(u)||r(l)&&(u=l,l=null),n(u)&&t(s,u),n(l)&&(s.code=l),i&&i(s,e.exports),s}}(ys)),ys.exports}var Jr={exports:{}},Rs,ml;function eh(){if(ml)return Rs;ml=1;var e=Sr(),t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,i=Object.getOwnPropertySymbols;return Rs=function(o,s){var l,u=Object(e(s));if(o=Object(e(o)),n(u).forEach(function(a){try{t(o,a,r(s,a))}catch(c){l=c}}),typeof i=="function"&&i(u).forEach(function(a){try{t(o,a,r(s,a))}catch(c){l=c}}),l!==void 0)throw l;return o},Rs}var yl;function th(){if(yl)return Jr.exports;yl=1;var e=nr(),t=function(s,l){return l},r,n,i,o;try{Object.defineProperty(t,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch{}return t.length===1?(r={configurable:!0,writable:!1,enumerable:!1},n=Object.defineProperty,Jr.exports=function(s,l){return l=e(l),s.length===l?s:(r.value=l,n(s,"length",r))}):(o=eh(),i=function(){var s=[];return function(l){var u,a=0;if(s[l])return s[l];for(u=[];l--;)u.push("a"+(++a).toString(36));return new Function("fn","return function ("+u.join(", ")+") { return fn.apply(this, arguments); };")}}(),Jr.exports=function(s,l){var u;if(l=e(l),s.length===l)return s;u=i(l)(s);try{o(u,s)}catch{}return u}),Jr.exports}var $s={exports:{}},Os,vl;function rh(){if(vl)return Os;vl=1;var e=void 0;return Os=function(t){return t!==e&&t!==null},Os}var Is,wl;function Zw(){if(wl)return Is;wl=1;var e=rh(),t={object:!0,function:!0,undefined:!0};return Is=function(r){return e(r)?hasOwnProperty.call(t,typeof r):!1},Is}var Ps,gl;function eg(){if(gl)return Ps;gl=1;var e=Zw();return Ps=function(t){if(!e(t))return!1;try{return t.constructor?t.constructor.prototype===t:!1}catch{return!1}},Ps}var Ts,_l;function tg(){if(_l)return Ts;_l=1;var e=eg();return Ts=function(t){if(typeof t!="function"||!hasOwnProperty.call(t,"length"))return!1;try{if(typeof t.length!="number"||typeof t.call!="function"||typeof t.apply!="function")return!1}catch{return!1}return!e(t)},Ts}var xs,El;function rg(){if(El)return xs;El=1;var e=tg(),t=/^\s*class[\s{/}]/,r=Function.prototype.toString;return xs=function(n){return!(!e(n)||t.test(r.call(n)))},xs}var As,Sl;function ng(){if(Sl)return As;Sl=1;var e="razdwatrzy";return As=function(){return typeof e.contains!="function"?!1:e.contains("dwa")===!0&&e.contains("foo")===!1},As}var Cs,bl;function ig(){if(bl)return Cs;bl=1;var e=String.prototype.indexOf;return Cs=function(t){return e.call(this,t,arguments[1])>-1},Cs}var Ns,Rl;function sg(){return Rl||(Rl=1,Ns=ng()()?String.prototype.contains:ig()),Ns}var $l;function sr(){if($l)return $s.exports;$l=1;var e=rh(),t=rg(),r=Zp(),n=Jp(),i=sg(),o=$s.exports=function(s,l){var u,a,c,m,p;return arguments.length<2||typeof s!="string"?(m=l,l=s,s=null):m=arguments[2],e(s)?(u=i.call(s,"c"),a=i.call(s,"e"),c=i.call(s,"w")):(u=c=!0,a=!1),p={value:l,configurable:u,enumerable:a,writable:c},m?r(n(m),p):p};return o.gs=function(s,l,u){var a,c,m,p;return typeof s!="string"?(m=u,u=l,l=s,s=null):m=arguments[3],e(l)?t(l)?e(u)?t(u)||(m=u,u=void 0):u=void 0:(m=l,l=u=void 0):l=void 0,e(s)?(a=i.call(s,"c"),c=i.call(s,"e")):(a=!0,c=!1),p={get:l,set:u,configurable:a,enumerable:c},m?r(n(m),p):p},$s.exports}var Qr={exports:{}},Ol;function og(){return Ol||(Ol=1,function(e,t){var r=sr(),n=jt(),i=Function.prototype.apply,o=Function.prototype.call,s=Object.create,l=Object.defineProperty,u=Object.defineProperties,a=Object.prototype.hasOwnProperty,c={configurable:!0,enumerable:!1,writable:!0},m,p,w,E,d,f,h;m=function(y,v){var S;return n(v),a.call(this,"__ee__")?S=this.__ee__:(S=c.value=s(null),l(this,"__ee__",c),c.value=null),S[y]?typeof S[y]=="object"?S[y].push(v):S[y]=[S[y],v]:S[y]=v,this},p=function(y,v){var S,_;return n(v),_=this,m.call(this,y,S=function(){w.call(_,y,S),i.call(v,this,arguments)}),S.__eeOnceListener__=v,this},w=function(y,v){var S,_,b,g;if(n(v),!a.call(this,"__ee__"))return this;if(S=this.__ee__,!S[y])return this;if(_=S[y],typeof _=="object")for(g=0;b=_[g];++g)(b===v||b.__eeOnceListener__===v)&&(_.length===2?S[y]=_[g?0:1]:_.splice(g,1));else(_===v||_.__eeOnceListener__===v)&&delete S[y];return this},E=function(y){var v,S,_,b,g;if(a.call(this,"__ee__")&&(b=this.__ee__[y],!!b))if(typeof b=="object"){for(S=arguments.length,g=new Array(S-1),v=1;v<S;++v)g[v-1]=arguments[v];for(b=b.slice(),v=0;_=b[v];++v)i.call(_,this,g)}else switch(arguments.length){case 1:o.call(b,this);break;case 2:o.call(b,this,arguments[1]);break;case 3:o.call(b,this,arguments[1],arguments[2]);break;default:for(S=arguments.length,g=new Array(S-1),v=1;v<S;++v)g[v-1]=arguments[v];i.call(b,this,g)}},d={on:m,once:p,off:w,emit:E},f={on:r(m),once:r(p),off:r(w),emit:r(E)},h=u({},f),e.exports=t=function(y){return y==null?s(h):u(Object(y),f)},t.methods=d}(Qr,Qr.exports)),Qr.exports}var Ls,Il;function ag(){return Il||(Il=1,Ls=function(){var e=Array.from,t,r;return typeof e!="function"?!1:(t=["raz","dwa"],r=e(t),!!(r&&r!==t&&r[1]==="dwa"))}),Ls}var Ds,Pl;function cg(){return Pl||(Pl=1,Ds=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}),Ds}var ks,Tl;function ug(){if(Tl)return ks;Tl=1;var e=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};return ks=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return e()}try{return __global__||e()}finally{delete Object.prototype.__global__}}(),ks}var Fs,xl;function Un(){return xl||(xl=1,Fs=cg()()?globalThis:ug()),Fs}var qs,Al;function lg(){if(Al)return qs;Al=1;var e=Un(),t={object:!0,symbol:!0};return qs=function(){var r=e.Symbol,n;if(typeof r!="function")return!1;n=r("test symbol");try{String(n)}catch{return!1}return!(!t[typeof r.iterator]||!t[typeof r.toPrimitive]||!t[typeof r.toStringTag])},qs}var Us,Cl;function fg(){return Cl||(Cl=1,Us=function(e){return e?typeof e=="symbol"?!0:!e.constructor||e.constructor.name!=="Symbol"?!1:e[e.constructor.toStringTag]==="Symbol":!1}),Us}var js,Nl;function nh(){if(Nl)return js;Nl=1;var e=fg();return js=function(t){if(!e(t))throw new TypeError(t+" is not a symbol");return t},js}var Ms,Ll;function dg(){if(Ll)return Ms;Ll=1;var e=sr(),t=Object.create,r=Object.defineProperty,n=Object.prototype,i=t(null);return Ms=function(o){for(var s=0,l,u;i[o+(s||"")];)++s;return o+=s||"",i[o]=!0,l="@@"+o,r(n,l,e.gs(null,function(a){u||(u=!0,r(this,l,e(a)),u=!1)})),l},Ms}var Gs,Dl;function pg(){if(Dl)return Gs;Dl=1;var e=sr(),t=Un().Symbol;return Gs=function(r){return Object.defineProperties(r,{hasInstance:e("",t&&t.hasInstance||r("hasInstance")),isConcatSpreadable:e("",t&&t.isConcatSpreadable||r("isConcatSpreadable")),iterator:e("",t&&t.iterator||r("iterator")),match:e("",t&&t.match||r("match")),replace:e("",t&&t.replace||r("replace")),search:e("",t&&t.search||r("search")),species:e("",t&&t.species||r("species")),split:e("",t&&t.split||r("split")),toPrimitive:e("",t&&t.toPrimitive||r("toPrimitive")),toStringTag:e("",t&&t.toStringTag||r("toStringTag")),unscopables:e("",t&&t.unscopables||r("unscopables"))})},Gs}var Vs,kl;function hg(){if(kl)return Vs;kl=1;var e=sr(),t=nh(),r=Object.create(null);return Vs=function(n){return Object.defineProperties(n,{for:e(function(i){return r[i]?r[i]:r[i]=n(String(i))}),keyFor:e(function(i){var o;t(i);for(o in r)if(r[o]===i)return o})})},Vs}var Bs,Fl;function mg(){if(Fl)return Bs;Fl=1;var e=sr(),t=nh(),r=Un().Symbol,n=dg(),i=pg(),o=hg(),s=Object.create,l=Object.defineProperties,u=Object.defineProperty,a,c,m;if(typeof r=="function")try{String(r()),m=!0}catch{}else r=null;return c=function(w){if(this instanceof c)throw new TypeError("Symbol is not a constructor");return a(w)},Bs=a=function p(w){var E;if(this instanceof p)throw new TypeError("Symbol is not a constructor");return m?r(w):(E=s(c.prototype),w=w===void 0?"":String(w),l(E,{__description__:e("",w),__name__:e("",n(w))}))},i(a),o(a),l(c.prototype,{constructor:e(a),toString:e("",function(){return this.__name__})}),l(a.prototype,{toString:e(function(){return"Symbol ("+t(this).__description__+")"}),valueOf:e(function(){return t(this)})}),u(a.prototype,a.toPrimitive,e("",function(){var p=t(this);return typeof p=="symbol"?p:p.toString()})),u(a.prototype,a.toStringTag,e("c","Symbol")),u(c.prototype,a.toStringTag,e("c",a.prototype[a.toStringTag])),u(c.prototype,a.toPrimitive,e("c",a.prototype[a.toPrimitive])),Bs}var Hs,ql;function yg(){return ql||(ql=1,Hs=lg()()?Un().Symbol:mg()),Hs}var zs,Ul;function vg(){if(Ul)return zs;Ul=1;var e=Object.prototype.toString,t=e.call(function(){return arguments}());return zs=function(r){return e.call(r)===t},zs}var Ws,jl;function wg(){if(jl)return Ws;jl=1;var e=Object.prototype.toString,t=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);return Ws=function(r){return typeof r=="function"&&t(e.call(r))},Ws}var Xs,Ml;function gg(){if(Ml)return Xs;Ml=1;var e=Object.prototype.toString,t=e.call("");return Xs=function(r){return typeof r=="string"||r&&typeof r=="object"&&(r instanceof String||e.call(r)===t)||!1},Xs}var Ks,Gl;function _g(){if(Gl)return Ks;Gl=1;var e=yg().iterator,t=vg(),r=wg(),n=nr(),i=jt(),o=Sr(),s=rr(),l=gg(),u=Array.isArray,a=Function.prototype.call,c={configurable:!0,enumerable:!0,writable:!0,value:null},m=Object.defineProperty;return Ks=function(p){var w=arguments[1],E=arguments[2],d,f,h,y,v,S,_,b,g,$;if(p=Object(o(p)),s(w)&&i(w),!this||this===Array||!r(this)){if(!w){if(t(p))return v=p.length,v!==1?Array.apply(null,p):(y=new Array(1),y[0]=p[0],y);if(u(p)){for(y=new Array(v=p.length),f=0;f<v;++f)y[f]=p[f];return y}}y=[]}else d=this;if(!u(p)){if((g=p[e])!==void 0){for(_=i(g).call(p),d&&(y=new d),b=_.next(),f=0;!b.done;)$=w?a.call(w,E,b.value,f):b.value,d?(c.value=$,m(y,f,c)):y[f]=$,b=_.next(),++f;v=f}else if(l(p)){for(v=p.length,d&&(y=new d),f=0,h=0;f<v;++f)$=p[f],f+1<v&&(S=$.charCodeAt(0),S>=55296&&S<=56319&&($+=p[++f])),$=w?a.call(w,E,$,h):$,d?(c.value=$,m(y,h,c)):y[h]=$,++h;v=h}}if(v===void 0)for(v=n(p.length),d&&(y=new d(v)),f=0;f<v;++f)$=w?a.call(w,E,p[f],f):p[f],d?(c.value=$,m(y,f,c)):y[f]=$;return d&&(c.value=null,y.length=v),y},Ks}var Ys,Vl;function Ua(){return Vl||(Vl=1,Ys=ag()()?Array.from:_g()),Ys}var Js,Bl;function Eg(){if(Bl)return Js;Bl=1;var e=Ua(),t=Array.isArray;return Js=function(r){return t(r)?r:e(r)},Js}var Qs,Hl;function Sg(){if(Hl)return Qs;Hl=1;var e=Eg(),t=rr(),r=jt(),n=Array.prototype.slice,i;return i=function(o){return this.map(function(s,l){return s?s(o[l]):o[l]}).concat(n.call(o,this.length))},Qs=function(o){return o=e(o),o.forEach(function(s){t(s)&&r(s)}),i.bind(o)},Qs}var Zs,zl;function bg(){if(zl)return Zs;zl=1;var e=jt();return Zs=function(t){var r;return typeof t=="function"?{set:t,get:t}:(r={get:e(t.get)},t.set!==void 0?(r.set=e(t.set),t.delete&&(r.delete=e(t.delete)),t.clear&&(r.clear=e(t.clear)),r):(r.set=r.get,r))},Zs}var eo,Wl;function Rg(){if(Wl)return eo;Wl=1;var e=Qw(),t=th(),r=sr(),n=og().methods,i=Sg(),o=bg(),s=Function.prototype.apply,l=Function.prototype.call,u=Object.create,a=Object.defineProperties,c=n.on,m=n.emit;return eo=function(p,w,E){var d=u(null),f,h,y,v,S,_,b,g,$,I,A,M,K,Q,x;return w!==!1?h=w:isNaN(p.length)?h=1:h=p.length,E.normalizer&&(I=o(E.normalizer),y=I.get,v=I.set,S=I.delete,_=I.clear),E.resolvers!=null&&(x=i(E.resolvers)),y?Q=t(function(T){var F,U,k=arguments;if(x&&(k=x(k)),F=y(k),F!==null&&hasOwnProperty.call(d,F))return A&&f.emit("get",F,k,this),d[F];if(k.length===1?U=l.call(p,this,k[0]):U=s.call(p,this,k),F===null){if(F=y(k),F!==null)throw e("Circular invocation","CIRCULAR_INVOCATION");F=v(k)}else if(hasOwnProperty.call(d,F))throw e("Circular invocation","CIRCULAR_INVOCATION");return d[F]=U,M&&f.emit("set",F,null,U),U},h):w===0?Q=function(){var T;if(hasOwnProperty.call(d,"data"))return A&&f.emit("get","data",arguments,this),d.data;if(arguments.length?T=s.call(p,this,arguments):T=l.call(p,this),hasOwnProperty.call(d,"data"))throw e("Circular invocation","CIRCULAR_INVOCATION");return d.data=T,M&&f.emit("set","data",null,T),T}:Q=function(T){var F,U=arguments,k;if(x&&(U=x(arguments)),k=String(U[0]),hasOwnProperty.call(d,k))return A&&f.emit("get",k,U,this),d[k];if(U.length===1?F=l.call(p,this,U[0]):F=s.call(p,this,U),hasOwnProperty.call(d,k))throw e("Circular invocation","CIRCULAR_INVOCATION");return d[k]=F,M&&f.emit("set",k,null,F),F},f={original:p,memoized:Q,profileName:E.profileName,get:function(T){return x&&(T=x(T)),y?y(T):String(T[0])},has:function(T){return hasOwnProperty.call(d,T)},delete:function(T){var F;hasOwnProperty.call(d,T)&&(S&&S(T),F=d[T],delete d[T],K&&f.emit("delete",T,F))},clear:function(){var T=d;_&&_(),d=u(null),f.emit("clear",T)},on:function(T,F){return T==="get"?A=!0:T==="set"?M=!0:T==="delete"&&(K=!0),c.call(this,T,F)},emit:m,updateEnv:function(){p=f.original}},y?b=t(function(T){var F,U=arguments;x&&(U=x(U)),F=y(U),F!==null&&f.delete(F)},h):w===0?b=function(){return f.delete("data")}:b=function(T){return x&&(T=x(arguments)[0]),f.delete(T)},g=t(function(){var T,F=arguments;return w===0?d.data:(x&&(F=x(F)),y?T=y(F):T=String(F[0]),d[T])}),$=t(function(){var T,F=arguments;return w===0?f.has("data"):(x&&(F=x(F)),y?T=y(F):T=String(F[0]),T===null?!1:f.has(T))}),a(Q,{__memoized__:r(!0),delete:r(b),clear:r(f.clear),_get:r(g),_has:r($)}),f},eo}var to,Xl;function $g(){if(Xl)return to;Xl=1;var e=jt(),t=qn(),r=ir(),n=Rg(),i=Qp();return to=function o(s){var l,u,a;if(e(s),l=Object(arguments[1]),l.async&&l.promise)throw new Error("Options 'async' and 'promise' cannot be used together");return hasOwnProperty.call(s,"__memoized__")&&!l.force?s:(u=i(l.length,s.length,l.async&&r.async),a=n(s,u,l),t(r,function(c,m){l[m]&&c(l[m],a,l)}),o.__profiler__&&o.__profiler__(a),a.updateEnv(),a.memoized)},to}var ro,Kl;function Og(){return Kl||(Kl=1,ro=function(e){var t,r,n=e.length;if(!n)return"";for(t=String(e[r=0]);--n;)t+=""+e[++r];return t}),ro}var no,Yl;function Ig(){return Yl||(Yl=1,no=function(e){return e?function(t){for(var r=String(t[0]),n=0,i=e;--i;)r+=""+t[++n];return r}:function(){return""}}),no}var io,Jl;function Pg(){return Jl||(Jl=1,io=function(){var e=Number.isNaN;return typeof e!="function"?!1:!e({})&&e(NaN)&&!e(34)}),io}var so,Ql;function Tg(){return Ql||(Ql=1,so=function(e){return e!==e}),so}var oo,Zl;function xg(){return Zl||(Zl=1,oo=Pg()()?Number.isNaN:Tg()),oo}var ao,ef;function ja(){if(ef)return ao;ef=1;var e=xg(),t=nr(),r=Sr(),n=Array.prototype.indexOf,i=Object.prototype.hasOwnProperty,o=Math.abs,s=Math.floor;return ao=function(l){var u,a,c,m;if(!e(l))return n.apply(this,arguments);for(a=t(r(this).length),c=arguments[1],isNaN(c)?c=0:c>=0?c=s(c):c=t(this.length)-s(o(c)),u=c;u<a;++u)if(i.call(this,u)&&(m=this[u],e(m)))return u;return-1},ao}var co,tf;function Ag(){if(tf)return co;tf=1;var e=ja(),t=Object.create;return co=function(){var r=0,n=[],i=t(null);return{get:function(o){var s=0,l=n,u,a=o.length;if(a===0)return l[a]||null;if(l=l[a]){for(;s<a-1;){if(u=e.call(l[0],o[s]),u===-1)return null;l=l[1][u],++s}return u=e.call(l[0],o[s]),u===-1?null:l[1][u]||null}return null},set:function(o){var s=0,l=n,u,a=o.length;if(a===0)l[a]=++r;else{for(l[a]||(l[a]=[[],[]]),l=l[a];s<a-1;)u=e.call(l[0],o[s]),u===-1&&(u=l[0].push(o[s])-1,l[1].push([[],[]])),l=l[1][u],++s;u=e.call(l[0],o[s]),u===-1&&(u=l[0].push(o[s])-1),l[1][u]=++r}return i[r]=o,r},delete:function(o){var s=0,l=n,u,a=i[o],c=a.length,m=[];if(c===0)delete l[c];else if(l=l[c]){for(;s<c-1;){if(u=e.call(l[0],a[s]),u===-1)return;m.push(l,u),l=l[1][u],++s}if(u=e.call(l[0],a[s]),u===-1)return;for(o=l[1][u],l[0].splice(u,1),l[1].splice(u,1);!l[0].length&&m.length;)u=m.pop(),l=m.pop(),l[0].splice(u,1),l[1].splice(u,1)}delete i[o]},clear:function(){n=[],i=t(null)}}},co}var uo,rf;function Cg(){if(rf)return uo;rf=1;var e=ja();return uo=function(){var t=0,r=[],n=[];return{get:function(i){var o=e.call(r,i[0]);return o===-1?null:n[o]},set:function(i){return r.push(i[0]),n.push(++t),t},delete:function(i){var o=e.call(n,i);o!==-1&&(r.splice(o,1),n.splice(o,1))},clear:function(){r=[],n=[]}}},uo}var lo,nf;function Ng(){if(nf)return lo;nf=1;var e=ja(),t=Object.create;return lo=function(r){var n=0,i=[[],[]],o=t(null);return{get:function(s){for(var l=0,u=i,a;l<r-1;){if(a=e.call(u[0],s[l]),a===-1)return null;u=u[1][a],++l}return a=e.call(u[0],s[l]),a===-1?null:u[1][a]||null},set:function(s){for(var l=0,u=i,a;l<r-1;)a=e.call(u[0],s[l]),a===-1&&(a=u[0].push(s[l])-1,u[1].push([[],[]])),u=u[1][a],++l;return a=e.call(u[0],s[l]),a===-1&&(a=u[0].push(s[l])-1),u[1][a]=++n,o[n]=s,n},delete:function(s){for(var l=0,u=i,a,c=[],m=o[s];l<r-1;){if(a=e.call(u[0],m[l]),a===-1)return;c.push(u,a),u=u[1][a],++l}if(a=e.call(u[0],m[l]),a!==-1){for(s=u[1][a],u[0].splice(a,1),u[1].splice(a,1);!u[0].length&&c.length;)a=c.pop(),u=c.pop(),u[0].splice(a,1),u[1].splice(a,1);delete o[s]}},clear:function(){i=[[],[]],o=t(null)}}},lo}var sf={},fo,of;function ih(){if(of)return fo;of=1;var e=jt(),t=qn(),r=Function.prototype.call;return fo=function(n,i){var o={},s=arguments[2];return e(i),t(n,function(l,u,a,c){o[u]=r.call(i,s,l,u,a,c)}),o},fo}var po,af;function Ma(){if(af)return po;af=1;var e=function(r){if(typeof r!="function")throw new TypeError(r+" is not a function");return r},t=function(r){var n=document.createTextNode(""),i,o,s=0;return new r(function(){var l;if(i)o&&(i=o.concat(i));else{if(!o)return;i=o}if(o=i,i=null,typeof o=="function"){l=o,o=null,l();return}for(n.data=s=++s%2;o;)l=o.shift(),o.length||(o=null),l()}).observe(n,{characterData:!0}),function(l){if(e(l),i){typeof i=="function"?i=[i,l]:i.push(l);return}i=l,n.data=s=++s%2}};return po=function(){if(typeof process=="object"&&process&&typeof process.nextTick=="function")return process.nextTick;if(typeof queueMicrotask=="function")return function(r){queueMicrotask(e(r))};if(typeof document=="object"&&document){if(typeof MutationObserver=="function")return t(MutationObserver);if(typeof WebKitMutationObserver=="function")return t(WebKitMutationObserver)}return typeof setImmediate=="function"?function(r){setImmediate(e(r))}:typeof setTimeout=="function"||typeof setTimeout=="object"?function(r){setTimeout(e(r),0)}:null}(),po}var cf;function Lg(){if(cf)return sf;cf=1;var e=Ua(),t=ih(),r=eh(),n=th(),i=Ma(),o=Array.prototype.slice,s=Function.prototype.apply,l=Object.create;return ir().async=function(u,a){var c=l(null),m=l(null),p=a.memoized,w=a.original,E,d,f;a.memoized=n(function(h){var y=arguments,v=y[y.length-1];return typeof v=="function"&&(E=v,y=o.call(y,0,-1)),p.apply(d=this,f=y)},p);try{r(a.memoized,p)}catch{}a.on("get",function(h){var y,v,S;if(E){if(c[h]){typeof c[h]=="function"?c[h]=[c[h],E]:c[h].push(E),E=null;return}y=E,v=d,S=f,E=d=f=null,i(function(){var _;hasOwnProperty.call(m,h)?(_=m[h],a.emit("getasync",h,S,v),s.call(y,_.context,_.args)):(E=y,d=v,f=S,p.apply(v,S))})}}),a.original=function(){var h,y,v,S;return E?(h=e(arguments),y=function _(b){var g,$,I=_.id;if(I==null){i(s.bind(_,this,arguments));return}if(delete _.id,g=c[I],delete c[I],!!g)return $=e(arguments),a.has(I)&&(b?a.delete(I):(m[I]={context:this,args:$},a.emit("setasync",I,typeof g=="function"?1:g.length))),typeof g=="function"?S=s.call(g,this,$):g.forEach(function(A){S=s.call(A,this,$)},this),S},v=E,E=d=f=null,h.push(y),S=s.call(w,this,h),y.cb=v,E=y,S):s.call(w,this,arguments)},a.on("set",function(h){if(!E){a.delete(h);return}c[h]?typeof c[h]=="function"?c[h]=[c[h],E.cb]:c[h].push(E.cb):c[h]=E.cb,delete E.cb,E.id=h,E=null}),a.on("delete",function(h){var y;hasOwnProperty.call(c,h)||m[h]&&(y=m[h],delete m[h],a.emit("deleteasync",h,o.call(y.args,1)))}),a.on("clear",function(){var h=m;m=l(null),a.emit("clearasync",t(h,function(y){return o.call(y.args,1)}))})},sf}var uf={},ho,lf;function Dg(){if(lf)return ho;lf=1;var e=Array.prototype.forEach,t=Object.create;return ho=function(r){var n=t(null);return e.call(arguments,function(i){n[i]=!0}),n},ho}var mo,ff;function sh(){return ff||(ff=1,mo=function(e){return typeof e=="function"}),mo}var yo,df;function kg(){if(df)return yo;df=1;var e=sh();return yo=function(t){try{return t&&e(t.toString)?t.toString():String(t)}catch{throw new TypeError("Passed argument cannot be stringifed")}},yo}var vo,pf;function Fg(){if(pf)return vo;pf=1;var e=Sr(),t=kg();return vo=function(r){return t(e(r))},vo}var wo,hf;function qg(){if(hf)return wo;hf=1;var e=sh();return wo=function(t){try{return t&&e(t.toString)?t.toString():String(t)}catch{return"<Non-coercible to string value>"}},wo}var go,mf;function Ug(){if(mf)return go;mf=1;var e=qg(),t=/[\n\r\u2028\u2029]/g;return go=function(r){var n=e(r);return n.length>100&&(n=n.slice(0,99)+"…"),n=n.replace(t,function(i){return JSON.stringify(i).slice(1,-1)}),n},go}var Zr={exports:{}},yf;function oh(){if(yf)return Zr.exports;yf=1,Zr.exports=e,Zr.exports.default=e;function e(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}return Zr.exports}var vf;function jg(){if(vf)return uf;vf=1;var e=ih(),t=Dg(),r=Fg(),n=Ug(),i=oh(),o=Ma(),s=Object.create,l=t("then","then:finally","done","done:finally");return ir().promise=function(u,a){var c=s(null),m=s(null),p=s(null);if(u===!0)u=null;else if(u=r(u),!l[u])throw new TypeError("'"+n(u)+"' is not valid promise mode");a.on("set",function(w,E,d){var f=!1;if(!i(d)){m[w]=d,a.emit("setasync",w,1);return}c[w]=1,p[w]=d;var h=function(_){var b=c[w];if(f)throw new Error(`Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)
|
||
Consider to rely on 'then' or 'done' mode instead.`);b&&(delete c[w],m[w]=_,a.emit("setasync",w,b))},y=function(){f=!0,c[w]&&(delete c[w],delete p[w],a.delete(w))},v=u;if(v||(v="then"),v==="then"){var S=function(){o(y)};d=d.then(function(_){o(h.bind(this,_))},S),typeof d.finally=="function"&&d.finally(S)}else if(v==="done"){if(typeof d.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");d.done(h,y)}else if(v==="done:finally"){if(typeof d.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if(typeof d.finally!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");d.done(h),d.finally(y)}}),a.on("get",function(w,E,d){var f;if(c[w]){++c[w];return}f=p[w];var h=function(){a.emit("getasync",w,E,d)};i(f)?typeof f.done=="function"?f.done(h):f.then(function(){o(h)}):h()}),a.on("delete",function(w){if(delete p[w],c[w]){delete c[w];return}if(hasOwnProperty.call(m,w)){var E=m[w];delete m[w],a.emit("deleteasync",w,[E])}}),a.on("clear",function(){var w=m;m=s(null),c=s(null),p=s(null),a.emit("clearasync",e(w,function(E){return[E]}))})},uf}var wf={},gf;function Mg(){if(gf)return wf;gf=1;var e=jt(),t=qn(),r=ir(),n=Function.prototype.apply;return r.dispose=function(i,o,s){var l;if(e(i),s.async&&r.async||s.promise&&r.promise){o.on("deleteasync",l=function(u,a){n.call(i,null,a)}),o.on("clearasync",function(u){t(u,function(a,c){l(c,a)})});return}o.on("delete",l=function(u,a){i(a)}),o.on("clear",function(u){t(u,function(a,c){l(c,a)})})},wf}var _f={},_o,Ef;function Gg(){return Ef||(Ef=1,_o=2147483647),_o}var Eo,Sf;function Vg(){if(Sf)return Eo;Sf=1;var e=nr(),t=Gg();return Eo=function(r){if(r=e(r),r>t)throw new TypeError(r+" exceeds maximum possible timeout");return r},Eo}var bf;function Bg(){if(bf)return _f;bf=1;var e=Ua(),t=qn(),r=Ma(),n=oh(),i=Vg(),o=ir(),s=Function.prototype,l=Math.max,u=Math.min,a=Object.create;return o.maxAge=function(c,m,p){var w,E,d,f;c=i(c),c&&(w=a(null),E=p.async&&o.async||p.promise&&o.promise?"async":"",m.on("set"+E,function(h){w[h]=setTimeout(function(){m.delete(h)},c),typeof w[h].unref=="function"&&w[h].unref(),f&&(f[h]&&f[h]!=="nextTick"&&clearTimeout(f[h]),f[h]=setTimeout(function(){delete f[h]},d),typeof f[h].unref=="function"&&f[h].unref())}),m.on("delete"+E,function(h){clearTimeout(w[h]),delete w[h],f&&(f[h]!=="nextTick"&&clearTimeout(f[h]),delete f[h])}),p.preFetch&&(p.preFetch===!0||isNaN(p.preFetch)?d=.333:d=l(u(Number(p.preFetch),1),0),d&&(f={},d=(1-d)*c,m.on("get"+E,function(h,y,v){f[h]||(f[h]="nextTick",r(function(){var S;f[h]==="nextTick"&&(delete f[h],m.delete(h),p.async&&(y=e(y),y.push(s)),S=m.memoized.apply(v,y),p.promise&&n(S)&&(typeof S.done=="function"?S.done(s,s):S.then(s,s)))}))}))),m.on("clear"+E,function(){t(w,function(h){clearTimeout(h)}),w={},f&&(t(f,function(h){h!=="nextTick"&&clearTimeout(h)}),f={})}))},_f}var Rf={},So,$f;function Hg(){if($f)return So;$f=1;var e=nr(),t=Object.create,r=Object.prototype.hasOwnProperty;return So=function(n){var i=0,o=1,s=t(null),l=t(null),u=0,a;return n=e(n),{hit:function(c){var m=l[c],p=++u;if(s[p]=c,l[c]=p,!m)return++i,i<=n?void 0:(c=s[o],a(c),c);if(delete s[m],o===m)for(;!r.call(s,++o););},delete:a=function(c){var m=l[c];if(m&&(delete s[m],delete l[c],--i,o===m)){if(!i){u=0,o=1;return}for(;!r.call(s,++o););}},clear:function(){i=0,o=1,s=t(null),l=t(null),u=0}}},So}var Of;function zg(){if(Of)return Rf;Of=1;var e=nr(),t=Hg(),r=ir();return r.max=function(n,i,o){var s,l,u;n=e(n),n&&(l=t(n),s=o.async&&r.async||o.promise&&r.promise?"async":"",i.on("set"+s,u=function(a){a=l.hit(a),a!==void 0&&i.delete(a)}),i.on("get"+s,u),i.on("delete"+s,l.delete),i.on("clear"+s,l.clear))},Rf}var If={},Pf;function Wg(){if(Pf)return If;Pf=1;var e=sr(),t=ir(),r=Object.create,n=Object.defineProperties;return t.refCounter=function(i,o,s){var l,u;l=r(null),u=s.async&&t.async||s.promise&&t.promise?"async":"",o.on("set"+u,function(a,c){l[a]=c||1}),o.on("get"+u,function(a){++l[a]}),o.on("delete"+u,function(a){delete l[a]}),o.on("clear"+u,function(){l={}}),n(o.memoized,{deleteRef:e(function(){var a=o.get(arguments);return a===null||!l[a]?null:--l[a]?!1:(o.delete(a),!0)}),getRefCount:e(function(){var a=o.get(arguments);return a===null||!l[a]?0:l[a]})})},If}var bo,Tf;function Xg(){if(Tf)return bo;Tf=1;var e=Jp(),t=Qp(),r=$g();return bo=function(n){var i=e(arguments[1]),o;return i.normalizer||(o=i.length=t(i.length,n.length,i.async),o!==0&&(i.primitive?o===!1?i.normalizer=Og():o>1&&(i.normalizer=Ig()(o)):o===!1?i.normalizer=Ag()():o===1?i.normalizer=Cg()():i.normalizer=Ng()(o))),i.async&&Lg(),i.promise&&jg(),i.dispose&&Mg(),i.maxAge&&Bg(),i.max&&zg(),i.refCounter&&Wg(),r(n,i)},bo}var Kg=Xg();const Fe=$e(Kg);async function ye(e){try{return await Wm.access(e),!0}catch{return!1}}function Yg(e){try{return Vm.accessSync(e),!0}catch{return!1}}function Jg(){if(_r()&&typeof process.env.SUDO_USER=="string"&&process.env.SUDO_USER!=="")return process.platform==="darwin"?J("/Users/",process.env.SUDO_USER):J("/home/",process.env.SUDO_USER);{const e=lp();return e===""?void 0:e}}const Qg=/^~(?=$|\/|\\)/;function rt(e){const t=Jg();return t===void 0?e:e.replace(Qg,t)}const{appendFile:ah,readFile:Ga,writeFile:Zg}=Pn,e_="envosman",ch=rt("~/.envosmanrc");async function t_(e){const t=rt("~/.bashrc"),r=rt("~/.profile"),n=Ia(e.rcPath);if(n===t||n===r)return;const i=e.guard??e_,o=`
|
||
# ${i}
|
||
if [[ "$SOURCE_${i.toUpperCase()}RC" != 0 && -f "${n}" ]]; then source "${n}"; fi
|
||
`;try{await Promise.all([r_(e),xf(o,t),xf(o,r)])}catch(s){ve(`Failed to add ${o} to .profile or .bashrc. You should add it manually: ${s}`)}}const Va=Fe(t_,{promise:!0});async function r_(e){const t=e.guard===void 0?`
|
||
# Automatically Generated by envosman
|
||
`:`
|
||
# Automatically Generated by envosman ${e.guard}
|
||
export SOURCE_${e.guard.toUpperCase()}RC=0
|
||
`;await ye(e.rcPath)&&((await Ga(e.rcPath,"utf8")).includes(t)||(await ah(e.rcPath,`
|
||
${t}
|
||
`),z(`Added ${t} to ${e.rcPath}`)))}async function xf(e,t){await ye(t)&&((await Ga(t,"utf-8")).includes(e)||(await ah(t,e),z(`${e} was added to ${t}`)))}async function n_(e){if(await ye(e.rcPath)){const t=(await Ga(e.rcPath,"utf-8")).split(`
|
||
`),r=[...new Set(t.reverse())].reverse();await Zg(e.rcPath,r.join(`
|
||
`)),await Er(e.rcPath)}}var Ro,Af;function i_(){if(Af)return Ro;Af=1;const e=it,t=e.platform()!=="win32",r=e.release(),n=/(\d+\.\d+)\.(\d+)/,i=(o="",s="")=>/1\d+\.\d+/.test(o)&&Number(s)>=17134.1184;return Ro=function(o){return t?o.replace(/(\s+)/g,"\\$1"):i(...n.exec(r).splice(1))?o:o.replace(/(\s+)/g,"%20")},Ro}var s_=i_();const o_=$e(s_);var an={exports:{}},$o,Cf;function a_(){if(Cf)return $o;Cf=1;var e=/[|\\{}()[\]^$+*?.]/g;return $o=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(e,"\\$&")},$o}var c_=an.exports,Nf;function u_(){return Nf||(Nf=1,function(){var e,t;e=a_(),t=function(r){return r.split("").reverse().join("")},an.exports=function(r,n,i){var o;return n==null&&(n="'"),i==null&&(i="\\"),typeof r!="string"?r:(o=new RegExp("(["+e(n)+"])(?!"+e(i)+")","g"),t(t(r).replace(o,"$1"+i)))}}.call(c_)),an.exports}var l_=u_();const f_=$e(l_);function d_(e,t=!1){const r=t?o_(e):e;return f_(r,'"',"\\")}const{GITHUB_ACTIONS:p_}=xt,{appendFile:Lf}=Pn;async function Ie(e,t,r={}){const n={escapeSpace:!1,overwrite:!0,rcPath:ch,...r},i=d_(t??"",n.escapeSpace);try{if(p_)try{if(!n.overwrite&&process.env[e]!==void 0){z(`Environment variable ${e} is already defined. Skipping.`);return}Ee.exportVariable(e,i)}catch(o){Ae(o),await Df(e,i,n)}else await Df(e,i,n)}catch(o){Ae(`${o}
|
||
Failed to export environment variable ${e}=${i}. You should add it manually.`)}}async function Df(e,t,r){const n=t??"";switch(process.platform){case"win32":{if(!r.overwrite&&process.env[e]!==void 0){z(`Environment variable ${e} is already defined. Skipping.`);return}await Wp(`[Environment]::SetEnvironmentVariable('${e}', '${n}', "User")`),z(`${e}='${n}' was set in the environment.`);return}case"linux":case"darwin":{await Va(r),r.overwrite?(await Lf(r.rcPath,`
|
||
export ${e}="${n}"
|
||
`),z(`${e}="${n}" was added to "${r.rcPath}`)):(await Lf(r.rcPath,`
|
||
if [ -z "\${${e}}" ]; then export ${e}="${n}"; fi
|
||
`),z(`if not defined ${e} then ${e}="${n}" was added to "${r.rcPath}`)),process.env[e]=n;return}}process.env[e]=n}const{GITHUB_ACTIONS:h_}=xt,{appendFile:m_}=Pn;async function Re(e,t={}){const r={rcPath:ch,...t};if(!v_(e)){process.env.PATH=`${e}${mn}${process.env.PATH}`;try{if(h_)try{Ee.addPath(e)}catch(n){Ae(n),await kf(e,r)}else await kf(e,r)}catch(n){Ae(`${n}
|
||
Failed to add ${e} to the percistent PATH. You should add it manually.`)}}}async function kf(e,t){switch(process.platform){case"win32":{await Wp(`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${e};$USER_PATH", "User")`),z(`"${e}" was added to the PATH.`);return}case"linux":case"darwin":{await Va(t),await m_(t.rcPath,`
|
||
export PATH="${e}:$PATH"
|
||
`),z(`"${e}" was added to "${t.rcPath}"`);return}default:return}}const y_=[/\/usr\/bin\/?/,/\/usr\/local\/bin\/?/];function v_(e){return y_.some(t=>t.test(e))?(process.env.PATH?.split(mn)??[]).includes(e):!1}function Ba(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 cn={exports:{}},w_=cn.exports,Ff;function uh(){return Ff||(Ff=1,function(e){(function(){var t={},r={create:n,addLocale:i,pluralize:o};e.exports=r;function n(a){return l(a),{pluralize:function(c,m){return o(a,c,m)}}}function i(a,c){t[a]=c}function o(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 s(a){return typeof t[a]<"u"}function l(a){s(a)||u(a)}function u(a){try{Ba(__dirname+"/../locales/"+a+".js")}catch{throw Error("Failed to load the following locale: "+a)}}}).call(w_)}(cn)),cn.exports}var Oo,qf;function lh(){return qf||(qf=1,Oo=uh()),Oo}var g_=lh();const __=$e(g_);var Io={},Uf;function E_(){return Uf||(Uf=1,function(){var e=this,t;typeof Ba=="function"?t=uh():t=e.numerous,t.addLocale("en",function(n){var i=Math.floor(Math.abs(n)),o=n.toString().replace(/^[^.]*\.?/,"").length;return typeof n=="string"&&(n=parseInt(n,10)),i===1&&o===0?"one":"other"})}.call(Io)),Io}var S_=E_();const b_=$e(S_);var Po={exports:{}},jf;function R_(){return jf||(jf=1,function(e,t){e.exports=!!(typeof process<"u"&&process.versions&&process.versions.node)}(Po)),Po.exports}var To,Mf;function $_(){if(Mf)return To;Mf=1;const e=lh(),t=R_(),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},i={};To={create:s,addLocale:o,defaultConfig:n};function o(d){Array.isArray(d)||(d=[d]);for(const f of d){const{id:h,data:y}=f;i[h]=y}}function s(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),v=[];for(const S of y){const[_,b]=S;if(b>0&&v.push(p(_,b,h)),v.length>=h.span)break}return v.join(h.delimiter)}function u(d,f){const{autoload:h}=f;if(!a(d))if(t&&h)c(d);else throw new Error(`Missing locale: ${d}, you must load it manually before using it`)}function a(d){return!!i[d]}function c(d){try{o(Ba(`../locales/${d}.js`))}catch(f){throw Error(`Failed to load locale: ${d} from ../locales/${d}.js. If using a bundled time-delta, set 'autoloadLocales: false' in the config: ${f}`)}}function m(d,f){let h=f-d;const y=[];return r.some(function(v){const S=v[0],_=v[1],b=Math.floor(h/_);if(h-=b*_,y.push([S,b]),h<=0)return!0}),y}function p(d,f,h){const y=w(h);return e.pluralize(h.locale,f,y[d]).replace("{0}",f)}function w(d){const f=i[d.locale];let h=d.unitTypeLookupOrder.slice();h.unshift(d.unitType),h=E(h);let y=null;if(h.some(function(v){if(typeof f[v]<"u")return y=f[v],!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 To}var xo,Gf;function O_(){return Gf||(Gf=1,xo=$_()),xo}var I_=O_();const Vf=$e(I_);var Ao,Bf;function P_(){return Bf||(Bf=1,Ao={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:{one:"{0}m",other:"{0}m"},seconds:{one:"{0}s",other:"{0}s"}},short:{years:{one:"{0} yr",other:"{0} yrs"},months:{one:"{0} mth",other:"{0} mths"},weeks:{one:"{0} wk",other:"{0} wks"},days:{one:"{0} day",other:"{0} days"},hours:{one:"{0} hr",other:"{0} hr"},minutes:{one:"{0} min",other:"{0} min"},seconds:{one:"{0} sec",other:"{0} sec"}}}}),Ao}var T_=P_();const x_=$e(T_);var A_=Rp();const jn=$e(A_);function _n(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Co,Hf;function C_(){if(Hf)return Co;Hf=1;var e=ue;function t(n,i){if(typeof n!="string"||n.length===0)return n;var o=e.basename(n,e.extname(n))+i,s=e.join(e.dirname(n),o);return r(n)?"."+e.sep+s:s}function r(n){var i=n.slice(0,2);return i==="."+e.sep||i==="./"}return Co=t,Co}var N_=C_();const L_=$e(N_);function bt(e,t){return Object.keys(t).forEach(r=>{r==="default"||r==="__esModule"||e.hasOwnProperty(r)||Object.defineProperty(e,r,{enumerable:!0,get(){return t[r]}})}),e}function At(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}function D_(e,t=!0){return t?er(e):er(e,In(e))}function k_(e){return Lm(e).replace(RegExp(_n(fp)+"$"),"")}function ge(e,t=".exe",r=""){return process.platform==="win32"?`${e}${t}`:`${e}${r}`}function F_(e,t){const r=In(e),n=`${t}${er(e,r)}${r}`;return J(be(e),n)}function q_(e,t){const r=In(e),n=`${er(e,r)}${t}${r}`;return J(be(e),n)}function Sa(e,t=".cmd",r=".sh"){return process.platform==="win32"?`${e}${t}`:`${e}${r}`}function fh(e){return process.platform==="win32"?e:"./"+e}function U_(e){const t=In(e).length;return e.slice(0,-t)}function j_(e,t){return L_(e,t)}function M_(e,t){const r=Dm(t,e);return!(!r||r===".."||r.startsWith(".."+fp)||r===Ia(e))}var Rt={},dh={};At(dh,"name",()=>D_);var ph={};At(ph,"normalizeTrim",()=>k_);var hh={};At(hh,"addExeExt",()=>ge);var mh={};At(mh,"addNamePrefix",()=>F_);var yh={};At(yh,"addNameSuffix",()=>q_);var vh={};At(vh,"addShExt",()=>Sa);var wh={};At(wh,"addShRelativePrefix",()=>fh);var gh={};At(gh,"removeExt",()=>U_);var _h={};At(_h,"replaceExt",()=>j_);var zf={};At(zf,"isPathInside",()=>M_),bt(Rt,dh),bt(Rt,ph),bt(Rt,hh),bt(Rt,mh),bt(Rt,yh),bt(Rt,vh),bt(Rt,wh),bt(Rt,gh),bt(Rt,_h),bt(Rt,zf);var G_=$p();const Eh=$e(G_);function Sh(){if(process.platform!=="linux")return!1;try{return Yg("/etc/alpine-release")}catch{return!1}}async function V_(){if(!Sh())return!1;try{return await fe("apk"),!0}catch{return!1}}const Oe=Fe(V_,{promise:!0});async function B_(){await le("apk",["update"],{stdio:"inherit"})}const En=Fe(B_,{promise:!0});async function H_(e){if(!await Oe())throw new Error("apk is not available on this system");try{const t="/etc/apk/repositories";if(!await ye(t))throw new Error(`APK repositories file not found at ${t}`);return z(`Adding repository: ${e}`),await Ym(t,`${e}
|
||
`),await En.clear(),await En(),z(`Successfully added repository: ${e}`),!0}catch(t){throw new Error(`Failed to add repository ${e}: ${t}`)}}async function bh(){const e=(await z_()).split(".").slice(0,2).join(".");return H_(`https://dl-cdn.alpinelinux.org/alpine/v${e}/community/`)}async function z_(){const e="/etc/alpine-release";if(!await ye(e))throw new Error(`Alpine release file not found at ${e}`);return pr(e,"utf8")}async function W_(e){try{const{exitCode:t}=await wt("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 wt("apk",["info","-v",e.name],{stdio:["ignore","pipe","ignore"]});return r.trim().split("-").slice(-1)[0]===e.version}catch{return!1}}async function Rh(e){return(await Promise.all(e.map(async r=>await W_(r)?void 0:r))).filter(r=>r!==void 0).map($h)}function $h(e){return e.version!==void 0&&e.version!==""?`${e.name}=${e.version}`:e.name}async function X_(){const e=await Rh([{name:"bash"}]);e.length!==0&&he("apk",["add",...e],{...st})}const K_=Fe(X_,{promise:!0});async function De(e,t=!1){if(!await Oe())throw new Error("apk is not available on this system");try{await K_(),t&&await En.clear(),await En();const r=await Rh(e);return r.length===0?(z("All packages are already installed"),{binDir:"/usr/bin"}):(z(`Installing ${r.join(" ")}`),await wt("apk",["add",...r]),z(`Successfully installed ${r.join(" ")}`),{binDir:"/usr/bin"})}catch(r){throw ve(`Failed to install ${e.map(n=>$h(n)).join(" ")}: ${r}`),r}}const{GITHUB_ACTIONS:Y_}=xt,{appendFile:J_}=Pn;async function Q_(e,t,r=40){await wt("update-alternatives",["--install",`/usr/bin/${e}`,e,t,r.toString()])}async function vt(e,t,r,n=40){Y_?await Q_(e,t,n):(await Va(r),await J_(r.rcPath,`
|
||
if [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${e} ${e} ${t} ${n}; fi
|
||
`))}var No={},Wf;function Z_(){return Wf||(Wf=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(v,S){for(var _,b=0;b<S.length;b++)_=S[b],_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(v,_.key,_)}return function(v,S,_){return S&&y(v.prototype,S),_&&y(v,_),v}}(),n=je,i=w(n),o=Jm,s=ue,l=w(s),u=yp,a=w(u),c=Pa,m=w(c),p=Tn;function w(y){if(y&&y.__esModule)return y;var v={};if(y!=null)for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(v[S]=y[S]);return v.default=y,v}function E(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}function d(y,v){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:y}function f(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);y.prototype=Object.create(v&&v.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(y,v):y.__proto__=v)}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 v(S,_){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};E(this,v);var g=d(this,(v.__proto__||Object.getPrototypeOf(v)).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(v,y),r(v,[{key:"start",value:function(){var _=this,b=function(){return new Promise(function(g,$){_.__promise={resolve:g,reject:$},_.__start()})};return this.__opts.resumeIfFileExists&&this.state!==this.__states.RESUMED?this.getTotalSize().then(function(g){var $=g.name,I=g.total,A=_.__opts.override;if(_.__opts.override=!0,_.__filePath=_.__getFilePath($),_.__opts.override=A,_.__filePath&&i.existsSync(_.__filePath)){var M=_.__getFilesizeInBytes(_.__filePath);return M===I?b():_.resumeFromFile(_.__filePath,{total:I,fileName:$})}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,$){i.access(_.__filePath,function(I){return I?(_.__emitStop(),g(!0)):void i.unlink(_.__filePath,function(A){return A?(_.__setState(_.__states.FAILED),_.emit("error",A),$(A)):(_.__emitStop(),void g(!0))})})})};return this.__requestAbort(),this.__closeFileStream().then(function(){return _.__opts.removeOnStop?b():(_.__emitStop(),Promise.resolve(!0))})}},{key:"pipe",value:function(_){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null;return this.__pipes.push({stream:_,options:b}),_}},{key:"unpipe",value:function(){var _=this,b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null,g=function(I){return _.__response?_.__response.unpipe(I):I.unpipe()};if(b){var $=this.__pipes.find(function(I){return I.stream===b});return void($&&(g(b),this.__pipes=this.__pipes.filter(function(I){return I.stream!==b})))}this.__pipes.forEach(function(I){return g(I.stream)}),this.__pipes=[]}},{key:"getDownloadPath",value:function(){return this.__filePath}},{key:"isResumable",value:function(){return this.__isResumable}},{key:"updateOptions",value:function(_){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";this.__opts=Object.assign({},this.__opts,_),this.__headers=this.__opts.headers,-1<this.__opts.timeout&&(this.__opts.httpRequestOptions.timeout=this.__opts.timeout,this.__opts.httpsRequestOptions.timeout=this.__opts.timeout),(typeof this.__opts.progressThrottle!="number"||0>this.__opts.progressThrottle)&&(this.__opts.progressThrottle=this.__defaultOpts.progressThrottle),this.url=b||this.url,this.__reqOptions=this.__getReqOptions(this.__opts.method,this.url,this.__opts.headers),this.__initProtocol(this.url)}},{key:"getOptions",value:function(){return this.__opts}},{key:"getMetadata",value:function(){return this.__opts.metadata}},{key:"getStats",value:function(){return{total:this.__total,name:this.__fileName,downloaded:this.__downloaded,progress:this.__progress,speed:this.__statsEstimate.bytes}}},{key:"getTotalSize",value:function(){var _=this;return new Promise(function(b,g){var $=function(A){_.__initProtocol(A);var M=Object.assign({},_.__headers);M.hasOwnProperty("range")&&delete M.range;var K=_.__getReqOptions("HEAD",A,M);return Object.assign({},_.__reqOptions,K)},I=function(A,M){var K=_.__protocol.request(M,function(Q){if(_.__isRequireRedirect(Q)){var x=/^https?:\/\//.test(Q.headers.location)?Q.headers.location:new o.URL(Q.headers.location,A).href;return _.emit("redirected",x,A),I(x,$(x))}return Q.statusCode===200?void b({name:_.__getFileNameFromHeaders(Q.headers,Q),total:parseInt(Q.headers["content-length"])||null}):g(new Error("Response status was "+Q.statusCode))});K.on("error",function(Q){return g(Q)}),K.on("timeout",function(){return g(new Error("timeout"))}),K.on("uncaughtException",function(Q){return g(Q)}),K.end()};I(_.url,$(_.url))})}},{key:"getResumeState",value:function(){return{downloaded:this.__downloaded,filePath:this.__filePath,fileName:this.__fileName,total:this.__total}}},{key:"resumeFromFile",value:function(_){var b=this,g=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return this.__opts.override=!0,this.__filePath=_,(g.total&&g.fileName?Promise.resolve({name:g.fileName,total:g.total}):this.getTotalSize()).then(function($){var I=$.name,A=$.total;return b.__total=g.total||A,b.__fileName=g.fileName||I,b.__downloaded=g.downloaded||b.__getFilesizeInBytes(b.__filePath),b.__reqOptions.headers.range="bytes="+b.__downloaded+"-",b.__isResumed=!0,b.__isResumable=!0,b.__setState(b.__states.RESUMED),b.emit("resume",b.__isResumed),new Promise(function(M,K){b.__promise={resolve:M,reject:K},b.__start()})})}},{key:"__start",value:function(){this.__isRedirected||this.state===this.__states.RESUMED||(this.emit("start"),this.__setState(this.__states.STARTED),this.__initProtocol(this.url)),this.__response=null,this.__isAborted=!1,this.__request&&!this.__request.destroyed&&this.__request.destroy(),this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__request=this.__downloadRequest(this.__promise.resolve,this.__promise.reject),this.__request.on("error",this.__onError(this.__promise.resolve,this.__promise.reject)),this.__request.on("timeout",this.__onTimeout(this.__promise.resolve,this.__promise.reject)),this.__request.on("uncaughtException",this.__onError(this.__promise.resolve,this.__promise.reject,!0)),this.__opts.body&&this.__request.write(this.__opts.body),this.__request.end()}},{key:"__resolvePending",value:function(){if(this.__promise){var _=this.__promise.resolve;return this.__promise=null,_(!0)}}},{key:"__downloadRequest",value:function(_,b){var g=this;return this.__protocol.request(this.__reqOptions,function($){if(g.__response=$,g.__isResumed||(g.__total=parseInt($.headers["content-length"])||null,g.__resetStats()),g.__isRequireRedirect($)){var I=/^https?:\/\//.test($.headers.location)?$.headers.location:new o.URL($.headers.location,g.url).href;return g.__isRedirected=!0,g.__initProtocol(I),g.emit("redirected",I,g.url),g.__start()}if($.statusCode!==200&&$.statusCode!==206){var A=new Error("Response status was "+$.statusCode);return A.status=$.statusCode||0,A.body=$.body||"",g.__setState(g.__states.FAILED),g.emit("error",A),b(A)}(g.__opts.forceResume||$.headers.hasOwnProperty("accept-ranges")&&$.headers["accept-ranges"]!=="none")&&(g.__isResumable=!0),g.__startDownload($,_,b)})}},{key:"__startDownload",value:function(_,b,g){var $=this,I=_;if(this.__isResumed)this.__fileStream=i.createWriteStream(this.__filePath,{flags:"a"});else{var A=this.__getFileNameFromHeaders(_.headers);if(this.__filePath=this.__getFilePath(A),this.__fileName=this.__filePath.split(l.sep).pop(),i.existsSync(this.__filePath)){var M=this.__getFilesizeInBytes(this.__filePath),K=this.__total?this.__total:0;if(t(this.__opts.override)==="object"&&this.__opts.override.skip&&(this.__opts.override.skipSmaller||M>=K))return this.emit("skip",{totalSize:this.__total,fileName:this.__fileName,filePath:this.__filePath,downloadedSize:M}),this.__setState(this.__states.SKIPPED),b(!0)}this.__fileStream=i.createWriteStream(this.__filePath,{})}this.emit("download",{fileName:this.__fileName,filePath:this.__filePath,totalSize:this.__total,isResumed:this.__isResumed,downloadedSize:this.__downloaded}),this.__retryCount=0,this.__isResumed=!1,this.__isRedirected=!1,this.__setState(this.__states.DOWNLOADING),this.__statsEstimate.time=new Date,this.__statsEstimate.throttleTime=new Date,I.on("data",function(Q){return $.__calculateStats(Q.length)}),this.__pipes.forEach(function(Q){I.pipe(Q.stream,Q.options),I=Q.stream}),I.pipe(this.__fileStream),I.on("error",this.__onError(b,g)),this.__fileStream.on("finish",this.__onFinished(b,g)),this.__fileStream.on("error",this.__onError(b,g))}},{key:"__hasFinished",value:function(){return!this.__isAborted&&[this.__states.PAUSED,this.__states.STOPPED,this.__states.RETRY,this.__states.FAILED,this.__states.RESUMED].indexOf(this.state)===-1}},{key:"__isRequireRedirect",value:function(_){return 300<_.statusCode&&400>_.statusCode&&_.headers.hasOwnProperty("location")&&_.headers.location}},{key:"__onFinished",value:function(_,b){var g=this;return function(){g.__fileStream.close(function($){if($)return b($);if(g.__hasFinished()){var I=!!g.__total&&g.__downloaded!==g.__total;if(I&&g.__isResumable&&g.__opts.resumeOnIncomplete&&g.__resumeRetryCount<=g.__opts.resumeOnIncompleteMaxRetry)return g.__resumeRetryCount++,g.emit("warning",new Error("uncomplete download, retrying")),g.resume();g.__setState(g.__states.FINISHED),g.__pipes=[],g.emit("end",{fileName:g.__fileName,filePath:g.__filePath,totalSize:g.__total,incomplete:I,onDiskSize:g.__getFilesizeInBytes(g.__filePath),downloadedSize:g.__downloaded})}return _(g.__downloaded===g.__total)})}}},{key:"__closeFileStream",value:function(){var _=this;return this.__fileStream?new Promise(function(b,g){_.__fileStream.close(function($){return $?g($):b(!0)})}):Promise.resolve(!0)}},{key:"__onError",value:function(_,b){var g=this,$=2<arguments.length&&arguments[2]!==void 0&&arguments[2];return function(I){return g.__pipes=[],$&&g.__requestAbort(),g.state===g.__states.STOPPED||g.state===g.__states.FAILED?void 0:g.__opts.retry?g.__retry(I).catch(function(A){g.__removeFile().finally(function(){g.__setState(g.__states.FAILED),g.emit("error",A||I),b(A||I)})}):g.__removeFile().finally(function(){g.__setState(g.__states.FAILED),g.emit("error",I),b(I)})}}},{key:"__retry",value:function(){var _=this,b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null;if(!this.__opts.retry||t(this.__opts.retry)!=="object")return Promise.reject(b||new Error("wrong retry options"));var g=this.__opts.retry,$=g.delay,I=$===void 0?0:$,A=g.maxRetries,M=A===void 0?999:A;return this.__retryCount>=M?Promise.reject(b||new Error("reached the maximum retries")):(this.__retryCount++,this.__setState(this.__states.RETRY),this.emit("retry",this.__retryCount,this.__opts.retry,b),this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(K){return K.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return new Promise(function(K){return _.__retryTimeout=setTimeout(function(){return K(0<_.__downloaded?_.resume():_.__start())},I)})}))}},{key:"__onTimeout",value:function(_,b){var g=this;return function(){return g.__requestAbort(),g.__opts.retry?g.__retry(new Error("timeout")).catch(function($){g.__removeFile().finally(function(){g.__setState(g.__states.FAILED),$?b($):(g.emit("timeout"),b(new Error("timeout")))})}):g.__removeFile().finally(function(){g.__setState(g.__states.FAILED),g.emit("timeout"),b(new Error("timeout"))})}}},{key:"__resetStats",value:function(){this.__retryCount=0,this.__downloaded=0,this.__progress=0,this.__resumeRetryCount=0,this.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0}}},{key:"__getFileNameFromHeaders",value:function(_,b){var g="",$=/.*filename\*=.*?'.*?'([^"].+?[^"])(?:(?:;)|$)/i,I=/.*filename="(.*?)";?/i,A=/.*filename=([^"].+?[^"])(?:(?:;)|$)/i,M=_.hasOwnProperty("content-disposition"),K=M?_["content-disposition"].match($):null,Q=!M||K?null:_["content-disposition"].match(I),x=!M||K||Q?null:_["content-disposition"].match(A);return M&&(K||Q||x)?(g=_["content-disposition"],g=g.trim(),K?g=K[1]:Q?g=Q[1]:x&&(g=x[1]),g=g.replace(/[/\\]/g,"")):0<l.basename(new o.URL(this.requestURL).pathname).length?g=l.basename(new o.URL(this.requestURL).pathname):g=new o.URL(this.requestURL).hostname+".html",this.__opts.fileName?this.__getFileNameFromOpts(g,b):g.replace(/\.*$/,"")}},{key:"__getFilePath",value:function(_){var b=l.join(this.__destFolder,_),g=b;return this.__opts.override||this.state===this.__states.RESUMED||(g=this.__uniqFileNameSync(g),b!==g&&this.emit("renamed",{path:g,fileName:g.split(l.sep).pop(),prevPath:b,prevFileName:b.split(l.sep).pop()})),g}},{key:"__getFileNameFromOpts",value:function(_,b){if(!this.__opts.fileName)return _;if(typeof this.__opts.fileName=="string")return this.__opts.fileName;if(typeof this.__opts.fileName=="function"){var g=l.join(this.__destFolder,_);return b&&b.headers||this.__response&&this.__response.headers?this.__opts.fileName(_,g,(b||this.__response).headers["content-type"]):this.__opts.fileName(_,g)}if(t(this.__opts.fileName)==="object"){var $=this.__opts.fileName,I=$.name,A=!!$.hasOwnProperty("ext")&&$.ext;if(typeof A=="string")return I+"."+A;if(typeof A=="boolean"){if(A)return I;var M=_.includes(".")?_.split(".").pop():"";return M===""?I:I+"."+M}}return _}},{key:"__calculateStats",value:function(_){var b=new Date,g=b-this.__statsEstimate.time,$=b-this.__statsEstimate.throttleTime,I=this.__total||0;_&&(this.__downloaded+=_,this.__progress=I===0?0:100*(this.__downloaded/I),(this.__downloaded===I||1e3<g)&&(this.__statsEstimate.time=b,this.__statsEstimate.bytes=this.__downloaded-this.__statsEstimate.prevBytes,this.__statsEstimate.prevBytes=this.__downloaded),(this.__downloaded===I||$>this.__opts.progressThrottle)&&(this.__statsEstimate.throttleTime=b,this.emit("progress.throttled",this.getStats())),this.emit("progress",this.getStats()))}},{key:"__setState",value:function(_){this.state=_,this.emit("stateChanged",this.state)}},{key:"__getReqOptions",value:function(_,b){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},$=new o.URL(b),I={protocol:$.protocol,host:$.hostname,port:$.port,path:$.pathname+$.search,method:_};return g&&(I.headers=g),I}},{key:"__getFilesizeInBytes",value:function(_){try{var b=i.statSync(_,{throwIfNoEntry:!1}),g=b.size||0;return g}catch($){this.emit("warning",$)}return 0}},{key:"__validate",value:function(_,b){if(typeof _!="string")throw new Error("URL should be an string");if(_.trim()==="")throw new Error("URL couldn't be empty");if(typeof b!="string")throw new Error("Destination Folder should be an string");if(b.trim()==="")throw new Error("Destination Folder couldn't be empty");if(!i.existsSync(b))throw new Error("Destination Folder must exist");var g=i.statSync(b);if(!g.isDirectory())throw new Error("Destination Folder must be a directory");try{i.accessSync(b,i.constants.W_OK)}catch{throw new Error("Destination Folder must be writable")}return!0}},{key:"__initProtocol",value:function(_){var b=this.__getReqOptions(this.__opts.method,_,this.__headers);this.requestURL=_,-1<_.indexOf("https://")?(this.__protocol=m,b.agent=new m.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},b,this.__opts.httpsRequestOptions)):(this.__protocol=a,b.agent=new a.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},b,this.__opts.httpRequestOptions))}},{key:"__uniqFileNameSync",value:function(_){if(typeof _!="string"||_==="")return _;try{i.accessSync(_,i.F_OK);var b=_.match(/(.*)(\([0-9]+\))(\..*)$/),g=b?b[1].trim():_,$=b?parseInt(b[2].replace(/\(|\)/,"")):0,I=_.split(".").pop();return I!==_&&0<I.length?(I="."+I,g=g.replace(I,"")):I="",this.__uniqFileNameSync(g+" ("+ ++$+")"+I)}catch{return _}}},{key:"__removeFile",value:function(){var _=this;return new Promise(function(b){return _.__fileStream?void _.__fileStream.close(function(g){return g&&_.emit("warning",g),_.__opts.removeOnFail?i.access(_.__filePath,function($){return $?b():void i.unlink(_.__filePath,function(I){I&&_.emit("warning",g),b()})}):void b()}):b()})}},{key:"__requestAbort",value:function(){this.__isAborted=!0,this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__response&&this.__response.destroy(),this.__request&&(this.__request.destroy?this.__request.destroy():this.__request.abort())}},{key:"__emitStop",value:function(){this.__resolvePending(),this.__setState(this.__states.STOPPED),this.emit("stop")}}]),v}(p.EventEmitter)}(No)),No}var br=Z_();function Oh(){return process.platform==="linux"&&fe.sync("nala",{nothrow:!0})!==null}function eE(){return process.platform==="linux"&&fe.sync("apt-fast",{nothrow:!0})!==null}function me(){return process.platform==="linux"&&fe.sync("apt-get",{nothrow:!0})!==null}function Gr(){if(Oh())return"nala";if(eE())return"apt-fast";if(me())return"apt-get";throw new Error("No apt command found")}function lt(e="apt-get"){const t={...process.env,DEBIAN_FRONTEND:"noninteractive"};return e==="nala"&&(t.LANG===void 0&&(t.LANG="C.UTF-8"),t.LC_ALL===void 0&&(t.LC_ALL="C.UTF-8")),t}function tE(e){return"keyUrl"in e?Ih(e):nE(e)}const rE="/etc/apt/trusted.gpg.d",Xf="keyserver.ubuntu.com";async function nE({key:e,keyServer:t=Xf,fileName:r,keyStorePath:n=Xf}){try{Th(r);const i=J(n,r);return await ye(i)||(Ph(),await wt("gpg",["--no-default-keyring","--keyring",`gnupg-ring:${i}`,"--keyserver",t,"--recv-keys",e]),await wt("chmod",["644",i])),i}catch(i){ve(`Failed to add apt key via server ${t}: ${i}`);return}}async function Ih({keyUrl:e,fileName:t,keyStorePath:r=rE}){try{Th(t);const n=J(r,t);if(!await ye(n)){Ph(),await de([{name:"ca-certificates"}]);const i=J(Ue(),t),o=new br.DownloaderHelper(e,Ue(),{fileName:t});o.on("error",s=>{throw new Error(`Failed to download ${e}: ${s}`)}),await o.start(),he("gpg",["--no-default-keyring","--keyring",`gnupg-ring:${n}`,"--import",i]),he("chmod",["644",n])}return n}catch(n){ve(`Failed to add apt key via download ${e}: ${n}`);return}}function Ph(){he("gpg",["-k"])}function Th(e){if(!e.endsWith(".gpg"))throw new Error(`Key file name must end with .gpg: ${e}`)}const Rr="Dpkg::Lock::Timeout=300";async function Ha(e){try{const{stdout:t}=await le("dpkg",["-s",e],{env:lt("apt-get"),stdio:"pipe"});return typeof t!="string"?!1:t.split(`
|
||
`).some(n=>n.startsWith("Status: install ok installed"))}catch{return!1}}async function iE(e){try{const{stdout:t}=await le("dpkg",["-l",e],{env:lt("apt-get"),stdio:"pipe"});return typeof t!="string"?!1:t.split(`
|
||
`).some(n=>n.startsWith("ii"))}catch{return!1}}let xh=!1;function sE(e=Gr()){he(e,["update","-o",Rr],{...st,env:lt(e)}),xh=!0}const hr=Fe(sE);var It;(function(e){e[e.NameDashVersion=0]="NameDashVersion",e[e.NameEqualsVersion=1]="NameEqualsVersion",e[e.Name=2]="Name",e[e.None=3]="None"})(It||(It={}));async function Ah(e,t=Gr()){return(await Promise.all(e.map(r=>ba(r,t)))).filter(r=>r!==void 0)}async function ba(e,t=Gr()){const r=await aE(t,e);return await Ha(r)?void 0:r}async function Ch(e,t,r,n){const i=r!==void 0&&r!=="",o=!i||n;if(i){if(await oE(e,t,r))return It.NameDashVersion;if(await Kf(e,`${t}=${r}`))return It.NameEqualsVersion}const s=()=>{i&&n&&z(`Could not find package ${t} ${r}. Falling back to latest version.`)};return o&&await Kf(e,t)?(s(),It.Name):xh?o?(s(),It.Name):It.None:(hr(e),Ch(e,t,r,n))}async function oE(e,t,r){try{const{stdout:n}=await le("apt-cache",["search","--names-only",`^${_n(t)}-${_n(r)}$`],{env:lt(e),stdio:"pipe"});if(n.trim()!=="")return!0}catch{}return!1}async function Kf(e,t){try{const{stdout:r}=await le("apt-cache",["show",t],{env:lt(e),stdio:"pipe",verbose:!0});if(r.trim()!=="")return!0}catch{}return!1}async function aE(e,t){const{name:r,version:n,fallBackToLatest:i=!1}=t;switch(await Ch(e,r,n,i)){case It.NameDashVersion:return`${r}-${n}`;case It.NameEqualsVersion:return`${r}=${n}`;case It.Name:return r;default:throw new Error(`Could not find package '${r}' ${n??"with unspecified version"}`)}}async function cE(e){hr(e);const t=await Ah([{name:"ca-certificates"},{name:"gnupg"},{name:"apt-utils"}],e);t.length!==0&&he(e,["install","-y","--fix-broken","-o",Rr,...t],{...st,env:lt(e)})}const Nh=Fe(cE,{promise:!0});function uE(e="apt-get"){try{const{stdout:t}=he("add-apt-repository",["--help"],{...st,env:lt(e),stdio:"pipe"});return t.includes("--no-update")}catch{return!1}}const Lh=Fe(uE);async function lE(e,t=Gr()){await Nh(t),await Dh();try{he("add-apt-repository",["-y",Lh(t)?"--no-update":void 0,e].filter(r=>r!==void 0),{...st,env:lt(t)})}catch{he("add-apt-repository",["-y",e],{...st,env:lt(t)})}hr.clear(),hr(t)}async function Dh(){if(await Ha("software-properties-common"))return;const e="apt-get";he(e,["install","-y","--fix-broken","-o",Rr,"software-properties-common"],{...st,env:lt(e)})}const fE=["E: Could not get lock","dpkg: error processing archive","dpkg: error: dpkg status database is locked by another process"];async function de(e,t=!1){try{const r=Gr();for(const{name:i,version:o}of e)z(`Installing ${i} ${o??""} via ${r}`);t&&hr.clear(),hr(r),await dE(r,e);const n=await Ah(e,r);if(n.length===0)return z("All packages are already installed"),{binDir:"/usr/bin/"};await Nh(r);try{await pE(e),he(r,["install","--fix-broken","-y",...n],{...st,env:lt(r)})}catch(i){if(hE(i))fE.some(o=>typeof i.stderr=="string"&&i.stderr.includes(o))&&(ve(`Failed to install packages ${n}. Retrying...`),he(r,["install","--fix-broken","-y","-o",Rr,...n],{...st,env:lt(r)}));else throw i}return{binDir:"/usr/bin/"}}catch(r){const n=r instanceof Error?`${r.message}
|
||
${r.stack}`:String(r);throw new Error(`Failed to install apt packages: ${n}`)}}async function dE(e,t){const r=[...new Set(t.flatMap(n=>n.repository??[]))];await Promise.all(r.map(n=>lE(n,e)))}async function pE(e){await Promise.all(e.map(async t=>{t.key!==void 0&&await tE(t.key)}))}function hE(e){return typeof e.stderr=="string"}let ur;async function Yf(){if(!me())return;if(typeof ur=="string")return{binDir:ur};const e=fe.sync("apt-fast",{nothrow:!0});return e!==null?(ur=be(e),{binDir:ur}):(ur="/usr/bin",await mE(),{binDir:ur})}async function mE(){const e=de([{name:"bash"},{name:"wget"}]),t=new br.DownloaderHelper("https://raw.githubusercontent.com/ilikenwf/apt-fast/c2cd0a0420d3f2d647dc82cf749bfd58c4697dac/quick-install.sh",Ue(),{fileName:"install-apt-fast.sh"});t.on("error",u=>{throw new Error(`Failed to download install-apt-fast.sh: ${u}`)}),await t.start();const r=J(Ue(),"install-apt-fast.sh");let n=await pr(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 yn(r,n),await e;try{he("bash",[r])}catch(u){Ae(`Failed to install apt-fast via installer: ${u}`)}const i="/etc/apt-fast.conf";let o=await pr(i,"utf8");const s=["_APTMGR","DOWNLOADBEFORE"];for(const u of s)o=o.replace(new RegExp(`^#\\s*${u}`,"m"),u);const l=J(Ue(),"apt-fast.conf");await yn(l,o),he("mv",[l,i])}let kt;async function yE({version:e}={}){if(!me())return;if(typeof kt=="string")return{binDir:kt};const t=fe.sync("nala",{nothrow:!0});if(t!==null)return kt=be(t),{binDir:kt};await de([{name:"python3-apt"}]),kt="/usr/bin";try{const r=await ba({name:"nala",version:e});if(r!==void 0)return await de([{name:r}]),{binDir:kt}}catch(r){z(`Failed to install nala: ${r}`)}try{const r=await ba({name:"nala-legacy"});if(r!==void 0)return await de([{name:r}],!0),{binDir:kt}}catch(r){z(`Failed to install nala-legacy: ${r}`)}return await vE(),{binDir:kt}}async function vE(){const e=new br.DownloaderHelper("https://gitlab.com/volian/volian-archive/-/raw/1939afc3f80638dca2bbedde74bbd86731703cc8/install-nala.sh",Ue(),{fileName:"install-nala.sh"});e.on("error",n=>{throw new Error(`Failed to download install-nala.sh: ${n}`)}),await e.start();const t=J(Ue(),"install-nala.sh"),r=await pr(t,"utf8");await yn(t,r.replace(/sudo/g,"")),await de([{name:"wget"}]);try{he("bash",[t])}catch(n){Ae(`Failed to install nala via installer: ${n}`),he("apt",["install","-y","-t","nala","nala"])}}let Yt;async function za(e={}){if(!["darwin","linux"].includes(process.platform)||process.platform==="linux"&&process.arch!=="x64"){ve(`Brew is not supported on ${process.platform} ${process.arch}`);return}if(typeof Yt=="string")return{binDir:Yt};const t=await fe("brew",{nothrow:!0});if(t!==null)return Yt=be(t),{binDir:Yt};await de([{name:"ca-certificates"}]);const r=new br.DownloaderHelper("https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh",Ue(),{fileName:"install-brew.sh"});return r.on("error",n=>{throw new Error(`Failed to download the brew installer script: ${n}`)}),await r.start(),ze("/bin/bash",[r.getDownloadPath()],{stdio:"inherit",env:{NONINTERACTIVE:"1"}}),Yt=Wa(),await Re(Yt,e.rcOptions),{binDir:Yt}}function Wa(){return J(Xa(),"bin")}function kh(){return J(Wa(),"brew")}function Xa(){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 Fh(e,t){return t!==void 0&&t!==""?`${e}@${t}`:e}async function wE(e,t){const r=Fh(e,t),n=await Jf(r);if(n!==void 0)return n;const i=await Jf(e);return i!==void 0?i:gE(e,r)}async function Jf(e){try{const t=kh();return(await le(t,["--prefix",e],{stdio:"pipe"})).stdout}catch{return}}function gE(e,t){const r=Xa(),n=J(r,"opt",t);if(Qt(n))return n;const i=J(r,"opt",e);if(Qt(i))return i;const o=J(r,"Cellar",t);if(Qt(o))return o;const s=J(r,"Cellar",e);if(Qt(s))return s;const l=J(r,"lib",t);if(Qt(l))return l;const u=J(r,"lib",e);if(Qt(u))return u}let Qf=!1;async function Ge(e,t,r={}){"overwrite"in r||(r.overwrite=!0),r.cask===!0&&(r.overwrite=!1),z(`Installing ${e} ${t??""} via brew`),(!Qf||fe.sync("brew",{nothrow:!0})===null)&&(await za(),Qf=!0);const n=kh(),i=["install",Fh(e,t)];for(const[u,a]of Object.entries(r))typeof a=="boolean"&&a?i.push(`--${u}`):typeof a=="string"&&i.push(`--${u}`,a);const o=ze(n,[...i,"--dry-run"],{stdio:"pipe"});o.exitCode===0&&new RegExp(`.*${e}.* is already installed and up-to-date.[\\s\\S]*`).test(o.stderr)?z(`${e} ${t??""} is already installed and up-to-date`):ze(n,i,{stdio:"inherit"});const l=await wE(e,t);return l===void 0?(ve(`Failed to find installation directory for ${e} ${t}`),{binDir:Wa(),installDir:void 0}):{installDir:l,binDir:J(l,"bin")}}var Ka=ka();const ne={rcPath:rt("~/.cpprc"),guard:"cpp"};async function qh(){if(process.platform==="darwin")try{const e=await Ka.getExecOutput("xcrun --sdk macosx --show-sdk-path"),t=e.stdout||e.stderr;t?await Ie("SDKROOT",t.trim(),ne):Ae("SDKROOT not set")}catch(e){Ae(e)}}let Lo;function Ne(){return process.platform!=="linux"?!1:(Lo===void 0&&(Lo=fe.sync("dnf",{nothrow:!0})!==null),Lo)}let Do;function Pe(){return process.platform!=="linux"?!1:(Do===void 0&&(Do=fe.sync("pacman",{nothrow:!0})!==null),Do)}async function Ce(e){for(const{name:r,version:n}of e)z(`Installing ${r} ${n??""} via dnf`);const t=await Promise.all(e.map(r=>_E(r.name,r.version)));return he("dnf",["-y","install",...t]),{binDir:"/usr/bin/"}}async function _E(e,t){if(t===void 0||t==="")return e;const{stdout:r}=await le("dnf",["search","-q",`${e}-${t}`]);if(r.trim()!=="")return`${e}-${t}`;const{stdout:n}=await le("dnf",["search","-q",`${e}${t}`]);return n.trim()!==""?`${e}${t}`:(ve(`Failed to install ${e} ${t} via dnf, trying without version`),e)}let Zf=!1,ed=!1;async function _e(e,t,r){z(`Installing ${e} ${t??""} via pacman`);const n="pacman";r==="yay"&&bE(),!Zf&&r!=="yay"&&(he(n,["-Sy","--noconfirm"]),Zf=!0),!ed&&r!=="yay"&&(he(n,["-S","--noconfirm","base-devel"]),ed=!0);const i=o=>r==="yay"?gr()&&Uh?he("su",["-","builder","-c",`yay -S --noconfirm ${o}`]):ze(r,["-S","--noconfirm",o]):he(r??n,["-S","--noconfirm",o]);if(t!==void 0&&t!=="")if((await SE(n,e)).includes(t))try{i(`${e}=${t}`)}catch{i(`${e}${t}`)}else z(`Failed to install ${e} ${t} via pacman, trying without version`),i(e);else i(e);return{binDir:"/usr/bin/"}}const EE=/Version\s*:\s*(.*)/g;async function SE(e,t){const r=[];try{const{stdout:n}=await le(e,["-Si",t]);for(const i of n.matchAll(EE))r.push(i[1])}catch(n){ve(`Failed to get available versions for ${t}: ${n}`)}return r}let Uh=!1;function bE(){if(fe.sync("yay",{nothrow:!0})===null)try{he("pacman",["-S","--noconfirm","base-devel","git"]);const e=J(Ue(),"yay");he("mkdir",["-p",e]),gr()?(ve("Creating a non-root user to build yay"),he("useradd",["-m","-G","wheel","builder"]),he("passwd",["-d","builder"]),he("chown",["-R","builder:builder",e]),he("bash",["-c",'echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers']),Uh=!0,ze("su",["-","builder","-c",`git clone https://aur.archlinux.org/yay.git ${e}`],{stdio:"inherit"}),ze("su",["-","builder","-c",`cd ${e} && makepkg -si --noconfirm`],{stdio:"inherit"})):(ze("git",["clone","https://aur.archlinux.org/yay.git",e],{stdio:"inherit",cwd:Ue()}),ze("makepkg",["-si","--noconfirm"],{stdio:"inherit",cwd:e})),ze("rm",["-rf",e],{stdio:"inherit"})}catch(e){throw new Error(`Failed to install yay: ${e}. Install yay manually and re-run the script.`)}}var RE=Tp();const mr=$e(RE);var $E=ft();const OE=$e($E);var IE=Mr();const Ya=$e(IE),jh=/v?(\d\S*)/;async function Mh(e,t=jh){try{const r=await Ka.getExecOutput(e,["--version"]),i=(r.stdout||r.stderr||"").trim().match(t)?.[1];return mr(i)??void 0}catch(r){console.error(r);return}}async function Ra(e,t,r=jh){const n=await Mh(e,r);if(n!==void 0&&t!=="")try{return OE(n,t)!==-1}catch{return Ya(n,t)}else return!1}function Ja(e){if(jn(e)===null)try{const t=mr(e);if(t!==null)return z(`Coerced version '${e}' to '${t}'`),t.version}catch{}return e}function PE(e){if(jn(e)===null)try{const t=mr(e);if(t!==null){const r=/^[<=>^~]/.test(t.version)?t.version:`^${t.version}`;return z(`Coerced version '${e}' to '${r}'`),r}}catch{}return e}function TE(e){return Number.parseInt(e.replace(/^v/,""),10)}function xE(e){return e.match(/^v/)?e:`v${e}`}function AE(e,t){const r=mr(e),n=mr(t);return r!==null&&n!==null?n.compare(r):t.localeCompare(e)}async function Gh(){const e=J(ES,"gcc_matcher.json");if(!await ye(e))return ve("the gcc_matcher.json file does not exist in the same folder as setup-cpp.js");z(`::add-matcher::${e}`)}async function Sn(e){const t=await pr(e,"utf-8");return JSON.parse(t)}function bn(e,t){const r=Object.keys(e),n=new Map;if(t.filterMapTag===void 0)for(const l of r)n.set(l,l);else for(const l of r){const u=t.filterMapTag(l);u!==void 0&&n.set(u,l)}if(n.size===0)return;const i=t.versionSatisfies??Ya,o=PE(t.version),s=[];for(const[l,u]of n.entries())i(l,o)&&s.push(u);if(s.length!==0)for(const l of s){let u=e[l];if(u===void 0||(t.filterName!==void 0&&(u=u.filter(t.filterName)),u.length===0))continue;const a=CE(l,u,t);if(a!==void 0)return a}}function CE(e,t,r){if((r.keywords===void 0||r.keywords.length===0)&&(r.optionalKeywords===void 0||r.optionalKeywords.length===0))return{tag:e,name:t[0]};let n=[];if(r.keywords!==void 0&&r.keywords.length!==0)for(const i of t)r.keywords.every(o=>typeof o=="string"&&i.includes(o)?!0:Array.isArray(o)&&o.some(s=>i.includes(s)))&&n.push(i);else n=t;if(n.length!==0){if(r.optionalKeywords!==void 0&&r.optionalKeywords.length!==0){const i=n.map(l=>{let u=0;for(const a of r.optionalKeywords)(typeof a=="string"&&l.includes(a)||Array.isArray(a)&&a.some(c=>l.includes(c)))&&u++;return u}),o=Math.max(...i),s=i.indexOf(o);return{tag:e,name:n[s]}}return{tag:e,name:n[0]}}}var ko={},en={},td;function Me(){return td||(td=1,en.fromCallback=function(e){return Object.defineProperty(function(...t){if(typeof t[t.length-1]=="function")e.apply(this,t);else return new Promise((r,n)=>{t.push((i,o)=>i!=null?n(i):r(o)),e.apply(this,t)})},"name",{value:e.name})},en.fromPromise=function(e){return Object.defineProperty(function(...t){const r=t[t.length-1];if(typeof r!="function")return e.apply(this,t);t.pop(),e.apply(this,t).then(n=>r(null,n),r)},"name",{value:e.name})}),en}var Fo,rd;function NE(){if(rd)return Fo;rd=1;var e=Qm,t=process.cwd,r=null,n=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return r||(r=t.call(process)),r};try{process.cwd()}catch{}if(typeof process.chdir=="function"){var i=process.chdir;process.chdir=function(s){r=null,i.call(process,s)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,i)}Fo=o;function o(s){e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&l(s),s.lutimes||u(s),s.chown=m(s.chown),s.fchown=m(s.fchown),s.lchown=m(s.lchown),s.chmod=a(s.chmod),s.fchmod=a(s.fchmod),s.lchmod=a(s.lchmod),s.chownSync=p(s.chownSync),s.fchownSync=p(s.fchownSync),s.lchownSync=p(s.lchownSync),s.chmodSync=c(s.chmodSync),s.fchmodSync=c(s.fchmodSync),s.lchmodSync=c(s.lchmodSync),s.stat=w(s.stat),s.fstat=w(s.fstat),s.lstat=w(s.lstat),s.statSync=E(s.statSync),s.fstatSync=E(s.fstatSync),s.lstatSync=E(s.lstatSync),s.chmod&&!s.lchmod&&(s.lchmod=function(f,h,y){y&&process.nextTick(y)},s.lchmodSync=function(){}),s.chown&&!s.lchown&&(s.lchown=function(f,h,y,v){v&&process.nextTick(v)},s.lchownSync=function(){}),n==="win32"&&(s.rename=typeof s.rename!="function"?s.rename:function(f){function h(y,v,S){var _=Date.now(),b=0;f(y,v,function g($){if($&&($.code==="EACCES"||$.code==="EPERM"||$.code==="EBUSY")&&Date.now()-_<6e4){setTimeout(function(){s.stat(v,function(I,A){I&&I.code==="ENOENT"?f(y,v,g):S($)})},b),b<100&&(b+=10);return}S&&S($)})}return Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h}(s.rename)),s.read=typeof s.read!="function"?s.read:function(f){function h(y,v,S,_,b,g){var $;if(g&&typeof g=="function"){var I=0;$=function(A,M,K){if(A&&A.code==="EAGAIN"&&I<10)return I++,f.call(s,y,v,S,_,b,$);g.apply(this,arguments)}}return f.call(s,y,v,S,_,b,$)}return Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h}(s.read),s.readSync=typeof s.readSync!="function"?s.readSync:function(f){return function(h,y,v,S,_){for(var b=0;;)try{return f.call(s,h,y,v,S,_)}catch(g){if(g.code==="EAGAIN"&&b<10){b++;continue}throw g}}}(s.readSync);function l(f){f.lchmod=function(h,y,v){f.open(h,e.O_WRONLY|e.O_SYMLINK,y,function(S,_){if(S){v&&v(S);return}f.fchmod(_,y,function(b){f.close(_,function(g){v&&v(b||g)})})})},f.lchmodSync=function(h,y){var v=f.openSync(h,e.O_WRONLY|e.O_SYMLINK,y),S=!0,_;try{_=f.fchmodSync(v,y),S=!1}finally{if(S)try{f.closeSync(v)}catch{}else f.closeSync(v)}return _}}function u(f){e.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(h,y,v,S){f.open(h,e.O_SYMLINK,function(_,b){if(_){S&&S(_);return}f.futimes(b,y,v,function(g){f.close(b,function($){S&&S(g||$)})})})},f.lutimesSync=function(h,y,v){var S=f.openSync(h,e.O_SYMLINK),_,b=!0;try{_=f.futimesSync(S,y,v),b=!1}finally{if(b)try{f.closeSync(S)}catch{}else f.closeSync(S)}return _}):f.futimes&&(f.lutimes=function(h,y,v,S){S&&process.nextTick(S)},f.lutimesSync=function(){})}function a(f){return f&&function(h,y,v){return f.call(s,h,y,function(S){d(S)&&(S=null),v&&v.apply(this,arguments)})}}function c(f){return f&&function(h,y){try{return f.call(s,h,y)}catch(v){if(!d(v))throw v}}}function m(f){return f&&function(h,y,v,S){return f.call(s,h,y,v,function(_){d(_)&&(_=null),S&&S.apply(this,arguments)})}}function p(f){return f&&function(h,y,v){try{return f.call(s,h,y,v)}catch(S){if(!d(S))throw S}}}function w(f){return f&&function(h,y,v){typeof y=="function"&&(v=y,y=null);function S(_,b){b&&(b.uid<0&&(b.uid+=4294967296),b.gid<0&&(b.gid+=4294967296)),v&&v.apply(this,arguments)}return y?f.call(s,h,y,S):f.call(s,h,S)}}function E(f){return f&&function(h,y){var v=y?f.call(s,h,y):f.call(s,h);return v&&(v.uid<0&&(v.uid+=4294967296),v.gid<0&&(v.gid+=4294967296)),v}}function d(f){if(!f||f.code==="ENOSYS")return!0;var h=!process.getuid||process.getuid()!==0;return!!(h&&(f.code==="EINVAL"||f.code==="EPERM"))}}return Fo}var qo,nd;function LE(){if(nd)return qo;nd=1;var e=Ur.Stream;qo=t;function t(r){return{ReadStream:n,WriteStream:i};function n(o,s){if(!(this instanceof n))return new n(o,s);e.call(this);var l=this;this.path=o,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,s=s||{};for(var u=Object.keys(s),a=0,c=u.length;a<c;a++){var m=u[a];this[m]=s[m]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){l._read()});return}r.open(this.path,this.flags,this.mode,function(p,w){if(p){l.emit("error",p),l.readable=!1;return}l.fd=w,l.emit("open",w),l._read()})}function i(o,s){if(!(this instanceof i))return new i(o,s);e.call(this),this.path=o,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var l=Object.keys(s),u=0,a=l.length;u<a;u++){var c=l[u];this[c]=s[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=r.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}return qo}var Uo,id;function DE(){if(id)return Uo;id=1,Uo=t;var e=Object.getPrototypeOf||function(r){return r.__proto__};function t(r){if(r===null||typeof r!="object")return r;if(r instanceof Object)var n={__proto__:e(r)};else var n=Object.create(null);return Object.getOwnPropertyNames(r).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(r,i))}),n}return Uo}var tn,sd;function Vr(){if(sd)return tn;sd=1;var e=je,t=NE(),r=LE(),n=DE(),i=xn,o,s;typeof Symbol=="function"&&typeof Symbol.for=="function"?(o=Symbol.for("graceful-fs.queue"),s=Symbol.for("graceful-fs.previous")):(o="___graceful-fs.queue",s="___graceful-fs.previous");function l(){}function u(f,h){Object.defineProperty(f,o,{get:function(){return h}})}var a=l;if(i.debuglog?a=i.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(a=function(){var f=i.format.apply(i,arguments);f="GFS4: "+f.split(/\n/).join(`
|
||
GFS4: `),console.error(f)}),!e[o]){var c=at[o]||[];u(e,c),e.close=function(f){function h(y,v){return f.call(e,y,function(S){S||E(),typeof v=="function"&&v.apply(this,arguments)})}return Object.defineProperty(h,s,{value:f}),h}(e.close),e.closeSync=function(f){function h(y){f.apply(e,arguments),E()}return Object.defineProperty(h,s,{value:f}),h}(e.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){a(e[o]),qr.equal(e[o].length,0)})}at[o]||u(at,e[o]),tn=m(n(e)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!e.__patched&&(tn=m(e),e.__patched=!0);function m(f){t(f),f.gracefulify=m,f.createReadStream=H,f.createWriteStream=W;var h=f.readFile;f.readFile=y;function y(X,ie,se){return typeof ie=="function"&&(se=ie,ie=null),we(X,ie,se);function we(D,L,N,j){return h(D,L,function(B){B&&(B.code==="EMFILE"||B.code==="ENFILE")?p([we,[D,L,N],B,j||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}var v=f.writeFile;f.writeFile=S;function S(X,ie,se,we){return typeof se=="function"&&(we=se,se=null),D(X,ie,se,we);function D(L,N,j,B,ee){return v(L,N,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?p([D,[L,N,j,B],Y,ee||Date.now(),Date.now()]):typeof B=="function"&&B.apply(this,arguments)})}}var _=f.appendFile;_&&(f.appendFile=b);function b(X,ie,se,we){return typeof se=="function"&&(we=se,se=null),D(X,ie,se,we);function D(L,N,j,B,ee){return _(L,N,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?p([D,[L,N,j,B],Y,ee||Date.now(),Date.now()]):typeof B=="function"&&B.apply(this,arguments)})}}var g=f.copyFile;g&&(f.copyFile=$);function $(X,ie,se,we){return typeof se=="function"&&(we=se,se=0),D(X,ie,se,we);function D(L,N,j,B,ee){return g(L,N,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?p([D,[L,N,j,B],Y,ee||Date.now(),Date.now()]):typeof B=="function"&&B.apply(this,arguments)})}}var I=f.readdir;f.readdir=M;var A=/^v[0-5]\./;function M(X,ie,se){typeof ie=="function"&&(se=ie,ie=null);var we=A.test(process.version)?function(N,j,B,ee){return I(N,D(N,j,B,ee))}:function(N,j,B,ee){return I(N,j,D(N,j,B,ee))};return we(X,ie,se);function D(L,N,j,B){return function(ee,Y){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?p([we,[L,N,j],ee,B||Date.now(),Date.now()]):(Y&&Y.sort&&Y.sort(),typeof j=="function"&&j.call(this,ee,Y))}}}if(process.version.substr(0,4)==="v0.8"){var K=r(f);U=K.ReadStream,G=K.WriteStream}var Q=f.ReadStream;Q&&(U.prototype=Object.create(Q.prototype),U.prototype.open=k);var x=f.WriteStream;x&&(G.prototype=Object.create(x.prototype),G.prototype.open=C),Object.defineProperty(f,"ReadStream",{get:function(){return U},set:function(X){U=X},enumerable:!0,configurable:!0}),Object.defineProperty(f,"WriteStream",{get:function(){return G},set:function(X){G=X},enumerable:!0,configurable:!0});var T=U;Object.defineProperty(f,"FileReadStream",{get:function(){return T},set:function(X){T=X},enumerable:!0,configurable:!0});var F=G;Object.defineProperty(f,"FileWriteStream",{get:function(){return F},set:function(X){F=X},enumerable:!0,configurable:!0});function U(X,ie){return this instanceof U?(Q.apply(this,arguments),this):U.apply(Object.create(U.prototype),arguments)}function k(){var X=this;ce(X.path,X.flags,X.mode,function(ie,se){ie?(X.autoClose&&X.destroy(),X.emit("error",ie)):(X.fd=se,X.emit("open",se),X.read())})}function G(X,ie){return this instanceof G?(x.apply(this,arguments),this):G.apply(Object.create(G.prototype),arguments)}function C(){var X=this;ce(X.path,X.flags,X.mode,function(ie,se){ie?(X.destroy(),X.emit("error",ie)):(X.fd=se,X.emit("open",se))})}function H(X,ie){return new f.ReadStream(X,ie)}function W(X,ie){return new f.WriteStream(X,ie)}var re=f.open;f.open=ce;function ce(X,ie,se,we){return typeof se=="function"&&(we=se,se=null),D(X,ie,se,we);function D(L,N,j,B,ee){return re(L,N,j,function(Y,ke){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?p([D,[L,N,j,B],Y,ee||Date.now(),Date.now()]):typeof B=="function"&&B.apply(this,arguments)})}}return f}function p(f){a("ENQUEUE",f[0].name,f[1]),e[o].push(f),d()}var w;function E(){for(var f=Date.now(),h=0;h<e[o].length;++h)e[o][h].length>2&&(e[o][h][3]=f,e[o][h][4]=f);d()}function d(){if(clearTimeout(w),w=void 0,e[o].length!==0){var f=e[o].shift(),h=f[0],y=f[1],v=f[2],S=f[3],_=f[4];if(S===void 0)a("RETRY",h.name,y),h.apply(null,y);else if(Date.now()-S>=6e4){a("TIMEOUT",h.name,y);var b=y.pop();typeof b=="function"&&b.call(null,v)}else{var g=Date.now()-_,$=Math.max(_-S,1),I=Math.min($*1.2,100);g>=I?(a("RETRY",h.name,y),h.apply(null,y.concat([S]))):e[o].push(f)}w===void 0&&(w=setTimeout(d,0))}}return tn}var od;function Xe(){return od||(od=1,function(e){const t=Me().fromCallback,r=Vr(),n=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(i=>typeof r[i]=="function");Object.assign(e,r),n.forEach(i=>{e[i]=t(r[i])}),e.exists=function(i,o){return typeof o=="function"?r.exists(i,o):new Promise(s=>r.exists(i,s))},e.read=function(i,o,s,l,u,a){return typeof a=="function"?r.read(i,o,s,l,u,a):new Promise((c,m)=>{r.read(i,o,s,l,u,(p,w,E)=>{if(p)return m(p);c({bytesRead:w,buffer:E})})})},e.write=function(i,o,...s){return typeof s[s.length-1]=="function"?r.write(i,o,...s):new Promise((l,u)=>{r.write(i,o,...s,(a,c,m)=>{if(a)return u(a);l({bytesWritten:c,buffer:m})})})},e.readv=function(i,o,...s){return typeof s[s.length-1]=="function"?r.readv(i,o,...s):new Promise((l,u)=>{r.readv(i,o,...s,(a,c,m)=>{if(a)return u(a);l({bytesRead:c,buffers:m})})})},e.writev=function(i,o,...s){return typeof s[s.length-1]=="function"?r.writev(i,o,...s):new Promise((l,u)=>{r.writev(i,o,...s,(a,c,m)=>{if(a)return u(a);l({bytesWritten:c,buffers:m})})})},typeof r.realpath.native=="function"?e.realpath.native=t(r.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(ko)),ko}var rn={},jo={},ad;function kE(){if(ad)return jo;ad=1;const e=ue;return jo.checkPath=function(r){if(process.platform==="win32"&&/[<>:"|?*]/.test(r.replace(e.parse(r).root,""))){const i=new Error(`Path contains invalid characters: ${r}`);throw i.code="EINVAL",i}},jo}var cd;function FE(){if(cd)return rn;cd=1;const e=Xe(),{checkPath:t}=kE(),r=n=>{const i={mode:511};return typeof n=="number"?n:{...i,...n}.mode};return rn.makeDir=async(n,i)=>(t(n),e.mkdir(n,{mode:r(i),recursive:!0})),rn.makeDirSync=(n,i)=>(t(n),e.mkdirSync(n,{mode:r(i),recursive:!0})),rn}var Mo,ud;function Ct(){if(ud)return Mo;ud=1;const e=Me().fromPromise,{makeDir:t,makeDirSync:r}=FE(),n=e(t);return Mo={mkdirs:n,mkdirsSync:r,mkdirp:n,mkdirpSync:r,ensureDir:n,ensureDirSync:r},Mo}var Go,ld;function or(){if(ld)return Go;ld=1;const e=Me().fromPromise,t=Xe();function r(n){return t.access(n).then(()=>!0).catch(()=>!1)}return Go={pathExists:e(r),pathExistsSync:t.existsSync},Go}var Vo,fd;function Vh(){if(fd)return Vo;fd=1;const e=Xe(),t=Me().fromPromise;async function r(i,o,s){const l=await e.open(i,"r+");let u=null;try{await e.futimes(l,o,s)}finally{try{await e.close(l)}catch(a){u=a}}if(u)throw u}function n(i,o,s){const l=e.openSync(i,"r+");return e.futimesSync(l,o,s),e.closeSync(l)}return Vo={utimesMillis:t(r),utimesMillisSync:n},Vo}var Bo,dd;function $r(){if(dd)return Bo;dd=1;const e=Xe(),t=ue,r=Me().fromPromise;function n(p,w,E){const d=E.dereference?f=>e.stat(f,{bigint:!0}):f=>e.lstat(f,{bigint:!0});return Promise.all([d(p),d(w).catch(f=>{if(f.code==="ENOENT")return null;throw f})]).then(([f,h])=>({srcStat:f,destStat:h}))}function i(p,w,E){let d;const f=E.dereference?y=>e.statSync(y,{bigint:!0}):y=>e.lstatSync(y,{bigint:!0}),h=f(p);try{d=f(w)}catch(y){if(y.code==="ENOENT")return{srcStat:h,destStat:null};throw y}return{srcStat:h,destStat:d}}async function o(p,w,E,d){const{srcStat:f,destStat:h}=await n(p,w,d);if(h){if(a(f,h)){const y=t.basename(p),v=t.basename(w);if(E==="move"&&y!==v&&y.toLowerCase()===v.toLowerCase())return{srcStat:f,destStat:h,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(f.isDirectory()&&!h.isDirectory())throw new Error(`Cannot overwrite non-directory '${w}' with directory '${p}'.`);if(!f.isDirectory()&&h.isDirectory())throw new Error(`Cannot overwrite directory '${w}' with non-directory '${p}'.`)}if(f.isDirectory()&&c(p,w))throw new Error(m(p,w,E));return{srcStat:f,destStat:h}}function s(p,w,E,d){const{srcStat:f,destStat:h}=i(p,w,d);if(h){if(a(f,h)){const y=t.basename(p),v=t.basename(w);if(E==="move"&&y!==v&&y.toLowerCase()===v.toLowerCase())return{srcStat:f,destStat:h,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(f.isDirectory()&&!h.isDirectory())throw new Error(`Cannot overwrite non-directory '${w}' with directory '${p}'.`);if(!f.isDirectory()&&h.isDirectory())throw new Error(`Cannot overwrite directory '${w}' with non-directory '${p}'.`)}if(f.isDirectory()&&c(p,w))throw new Error(m(p,w,E));return{srcStat:f,destStat:h}}async function l(p,w,E,d){const f=t.resolve(t.dirname(p)),h=t.resolve(t.dirname(E));if(h===f||h===t.parse(h).root)return;let y;try{y=await e.stat(h,{bigint:!0})}catch(v){if(v.code==="ENOENT")return;throw v}if(a(w,y))throw new Error(m(p,E,d));return l(p,w,h,d)}function u(p,w,E,d){const f=t.resolve(t.dirname(p)),h=t.resolve(t.dirname(E));if(h===f||h===t.parse(h).root)return;let y;try{y=e.statSync(h,{bigint:!0})}catch(v){if(v.code==="ENOENT")return;throw v}if(a(w,y))throw new Error(m(p,E,d));return u(p,w,h,d)}function a(p,w){return w.ino&&w.dev&&w.ino===p.ino&&w.dev===p.dev}function c(p,w){const E=t.resolve(p).split(t.sep).filter(f=>f),d=t.resolve(w).split(t.sep).filter(f=>f);return E.every((f,h)=>d[h]===f)}function m(p,w,E){return`Cannot ${E} '${p}' to a subdirectory of itself, '${w}'.`}return Bo={checkPaths:r(o),checkPathsSync:s,checkParentPaths:r(l),checkParentPathsSync:u,isSrcSubdir:c,areIdentical:a},Bo}var Ho,pd;function qE(){if(pd)return Ho;pd=1;const e=Xe(),t=ue,{mkdirs:r}=Ct(),{pathExists:n}=or(),{utimesMillis:i}=Vh(),o=$r();async function s(d,f,h={}){typeof h=="function"&&(h={filter:h}),h.clobber="clobber"in h?!!h.clobber:!0,h.overwrite="overwrite"in h?!!h.overwrite:h.clobber,h.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
||
|
||
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");const{srcStat:y,destStat:v}=await o.checkPaths(d,f,"copy",h);if(await o.checkParentPaths(d,y,f,"copy"),!await l(d,f,h))return;const _=t.dirname(f);await n(_)||await r(_),await u(v,d,f,h)}async function l(d,f,h){return h.filter?h.filter(d,f):!0}async function u(d,f,h,y){const S=await(y.dereference?e.stat:e.lstat)(f);if(S.isDirectory())return w(S,d,f,h,y);if(S.isFile()||S.isCharacterDevice()||S.isBlockDevice())return a(S,d,f,h,y);if(S.isSymbolicLink())return E(d,f,h,y);throw S.isSocket()?new Error(`Cannot copy a socket file: ${f}`):S.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${f}`):new Error(`Unknown file: ${f}`)}async function a(d,f,h,y,v){if(!f)return c(d,h,y,v);if(v.overwrite)return await e.unlink(y),c(d,h,y,v);if(v.errorOnExist)throw new Error(`'${y}' already exists`)}async function c(d,f,h,y){if(await e.copyFile(f,h),y.preserveTimestamps){m(d.mode)&&await p(h,d.mode);const v=await e.stat(f);await i(h,v.atime,v.mtime)}return e.chmod(h,d.mode)}function m(d){return(d&128)===0}function p(d,f){return e.chmod(d,f|128)}async function w(d,f,h,y,v){f||await e.mkdir(y);const S=[];for await(const _ of await e.opendir(h)){const b=t.join(h,_.name),g=t.join(y,_.name);S.push(l(b,g,v).then($=>{if($)return o.checkPaths(b,g,"copy",v).then(({destStat:I})=>u(I,b,g,v))}))}await Promise.all(S),f||await e.chmod(y,d.mode)}async function E(d,f,h,y){let v=await e.readlink(f);if(y.dereference&&(v=t.resolve(process.cwd(),v)),!d)return e.symlink(v,h);let S=null;try{S=await e.readlink(h)}catch(_){if(_.code==="EINVAL"||_.code==="UNKNOWN")return e.symlink(v,h);throw _}if(y.dereference&&(S=t.resolve(process.cwd(),S)),o.isSrcSubdir(v,S))throw new Error(`Cannot copy '${v}' to a subdirectory of itself, '${S}'.`);if(o.isSrcSubdir(S,v))throw new Error(`Cannot overwrite '${S}' with '${v}'.`);return await e.unlink(h),e.symlink(v,h)}return Ho=s,Ho}var zo,hd;function UE(){if(hd)return zo;hd=1;const e=Vr(),t=ue,r=Ct().mkdirsSync,n=Vh().utimesMillisSync,i=$r();function o(_,b,g){typeof g=="function"&&(g={filter:g}),g=g||{},g.clobber="clobber"in g?!!g.clobber:!0,g.overwrite="overwrite"in g?!!g.overwrite:g.clobber,g.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
||
|
||
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");const{srcStat:$,destStat:I}=i.checkPathsSync(_,b,"copy",g);if(i.checkParentPathsSync(_,$,b,"copy"),g.filter&&!g.filter(_,b))return;const A=t.dirname(b);return e.existsSync(A)||r(A),s(I,_,b,g)}function s(_,b,g,$){const A=($.dereference?e.statSync:e.lstatSync)(b);if(A.isDirectory())return d(A,_,b,g,$);if(A.isFile()||A.isCharacterDevice()||A.isBlockDevice())return l(A,_,b,g,$);if(A.isSymbolicLink())return v(_,b,g,$);throw A.isSocket()?new Error(`Cannot copy a socket file: ${b}`):A.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${b}`):new Error(`Unknown file: ${b}`)}function l(_,b,g,$,I){return b?u(_,g,$,I):a(_,g,$,I)}function u(_,b,g,$){if($.overwrite)return e.unlinkSync(g),a(_,b,g,$);if($.errorOnExist)throw new Error(`'${g}' already exists`)}function a(_,b,g,$){return e.copyFileSync(b,g),$.preserveTimestamps&&c(_.mode,b,g),w(g,_.mode)}function c(_,b,g){return m(_)&&p(g,_),E(b,g)}function m(_){return(_&128)===0}function p(_,b){return w(_,b|128)}function w(_,b){return e.chmodSync(_,b)}function E(_,b){const g=e.statSync(_);return n(b,g.atime,g.mtime)}function d(_,b,g,$,I){return b?h(g,$,I):f(_.mode,g,$,I)}function f(_,b,g,$){return e.mkdirSync(g),h(b,g,$),w(g,_)}function h(_,b,g){const $=e.opendirSync(_);try{let I;for(;(I=$.readSync())!==null;)y(I.name,_,b,g)}finally{$.closeSync()}}function y(_,b,g,$){const I=t.join(b,_),A=t.join(g,_);if($.filter&&!$.filter(I,A))return;const{destStat:M}=i.checkPathsSync(I,A,"copy",$);return s(M,I,A,$)}function v(_,b,g,$){let I=e.readlinkSync(b);if($.dereference&&(I=t.resolve(process.cwd(),I)),_){let A;try{A=e.readlinkSync(g)}catch(M){if(M.code==="EINVAL"||M.code==="UNKNOWN")return e.symlinkSync(I,g);throw M}if($.dereference&&(A=t.resolve(process.cwd(),A)),i.isSrcSubdir(I,A))throw new Error(`Cannot copy '${I}' to a subdirectory of itself, '${A}'.`);if(i.isSrcSubdir(A,I))throw new Error(`Cannot overwrite '${A}' with '${I}'.`);return S(I,g)}else return e.symlinkSync(I,g)}function S(_,b){return e.unlinkSync(b),e.symlinkSync(_,b)}return zo=o,zo}var Wo,md;function Qa(){if(md)return Wo;md=1;const e=Me().fromPromise;return Wo={copy:e(qE()),copySync:UE()},Wo}var Xo,yd;function Mn(){if(yd)return Xo;yd=1;const e=Vr(),t=Me().fromCallback;function r(i,o){e.rm(i,{recursive:!0,force:!0},o)}function n(i){e.rmSync(i,{recursive:!0,force:!0})}return Xo={remove:t(r),removeSync:n},Xo}var Ko,vd;function jE(){if(vd)return Ko;vd=1;const e=Me().fromPromise,t=Xe(),r=ue,n=Ct(),i=Mn(),o=e(async function(u){let a;try{a=await t.readdir(u)}catch{return n.mkdirs(u)}return Promise.all(a.map(c=>i.remove(r.join(u,c))))});function s(l){let u;try{u=t.readdirSync(l)}catch{return n.mkdirsSync(l)}u.forEach(a=>{a=r.join(l,a),i.removeSync(a)})}return Ko={emptyDirSync:s,emptydirSync:s,emptyDir:o,emptydir:o},Ko}var Yo,wd;function ME(){if(wd)return Yo;wd=1;const e=Me().fromPromise,t=ue,r=Xe(),n=Ct();async function i(s){let l;try{l=await r.stat(s)}catch{}if(l&&l.isFile())return;const u=t.dirname(s);let a=null;try{a=await r.stat(u)}catch(c){if(c.code==="ENOENT"){await n.mkdirs(u),await r.writeFile(s,"");return}else throw c}a.isDirectory()?await r.writeFile(s,""):await r.readdir(u)}function o(s){let l;try{l=r.statSync(s)}catch{}if(l&&l.isFile())return;const u=t.dirname(s);try{r.statSync(u).isDirectory()||r.readdirSync(u)}catch(a){if(a&&a.code==="ENOENT")n.mkdirsSync(u);else throw a}r.writeFileSync(s,"")}return Yo={createFile:e(i),createFileSync:o},Yo}var Jo,gd;function GE(){if(gd)return Jo;gd=1;const e=Me().fromPromise,t=ue,r=Xe(),n=Ct(),{pathExists:i}=or(),{areIdentical:o}=$r();async function s(u,a){let c;try{c=await r.lstat(a)}catch{}let m;try{m=await r.lstat(u)}catch(E){throw E.message=E.message.replace("lstat","ensureLink"),E}if(c&&o(m,c))return;const p=t.dirname(a);await i(p)||await n.mkdirs(p),await r.link(u,a)}function l(u,a){let c;try{c=r.lstatSync(a)}catch{}try{const w=r.lstatSync(u);if(c&&o(w,c))return}catch(w){throw w.message=w.message.replace("lstat","ensureLink"),w}const m=t.dirname(a);return r.existsSync(m)||n.mkdirsSync(m),r.linkSync(u,a)}return Jo={createLink:e(s),createLinkSync:l},Jo}var Qo,_d;function VE(){if(_d)return Qo;_d=1;const e=ue,t=Xe(),{pathExists:r}=or(),n=Me().fromPromise;async function i(s,l){if(e.isAbsolute(s)){try{await t.lstat(s)}catch(m){throw m.message=m.message.replace("lstat","ensureSymlink"),m}return{toCwd:s,toDst:s}}const u=e.dirname(l),a=e.join(u,s);if(await r(a))return{toCwd:a,toDst:s};try{await t.lstat(s)}catch(m){throw m.message=m.message.replace("lstat","ensureSymlink"),m}return{toCwd:s,toDst:e.relative(u,s)}}function o(s,l){if(e.isAbsolute(s)){if(!t.existsSync(s))throw new Error("absolute srcpath does not exist");return{toCwd:s,toDst:s}}const u=e.dirname(l),a=e.join(u,s);if(t.existsSync(a))return{toCwd:a,toDst:s};if(!t.existsSync(s))throw new Error("relative srcpath does not exist");return{toCwd:s,toDst:e.relative(u,s)}}return Qo={symlinkPaths:n(i),symlinkPathsSync:o},Qo}var Zo,Ed;function BE(){if(Ed)return Zo;Ed=1;const e=Xe(),t=Me().fromPromise;async function r(i,o){if(o)return o;let s;try{s=await e.lstat(i)}catch{return"file"}return s&&s.isDirectory()?"dir":"file"}function n(i,o){if(o)return o;let s;try{s=e.lstatSync(i)}catch{return"file"}return s&&s.isDirectory()?"dir":"file"}return Zo={symlinkType:t(r),symlinkTypeSync:n},Zo}var ea,Sd;function HE(){if(Sd)return ea;Sd=1;const e=Me().fromPromise,t=ue,r=Xe(),{mkdirs:n,mkdirsSync:i}=Ct(),{symlinkPaths:o,symlinkPathsSync:s}=VE(),{symlinkType:l,symlinkTypeSync:u}=BE(),{pathExists:a}=or(),{areIdentical:c}=$r();async function m(w,E,d){let f;try{f=await r.lstat(E)}catch{}if(f&&f.isSymbolicLink()){const[S,_]=await Promise.all([r.stat(w),r.stat(E)]);if(c(S,_))return}const h=await o(w,E);w=h.toDst;const y=await l(h.toCwd,d),v=t.dirname(E);return await a(v)||await n(v),r.symlink(w,E,y)}function p(w,E,d){let f;try{f=r.lstatSync(E)}catch{}if(f&&f.isSymbolicLink()){const S=r.statSync(w),_=r.statSync(E);if(c(S,_))return}const h=s(w,E);w=h.toDst,d=u(h.toCwd,d);const y=t.dirname(E);return r.existsSync(y)||i(y),r.symlinkSync(w,E,d)}return ea={createSymlink:e(m),createSymlinkSync:p},ea}var ta,bd;function zE(){if(bd)return ta;bd=1;const{createFile:e,createFileSync:t}=ME(),{createLink:r,createLinkSync:n}=GE(),{createSymlink:i,createSymlinkSync:o}=HE();return ta={createFile:e,createFileSync:t,ensureFile:e,ensureFileSync:t,createLink:r,createLinkSync:n,ensureLink:r,ensureLinkSync:n,createSymlink:i,createSymlinkSync:o,ensureSymlink:i,ensureSymlinkSync:o},ta}var ra,Rd;function Za(){if(Rd)return ra;Rd=1;function e(r,{EOL:n=`
|
||
`,finalEOL:i=!0,replacer:o=null,spaces:s}={}){const l=i?n:"";return JSON.stringify(r,o,s).replace(/\n/g,n)+l}function t(r){return Buffer.isBuffer(r)&&(r=r.toString("utf8")),r.replace(/^\uFEFF/,"")}return ra={stringify:e,stripBom:t},ra}var na,$d;function WE(){if($d)return na;$d=1;let e;try{e=Vr()}catch{e=je}const t=Me(),{stringify:r,stripBom:n}=Za();async function i(m,p={}){typeof p=="string"&&(p={encoding:p});const w=p.fs||e,E="throws"in p?p.throws:!0;let d=await t.fromCallback(w.readFile)(m,p);d=n(d);let f;try{f=JSON.parse(d,p?p.reviver:null)}catch(h){if(E)throw h.message=`${m}: ${h.message}`,h;return null}return f}const o=t.fromPromise(i);function s(m,p={}){typeof p=="string"&&(p={encoding:p});const w=p.fs||e,E="throws"in p?p.throws:!0;try{let d=w.readFileSync(m,p);return d=n(d),JSON.parse(d,p.reviver)}catch(d){if(E)throw d.message=`${m}: ${d.message}`,d;return null}}async function l(m,p,w={}){const E=w.fs||e,d=r(p,w);await t.fromCallback(E.writeFile)(m,d,w)}const u=t.fromPromise(l);function a(m,p,w={}){const E=w.fs||e,d=r(p,w);return E.writeFileSync(m,d,w)}return na={readFile:o,readFileSync:s,writeFile:u,writeFileSync:a},na}var ia,Od;function XE(){if(Od)return ia;Od=1;const e=WE();return ia={readJson:e.readFile,readJsonSync:e.readFileSync,writeJson:e.writeFile,writeJsonSync:e.writeFileSync},ia}var sa,Id;function ec(){if(Id)return sa;Id=1;const e=Me().fromPromise,t=Xe(),r=ue,n=Ct(),i=or().pathExists;async function o(l,u,a="utf-8"){const c=r.dirname(l);return await i(c)||await n.mkdirs(c),t.writeFile(l,u,a)}function s(l,...u){const a=r.dirname(l);t.existsSync(a)||n.mkdirsSync(a),t.writeFileSync(l,...u)}return sa={outputFile:e(o),outputFileSync:s},sa}var oa,Pd;function KE(){if(Pd)return oa;Pd=1;const{stringify:e}=Za(),{outputFile:t}=ec();async function r(n,i,o={}){const s=e(i,o);await t(n,s,o)}return oa=r,oa}var aa,Td;function YE(){if(Td)return aa;Td=1;const{stringify:e}=Za(),{outputFileSync:t}=ec();function r(n,i,o){const s=e(i,o);t(n,s,o)}return aa=r,aa}var ca,xd;function JE(){if(xd)return ca;xd=1;const e=Me().fromPromise,t=XE();return t.outputJson=e(KE()),t.outputJsonSync=YE(),t.outputJSON=t.outputJson,t.outputJSONSync=t.outputJsonSync,t.writeJSON=t.writeJson,t.writeJSONSync=t.writeJsonSync,t.readJSON=t.readJson,t.readJSONSync=t.readJsonSync,ca=t,ca}var ua,Ad;function QE(){if(Ad)return ua;Ad=1;const e=Xe(),t=ue,{copy:r}=Qa(),{remove:n}=Mn(),{mkdirp:i}=Ct(),{pathExists:o}=or(),s=$r();async function l(c,m,p={}){const w=p.overwrite||p.clobber||!1,{srcStat:E,isChangingCase:d=!1}=await s.checkPaths(c,m,"move",p);await s.checkParentPaths(c,E,m,"move");const f=t.dirname(m);return t.parse(f).root!==f&&await i(f),u(c,m,w,d)}async function u(c,m,p,w){if(!w){if(p)await n(m);else if(await o(m))throw new Error("dest already exists.")}try{await e.rename(c,m)}catch(E){if(E.code!=="EXDEV")throw E;await a(c,m,p)}}async function a(c,m,p){return await r(c,m,{overwrite:p,errorOnExist:!0,preserveTimestamps:!0}),n(c)}return ua=l,ua}var la,Cd;function ZE(){if(Cd)return la;Cd=1;const e=Vr(),t=ue,r=Qa().copySync,n=Mn().removeSync,i=Ct().mkdirpSync,o=$r();function s(m,p,w){w=w||{};const E=w.overwrite||w.clobber||!1,{srcStat:d,isChangingCase:f=!1}=o.checkPathsSync(m,p,"move",w);return o.checkParentPathsSync(m,d,p,"move"),l(p)||i(t.dirname(p)),u(m,p,E,f)}function l(m){const p=t.dirname(m);return t.parse(p).root===p}function u(m,p,w,E){if(E)return a(m,p,w);if(w)return n(p),a(m,p,w);if(e.existsSync(p))throw new Error("dest already exists.");return a(m,p,w)}function a(m,p,w){try{e.renameSync(m,p)}catch(E){if(E.code!=="EXDEV")throw E;return c(m,p,w)}}function c(m,p,w){return r(m,p,{overwrite:w,errorOnExist:!0,preserveTimestamps:!0}),n(m)}return la=s,la}var fa,Nd;function eS(){if(Nd)return fa;Nd=1;const e=Me().fromPromise;return fa={move:e(QE()),moveSync:ZE()},fa}var da,Ld;function tS(){return Ld||(Ld=1,da={...Xe(),...Qa(),...jE(),...zE(),...JE(),...Ct(),...eS(),...ec(),...or(),...Mn()}),da}var Pt=tS();let Ft;async function Bh(e){if(process.platform!=="win32")return;if(typeof Ft=="string")return{binDir:Ft};const t=fe.sync("choco",{nothrow:!0});if(t!==null)return Ft=be(t),{binDir:Ft};let r="powershell.exe";const n=fe.sync(`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,{nothrow:!0});n!==null&&(r=n),ze(r,["-NoProfile","-InputFormat","None","-ExecutionPolicy","Bypass","-Command","[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"],{stdio:"inherit"});const i=`${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`;await Re(i,ne);const o=fe.sync("choco",{nothrow:!0});if(o!==null?Ft=be(o):Ft=`${process.env.ChocolateyInstall??"C:/ProgramData/chocolatey"}/bin`,await ye(Ft))return{binDir:Ft}}let Dd=!1;async function Le(e,t,r=[]){z(`Installing ${e} ${t??""} via chocolatey`),(!Dd||fe.sync("choco",{nothrow:!0})===null)&&(await Bh(),Dd=!0);const n=process.env.PATH,i={...process.env};if(i.TMP=void 0,i.TEMP=void 0,i.Path=void 0,i.PATH=n,t!==void 0&&t!=="")ze("choco",["install","-y",e,`--version=${t}`,...r],{env:i,extendEnv:!1,stdio:"inherit"});else try{ze("choco",["install","-y",e,...r],{env:i,extendEnv:!1,stdio:"inherit"})}catch(s){if(s.message.includes("exit code 3010"))z(`${e} might require a reboot for the completion of the installation.`);else throw s}const o=`${process.env.ChocolateyInstall??"C:/ProgramData/chocolatey"}/bin`;return await Re(o,ne),{binDir:o}}async function un({version:e}={}){switch(process.platform){case"win32":return Le("7zip",e);case"darwin":return Ge("p7zip",e);case"linux":{if(Pe())return _e("p7zip",e);if(Ne())return Ce([{name:"p7zip",version:e},{name:"p7zip-plugins",version:e}]);if(me())return de([{name:"p7zip-full",version:e}]);if(await Oe())return De([{name:"p7zip",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}var ae={},Ar={exports:{}},nn={exports:{}},kd;function Hh(){return kd||(kd=1,function(e,t){t=e.exports=g;var r;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?r=function(){var R=Array.prototype.slice.call(arguments,0);R.unshift("SEMVER"),console.log.apply(console,R)}:r=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var n=256,i=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,s=n-6,l=t.re=[],u=t.safeRe=[],a=t.src=[],c=t.tokens={},m=0;function p(R){c[R]=m++}var w="[a-zA-Z0-9-]",E=[["\\s",1],["\\d",n],[w,s]];function d(R){for(var O=0;O<E.length;O++){var P=E[O][0],q=E[O][1];R=R.split(P+"*").join(P+"{0,"+q+"}").split(P+"+").join(P+"{1,"+q+"}")}return R}p("NUMERICIDENTIFIER"),a[c.NUMERICIDENTIFIER]="0|[1-9]\\d*",p("NUMERICIDENTIFIERLOOSE"),a[c.NUMERICIDENTIFIERLOOSE]="\\d+",p("NONNUMERICIDENTIFIER"),a[c.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+w+"*",p("MAINVERSION"),a[c.MAINVERSION]="("+a[c.NUMERICIDENTIFIER]+")\\.("+a[c.NUMERICIDENTIFIER]+")\\.("+a[c.NUMERICIDENTIFIER]+")",p("MAINVERSIONLOOSE"),a[c.MAINVERSIONLOOSE]="("+a[c.NUMERICIDENTIFIERLOOSE]+")\\.("+a[c.NUMERICIDENTIFIERLOOSE]+")\\.("+a[c.NUMERICIDENTIFIERLOOSE]+")",p("PRERELEASEIDENTIFIER"),a[c.PRERELEASEIDENTIFIER]="(?:"+a[c.NUMERICIDENTIFIER]+"|"+a[c.NONNUMERICIDENTIFIER]+")",p("PRERELEASEIDENTIFIERLOOSE"),a[c.PRERELEASEIDENTIFIERLOOSE]="(?:"+a[c.NUMERICIDENTIFIERLOOSE]+"|"+a[c.NONNUMERICIDENTIFIER]+")",p("PRERELEASE"),a[c.PRERELEASE]="(?:-("+a[c.PRERELEASEIDENTIFIER]+"(?:\\."+a[c.PRERELEASEIDENTIFIER]+")*))",p("PRERELEASELOOSE"),a[c.PRERELEASELOOSE]="(?:-?("+a[c.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+a[c.PRERELEASEIDENTIFIERLOOSE]+")*))",p("BUILDIDENTIFIER"),a[c.BUILDIDENTIFIER]=w+"+",p("BUILD"),a[c.BUILD]="(?:\\+("+a[c.BUILDIDENTIFIER]+"(?:\\."+a[c.BUILDIDENTIFIER]+")*))",p("FULL"),p("FULLPLAIN"),a[c.FULLPLAIN]="v?"+a[c.MAINVERSION]+a[c.PRERELEASE]+"?"+a[c.BUILD]+"?",a[c.FULL]="^"+a[c.FULLPLAIN]+"$",p("LOOSEPLAIN"),a[c.LOOSEPLAIN]="[v=\\s]*"+a[c.MAINVERSIONLOOSE]+a[c.PRERELEASELOOSE]+"?"+a[c.BUILD]+"?",p("LOOSE"),a[c.LOOSE]="^"+a[c.LOOSEPLAIN]+"$",p("GTLT"),a[c.GTLT]="((?:<|>)?=?)",p("XRANGEIDENTIFIERLOOSE"),a[c.XRANGEIDENTIFIERLOOSE]=a[c.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",p("XRANGEIDENTIFIER"),a[c.XRANGEIDENTIFIER]=a[c.NUMERICIDENTIFIER]+"|x|X|\\*",p("XRANGEPLAIN"),a[c.XRANGEPLAIN]="[v=\\s]*("+a[c.XRANGEIDENTIFIER]+")(?:\\.("+a[c.XRANGEIDENTIFIER]+")(?:\\.("+a[c.XRANGEIDENTIFIER]+")(?:"+a[c.PRERELEASE]+")?"+a[c.BUILD]+"?)?)?",p("XRANGEPLAINLOOSE"),a[c.XRANGEPLAINLOOSE]="[v=\\s]*("+a[c.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[c.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[c.XRANGEIDENTIFIERLOOSE]+")(?:"+a[c.PRERELEASELOOSE]+")?"+a[c.BUILD]+"?)?)?",p("XRANGE"),a[c.XRANGE]="^"+a[c.GTLT]+"\\s*"+a[c.XRANGEPLAIN]+"$",p("XRANGELOOSE"),a[c.XRANGELOOSE]="^"+a[c.GTLT]+"\\s*"+a[c.XRANGEPLAINLOOSE]+"$",p("COERCE"),a[c.COERCE]="(^|[^\\d])(\\d{1,"+o+"})(?:\\.(\\d{1,"+o+"}))?(?:\\.(\\d{1,"+o+"}))?(?:$|[^\\d])",p("COERCERTL"),l[c.COERCERTL]=new RegExp(a[c.COERCE],"g"),u[c.COERCERTL]=new RegExp(d(a[c.COERCE]),"g"),p("LONETILDE"),a[c.LONETILDE]="(?:~>?)",p("TILDETRIM"),a[c.TILDETRIM]="(\\s*)"+a[c.LONETILDE]+"\\s+",l[c.TILDETRIM]=new RegExp(a[c.TILDETRIM],"g"),u[c.TILDETRIM]=new RegExp(d(a[c.TILDETRIM]),"g");var f="$1~";p("TILDE"),a[c.TILDE]="^"+a[c.LONETILDE]+a[c.XRANGEPLAIN]+"$",p("TILDELOOSE"),a[c.TILDELOOSE]="^"+a[c.LONETILDE]+a[c.XRANGEPLAINLOOSE]+"$",p("LONECARET"),a[c.LONECARET]="(?:\\^)",p("CARETTRIM"),a[c.CARETTRIM]="(\\s*)"+a[c.LONECARET]+"\\s+",l[c.CARETTRIM]=new RegExp(a[c.CARETTRIM],"g"),u[c.CARETTRIM]=new RegExp(d(a[c.CARETTRIM]),"g");var h="$1^";p("CARET"),a[c.CARET]="^"+a[c.LONECARET]+a[c.XRANGEPLAIN]+"$",p("CARETLOOSE"),a[c.CARETLOOSE]="^"+a[c.LONECARET]+a[c.XRANGEPLAINLOOSE]+"$",p("COMPARATORLOOSE"),a[c.COMPARATORLOOSE]="^"+a[c.GTLT]+"\\s*("+a[c.LOOSEPLAIN]+")$|^$",p("COMPARATOR"),a[c.COMPARATOR]="^"+a[c.GTLT]+"\\s*("+a[c.FULLPLAIN]+")$|^$",p("COMPARATORTRIM"),a[c.COMPARATORTRIM]="(\\s*)"+a[c.GTLT]+"\\s*("+a[c.LOOSEPLAIN]+"|"+a[c.XRANGEPLAIN]+")",l[c.COMPARATORTRIM]=new RegExp(a[c.COMPARATORTRIM],"g"),u[c.COMPARATORTRIM]=new RegExp(d(a[c.COMPARATORTRIM]),"g");var y="$1$2$3";p("HYPHENRANGE"),a[c.HYPHENRANGE]="^\\s*("+a[c.XRANGEPLAIN]+")\\s+-\\s+("+a[c.XRANGEPLAIN]+")\\s*$",p("HYPHENRANGELOOSE"),a[c.HYPHENRANGELOOSE]="^\\s*("+a[c.XRANGEPLAINLOOSE]+")\\s+-\\s+("+a[c.XRANGEPLAINLOOSE]+")\\s*$",p("STAR"),a[c.STAR]="(<|>)?=?\\s*\\*";for(var v=0;v<m;v++)r(v,a[v]),l[v]||(l[v]=new RegExp(a[v]),u[v]=new RegExp(d(a[v])));t.parse=S;function S(R,O){if((!O||typeof O!="object")&&(O={loose:!!O,includePrerelease:!1}),R instanceof g)return R;if(typeof R!="string"||R.length>n)return null;var P=O.loose?u[c.LOOSE]:u[c.FULL];if(!P.test(R))return null;try{return new g(R,O)}catch{return null}}t.valid=_;function _(R,O){var P=S(R,O);return P?P.version:null}t.clean=b;function b(R,O){var P=S(R.trim().replace(/^[=v]+/,""),O);return P?P.version:null}t.SemVer=g;function g(R,O){if((!O||typeof O!="object")&&(O={loose:!!O,includePrerelease:!1}),R instanceof g){if(R.loose===O.loose)return R;R=R.version}else if(typeof R!="string")throw new TypeError("Invalid Version: "+R);if(R.length>n)throw new TypeError("version is longer than "+n+" characters");if(!(this instanceof g))return new g(R,O);r("SemVer",R,O),this.options=O,this.loose=!!O.loose;var P=R.trim().match(O.loose?u[c.LOOSE]:u[c.FULL]);if(!P)throw new TypeError("Invalid Version: "+R);if(this.raw=R,this.major=+P[1],this.minor=+P[2],this.patch=+P[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");P[4]?this.prerelease=P[4].split(".").map(function(q){if(/^[0-9]+$/.test(q)){var V=+q;if(V>=0&&V<i)return V}return q}):this.prerelease=[],this.build=P[5]?P[5].split("."):[],this.format()}g.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},g.prototype.toString=function(){return this.version},g.prototype.compare=function(R){return r("SemVer.compare",this.version,this.options,R),R instanceof g||(R=new g(R,this.options)),this.compareMain(R)||this.comparePre(R)},g.prototype.compareMain=function(R){return R instanceof g||(R=new g(R,this.options)),M(this.major,R.major)||M(this.minor,R.minor)||M(this.patch,R.patch)},g.prototype.comparePre=function(R){if(R instanceof g||(R=new g(R,this.options)),this.prerelease.length&&!R.prerelease.length)return-1;if(!this.prerelease.length&&R.prerelease.length)return 1;if(!this.prerelease.length&&!R.prerelease.length)return 0;var O=0;do{var P=this.prerelease[O],q=R.prerelease[O];if(r("prerelease compare",O,P,q),P===void 0&&q===void 0)return 0;if(q===void 0)return 1;if(P===void 0)return-1;if(P===q)continue;return M(P,q)}while(++O)},g.prototype.compareBuild=function(R){R instanceof g||(R=new g(R,this.options));var O=0;do{var P=this.build[O],q=R.build[O];if(r("prerelease compare",O,P,q),P===void 0&&q===void 0)return 0;if(q===void 0)return 1;if(P===void 0)return-1;if(P===q)continue;return M(P,q)}while(++O)},g.prototype.inc=function(R,O){switch(R){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",O);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",O);break;case"prepatch":this.prerelease.length=0,this.inc("patch",O),this.inc("pre",O);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",O),this.inc("pre",O);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var P=this.prerelease.length;--P>=0;)typeof this.prerelease[P]=="number"&&(this.prerelease[P]++,P=-2);P===-1&&this.prerelease.push(0)}O&&(this.prerelease[0]===O?isNaN(this.prerelease[1])&&(this.prerelease=[O,0]):this.prerelease=[O,0]);break;default:throw new Error("invalid increment argument: "+R)}return this.format(),this.raw=this.version,this},t.inc=$;function $(R,O,P,q){typeof P=="string"&&(q=P,P=void 0);try{return new g(R,P).inc(O,q).version}catch{return null}}t.diff=I;function I(R,O){if(ce(R,O))return null;var P=S(R),q=S(O),V="";if(P.prerelease.length||q.prerelease.length){V="pre";var Z="prerelease"}for(var te in P)if((te==="major"||te==="minor"||te==="patch")&&P[te]!==q[te])return V+te;return Z}t.compareIdentifiers=M;var A=/^[0-9]+$/;function M(R,O){var P=A.test(R),q=A.test(O);return P&&q&&(R=+R,O=+O),R===O?0:P&&!q?-1:q&&!P?1:R<O?-1:1}t.rcompareIdentifiers=K;function K(R,O){return M(O,R)}t.major=Q;function Q(R,O){return new g(R,O).major}t.minor=x;function x(R,O){return new g(R,O).minor}t.patch=T;function T(R,O){return new g(R,O).patch}t.compare=F;function F(R,O,P){return new g(R,P).compare(new g(O,P))}t.compareLoose=U;function U(R,O){return F(R,O,!0)}t.compareBuild=k;function k(R,O,P){var q=new g(R,P),V=new g(O,P);return q.compare(V)||q.compareBuild(V)}t.rcompare=G;function G(R,O,P){return F(O,R,P)}t.sort=C;function C(R,O){return R.sort(function(P,q){return t.compareBuild(P,q,O)})}t.rsort=H;function H(R,O){return R.sort(function(P,q){return t.compareBuild(q,P,O)})}t.gt=W;function W(R,O,P){return F(R,O,P)>0}t.lt=re;function re(R,O,P){return F(R,O,P)<0}t.eq=ce;function ce(R,O,P){return F(R,O,P)===0}t.neq=X;function X(R,O,P){return F(R,O,P)!==0}t.gte=ie;function ie(R,O,P){return F(R,O,P)>=0}t.lte=se;function se(R,O,P){return F(R,O,P)<=0}t.cmp=we;function we(R,O,P,q){switch(O){case"===":return typeof R=="object"&&(R=R.version),typeof P=="object"&&(P=P.version),R===P;case"!==":return typeof R=="object"&&(R=R.version),typeof P=="object"&&(P=P.version),R!==P;case"":case"=":case"==":return ce(R,P,q);case"!=":return X(R,P,q);case">":return W(R,P,q);case">=":return ie(R,P,q);case"<":return re(R,P,q);case"<=":return se(R,P,q);default:throw new TypeError("Invalid operator: "+O)}}t.Comparator=D;function D(R,O){if((!O||typeof O!="object")&&(O={loose:!!O,includePrerelease:!1}),R instanceof D){if(R.loose===!!O.loose)return R;R=R.value}if(!(this instanceof D))return new D(R,O);R=R.trim().split(/\s+/).join(" "),r("comparator",R,O),this.options=O,this.loose=!!O.loose,this.parse(R),this.semver===L?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var L={};D.prototype.parse=function(R){var O=this.options.loose?u[c.COMPARATORLOOSE]:u[c.COMPARATOR],P=R.match(O);if(!P)throw new TypeError("Invalid comparator: "+R);this.operator=P[1]!==void 0?P[1]:"",this.operator==="="&&(this.operator=""),P[2]?this.semver=new g(P[2],this.options.loose):this.semver=L},D.prototype.toString=function(){return this.value},D.prototype.test=function(R){if(r("Comparator.test",R,this.options.loose),this.semver===L||R===L)return!0;if(typeof R=="string")try{R=new g(R,this.options)}catch{return!1}return we(R,this.operator,this.semver,this.options)},D.prototype.intersects=function(R,O){if(!(R instanceof D))throw new TypeError("a Comparator is required");(!O||typeof O!="object")&&(O={loose:!!O,includePrerelease:!1});var P;if(this.operator==="")return this.value===""?!0:(P=new N(R.value,O),Br(this.value,P,O));if(R.operator==="")return R.value===""?!0:(P=new N(this.value,O),Br(R.semver,P,O));var q=(this.operator===">="||this.operator===">")&&(R.operator===">="||R.operator===">"),V=(this.operator==="<="||this.operator==="<")&&(R.operator==="<="||R.operator==="<"),Z=this.semver.version===R.semver.version,te=(this.operator===">="||this.operator==="<=")&&(R.operator===">="||R.operator==="<="),pe=we(this.semver,"<",R.semver,O)&&(this.operator===">="||this.operator===">")&&(R.operator==="<="||R.operator==="<"),oe=we(this.semver,">",R.semver,O)&&(this.operator==="<="||this.operator==="<")&&(R.operator===">="||R.operator===">");return q||V||Z&&te||pe||oe},t.Range=N;function N(R,O){if((!O||typeof O!="object")&&(O={loose:!!O,includePrerelease:!1}),R instanceof N)return R.loose===!!O.loose&&R.includePrerelease===!!O.includePrerelease?R:new N(R.raw,O);if(R instanceof D)return new N(R.value,O);if(!(this instanceof N))return new N(R,O);if(this.options=O,this.loose=!!O.loose,this.includePrerelease=!!O.includePrerelease,this.raw=R.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(P){return this.parseRange(P.trim())},this).filter(function(P){return P.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}N.prototype.format=function(){return this.range=this.set.map(function(R){return R.join(" ").trim()}).join("||").trim(),this.range},N.prototype.toString=function(){return this.range},N.prototype.parseRange=function(R){var O=this.options.loose,P=O?u[c.HYPHENRANGELOOSE]:u[c.HYPHENRANGE];R=R.replace(P,bm),r("hyphen replace",R),R=R.replace(u[c.COMPARATORTRIM],y),r("comparator trim",R,u[c.COMPARATORTRIM]),R=R.replace(u[c.TILDETRIM],f),R=R.replace(u[c.CARETTRIM],h),R=R.split(/\s+/).join(" ");var q=O?u[c.COMPARATORLOOSE]:u[c.COMPARATOR],V=R.split(" ").map(function(Z){return ee(Z,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(V=V.filter(function(Z){return!!Z.match(q)})),V=V.map(function(Z){return new D(Z,this.options)},this),V},N.prototype.intersects=function(R,O){if(!(R instanceof N))throw new TypeError("a Range is required");return this.set.some(function(P){return j(P,O)&&R.set.some(function(q){return j(q,O)&&P.every(function(V){return q.every(function(Z){return V.intersects(Z,O)})})})})};function j(R,O){for(var P=!0,q=R.slice(),V=q.pop();P&&q.length;)P=q.every(function(Z){return V.intersects(Z,O)}),V=q.pop();return P}t.toComparators=B;function B(R,O){return new N(R,O).set.map(function(P){return P.map(function(q){return q.value}).join(" ").trim().split(" ")})}function ee(R,O){return r("comp",R,O),R=Ke(R,O),r("caret",R),R=ke(R,O),r("tildes",R),R=Nt(R,O),r("xrange",R),R=Sm(R,O),r("stars",R),R}function Y(R){return!R||R.toLowerCase()==="x"||R==="*"}function ke(R,O){return R.trim().split(/\s+/).map(function(P){return Te(P,O)}).join(" ")}function Te(R,O){var P=O.loose?u[c.TILDELOOSE]:u[c.TILDE];return R.replace(P,function(q,V,Z,te,pe){r("tilde",R,q,V,Z,te,pe);var oe;return Y(V)?oe="":Y(Z)?oe=">="+V+".0.0 <"+(+V+1)+".0.0":Y(te)?oe=">="+V+"."+Z+".0 <"+V+"."+(+Z+1)+".0":pe?(r("replaceTilde pr",pe),oe=">="+V+"."+Z+"."+te+"-"+pe+" <"+V+"."+(+Z+1)+".0"):oe=">="+V+"."+Z+"."+te+" <"+V+"."+(+Z+1)+".0",r("tilde return",oe),oe})}function Ke(R,O){return R.trim().split(/\s+/).map(function(P){return xe(P,O)}).join(" ")}function xe(R,O){r("caret",R,O);var P=O.loose?u[c.CARETLOOSE]:u[c.CARET];return R.replace(P,function(q,V,Z,te,pe){r("caret",R,q,V,Z,te,pe);var oe;return Y(V)?oe="":Y(Z)?oe=">="+V+".0.0 <"+(+V+1)+".0.0":Y(te)?V==="0"?oe=">="+V+"."+Z+".0 <"+V+"."+(+Z+1)+".0":oe=">="+V+"."+Z+".0 <"+(+V+1)+".0.0":pe?(r("replaceCaret pr",pe),V==="0"?Z==="0"?oe=">="+V+"."+Z+"."+te+"-"+pe+" <"+V+"."+Z+"."+(+te+1):oe=">="+V+"."+Z+"."+te+"-"+pe+" <"+V+"."+(+Z+1)+".0":oe=">="+V+"."+Z+"."+te+"-"+pe+" <"+(+V+1)+".0.0"):(r("no pr"),V==="0"?Z==="0"?oe=">="+V+"."+Z+"."+te+" <"+V+"."+Z+"."+(+te+1):oe=">="+V+"."+Z+"."+te+" <"+V+"."+(+Z+1)+".0":oe=">="+V+"."+Z+"."+te+" <"+(+V+1)+".0.0"),r("caret return",oe),oe})}function Nt(R,O){return r("replaceXRanges",R,O),R.split(/\s+/).map(function(P){return Em(P,O)}).join(" ")}function Em(R,O){R=R.trim();var P=O.loose?u[c.XRANGELOOSE]:u[c.XRANGE];return R.replace(P,function(q,V,Z,te,pe,oe){r("xRange",R,q,V,Z,te,pe,oe);var Et=Y(Z),St=Et||Y(te),ot=St||Y(pe),Ye=ot;return V==="="&&Ye&&(V=""),oe=O.includePrerelease?"-0":"",Et?V===">"||V==="<"?q="<0.0.0-0":q="*":V&&Ye?(St&&(te=0),pe=0,V===">"?(V=">=",St?(Z=+Z+1,te=0,pe=0):(te=+te+1,pe=0)):V==="<="&&(V="<",St?Z=+Z+1:te=+te+1),q=V+Z+"."+te+"."+pe+oe):St?q=">="+Z+".0.0"+oe+" <"+(+Z+1)+".0.0"+oe:ot&&(q=">="+Z+"."+te+".0"+oe+" <"+Z+"."+(+te+1)+".0"+oe),r("xRange return",q),q})}function Sm(R,O){return r("replaceStars",R,O),R.trim().replace(u[c.STAR],"")}function bm(R,O,P,q,V,Z,te,pe,oe,Et,St,ot,Ye){return Y(P)?O="":Y(q)?O=">="+P+".0.0":Y(V)?O=">="+P+"."+q+".0":O=">="+O,Y(oe)?pe="":Y(Et)?pe="<"+(+oe+1)+".0.0":Y(St)?pe="<"+oe+"."+(+Et+1)+".0":ot?pe="<="+oe+"."+Et+"."+St+"-"+ot:pe="<="+pe,(O+" "+pe).trim()}N.prototype.test=function(R){if(!R)return!1;if(typeof R=="string")try{R=new g(R,this.options)}catch{return!1}for(var O=0;O<this.set.length;O++)if(Rm(this.set[O],R,this.options))return!0;return!1};function Rm(R,O,P){for(var q=0;q<R.length;q++)if(!R[q].test(O))return!1;if(O.prerelease.length&&!P.includePrerelease){for(q=0;q<R.length;q++)if(r(R[q].semver),R[q].semver!==L&&R[q].semver.prerelease.length>0){var V=R[q].semver;if(V.major===O.major&&V.minor===O.minor&&V.patch===O.patch)return!0}return!1}return!0}t.satisfies=Br;function Br(R,O,P){try{O=new N(O,P)}catch{return!1}return O.test(R)}t.maxSatisfying=$m;function $m(R,O,P){var q=null,V=null;try{var Z=new N(O,P)}catch{return null}return R.forEach(function(te){Z.test(te)&&(!q||V.compare(te)===-1)&&(q=te,V=new g(q,P))}),q}t.minSatisfying=Om;function Om(R,O,P){var q=null,V=null;try{var Z=new N(O,P)}catch{return null}return R.forEach(function(te){Z.test(te)&&(!q||V.compare(te)===1)&&(q=te,V=new g(q,P))}),q}t.minVersion=Im;function Im(R,O){R=new N(R,O);var P=new g("0.0.0");if(R.test(P)||(P=new g("0.0.0-0"),R.test(P)))return P;P=null;for(var q=0;q<R.set.length;++q){var V=R.set[q];V.forEach(function(Z){var te=new g(Z.semver.version);switch(Z.operator){case">":te.prerelease.length===0?te.patch++:te.prerelease.push(0),te.raw=te.format();case"":case">=":(!P||W(P,te))&&(P=te);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+Z.operator)}})}return P&&R.test(P)?P:null}t.validRange=Pm;function Pm(R,O){try{return new N(R,O).range||"*"}catch{return null}}t.ltr=Tm;function Tm(R,O,P){return Gn(R,O,"<",P)}t.gtr=xm;function xm(R,O,P){return Gn(R,O,">",P)}t.outside=Gn;function Gn(R,O,P,q){R=new g(R,q),O=new N(O,q);var V,Z,te,pe,oe;switch(P){case">":V=W,Z=se,te=re,pe=">",oe=">=";break;case"<":V=re,Z=ie,te=W,pe="<",oe="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Br(R,O,q))return!1;for(var Et=0;Et<O.set.length;++Et){var St=O.set[Et],ot=null,Ye=null;if(St.forEach(function(Dt){Dt.semver===L&&(Dt=new D(">=0.0.0")),ot=ot||Dt,Ye=Ye||Dt,V(Dt.semver,ot.semver,q)?ot=Dt:te(Dt.semver,Ye.semver,q)&&(Ye=Dt)}),ot.operator===pe||ot.operator===oe||(!Ye.operator||Ye.operator===pe)&&Z(R,Ye.semver))return!1;if(Ye.operator===oe&&te(R,Ye.semver))return!1}return!0}t.prerelease=Am;function Am(R,O){var P=S(R,O);return P&&P.prerelease.length?P.prerelease:null}t.intersects=Cm;function Cm(R,O,P){return R=new N(R,P),O=new N(O,P),R.intersects(O)}t.coerce=Nm;function Nm(R,O){if(R instanceof g)return R;if(typeof R=="number"&&(R=String(R)),typeof R!="string")return null;O=O||{};var P=null;if(!O.rtl)P=R.match(u[c.COERCE]);else{for(var q;(q=u[c.COERCERTL].exec(R))&&(!P||P.index+P[0].length!==R.length);)(!P||q.index+q[0].length!==P.index+P[0].length)&&(P=q),u[c.COERCERTL].lastIndex=q.index+q[1].length+q[2].length;u[c.COERCERTL].lastIndex=-1}return P===null?null:S(P[2]+"."+(P[3]||"0")+"."+(P[4]||"0"),O)}}(nn,nn.exports)),nn.exports}var qt=Ar.exports,Fd;function rS(){return Fd||(Fd=1,function(e,t){var r=qt&&qt.__createBinding||(Object.create?function(E,d,f,h){h===void 0&&(h=f);var y=Object.getOwnPropertyDescriptor(d,f);(!y||("get"in y?!d.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(E,h,y)}:function(E,d,f,h){h===void 0&&(h=f),E[h]=d[f]}),n=qt&&qt.__setModuleDefault||(Object.create?function(E,d){Object.defineProperty(E,"default",{enumerable:!0,value:d})}:function(E,d){E.default=d}),i=qt&&qt.__importStar||function(E){if(E&&E.__esModule)return E;var d={};if(E!=null)for(var f in E)f!=="default"&&Object.prototype.hasOwnProperty.call(E,f)&&r(d,E,f);return n(d,E),d},o=qt&&qt.__awaiter||function(E,d,f,h){function y(v){return v instanceof f?v:new f(function(S){S(v)})}return new(f||(f=Promise))(function(v,S){function _($){try{g(h.next($))}catch(I){S(I)}}function b($){try{g(h.throw($))}catch(I){S(I)}}function g($){$.done?v($.value):y($.value).then(_,b)}g((h=h.apply(E,d||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._readLinuxVersionFile=t._getOsVersion=t._findMatch=void 0;const s=i(Hh()),l=wr(),u=it,a=Fr,c=je;function m(E,d,f,h){return o(this,void 0,void 0,function*(){const y=u.platform();let v,S,_;for(const b of f){const g=b.version;if((0,l.debug)(`check ${g} satisfies ${E}`),s.satisfies(g,E)&&(!d||b.stable===d)&&(_=b.files.find($=>{(0,l.debug)(`${$.arch}===${h} && ${$.platform}===${y}`);let I=$.arch===h&&$.platform===y;if(I&&$.platform_version){const A=e.exports._getOsVersion();A===$.platform_version?I=!0:I=s.satisfies(A,$.platform_version)}return I}),_)){(0,l.debug)(`matched ${b.version}`),S=b;break}}return S&&_&&(v=Object.assign({},S),v.files=[_]),v})}t._findMatch=m;function p(){const E=u.platform();let d="";if(E==="darwin")d=a.execSync("sw_vers -productVersion").toString();else if(E==="linux"){const f=e.exports._readLinuxVersionFile();if(f){const h=f.split(`
|
||
`);for(const y of h){const v=y.split("=");if(v.length===2&&(v[0].trim()==="VERSION_ID"||v[0].trim()==="DISTRIB_RELEASE")){d=v[1].trim().replace(/^"/,"").replace(/"$/,"");break}}}}return d}t._getOsVersion=p;function w(){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=w}(Ar,Ar.exports)),Ar.exports}var et={},qd;function nS(){if(qd)return et;qd=1;var e=et&&et.__createBinding||(Object.create?function(s,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(s,a,c)}:function(s,l,u,a){a===void 0&&(a=u),s[a]=l[u]}),t=et&&et.__setModuleDefault||(Object.create?function(s,l){Object.defineProperty(s,"default",{enumerable:!0,value:l})}:function(s,l){s.default=l}),r=et&&et.__importStar||function(s){if(s&&s.__esModule)return s;var l={};if(s!=null)for(var u in s)u!=="default"&&Object.prototype.hasOwnProperty.call(s,u)&&e(l,s,u);return t(l,s),l},n=et&&et.__awaiter||function(s,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 w(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(w,E)}d((a=a.apply(s,l||[])).next())})};Object.defineProperty(et,"__esModule",{value:!0}),et.RetryHelper=void 0;const i=r(wr());class o{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;i.info(m.message)}const c=this.getSleepAmount();i.info(`Waiting ${c} seconds before trying again`),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 et.RetryHelper=o,et}var Ud;function iS(){if(Ud)return ae;Ud=1;var e=ae&&ae.__createBinding||(Object.create?function(D,L,N,j){j===void 0&&(j=N);var B=Object.getOwnPropertyDescriptor(L,N);(!B||("get"in B?!L.__esModule:B.writable||B.configurable))&&(B={enumerable:!0,get:function(){return L[N]}}),Object.defineProperty(D,j,B)}:function(D,L,N,j){j===void 0&&(j=N),D[j]=L[N]}),t=ae&&ae.__setModuleDefault||(Object.create?function(D,L){Object.defineProperty(D,"default",{enumerable:!0,value:L})}:function(D,L){D.default=L}),r=ae&&ae.__importStar||function(D){if(D&&D.__esModule)return D;var L={};if(D!=null)for(var N in D)N!=="default"&&Object.prototype.hasOwnProperty.call(D,N)&&e(L,D,N);return t(L,D),L},n=ae&&ae.__awaiter||function(D,L,N,j){function B(ee){return ee instanceof N?ee:new N(function(Y){Y(ee)})}return new(N||(N=Promise))(function(ee,Y){function ke(xe){try{Ke(j.next(xe))}catch(Nt){Y(Nt)}}function Te(xe){try{Ke(j.throw(xe))}catch(Nt){Y(Nt)}}function Ke(xe){xe.done?ee(xe.value):B(xe.value).then(ke,Te)}Ke((j=j.apply(D,L||[])).next())})};Object.defineProperty(ae,"__esModule",{value:!0}),ae.evaluateVersions=ae.isExplicitVersion=ae.findFromManifest=ae.getManifestFromRepo=ae.findAllVersions=ae.find=ae.cacheFile=ae.cacheDir=ae.extractZip=ae.extractXar=ae.extractTar=ae.extract7z=ae.downloadTool=ae.HTTPError=void 0;const i=r(wr()),o=r(Np()),s=r(mp),l=r(je),u=r(rS()),a=r(it),c=r(ue),m=r(Ap),p=r(Hh()),w=r(Ur),E=r(xn),d=qr,f=ka(),h=nS();class y extends Error{constructor(L){super(`Unexpected HTTP response: ${L}`),this.httpStatusCode=L,Object.setPrototypeOf(this,new.target.prototype)}}ae.HTTPError=y;const v=process.platform==="win32",S=process.platform==="darwin",_="actions/tool-cache";function b(D,L,N,j){return n(this,void 0,void 0,function*(){L=L||c.join(ie(),s.randomUUID()),yield o.mkdirP(c.dirname(L)),i.debug(`Downloading ${D}`),i.debug(`Destination ${L}`);const B=3,ee=se("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),Y=se("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20);return yield new h.RetryHelper(B,ee,Y).execute(()=>n(this,void 0,void 0,function*(){return yield g(D,L||"",N,j)}),Te=>!(Te instanceof y&&Te.httpStatusCode&&Te.httpStatusCode<500&&Te.httpStatusCode!==408&&Te.httpStatusCode!==429))})}ae.downloadTool=b;function g(D,L,N,j){return n(this,void 0,void 0,function*(){if(l.existsSync(L))throw new Error(`Destination file path ${L} already exists`);const B=new m.HttpClient(_,[],{allowRetries:!1});N&&(i.debug("set auth"),j===void 0&&(j={}),j.authorization=N);const ee=yield B.get(D,j);if(ee.message.statusCode!==200){const xe=new y(ee.message.statusCode);throw i.debug(`Failed to download from "${D}". Code(${ee.message.statusCode}) Message(${ee.message.statusMessage})`),xe}const Y=E.promisify(w.pipeline),Te=se("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",()=>ee.message)();let Ke=!1;try{return yield Y(Te,l.createWriteStream(L)),i.debug("download complete"),Ke=!0,L}finally{if(!Ke){i.debug("download failed");try{yield o.rmRF(L)}catch(xe){i.debug(`Failed to delete '${L}'. ${xe.message}`)}}}})}function $(D,L,N){return n(this,void 0,void 0,function*(){(0,d.ok)(v,"extract7z() not supported on current OS"),(0,d.ok)(D,'parameter "file" is required'),L=yield C(L);const j=process.cwd();if(process.chdir(L),N)try{const ee=["x",i.isDebug()?"-bb1":"-bb0","-bd","-sccUTF-8",D],Y={silent:!0};yield(0,f.exec)(`"${N}"`,ee,Y)}finally{process.chdir(j)}else{const B=c.join(__dirname,"..","scripts","Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,""),ee=D.replace(/'/g,"''").replace(/"|\n|\r/g,""),Y=L.replace(/'/g,"''").replace(/"|\n|\r/g,""),Te=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",`& '${B}' -Source '${ee}' -Target '${Y}'`],Ke={silent:!0};try{const xe=yield o.which("powershell",!0);yield(0,f.exec)(`"${xe}"`,Te,Ke)}finally{process.chdir(j)}}return L})}ae.extract7z=$;function I(D,L,N="xz"){return n(this,void 0,void 0,function*(){if(!D)throw new Error("parameter 'file' is required");L=yield C(L),i.debug("Checking tar --version");let j="";yield(0,f.exec)("tar --version",[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:Te=>j+=Te.toString(),stderr:Te=>j+=Te.toString()}}),i.debug(j.trim());const B=j.toUpperCase().includes("GNU TAR");let ee;N instanceof Array?ee=N:ee=[N],i.isDebug()&&!N.includes("v")&&ee.push("-v");let Y=L,ke=D;return v&&B&&(ee.push("--force-local"),Y=L.replace(/\\/g,"/"),ke=D.replace(/\\/g,"/")),B&&(ee.push("--warning=no-unknown-keyword"),ee.push("--overwrite")),ee.push("-C",Y,"-f",ke),yield(0,f.exec)("tar",ee),L})}ae.extractTar=I;function A(D,L,N=[]){return n(this,void 0,void 0,function*(){(0,d.ok)(S,"extractXar() not supported on current OS"),(0,d.ok)(D,'parameter "file" is required'),L=yield C(L);let j;N instanceof Array?j=N:j=[N],j.push("-x","-C",L,"-f",D),i.isDebug()&&j.push("-v");const B=yield o.which("xar",!0);return yield(0,f.exec)(`"${B}"`,we(j)),L})}ae.extractXar=A;function M(D,L){return n(this,void 0,void 0,function*(){if(!D)throw new Error("parameter 'file' is required");return L=yield C(L),v?yield K(D,L):yield Q(D,L),L})}ae.extractZip=M;function K(D,L){return n(this,void 0,void 0,function*(){const N=D.replace(/'/g,"''").replace(/"|\n|\r/g,""),j=L.replace(/'/g,"''").replace(/"|\n|\r/g,""),B=yield o.which("pwsh",!1);if(B){const Y=["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;",`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${N}', '${j}', $true) }`,`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${N}' -DestinationPath '${j}' -Force } else { throw $_ } } ;`].join(" ")];i.debug(`Using pwsh at path: ${B}`),yield(0,f.exec)(`"${B}"`,Y)}else{const Y=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;",`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${N}' -DestinationPath '${j}' -Force }`,`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${N}', '${j}', $true) }`].join(" ")],ke=yield o.which("powershell",!0);i.debug(`Using powershell at path: ${ke}`),yield(0,f.exec)(`"${ke}"`,Y)}})}function Q(D,L){return n(this,void 0,void 0,function*(){const N=yield o.which("unzip",!0),j=[D];i.isDebug()||j.unshift("-q"),j.unshift("-o"),yield(0,f.exec)(`"${N}"`,j,{cwd:L})})}function x(D,L,N,j){return n(this,void 0,void 0,function*(){if(N=p.clean(N)||N,j=j||a.arch(),i.debug(`Caching tool ${L} ${N} ${j}`),i.debug(`source dir: ${D}`),!l.statSync(D).isDirectory())throw new Error("sourceDir is not a directory");const B=yield H(L,N,j);for(const ee of l.readdirSync(D)){const Y=c.join(D,ee);yield o.cp(Y,B,{recursive:!0})}return W(L,N,j),B})}ae.cacheDir=x;function T(D,L,N,j,B){return n(this,void 0,void 0,function*(){if(j=p.clean(j)||j,B=B||a.arch(),i.debug(`Caching tool ${N} ${j} ${B}`),i.debug(`source file: ${D}`),!l.statSync(D).isFile())throw new Error("sourceFile is not a file");const ee=yield H(N,j,B),Y=c.join(ee,L);return i.debug(`destination file ${Y}`),yield o.cp(D,Y),W(N,j,B),ee})}ae.cacheFile=T;function F(D,L,N){if(!D)throw new Error("toolName parameter is required");if(!L)throw new Error("versionSpec parameter is required");if(N=N||a.arch(),!re(L)){const B=U(D,N);L=ce(B,L)}let j="";if(L){L=p.clean(L)||"";const B=c.join(X(),D,L,N);i.debug(`checking cache: ${B}`),l.existsSync(B)&&l.existsSync(`${B}.complete`)?(i.debug(`Found tool in cache ${D} ${L} ${N}`),j=B):i.debug("not found")}return j}ae.find=F;function U(D,L){const N=[];L=L||a.arch();const j=c.join(X(),D);if(l.existsSync(j)){const B=l.readdirSync(j);for(const ee of B)if(re(ee)){const Y=c.join(j,ee,L||"");l.existsSync(Y)&&l.existsSync(`${Y}.complete`)&&N.push(ee)}}return N}ae.findAllVersions=U;function k(D,L,N,j="master"){return n(this,void 0,void 0,function*(){let B=[];const ee=`https://api.github.com/repos/${D}/${L}/git/trees/${j}`,Y=new m.HttpClient("tool-cache"),ke={};N&&(i.debug("set auth"),ke.authorization=N);const Te=yield Y.getJson(ee,ke);if(!Te.result)return B;let Ke="";for(const Nt of Te.result.tree)if(Nt.path==="versions-manifest.json"){Ke=Nt.url;break}ke.accept="application/vnd.github.VERSION.raw";let xe=yield(yield Y.get(Ke,ke)).readBody();if(xe){xe=xe.replace(/^\uFEFF/,"");try{B=JSON.parse(xe)}catch{i.debug("Invalid json")}}return B})}ae.getManifestFromRepo=k;function G(D,L,N,j=a.arch()){return n(this,void 0,void 0,function*(){return yield u._findMatch(D,L,N,j)})}ae.findFromManifest=G;function C(D){return n(this,void 0,void 0,function*(){return D||(D=c.join(ie(),s.randomUUID())),yield o.mkdirP(D),D})}function H(D,L,N){return n(this,void 0,void 0,function*(){const j=c.join(X(),D,p.clean(L)||L,N||"");i.debug(`destination ${j}`);const B=`${j}.complete`;return yield o.rmRF(j),yield o.rmRF(B),yield o.mkdirP(j),j})}function W(D,L,N){const B=`${c.join(X(),D,p.clean(L)||L,N||"")}.complete`;l.writeFileSync(B,""),i.debug("finished caching tool")}function re(D){const L=p.clean(D)||"";i.debug(`isExplicit: ${L}`);const N=p.valid(L)!=null;return i.debug(`explicit? ${N}`),N}ae.isExplicitVersion=re;function ce(D,L){let N="";i.debug(`evaluating ${D.length} versions`),D=D.sort((j,B)=>p.gt(j,B)?1:-1);for(let j=D.length-1;j>=0;j--){const B=D[j];if(p.satisfies(B,L)){N=B;break}}return N?i.debug(`matched: ${N}`):i.debug("match not found"),N}ae.evaluateVersions=ce;function X(){const D=process.env.RUNNER_TOOL_CACHE||"";return(0,d.ok)(D,"Expected RUNNER_TOOL_CACHE to be defined"),D}function ie(){const D=process.env.RUNNER_TEMP||"";return(0,d.ok)(D,"Expected RUNNER_TEMP to be defined"),D}function se(D,L){const N=at[D];return N!==void 0?N:L}function we(D){return Array.from(new Set(D))}return ae}var tc=iS(),$t={},jd;function sS(){if(jd)return $t;jd=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.retryAsPromised=$t.applyJitter=$t.TimeoutError=void 0;class e extends Error{constructor(o,s){super(o),this.name="TimeoutError",this.previous=s}}$t.TimeoutError=e;function t(i,o){if(typeof i=="function")try{if(o instanceof i)return!0}catch{return!!i(o)}return i===o.toString()||i===o.message?!0:i instanceof RegExp&&(i.test(o.message)||i.test(o.toString()))}function r(i,o){const s=i+Math.random()*o*(Math.random()>.5?1:-1);return Math.max(0,s)}$t.applyJitter=r;function n(i,o){if(!i||!o)throw new Error("retry-as-promised must be passed a callback and a options set");o=typeof o=="number"?{max:o}:o;const s={$current:"$current"in o?o.$current:1,max:o.max,timeout:o.timeout||void 0,match:o.match?Array.isArray(o.match)?o.match:[o.match]:[],backoffBase:o.backoffBase===void 0?100:o.backoffBase,backoffExponent:o.backoffExponent||1.1,backoffJitter:o.backoffJitter||0,report:o.report,name:o.name||i.name||"unknown"};return s.match&&!Array.isArray(s.match)&&(s.match=[s.match]),s.report&&s.report("Trying "+s.name+" #"+s.$current+" at "+new Date().toLocaleTimeString(),s),new Promise(function(l,u){let a,c,m;s.timeout&&(a=setTimeout(function(){c&&clearTimeout(c),u(new e(s.name+" timed out",m))},s.timeout)),Promise.resolve(i({current:s.$current})).then(l).then(function(){a&&clearTimeout(a),c&&clearTimeout(c)}).catch(function(p){a&&clearTimeout(a),c&&clearTimeout(c),m=p,s.report&&s.report(p&&p.toString()||p,s,p);var w=s.$current<s.max;if(!w||(w=s.match.length===0||s.match.some(function(f){return t(f,p)}),!w))return u(p);var E=s.backoffBase*Math.pow(s.backoffExponent,s.$current-1);const d=s.backoffJitter;d!==void 0&&(E=r(E,d)),s.$current++,s.report&&s.report(`Retrying ${s.name} (${s.$current})`,s),E?(s.report&&s.report(`Delaying retry of ${s.name} by ${E}`,s),c=setTimeout(function(){n(i,s).then(l).catch(u)},E)):n(i,s).then(l).catch(u)})})}return $t.retryAsPromised=n,$t.default=n,$t}var oS=sS();const zh=$e(oS),{GITHUB_ACTIONS:Wh}=xt;async function gt(e,t,r,n,i){z(`Installing ${e} ${t} ${i} via direct downloading`),process.env.RUNNER_TEMP=process.env.RUNNER_TEMP??Ue(),process.env.RUNNER_TOOL_CACHE=process.env.RUNNER_TOOL_CACHE??J(Ue(),"setup-cpp","hostedtoolcache");const{url:o,binRelativeDir:s,binFileName:l,extractedFolderName:u,extractFunction:a}=await r(t,process.platform,i);if(Wh)try{const w=tc.find(e,t);if(w){const E=J(w,u),d=J(E,s);if(await ye(J(d,l)))return z(`${e} ${t} was found in the cache at ${d}.`),await Re(d,ne),{installDir:E,binDir:d}}}catch{}const c=J(n,u),m=J(c,s),p=J(m,l);return await aS(m,p,e,t,o,n,a,i),await uS(n,e,t),{installDir:c,binDir:m}}async function aS(e,t,r,n,i,o,s,l){if((await Promise.all([ye(e),ye(t)])).includes(!1))try{const u=await cS(r,n,i);z(`Extracting ${u} to ${o}`),await(s??Yh(Kh(i)))(u,o)}catch(u){throw new Error(`Failed to download ${r} ${n} ${l} from ${i}: ${u}`)}if(z(`Add ${e} to PATH`),await Re(e,ne),!await ye(t))throw new Error(`Failed to find the binary ${t} after extracting ${r} ${n} ${l}`);if(process.platform!=="win32")try{await Ep(t,"755")}catch(u){ve(`Failed to make ${t} executable: ${u}`)}}async function cS(e,t,r){return z(`Download ${e} ${t}`),await zh(()=>{const i=`${Date.now()}-setup-cpp-`,o=J(process.env.RUNNER_TEMP??Ue(),`${i}${er(r)}`);return tc.downloadTool(r,o)},{name:r,max:4,backoffBase:2e3,report:i=>z(i)})}async function uS(e,t,r){Wh&&typeof process.env.RUNNER_TOOL_CACHE=="string"&&(Lp("cache-tools")==="true"||process.env.CACHE_TOOLS==="true")&&await tc.cacheDir(e,t,r)}async function Xh({version:e,arch:t,setupDir:r}){const n=await fe("tar",{nothrow:!0});if(n!==null){z(`tar already installed at ${n}`);return}switch(process.platform){case"win32":return gt("tar",e,lS,r,t);case"darwin":return Ge("gnu-tar",e);case"linux":{if(Pe())return await _e("gzip"),await _e("xz"),_e("tar");if(Ne())return Ce([{name:"tar"},{name:"gzip"},{name:"xz"}]);if(me())return de([{name:"tar"},{name:"gzip"},{name:"xz-utils"}]);if(await Oe())return De([{name:"tar"},{name:"gzip"},{name:"xz"}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}function lS(e,t,r){if(t!=="win32")throw new Error("Unsupported platform");return r!=="x64"&&ve(`Unsupported architecture ${r} for tar on Windows. Using x64.`),{url:`https://phoenixnap.dl.sourceforge.net/project/gnuwin32/tar/${e}/tar-${e}-bin.zip?viasf=1`,extractedFolderName:"",binRelativeDir:"bin",binFileName:"tar.exe"}}var ln=(e=>(e[e.Tar=0]="Tar",e[e.TarGz=1]="TarGz",e[e.TarXz=2]="TarXz",e[e.Zip=3]="Zip",e[e.SevenZip=4]="SevenZip",e))(ln||{});function Kh(e){const t=e.split(".").pop();return t==="tar"?0:t==="gz"||t==="tgz"?1:t==="xz"||t==="txz"?2:t==="zip"?3:(t==="7z"||t==="exe"||ve(`Unknown archive type: ${t}. Defaulting to 7z`),4)}function Yh(e){switch(e){case 0:case 1:case 2:return process.platform==="win32"?yr:rc;case 3:return hS;default:return yr}}let pa;async function yr(e,t,r=!1){const n=er(e);return/.*\.tar\..+$/.test(n)?await fS(e,n,t,r):await $a(e,t),t}async function fS(e,t,r,n){if(!/.*\.tar\..+$/.test(t))throw new Error(`Invalid tar file: ${t}`);const i=J(be(e),"sevenzip-temp");await $a(e,i);const o=t.slice(0,-3),s=J(i,o);await $a(s,i),await Pt.remove(s),z(`Moving ${i} to ${r}`);const l=await Pt.readdir(i);await Promise.all(l.map(async u=>{await Pt.move(J(i,u),J(r,u),{overwrite:!0})})),await Pt.remove(i),n&&await dS(r)}async function dS(e){z(`Stripping path components from ${e}`);const t=await Pt.readdir(e);if(t.length!==1)throw new Error(`Expected 1 folder in ${e}, got ${t.length}`);const r=t[0],n=J(e,r),i=await Pt.stat(n);if(!i.isDirectory()){ve(`Expected ${n} to be a directory, got ${i}.`);return}const o=await Pt.readdir(n);await Promise.all(o.map(s=>Pt.move(J(n,s),J(e,s),{overwrite:!0}))),await Pt.remove(n)}async function $a(e,t){z(`7z: extracting ${e} to ${t}`),await le(await pS(),["x",e,`-o${t}`,"-y"],{stdio:"inherit"}),await Er(t)}async function pS(){return pa===void 0&&(fe.sync("7z",{nothrow:!0})===null&&await un({version:""}),pa="7z"),pa}async function hS(e,t){return fe.sync("7z",{nothrow:!0})!==null?yr(e,t):fe.sync("unzip",{nothrow:!0})!==null?(await le("unzip",["-q",e,"-d",t],{stdio:"inherit"}),await Er(t),t):yr(e,t)}async function rc(e,t,r=0,n=[]){await Xh({version:"",arch:process.arch,setupDir:rt("~/tar")});try{await Pt.mkdirp(t)}catch{}try{await le("tar",["xf",e,"-C",t,`--strip-components=${r}`,...n],{stdio:"inherit"})}catch(i){process.platform==="win32"&&i.message.includes("Can't create '\\\\?\\C:")&&ve(`Failed to extract symlink ${e} to ${t}. Ignoring this symlink.`)}return await Er(t),t}const{GITHUB_ACTIONS:mS}=xt,yS=typeof __dirname=="string"?__dirname:ue.dirname(Lt(import.meta.url));async function nc({version:e,setupDir:t,arch:r}){let n;switch(process.platform){case"win32":{(r==="arm"||r==="arm64")&&(n=await Le("gcc-arm-embedded",e));try{n=await gt("g++",e,wS,t,r)}catch(i){z(`Failed to download g++ binary. ${i}. Falling back to chocolatey.`),n=await vS(e,r)}break}case"linux":{if(Pe())n=await _e("mingw-w64-gcc",e);else if(Ne())n=await Ce([{name:"mingw64-gcc",version:e}]);else if(me())n=await de([{name:"mingw-w64",version:e}]);else if(await Oe())await bh(),n=await De([{name:"mingw-w64-gcc",version:e},{name:"mingw-w64-crt",version:e}]);else throw new Error(`Unsupported Linux distro for ${r}`);break}default:throw new Error(`Unsupported platform for ${r}`)}return n!==void 0&&await gS(n.binDir),n}async function vS(e,t){await Le("mingw",e);let r;if(t==="x64"&&await ye("C:/tools/mingw64/bin")?(r="C:/tools/mingw64/bin",await Re(r,ne)):t==="ia32"&&await ye("C:/tools/mingw32/bin")?(r="C:/tools/mingw32/bin",await Re(r,ne)):await ye(`${process.env.ChocolateyInstall??"C:/ProgramData/chocolatey"}/bin/g++.exe`)&&(r=`${process.env.ChocolateyInstall??"C:/ProgramData/chocolatey"}/bin`),r!==void 0)return{binDir:r}}async function wS(e,t,r){if(t!=="win32")throw new Error(`Unsupported platform '${t}'`);const n=await Sn(J(yS,"github_brechtsanders_winlibs_mingw.json")),i={x64:"x86_64",ia32:"i386"},o=ha(e),s=ma(e),l=Md(e),u=bn(n,{version:e,keywords:[i[r]??r],filterName:a=>(o===void 0||o===ha(a))&&(s===void 0||s===ma(a))&&(l===void 0||l===Md(a)),versionSatisfies:(a,c)=>{const m=mr(a);if(m===null)throw new Error(`Invalid MinGW asset version: '${a}'`);return Ya(m,c)&&(o===void 0||o===ha(a))&&(s===void 0||s===ma(a))}});if(u===void 0)throw new Error(`No asset found for version ${e} and arch ${r}`);return{binRelativeDir:"bin/",binFileName:ge("g++"),extractedFolderName:"mingw64",extractFunction:yr,url:`https://github.com/brechtsanders/winlibs_mingw/releases/download/${u.tag}/${u.name}`}}function ha(e){const t=e.match(/(ucrt|msvcrt)/);return t!==null?t[1]:void 0}function ma(e){const t=e.match(/(posix|mcf)/);return t!==null?t[1]:void 0}function Md(e){const t=e.match(/(seh|dwarf)/);return t!==null?t[1]:void 0}async function gS(e){const t=[];process.platform==="win32"&&t.push(Ie("CC",ge(`${e}/gcc`),ne),Ie("CXX",ge(`${e}/g++`),ne)),mS&&await Gh(),await Promise.all(t)}const{GITHUB_ACTIONS:_S}=xt,ES=typeof __dirname=="string"?__dirname:ue.dirname(Lt(import.meta.url));async function Rn({version:e,setupDir:t,arch:r,priority:n=40}){let i;switch(process.platform){case"win32":{i=await nc({version:e,setupDir:t,arch:r});break}case"darwin":{i=await Ge("gcc",e);break}case"linux":{if(Pe())i=await _e("gcc",e);else if(Ne())i=await Ce([{name:"gcc",version:e},{name:"gcc-c++",version:e},{name:"libstdc++-devel"}]);else if(await Oe())i=await De([{name:"gcc",version:e},{name:"g++",version:e}]);else if(me())if(e==="")i=await de([{name:"gcc"},{name:"g++"}]);else try{i=await de([{name:"gcc",version:e},{name:"g++",version:e}])}catch{i=await de([{name:"gcc",version:e,repository:"ppa:ubuntu-toolchain-r/test",key:{key:"1E9377A2BA9EF27F",fileName:"ubuntu-toolchain-r-test.gpg"}},{name:"g++",version:e,repository:"ppa:ubuntu-toolchain-r/test",key:{key:"1E9377A2BA9EF27F",fileName:"ubuntu-toolchain-r-test.gpg"}}])}break}default:throw new Error(`Unsupported platform for ${r}`)}if(i!==void 0)return await SS(e,i.binDir,n),i}async function SS(e,t,r=40){if(process.platform==="win32")return;const n=[];{const i=bS(e),[o,s]=await Promise.all([Gd("gcc",t,i),Gd("g++",t,i)]);n.push(Ie("CC",o,ne),Ie("CXX",s,ne)),me()&&n.push(vt("cc",o,ne,r),vt("cxx",s,ne,r),vt("gcc",o,ne,r),vt("g++",s,ne,r))}n.push(qh()),_S&&await Gh(),await Promise.all(n)}function bS(e){try{const t=Ja(e),r=Eh(t);return r>=5?`${r}`:e}catch{return e}}async function Gd(e,t,r){if(await ye(`${t}/${e}-${r}`))return ge(`${t}/${e}-${r}`);const n=new RegExp(`^${_n(e)}-?([\\d\\.\\-]*)(?:\\.exe)?$`),i=(await Sp(t)).filter(o=>n.test(o)).sort((o,s)=>{const l=o.match(n)?.[1]??"",u=s.match(n)?.[1]??"";try{return AE(l,u)}catch{return 0}});for(const o of i){const s=`${t}/${o}`;if(r===""||o.includes(r)||((await RS(s))?.includes(r)??!1))return ge(s)}return await ye(`${t}/${e}`)?ge(`${t}/${e}`):ge(e)}async function RS(e){try{const{stdout:t}=await le(e,["--version"],{stdio:"pipe"}),r=t.match(/(gcc|g\+\+).* \(.*\) ([\d.]+)/);if(r!==null)return r[2];ve(`Failed to parse gcc version from: ${t}`)}catch(t){Ae(`Failed to get gcc version: ${t}`)}}const Mt=e=>{if(!e)e={mode:511};else if(typeof e=="object")e={mode:511,...e};else if(typeof e=="number")e={mode:e};else if(typeof e=="string")e={mode:parseInt(e,8)};else throw new TypeError("invalid options argument");const t=e,r=e.fs||{};return e.mkdir=e.mkdir||r.mkdir||pp,e.mkdirAsync=e.mkdirAsync?e.mkdirAsync:async(n,i)=>new Promise((o,s)=>t.mkdir(n,i,(l,u)=>l?s(l):o(u))),e.stat=e.stat||r.stat||km,e.statAsync=e.statAsync?e.statAsync:async n=>new Promise((i,o)=>t.stat(n,(s,l)=>s?o(s):i(l))),e.statSync=e.statSync||r.statSync||Fm,e.mkdirSync=e.mkdirSync||r.mkdirSync||hp,t},tr=(e,t,r)=>{const n=be(e),i={...Mt(t),recursive:!1};if(n===e)try{return i.mkdirSync(e,i)}catch(o){const s=o;if(s&&s.code!=="EISDIR")throw o;return}try{return i.mkdirSync(e,i),r||e}catch(o){const s=o;if(s&&s.code==="ENOENT")return tr(e,i,tr(n,i,r));if(s&&s.code!=="EEXIST"&&s&&s.code!=="EROFS")throw o;try{if(!i.statSync(e).isDirectory())throw o}catch{throw o}}},lr=Object.assign(async(e,t,r)=>{const n=Mt(t);n.recursive=!1;const i=be(e);return i===e?n.mkdirAsync(e,n).catch(o=>{const s=o;if(s&&s.code!=="EISDIR")throw o}):n.mkdirAsync(e,n).then(()=>r||e,async o=>{const s=o;if(s&&s.code==="ENOENT")return lr(i,n).then(l=>lr(e,n,l));if(s&&s.code!=="EEXIST"&&s.code!=="EROFS")throw o;return n.statAsync(e).then(l=>{if(l.isDirectory())return r;throw o},()=>{throw o})})},{sync:tr}),Jh=async(e,t,r)=>{if(r!==t)return e.statAsync(t).then(n=>n.isDirectory()?r:void 0,n=>{const i=n;return i&&i.code==="ENOENT"?Jh(e,be(t),t):void 0})},Qh=(e,t,r)=>{if(r!==t)try{return e.statSync(t).isDirectory()?r:void 0}catch(n){const i=n;return i&&i.code==="ENOENT"?Qh(e,be(t),t):void 0}},$n=(e,t)=>{const r=Mt(t);if(r.recursive=!0,be(e)===e)return r.mkdirSync(e,r);const i=Qh(r,e);try{return r.mkdirSync(e,r),i}catch(o){const s=o;if(s&&s.code==="ENOENT")return tr(e,r);throw o}},ya=Object.assign(async(e,t)=>{const r={...Mt(t),recursive:!0};return be(e)===e?await r.mkdirAsync(e,r):Jh(r,e).then(i=>r.mkdirAsync(e,r).then(o=>i||o).catch(o=>{const s=o;if(s&&s.code==="ENOENT")return lr(e,r);throw o}))},{sync:$n}),$S=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,Zh=e=>{if(/\0/.test(e))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:e,code:"ERR_INVALID_ARG_VALUE"});if(e=Ia(e),$S==="win32"){const t=/[*|"<>?:]/,{root:r}=dp(e);if(t.test(e.substring(r.length)))throw Object.assign(new Error("Illegal characters in path."),{path:e,code:"EINVAL"})}return e},OS=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,va=OS.replace(/^v/,"").split("."),em=+va[0]>10||+va[0]==10&&+va[1]>=12,ic=em?e=>Mt(e).mkdirSync===hp:()=>!1,Vd=Object.assign(em?e=>Mt(e).mkdir===pp:()=>!1,{sync:ic}),Bd=(e,t)=>{e=Zh(e);const r=Mt(t);return ic(r)?$n(e,r):tr(e,r)},Cr=Object.assign(async(e,t)=>{e=Zh(e);const r=Mt(t);return Vd(r)?ya(e,r):lr(e,r)},{mkdirpSync:Bd,mkdirpNative:ya,mkdirpNativeSync:$n,mkdirpManual:lr,mkdirpManualSync:tr,sync:Bd,native:ya,nativeSync:$n,manual:lr,manualSync:tr,useNative:Vd,useNativeSync:ic});function nt(e,t,r=null){return tm(t)?sc(e,r)??"":t}function IS(){const e=typeof __dirname=="string"?__dirname:ue.dirname(Lt(import.meta.url)),t=ue.join(e,"versions.json");return JSON.parse(je.readFileSync(t,"utf-8"))}const PS=Fe(IS);function sc(e,t=null){const n=PS()[e];if(n===void 0)return;if(typeof n=="string")return n;const i=n,o=i[process.platform]??i.else;if(o===void 0)throw new Error(`Platform "${process.platform}" not found in versions data for tool "${e}"`);if(typeof o=="string")return o;const s=o,l=me()?"ubuntu":Pe()?"archlinux":Sh()?"alpine":Ne()?"fedora":"else",u=s[l]??s.else;if(u===void 0)throw new Error(`Distro "${l}" not found in versions data for tool "${e}"`);if(typeof u=="string")return u;const a=u,c=t!==null?TS(t,a):a.else;if(c===void 0)throw new Error(`Architecture "${process.arch}" not found in versions data for tool "${e}"`);if(typeof c=="string")return c;const m=c;return m[process.arch]??m.else}function TS(e,t){const r=e[0],n=Object.keys(t).map(i=>Number.parseInt(i,10)).filter(i=>!Number.isNaN(i)).sort((i,o)=>o-i).find(i=>r>=i);return n!==void 0?t[n]??t.else:t.else}function tm(e){return e==="true"||e===void 0}function xS(e,t,r=void 0){const n=r===void 0?!1:t.includes(r.compiler),o=(n?t:t.filter(u=>u!=="compiler")).filter(u=>e[u]!==void 0),s=o.filter(u=>{const a=n&&u==="compiler"&&r!==void 0?r.version:e[u];return!tm(a)}),l=s.length!==0?n&&s[0]==="compiler"&&r!==void 0?r.version??"true":e[s[0]]??"true":"true";if(s.some(u=>n&&u==="compiler"&&r!==void 0?e.compiler!==`${r.compiler}-${l}`:e[u]!==l))return!1;for(const u of o)e[u]=n&&u==="compiler"&&r!==void 0?`${r.compiler}-${l}`:l;return!0}function AS(e){return e.startsWith(">")}const{GITHUB_ACTIONS:CS}=xt;async function rm({version:e,setupDir:t,arch:r}){Ee.startGroup("Setup Python");const n=await FS(e,t,r);qr(n.bin!==void 0);const i=n.bin;Ee.endGroup(),Ee.startGroup("Setup venv"),await LS(i),Ee.endGroup(),Ee.startGroup("Setup pip");const o=await US(i);if(Ee.endGroup(),o===void 0)throw new Error("pip was not installed correctly");return Ee.startGroup("Setup pipx"),await NS(i),Ee.endGroup(),Ee.startGroup("Setup wheel"),await kS(i),Ee.endGroup(),n}async function NS(e){try{if(!await dn(e)){try{await kr("pipx")}catch(t){Zt(`pipx was not installed completely for the system-wide python: ${t}`)}try{await dn(e)||await On(e,"pipx",void 0,{upgrade:!0,usePipx:!1})}catch(t){Zt(`pipx was not installed completely for ${e}: ${t}`)}}if(await dn(e))await le(e,["-m","pipx","ensurepath"],{stdio:"inherit"});else if(await HS())Zt(`pipx module not found for ${e}. Trying to install with pipx binary...`),await le("pipx",["ensurepath"],{stdio:"inherit"});else throw new Error("pipx module or pipx binary not found. Corrput pipx installation.")}catch(t){Zt(`Failed to install pipx completely for ${e}: ${t.toString()}. Ignoring...`)}}async function LS(e){if(await DS(e)){z("venv module already installed.");return}try{await kr("venv")}catch(t){z(`Failed to install venv: ${t.toString()}. Ignoring...`)}}async function DS(e){try{return await le(e,["-m","venv","-h"],{stdio:"ignore"}),me()?Ha("python3-venv"):!0}catch{}return!1}async function kS(e){try{await On(e,"setuptools",void 0,{upgrade:!0,isLibrary:!0,usePipx:!1}),await On(e,"wheel",void 0,{upgrade:!1,isLibrary:!0,usePipx:!1})}catch(t){z(`Failed to install setuptools/wheel: ${t.toString()}. Ignoring...`)}}async function FS(e,t,r){const n=AS(e)?"":e;let i,o=await fn(t);if(o!==void 0){const s=be(o);i={bin:o,installDir:s,binDir:s}}else{if(CS)try{z("Installing python in GitHub Actions");const{setupActionsPython:s}=await import("./assets/actions_python-5i6QBnsE.mjs");if(await s(n,t,r),o=await fn(t),o===void 0)throw new Error("Python binary could not be found");const l=be(o);i={bin:o,installDir:l,binDir:l}}catch(s){ve(s.toString())}i===void 0&&(i=await qS(t,n))}if(o===void 0||i.bin===void 0){if(o=await fn(t),o===void 0)throw new Error("Python binary could not be found");i={bin:o,installDir:be(o),binDir:be(o)}}return i}async function qS(e,t){let r;switch(process.platform){case"win32":{e?await Le("python3",t,[`--params=/InstallDir:${e}`]):await Le("python3",t);const n=await fn(e);if(n===void 0)throw new Error("Python binary could not be found");const i=be(n);await Re(i,ne),r={installDir:i,binDir:i,bin:n};break}case"darwin":{r=await Ge("python3",t);const n=await le("brew",["--prefix","python"],{stdio:"pipe"}),i=J(n.stdout,"libexec","bin");await Re(i,ne);break}case"linux":{if(Pe())r=await _e("python",t);else if(Ne())r=await Ce([{name:"python3",version:t}]);else if(me())r=await de([{name:"python3",version:t},{name:"python-is-python3"}]);else if(await Oe())r=await De([{name:"python3",version:t}]);else throw new Error("Unsupported linux distributions");break}default:throw new Error("Unsupported platform")}return r}async function fn(e){for(const t of["python","python3"]){const r=await Hd(t,e);if(r!==void 0)return r}if(process.platform==="win32"){const t=dp(lp()).root,r=(await Sp(t)).filter(n=>n.startsWith("Python"));for(const n of r)for(const i of["python3","python"]){const o=await Hd(i,J(t,n));if(o!==void 0)return o}}}async function Hd(e,t){try{const r=sc("python");if(t!==void 0){const i=J(t,ge(e));if(await ye(i)&&await Ra(i,r))return i}const n=await fe(e,{nothrow:!0,all:!0})??[];for(const i of n)if(await Ra(i,r))return i}catch{}}async function US(e){const t=await zd();return t===void 0?(z("pip was not found. Installing pip"),await MS(e),zd()):t}async function zd(){for(const e of["pip3","pip"]){const t=await jS(e);if(t!==void 0)return t}}async function jS(e){try{const t=sc("pip"),r=await fe(e,{nothrow:!0,all:!0})??[];for(const n of r)if(await Ra(n,t))return n}catch{}}async function MS(e){await Wd(e)||(await kr("pip"),await Wd(e))}async function Wd(e){if(await om(e))return!1;try{return await le(e,["-m","ensurepip","-U","--upgrade"],{stdio:"inherit"}),!0}catch(t){z(t.toString());try{return await le(e,["-m","pip","install","--upgrade","pip"],{stdio:"inherit"}),!0}catch(r){z(r.toString())}}return!1}var Tr={},Xd;function GS(){if(Xd)return Tr;Xd=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.getUbuntuVersion=void 0;const e=Fr;function t(i){return"errno"in i}function r(i,o){return new Promise((s,l)=>{e.execFile(i,o,{encoding:"utf8",shell:!1},(u,a,c)=>{if(u){if(t(u)&&u.code==="ENOENT"){s(null);return}l(new Error(`Could not execute \`${i} ${o.join(" ")}\`: ${u} (stderr=${c})`));return}s(a)})})}async function n(){if(process.platform!=="linux")return[];const i=await r("lsb_release",["-a"]);if(i===null)return[];const o=/^Distributor ID:\s*(.+)$/,s=/^Description:\s*Ubuntu\s+(\d+)\.(\d+)(?:\.(\d+))?/,l=/^Release:\s*(\d+)\.(\d+)(?:\.(\d+))?$/;let u=null,a=null,c=!1;for(const m of i.split(`
|
||
`)){const p=m.match(o);if(p!==null){if(p[1]!=="Ubuntu")return[];c=!0}const w=m.match(s);w&&(u=w);const E=m.match(l);if(E&&(a=E),c&&u&&a)break}if(!c)return[];for(const m of[u,a])if(m){const p=[m[1],m[2]];return m[3]&&p.push(m[3]),p.map(w=>parseInt(w,10))}return[]}return Tr.getUbuntuVersion=n,Tr}var nm=GS();async function VS(){try{if(me()){try{fe.sync("lsb_release",{nothrow:!0})===null&&await de([{name:"lsb-release"}])}catch{return Kd()}const e=await nm.getUbuntuVersion();return e.length===0?Kd():e}else return null}catch(e){return ve(e.toString()),null}}const Ut=Fe(VS,{promise:!0});function Kd(){if(!("version"in it&&typeof it.version=="function"))return null;const t=it.version().match(/(\d+)\.(\d+)\.(\d+)/);if(t===null)return null;const r=Number.parseInt(t[1],10),n=Number.parseInt(t[2],10),i=Number.parseInt(t[3],10);return[r,n,i]}function BS(e){return[...new Set(e)]}function Yd(e,t='"'){return e.includes(" ")?`${t}${e}${t}`:e}async function ar(e,t,r={}){return On(await KS(r.pythonVersion),e,t,r)}async function On(e,t,r,n={}){const{usePipx:i=!0,user:o=!0,upgrade:s=!1,isLibrary:l=!1}=n,u=i&&!l&&await dn(e),a=!u&&await om(e),c=u?"pipx":"pip",m=YS(t);if(!s&&(u?await QS(e,m):await JS(e,m)))return{binDir:u?await Jd():await Qd(e,m)};if(!a&&await ZS(e,m))try{Ee.info(`Installing ${t} ${r??""} via ${c}`);const w=r!==void 0&&r!==""?`${t}==${r}`:t,E=s?u?["upgrade"]:["install","--upgrade"]:["install"],d=!u&&o?["--user"]:[],f=process.env;u&&o&&(f.PIPX_HOME=await WS(),f.PIPX_BIN_DIR=await im()),ze(e,["-m",c,...E,...d,w],{stdio:"inherit",env:f})}catch(w){const E=w instanceof Error?`${w.message}
|
||
${w.stack}`:String(w);if(Ee.info(`Failed to install ${t} via ${c}: ${E}`),await kr(t)===null)throw new Error(`Failed to install ${t} via ${c}: ${w}.`)}else if(await kr(t)===null)throw new Error(`Failed to install ${t} as it was not found via ${c} or the system package manager`);return{binDir:u?await Jd():await Qd(e,m)}}function Jd(){return im()}async function Qd(e,t){const r=await rb(e),n=await eb(r,t);return await Re(n,ne),n}async function HS(){return await fe("pipx",{nothrow:!0})!==null}async function dn(e){return(await le(e,["-m","pipx","--help"],{stdio:"ignore",reject:!1})).exitCode===0}async function zS(){let e=process.env.PIPX_HOME;if(e!==void 0)return e;const t=rt("~/.local/pipx");if(await ye(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 Cr(e),await Cr(J(e,"trash")),await Cr(J(e,"shared")),await Cr(J(e,"venv")),e}const WS=Fe(zS,{promise:!0});async function XS(){if(process.env.PIPX_BIN_DIR!==void 0)return process.env.PIPX_BIN_DIR;const e=rt("~/.local/bin");return await Re(e,ne),await Cr(e),e}const im=Fe(XS,{promise:!0});let sn;async function KS(e){if(sn!==void 0)return sn;const t=e??nt("python",void 0,await Ut());return sn=(await rm({version:t,setupDir:"",arch:process.arch})).bin,sn}function YS(e){return e.replace(/\[.*]/g,"").trim()}async function JS(e,t){try{return(await le(e,["-m","pip","-qq","show",t],{stdio:"ignore",reject:!1})).exitCode===0}catch{return!1}}async function QS(e,t){try{const r=await le(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 i of Object.values(n.venvs))if(i.metadata.main_package.package_or_url===t||i.metadata.main_package.package===t)return!0}catch{}return!1}async function ZS(e,t){return(await le(e,["-m","pip","-qq","index","versions",t],{stdio:"ignore",reject:!1})).exitCode===0}async function eb(e,t){const n=(await Promise.all(e.map(o=>ye(J(o,ge(t)))))).findIndex(o=>o);if(n!==-1)return e[n];const i=fe.sync(ge(t),{nothrow:!0});return i!==null?be(i):e[e.length-1]}async function kr(e,t){if(process.platform==="linux"){Ee.info(`Installing ${e} via the system package manager`);const r=e==="pipx"?Pe():!0;if(Pe())return _e(r?`python-${e}`:e);if(Ne())return Ce([{name:r?`python3-${e}`:e}]);if(me())return de([{name:r?`python3-${e}`:e}]);if(await Oe())return De([{name:r?`py3-${e}`:e}])}else if(process.platform==="darwin")return["venv"].includes(e)?null:Ge(e);return null}async function tb(e){const t=[];process.platform==="linux"?t.push("/home/runner/.local/bin/"):process.platform==="darwin"&&t.push("/usr/local/bin/");const r=await sm(e);return t.push(J(r,"Scripts"),J(r,"Scripts","bin"),J(r,"bin")),BS(t)}const rb=Fe(tb,{promise:!0});async function nb(e){return(await Ka.getExecOutput(`${e} -c "import sys;print(sys.base_exec_prefix);"`)).stdout.trim()}const sm=Fe(nb,{promise:!0});async function ib(e){try{const t=await sm(e),r=await Mh(e);if(r===void 0)return ve(`Failed to get the version of ${e}`),!1;const n=J(t,"lib",`python${r.major}.${r.minor}`,"EXTERNALLY-MANAGED");return ye(n)}catch(t){return ve(`Failed to check if ${e} is externally managed: ${t}`),!1}}const om=Fe(ib,{promise:!0});function sb({version:e}={}){return me()&&(e===void 0||e==="")?de([{name:"gcovr",version:e}]):ar("gcovr",e)}function ob(){return Ie("GCOV","llvm-cov gcov",ne)}function Zd(e){const t=jn(e),r=t!==null?Eh(t):e,n=r!==""?`gcov-${r}`:"gcov";return Ie("GCOV",n,ne)}const ct=["x64","amd64","x86_64","win64","64","amd64_x86","amd64_arm64"],fr=["x86","i386","ia32","win32","32","x32"],ut=["aarch64","arm64","woa64","arm"],ab=["armv7","armv7a"],cb=["powerpc64le","ppc64le"],ub=["sparc64"],lb=["sparcv9"];function am(e){return ut.includes(e)?"arm64":ct.includes(e)?"amd64":e}async function fb({version:e}={}){switch(process.platform){case"win32":return Le("bazelisk",e);case"darwin":return Ge("bazelisk",e);case"linux":{if(Pe())throw new Error("installing bazel on Arch linux is not supported yet");if(Ne())return await Ce([{name:"dnf-plugins-core"}]),await wt("dnf",["copr","enable","vbatts/bazel"]),Ce([{name:"bazel4"}]);if(me()){const t=await Ih({fileName:"bazel-archive-keyring.gpg",keyUrl:"https://bazel.build/bazel-release.pub.gpg"});return await wt("bash",["-c",`echo "deb [arch=${am(process.arch)} signed-by=${t}] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list`]),de([{name:"bazel",version:e}],!0)}else if(await Oe())return De([{name:"bazel",version:e}],!0);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}async function db({version:e}={}){switch(process.platform){case"win32":return Le("ccache",e);case"darwin":return Ge("ccache",e);case"linux":{if(Pe())return _e("ccache",e);if(Ne())return Ce([{name:"ccache",version:e}]);if(me())return de([{name:"ccache",version:e}]);if(await Oe())return De([{name:"ccache",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}var pb=Ln();const wa=$e(pb);function hb(e,t,r){const n=e===""?"":Ja(e);switch(t){case"win32":{const i=n===""?!1:wa(n,"v3.19.6");let o;ct.includes(r)?o=i?"win64-x64":"windows-x86_64":fr.includes(r)?o=i?"win32-x86":"windows-i386":ut.includes(r)?o="windows-arm64":(z(`Trying unsupported arch '${r}' for cmake on Windows`),o=`windows-${r}`);const s=`cmake-${e}-${o}`;return{binRelativeDir:"bin/",binFileName:ge("cmake"),extractedFolderName:s,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${s}.zip`}}case"darwin":{const o=(n===""?!1:wa(n,"v3.19.1"))?"Darwin-x86_64":"macos-universal",s=`cmake-${e}-${o}`;return{binRelativeDir:"CMake.app/Contents/bin/",binFileName:ge("cmake"),extractedFolderName:s,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${s}.tar.gz`}}case"linux":{const i=n===""?!1:wa(n,"v3.19.8");let o;ut.includes(r)?o=i?"Linux-aarch64":"linux-aarch64":ct.includes(r)?o=i?"Linux-x86_64":"linux-x86_64":(z(`Trying unsupported arch '${r}' for cmake on Linux`),o=`linux-${r}`);const s=`cmake-${e}-${o}`;return{binRelativeDir:"bin/",binFileName:ge("cmake"),extractedFolderName:s,url:`https://github.com/Kitware/CMake/releases/download/v${e}/${s}.tar.gz`}}default:throw new Error(`Unsupported platform '${t}'`)}}async function cm({version:e,setupDir:t,arch:r}){return await Oe()?De([{name:"cmake"}]):gt("cmake",e,hb,t,r)}function xr({version:e}={}){return ar("cmakelang[YAML]",e)}function mb({version:e}={}){return ar("conan",e)}async function yb({version:e}={}){switch(process.platform){case"win32":return await Le("cppcheck",e),{binDir:await vb()};case"darwin":return Ge("cppcheck",e);case"linux":{if(Pe())return _e("cppcheck",e);if(Ne())return Ce([{name:"ccache",version:e}]);if(me())return de([{name:"cppcheck",version:e}]);if(await Oe())return De([{name:"cppcheck",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}async function vb(){const e="C:/Program Files/Cppcheck";return await Re(e,ne),e}function wb({version:e}={}){return ar("cpplint",e,{pythonVersion:">=3.8.0"})}async function pn({version:e}={}){switch(process.platform){case"win32":return await Le("graphviz",e),gb();case"darwin":return Ge("graphviz",e);case"linux":{if(Pe())return _e("graphviz",e);if(Ne())return Ce([{name:"graphviz",version:e}]);if(me())return de([{name:"graphviz",version:e}]);if(await Oe())return De([{name:"graphviz",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}async function gb(){switch(process.platform){case"win32":{const e="C:/Program Files/Graphviz/bin";return await Re(e,ne),{binDir:e}}default:throw new Error("Unsupported platform")}}const _b=new Map([[25,["Tahoe","26"]],[24,["Sequoia","15"]],[23,["Sonoma","14"]],[22,["Ventura","13"]],[21,["Monterey","12"]],[20,["Big Sur","11"]],[19,["Catalina","10.15"]],[18,["Mojave","10.14"]],[17,["High Sierra","10.13"]],[16,["Sierra","10.12"]],[15,["El Capitan","10.11"]],[14,["Yosemite","10.10"]],[13,["Mavericks","10.9"]],[12,["Mountain Lion","10.8"]],[11,["Lion","10.7"]],[10,["Snow Leopard","10.6"]],[9,["Leopard","10.5"]],[8,["Tiger","10.4"]],[7,["Panther","10.3"]],[6,["Jaguar","10.2"]],[5,["Puma","10.1"]]]);function Eb(e){e=Number((e||wp.release()).split(".")[0]);const[t,r]=_b.get(e)||["Unknown",""];return{name:t,version:r}}function Sb(){if(process.platform!=="darwin")return[];const{version:e}=Eb();return e.split(".").map(t=>Number.parseInt(t,10))}const bb=Fe(Sb);async function Rb(e,t){const{ArchiveHdi:r}=await import("./assets/index-CkjZCcSz.mjs");await new r(e).read(async i=>{await i.extract(J(t,i.path))})}function $b(e,t,r){switch(t){case"linux":{if(process.arch==="arm64")throw new Error("Doxygen binaries are not available for Linux arm64");const n=`doxygen-${e}`;return{binRelativeDir:"bin/",binFileName:ge("doxygen"),extractedFolderName:n,url:`https://www.doxygen.nl/files/${n}.linux.bin.tar.gz`}}case"win32":{const n=`doxygen-${e}`;return{binRelativeDir:"",binFileName:ge("doxygen"),extractedFolderName:n,url:`https://www.doxygen.nl/files/${n}.windows.x64.bin.zip`}}case"darwin":{const n=`Doxygen-${e}`;return{binRelativeDir:"Doxygen/Doxygen.app/Contents/Resources/",binFileName:ge("doxygen"),extractedFolderName:n,extractFunction:Rb,url:`https://doxygen.nl/files/${n}.dmg`}}default:throw new Error(`Unsupported platform '${t}'`)}}async function Ob({version:e,setupDir:t,arch:r}){switch(process.platform){case"win32":{await zh(()=>Le("doxygen.install",e),{name:"doxygen.install",max:4,backoffBase:2e3,report:o=>z(o)});const i={binDir:await Pb()};return await pn({version:nt("graphviz",void 0)}),i}case"darwin":{const n=await Ge("doxygen",void 0,{formula:!0});return bb()[0]>11&&await pn({version:nt("graphviz",void 0)}),n}case"linux":{const n=await Ib({version:e,setupDir:t,arch:r});return await pn({version:nt("graphviz",void 0,await Ut())}),n}default:throw new Error("Unsupported platform")}}async function Ib({version:e,setupDir:t,arch:r}){try{if(Pe())return await _e("doxygen",e);if(Ne())return Ce([{name:"doxygen",version:e}]);if(me())return await de([{name:"doxygen",version:e,fallBackToLatest:ut.includes(r)}]);if(await Oe())return De([{name:"doxygen"}]);throw new Error("Unsupported linux distributions")}catch{try{const n=await gt("doxygen",e,$b,t,r);if(me())try{await de([{name:"libclang-cpp-dev"}])}catch(i){z(`Failed to download libclang-cpp-dev that might be needed for running doxygen. ${i}`)}return n}catch(n){return Zt(`Failed to download doxygen binary. ${n}. Falling back to installing the latest version from apt-get.`),de([{name:"doxygen"}])}}}async function Pb(){switch(process.platform){case"win32":{for(const e of["C:/ProgramData/chocolatey/bin","C:/Program Files/doxygen/bin","C:/Program Files (x86)/doxygen"])if(await ye(J(e,"doxygen.exe")))return await Re(e,ne),e;throw new Error("Failed to find doxygen binary")}default:throw new Error("Unsupported platform")}}function Tb({version:e}={}){return ar("flawfinder",e)}async function um({version:e}={}){const t=await fe("git",{nothrow:!0});if(t!==null){z(`Git already installed at ${t}`);return}switch(process.platform){case"win32":{const r=await Le("git",e),n=xb();return n!==null&&await Re(n,ne),r}case"darwin":return Ge("git",e);case"linux":{if(Pe())return _e("git",e);if(Ne())return Ce([{name:"git",version:e}]);if(me())return de([{name:"git",version:e}]);if(await Oe())return De([{name:"git",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}function xb(){const e=["C:/Program Files/Git/bin/","C:/Program Files (x86)/Git/bin/"];for(const t of e)if(Qt(J(t,"git.exe")))return t;return ve("Git not found in the default locations. Add git to PATH manually."),null}const Ab=typeof __dirname=="string"?__dirname:ue.dirname(Lt(import.meta.url));async function Cb(e,t,r){const{keywords:n,optionalKeywords:i}=Lb(t,r),o=await Sn(J(Ab,"github_facebook_infer.json")),s=bn(o,{version:e,keywords:n,optionalKeywords:i,filterMapTag(l){return l.replace(/^v/,"")}});if(s!==void 0)return{url:`https://github.com/facebook/infer/releases/download/${s.tag}/${s.name}`,extractedFolderName:`${er(s.name,".tar.xz")}`,binRelativeDir:"bin",binFileName:ge("infer")};throw new Error(`No asset found for version ${e} matching ${n} and ${i}`)}function Nb({version:e,setupDir:t,arch:r}){return gt("infer",e,Cb,t,r)}function Lb(e,t){const r=[],n=[];switch(e){case"linux":{r.push("linux"),ct.includes(t)?(n.push("64"),n.push("x86_64")):(z(`Using arch ${t} for infer`),r.push(t));break}case"darwin":{r.push("osx"),ct.includes(t)?n.push("x86_64"):ut.includes(t)?n.push("arm64"):(z(`Using arch ${t} for infer`),r.push(t));break}default:z(`Using ${e} ${t} for infer`),r.push(e,t);break}return{keywords:r,optionalKeywords:n}}function Db(e,t){switch(e){case"win32":return ct.includes(t)||fr.includes(t)?"win":ut.includes(t)?"winarm64":"win";case"darwin":return"mac";case"linux":return ct.includes(t)||fr.includes(t)?"linux":ut.includes(t)?"linux-aarch64":"linux";default:throw new Error(`Unsupported platform '${e}'`)}}function kb(e,t,r){const n=Db(t,r);return{binRelativeDir:"",binFileName:ge("ninja"),extractedFolderName:"",url:`https://github.com/ninja-build/ninja/releases/download/v${e}/ninja-${n}.zip`}}async function lm({version:e,setupDir:t,arch:r}){return await Oe()?(await bh(),await De([{name:"ninja-build"},{name:"ninja-is-really-ninja"}]),await Re("/usr/lib/ninja-build/bin",ne),{binDir:"/usr/lib/ninja-build/bin",installDir:"/usr/lib/ninja-build/",bin:"/usr/lib/ninja-build/bin/ninja"}):gt("ninja",e,kb,t,r)}const Fb=typeof __dirname=="string"?__dirname:ue.dirname(Lt(import.meta.url));function qb(e){return{url:`https://github.com/SimonKagstrom/kcov/releases/download/${e}/kcov-amd64.tar.gz`,extractedFolderName:"",binRelativeDir:"usr/local/bin",binFileName:ge("kcov")}}function Ub(e,t,r){return{url:`https://github.com/SimonKagstrom/kcov/archive/refs/tags/${e}.tar.gz`,extractedFolderName:"",binRelativeDir:"build/src",binFileName:ge("kcov"),extractFunction:(n,i)=>jb(n,i,r)}}async function jb(e,t,r){const n=await rc(e,t,1),i=await Mb(r);process.platform==="linux"&&(Pe()?await Promise.all([_e("libdwarf"),_e("libcurl-openssl")]):Ne()?await Ce([{name:"libdwarf-devel"},{name:"libcurl-devel"}]):me()&&await de([{name:"libdw-dev"},{name:"libcurl4-openssl-dev"}]));try{if(fe.sync("patch",{nothrow:!0})!==null){const s=J(Fb,"gcc13.patch");await le("patch",["-N","-p1","-i",s],{cwd:n,stdio:"inherit"})}else z("`patch` not found, skipping gcc13.patch, kcov may not build on gcc 13")}catch{}const o=J(n,"build");return await le(i,["-S",n,"-B",o,"-DCMAKE_BUILD_TYPE=Release","-G","Ninja"],{cwd:n,stdio:"inherit"}),await le(i,["--build",o,"--config","Release"],{cwd:n,stdio:"inherit"}),n}async function Mb(e){let t=fe.sync("cmake",{nothrow:!0});if(t===null){const{binDir:n}=await cm({version:nt("cmake",void 0,await Ut()),setupDir:J(rt("~"),"cmake"),arch:e});t=J(n,"cmake")}return fe.sync("ninja",{nothrow:!0})===null&&await lm({version:nt("ninja",void 0,await Ut()),setupDir:J(rt("~"),"ninja"),arch:e}),t}async function Gb({version:e,setupDir:t,arch:r}){if(process.platform!=="linux"){z("Kcov is not supported on non-linux");return}const n=e.split("-");let i=xE(n[0]);const o=n[1],s=TE(i);s===38&&(i="v38");let l;return o==="binary"&&s>=39?(l=await gt("kcov",i,qb,t,r),Pe()?await _e("binutils"):Ne()?await Ce([{name:"binutils"}]):me()&&await de([{name:"libbinutils"}]),l):(l=await gt("kcov",i,Ub,t,r),l)}function Vb({version:e}={}){return ar("lizard",e)}async function Nr(){process.platform==="darwin"&&(await fe("clang",{nothrow:!0})!==null&&await fe("clang++",{nothrow:!0})!==null&&(Zt("Assuming clang is an Apple Clang compiler"),await Promise.all([Ie("CC","clang",ne),Ie("CXX","clang++",ne)])),Zm("Apple Clang automatic installation is not supported yet"))}function Bb(e){const t=Ja(e);return Number.parseInt(t.split(".")[0],10)}const Or=Fe(Bb);async function Hb(e){if(await Oe())try{return await zb(e)}catch(t){z(`Failed to install llvm via system package manager ${t}.`)}}function zb(e){const t=Or(e);return De([{name:`llvm${t}`}])}const Wb=typeof __dirname=="string"?__dirname:ue.dirname(Lt(import.meta.url));var oc=(e=>(e[e.All=0]="All",e[e.ClangFormat=1]="ClangFormat",e[e.Core=2]="Core",e))(oc||{});async function Xb(e,t=0){if(me())try{return await Kb(e,t)}catch(r){_a(`Failed to install llvm via system package manager ${r}. Trying to remove the repository`);try{he(J(Wb,"llvm_repo_remove.bash"),[`${Or(e)}`])}catch(n){_a(`Failed to remove llvm repository ${n}`)}}}async function Kb(e,t=0){const r=Or(e),n=`/usr/lib/llvm-${r}`;await de([{name:"ca-certificates"}]);const i=new br.DownloaderHelper("https://apt.llvm.org/llvm.sh",Ue(),{fileName:"llvm.sh",override:!0});i.on("error",l=>{throw new Error(`Failed to download the LLVM installer script: ${l}`)}),await i.start();const o=await pr(i.getDownloadPath(),"utf-8"),s=J(Ue(),"llvm-setup-cpp.sh");return await Yb(o,s,r,t),await Dh(),await de([{name:"lsb-release"},{name:"wget"},{name:"gnupg"}]),await Ep(s,"755"),await wt("bash",[s,`${r}`,...t===0?["all"]:[]],{stdio:"inherit",shell:!0,timeout:gm}),await Re(`${n}/bin`,ne),{installDir:`${n}`,binDir:`${n}/bin`,bin:`${n}/bin/clang++`}}async function Yb(e,t,r,n){let i=Jb(e);i=Qb(i),i=t0(n,i,r),i=await Zb(i),i=e0(i),await yn(t,i)}function Jb(e){return process.env.NODE_DEBUG!=="1"&&process.env.NODE_DEBUG!=="true"?e.replace(/set -eux/g,"set -eu"):e}function Qb(e){const t=Lh();return e.replace(/add-apt-repository\s*(-y)?\s*"\${REPO_NAME}"/g,`add-apt-repository -y ${t?"--no-update":""} "\${REPO_NAME}"
|
||
apt-get update -o ${Rr}`)}async function Zb(e){let t=e.replace(/apt-get install -y/g,`apt-get install -o Dpkg::Options::="--force-overwrite" -o ${Rr} -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 i=n.replace("$LLVM_VERSION","*");await iE(i)&&(_a(`Removing conflicting package ${i}`),t=t.replace(n,""))})),t}function e0(e){return Oh()?e.replace(/apt-get/g,"nala"):e}function t0(e,t,r){return e===1?t.replace(/ -y \$PKG/g,` -y clang-format-${r}`):t}const ep=typeof __dirname=="string"?__dirname:ue.dirname(Lt(import.meta.url));async function r0(e,t,r){const n=await n0(t,r,e);z(`Downloading LLVM from ${n}`);const i=Kh(n);return{url:n,extractedFolderName:"",binRelativeDir:"bin",binFileName:ge("clang"),extractFunction:i===ln.Tar||i===ln.TarGz||i===ln.TarXz?(o,s)=>process.platform==="win32"?yr(o,s,!0):rc(o,s,1):Yh(i)}}async function n0(e,t,r){const{keywords:n,optionalKeywords:i}=await i0(e,t),o=await Sn(J(ep,"github_llvm_llvm-project.json")),s=bn(o,{version:r,keywords:n,optionalKeywords:i,filterMapTag(a){return a.replace(/^llvmorg-/,"")}});if(s!==void 0)return`https://github.com/llvm/llvm-project/releases/download/${s.tag}/${s.name}`;const l=await Sn(J(ep,"llvm_org_releases.json")),u=bn(l,{version:r,keywords:n,optionalKeywords:i});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 ${i}`)}async function i0(e,t){const r=[],n=[];switch(e){case"win32":{n.push(".tar.xz",".tar.xz");const i=[];ct.includes(t)?(i.push("win64"),n.push(["x86_64","X64"])):fr.includes(t)?i.push("win32"):ut.includes(t)?i.push("woa64"):(z(`Using arch ${t} for LLVM`),i.push(t)),i.push("windows","Windows"),r.push(i);break}case"linux":{const i=["linux","Linux"];if(me()){n.push("ubuntu");const o=await Ut();if(o!==null){n.push(`${o[0]}`);const s=o[1]<10?`0${o[1]}`:`${o[1]}`;n.push(`${o[0]}.${s}`),n.push(`${o[0]}.${s}.${o[2]}`)}}else Ne()&&n.push("rhel");ct.includes(t)?r.push(["x86_64","X64"]):fr.includes(t)?r.push("x86"):ut.includes(t)?r.push("aarch64"):ab.includes(t)?r.push("armv7a"):cb.includes(t)?r.push("powerpc64le"):ub.includes(t)?r.push("sparc64"):(z(`Using arch ${t} for LLVM`),r.push(t)),r.push(i);break}case"darwin":{r.push(["apple","macos","macOS"]),ct.includes(t)?n.push(["x86_64","X64"]):ut.includes(t)?n.push(["arm64","ARM64"]):(z(`Using arch ${t} for LLVM`),r.push(t));break}case"freebsd":{r.push("freebsd"),ct.includes(t)?r.push("amd64"):fr.includes(t)?r.push("i386"):(z(`Using arch ${t} for LLVM`),r.push(t));break}case"solaris":{r.push("solaris"),ct.includes(t)?r.push("amd64"):lb.includes(t)?r.push("sparcv9"):(z(`Using arch ${t} for LLVM`),r.push(t));break}default:z(`Using ${e} ${t} for LLVM`),r.push(e,t);break}return{keywords:r,optionalKeywords:n}}async function s0({version:e,setupDir:t,arch:r}){const n=await gt("llvm",e,r0,t,r);return await a0(Or(e),r),n}async function o0(e,t){if(me())for(const r of["libtinfo5","libtinfo6"])try{await de([{name:r}])}catch{try{if(r==="libtinfo5"){z(`Failed to install ${r}
|
||
Manually installing the package`);const i=`libtinfo5_6.3-2ubuntu0.1_${am(t)}.deb`,o=`https://launchpad.net/ubuntu/+archive/primary/+files/${i}`,s=new br.DownloaderHelper(o,Ue(),{fileName:i});s.on("error",async l=>{z(`Failed to download ${o}: ${l}`),await s.stop()}),await s.start(),he("dpkg",["-i",J(Ue(),i)])}}catch{z(`Failed to install ${r}. Ignoring`)}}else Pe()?await _e("ncurses5-compat-libs",void 0,"yay"):Ne()&&await Ce([{name:"ncurses-compat-libs"}])}const a0=Fe(o0,{promise:!0});async function c0({version:e}){if(process.platform!=="darwin")return Promise.resolve(void 0);try{return await u0({version:e})}catch(t){z(`Failed to install llvm via brew: ${t}`);return}}async function u0({version:e}){const t=Or(e),r=await Ge("llvm",`${t}`,{"force-bottle":!0});return await Re(r.binDir,ne),r}const{GITHUB_ACTIONS:l0}=xt,f0=typeof __dirname=="string"?__dirname:ue.dirname(Lt(import.meta.url));async function hn({version:e,setupDir:t,arch:r}){const n=await ac(e,t,r);return await p0(r),await m0(),n.installDir!==void 0&&await h0(n.installDir,e),n}async function ac(e,t,r,n=oc.All){const i=await Xb(e,n);if(i!==void 0)return i;const o=await Hb(e);if(o!==void 0)return o;const s=await c0({version:e});return s!==void 0?s:s0({version:e,setupDir:t,arch:r})}async function d0(e){process.platform==="linux"&&await Rn({version:nt("gcc",void 0,await Ut()),setupDir:"",arch:e,priority:40})}const p0=Fe(d0,{promise:!0});async function h0(e,t){const r=process.env.LD_LIBRARY_PATH??"",n=process.env.DYLD_LIBRARY_PATH??"",i=Or(t),o=[Ie("CC",ge(`${e}/bin/clang`),ne),Ie("CXX",ge(`${e}/bin/clang++`),ne),Ie("LLVM_PATH",e,ne),Ie("LLVM_LD_LIBRARY_PATH",`${r}${mn}${e}/lib`,ne),Ie("LLVM_DYLD_LIBRARY_PATH",`${n}${mn}${e}/lib`,ne),Ie("LLVM_LDFLAGS",`-L${Yd(`${e}/lib`)}`,ne),Ie("LLVM_CPPFLAGS",`-I${Yd(`${e}/include`)}`,ne),await ye(`${e}/lib/clang/${t}/include`)?Ie("LLVM_CPATH",`${e}/lib/clang/${t}/include`,ne):await ye(`${e}/lib/clang/${i}/include`)?Ie("LLVM_CPATH",`${e}/lib/clang/${i}/include`,ne):Promise.resolve(),Ie("LLVM_LIBRARY_PATH",`${e}/lib`,ne),qh()];me()&&o.push(vt("cc",`${e}/bin/clang`,ne,60),vt("cxx",`${e}/bin/clang++`,ne,60),vt("clang",`${e}/bin/clang`,ne),vt("clang++",`${e}/bin/clang++`,ne),vt("lld",`${e}/bin/lld`,ne),vt("ld.lld",`${e}/bin/ld.lld`,ne),vt("llvm-ar",`${e}/bin/llvm-ar`,ne)),await Promise.all(o)}async function m0(){if(!l0)return;const e=J(f0,"llvm_matcher.json");if(!await ye(e))return ve("the llvm_matcher.json file does not exist in the same folder as setup-cpp.js");z(`::add-matcher::${e}`)}function tp({version:e,setupDir:t,arch:r}){return ac(e,t,r,oc.ClangFormat)}function rp({version:e,setupDir:t,arch:r}){return ac(e,t,r)}async function y0({version:e}={}){switch(process.platform){case"win32":return Le("make",e);case"darwin":{await Ge("make",e);const t=J(Xa(),"opt/make/libexec/gnubin");return await Re(t,ne),{binDir:t}}case"linux":{if(Pe())return _e("make",e);if(Ne())return Ce([{name:"make",version:e}]);if(me())return de([{name:"make",version:e}]);if(await Oe())return De([{name:"make",version:e}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}function v0({version:e}={}){return ar("meson",e)}var Jt={},np;function w0(){if(np)return Jt;np=1;const e=wr(),t=Fr,r=je,n=ue,i=up,o=i.env["ProgramFiles(x86)"],s=[i.env["ProgramFiles(x86)"],i.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}Jt.vsversion_to_versionnumber=c;function m(y){if(Object.keys(a).includes(y))return y;for(const[v,S]of Object.entries(a))if(S===y)return v;return y}Jt.vsversion_to_year=m;const p=`${o}\\Microsoft Visual Studio\\Installer`;function w(y,v){try{return t.execSync(`vswhere -products * ${v} -prerelease -property installationPath`).toString().trim()+"\\"+y}catch(S){e.warning(`vswhere failed: ${S}`)}return null}Jt.findWithVswhere=w;function E(y){const v=c(y);let S;if(v){const g=v.split(".")[0]+".9";S=`-version "${v},${g}"`}else S="-latest";let _=w("VC\\Auxiliary\\Build\\vcvarsall.bat",S);if(_&&r.existsSync(_))return e.info(`Found with vswhere: ${_}`),_;e.info("Not found with vswhere");const b=y?[m(y)]:u;for(const g of s)for(const $ of b)for(const I of l)if(_=`${g}\\Microsoft Visual Studio\\${$}\\${I}\\VC\\Auxiliary\\Build\\vcvarsall.bat`,e.info(`Trying standard location: ${_}`),r.existsSync(_))return e.info(`Found standard location: ${_}`),_;if(e.info("Not found in standard locations"),_=`${o}\\Microsoft Visual C++ Build Tools\\vcbuildtools.bat`,r.existsSync(_))return e.info(`Found VS 2015: ${_}`),_;throw e.info(`Not found in VS 2015 location: ${_}`),new Error("Microsoft Visual Studio not found")}Jt.findVcvarsall=E;function d(y){return["PATH","INCLUDE","LIB","LIBPATH"].indexOf(y.toUpperCase())!=-1}function f(y){let v=y.split(";");function S(_,b,g){return g.indexOf(_)===b}return v.filter(S).join(";")}function h(y,v,S,_,b,g){if(i.platform!="win32"){e.info("This is not a Windows virtual environment, bye!");return}i.env.PATH+=n.delimiter+p;let $={win32:"x86",win64:"x64",x86_64:"x64","x86-64":"x64"};y.toLowerCase()in $&&(y=$[y.toLowerCase()]);var I=[y];_&&JSON.parse(_)===!0&&I.push("uwp"),v&&I.push(v),S&&I.push(`-vcvars_ver=${S}`),b&&JSON.parse(b)===!0&&I.push("-vcvars_spectre_libs=spectre");const A=`"${E(g)}" ${I.join(" ")}`;e.debug(`vcvars command-line: ${A}`);const K=t.execSync(`set && cls && ${A} && cls && set`,{shell:"cmd"}).toString().split("\f"),Q=K[0].split(`\r
|
||
`),x=K[1].split(`\r
|
||
`),T=K[2].split(`\r
|
||
`),F=x.filter(k=>!!(k.match(/^\[ERROR.*\]/)&&!k.match(/Error in script usage. The correct usage is:$/)));if(F.length>0)throw new Error(`invalid parameters\r
|
||
`+F.join(`\r
|
||
`));let U={};for(let k of Q){const[G,C]=k.split("=");U[G]=C}e.startGroup("Environment variables");for(let k of T){if(!k.includes("="))continue;let[G,C]=k.split("="),H=U[G];C!==H&&(e.info(`Setting ${G}`),d(G)&&(C=f(C)),e.exportVariable(G,C))}e.endGroup(),e.info("Configured Developer Command Prompt")}return Jt.setupMSVCDevCmd=h,Jt}var Oa=w0();function g0(e){switch(e){case"x32":case"32":case"ia32":return"x86";case"64":return"x64";default:return e}}async function cc({vsversion:e,VCTargetsPath:t,arch:r,toolset:n,sdk:i,uwp:o,spectre:s}){t!==void 0&&await ye(t)&&(z(`Adding ${t} to PATH`),await Ie("VCTargetsPath",t,ne)),await Oa.setupMSVCDevCmd(g0(r),i,n,o,s,e)}const{GITHUB_ACTIONS:_0}=xt,E0=typeof __dirname=="string"?__dirname:ue.dirname(Lt(import.meta.url));async function Lr({version:e,setupDir:t,arch:r,sdk:n,uwp:i,spectre:o}){if(process.platform!=="win32")return;const s=Oa.vsversion_to_versionnumber(e);z(`Checking if MSVC ${s} is already installed`);let l=!1;try{const c=Oa.findVcvarsall(s);l=!0,z(`Found the pre-installed version of MSVC at ${c}`)}catch{}let u,a;if(!l)try{s==="14.0"?(u="14.0",await Le("visualcpp-build-tools","14.0.25420.1",["--ignore-dependencies"]),a="C:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/v140"):s==="15.0"?(u="14.16",await Le("visualstudio2017buildtools","15.9.41.0",[]),a="C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16"):s==="16.0"?(u="14.29",await Le("visualstudio2019buildtools","16.11.7.0",[]),a="C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133"):s==="17.0"?(u=void 0,await Le("visualstudio2022buildtools","117.0.5.0",[]),a=void 0):Ae(`The given MSVC versions ${e} is not supported yet.`)}catch(c){Ae(c)}await cc({VCTargetsPath:a,arch:r,toolset:u,sdk:n,uwp:i,spectre:o}),_0&&await S0()}async function S0(){const e=J(E0,"msvc_matcher.json");if(!await ye(e))return ve("the msvc_matcher.json file does not exist in the same folder as setup-cpp.js");z(`::add-matcher::${e}`)}async function ip({version:e}={}){return process.platform!=="win32"?void 0:(await Le("opencppcoverage",e),{binDir:await b0()})}async function b0(){const e="C:/Program Files/OpenCppCoverage";return await Re(e,ne),e}function R0(e,t,r){return{url:$0(t,r,e),binRelativeDir:"",binFileName:ge("pwsh"),extractedFolderName:""}}function $0(e,t,r){switch(e){case"win32":{const n=["ia32","x86","i386","x32"].includes(t)?"win-x86":"win-x64";return`https://github.com/PowerShell/PowerShell/releases/download/v${r}/PowerShell-${r}-${n}.zip`}case"darwin":{const n=["arm","arm64"].includes(t)?"osx-arm64":"osx-x64";return`https://github.com/PowerShell/PowerShell/releases/download/v${r}/powershell-${r}-${n}.tar.gz`}case"linux":{const i={arm64:"linux-arm64",arm:"linux-arm64",arm32:"linux-arm32",aarch64:"linux-arm64",x64:"linux-x64"}[t]??"linux-x64";return`https://github.com/PowerShell/PowerShell/releases/download/v${r}/powershell-${r}-${i}.tar.gz`}default:throw new Error(`Unsupported platform '${e}'`)}}async function sp({version:e,setupDir:t,arch:r}){try{return await Oe()?op({version:e}):await gt("pwsh",e,R0,t,r)}catch(n){return Ae(`Failed to setup pwsh via download: ${n}. Trying package managers...`),op({version:e})}}async function op({version:e}={}){switch(process.platform){case"win32":{await Le("powershell-core",e);const t="C:/Program Files/PowerShell/7";return await Re(t,ne),{binDir:t}}case"darwin":return Ge("powershell",e,{cask:!0,overwrite:!1});case"linux":{if(Pe())return _e("powershell-bin",e,"yay");if(Ne())return await Ce([{name:"curl"}]),he("/bin/bash",["-c","curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo"]),Ce([{name:"powershell",version:e}]);if(me()){await de([{name:"curl"}]);const t=await Ut(),r=`${t[0]}.0${t[1]}`;return he("curl",["-LJO",`https://packages.microsoft.com/config/ubuntu/${r}/packages-microsoft-prod.deb`]),he("dpkg",["-i","packages-microsoft-prod.deb"]),de([{name:"powershell",version:e}],!0)}else if(await Oe())return De([{name:"powershell",version:void 0}]);throw new Error("Unsupported linux distribution")}default:throw new Error("Unsupported platform")}}async function O0({version:e}={}){switch(process.platform){case"win32":return Le("sccache",e);case"linux":{if(me()){if((await nm.getUbuntuVersion())[0]>=24)return de([{name:"sccache",version:e}])}else if(await Oe())return De([{name:"sccache",version:e}]);return Ge("sccache",e)}case"darwin":return Ge("sccache",e);default:throw new Error("Unsupported platform")}}function I0(e){switch(e){case"win32":return"windows";default:return e}}function P0(e){switch(e){case"x64":return"amd64";case"ia32":case"x86":case"i386":case"x32":return"386";default:return e}}function T0(e,t,r){const n=I0(t),i=P0(r),o=t==="win32"?"zip":"tar.gz";return{binRelativeDir:"",binFileName:ge("task"),extractedFolderName:"",url:`https://github.com/go-task/task/releases/download/v${e}/task_${n}_${i}.${o}`}}function x0({version:e,setupDir:t,arch:r}){return gt("task",e,T0,t,r)}let ap=!1;async function A0({version:e,setupDir:t,arch:r}){const n=await fe("vcpkg",{nothrow:!0});if(ap&&n!==null)return{binDir:be(n)};if(await um(),process.platform==="linux"){if(Pe())await Promise.all([_e("curl"),_e("zip"),_e("unzip"),_e("tar"),_e("pkg-config")]);else if(Ne())await Ce([{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"pkg-config"}]);else if(me())await de([{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"pkg-config"}]);else if(await Oe()){const i=[{name:"curl"},{name:"zip"},{name:"unzip"},{name:"tar"},{name:"pkgconf"}];ut.includes(r)&&i.push({name:"build-base"}),await De(i)}}return await ye(J(t,Sa("bootstrap-vcpkg",".bat")))?Zt(`Vcpkg folder already exists at ${t}. Skipping the clone`):await le("git",["clone","https://github.com/microsoft/vcpkg"],{cwd:be(t),stdio:"inherit"}),e!==""&&e!=="true"&&(z(`Checking out vcpkg version ${e}`),await le("git",["checkout",e],{cwd:t,stdio:"inherit"})),process.platform==="linux"&&ut.includes(r)&&await Ie("VCPKG_FORCE_SYSTEM_BINARIES","1",ne),await le(Sa(fh("bootstrap-vcpkg"),".bat"),{cwd:t,shell:!0,stdio:"inherit"}),await Er(t),await Re(t,ne),ap=!0,{binDir:t}}const fm={llvm:hn,clang:hn,"clang++":hn},dm={gcc:Rn,"g++":Rn},pm={mingw:nc},hm={msvc:Lr,cl:Lr,msbuild:Lr,visualstudio:Lr},mm={appleclang:Nr,applellvm:Nr,"apple-clang":Nr,"apple-llvm":Nr},C0={cmakelang:xr,"cmake-lint":xr,"cmake-format":xr,cmakelint:xr,cmakeformat:xr},ym=["llvm","clang","clang++","clang-tidy","clang-format","clangtidy","clangformat"],vm={"apt-fast":Yf,aptfast:Yf,nala:yE,git:um,brew:za,choco:Bh,python:rm,powershell:sp,pwsh:sp,...fm,...dm,...pm,...hm,...mm,...C0,cmake:cm,ninja:lm,vcpkg:A0,bazel:fb,conan:mb,meson:v0,gcovr:sb,opencppcoverage:ip,OpenCppCoverage:ip,ccache:db,sccache:O0,doxygen:Ob,graphviz:pn,cppcheck:yb,cpplint:wb,flawfinder:Tb,lizard:Vb,infer:Nb,"clang-tidy":rp,clangtidy:rp,"clang-format":tp,clangformat:tp,vcvarsall:cc,kcov:Gb,make:y0,task:x0,sevenzip:un,"7zip":un,"7z":un,tar:Xh},wm=Object.keys(vm),cp=["compiler","architecture","timeout",...wm],gm=60*60*1e3;async function N0(e,t,r,n,i,o,s,l=gm){Ee.startGroup(`Installing ${e} ${t}`);try{await L0(e,t,r,n,i,o)}catch(u){Ae(u),u instanceof Error&&u.stack!==void 0&&Ae(u.stack),s.push(`${e} failed to install`)}Ee.endGroup()}async function L0(e,t,r,n,i,o){const s=ym.includes(e);let l;if(e==="vcvarsall")await cc({version:nt(e,t,r),arch:n,uwp:!1,spectre:!1});else if(e==="brew")l=await za({rcOptions:ne});else{const u=J(i,s?"llvm":e),a=nt(e,t,r),c=vm[e];l=await c({version:a,setupDir:u,arch:n})}o.push(_m(e,l))}function _m(e,t){let r=`✅ ${e} was installed successfully:`;return t===void 0||("installDir"in t&&(r+=`
|
||
- The installation directory is ${t.installDir}`),t.binDir!==""&&(r+=`
|
||
- The binary directory is ${t.binDir}`)),r}const D0=/[.-]((?:\d{4}|\d+(?:\.\d+)*(?:-[\w.-]+)?(?:\+[\w.-]+)?)$)/;function k0(e){try{const t=e.match(D0);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}$/)&&jn(r)===null&&z(`Non-semver version format: ${r}`),{compiler:n,version:r}}catch(t){return Ae(`Failed to parse the compiler info ${e}: ${t}`),{compiler:e,version:void 0}}}async function F0(e,t,r,n,i,o,s){let l;try{if(Ee.startGroup(`Installing ${e} ${t??""}`),e in fm)l=await hn({version:nt("llvm",t,r),setupDir:J(n,"llvm"),arch:i}),await ob();else if(e in dm){const u=nt("gcc",t,r);l=await Rn({version:u,setupDir:J(n,"gcc"),arch:i}),await Zd(u)}else if(e in pm){const u=nt("mingw",t,r);l=await nc({version:u,setupDir:J(n,"gcc"),arch:i}),await Zd(u)}else e in hm?l=await Lr({version:nt("msvc",t,r),setupDir:J(n,"msvc"),arch:i}):e in mm?await Nr():(l=null,s.push(`Unsupported compiler ${e}`))}catch(u){Ae(u),u instanceof Error&&Ae(u.stack??""),s.push(`Failed to install the ${e} compiler ${t}`)}l!==null&&o.push(_m(e,l)),Ee.endGroup()}async function q0(e,t="npm"){try{return await fe("setup-cpp",{nothrow:!0})!==null?`setup-cpp@${e} already installed`:(z(`Installing setup-cpp@${e} via ${t}...`),await le(t,["install","-g",`setup-cpp@${e}`],{stdio:"inherit",timeout:1e3*60*1}),`setup-cpp@${e} installed successfully`)}catch(r){return new Error(`Failed to install the setup-cpp@${e} CLI: ${r}. Ignoring...`)}}async function U0(e={}){const t=e.architecture??process.arch,r=process.env.SETUP_CPP_DIR??rt("~"),n=[],i=[],o=Vf.create({autoloadLocales:!0});Vf.addLocale(x_),__.addLocale(b_);let s,l;const u=await Ut(),a=e.compiler!==void 0?k0(e.compiler):void 0;if(!xS(e,[...ym,"compiler"],a))return{successMessages:[],errorMessages:["The same version must be used for llvm, clang-format and clang-tidy"]};Pe()&&typeof e.cppcheck=="string"&&typeof e.gcovr=="string"&&(z("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux"),await _e("python-pygments"));const c=wm.filter(E=>{const d=e[E];return d!==void 0&&d!=="false"}),m=e["setup-cpp"]===void 0||e["setup-cpp"]?q0(La.version,e["node-package-manager"]):Promise.resolve(void 0);let p=!1;for(const E of c){const d=e[E],f=e.timeout!==void 0?Number.parseFloat(e.timeout)*60*1e3:void 0;if(s=Date.now(),await N0(E,d,u,t,r,n,i,f),l=Date.now(),z(`took ${o.format(s,l)||"0 seconds"}`),i.length!==0&&vn.isCI){p=!0;break}}if(!p&&a!==void 0){const E=Date.now();await F0(a.compiler,a.version,u,r,t,n,i);const d=Date.now();z(`took ${o.format(E,d)||"0 seconds"}`)}const w=await m;return typeof w=="string"&&n.push(w),await n_(ne),{successMessages:n,errorMessages:i}}async function j0(e){const t=vn.GITHUB_ACTIONS?Promise.resolve():M0(),r=G0(e);if(r.help)return V0(),0;if(r.version)return z(`${La.version}`),0;const{successMessages:n,errorMessages:i}=await U0(r);for(const o of n)Qy(o);for(const o of i)Ae(o);if((n.length!==0||i.length!==0)&&(z("setup-cpp finished"),!vn.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` or restart your shell to update the environment.");break}}return await t,i.length===0?0:1}async function M0(){try{await Iy({pkg:La})}catch(e){ve(`Failed to check for updates: ${e instanceof Error?e.message+e.stack:e}`)}}function G0(e){const t=Object.fromEntries(cp.map(r=>[r,Lp(r)]));return ty(e,{string:[...cp,"timeout","node-package-manager"],default:t,alias:{h:"help",v:"version"},boolean:["help","version","setup-cpp"]})}function V0(){z(`
|
||
setup-cpp [options]
|
||
setup-cpp --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
|
||
|
||
Install all the tools required for building and testing C++/C projects.
|
||
|
||
--architecture the cpu architecture to install the tools for. By default it uses the current CPU architecture.
|
||
--timeout the timeout for the installation of each tool in minutes. By default it is 10 minutes.
|
||
--compiler the <compiler> to install.
|
||
You can specify the version instead of specifying just the name e.g: --compiler 'llvm-13.0.0'
|
||
--tool_name pass "true" or pass the <version> you would like to install for this tool. e.g. --conan true or --conan "1.42.1"
|
||
--nodePackageManager the node package manager to use (npm/yarn/pnpm) when installing setup-cpp globally
|
||
--help show this help message
|
||
--version show the version of setup-cpp
|
||
|
||
All the available tools:
|
||
`),console.table({"compiler and analyzer":{tools:"--llvm, --gcc, --msvc, --apple-clang, --vcvarsall"},"build system":{tools:"--cmake, --ninja, --meson, --make, --task, --bazel"},"package manager":{tools:"--vcpkg, --conan, --choco, --brew, --apt-fast, --nala, --git, --setup-cpp"},"analyzer/linter":{tools:"--clang-tidy, --clang-format, --cppcheck, --cpplint, --flawfinder, --lizard, --infer, , --cmakelang, --cmake-lint, --cmake-format"},cache:{tools:"--ccache, --sccache"},documentation:{tools:"--doxygen, --graphviz"},coverage:{tools:"--gcovr, --opencppcoverage, --kcov"},other:{tools:"--python, --powershell, --sevenzip, --tar"}},["tools"])}process.env.SETUP_CPP_SKIP_MAIN!=="true"&&j0(process.argv).then(e=>{process.exitCode=e}).catch(e=>{Ae("main() panicked!"),Ae(e),process.exitCode=1});export{Vy as H,Ee as a,xt as b,at as c,Ka as e,$e as g,z as i,ye as p,G0 as parseArgs,Ry as r,tc as t,ve as w};
|
||
//# sourceMappingURL=setup-cpp.mjs.map
|