docker-setup-buildx/dist/index.js

32 lines
1.9 MiB
JavaScript
Raw Normal View History

require('./sourcemap-register.js');(()=>{var __webpack_modules__={7799:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;var l=Object.getOwnPropertyDescriptor(i,s);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[s]}}}Object.defineProperty(r,a,l)}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};var p=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.saveCache=i.restoreCache=i.isFeatureAvailable=i.ReserveCacheError=i.ValidationError=void 0;const d=c(s(2186));const A=c(s(1017));const u=c(s(1518));const m=c(s(8245));const h=s(3434);class ValidationError extends Error{constructor(r){super(r);this.name="ValidationError";Object.setPrototypeOf(this,ValidationError.prototype)}}i.ValidationError=ValidationError;class ReserveCacheError extends Error{constructor(r){super(r);this.name="ReserveCacheError";Object.setPrototypeOf(this,ReserveCacheError.prototype)}}i.ReserveCacheError=ReserveCacheError;function checkPaths(r){if(!r||r.length===0){throw new ValidationError(`Path Validation Error: At least one directory or file path is required`)}}function checkKey(r){if(r.length>512){throw new ValidationError(`Key Validation Error: ${r} cannot be larger than 512 characters.`)}const i=/^[^,]*$/;if(!i.test(r)){throw new ValidationError(`Key Validation Error: ${r} cannot contain commas.`)}}function isFeatureAvailable(){return!!process.env["ACTIONS_CACHE_URL"]}i.isFeatureAvailable=isFeatureAvailable;function restoreCache(r,i,s,a,l=false){return p(this,void 0,void 0,(function*(){checkPaths(r);s=s||[];const c=[i,...s];d.debug("Resolved Keys:");d.debug(JSON.stringify(c));if(c.length>10){throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`)}for(const r of c){checkKey(r)}const p=yield u.getCompressionMethod();let g="";try{const i=yield m.getCacheEntry(c,r,{compressionMethod:p,enableCrossOsArchive:l});if(!(i===null||i===void 0?void 0:i.archiveLocation)){return undefined}if(a===null||a===void 0?void 0:a.lookupOnly){d.info("Lookup only - skipping download");return i.cacheKey}g=A.join(yield u.createTempDirectory(),u.getCacheFileName(p));d.debug(`Archive Path: ${g}`);yield m.downloadCache(i.archiveLocation,g,a);if(d.isDebug()){yield(0,h.listTar)(g,p)}const s=u.getArchiveFileSizeInBytes(g);d.info(`Cache Size: ~${Math.round(s/(1024*1024))} MB (${s} B)`);yield(0,h.extractTar)(g,p);d.info("Cache restored successfully");return i.cacheKey}catch(r){const i=r;if(i.name===ValidationError.name){throw r}else{d.warning(`Failed to restore: ${r.message}`)}}finally{try{yield u.unlinkFile(g)}catch(r){d.debug(`Failed to delete archive: ${r}`)}}return undefined}))}i.restoreCache=restoreCache;function saveCache(r,i,s,a=false){var l,c,g,E,y;return p(this,void 0,void 0,(function*(){checkPaths(r);checkKey(i);const p=yield u.getCompressionMethod();let C=-1;const b=yield u.resolvePaths(r);d.debug("Cache Paths:");d.debug(`${JSON.stringify(b)}`);if(b.length===0){throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`)}const I=yield u.createTempDirectory();const B=A.join(I,u.getCacheFileName(p));d.debug(`Archive Path: ${B}`);try{yield(0,h.createTar)(I,b,p);if(d.isDebug()){yield(0,h.listTar)(B,p)}const A=10*1024*1024*1024;cons
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/function isObject(r){return Object.prototype.toString.call(r)==="[object Object]"}function isPlainObject(r){var i,s;if(isObject(r)===false)return false;i=r.constructor;if(i===undefined)return true;s=i.prototype;if(isObject(s)===false)return false;if(s.hasOwnProperty("isPrototypeOf")===false){return false}return true}i.isPlainObject=isPlainObject},1917:(r,i,s)=>{"use strict";var a=s(1161);var l=s(8866);function renamed(r,i){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. "+"Use yaml."+i+" instead, which is now safe by default.")}}r.exports.Type=s(6073);r.exports.Schema=s(1082);r.exports.FAILSAFE_SCHEMA=s(8562);r.exports.JSON_SCHEMA=s(1035);r.exports.CORE_SCHEMA=s(2011);r.exports.DEFAULT_SCHEMA=s(8759);r.exports.load=a.load;r.exports.loadAll=a.loadAll;r.exports.dump=l.dump;r.exports.YAMLException=s(8179);r.exports.types={binary:s(7900),float:s(2705),map:s(6150),null:s(721),pairs:s(6860),set:s(9548),timestamp:s(9212),bool:s(4993),int:s(1615),merge:s(6104),omap:s(9046),seq:s(7283),str:s(3619)};r.exports.safeLoad=renamed("safeLoad","load");r.exports.safeLoadAll=renamed("safeLoadAll","loadAll");r.exports.safeDump=renamed("safeDump","dump")},6829:r=>{"use strict";function isNothing(r){return typeof r==="undefined"||r===null}function isObject(r){return typeof r==="object"&&r!==null}function toArray(r){if(Array.isArray(r))return r;else if(isNothing(r))return[];return[r]}function extend(r,i){var s,a,l,c;if(i){c=Object.keys(i);for(s=0,a=c.length;s<a;s+=1){l=c[s];r[l]=i[l]}}return r}function repeat(r,i){var s="",a;for(a=0;a<i;a+=1){s+=r}return s}function isNegativeZero(r){return r===0&&Number.NEGATIVE_INFINITY===1/r}r.exports.isNothing=isNothing;r.exports.isObject=isObject;r.exports.toArray=toArray;r.exports.repeat=repeat;r.exports.isNegativeZero=isNegativeZero;r.exports.extend=extend},8866:(r,i,s)=>{"use strict";var a=s(6829);var l=s(8179);var c=s(8759);var p=Object.prototype.toString;var d=Object.prototype.hasOwnProperty;var A=65279;var u=9;var m=10;var h=13;var g=32;var E=33;var y=34;var C=35;var b=37;var I=38;var B=39;var v=42;var Q=44;var w=45;var x=58;var S=61;var N=62;var R=63;var D=64;var T=91;var _=93;var k=96;var O=123;var P=124;var L=125;var M={};M[0]="\\0";M[7]="\\a";M[8]="\\b";M[9]="\\t";M[10]="\\n";M[11]="\\v";M[12]="\\f";M[13]="\\r";M[27]="\\e";M[34]='\\"';M[92]="\\\\";M[133]="\\N";M[160]="\\_";M[8232]="\\L";M[8233]="\\P";var U=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];var q=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function compileStyleMap(r,i){var s,a,l,c,p,A,u;if(i===null)return{};s={};a=Object.keys(i);for(l=0,c=a.length;l<c;l+=1){p=a[l];A=String(i[p]);if(p.slice(0,2)==="!!"){p="tag:yaml.org,2002:"+p.slice(2)}u=r.compiledTypeMap["fallback"][p];if(u&&d.call(u.styleAliases,A)){A=u.styleAliases[A]}s[p]=A}return s}function encodeHex(r){var i,s,c;i=r.toString(16).toUpperCase();if(r<=255){s="x";c=2}else if(r<=65535){s="u";c=4}else if(r<=4294967295){s="U";c=8}else{throw new l("code point within a string may not be greater than 0xFFFFFFFF")}return"\\"+s+a.repeat("0",c-i.length)+i}var H=1,G=2;function State(r){this.schema=r["schema"]||c;this.indent=Math.max(1,r["indent"]||2);this.noArrayIndent=r["noArrayIndent"]||false;this.skipInvalid=r["skipInvalid"]||false;this.flowLevel=a.isNothing(r["flowLevel"])?-1:r["flowLevel"];this.styleMap=compileStyleMap(this.schema,r["styles"]||null);this.sortKeys=r["sortKeys"]||false;this.lineWidth=r["lineWidth"]||80;this.noRefs=r["noRefs"]||false;this.noCompatMode=r["noCompatMode"]||false;this.condenseFlow=r["condenseFlow"]||false;this.quotingType=r["quotingType"]==='"'?G:H;this.forceQuotes=r["forceQuotes"]||false;this.replacer=typeof r["replacer"]==="function"?r["replacer"]:null;this.implicitTypes=this.schema.compiledImplicit;this.explicitTypes=this.schema.compiledExplicit;this.tag=null;this.result="";this.duplicates=[];this.usedDuplicates=null}function indentString(r,i){var s=a.repeat(" ",i),l=0,c=-1,p="",d,A=r.length;while(l<A){c=r.indexOf("\n",l);if(c===-1){d=r.slice(l);l=A}else{d=r.slice(l,c+1);l=c+1}if(d.leng
/*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*/
r.exports=s(3765)},3583:(r,i,s)=>{"use strict";
/*!
* mime-types
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/var a=s(7426);var l=s(1017).extname;var c=/^\s*([^;\s]*)(?:;|\s|$)/;var p=/^text\//i;i.charset=charset;i.charsets={lookup:charset};i.contentType=contentType;i.extension=extension;i.extensions=Object.create(null);i.lookup=lookup;i.types=Object.create(null);populateMaps(i.extensions,i.types);function charset(r){if(!r||typeof r!=="string"){return false}var i=c.exec(r);var s=i&&a[i[1].toLowerCase()];if(s&&s.charset){return s.charset}if(i&&p.test(i[1])){return"UTF-8"}return false}function contentType(r){if(!r||typeof r!=="string"){return false}var s=r.indexOf("/")===-1?i.lookup(r):r;if(!s){return false}if(s.indexOf("charset")===-1){var a=i.charset(s);if(a)s+="; charset="+a.toLowerCase()}return s}function extension(r){if(!r||typeof r!=="string"){return false}var s=c.exec(r);var a=s&&i.extensions[s[1].toLowerCase()];if(!a||!a.length){return false}return a[0]}function lookup(r){if(!r||typeof r!=="string"){return false}var s=l("x."+r).toLowerCase().substr(1);if(!s){return false}return i.types[s]||false}function populateMaps(r,i){var s=["nginx","apache",undefined,"iana"];Object.keys(a).forEach((function forEachMimeType(l){var c=a[l];var p=c.extensions;if(!p||!p.length){return}r[l]=p;for(var d=0;d<p.length;d++){var A=p[d];if(i[A]){var u=s.indexOf(a[i[A]].source);var m=s.indexOf(c.source);if(i[A]!=="application/octet-stream"&&(u>m||u===m&&i[A].substr(0,12)==="application/")){continue}}i[A]=l}}))}},3973:(r,i,s)=>{r.exports=minimatch;minimatch.Minimatch=Minimatch;var a=function(){try{return s(1017)}catch(r){}}()||{sep:"/"};minimatch.sep=a.sep;var l=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var c=s(3717);var p={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var d="[^/]";var A=d+"*?";var u="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var m="(?:(?!(?:\\/|^)\\.).)*?";var h=charSet("().*{}+?[]^$\\!");function charSet(r){return r.split("").reduce((function(r,i){r[i]=true;return r}),{})}var g=/\/+/;minimatch.filter=filter;function filter(r,i){i=i||{};return function(s,a,l){return minimatch(s,r,i)}}function ext(r,i){i=i||{};var s={};Object.keys(r).forEach((function(i){s[i]=r[i]}));Object.keys(i).forEach((function(r){s[r]=i[r]}));return s}minimatch.defaults=function(r){if(!r||typeof r!=="object"||!Object.keys(r).length){return minimatch}var i=minimatch;var s=function minimatch(s,a,l){return i(s,a,ext(r,l))};s.Minimatch=function Minimatch(s,a){return new i.Minimatch(s,ext(r,a))};s.Minimatch.defaults=function defaults(s){return i.defaults(ext(r,s)).Minimatch};s.filter=function filter(s,a){return i.filter(s,ext(r,a))};s.defaults=function defaults(s){return i.defaults(ext(r,s))};s.makeRe=function makeRe(s,a){return i.makeRe(s,ext(r,a))};s.braceExpand=function braceExpand(s,a){return i.braceExpand(s,ext(r,a))};s.match=function(s,a,l){return i.match(s,a,ext(r,l))};return s};Minimatch.defaults=function(r){return minimatch.defaults(r).Minimatch};function minimatch(r,i,s){assertValidPattern(i);if(!s)s={};if(!s.nocomment&&i.charAt(0)==="#"){return false}return new Minimatch(i,s).match(r)}function Minimatch(r,i){if(!(this instanceof Minimatch)){return new Minimatch(r,i)}assertValidPattern(r);if(!i)i={};r=r.trim();if(!i.allowWindowsEscape&&a.sep!=="/"){r=r.split(a.sep).join("/")}this.options=i;this.set=[];this.pattern=r;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!i.partial;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){var r=this.pattern;var i=this.options;if(!i.nocomment&&r.charAt(0)==="#"){this.comment=true;return}if(!r){this.empty=true;return}this.parseNegate();var s=this.globSet=this.braceExpand();if(i.debug)this.debug=function debug(){console.error.apply(console,arguments)};this.debug(this.pattern,s);s=this.globParts=s.map((function(r){return r.split(g)}));this.debug(this.pattern,s);s=s.map((function(r,i,s){return r.map(this.parse,this)}),this);this.debug(this.pattern,s);s=s.filter((function(r){return r.indexOf(false)===-1}));this.debug(this.pattern,s);thi
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var r=String.fromCharCode;var i=Math.floor;var fromCodePoint=function(){var s=16384;var a=[];var l;var c;var p=-1;var d=arguments.length;if(!d){return""}var A="";while(++p<d){var u=Number(arguments[p]);if(!isFinite(u)||u<0||u>1114111||i(u)!==u){throw RangeError("Invalid code point: "+u)}if(u<=65535){a.push(u)}else{u-=65536;l=(u>>10)+55296;c=u%1024+56320;a.push(l,c)}if(p+1===d||a.length>s){A+=r.apply(null,a);a.length=0}}return A};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:true,writable:true})}else{String.fromCodePoint=fromCodePoint}})()}})(false?0:i)},5911:(r,i)=>{i=r.exports=SemVer;var s;if(typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)){s=function(){var r=Array.prototype.slice.call(arguments,0);r.unshift("SEMVER");console.log.apply(console,r)}}else{s=function(){}}i.SEMVER_SPEC_VERSION="2.0.0";var a=256;var l=Number.MAX_SAFE_INTEGER||9007199254740991;var c=16;var p=i.re=[];var d=i.src=[];var A=i.tokens={};var u=0;function tok(r){A[r]=u++}tok("NUMERICIDENTIFIER");d[A.NUMERICIDENTIFIER]="0|[1-9]\\d*";tok("NUMERICIDENTIFIERLOOSE");d[A.NUMERICIDENTIFIERLOOSE]="[0-9]+";tok("NONNUMERICIDENTIFIER");d[A.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";tok("MAINVERSION");d[A.MAINVERSION]="("+d[A.NUMERICIDENTIFIER]+")\\."+"("+d[A.NUMERICIDENTIFIER]+")\\."+"("+d[A.NUMERICIDENTIFIER]+")";tok("MAINVERSIONLOOSE");d[A.MAINVERSIONLOOSE]="("+d[A.NUMERICIDENTIFIERLOOSE]+")\\."+"("+d[A.NUMERICIDENTIFIERLOOSE]+")\\."+"("+d[A.NUMERICIDENTIFIERLOOSE]+")";tok("PRERELEASEIDENTIFIER");d[A.PRERELEASEIDENTIFIER]="(?:"+d[A.NUMERICIDENTIFIER]+"|"+d[A.NONNUMERICIDENTIFIER]+")";tok("PRERELEASEIDENTIFIERLOOSE");d[A.PRERELEASEIDENTIFIERLOOSE]="(?:"+d[A.NUMERICIDENTIFIERLOOSE]+"|"+d[A.NONNUMERICIDENTIFIER]+")";tok("PRERELEASE");d[A.PRERELEASE]="(?:-("+d[A.PRERELEASEIDENTIFIER]+"(?:\\."+d[A.PRERELEASEIDENTIFIER]+")*))";tok("PRERELEASELOOSE");d[A.PRERELEASELOOSE]="(?:-?("+d[A.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+d[A.PRERELEASEIDENTIFIERLOOSE]+")*))";tok("BUILDIDENTIFIER");d[A.BUILDIDENTIFIER]="[0-9A-Za-z-]+";tok("BUILD");d[A.BUILD]="(?:\\+("+d[A.BUILDIDENTIFIER]+"(?:\\."+d[A.BUILDIDENTIFIER]+")*))";tok("FULL");tok("FULLPLAIN");d[A.FULLPLAIN]="v?"+d[A.MAINVERSION]+d[A.PRERELEASE]+"?"+d[A.BUILD]+"?";d[A.FULL]="^"+d[A.FULLPLAIN]+"$";tok("LOOSEPLAIN");d[A.LOOSEPLAIN]="[v=\\s]*"+d[A.MAINVERSIONLOOSE]+d[A.PRERELEASELOOSE]+"?"+d[A.BUILD]+"?";tok("LOOSE");d[A.LOOSE]="^"+d[A.LOOSEPLAIN]+"$";tok("GTLT");d[A.GTLT]="((?:<|>)?=?)";tok("XRANGEIDENTIFIERLOOSE");d[A.XRANGEIDENTIFIERLOOSE]=d[A.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";tok("XRANGEIDENTIFIER");d[A.XRANGEIDENTIFIER]=d[A.NUMERICIDENTIFIER]+"|x|X|\\*";tok("XRANGEPLAIN");d[A.XRANGEPLAIN]="[v=\\s]*("+d[A.XRANGEIDENTIFIER]+")"+"(?:\\.("+d[A.XRANGEIDENTIFIER]+")"+"(?:\\.("+d[A.XRANGEIDENTIFIER]+")"+"(?:"+d[A.PRERELEASE]+")?"+d[A.BUILD]+"?"+")?)?";tok("XRANGEPLAINLOOSE");d[A.XRANGEPLAINLOOSE]="[v=\\s]*("+d[A.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+d[A.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+d[A.XRANGEIDENTIFIERLOOSE]+")"+"(?:"+d[A.PRERELEASELOOSE]+")?"+d[A.BUILD]+"?"+")?)?";tok("XRANGE");d[A.XRANGE]="^"+d[A.GTLT]+"\\s*"+d[A.XRANGEPLAIN]+"$";tok("XRANGELOOSE");d[A.XRANGELOOSE]="^"+d[A.GTLT]+"\\s*"+d[A.XRANGEPLAINLOOSE]+"$";tok("COERCE");d[A.COERCE]="(^|[^\\d])"+"(\\d{1,"+c+"})"+"(?:\\.(\\d{1,"+c+"}))?"+"(?:\\.(\\d{1,"+c+"}))?"+"(?:$|[^\\d])";tok("COERCERTL");p[A.COERCERTL]=new RegExp(d[A.COERCE],"g");tok("LONETILDE");d[A.LONETILDE]="(?:~>?)";tok("TILDETRIM");d[A.TILDETRIM]="(\\s*)"+d[A.LONETILDE]+"\\s+";p[A.TILDETRIM]=new RegExp(d[A.TILDETRIM],"g");var m="$1~";tok("TILDE");d[A.TILDE]="^"+d[A.LONETILDE]+d[A.XRANGEPLAIN]+"$";tok("TILDELOOSE");d[A.TILDELOOSE]="^"+d[A.LONETILDE]+d[A.XRANGEPLAINLOOSE]+"$";tok("LONECARET");d[A.LONECARET]="(?:\\^)";tok("CARETTRIM");d[A.CARETTRIM]="(\\s*)"+d[A.LONECARET]+"\\s+";p[A.CARETTRIM]=new RegExp(d[A.CARETTRIM],"g");var h="$1^";tok("CARET");d[A.CARET]="^"+d[A.LONECARET]+d[A.XRANGEPLAIN
/*!
* Tmp
*
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
*
* MIT Licensed
*/
const a=s(7147);const l=s(2037);const c=s(1017);const p=s(6113);const d={fs:a.constants,os:l.constants};const A=s(4959);const u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",m=/XXXXXX/,h=3,g=(d.O_CREAT||d.fs.O_CREAT)|(d.O_EXCL||d.fs.O_EXCL)|(d.O_RDWR||d.fs.O_RDWR),E=l.platform()==="win32",y=d.EBADF||d.os.errno.EBADF,C=d.ENOENT||d.os.errno.ENOENT,b=448,I=384,B="exit",v=[],Q=a.rmdirSync.bind(a),w=A.sync;let x=false;function tmpName(r,i){const s=_parseArguments(r,i),l=s[0],c=s[1];try{_assertAndSanitizeOptions(l)}catch(r){return c(r)}let p=l.tries;(function _getUniqueName(){try{const r=_generateTmpName(l);a.stat(r,(function(i){if(!i){if(p-- >0)return _getUniqueName();return c(new Error("Could not get a unique tmp filename, max tries reached "+r))}c(null,r)}))}catch(r){c(r)}})()}function tmpNameSync(r){const i=_parseArguments(r),s=i[0];_assertAndSanitizeOptions(s);let l=s.tries;do{const r=_generateTmpName(s);try{a.statSync(r)}catch(i){return r}}while(l-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(r,i){const s=_parseArguments(r,i),l=s[0],c=s[1];tmpName(l,(function _tmpNameCreated(r,i){if(r)return c(r);a.open(i,g,l.mode||I,(function _fileCreated(r,s){if(r)return c(r);if(l.discardDescriptor){return a.close(s,(function _discardCallback(r){return c(r,i,undefined,_prepareTmpFileRemoveCallback(i,-1,l,false))}))}else{const r=l.discardDescriptor||l.detachDescriptor;c(null,i,s,_prepareTmpFileRemoveCallback(i,r?-1:s,l,false))}}))}))}function fileSync(r){const i=_parseArguments(r),s=i[0];const l=s.discardDescriptor||s.detachDescriptor;const c=tmpNameSync(s);var p=a.openSync(c,g,s.mode||I);if(s.discardDescriptor){a.closeSync(p);p=undefined}return{name:c,fd:p,removeCallback:_prepareTmpFileRemoveCallback(c,l?-1:p,s,true)}}function dir(r,i){const s=_parseArguments(r,i),l=s[0],c=s[1];tmpName(l,(function _tmpNameCreated(r,i){if(r)return c(r);a.mkdir(i,l.mode||b,(function _dirCreated(r){if(r)return c(r);c(null,i,_prepareTmpDirRemoveCallback(i,l,false))}))}))}function dirSync(r){const i=_parseArguments(r),s=i[0];const l=tmpNameSync(s);a.mkdirSync(l,s.mode||b);return{name:l,removeCallback:_prepareTmpDirRemoveCallback(l,s,true)}}function _removeFileAsync(r,i){const _handler=function(r){if(r&&!_isENOENT(r)){return i(r)}i()};if(0<=r[0])a.close(r[0],(function(){a.unlink(r[1],_handler)}));else a.unlink(r[1],_handler)}function _removeFileSync(r){let i=null;try{if(0<=r[0])a.closeSync(r[0])}catch(r){if(!_isEBADF(r)&&!_isENOENT(r))throw r}finally{try{a.unlinkSync(r[1])}catch(r){if(!_isENOENT(r))i=r}}if(i!==null){throw i}}function _prepareTmpFileRemoveCallback(r,i,s,a){const l=_prepareRemoveCallback(_removeFileSync,[i,r],a);const c=_prepareRemoveCallback(_removeFileAsync,[i,r],a,l);if(!s.keep)v.unshift(l);return a?l:c}function _prepareTmpDirRemoveCallback(r,i,s){const l=i.unsafeCleanup?A:a.rmdir.bind(a);const c=i.unsafeCleanup?w:Q;const p=_prepareRemoveCallback(c,r,s);const d=_prepareRemoveCallback(l,r,s,p);if(!i.keep)v.unshift(p);return s?p:d}function _prepareRemoveCallback(r,i,s,a){let l=false;return function _cleanupCallback(c){if(!l){const p=a||_cleanupCallback;const d=v.indexOf(p);if(d>=0)v.splice(d,1);l=true;if(s||r===Q||r===w){return r(i)}else{return r(i,c||function(){})}}}}function _garbageCollector(){if(!x)return;while(v.length){try{v[0]()}catch(r){}}}function _randomChars(r){let i=[],s=null;try{s=p.randomBytes(r)}catch(i){s=p.pseudoRandomBytes(r)}for(var a=0;a<r;a++){i.push(u[s[a]%u.length])}return i.join("")}function _isBlank(r){return r===null||_isUndefined(r)||!r.trim()}function _isUndefined(r){return typeof r==="undefined"}function _parseArguments(r,i){if(typeof r==="function"){return[{},r]}if(_isUndefined(r)){return[{},i]}const s={};for(const i of Object.getOwnPropertyNames(r)){s[i]=r[i]}return[s,i]}function _generateTmpName(r){const i=r.tmpdir;if(!_isUndefined(r.name))return c.join(i,r.dir,r.name);if(!_isUndefined(r.template))return c.join(i,r.dir,r.template).replace(m,_randomChars(6));const s=[r.prefix?r.prefix:"tmp","-",process.pid,"-",_randomChars(12),r.postfix?"-"+r.po
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=r=>r.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=r=>r.replace(/\r?\n|\r/g,"\r\n");const a=new TextEncoder;const l=[];const c=new Uint8Array([13,10]);h=0;let p=false;for(const[i,d]of r){if(typeof d==="string"){const r=a.encode(s+`; name="${escape(normalizeLinefeeds(i))}"`+`\r\n\r\n${normalizeLinefeeds(d)}\r\n`);l.push(r);h+=r.byteLength}else{const r=a.encode(`${s}; name="${escape(normalizeLinefeeds(i))}"`+(d.name?`; filename="${escape(d.name)}"`:"")+"\r\n"+`Content-Type: ${d.type||"application/octet-stream"}\r\n\r\n`);l.push(r,d,c);if(typeof d.size==="number"){h+=r.byteLength+d.size+c.byteLength}else{p=true}}}const d=a.encode(`--${i}--`);l.push(d);h+=d.byteLength;if(p){h=null}m=r;u=async function*(){for(const r of l){if(r.stream){yield*r.stream()}else{yield r}}};g="multipart/form-data; boundary="+i}else if(p(r)){m=r;h=r.size;if(r.type){g=r.type}}else if(typeof r[Symbol.asyncIterator]==="function"){if(i){throw new TypeError("keepalive")}if(l.isDisturbed(r)||r.locked){throw new TypeError("Response body object should not be disturbed or locked")}a=r instanceof D?r:c(r)}if(typeof m==="string"||l.isBuffer(m)){h=Buffer.byteLength(m)}if(u!=null){let i;a=new D({async start(){i=u(r)[Symbol.asyncIterator]()},async pull(r){const{value:s,done:l}=await i.next();if(l){queueMicrotask((()=>{r.close()}))}else{if(!Q(a)){r.enqueue(new Uint8Array(s))}}return r.desiredSize>0},async cancel(r){await i.return()},type:undefined})}const E={stream:a,source:m,length:h};return[E,g]}function safelyExtractBody(r,i=false){if(!D){D=s(5356).ReadableStream}if(r instanceof D){v(!l.isDisturbed(r),"The body has already been consumed.");v(!r.locked,"The stream is locked.")}return extractBody(r,i)}function cloneBody(r){const[i,s]=r.stream.tee();const a=C(s,{transfer:[s]});const[,l]=a.tee();r.stream=i;return{stream:l,length:r.length,source:r.source}}async function*consumeBody(r){if(r){if(w(r)){yield r}else{const i=r.stream;if(l.isDisturbed(i)){throw new TypeError("The body has already been consumed.")}if(i.locked){throw new TypeError("The stream is locked.")}i[B]=true;yield*i}}}function throwIfAborted(r){if(r.aborted){throw new y("The operation was aborted.","AbortError")}}function bodyMixinMethods(r){const i={blob(){return specConsumeBody(this,(r=>{let i=bodyMimeType(this);if(i==="failure"){i=""}else if(i){i=R(i)}return new b([r],{type:i})}),r)},arrayBuffer(){return specConsumeBody(this,(r=>new Uint8Array(r).buffer),r)},text(){return specConsumeBody(this,utf8DecodeBytes,r)},json(){return specConsumeBody(this,parseJSONFromBytes,r)},async formData(){E.brandCheck(this,r);throwIfAborted(this[g]);const i=this.headers.get("Content-Type");if(/multipart\/form-data/.test(i)){const r={};for(const[i,s]of this.headers)r[i.toLowerCase()]=s;const i=new h;let s;try{s=new a({headers:r,preservePath:true})}catch(r){throw new y(`${r}`,"AbortError")}s.on("field",((r,s)=>{i.append(r,s)}));s.on("file",((r,s,a,l,c)=>{const p=[];if(l==="base64"||l.toLowerCase()==="base64"){let l="";s.on("data",(r=>{l+=r.toString().replace(/[\r\n]/gm,"");const i=l.length-l.length%4;p.push(Buffer.from(l.slice(0,i),"base64"));l=l.slice(i)}));s.on("end",(()=>{p.push(Buffer.from(l,"base64"));i.append(r,new T(p,a,{type:c}))}))}else{s.on("data",(r=>{p.push(r)}));s.on("end",(()=>{i.append(r,new T(p,a,{type:c}))}))}}));const l=new Promise(((r,i)=>{s.on("finish",r);s.on("error",(r=>i(new TypeError(r))))}));if(this.body!==null)for await(const r of consumeBody(this[g].body))s.write(r);s.end();await l;return i}else if(/application\/x-www-form-urlencoded/.test(i)){let r;try{let i="";const s=new TextDecoder("utf-8",{ignoreBOM:true});for await(const r of consumeBody(this[g].body)){if(!w(r)){throw new TypeError("Expected Uint8Array chunk")}i+=s.decode(r,{stream:true})}i+=s.decode();r=new URLSearchParams(i)}catch(r){throw Object.assign(new TypeError,{cause:r})}const i=new h;for(const[s,a]of r){i.append(s,a)}return i}else{await Promise.resolve();throwIfAborted(this[g]);thro
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */c[l-4]=this.maskKey[0];c[l-3]=this.maskKey[1];c[l-2]=this.maskKey[2];c[l-1]=this.maskKey[3];c[1]=s;if(s===126){c.writeUInt16BE(i,2)}else if(s===127){c[2]=c[3]=0;c.writeUIntBE(i,4,6)}c[1]|=128;for(let r=0;r<i;r++){c[l+r]=this.frameData[r]^this.maskKey[r%4]}return c}}r.exports={WebsocketFrameSend:WebsocketFrameSend}},1688:(r,i,s)=>{"use strict";const{Writable:a}=s(2781);const l=s(7643);const{parserStates:c,opcodes:p,states:d,emptyBuffer:A}=s(9188);const{kReadyState:u,kSentClose:m,kResponse:h,kReceivedClose:g}=s(7578);const{isValidStatusCode:E,failWebsocketConnection:y,websocketMessageReceived:C}=s(5515);const{WebsocketFrameSend:b}=s(5444);const I={};I.ping=l.channel("undici:websocket:ping");I.pong=l.channel("undici:websocket:pong");class ByteParser extends a{#a=[];#o=0;#l=c.INFO;#c={};#p=[];constructor(r){super();this.ws=r}_write(r,i,s){this.#a.push(r);this.#o+=r.length;this.run(s)}run(r){while(true){if(this.#l===c.INFO){if(this.#o<2){return r()}const i=this.consume(2);this.#c.fin=(i[0]&128)!==0;this.#c.opcode=i[0]&15;this.#c.originalOpcode??=this.#c.opcode;this.#c.fragmented=!this.#c.fin&&this.#c.opcode!==p.CONTINUATION;if(this.#c.fragmented&&this.#c.opcode!==p.BINARY&&this.#c.opcode!==p.TEXT){y(this.ws,"Invalid frame type was fragmented.");return}const s=i[1]&127;if(s<=125){this.#c.payloadLength=s;this.#l=c.READ_DATA}else if(s===126){this.#l=c.PAYLOADLENGTH_16}else if(s===127){this.#l=c.PAYLOADLENGTH_64}if(this.#c.fragmented&&s>125){y(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#c.opcode===p.PING||this.#c.opcode===p.PONG||this.#c.opcode===p.CLOSE)&&s>125){y(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#c.opcode===p.CLOSE){if(s===1){y(this.ws,"Received close frame with a 1-byte body.");return}const r=this.consume(s);this.#c.closeInfo=this.parseCloseBody(false,r);if(!this.ws[m]){const r=Buffer.allocUnsafe(2);r.writeUInt16BE(this.#c.closeInfo.code,0);const i=new b(r);this.ws[h].socket.write(i.createFrame(p.CLOSE),(r=>{if(!r){this.ws[m]=true}}))}this.ws[u]=d.CLOSING;this.ws[g]=true;this.end();return}else if(this.#c.opcode===p.PING){const i=this.consume(s);if(!this.ws[g]){const r=new b(i);this.ws[h].socket.write(r.createFrame(p.PONG));if(I.ping.hasSubscribers){I.ping.publish({payload:i})}}this.#l=c.INFO;if(this.#o>0){continue}else{r();return}}else if(this.#c.opcode===p.PONG){const i=this.consume(s);if(I.pong.hasSubscribers){I.pong.publish({payload:i})}if(this.#o>0){continue}else{r();return}}}else if(this.#l===c.PAYLOADLENGTH_16){if(this.#o<2){return r()}const i=this.consume(2);this.#c.payloadLength=i.readUInt16BE(0);this.#l=c.READ_DATA}else if(this.#l===c.PAYLOADLENGTH_64){if(this.#o<8){return r()}const i=this.consume(8);const s=i.readUInt32BE(0);if(s>2**31-1){y(this.ws,"Received payload length > 2^31 bytes.");return}const a=i.readUInt32BE(4);this.#c.payloadLength=(s<<8)+a;this.#l=c.READ_DATA}else if(this.#l===c.READ_DATA){if(this.#o<this.#c.payloadLength){return r()}else if(this.#o>=this.#c.payloadLength){const r=this.consume(this.#c.payloadLength);this.#p.push(r);if(!this.#c.fragmented||this.#c.fin&&this.#c.opcode===p.CONTINUATION){const r=Buffer.concat(this.#p);C(this.ws,this.#c.originalOpcode,r);this.#c={};this.#p.length=0}this.#l=c.INFO}}if(this.#o>0){continue}else{r();break}}}consume(r){if(r>this.#o){return null}else if(r===0){return A}if(this.#a[0].length===r){this.#o-=this.#a[0].length;return this.#a.shift()}const i=Buffer.allocUnsafe(r);let s=0;while(s!==r){const a=this.#a[0];const{length:l}=a;if(l+s===r){i.set(this.#a.shift(),s);break}else if(l+s>r){i.set(a.subarray(0,r-s),s);this.#a[0]=a.subarray(r-s);break}else{i.set(this.#a.shift(),s);s+=a.length}}this.#o-=r;return i}parseCloseBody(r,i){let s;if(i.length>=2){s=i.readUInt16BE(0)}if(r){if(!E(s)){return null}return{code:s}}let a=i.subarray(2);if(a[0]===239&&a[1]===187&&a[2]===191){a=a.subarray(3)}if(s!==undefined&&!E(s)){return null}try{a=new TextDecoder("utf-8",{fatal:true}).decode(a)}catch{return null}return{code:s,reason:a}}get closingIn
//# sourceMappingURL=index.js.map