helm-viewer 0.7.4 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ https://helm-viewer.vercel.app?id=deefdf73-2c0f-4ab7-b817-2a6754af815a&encryptionKey=f5f0e76f-9d04-494b-8de7-250937bcd7cc&online=true
package/binary/index.js CHANGED
@@ -54,4 +54,4 @@ e.exports=function(e,t){if(typeof e!=="string"){throw new TypeError("expected pa
54
54
  *
55
55
  * Copyright (c) 2015-present, Jon Schlinkert.
56
56
  * Released under the MIT License.
57
- */const n=r(5680);const toRegexRange=(e,t,r)=>{if(n(e)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(t===void 0||e===t){return String(e)}if(n(t)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let i={relaxZeros:true,...r};if(typeof i.strictZeros==="boolean"){i.relaxZeros=i.strictZeros===false}let s=String(i.relaxZeros);let o=String(i.shorthand);let a=String(i.capture);let c=String(i.wrap);let l=e+":"+t+"="+s+o+a+c;if(toRegexRange.cache.hasOwnProperty(l)){return toRegexRange.cache[l].result}let u=Math.min(e,t);let f=Math.max(e,t);if(Math.abs(u-f)===1){let r=e+"|"+t;if(i.capture){return`(${r})`}if(i.wrap===false){return r}return`(?:${r})`}let h=hasPadding(e)||hasPadding(t);let d={min:e,max:t,a:u,b:f};let p=[];let m=[];if(h){d.isPadded=h;d.maxLen=String(d.max).length}if(u<0){let e=f<0?Math.abs(f):1;m=splitToPatterns(e,Math.abs(u),d,i);u=d.a=0}if(f>=0){p=splitToPatterns(u,f,d,i)}d.negatives=m;d.positives=p;d.result=collatePatterns(m,p,i);if(i.capture===true){d.result=`(${d.result})`}else if(i.wrap!==false&&p.length+m.length>1){d.result=`(?:${d.result})`}toRegexRange.cache[l]=d;return d.result};function collatePatterns(e,t,r){let n=filterPatterns(e,t,"-",false,r)||[];let i=filterPatterns(t,e,"",false,r)||[];let s=filterPatterns(e,t,"-?",true,r)||[];let o=n.concat(s).concat(i);return o.join("|")}function splitToRanges(e,t){let r=1;let n=1;let i=countNines(e,r);let s=new Set([t]);while(e<=i&&i<=t){s.add(i);r+=1;i=countNines(e,r)}i=countZeros(t+1,n)-1;while(e<i&&i<=t){s.add(i);n+=1;i=countZeros(t+1,n)-1}s=[...s];s.sort(compare);return s}function rangeToPattern(e,t,r){if(e===t){return{pattern:e,count:[],digits:0}}let n=zip(e,t);let i=n.length;let s="";let o=0;for(let e=0;e<i;e++){let[t,i]=n[e];if(t===i){s+=t}else if(t!=="0"||i!=="9"){s+=toCharacterClass(t,i,r)}else{o++}}if(o){s+=r.shorthand===true?"\\d":"[0-9]"}return{pattern:s,count:[o],digits:i}}function splitToPatterns(e,t,r,n){let i=splitToRanges(e,t);let s=[];let o=e;let a;for(let e=0;e<i.length;e++){let t=i[e];let c=rangeToPattern(String(o),String(t),n);let l="";if(!r.isPadded&&a&&a.pattern===c.pattern){if(a.count.length>1){a.count.pop()}a.count.push(c.count[0]);a.string=a.pattern+toQuantifier(a.count);o=t+1;continue}if(r.isPadded){l=padZeros(t,r,n)}c.string=l+c.pattern+toQuantifier(c.count);s.push(c);o=t+1;a=c}return s}function filterPatterns(e,t,r,n,i){let s=[];for(let i of e){let{string:e}=i;if(!n&&!contains(t,"string",e)){s.push(r+e)}if(n&&contains(t,"string",e)){s.push(r+e)}}return s}function zip(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function compare(e,t){return e>t?1:t>e?-1:0}function contains(e,t,r){return e.some((e=>e[t]===r))}function countNines(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function countZeros(e,t){return e-e%Math.pow(10,t)}function toQuantifier(e){let[t=0,r=""]=e;if(r||t>1){return`{${t+(r?","+r:"")}}`}return""}function toCharacterClass(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function hasPadding(e){return/^-?(0+)\d/.test(e)}function padZeros(e,t,r){if(!t.isPadded){return e}let n=Math.abs(t.maxLen-String(e).length);let i=r.relaxZeros!==false;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:{return i?`0{0,${n}}`:`0{${n}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};e.exports=toRegexRange},4207:(e,t,r)=>{const n=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const i=r(1017);const s=n?";":":";const o=r(7126);const getNotFoundError=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"});const getPathInfo=(e,t)=>{const r=t.colon||s;const i=e.match(/\//)||n&&e.match(/\\/)?[""]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)];const o=n?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const a=n?o.split(r):[""];if(n){if(e.indexOf(".")!==-1&&a[0]!=="")a.unshift("")}return{pathEnv:i,pathExt:a,pathExtExe:o}};const which=(e,t,r)=>{if(typeof t==="function"){r=t;t={}}if(!t)t={};const{pathEnv:n,pathExt:s,pathExtExe:a}=getPathInfo(e,t);const c=[];const step=r=>new Promise(((s,o)=>{if(r===n.length)return t.all&&c.length?s(c):o(getNotFoundError(e));const a=n[r];const l=/^".*"$/.test(a)?a.slice(1,-1):a;const u=i.join(l,e);const f=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;s(subStep(f,r,0))}));const subStep=(e,r,n)=>new Promise(((i,l)=>{if(n===s.length)return i(step(r+1));const u=s[n];o(e+u,{pathExt:a},((s,o)=>{if(!s&&o){if(t.all)c.push(e+u);else return i(e+u)}return i(subStep(e,r,n+1))}))}));return r?step(0).then((e=>r(null,e)),r):step(0)};const whichSync=(e,t)=>{t=t||{};const{pathEnv:r,pathExt:n,pathExtExe:s}=getPathInfo(e,t);const a=[];for(let c=0;c<r.length;c++){const l=r[c];const u=/^".*"$/.test(l)?l.slice(1,-1):l;const f=i.join(u,e);const h=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+f:f;for(let e=0;e<n.length;e++){const r=h+n[e];try{const e=o.sync(r,{pathExt:s});if(e){if(t.all)a.push(r);else return r}}catch(e){}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw getNotFoundError(e)};e.exports=which;which.sync=whichSync},8867:(e,t,r)=>{"use strict";const n=r(1518);n.createWebSocketStream=r(1658);n.Server=r(8887);n.Receiver=r(5066);n.Sender=r(6947);n.WebSocket=n;n.WebSocketServer=n.Server;e.exports=n},9436:(e,t,r)=>{"use strict";const{EMPTY_BUFFER:n}=r(5949);const i=Buffer[Symbol.species];function concat(e,t){if(e.length===0)return n;if(e.length===1)return e[0];const r=Buffer.allocUnsafe(t);let s=0;for(let t=0;t<e.length;t++){const n=e[t];r.set(n,s);s+=n.length}if(s<t){return new i(r.buffer,r.byteOffset,s)}return r}function _mask(e,t,r,n,i){for(let s=0;s<i;s++){r[n+s]=e[s]^t[s&3]}}function _unmask(e,t){for(let r=0;r<e.length;r++){e[r]^=t[r&3]}}function toArrayBuffer(e){if(e.length===e.buffer.byteLength){return e.buffer}return e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function toBuffer(e){toBuffer.readOnly=true;if(Buffer.isBuffer(e))return e;let t;if(e instanceof ArrayBuffer){t=new i(e)}else if(ArrayBuffer.isView(e)){t=new i(e.buffer,e.byteOffset,e.byteLength)}else{t=Buffer.from(e);toBuffer.readOnly=false}return t}e.exports={concat:concat,mask:_mask,toArrayBuffer:toArrayBuffer,toBuffer:toBuffer,unmask:_unmask};if(!process.env.WS_NO_BUFFER_UTIL){try{const t=r(1269);e.exports.mask=function(e,r,n,i,s){if(s<48)_mask(e,r,n,i,s);else t.mask(e,r,n,i,s)};e.exports.unmask=function(e,r){if(e.length<32)_unmask(e,r);else t.unmask(e,r)}}catch(e){}}},5949:e=>{"use strict";e.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}},4561:(e,t,r)=>{"use strict";const{kForOnEventAttribute:n,kListener:i}=r(5949);const s=Symbol("kCode");const o=Symbol("kData");const a=Symbol("kError");const c=Symbol("kMessage");const l=Symbol("kReason");const u=Symbol("kTarget");const f=Symbol("kType");const h=Symbol("kWasClean");class Event{constructor(e){this[u]=null;this[f]=e}get target(){return this[u]}get type(){return this[f]}}Object.defineProperty(Event.prototype,"target",{enumerable:true});Object.defineProperty(Event.prototype,"type",{enumerable:true});class CloseEvent extends Event{constructor(e,t={}){super(e);this[s]=t.code===undefined?0:t.code;this[l]=t.reason===undefined?"":t.reason;this[h]=t.wasClean===undefined?false:t.wasClean}get code(){return this[s]}get reason(){return this[l]}get wasClean(){return this[h]}}Object.defineProperty(CloseEvent.prototype,"code",{enumerable:true});Object.defineProperty(CloseEvent.prototype,"reason",{enumerable:true});Object.defineProperty(CloseEvent.prototype,"wasClean",{enumerable:true});class ErrorEvent extends Event{constructor(e,t={}){super(e);this[a]=t.error===undefined?null:t.error;this[c]=t.message===undefined?"":t.message}get error(){return this[a]}get message(){return this[c]}}Object.defineProperty(ErrorEvent.prototype,"error",{enumerable:true});Object.defineProperty(ErrorEvent.prototype,"message",{enumerable:true});class MessageEvent extends Event{constructor(e,t={}){super(e);this[o]=t.data===undefined?null:t.data}get data(){return this[o]}}Object.defineProperty(MessageEvent.prototype,"data",{enumerable:true});const d={addEventListener(e,t,r={}){for(const s of this.listeners(e)){if(!r[n]&&s[i]===t&&!s[n]){return}}let s;if(e==="message"){s=function onMessage(e,r){const n=new MessageEvent("message",{data:r?e:e.toString()});n[u]=this;callListener(t,this,n)}}else if(e==="close"){s=function onClose(e,r){const n=new CloseEvent("close",{code:e,reason:r.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});n[u]=this;callListener(t,this,n)}}else if(e==="error"){s=function onError(e){const r=new ErrorEvent("error",{error:e,message:e.message});r[u]=this;callListener(t,this,r)}}else if(e==="open"){s=function onOpen(){const e=new Event("open");e[u]=this;callListener(t,this,e)}}else{return}s[n]=!!r[n];s[i]=t;if(r.once){this.once(e,s)}else{this.on(e,s)}},removeEventListener(e,t){for(const r of this.listeners(e)){if(r[i]===t&&!r[n]){this.removeListener(e,r);break}}}};e.exports={CloseEvent:CloseEvent,ErrorEvent:ErrorEvent,Event:Event,EventTarget:d,MessageEvent:MessageEvent};function callListener(e,t,r){if(typeof e==="object"&&e.handleEvent){e.handleEvent.call(e,r)}else{e.call(t,r)}}},2035:(e,t,r)=>{"use strict";const{tokenChars:n}=r(6279);function push(e,t,r){if(e[t]===undefined)e[t]=[r];else e[t].push(r)}function parse(e){const t=Object.create(null);let r=Object.create(null);let i=false;let s=false;let o=false;let a;let c;let l=-1;let u=-1;let f=-1;let h=0;for(;h<e.length;h++){u=e.charCodeAt(h);if(a===undefined){if(f===-1&&n[u]===1){if(l===-1)l=h}else if(h!==0&&(u===32||u===9)){if(f===-1&&l!==-1)f=h}else if(u===59||u===44){if(l===-1){throw new SyntaxError(`Unexpected character at index ${h}`)}if(f===-1)f=h;const n=e.slice(l,f);if(u===44){push(t,n,r);r=Object.create(null)}else{a=n}l=f=-1}else{throw new SyntaxError(`Unexpected character at index ${h}`)}}else if(c===undefined){if(f===-1&&n[u]===1){if(l===-1)l=h}else if(u===32||u===9){if(f===-1&&l!==-1)f=h}else if(u===59||u===44){if(l===-1){throw new SyntaxError(`Unexpected character at index ${h}`)}if(f===-1)f=h;push(r,e.slice(l,f),true);if(u===44){push(t,a,r);r=Object.create(null);a=undefined}l=f=-1}else if(u===61&&l!==-1&&f===-1){c=e.slice(l,h);l=f=-1}else{throw new SyntaxError(`Unexpected character at index ${h}`)}}else{if(s){if(n[u]!==1){throw new SyntaxError(`Unexpected character at index ${h}`)}if(l===-1)l=h;else if(!i)i=true;s=false}else if(o){if(n[u]===1){if(l===-1)l=h}else if(u===34&&l!==-1){o=false;f=h}else if(u===92){s=true}else{throw new SyntaxError(`Unexpected character at index ${h}`)}}else if(u===34&&e.charCodeAt(h-1)===61){o=true}else if(f===-1&&n[u]===1){if(l===-1)l=h}else if(l!==-1&&(u===32||u===9)){if(f===-1)f=h}else if(u===59||u===44){if(l===-1){throw new SyntaxError(`Unexpected character at index ${h}`)}if(f===-1)f=h;let n=e.slice(l,f);if(i){n=n.replace(/\\/g,"");i=false}push(r,c,n);if(u===44){push(t,a,r);r=Object.create(null);a=undefined}c=undefined;l=f=-1}else{throw new SyntaxError(`Unexpected character at index ${h}`)}}}if(l===-1||o||u===32||u===9){throw new SyntaxError("Unexpected end of input")}if(f===-1)f=h;const d=e.slice(l,f);if(a===undefined){push(t,d,r)}else{if(c===undefined){push(r,d,true)}else if(i){push(r,c,d.replace(/\\/g,""))}else{push(r,c,d)}push(t,a,r)}return t}function format(e){return Object.keys(e).map((t=>{let r=e[t];if(!Array.isArray(r))r=[r];return r.map((e=>[t].concat(Object.keys(e).map((t=>{let r=e[t];if(!Array.isArray(r))r=[r];return r.map((e=>e===true?t:`${t}=${e}`)).join("; ")}))).join("; "))).join(", ")})).join(", ")}e.exports={format:format,parse:parse}},1356:e=>{"use strict";const t=Symbol("kDone");const r=Symbol("kRun");class Limiter{constructor(e){this[t]=()=>{this.pending--;this[r]()};this.concurrency=e||Infinity;this.jobs=[];this.pending=0}add(e){this.jobs.push(e);this[r]()}[r](){if(this.pending===this.concurrency)return;if(this.jobs.length){const e=this.jobs.shift();this.pending++;e(this[t])}}}e.exports=Limiter},6684:(e,t,r)=>{"use strict";const n=r(9796);const i=r(9436);const s=r(1356);const{kStatusCode:o}=r(5949);const a=Buffer[Symbol.species];const c=Buffer.from([0,0,255,255]);const l=Symbol("permessage-deflate");const u=Symbol("total-length");const f=Symbol("callback");const h=Symbol("buffers");const d=Symbol("error");let p;class PerMessageDeflate{constructor(e,t,r){this._maxPayload=r|0;this._options=e||{};this._threshold=this._options.threshold!==undefined?this._options.threshold:1024;this._isServer=!!t;this._deflate=null;this._inflate=null;this.params=null;if(!p){const e=this._options.concurrencyLimit!==undefined?this._options.concurrencyLimit:10;p=new s(e)}}static get extensionName(){return"permessage-deflate"}offer(){const e={};if(this._options.serverNoContextTakeover){e.server_no_context_takeover=true}if(this._options.clientNoContextTakeover){e.client_no_context_takeover=true}if(this._options.serverMaxWindowBits){e.server_max_window_bits=this._options.serverMaxWindowBits}if(this._options.clientMaxWindowBits){e.client_max_window_bits=this._options.clientMaxWindowBits}else if(this._options.clientMaxWindowBits==null){e.client_max_window_bits=true}return e}accept(e){e=this.normalizeParams(e);this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e);return this.params}cleanup(){if(this._inflate){this._inflate.close();this._inflate=null}if(this._deflate){const e=this._deflate[f];this._deflate.close();this._deflate=null;if(e){e(new Error("The deflate stream was closed while data was being processed"))}}}acceptAsServer(e){const t=this._options;const r=e.find((e=>{if(t.serverNoContextTakeover===false&&e.server_no_context_takeover||e.server_max_window_bits&&(t.serverMaxWindowBits===false||typeof t.serverMaxWindowBits==="number"&&t.serverMaxWindowBits>e.server_max_window_bits)||typeof t.clientMaxWindowBits==="number"&&!e.client_max_window_bits){return false}return true}));if(!r){throw new Error("None of the extension offers can be accepted")}if(t.serverNoContextTakeover){r.server_no_context_takeover=true}if(t.clientNoContextTakeover){r.client_no_context_takeover=true}if(typeof t.serverMaxWindowBits==="number"){r.server_max_window_bits=t.serverMaxWindowBits}if(typeof t.clientMaxWindowBits==="number"){r.client_max_window_bits=t.clientMaxWindowBits}else if(r.client_max_window_bits===true||t.clientMaxWindowBits===false){delete r.client_max_window_bits}return r}acceptAsClient(e){const t=e[0];if(this._options.clientNoContextTakeover===false&&t.client_no_context_takeover){throw new Error('Unexpected parameter "client_no_context_takeover"')}if(!t.client_max_window_bits){if(typeof this._options.clientMaxWindowBits==="number"){t.client_max_window_bits=this._options.clientMaxWindowBits}}else if(this._options.clientMaxWindowBits===false||typeof this._options.clientMaxWindowBits==="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits){throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}return t}normalizeParams(e){e.forEach((e=>{Object.keys(e).forEach((t=>{let r=e[t];if(r.length>1){throw new Error(`Parameter "${t}" must have only a single value`)}r=r[0];if(t==="client_max_window_bits"){if(r!==true){const e=+r;if(!Number.isInteger(e)||e<8||e>15){throw new TypeError(`Invalid value for parameter "${t}": ${r}`)}r=e}else if(!this._isServer){throw new TypeError(`Invalid value for parameter "${t}": ${r}`)}}else if(t==="server_max_window_bits"){const e=+r;if(!Number.isInteger(e)||e<8||e>15){throw new TypeError(`Invalid value for parameter "${t}": ${r}`)}r=e}else if(t==="client_no_context_takeover"||t==="server_no_context_takeover"){if(r!==true){throw new TypeError(`Invalid value for parameter "${t}": ${r}`)}}else{throw new Error(`Unknown parameter "${t}"`)}e[t]=r}))}));return e}decompress(e,t,r){p.add((n=>{this._decompress(e,t,((e,t)=>{n();r(e,t)}))}))}compress(e,t,r){p.add((n=>{this._compress(e,t,((e,t)=>{n();r(e,t)}))}))}_decompress(e,t,r){const s=this._isServer?"client":"server";if(!this._inflate){const e=`${s}_max_window_bits`;const t=typeof this.params[e]!=="number"?n.Z_DEFAULT_WINDOWBITS:this.params[e];this._inflate=n.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t});this._inflate[l]=this;this._inflate[u]=0;this._inflate[h]=[];this._inflate.on("error",inflateOnError);this._inflate.on("data",inflateOnData)}this._inflate[f]=r;this._inflate.write(e);if(t)this._inflate.write(c);this._inflate.flush((()=>{const e=this._inflate[d];if(e){this._inflate.close();this._inflate=null;r(e);return}const n=i.concat(this._inflate[h],this._inflate[u]);if(this._inflate._readableState.endEmitted){this._inflate.close();this._inflate=null}else{this._inflate[u]=0;this._inflate[h]=[];if(t&&this.params[`${s}_no_context_takeover`]){this._inflate.reset()}}r(null,n)}))}_compress(e,t,r){const s=this._isServer?"server":"client";if(!this._deflate){const e=`${s}_max_window_bits`;const t=typeof this.params[e]!=="number"?n.Z_DEFAULT_WINDOWBITS:this.params[e];this._deflate=n.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t});this._deflate[u]=0;this._deflate[h]=[];this._deflate.on("data",deflateOnData)}this._deflate[f]=r;this._deflate.write(e);this._deflate.flush(n.Z_SYNC_FLUSH,(()=>{if(!this._deflate){return}let e=i.concat(this._deflate[h],this._deflate[u]);if(t){e=new a(e.buffer,e.byteOffset,e.length-4)}this._deflate[f]=null;this._deflate[u]=0;this._deflate[h]=[];if(t&&this.params[`${s}_no_context_takeover`]){this._deflate.reset()}r(null,e)}))}}e.exports=PerMessageDeflate;function deflateOnData(e){this[h].push(e);this[u]+=e.length}function inflateOnData(e){this[u]+=e.length;if(this[l]._maxPayload<1||this[u]<=this[l]._maxPayload){this[h].push(e);return}this[d]=new RangeError("Max payload size exceeded");this[d].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH";this[d][o]=1009;this.removeListener("data",inflateOnData);this.reset()}function inflateOnError(e){this[l]._inflate=null;e[o]=1007;this[f](e)}},5066:(e,t,r)=>{"use strict";const{Writable:n}=r(2781);const i=r(6684);const{BINARY_TYPES:s,EMPTY_BUFFER:o,kStatusCode:a,kWebSocket:c}=r(5949);const{concat:l,toArrayBuffer:u,unmask:f}=r(9436);const{isValidStatusCode:h,isValidUTF8:d}=r(6279);const p=Buffer[Symbol.species];const m=Promise.resolve();const v=0;const _=1;const g=2;const y=3;const w=4;const b=5;const S=6;class Receiver extends n{constructor(e={}){super();this._binaryType=e.binaryType||s[0];this._extensions=e.extensions||{};this._isServer=!!e.isServer;this._maxPayload=e.maxPayload|0;this._skipUTF8Validation=!!e.skipUTF8Validation;this[c]=undefined;this._bufferedBytes=0;this._buffers=[];this._compressed=false;this._payloadLength=0;this._mask=undefined;this._fragmented=0;this._masked=false;this._fin=false;this._opcode=0;this._totalPayloadLength=0;this._messageLength=0;this._fragments=[];this._state=v;this._loop=false}_write(e,t,r){if(this._opcode===8&&this._state==v)return r();this._bufferedBytes+=e.length;this._buffers.push(e);this.startLoop(r)}consume(e){this._bufferedBytes-=e;if(e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){const t=this._buffers[0];this._buffers[0]=new p(t.buffer,t.byteOffset+e,t.length-e);return new p(t.buffer,t.byteOffset,e)}const t=Buffer.allocUnsafe(e);do{const r=this._buffers[0];const n=t.length-e;if(e>=r.length){t.set(this._buffers.shift(),n)}else{t.set(new Uint8Array(r.buffer,r.byteOffset,e),n);this._buffers[0]=new p(r.buffer,r.byteOffset+e,r.length-e)}e-=r.length}while(e>0);return t}startLoop(e){let t;this._loop=true;do{switch(this._state){case v:t=this.getInfo();break;case _:t=this.getPayloadLength16();break;case g:t=this.getPayloadLength64();break;case y:this.getMask();break;case w:t=this.getData(e);break;case b:this._loop=false;return;default:this._loop=false;m.then((()=>{this._state=v;this.startLoop(e)}));return}}while(this._loop);e(t)}getInfo(){if(this._bufferedBytes<2){this._loop=false;return}const e=this.consume(2);if((e[0]&48)!==0){this._loop=false;return error(RangeError,"RSV2 and RSV3 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_2_3")}const t=(e[0]&64)===64;if(t&&!this._extensions[i.extensionName]){this._loop=false;return error(RangeError,"RSV1 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_1")}this._fin=(e[0]&128)===128;this._opcode=e[0]&15;this._payloadLength=e[1]&127;if(this._opcode===0){if(t){this._loop=false;return error(RangeError,"RSV1 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_1")}if(!this._fragmented){this._loop=false;return error(RangeError,"invalid opcode 0",true,1002,"WS_ERR_INVALID_OPCODE")}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){this._loop=false;return error(RangeError,`invalid opcode ${this._opcode}`,true,1002,"WS_ERR_INVALID_OPCODE")}this._compressed=t}else if(this._opcode>7&&this._opcode<11){if(!this._fin){this._loop=false;return error(RangeError,"FIN must be set",true,1002,"WS_ERR_EXPECTED_FIN")}if(t){this._loop=false;return error(RangeError,"RSV1 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_1")}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){this._loop=false;return error(RangeError,`invalid payload length ${this._payloadLength}`,true,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}}else{this._loop=false;return error(RangeError,`invalid opcode ${this._opcode}`,true,1002,"WS_ERR_INVALID_OPCODE")}if(!this._fin&&!this._fragmented)this._fragmented=this._opcode;this._masked=(e[1]&128)===128;if(this._isServer){if(!this._masked){this._loop=false;return error(RangeError,"MASK must be set",true,1002,"WS_ERR_EXPECTED_MASK")}}else if(this._masked){this._loop=false;return error(RangeError,"MASK must be clear",true,1002,"WS_ERR_UNEXPECTED_MASK")}if(this._payloadLength===126)this._state=_;else if(this._payloadLength===127)this._state=g;else return this.haveLength()}getPayloadLength16(){if(this._bufferedBytes<2){this._loop=false;return}this._payloadLength=this.consume(2).readUInt16BE(0);return this.haveLength()}getPayloadLength64(){if(this._bufferedBytes<8){this._loop=false;return}const e=this.consume(8);const t=e.readUInt32BE(0);if(t>Math.pow(2,53-32)-1){this._loop=false;return error(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",false,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")}this._payloadLength=t*Math.pow(2,32)+e.readUInt32BE(4);return this.haveLength()}haveLength(){if(this._payloadLength&&this._opcode<8){this._totalPayloadLength+=this._payloadLength;if(this._totalPayloadLength>this._maxPayload&&this._maxPayload>0){this._loop=false;return error(RangeError,"Max payload size exceeded",false,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH")}}if(this._masked)this._state=y;else this._state=w}getMask(){if(this._bufferedBytes<4){this._loop=false;return}this._mask=this.consume(4);this._state=w}getData(e){let t=o;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=false;return}t=this.consume(this._payloadLength);if(this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0){f(t,this._mask)}}if(this._opcode>7)return this.controlMessage(t);if(this._compressed){this._state=b;this.decompress(t,e);return}if(t.length){this._messageLength=this._totalPayloadLength;this._fragments.push(t)}return this.dataMessage()}decompress(e,t){const r=this._extensions[i.extensionName];r.decompress(e,this._fin,((e,r)=>{if(e)return t(e);if(r.length){this._messageLength+=r.length;if(this._messageLength>this._maxPayload&&this._maxPayload>0){return t(error(RangeError,"Max payload size exceeded",false,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"))}this._fragments.push(r)}const n=this.dataMessage();if(n)return t(n);this.startLoop(t)}))}dataMessage(){if(this._fin){const e=this._messageLength;const t=this._fragments;this._totalPayloadLength=0;this._messageLength=0;this._fragmented=0;this._fragments=[];if(this._opcode===2){let r;if(this._binaryType==="nodebuffer"){r=l(t,e)}else if(this._binaryType==="arraybuffer"){r=u(l(t,e))}else{r=t}this.emit("message",r,true)}else{const r=l(t,e);if(!this._skipUTF8Validation&&!d(r)){this._loop=false;return error(Error,"invalid UTF-8 sequence",true,1007,"WS_ERR_INVALID_UTF8")}this.emit("message",r,false)}}this._state=S}controlMessage(e){if(this._opcode===8){this._loop=false;if(e.length===0){this.emit("conclude",1005,o);this.end();this._state=v}else{const t=e.readUInt16BE(0);if(!h(t)){return error(RangeError,`invalid status code ${t}`,true,1002,"WS_ERR_INVALID_CLOSE_CODE")}const r=new p(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!d(r)){return error(Error,"invalid UTF-8 sequence",true,1007,"WS_ERR_INVALID_UTF8")}this.emit("conclude",t,r);this.end();this._state=v}}else if(this._opcode===9){this.emit("ping",e);this._state=S}else{this.emit("pong",e);this._state=S}}}e.exports=Receiver;function error(e,t,r,n,i){const s=new e(r?`Invalid WebSocket frame: ${t}`:t);Error.captureStackTrace(s,error);s.code=i;s[a]=n;return s}},6947:(e,t,r)=>{"use strict";const{Duplex:n}=r(2781);const{randomFillSync:i}=r(6113);const s=r(6684);const{EMPTY_BUFFER:o}=r(5949);const{isValidStatusCode:a}=r(6279);const{mask:c,toBuffer:l}=r(9436);const u=Symbol("kByteLength");const f=Buffer.alloc(4);class Sender{constructor(e,t,r){this._extensions=t||{};if(r){this._generateMask=r;this._maskBuffer=Buffer.alloc(4)}this._socket=e;this._firstFragment=true;this._compress=false;this._bufferedBytes=0;this._deflating=false;this._queue=[]}static frame(e,t){let r;let n=false;let s=2;let o=false;if(t.mask){r=t.maskBuffer||f;if(t.generateMask){t.generateMask(r)}else{i(r,0,4)}o=(r[0]|r[1]|r[2]|r[3])===0;s=6}let a;if(typeof e==="string"){if((!t.mask||o)&&t[u]!==undefined){a=t[u]}else{e=Buffer.from(e);a=e.length}}else{a=e.length;n=t.mask&&t.readOnly&&!o}let l=a;if(a>=65536){s+=8;l=127}else if(a>125){s+=2;l=126}const h=Buffer.allocUnsafe(n?a+s:s);h[0]=t.fin?t.opcode|128:t.opcode;if(t.rsv1)h[0]|=64;h[1]=l;if(l===126){h.writeUInt16BE(a,2)}else if(l===127){h[2]=h[3]=0;h.writeUIntBE(a,4,6)}if(!t.mask)return[h,e];h[1]|=128;h[s-4]=r[0];h[s-3]=r[1];h[s-2]=r[2];h[s-1]=r[3];if(o)return[h,e];if(n){c(e,r,h,s,a);return[h]}c(e,r,e,0,a);return[h,e]}close(e,t,r,n){let i;if(e===undefined){i=o}else if(typeof e!=="number"||!a(e)){throw new TypeError("First argument must be a valid error code number")}else if(t===undefined||!t.length){i=Buffer.allocUnsafe(2);i.writeUInt16BE(e,0)}else{const r=Buffer.byteLength(t);if(r>123){throw new RangeError("The message must not be greater than 123 bytes")}i=Buffer.allocUnsafe(2+r);i.writeUInt16BE(e,0);if(typeof t==="string"){i.write(t,2)}else{i.set(t,2)}}const s={[u]:i.length,fin:true,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:false,rsv1:false};if(this._deflating){this.enqueue([this.dispatch,i,false,s,n])}else{this.sendFrame(Sender.frame(i,s),n)}}ping(e,t,r){let n;let i;if(typeof e==="string"){n=Buffer.byteLength(e);i=false}else{e=l(e);n=e.length;i=l.readOnly}if(n>125){throw new RangeError("The data size must not be greater than 125 bytes")}const s={[u]:n,fin:true,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:i,rsv1:false};if(this._deflating){this.enqueue([this.dispatch,e,false,s,r])}else{this.sendFrame(Sender.frame(e,s),r)}}pong(e,t,r){let n;let i;if(typeof e==="string"){n=Buffer.byteLength(e);i=false}else{e=l(e);n=e.length;i=l.readOnly}if(n>125){throw new RangeError("The data size must not be greater than 125 bytes")}const s={[u]:n,fin:true,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:i,rsv1:false};if(this._deflating){this.enqueue([this.dispatch,e,false,s,r])}else{this.sendFrame(Sender.frame(e,s),r)}}send(e,t,r){const n=this._extensions[s.extensionName];let i=t.binary?2:1;let o=t.compress;let a;let c;if(typeof e==="string"){a=Buffer.byteLength(e);c=false}else{e=l(e);a=e.length;c=l.readOnly}if(this._firstFragment){this._firstFragment=false;if(o&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]){o=a>=n._threshold}this._compress=o}else{o=false;i=0}if(t.fin)this._firstFragment=true;if(n){const n={[u]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:c,rsv1:o};if(this._deflating){this.enqueue([this.dispatch,e,this._compress,n,r])}else{this.dispatch(e,this._compress,n,r)}}else{this.sendFrame(Sender.frame(e,{[u]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:c,rsv1:false}),r)}}dispatch(e,t,r,n){if(!t){this.sendFrame(Sender.frame(e,r),n);return}const i=this._extensions[s.extensionName];this._bufferedBytes+=r[u];this._deflating=true;i.compress(e,r.fin,((e,t)=>{if(this._socket.destroyed){const e=new Error("The socket was closed while data was being compressed");if(typeof n==="function")n(e);for(let t=0;t<this._queue.length;t++){const r=this._queue[t];const n=r[r.length-1];if(typeof n==="function")n(e)}return}this._bufferedBytes-=r[u];this._deflating=false;r.readOnly=false;this.sendFrame(Sender.frame(t,r),n);this.dequeue()}))}dequeue(){while(!this._deflating&&this._queue.length){const e=this._queue.shift();this._bufferedBytes-=e[3][u];Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][u];this._queue.push(e)}sendFrame(e,t){if(e.length===2){this._socket.cork();this._socket.write(e[0]);this._socket.write(e[1],t);this._socket.uncork()}else{this._socket.write(e[0],t)}}}e.exports=Sender},1658:(e,t,r)=>{"use strict";const{Duplex:n}=r(2781);function emitClose(e){e.emit("close")}function duplexOnEnd(){if(!this.destroyed&&this._writableState.finished){this.destroy()}}function duplexOnError(e){this.removeListener("error",duplexOnError);this.destroy();if(this.listenerCount("error")===0){this.emit("error",e)}}function createWebSocketStream(e,t){let r=true;const i=new n({...t,autoDestroy:false,emitClose:false,objectMode:false,writableObjectMode:false});e.on("message",(function message(t,r){const n=!r&&i._readableState.objectMode?t.toString():t;if(!i.push(n))e.pause()}));e.once("error",(function error(e){if(i.destroyed)return;r=false;i.destroy(e)}));e.once("close",(function close(){if(i.destroyed)return;i.push(null)}));i._destroy=function(t,n){if(e.readyState===e.CLOSED){n(t);process.nextTick(emitClose,i);return}let s=false;e.once("error",(function error(e){s=true;n(e)}));e.once("close",(function close(){if(!s)n(t);process.nextTick(emitClose,i)}));if(r)e.terminate()};i._final=function(t){if(e.readyState===e.CONNECTING){e.once("open",(function open(){i._final(t)}));return}if(e._socket===null)return;if(e._socket._writableState.finished){t();if(i._readableState.endEmitted)i.destroy()}else{e._socket.once("finish",(function finish(){t()}));e.close()}};i._read=function(){if(e.isPaused)e.resume()};i._write=function(t,r,n){if(e.readyState===e.CONNECTING){e.once("open",(function open(){i._write(t,r,n)}));return}e.send(t,n)};i.on("end",duplexOnEnd);i.on("error",duplexOnError);return i}e.exports=createWebSocketStream},6668:(e,t,r)=>{"use strict";const{tokenChars:n}=r(6279);function parse(e){const t=new Set;let r=-1;let i=-1;let s=0;for(s;s<e.length;s++){const o=e.charCodeAt(s);if(i===-1&&n[o]===1){if(r===-1)r=s}else if(s!==0&&(o===32||o===9)){if(i===-1&&r!==-1)i=s}else if(o===44){if(r===-1){throw new SyntaxError(`Unexpected character at index ${s}`)}if(i===-1)i=s;const n=e.slice(r,i);if(t.has(n)){throw new SyntaxError(`The "${n}" subprotocol is duplicated`)}t.add(n);r=i=-1}else{throw new SyntaxError(`Unexpected character at index ${s}`)}}if(r===-1||i!==-1){throw new SyntaxError("Unexpected end of input")}const o=e.slice(r,s);if(t.has(o)){throw new SyntaxError(`The "${o}" subprotocol is duplicated`)}t.add(o);return t}e.exports={parse:parse}},6279:(e,t,r)=>{"use strict";const{isUtf8:n}=r(4300);const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function isValidStatusCode(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function _isValidUTF8(e){const t=e.length;let r=0;while(r<t){if((e[r]&128)===0){r++}else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192){return false}r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160){return false}r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244){return false}r+=4}else{return false}}return true}e.exports={isValidStatusCode:isValidStatusCode,isValidUTF8:_isValidUTF8,tokenChars:i};if(n){e.exports.isValidUTF8=function(e){return e.length<24?_isValidUTF8(e):n(e)}}else if(!process.env.WS_NO_UTF_8_VALIDATE){try{const t=r(4592);e.exports.isValidUTF8=function(e){return e.length<32?_isValidUTF8(e):t(e)}}catch(e){}}},8887:(e,t,r)=>{"use strict";const n=r(2361);const i=r(3685);const{Duplex:s}=r(2781);const{createHash:o}=r(6113);const a=r(2035);const c=r(6684);const l=r(6668);const u=r(1518);const{GUID:f,kWebSocket:h}=r(5949);const d=/^[+/0-9A-Za-z]{22}==$/;const p=0;const m=1;const v=2;class WebSocketServer extends n{constructor(e,t){super();e={maxPayload:100*1024*1024,skipUTF8Validation:false,perMessageDeflate:false,handleProtocols:null,clientTracking:true,verifyClient:null,noServer:false,backlog:null,server:null,host:null,path:null,port:null,WebSocket:u,...e};if(e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer){throw new TypeError('One and only one of the "port", "server", or "noServer" options '+"must be specified")}if(e.port!=null){this._server=i.createServer(((e,t)=>{const r=i.STATUS_CODES[426];t.writeHead(426,{"Content-Length":r.length,"Content-Type":"text/plain"});t.end(r)}));this._server.listen(e.port,e.host,e.backlog,t)}else if(e.server){this._server=e.server}if(this._server){const e=this.emit.bind(this,"connection");this._removeListeners=addListeners(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(t,r,n)=>{this.handleUpgrade(t,r,n,e)}})}if(e.perMessageDeflate===true)e.perMessageDeflate={};if(e.clientTracking){this.clients=new Set;this._shouldEmitClose=false}this.options=e;this._state=p}address(){if(this.options.noServer){throw new Error('The server is operating in "noServer" mode')}if(!this._server)return null;return this._server.address()}close(e){if(this._state===v){if(e){this.once("close",(()=>{e(new Error("The server is not running"))}))}process.nextTick(emitClose,this);return}if(e)this.once("close",e);if(this._state===m)return;this._state=m;if(this.options.noServer||this.options.server){if(this._server){this._removeListeners();this._removeListeners=this._server=null}if(this.clients){if(!this.clients.size){process.nextTick(emitClose,this)}else{this._shouldEmitClose=true}}else{process.nextTick(emitClose,this)}}else{const e=this._server;this._removeListeners();this._removeListeners=this._server=null;e.close((()=>{emitClose(this)}))}}shouldHandle(e){if(this.options.path){const t=e.url.indexOf("?");const r=t!==-1?e.url.slice(0,t):e.url;if(r!==this.options.path)return false}return true}handleUpgrade(e,t,r,n){t.on("error",socketOnError);const i=e.headers["sec-websocket-key"];const s=+e.headers["sec-websocket-version"];if(e.method!=="GET"){const r="Invalid HTTP method";abortHandshakeOrEmitwsClientError(this,e,t,405,r);return}if(e.headers.upgrade.toLowerCase()!=="websocket"){const r="Invalid Upgrade header";abortHandshakeOrEmitwsClientError(this,e,t,400,r);return}if(!i||!d.test(i)){const r="Missing or invalid Sec-WebSocket-Key header";abortHandshakeOrEmitwsClientError(this,e,t,400,r);return}if(s!==8&&s!==13){const r="Missing or invalid Sec-WebSocket-Version header";abortHandshakeOrEmitwsClientError(this,e,t,400,r);return}if(!this.shouldHandle(e)){abortHandshake(t,400);return}const o=e.headers["sec-websocket-protocol"];let u=new Set;if(o!==undefined){try{u=l.parse(o)}catch(r){const n="Invalid Sec-WebSocket-Protocol header";abortHandshakeOrEmitwsClientError(this,e,t,400,n);return}}const f=e.headers["sec-websocket-extensions"];const h={};if(this.options.perMessageDeflate&&f!==undefined){const r=new c(this.options.perMessageDeflate,true,this.options.maxPayload);try{const e=a.parse(f);if(e[c.extensionName]){r.accept(e[c.extensionName]);h[c.extensionName]=r}}catch(r){const n="Invalid or unacceptable Sec-WebSocket-Extensions header";abortHandshakeOrEmitwsClientError(this,e,t,400,n);return}}if(this.options.verifyClient){const o={origin:e.headers[`${s===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(o,((s,o,a,c)=>{if(!s){return abortHandshake(t,o||401,a,c)}this.completeUpgrade(h,i,u,e,t,r,n)}));return}if(!this.options.verifyClient(o))return abortHandshake(t,401)}this.completeUpgrade(h,i,u,e,t,r,n)}completeUpgrade(e,t,r,n,i,s,l){if(!i.readable||!i.writable)return i.destroy();if(i[h]){throw new Error("server.handleUpgrade() was called more than once with the same "+"socket, possibly due to a misconfiguration")}if(this._state>p)return abortHandshake(i,503);const u=o("sha1").update(t+f).digest("base64");const d=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${u}`];const m=new this.options.WebSocket(null);if(r.size){const e=this.options.handleProtocols?this.options.handleProtocols(r,n):r.values().next().value;if(e){d.push(`Sec-WebSocket-Protocol: ${e}`);m._protocol=e}}if(e[c.extensionName]){const t=e[c.extensionName].params;const r=a.format({[c.extensionName]:[t]});d.push(`Sec-WebSocket-Extensions: ${r}`);m._extensions=e}this.emit("headers",d,n);i.write(d.concat("\r\n").join("\r\n"));i.removeListener("error",socketOnError);m.setSocket(i,s,{maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation});if(this.clients){this.clients.add(m);m.on("close",(()=>{this.clients.delete(m);if(this._shouldEmitClose&&!this.clients.size){process.nextTick(emitClose,this)}}))}l(m,n)}}e.exports=WebSocketServer;function addListeners(e,t){for(const r of Object.keys(t))e.on(r,t[r]);return function removeListeners(){for(const r of Object.keys(t)){e.removeListener(r,t[r])}}}function emitClose(e){e._state=v;e.emit("close")}function socketOnError(){this.destroy()}function abortHandshake(e,t,r,n){r=r||i.STATUS_CODES[t];n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...n};e.once("finish",e.destroy);e.end(`HTTP/1.1 ${t} ${i.STATUS_CODES[t]}\r\n`+Object.keys(n).map((e=>`${e}: ${n[e]}`)).join("\r\n")+"\r\n\r\n"+r)}function abortHandshakeOrEmitwsClientError(e,t,r,n,i){if(e.listenerCount("wsClientError")){const n=new Error(i);Error.captureStackTrace(n,abortHandshakeOrEmitwsClientError);e.emit("wsClientError",n,r,t)}else{abortHandshake(r,n,i)}}},1518:(e,t,r)=>{"use strict";const n=r(2361);const i=r(5687);const s=r(3685);const o=r(1808);const a=r(4404);const{randomBytes:c,createHash:l}=r(6113);const{Duplex:u,Readable:f}=r(2781);const{URL:h}=r(7310);const d=r(6684);const p=r(5066);const m=r(6947);const{BINARY_TYPES:v,EMPTY_BUFFER:_,GUID:g,kForOnEventAttribute:y,kListener:w,kStatusCode:b,kWebSocket:S,NOOP:E}=r(5949);const{EventTarget:{addEventListener:x,removeEventListener:A}}=r(4561);const{format:k,parse:C}=r(2035);const{toBuffer:R}=r(9436);const O=30*1e3;const T=Symbol("kAborted");const I=[8,13];const P=["CONNECTING","OPEN","CLOSING","CLOSED"];const L=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class WebSocket extends n{constructor(e,t,r){super();this._binaryType=v[0];this._closeCode=1006;this._closeFrameReceived=false;this._closeFrameSent=false;this._closeMessage=_;this._closeTimer=null;this._extensions={};this._paused=false;this._protocol="";this._readyState=WebSocket.CONNECTING;this._receiver=null;this._sender=null;this._socket=null;if(e!==null){this._bufferedAmount=0;this._isServer=false;this._redirects=0;if(t===undefined){t=[]}else if(!Array.isArray(t)){if(typeof t==="object"&&t!==null){r=t;t=[]}else{t=[t]}}initAsClient(this,e,t,r)}else{this._isServer=true}}get binaryType(){return this._binaryType}set binaryType(e){if(!v.includes(e))return;this._binaryType=e;if(this._receiver)this._receiver._binaryType=e}get bufferedAmount(){if(!this._socket)return this._bufferedAmount;return this._socket._writableState.length+this._sender._bufferedBytes}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,r){const n=new p({binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation});this._sender=new m(e,this._extensions,r.generateMask);this._receiver=n;this._socket=e;n[S]=this;e[S]=this;n.on("conclude",receiverOnConclude);n.on("drain",receiverOnDrain);n.on("error",receiverOnError);n.on("message",receiverOnMessage);n.on("ping",receiverOnPing);n.on("pong",receiverOnPong);if(e.setTimeout)e.setTimeout(0);if(e.setNoDelay)e.setNoDelay();if(t.length>0)e.unshift(t);e.on("close",socketOnClose);e.on("data",socketOnData);e.on("end",socketOnEnd);e.on("error",socketOnError);this._readyState=WebSocket.OPEN;this.emit("open")}emitClose(){if(!this._socket){this._readyState=WebSocket.CLOSED;this.emit("close",this._closeCode,this._closeMessage);return}if(this._extensions[d.extensionName]){this._extensions[d.extensionName].cleanup()}this._receiver.removeAllListeners();this._readyState=WebSocket.CLOSED;this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState===WebSocket.CLOSED)return;if(this.readyState===WebSocket.CONNECTING){const e="WebSocket was closed before the connection was established";abortHandshake(this,this._req,e);return}if(this.readyState===WebSocket.CLOSING){if(this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)){this._socket.end()}return}this._readyState=WebSocket.CLOSING;this._sender.close(e,t,!this._isServer,(e=>{if(e)return;this._closeFrameSent=true;if(this._closeFrameReceived||this._receiver._writableState.errorEmitted){this._socket.end()}}));this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),O)}pause(){if(this.readyState===WebSocket.CONNECTING||this.readyState===WebSocket.CLOSED){return}this._paused=true;this._socket.pause()}ping(e,t,r){if(this.readyState===WebSocket.CONNECTING){throw new Error("WebSocket is not open: readyState 0 (CONNECTING)")}if(typeof e==="function"){r=e;e=t=undefined}else if(typeof t==="function"){r=t;t=undefined}if(typeof e==="number")e=e.toString();if(this.readyState!==WebSocket.OPEN){sendAfterClose(this,e,r);return}if(t===undefined)t=!this._isServer;this._sender.ping(e||_,t,r)}pong(e,t,r){if(this.readyState===WebSocket.CONNECTING){throw new Error("WebSocket is not open: readyState 0 (CONNECTING)")}if(typeof e==="function"){r=e;e=t=undefined}else if(typeof t==="function"){r=t;t=undefined}if(typeof e==="number")e=e.toString();if(this.readyState!==WebSocket.OPEN){sendAfterClose(this,e,r);return}if(t===undefined)t=!this._isServer;this._sender.pong(e||_,t,r)}resume(){if(this.readyState===WebSocket.CONNECTING||this.readyState===WebSocket.CLOSED){return}this._paused=false;if(!this._receiver._writableState.needDrain)this._socket.resume()}send(e,t,r){if(this.readyState===WebSocket.CONNECTING){throw new Error("WebSocket is not open: readyState 0 (CONNECTING)")}if(typeof t==="function"){r=t;t={}}if(typeof e==="number")e=e.toString();if(this.readyState!==WebSocket.OPEN){sendAfterClose(this,e,r);return}const n={binary:typeof e!=="string",mask:!this._isServer,compress:true,fin:true,...t};if(!this._extensions[d.extensionName]){n.compress=false}this._sender.send(e||_,n,r)}terminate(){if(this.readyState===WebSocket.CLOSED)return;if(this.readyState===WebSocket.CONNECTING){const e="WebSocket was closed before the connection was established";abortHandshake(this,this._req,e);return}if(this._socket){this._readyState=WebSocket.CLOSING;this._socket.destroy()}}}Object.defineProperty(WebSocket,"CONNECTING",{enumerable:true,value:P.indexOf("CONNECTING")});Object.defineProperty(WebSocket.prototype,"CONNECTING",{enumerable:true,value:P.indexOf("CONNECTING")});Object.defineProperty(WebSocket,"OPEN",{enumerable:true,value:P.indexOf("OPEN")});Object.defineProperty(WebSocket.prototype,"OPEN",{enumerable:true,value:P.indexOf("OPEN")});Object.defineProperty(WebSocket,"CLOSING",{enumerable:true,value:P.indexOf("CLOSING")});Object.defineProperty(WebSocket.prototype,"CLOSING",{enumerable:true,value:P.indexOf("CLOSING")});Object.defineProperty(WebSocket,"CLOSED",{enumerable:true,value:P.indexOf("CLOSED")});Object.defineProperty(WebSocket.prototype,"CLOSED",{enumerable:true,value:P.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach((e=>{Object.defineProperty(WebSocket.prototype,e,{enumerable:true})}));["open","error","close","message"].forEach((e=>{Object.defineProperty(WebSocket.prototype,`on${e}`,{enumerable:true,get(){for(const t of this.listeners(e)){if(t[y])return t[w]}return null},set(t){for(const t of this.listeners(e)){if(t[y]){this.removeListener(e,t);break}}if(typeof t!=="function")return;this.addEventListener(e,t,{[y]:true})}})}));WebSocket.prototype.addEventListener=x;WebSocket.prototype.removeEventListener=A;e.exports=WebSocket;function initAsClient(e,t,r,n){const o={protocolVersion:I[1],maxPayload:100*1024*1024,skipUTF8Validation:false,perMessageDeflate:true,followRedirects:false,maxRedirects:10,...n,createConnection:undefined,socketPath:undefined,hostname:undefined,protocol:undefined,timeout:undefined,method:"GET",host:undefined,path:undefined,port:undefined};if(!I.includes(o.protocolVersion)){throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} `+`(supported versions: ${I.join(", ")})`)}let a;if(t instanceof h){a=t}else{try{a=new h(t)}catch(e){throw new SyntaxError(`Invalid URL: ${t}`)}}if(a.protocol==="http:"){a.protocol="ws:"}else if(a.protocol==="https:"){a.protocol="wss:"}e._url=a.href;const u=a.protocol==="wss:";const f=a.protocol==="ws+unix:";let p;if(a.protocol!=="ws:"&&!u&&!f){p='The URL\'s protocol must be one of "ws:", "wss:", '+'"http:", "https", or "ws+unix:"'}else if(f&&!a.pathname){p="The URL's pathname is empty"}else if(a.hash){p="The URL contains a fragment identifier"}if(p){const t=new SyntaxError(p);if(e._redirects===0){throw t}else{emitErrorAndClose(e,t);return}}const m=u?443:80;const v=c(16).toString("base64");const _=u?i.request:s.request;const y=new Set;let w;o.createConnection=u?tlsConnect:netConnect;o.defaultPort=o.defaultPort||m;o.port=a.port||m;o.host=a.hostname.startsWith("[")?a.hostname.slice(1,-1):a.hostname;o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":v,Connection:"Upgrade",Upgrade:"websocket"};o.path=a.pathname+a.search;o.timeout=o.handshakeTimeout;if(o.perMessageDeflate){w=new d(o.perMessageDeflate!==true?o.perMessageDeflate:{},false,o.maxPayload);o.headers["Sec-WebSocket-Extensions"]=k({[d.extensionName]:w.offer()})}if(r.length){for(const e of r){if(typeof e!=="string"||!L.test(e)||y.has(e)){throw new SyntaxError("An invalid or duplicated subprotocol was specified")}y.add(e)}o.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(o.origin){if(o.protocolVersion<13){o.headers["Sec-WebSocket-Origin"]=o.origin}else{o.headers.Origin=o.origin}}if(a.username||a.password){o.auth=`${a.username}:${a.password}`}if(f){const e=o.path.split(":");o.socketPath=e[0];o.path=e[1]}let b;if(o.followRedirects){if(e._redirects===0){e._originalIpc=f;e._originalSecure=u;e._originalHostOrSocketPath=f?o.socketPath:a.host;const t=n&&n.headers;n={...n,headers:{}};if(t){for(const[e,r]of Object.entries(t)){n.headers[e.toLowerCase()]=r}}}else if(e.listenerCount("redirect")===0){const t=f?e._originalIpc?o.socketPath===e._originalHostOrSocketPath:false:e._originalIpc?false:a.host===e._originalHostOrSocketPath;if(!t||e._originalSecure&&!u){delete o.headers.authorization;delete o.headers.cookie;if(!t)delete o.headers.host;o.auth=undefined}}if(o.auth&&!n.headers.authorization){n.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64")}b=e._req=_(o);if(e._redirects){e.emit("redirect",e.url,b)}}else{b=e._req=_(o)}if(o.timeout){b.on("timeout",(()=>{abortHandshake(e,b,"Opening handshake has timed out")}))}b.on("error",(t=>{if(b===null||b[T])return;b=e._req=null;emitErrorAndClose(e,t)}));b.on("response",(i=>{const s=i.headers.location;const a=i.statusCode;if(s&&o.followRedirects&&a>=300&&a<400){if(++e._redirects>o.maxRedirects){abortHandshake(e,b,"Maximum redirects exceeded");return}b.abort();let i;try{i=new h(s,t)}catch(t){const r=new SyntaxError(`Invalid URL: ${s}`);emitErrorAndClose(e,r);return}initAsClient(e,i,r,n)}else if(!e.emit("unexpected-response",b,i)){abortHandshake(e,b,`Unexpected server response: ${i.statusCode}`)}}));b.on("upgrade",((t,r,n)=>{e.emit("upgrade",t);if(e.readyState!==WebSocket.CONNECTING)return;b=e._req=null;if(t.headers.upgrade.toLowerCase()!=="websocket"){abortHandshake(e,r,"Invalid Upgrade header");return}const i=l("sha1").update(v+g).digest("base64");if(t.headers["sec-websocket-accept"]!==i){abortHandshake(e,r,"Invalid Sec-WebSocket-Accept header");return}const s=t.headers["sec-websocket-protocol"];let a;if(s!==undefined){if(!y.size){a="Server sent a subprotocol but none was requested"}else if(!y.has(s)){a="Server sent an invalid subprotocol"}}else if(y.size){a="Server sent no subprotocol"}if(a){abortHandshake(e,r,a);return}if(s)e._protocol=s;const c=t.headers["sec-websocket-extensions"];if(c!==undefined){if(!w){const t="Server sent a Sec-WebSocket-Extensions header but no extension "+"was requested";abortHandshake(e,r,t);return}let t;try{t=C(c)}catch(t){const n="Invalid Sec-WebSocket-Extensions header";abortHandshake(e,r,n);return}const n=Object.keys(t);if(n.length!==1||n[0]!==d.extensionName){const t="Server indicated an extension that was not requested";abortHandshake(e,r,t);return}try{w.accept(t[d.extensionName])}catch(t){const n="Invalid Sec-WebSocket-Extensions header";abortHandshake(e,r,n);return}e._extensions[d.extensionName]=w}e.setSocket(r,n,{generateMask:o.generateMask,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})}));if(o.finishRequest){o.finishRequest(b,e)}else{b.end()}}function emitErrorAndClose(e,t){e._readyState=WebSocket.CLOSING;e.emit("error",t);e.emitClose()}function netConnect(e){e.path=e.socketPath;return o.connect(e)}function tlsConnect(e){e.path=undefined;if(!e.servername&&e.servername!==""){e.servername=o.isIP(e.host)?"":e.host}return a.connect(e)}function abortHandshake(e,t,r){e._readyState=WebSocket.CLOSING;const n=new Error(r);Error.captureStackTrace(n,abortHandshake);if(t.setHeader){t[T]=true;t.abort();if(t.socket&&!t.socket.destroyed){t.socket.destroy()}process.nextTick(emitErrorAndClose,e,n)}else{t.destroy(n);t.once("error",e.emit.bind(e,"error"));t.once("close",e.emitClose.bind(e))}}function sendAfterClose(e,t,r){if(t){const r=R(t).length;if(e._socket)e._sender._bufferedBytes+=r;else e._bufferedAmount+=r}if(r){const t=new Error(`WebSocket is not open: readyState ${e.readyState} `+`(${P[e.readyState]})`);process.nextTick(r,t)}}function receiverOnConclude(e,t){const r=this[S];r._closeFrameReceived=true;r._closeMessage=t;r._closeCode=e;if(r._socket[S]===undefined)return;r._socket.removeListener("data",socketOnData);process.nextTick(resume,r._socket);if(e===1005)r.close();else r.close(e,t)}function receiverOnDrain(){const e=this[S];if(!e.isPaused)e._socket.resume()}function receiverOnError(e){const t=this[S];if(t._socket[S]!==undefined){t._socket.removeListener("data",socketOnData);process.nextTick(resume,t._socket);t.close(e[b])}t.emit("error",e)}function receiverOnFinish(){this[S].emitClose()}function receiverOnMessage(e,t){this[S].emit("message",e,t)}function receiverOnPing(e){const t=this[S];t.pong(e,!t._isServer,E);t.emit("ping",e)}function receiverOnPong(e){this[S].emit("pong",e)}function resume(e){e.resume()}function socketOnClose(){const e=this[S];this.removeListener("close",socketOnClose);this.removeListener("data",socketOnData);this.removeListener("end",socketOnEnd);e._readyState=WebSocket.CLOSING;let t;if(!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&(t=e._socket.read())!==null){e._receiver.write(t)}e._receiver.end();this[S]=undefined;clearTimeout(e._closeTimer);if(e._receiver._writableState.finished||e._receiver._writableState.errorEmitted){e.emitClose()}else{e._receiver.on("error",receiverOnFinish);e._receiver.on("finish",receiverOnFinish)}}function socketOnData(e){if(!this[S]._receiver.write(e)){this.pause()}}function socketOnEnd(){const e=this[S];e._readyState=WebSocket.CLOSING;e._receiver.end();this.end()}function socketOnError(){const e=this[S];this.removeListener("error",socketOnError);this.on("error",E);if(e){e._readyState=WebSocket.CLOSING;this.destroy()}}},1529:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.helmChartModifiedEvent=void 0;const i=n(r(2361));t.helmChartModifiedEvent=new i.default},5020:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.computeSources=t.computeTemplated=t.computeChart=void 0;const s=r(6113);const o=r(798);const a=r(7147);const c=i(r(1917));const l=r(1017);const u=r(2037);function computeChart(e,t,r=[]){return n(this,void 0,void 0,(function*(){let n;if(r.length===0){({stdout:n}=yield(0,o.$)`helm template --name-template ${t} ${e}`)}else if(r.length===1){({stdout:n}=yield(0,o.$)`helm template --name-template ${t} ${e} --values ${r.at(0)}`)}else if(r.length===2){({stdout:n}=yield(0,o.$)`helm template --name-template ${t} ${e} --values ${r.at(0)} --values ${r.at(1)}`)}const{templated:i}=yield computeTemplated(n);const{sources:s}=yield computeSources(n,e);const{version:a,name:l}=c.default.load(s["Chart.yaml"]);return{name:l,version:a,templated:i,sources:s}}))}t.computeChart=computeChart;function computeTemplated(e){var t;return n(this,void 0,void 0,(function*(){const r={templated:{}};const n=e.split("---");for(const e of n){const n=c.default.load(e);if(n){if(!r["templated"][n.kind]){r["templated"][n.kind]={}}r["templated"][n.kind][(t=n===null||n===void 0?void 0:n.metadata)===null||t===void 0?void 0:t.name.replaceAll("-","_")]=e}}return r}))}t.computeTemplated=computeTemplated;function computeSources(e,t){var r;return n(this,void 0,void 0,(function*(){const n=`${(0,u.tmpdir)()}/${(0,s.randomUUID)()}`;(0,a.mkdirSync)(n,{recursive:true});(0,a.mkdirSync)(`${n}/sources`,{recursive:true});(0,a.mkdirSync)(`${n}/templated`,{recursive:true});const i={sources:{}};const o=e.split("---");for(const e of o){const t=c.default.load(e);if(t){const i=t.kind+"_"+((r=t===null||t===void 0?void 0:t.metadata)===null||r===void 0?void 0:r.name.replaceAll("-","_"));(0,a.writeFileSync)(`${n}/templated/${i}.yaml`,e)}}const f=(0,a.readdirSync)(t);for(const e of f.filter((e=>!e.includes("tgz")))){const r=(0,l.join)(t,e);if(!(0,a.statSync)(r).isDirectory()){const t=(0,a.readFileSync)(r);i["sources"][e]=String(t)}}return i}))}t.computeSources=computeSources},7017:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.decrypt=t.encrypt=void 0;const i=n(r(4134));function encrypt(e,t){return i.default.AES.encrypt(e,t).toString()}t.encrypt=encrypt;function decrypt(e,t){const r=i.default.AES.decrypt(e,t);return r.toString(i.default.enc.Utf8)}t.decrypt=decrypt},7893:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.watchHelmChartFilesModifications=void 0;const s=i(r(2677));const o=r(1529);function watchHelmChartFilesModifications(e){return n(this,void 0,void 0,(function*(){s.default.watch(e).on("all",((e,t)=>{o.helmChartModifiedEvent.emit("changed",t)}))}))}t.watchHelmChartFilesModifications=watchHelmChartFilesModifications},2620:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.isChartFolder=void 0;const i=n(r(7561));function isChartFolder(e){const t=i.default.readdirSync(e);return t.includes("Chart.yaml")}t.isChartFolder=isChartFolder},6601:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getArguments=void 0;const n=r(6005);const i=r(7261);function getArguments(){return(0,i.parseArgs)({options:{watch:{type:"boolean",short:"w",default:false},push:{type:"boolean",short:"p",default:false},encryptionKey:{type:"string",short:"k",default:(0,n.randomUUID)()},browser:{type:"string",short:"b",default:"default"},values:{type:"string",short:"v",multiple:true,default:[]},help:{type:"boolean",short:"h",default:false},name:{type:"string",short:"n",default:"release-name"}},allowPositionals:true})}t.getArguments=getArguments},8597:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.serverFileTemporary=void 0;const i=n(r(3685));const s=n(r(385));function serverFileTemporary(e,t){return new Promise((r=>{const n=i.default.createServer(((i,o)=>{const a={"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"OPTIONS, POST, GET"};if(i.method==="OPTIONS"){o.writeHead(200,a);o.end();return}o.writeHead(200,a);o.end(JSON.stringify(e),"utf-8");console.log(s.default.cyanBright(`Closing server on port ${t}...`));n.close((()=>{r(undefined)}));setTimeout((()=>{n.emit("close")}),100)}));n.listen(t)}))}t.serverFileTemporary=serverFileTemporary},5989:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.startWebsocketServer=void 0;const s=i(r(385));const o=r(8867);const a=r(1529);const c=r(5020);function startWebsocketServer(e,t){const r=new o.WebSocketServer({port:12096});console.log(s.default.cyanBright(`⚡️ Web socket started on 12096`));console.log(s.default.cyanBright(`Don't touch this terminal anymore and see your chart change directly in the browser`));r.on("connection",(function connection(r){r.on("error",console.error);a.helmChartModifiedEvent.addListener("changed",(i=>n(this,void 0,void 0,(function*(){try{const n=yield(0,c.computeChart)(e,t);r.send(JSON.stringify({filePath:i,chartContentUpdated:n,error:null}))}catch(e){r.send(JSON.stringify({filePath:null,chartContentUpdated:null,error:e.stderr}))}}))))}))}t.startWebsocketServer=startWebsocketServer},6144:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const s=r(2620);const o=r(7147);const a=r(6113);const c=i(r(385));const l=r(2037);const u=r(8597);const f=i(r(5768));const h=i(r(1917));const d=r(7017);const p=i(r(7147));const m=r(5989);const v=r(7893);const _=r(6601);const g=r(5020);const y=process.env.NODE_ENV==="development"?"http://localhost:3000":"https://helm-viewer.vercel.app";function run(){var e,t;return n(this,void 0,void 0,(function*(){const r=(0,_.getArguments)();if(r.values.help){console.log(`\nhelm-viewer v0.7.4\n\n -b/--browser: allow to open with a specific browser (firefox, chromium)\n -h/--help: displays this menu\n -k/--encryptionKey: specify the encryption key\n -n/--name: provide a release name to Helm\n -p/--push: push the result of the build online and returns an URL\n -v/--values: provide values files for the chart, can be provided several times\n -w/--watch: activate the watch mode\n\n # When you are in a chart helm folder\n helm-viewer\n \n # To target a specific path\n helm-viewer path/of/the/chart\n \n # To compute the chart with an external values file\n helm-viewer path/of/the/chart --values path/of/the/values/file1 --values path/of/the/values/file2\n \n # To get a public link (with encrypted data)\n helm-viewer path/of/the/chart --push\n `);process.exit(0)}const n=(e=r.positionals.at(0))!==null&&e!==void 0?e:process.cwd();const i=r.values.values;console.log(c.default.cyanBright(`⚡️ Path detected ${n}`));console.log(i.length>0?c.default.greenBright(`🔑 Values detected : ${i.join(",")}`):c.default.yellowBright(`⚠️ No value detected, computing with default values in the Chart`));const u=`${(0,l.tmpdir)()}/${(0,a.randomUUID)()}`;(0,o.mkdirSync)(u,{recursive:true});(0,o.mkdirSync)(`${u}/sources`,{recursive:true});(0,o.mkdirSync)(`${u}/templated`,{recursive:true});if(!(0,s.isChartFolder)(n)){console.log("Not a chart folder");process.exit(1)}let f;try{f=yield(0,g.computeChart)(n,r.values.name,i)}catch(e){console.log("\n");console.log(c.default.bgRedBright("The computation of the chart failed. (message below)"));console.log(e.message);console.log("\n");process.exit(1)}if(r.values.push){yield pushOnlineFunction(f,r.values.encryptionKey)}else{yield serveLocally(f,n,r.values.watch,(t=r.values.browser)!==null&&t!==void 0?t:null,r.values.name)}process.exit(0)}))}function pushOnlineFunction(e,t){return n(this,void 0,void 0,(function*(){const r=(0,a.randomUUID)();const{version:n,name:i}=h.default.load(JSON.parse(e).sources["Chart.yaml"]);const s={chartVersion:n,chartName:i,content:(0,d.encrypt)(e,t)};yield fetch(`${y}/api/chart-upload`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:JSON.stringify(s),chartId:r})});console.log("");console.log(`${y}?id=${r}&encryptionKey=${t}&online=true`);console.log("");p.default.writeFileSync(".helm-viewer-url",`${y}?id=${r}&encryptionKey=${t}&online=true`)}))}function serveLocally(e,t,r,i,s){return n(this,void 0,void 0,(function*(){const n=(0,a.randomUUID)();if(process.env.NODE_ENV==="development"){(0,f.default)(`${y}?id=${n}`,{app:{name:"firefox"}})}else{if(i){(0,f.default)(`${y}?id=${n}`,{app:{name:i}})}else{(0,f.default)(`${y}?id=${n}`)}}const{version:o,name:c}=h.default.load(e.sources["Chart.yaml"]);yield Promise.all([(0,u.serverFileTemporary)(JSON.stringify(e),12094),(0,u.serverFileTemporary)({chartName:c,chartVersion:o},12095)]);if(r){(0,m.startWebsocketServer)(t,s);(0,v.watchHelmChartFilesModifications)(t);yield new Promise((e=>setTimeout(e,1e8)))}}))}run()},2982:(e,t,r)=>{e.exports=require(r.ab+"fsevents.node")},1269:module=>{module.exports=eval("require")("bufferutil")},4592:module=>{module.exports=eval("require")("utf-8-validate")},4300:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1808:e=>{"use strict";e.exports=require("net")},6005:e=>{"use strict";e.exports=require("node:crypto")},7561:e=>{"use strict";e.exports=require("node:fs")},612:e=>{"use strict";e.exports=require("node:os")},7742:e=>{"use strict";e.exports=require("node:process")},7261:e=>{"use strict";e.exports=require("node:util")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},2781:e=>{"use strict";e.exports=require("stream")},4404:e=>{"use strict";e.exports=require("tls")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},9796:e=>{"use strict";e.exports=require("zlib")},385:(e,t,r)=>{"use strict";r.r(t);r.d(t,{Chalk:()=>Chalk,backgroundColorNames:()=>a,backgroundColors:()=>a,chalkStderr:()=>R,colorNames:()=>c,colors:()=>c,default:()=>O,foregroundColorNames:()=>o,foregroundColors:()=>o,modifierNames:()=>s,modifiers:()=>s,supportsColor:()=>g,supportsColorStderr:()=>y});const n=10;const wrapAnsi16=(e=0)=>t=>`[${t+e}m`;const wrapAnsi256=(e=0)=>t=>`[${38+e};5;${t}m`;const wrapAnsi16m=(e=0)=>(t,r,n)=>`[${38+e};2;${t};${r};${n}m`;const i={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};const s=Object.keys(i.modifier);const o=Object.keys(i.color);const a=Object.keys(i.bgColor);const c=[...o,...a];function assembleStyles(){const e=new Map;for(const[t,r]of Object.entries(i)){for(const[t,n]of Object.entries(r)){i[t]={open:`[${n[0]}m`,close:`[${n[1]}m`};r[t]=i[t];e.set(n[0],n[1])}Object.defineProperty(i,t,{value:r,enumerable:false})}Object.defineProperty(i,"codes",{value:e,enumerable:false});i.color.close="";i.bgColor.close="";i.color.ansi=wrapAnsi16();i.color.ansi256=wrapAnsi256();i.color.ansi16m=wrapAnsi16m();i.bgColor.ansi=wrapAnsi16(n);i.bgColor.ansi256=wrapAnsi256(n);i.bgColor.ansi16m=wrapAnsi16m(n);Object.defineProperties(i,{rgbToAnsi256:{value(e,t,r){if(e===t&&t===r){if(e<8){return 16}if(e>248){return 231}return Math.round((e-8)/247*24)+232}return 16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)},enumerable:false},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t){return[0,0,0]}let[r]=t;if(r.length===3){r=[...r].map((e=>e+e)).join("")}const n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:false},hexToAnsi256:{value:e=>i.rgbToAnsi256(...i.hexToRgb(e)),enumerable:false},ansi256ToAnsi:{value(e){if(e<8){return 30+e}if(e<16){return 90+(e-8)}let t;let r;let n;if(e>=232){t=((e-232)*10+8)/255;r=t;n=t}else{e-=16;const i=e%36;t=Math.floor(e/36)/5;r=Math.floor(i/6)/5;n=i%6/5}const i=Math.max(t,r,n)*2;if(i===0){return 30}let s=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));if(i===2){s+=60}return s},enumerable:false},rgbToAnsi:{value:(e,t,r)=>i.ansi256ToAnsi(i.rgbToAnsi256(e,t,r)),enumerable:false},hexToAnsi:{value:e=>i.ansi256ToAnsi(i.hexToAnsi256(e)),enumerable:false}});return i}const l=assembleStyles();const u=l;var f=r(7742);var h=r(612);const d=require("node:tty");function hasFlag(e,t=(globalThis.Deno?globalThis.Deno.args:f.argv)){const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}const{env:p}=f;let m;if(hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")){m=0}else if(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always")){m=1}function envForceColor(){if("FORCE_COLOR"in p){if(p.FORCE_COLOR==="true"){return 1}if(p.FORCE_COLOR==="false"){return 0}return p.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(p.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function _supportsColor(e,{streamIsTTY:t,sniffFlags:r=true}={}){const n=envForceColor();if(n!==undefined){m=n}const i=r?m:n;if(i===0){return 0}if(r){if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor")){return 3}if(hasFlag("color=256")){return 2}}if("TF_BUILD"in p&&"AGENT_NAME"in p){return 1}if(e&&!t&&i===undefined){return 0}const s=i||0;if(p.TERM==="dumb"){return s}if(f.platform==="win32"){const e=h.release().split(".");if(Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in p){if("GITHUB_ACTIONS"in p||"GITEA_ACTIONS"in p){return 3}if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((e=>e in p))||p.CI_NAME==="codeship"){return 1}return s}if("TEAMCITY_VERSION"in p){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(p.TEAMCITY_VERSION)?1:0}if(p.COLORTERM==="truecolor"){return 3}if(p.TERM==="xterm-kitty"){return 3}if("TERM_PROGRAM"in p){const e=Number.parseInt((p.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(p.TERM_PROGRAM){case"iTerm.app":{return e>=3?3:2}case"Apple_Terminal":{return 2}}}if(/-256(color)?$/i.test(p.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(p.TERM)){return 1}if("COLORTERM"in p){return 1}return s}function createSupportsColor(e,t={}){const r=_supportsColor(e,{streamIsTTY:e&&e.isTTY,...t});return translateLevel(r)}const v={stdout:createSupportsColor({isTTY:d.isatty(1)}),stderr:createSupportsColor({isTTY:d.isatty(2)})};const _=v;function stringReplaceAll(e,t,r){let n=e.indexOf(t);if(n===-1){return e}const i=t.length;let s=0;let o="";do{o+=e.slice(s,n)+t+r;s=n+i;n=e.indexOf(t,s)}while(n!==-1);o+=e.slice(s);return o}function stringEncaseCRLFWithFirstIndex(e,t,r,n){let i=0;let s="";do{const o=e[n-1]==="\r";s+=e.slice(i,o?n-1:n)+t+(o?"\r\n":"\n")+r;i=n+1;n=e.indexOf("\n",i)}while(n!==-1);s+=e.slice(i);return s}const{stdout:g,stderr:y}=_;const w=Symbol("GENERATOR");const b=Symbol("STYLER");const S=Symbol("IS_EMPTY");const E=["ansi","ansi","ansi256","ansi16m"];const x=Object.create(null);const applyOptions=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const r=g?g.level:0;e.level=t.level===undefined?r:t.level};class Chalk{constructor(e){return chalkFactory(e)}}const chalkFactory=e=>{const chalk=(...e)=>e.join(" ");applyOptions(chalk,e);Object.setPrototypeOf(chalk,createChalk.prototype);return chalk};function createChalk(e){return chalkFactory(e)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(const[e,t]of Object.entries(u)){x[e]={get(){const r=createBuilder(this,createStyler(t.open,t.close,this[b]),this[S]);Object.defineProperty(this,e,{value:r});return r}}}x.visible={get(){const e=createBuilder(this,this[b],true);Object.defineProperty(this,"visible",{value:e});return e}};const getModelAnsi=(e,t,r,...n)=>{if(e==="rgb"){if(t==="ansi16m"){return u[r].ansi16m(...n)}if(t==="ansi256"){return u[r].ansi256(u.rgbToAnsi256(...n))}return u[r].ansi(u.rgbToAnsi(...n))}if(e==="hex"){return getModelAnsi("rgb",t,r,...u.hexToRgb(...n))}return u[r][e](...n)};const A=["rgb","hex","ansi256"];for(const e of A){x[e]={get(){const{level:t}=this;return function(...r){const n=createStyler(getModelAnsi(e,E[t],"color",...r),u.color.close,this[b]);return createBuilder(this,n,this[S])}}};const t="bg"+e[0].toUpperCase()+e.slice(1);x[t]={get(){const{level:t}=this;return function(...r){const n=createStyler(getModelAnsi(e,E[t],"bgColor",...r),u.bgColor.close,this[b]);return createBuilder(this,n,this[S])}}}}const k=Object.defineProperties((()=>{}),{...x,level:{enumerable:true,get(){return this[w].level},set(e){this[w].level=e}}});const createStyler=(e,t,r)=>{let n;let i;if(r===undefined){n=e;i=t}else{n=r.openAll+e;i=t+r.closeAll}return{open:e,close:t,openAll:n,closeAll:i,parent:r}};const createBuilder=(e,t,r)=>{const builder=(...e)=>applyStyle(builder,e.length===1?""+e[0]:e.join(" "));Object.setPrototypeOf(builder,k);builder[w]=e;builder[b]=t;builder[S]=r;return builder};const applyStyle=(e,t)=>{if(e.level<=0||!t){return e[S]?"":t}let r=e[b];if(r===undefined){return t}const{openAll:n,closeAll:i}=r;if(t.includes("")){while(r!==undefined){t=stringReplaceAll(t,r.close,r.open);r=r.parent}}const s=t.indexOf("\n");if(s!==-1){t=stringEncaseCRLFWithFirstIndex(t,i,n,s)}return n+t+i};Object.defineProperties(createChalk.prototype,x);const C=createChalk();const R=createChalk({level:y?y.level:0});const O=C},798:(e,t,r)=>{"use strict";r.r(t);r.d(t,{$:()=>X,execa:()=>execa,execaCommand:()=>execaCommand,execaCommandSync:()=>execaCommandSync,execaNode:()=>execaNode,execaSync:()=>execaSync});const n=require("node:buffer");const i=require("node:path");const s=require("node:child_process");var o=r(7742);var a=r(2746);function stripFinalNewline(e){const t=typeof e==="string"?"\n":"\n".charCodeAt();const r=typeof e==="string"?"\r":"\r".charCodeAt();if(e[e.length-1]===t){e=e.slice(0,-1)}if(e[e.length-1]===r){e=e.slice(0,-1)}return e}const c=require("node:url");function pathKey(e={}){const{env:t=process.env,platform:r=process.platform}=e;if(r!=="win32"){return"PATH"}return Object.keys(t).reverse().find((e=>e.toUpperCase()==="PATH"))||"Path"}function npmRunPath(e={}){const{cwd:t=o.cwd(),path:r=o.env[pathKey()],execPath:n=o.execPath}=e;let s;const a=t instanceof URL?c.fileURLToPath(t):t;let l=i.resolve(a);const u=[];while(s!==l){u.push(i.join(l,"node_modules/.bin"));s=l;l=i.resolve(l,"..")}u.push(i.resolve(a,n,".."));return[...u,r].join(i.delimiter)}function npmRunPathEnv({env:e=o.env,...t}={}){e={...e};const r=pathKey({env:e});t.path=e[r];e[r]=npmRunPath(t);return e}const copyProperty=(e,t,r,n)=>{if(r==="length"||r==="prototype"){return}if(r==="arguments"||r==="caller"){return}const i=Object.getOwnPropertyDescriptor(e,r);const s=Object.getOwnPropertyDescriptor(t,r);if(!canCopyProperty(i,s)&&n){return}Object.defineProperty(e,r,s)};const canCopyProperty=function(e,t){return e===undefined||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)};const changePrototype=(e,t)=>{const r=Object.getPrototypeOf(t);if(r===Object.getPrototypeOf(e)){return}Object.setPrototypeOf(e,r)};const wrappedToString=(e,t)=>`/* Wrapped ${e}*/\n${t}`;const l=Object.getOwnPropertyDescriptor(Function.prototype,"toString");const u=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");const changeToString=(e,t,r)=>{const n=r===""?"":`with ${r.trim()}() `;const i=wrappedToString.bind(null,n,t.toString());Object.defineProperty(i,"name",u);Object.defineProperty(e,"toString",{...l,value:i})};function mimicFunction(e,t,{ignoreNonConfigurable:r=false}={}){const{name:n}=e;for(const n of Reflect.ownKeys(t)){copyProperty(e,t,n,r)}changePrototype(e,t);changeToString(e,t,n);return e}const f=new WeakMap;const onetime=(e,t={})=>{if(typeof e!=="function"){throw new TypeError("Expected a function")}let r;let n=0;const i=e.displayName||e.name||"<anonymous>";const onetime=function(...s){f.set(onetime,++n);if(n===1){r=e.apply(this,s);e=null}else if(t.throw===true){throw new Error(`Function \`${i}\` can only be called once`)}return r};mimicFunction(onetime,e);f.set(onetime,n);return onetime};onetime.callCount=e=>{if(!f.has(e)){throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`)}return f.get(e)};const h=onetime;var d=r(612);const getRealtimeSignals=()=>{const e=m-p+1;return Array.from({length:e},getRealtimeSignal)};const getRealtimeSignal=(e,t)=>({name:`SIGRT${t+1}`,number:p+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"});const p=34;const m=64;const v=[{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:true},{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:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{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"}];const getSignals=()=>{const e=getRealtimeSignals();const t=[...v,...e].map(normalizeSignal);return t};const normalizeSignal=({name:e,number:t,description:r,action:n,forced:i=false,standard:s})=>{const{signals:{[e]:o}}=d.constants;const a=o!==undefined;const c=a?o:t;return{name:e,number:c,description:r,supported:a,action:n,forced:i,standard:s}};const getSignalsByName=()=>{const e=getSignals();return Object.fromEntries(e.map(getSignalByName))};const getSignalByName=({name:e,number:t,description:r,supported:n,action:i,forced:s,standard:o})=>[e,{name:e,number:t,description:r,supported:n,action:i,forced:s,standard:o}];const _=getSignalsByName();const getSignalsByNumber=()=>{const e=getSignals();const t=m+1;const r=Array.from({length:t},((t,r)=>getSignalByNumber(r,e)));return Object.assign({},...r)};const getSignalByNumber=(e,t)=>{const r=findSignalByNumber(e,t);if(r===undefined){return{}}const{name:n,description:i,supported:s,action:o,forced:a,standard:c}=r;return{[e]:{name:n,number:e,description:i,supported:s,action:o,forced:a,standard:c}}};const findSignalByNumber=(e,t)=>{const r=t.find((({name:t})=>d.constants.signals[t]===e));if(r!==undefined){return r}return t.find((t=>t.number===e))};const g=getSignalsByNumber();const getErrorPrefix=({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:i,exitCode:s,isCanceled:o})=>{if(e){return`timed out after ${t} milliseconds`}if(o){return"was canceled"}if(r!==undefined){return`failed with ${r}`}if(n!==undefined){return`was killed with ${n} (${i})`}if(s!==undefined){return`failed with exit code ${s}`}return"failed"};const makeError=({stdout:e,stderr:t,all:r,error:n,signal:i,exitCode:s,command:a,escapedCommand:c,timedOut:l,isCanceled:u,killed:f,parsed:{options:{timeout:h,cwd:d=o.cwd()}}})=>{s=s===null?undefined:s;i=i===null?undefined:i;const p=i===undefined?undefined:_[i].description;const m=n&&n.code;const v=getErrorPrefix({timedOut:l,timeout:h,errorCode:m,signal:i,signalDescription:p,exitCode:s,isCanceled:u});const g=`Command ${v}: ${a}`;const y=Object.prototype.toString.call(n)==="[object Error]";const w=y?`${g}\n${n.message}`:g;const b=[w,t,e].filter(Boolean).join("\n");if(y){n.originalMessage=n.message;n.message=b}else{n=new Error(b)}n.shortMessage=w;n.command=a;n.escapedCommand=c;n.exitCode=s;n.signal=i;n.signalDescription=p;n.stdout=e;n.stderr=t;n.cwd=d;if(r!==undefined){n.all=r}if("bufferedData"in n){delete n.bufferedData}n.failed=true;n.timedOut=Boolean(l);n.isCanceled=u;n.killed=f&&!l;return n};const y=["stdin","stdout","stderr"];const hasAlias=e=>y.some((t=>e[t]!==undefined));const normalizeStdio=e=>{if(!e){return}const{stdio:t}=e;if(t===undefined){return y.map((t=>e[t]))}if(hasAlias(e)){throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${y.map((e=>`\`${e}\``)).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,y.length);return Array.from({length:r},((e,r)=>t[r]))};const normalizeStdioNode=e=>{const t=normalizeStdio(e);if(t==="ipc"){return"ipc"}if(t===undefined||typeof t==="string"){return[t,t,t,"ipc"]}if(t.includes("ipc")){return t}return[...t,"ipc"]};const w=[];w.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32"){w.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){w.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")}const processOk=e=>!!e&&typeof e==="object"&&typeof e.removeListener==="function"&&typeof e.emit==="function"&&typeof e.reallyExit==="function"&&typeof e.listeners==="function"&&typeof e.kill==="function"&&typeof e.pid==="number"&&typeof e.on==="function";const b=Symbol.for("signal-exit emitter");const S=globalThis;const E=Object.defineProperty.bind(Object);class Emitter{emitted={afterExit:false,exit:false};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(S[b]){return S[b]}E(S,b,{value:this,writable:false,enumerable:false,configurable:false})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const r=this.listeners[e];const n=r.indexOf(t);if(n===-1){return}if(n===0&&r.length===1){r.length=0}else{r.splice(n,1)}}emit(e,t,r){if(this.emitted[e]){return false}this.emitted[e]=true;let n=false;for(const i of this.listeners[e]){n=i(t,r)===true||n}if(e==="exit"){n=this.emit("afterExit",t,r)||n}return n}}class SignalExitBase{}const signalExitWrap=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}});class SignalExitFallback extends SignalExitBase{onExit(){return()=>{}}load(){}unload(){}}class SignalExit extends SignalExitBase{#e=x.platform==="win32"?"SIGINT":"SIGHUP";#t=new Emitter;#r;#n;#i;#s={};#o=false;constructor(e){super();this.#r=e;this.#s={};for(const t of w){this.#s[t]=()=>{const r=this.#r.listeners(t);let{count:n}=this.#t;const i=e;if(typeof i.__signal_exit_emitter__==="object"&&typeof i.__signal_exit_emitter__.count==="number"){n+=i.__signal_exit_emitter__.count}if(r.length===n){this.unload();const r=this.#t.emit("exit",null,t);const n=t==="SIGHUP"?this.#e:t;if(!r)e.kill(e.pid,n)}}}this.#i=e.reallyExit;this.#n=e.emit}onExit(e,t){if(!processOk(this.#r)){return()=>{}}if(this.#o===false){this.load()}const r=t?.alwaysLast?"afterExit":"exit";this.#t.on(r,e);return()=>{this.#t.removeListener(r,e);if(this.#t.listeners["exit"].length===0&&this.#t.listeners["afterExit"].length===0){this.unload()}}}load(){if(this.#o){return}this.#o=true;this.#t.count+=1;for(const e of w){try{const t=this.#s[e];if(t)this.#r.on(e,t)}catch(e){}}this.#r.emit=(e,...t)=>this.#a(e,...t);this.#r.reallyExit=e=>this.#c(e)}unload(){if(!this.#o){return}this.#o=false;w.forEach((e=>{const t=this.#s[e];if(!t){throw new Error("Listener not defined for signal: "+e)}try{this.#r.removeListener(e,t)}catch(e){}}));this.#r.emit=this.#n;this.#r.reallyExit=this.#i;this.#t.count-=1}#c(e){if(!processOk(this.#r)){return 0}this.#r.exitCode=e||0;this.#t.emit("exit",this.#r.exitCode,null);return this.#i.call(this.#r,this.#r.exitCode)}#a(e,...t){const r=this.#n;if(e==="exit"&&processOk(this.#r)){if(typeof t[0]==="number"){this.#r.exitCode=t[0]}const n=r.call(this.#r,e,...t);this.#t.emit("exit",this.#r.exitCode,null);return n}else{return r.call(this.#r,e,...t)}}}const x=globalThis.process;const{onExit:A,load:k,unload:C}=signalExitWrap(processOk(x)?new SignalExit(x):new SignalExitFallback);const R=1e3*5;const spawnedKill=(e,t="SIGTERM",r={})=>{const n=e(t);setKillTimeout(e,t,r,n);return n};const setKillTimeout=(e,t,r,n)=>{if(!shouldForceKill(t,r,n)){return}const i=getForceKillAfterTimeout(r);const s=setTimeout((()=>{e("SIGKILL")}),i);if(s.unref){s.unref()}};const shouldForceKill=(e,{forceKillAfterTimeout:t},r)=>isSigterm(e)&&t!==false&&r;const isSigterm=e=>e===d.constants.signals.SIGTERM||typeof e==="string"&&e.toUpperCase()==="SIGTERM";const getForceKillAfterTimeout=({forceKillAfterTimeout:e=true})=>{if(e===true){return R}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};const spawnedCancel=(e,t)=>{const r=e.kill();if(r){t.isCanceled=true}};const timeoutKill=(e,t,r)=>{e.kill(t);r(Object.assign(new Error("Timed out"),{timedOut:true,signal:t}))};const setupTimeout=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(t===0||t===undefined){return n}let i;const s=new Promise(((n,s)=>{i=setTimeout((()=>{timeoutKill(e,r,s)}),t)}));const o=n.finally((()=>{clearTimeout(i)}));return Promise.race([s,o])};const validateTimeout=({timeout:e})=>{if(e!==undefined&&(!Number.isFinite(e)||e<0)){throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)}};const setExitHandler=async(e,{cleanup:t,detached:r},n)=>{if(!t||r){return n}const i=A((()=>{e.kill()}));return n.finally((()=>{i()}))};var O=r(7561);function isStream(e){return e!==null&&typeof e==="object"&&typeof e.pipe==="function"}function isWritableStream(e){return isStream(e)&&e.writable!==false&&typeof e._write==="function"&&typeof e._writableState==="object"}function isReadableStream(e){return isStream(e)&&e.readable!==false&&typeof e._read==="function"&&typeof e._readableState==="object"}function isDuplexStream(e){return isWritableStream(e)&&isReadableStream(e)}function isTransformStream(e){return isDuplexStream(e)&&typeof e._transform==="function"}const isExecaChildProcess=e=>e instanceof s.ChildProcess&&typeof e.then==="function";const pipeToTarget=(e,t,r)=>{if(typeof r==="string"){e[t].pipe((0,O.createWriteStream)(r));return e}if(isWritableStream(r)){e[t].pipe(r);return e}if(!isExecaChildProcess(r)){throw new TypeError("The second argument must be a string, a stream or an Execa child process.")}if(!isWritableStream(r.stdin)){throw new TypeError("The target child process's stdin must be available.")}e[t].pipe(r.stdin);return r};const addPipeMethods=e=>{if(e.stdout!==null){e.pipeStdout=pipeToTarget.bind(undefined,e,"stdout")}if(e.stderr!==null){e.pipeStderr=pipeToTarget.bind(undefined,e,"stderr")}if(e.all!==undefined){e.pipeAll=pipeToTarget.bind(undefined,e,"all")}};const T=require("node:timers/promises");const contents_getStreamContents=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:i,addChunk:s,getFinalChunk:o,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{if(!isAsyncIterable(e)){throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.")}const l=t();l.length=0;try{for await(const t of e){const e=getChunkType(t);const o=r[e](t,l);appendChunk({convertedChunk:o,state:l,getSize:n,truncateChunk:i,addChunk:s,maxBuffer:c})}appendFinalChunk({state:l,convertChunk:r,getSize:n,truncateChunk:i,addChunk:s,getFinalChunk:o,maxBuffer:c});return a(l)}catch(e){e.bufferedData=a(l);throw e}};const appendFinalChunk=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:i,maxBuffer:s})=>{const o=i(e);if(o!==undefined){appendChunk({convertedChunk:o,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:s})}};const appendChunk=({convertedChunk:e,state:t,getSize:r,truncateChunk:n,addChunk:i,maxBuffer:s})=>{const o=r(e);const a=t.length+o;if(a<=s){addNewChunk(e,t,i,a);return}const c=n(e,s-t.length);if(c!==undefined){addNewChunk(c,t,i,s)}throw new MaxBufferError};const addNewChunk=(e,t,r,n)=>{t.contents=r(e,t,n);t.length=n};const isAsyncIterable=e=>typeof e==="object"&&e!==null&&typeof e[Symbol.asyncIterator]==="function";const getChunkType=e=>{const t=typeof e;if(t==="string"){return"string"}if(t!=="object"||e===null){return"others"}if(globalThis.Buffer?.isBuffer(e)){return"buffer"}const r=I.call(e);if(r==="[object ArrayBuffer]"){return"arrayBuffer"}if(r==="[object DataView]"){return"dataView"}if(Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&I.call(e.buffer)==="[object ArrayBuffer]"){return"typedArray"}return"others"};const{toString:I}=Object.prototype;class MaxBufferError extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const identity=e=>e;const noop=()=>undefined;const getContentsProp=({contents:e})=>e;const throwObjectStream=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)};const getLengthProp=e=>e.length;async function getStreamAsArray(e,t){return getStreamContents(e,P,t)}const initArray=()=>({contents:[]});const increment=()=>1;const addArrayChunk=(e,{contents:t})=>{t.push(e);return t};const P={init:initArray,convertChunk:{string:identity,buffer:identity,arrayBuffer:identity,dataView:identity,typedArray:identity,others:identity},getSize:increment,truncateChunk:noop,addChunk:addArrayChunk,getFinalChunk:noop,finalize:getContentsProp};async function getStreamAsArrayBuffer(e,t){return contents_getStreamContents(e,B,t)}const initArrayBuffer=()=>({contents:new ArrayBuffer(0)});const useTextEncoder=e=>L.encode(e);const L=new TextEncoder;const useUint8Array=e=>new Uint8Array(e);const useUint8ArrayWithOffset=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);const truncateArrayBufferChunk=(e,t)=>e.slice(0,t);const addArrayBufferChunk=(e,{contents:t,length:r},n)=>{const i=hasArrayBufferResize()?resizeArrayBuffer(t,n):resizeArrayBufferSlow(t,n);new Uint8Array(i).set(e,r);return i};const resizeArrayBufferSlow=(e,t)=>{if(t<=e.byteLength){return e}const r=new ArrayBuffer(getNewContentsLength(t));new Uint8Array(r).set(new Uint8Array(e),0);return r};const resizeArrayBuffer=(e,t)=>{if(t<=e.maxByteLength){e.resize(t);return e}const r=new ArrayBuffer(t,{maxByteLength:getNewContentsLength(t)});new Uint8Array(r).set(new Uint8Array(e),0);return r};const getNewContentsLength=e=>N**Math.ceil(Math.log(e)/Math.log(N));const N=2;const finalizeArrayBuffer=({contents:e,length:t})=>hasArrayBufferResize()?e:e.slice(0,t);const hasArrayBufferResize=()=>"resize"in ArrayBuffer.prototype;const B={init:initArrayBuffer,convertChunk:{string:useTextEncoder,buffer:useUint8Array,arrayBuffer:useUint8Array,dataView:useUint8ArrayWithOffset,typedArray:useUint8ArrayWithOffset,others:throwObjectStream},getSize:getLengthProp,truncateChunk:truncateArrayBufferChunk,addChunk:addArrayBufferChunk,getFinalChunk:noop,finalize:finalizeArrayBuffer};async function getStreamAsBuffer(e,t){if(!("Buffer"in globalThis)){throw new Error("getStreamAsBuffer() is only supported in Node.js")}try{return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(e,t))}catch(e){if(e.bufferedData!==undefined){e.bufferedData=arrayBufferToNodeBuffer(e.bufferedData)}throw e}}const arrayBufferToNodeBuffer=e=>globalThis.Buffer.from(e);async function getStreamAsString(e,t){return contents_getStreamContents(e,H,t)}const initString=()=>({contents:"",textDecoder:new TextDecoder});const useTextDecoder=(e,{textDecoder:t})=>t.decode(e,{stream:true});const addStringChunk=(e,{contents:t})=>t+e;const truncateStringChunk=(e,t)=>e.slice(0,t);const getFinalStringChunk=({textDecoder:e})=>{const t=e.decode();return t===""?undefined:t};const H={init:initString,convertChunk:{string:identity,buffer:useTextDecoder,arrayBuffer:useTextDecoder,dataView:useTextDecoder,typedArray:useTextDecoder,others:throwObjectStream},getSize:getLengthProp,truncateChunk:truncateStringChunk,addChunk:addStringChunk,getFinalChunk:getFinalStringChunk,finalize:getContentsProp};var W=r(2621);const validateInputOptions=e=>{if(e!==undefined){throw new TypeError("The `input` and `inputFile` options cannot be both set.")}};const getInputSync=({input:e,inputFile:t})=>{if(typeof t!=="string"){return e}validateInputOptions(e);return(0,O.readFileSync)(t)};const handleInputSync=e=>{const t=getInputSync(e);if(isStream(t)){throw new TypeError("The `input` option cannot be a stream in sync mode")}return t};const getInput=({input:e,inputFile:t})=>{if(typeof t!=="string"){return e}validateInputOptions(e);return(0,O.createReadStream)(t)};const handleInput=(e,t)=>{const r=getInput(t);if(r===undefined){return}if(isStream(r)){r.pipe(e.stdin)}else{e.stdin.end(r)}};const makeAllStream=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr){return}const r=W();if(e.stdout){r.add(e.stdout)}if(e.stderr){r.add(e.stderr)}return r};const getBufferedData=async(e,t)=>{if(!e||t===undefined){return}await(0,T.setTimeout)(0);e.destroy();try{return await t}catch(e){return e.bufferedData}};const getStreamPromise=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(!e||!r){return}if(t==="utf8"||t==="utf-8"){return getStreamAsString(e,{maxBuffer:n})}if(t===null||t==="buffer"){return getStreamAsBuffer(e,{maxBuffer:n})}return applyEncoding(e,n,t)};const applyEncoding=async(e,t,r)=>{const n=await getStreamAsBuffer(e,{maxBuffer:t});return n.toString(r)};const getSpawnedResult=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:s},o)=>{const a=getStreamPromise(e,{encoding:n,buffer:i,maxBuffer:s});const c=getStreamPromise(t,{encoding:n,buffer:i,maxBuffer:s});const l=getStreamPromise(r,{encoding:n,buffer:i,maxBuffer:s*2});try{return await Promise.all([o,a,c,l])}catch(n){return Promise.all([{error:n,signal:n.signal,timedOut:n.timedOut},getBufferedData(e,a),getBufferedData(t,c),getBufferedData(r,l)])}};const M=(async()=>{})().constructor.prototype;const D=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(M,e)]));const mergePromise=(e,t)=>{for(const[r,n]of D){const i=typeof t==="function"?(...e)=>Reflect.apply(n.value,t(),e):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:i})}};const getSpawnedPromise=e=>new Promise(((t,r)=>{e.on("exit",((e,r)=>{t({exitCode:e,signal:r})}));e.on("error",(e=>{r(e)}));if(e.stdin){e.stdin.on("error",(e=>{r(e)}))}}));const normalizeArgs=(e,t=[])=>{if(!Array.isArray(t)){return[e]}return[e,...t]};const j=/^[\w.-]+$/;const escapeArg=e=>{if(typeof e!=="string"||j.test(e)){return e}return`"${e.replaceAll('"','\\"')}"`};const joinCommand=(e,t)=>normalizeArgs(e,t).join(" ");const getEscapedCommand=(e,t)=>normalizeArgs(e,t).map((e=>escapeArg(e))).join(" ");const U=/ +/g;const parseCommand=e=>{const t=[];for(const r of e.trim().split(U)){const e=t.at(-1);if(e&&e.endsWith("\\")){t[t.length-1]=`${e.slice(0,-1)} ${r}`}else{t.push(r)}}return t};const parseExpression=e=>{const t=typeof e;if(t==="string"){return e}if(t==="number"){return String(e)}if(t==="object"&&e!==null&&!(e instanceof s.ChildProcess)&&"stdout"in e){const t=typeof e.stdout;if(t==="string"){return e.stdout}if(n.Buffer.isBuffer(e.stdout)){return e.stdout.toString()}throw new TypeError(`Unexpected "${t}" stdout in template expression`)}throw new TypeError(`Unexpected "${t}" in template expression`)};const concatTokens=(e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)];const parseTemplate=({templates:e,expressions:t,tokens:r,index:n,template:i})=>{const s=i??e.raw[n];const o=s.split(U).filter(Boolean);const a=concatTokens(r,o,s.startsWith(" "));if(n===t.length){return a}const c=t[n];const l=Array.isArray(c)?c.map((e=>parseExpression(e))):[parseExpression(c)];return concatTokens(a,l,s.endsWith(" "))};const parseTemplates=(e,t)=>{let r=[];for(const[n,i]of e.entries()){r=parseTemplate({templates:e,expressions:t,tokens:r,index:n,template:i})}return r};var G=r(7261);const z=(0,G.debuglog)("execa").enabled;const padField=(e,t)=>String(e).padStart(t,"0");const getTimestamp=()=>{const e=new Date;return`${padField(e.getHours(),2)}:${padField(e.getMinutes(),2)}:${padField(e.getSeconds(),2)}.${padField(e.getMilliseconds(),3)}`};const logCommand=(e,{verbose:t})=>{if(!t){return}o.stderr.write(`[${getTimestamp()}] ${e}\n`)};const Y=1e3*1e3*100;const getEnv=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{const s=t?{...o.env,...e}:e;if(r){return npmRunPathEnv({env:s,cwd:n,execPath:i})}return s};const handleArguments=(e,t,r={})=>{const n=a._parse(e,t,r);e=n.command;t=n.args;r=n.options;r={maxBuffer:Y,buffer:true,stripFinalNewline:true,extendEnv:true,preferLocal:false,localDir:r.cwd||o.cwd(),execPath:o.execPath,encoding:"utf8",reject:true,cleanup:true,all:false,windowsHide:true,verbose:z,...r};r.env=getEnv(r);r.stdio=normalizeStdio(r);if(o.platform==="win32"&&i.basename(e,".exe")==="cmd"){t.unshift("/q")}return{file:e,args:t,options:r,parsed:n}};const handleOutput=(e,t,r)=>{if(typeof t!=="string"&&!n.Buffer.isBuffer(t)){return r===undefined?undefined:""}if(e.stripFinalNewline){return stripFinalNewline(t)}return t};function execa(e,t,r){const n=handleArguments(e,t,r);const i=joinCommand(e,t);const o=getEscapedCommand(e,t);logCommand(o,n.options);validateTimeout(n.options);let a;try{a=s.spawn(n.file,n.args,n.options)}catch(e){const t=new s.ChildProcess;const r=Promise.reject(makeError({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:o,parsed:n,timedOut:false,isCanceled:false,killed:false}));mergePromise(t,r);return t}const c=getSpawnedPromise(a);const l=setupTimeout(a,n.options,c);const u=setExitHandler(a,n.options,l);const f={isCanceled:false};a.kill=spawnedKill.bind(null,a.kill.bind(a));a.cancel=spawnedCancel.bind(null,a,f);const handlePromise=async()=>{const[{error:e,exitCode:t,signal:r,timedOut:s},c,l,h]=await getSpawnedResult(a,n.options,u);const d=handleOutput(n.options,c);const p=handleOutput(n.options,l);const m=handleOutput(n.options,h);if(e||t!==0||r!==null){const c=makeError({error:e,exitCode:t,signal:r,stdout:d,stderr:p,all:m,command:i,escapedCommand:o,parsed:n,timedOut:s,isCanceled:f.isCanceled||(n.options.signal?n.options.signal.aborted:false),killed:a.killed});if(!n.options.reject){return c}throw c}return{command:i,escapedCommand:o,exitCode:0,stdout:d,stderr:p,all:m,failed:false,timedOut:false,isCanceled:false,killed:false}};const d=h(handlePromise);handleInput(a,n.options);a.all=makeAllStream(a,n.options);addPipeMethods(a);mergePromise(a,d);return a}function execaSync(e,t,r){const n=handleArguments(e,t,r);const i=joinCommand(e,t);const o=getEscapedCommand(e,t);logCommand(o,n.options);const a=handleInputSync(n.options);let c;try{c=s.spawnSync(n.file,n.args,{...n.options,input:a})}catch(e){throw makeError({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:o,parsed:n,timedOut:false,isCanceled:false,killed:false})}const l=handleOutput(n.options,c.stdout,c.error);const u=handleOutput(n.options,c.stderr,c.error);if(c.error||c.status!==0||c.signal!==null){const e=makeError({stdout:l,stderr:u,error:c.error,signal:c.signal,exitCode:c.status,command:i,escapedCommand:o,parsed:n,timedOut:c.error&&c.error.code==="ETIMEDOUT",isCanceled:false,killed:c.signal!==null});if(!n.options.reject){return e}throw e}return{command:i,escapedCommand:o,exitCode:0,stdout:l,stderr:u,failed:false,timedOut:false,isCanceled:false,killed:false}}const normalizeScriptStdin=({input:e,inputFile:t,stdio:r})=>e===undefined&&t===undefined&&r===undefined?{stdin:"inherit"}:{};const normalizeScriptOptions=(e={})=>({preferLocal:true,...normalizeScriptStdin(e),...e});function create$(e){function $(t,...r){if(!Array.isArray(t)){return create$({...e,...t})}const[n,...i]=parseTemplates(t,r);return execa(n,i,normalizeScriptOptions(e))}$.sync=(t,...r)=>{if(!Array.isArray(t)){throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.")}const[n,...i]=parseTemplates(t,r);return execaSync(n,i,normalizeScriptOptions(e))};return $}const X=create$();function execaCommand(e,t){const[r,...n]=parseCommand(e);return execa(r,n,t)}function execaCommandSync(e,t){const[r,...n]=parseCommand(e);return execaSync(r,n,t)}function execaNode(e,t,r={}){if(t&&!Array.isArray(t)&&typeof t==="object"){r=t;t=[]}const n=normalizeStdioNode(r);const i=o.execArgv.filter((e=>!e.startsWith("--inspect")));const{nodePath:s=o.execPath,nodeOptions:a=i}=r;return execa(s,[...a,e,...Array.isArray(t)?t:[]],{...r,stdin:undefined,stdout:undefined,stderr:undefined,stdio:n,shell:false})}},5133:e=>{"use strict";e.exports=JSON.parse('["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]')}};var __webpack_module_cache__={};function __nccwpck_require__(e){var t=__webpack_module_cache__[e];if(t!==undefined){return t.exports}var r=__webpack_module_cache__[e]={exports:{}};var n=true;try{__webpack_modules__[e].call(r.exports,r,r.exports,__nccwpck_require__);n=false}finally{if(n)delete __webpack_module_cache__[e]}return r.exports}(()=>{__nccwpck_require__.d=(e,t)=>{for(var r in t){if(__nccwpck_require__.o(t,r)&&!__nccwpck_require__.o(e,r)){Object.defineProperty(e,r,{enumerable:true,get:t[r]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();(()=>{__nccwpck_require__.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__=__nccwpck_require__(6144);module.exports=__webpack_exports__})();
57
+ */const n=r(5680);const toRegexRange=(e,t,r)=>{if(n(e)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(t===void 0||e===t){return String(e)}if(n(t)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let i={relaxZeros:true,...r};if(typeof i.strictZeros==="boolean"){i.relaxZeros=i.strictZeros===false}let s=String(i.relaxZeros);let o=String(i.shorthand);let a=String(i.capture);let c=String(i.wrap);let l=e+":"+t+"="+s+o+a+c;if(toRegexRange.cache.hasOwnProperty(l)){return toRegexRange.cache[l].result}let u=Math.min(e,t);let f=Math.max(e,t);if(Math.abs(u-f)===1){let r=e+"|"+t;if(i.capture){return`(${r})`}if(i.wrap===false){return r}return`(?:${r})`}let h=hasPadding(e)||hasPadding(t);let d={min:e,max:t,a:u,b:f};let p=[];let m=[];if(h){d.isPadded=h;d.maxLen=String(d.max).length}if(u<0){let e=f<0?Math.abs(f):1;m=splitToPatterns(e,Math.abs(u),d,i);u=d.a=0}if(f>=0){p=splitToPatterns(u,f,d,i)}d.negatives=m;d.positives=p;d.result=collatePatterns(m,p,i);if(i.capture===true){d.result=`(${d.result})`}else if(i.wrap!==false&&p.length+m.length>1){d.result=`(?:${d.result})`}toRegexRange.cache[l]=d;return d.result};function collatePatterns(e,t,r){let n=filterPatterns(e,t,"-",false,r)||[];let i=filterPatterns(t,e,"",false,r)||[];let s=filterPatterns(e,t,"-?",true,r)||[];let o=n.concat(s).concat(i);return o.join("|")}function splitToRanges(e,t){let r=1;let n=1;let i=countNines(e,r);let s=new Set([t]);while(e<=i&&i<=t){s.add(i);r+=1;i=countNines(e,r)}i=countZeros(t+1,n)-1;while(e<i&&i<=t){s.add(i);n+=1;i=countZeros(t+1,n)-1}s=[...s];s.sort(compare);return s}function rangeToPattern(e,t,r){if(e===t){return{pattern:e,count:[],digits:0}}let n=zip(e,t);let i=n.length;let s="";let o=0;for(let e=0;e<i;e++){let[t,i]=n[e];if(t===i){s+=t}else if(t!=="0"||i!=="9"){s+=toCharacterClass(t,i,r)}else{o++}}if(o){s+=r.shorthand===true?"\\d":"[0-9]"}return{pattern:s,count:[o],digits:i}}function splitToPatterns(e,t,r,n){let i=splitToRanges(e,t);let s=[];let o=e;let a;for(let e=0;e<i.length;e++){let t=i[e];let c=rangeToPattern(String(o),String(t),n);let l="";if(!r.isPadded&&a&&a.pattern===c.pattern){if(a.count.length>1){a.count.pop()}a.count.push(c.count[0]);a.string=a.pattern+toQuantifier(a.count);o=t+1;continue}if(r.isPadded){l=padZeros(t,r,n)}c.string=l+c.pattern+toQuantifier(c.count);s.push(c);o=t+1;a=c}return s}function filterPatterns(e,t,r,n,i){let s=[];for(let i of e){let{string:e}=i;if(!n&&!contains(t,"string",e)){s.push(r+e)}if(n&&contains(t,"string",e)){s.push(r+e)}}return s}function zip(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function compare(e,t){return e>t?1:t>e?-1:0}function contains(e,t,r){return e.some((e=>e[t]===r))}function countNines(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function countZeros(e,t){return e-e%Math.pow(10,t)}function toQuantifier(e){let[t=0,r=""]=e;if(r||t>1){return`{${t+(r?","+r:"")}}`}return""}function toCharacterClass(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function hasPadding(e){return/^-?(0+)\d/.test(e)}function padZeros(e,t,r){if(!t.isPadded){return e}let n=Math.abs(t.maxLen-String(e).length);let i=r.relaxZeros!==false;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:{return i?`0{0,${n}}`:`0{${n}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};e.exports=toRegexRange},4207:(e,t,r)=>{const n=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const i=r(1017);const s=n?";":":";const o=r(7126);const getNotFoundError=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"});const getPathInfo=(e,t)=>{const r=t.colon||s;const i=e.match(/\//)||n&&e.match(/\\/)?[""]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)];const o=n?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const a=n?o.split(r):[""];if(n){if(e.indexOf(".")!==-1&&a[0]!=="")a.unshift("")}return{pathEnv:i,pathExt:a,pathExtExe:o}};const which=(e,t,r)=>{if(typeof t==="function"){r=t;t={}}if(!t)t={};const{pathEnv:n,pathExt:s,pathExtExe:a}=getPathInfo(e,t);const c=[];const step=r=>new Promise(((s,o)=>{if(r===n.length)return t.all&&c.length?s(c):o(getNotFoundError(e));const a=n[r];const l=/^".*"$/.test(a)?a.slice(1,-1):a;const u=i.join(l,e);const f=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;s(subStep(f,r,0))}));const subStep=(e,r,n)=>new Promise(((i,l)=>{if(n===s.length)return i(step(r+1));const u=s[n];o(e+u,{pathExt:a},((s,o)=>{if(!s&&o){if(t.all)c.push(e+u);else return i(e+u)}return i(subStep(e,r,n+1))}))}));return r?step(0).then((e=>r(null,e)),r):step(0)};const whichSync=(e,t)=>{t=t||{};const{pathEnv:r,pathExt:n,pathExtExe:s}=getPathInfo(e,t);const a=[];for(let c=0;c<r.length;c++){const l=r[c];const u=/^".*"$/.test(l)?l.slice(1,-1):l;const f=i.join(u,e);const h=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+f:f;for(let e=0;e<n.length;e++){const r=h+n[e];try{const e=o.sync(r,{pathExt:s});if(e){if(t.all)a.push(r);else return r}}catch(e){}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw getNotFoundError(e)};e.exports=which;which.sync=whichSync},8867:(e,t,r)=>{"use strict";const n=r(1518);n.createWebSocketStream=r(1658);n.Server=r(8887);n.Receiver=r(5066);n.Sender=r(6947);n.WebSocket=n;n.WebSocketServer=n.Server;e.exports=n},9436:(e,t,r)=>{"use strict";const{EMPTY_BUFFER:n}=r(5949);const i=Buffer[Symbol.species];function concat(e,t){if(e.length===0)return n;if(e.length===1)return e[0];const r=Buffer.allocUnsafe(t);let s=0;for(let t=0;t<e.length;t++){const n=e[t];r.set(n,s);s+=n.length}if(s<t){return new i(r.buffer,r.byteOffset,s)}return r}function _mask(e,t,r,n,i){for(let s=0;s<i;s++){r[n+s]=e[s]^t[s&3]}}function _unmask(e,t){for(let r=0;r<e.length;r++){e[r]^=t[r&3]}}function toArrayBuffer(e){if(e.length===e.buffer.byteLength){return e.buffer}return e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function toBuffer(e){toBuffer.readOnly=true;if(Buffer.isBuffer(e))return e;let t;if(e instanceof ArrayBuffer){t=new i(e)}else if(ArrayBuffer.isView(e)){t=new i(e.buffer,e.byteOffset,e.byteLength)}else{t=Buffer.from(e);toBuffer.readOnly=false}return t}e.exports={concat:concat,mask:_mask,toArrayBuffer:toArrayBuffer,toBuffer:toBuffer,unmask:_unmask};if(!process.env.WS_NO_BUFFER_UTIL){try{const t=r(1269);e.exports.mask=function(e,r,n,i,s){if(s<48)_mask(e,r,n,i,s);else t.mask(e,r,n,i,s)};e.exports.unmask=function(e,r){if(e.length<32)_unmask(e,r);else t.unmask(e,r)}}catch(e){}}},5949:e=>{"use strict";e.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}},4561:(e,t,r)=>{"use strict";const{kForOnEventAttribute:n,kListener:i}=r(5949);const s=Symbol("kCode");const o=Symbol("kData");const a=Symbol("kError");const c=Symbol("kMessage");const l=Symbol("kReason");const u=Symbol("kTarget");const f=Symbol("kType");const h=Symbol("kWasClean");class Event{constructor(e){this[u]=null;this[f]=e}get target(){return this[u]}get type(){return this[f]}}Object.defineProperty(Event.prototype,"target",{enumerable:true});Object.defineProperty(Event.prototype,"type",{enumerable:true});class CloseEvent extends Event{constructor(e,t={}){super(e);this[s]=t.code===undefined?0:t.code;this[l]=t.reason===undefined?"":t.reason;this[h]=t.wasClean===undefined?false:t.wasClean}get code(){return this[s]}get reason(){return this[l]}get wasClean(){return this[h]}}Object.defineProperty(CloseEvent.prototype,"code",{enumerable:true});Object.defineProperty(CloseEvent.prototype,"reason",{enumerable:true});Object.defineProperty(CloseEvent.prototype,"wasClean",{enumerable:true});class ErrorEvent extends Event{constructor(e,t={}){super(e);this[a]=t.error===undefined?null:t.error;this[c]=t.message===undefined?"":t.message}get error(){return this[a]}get message(){return this[c]}}Object.defineProperty(ErrorEvent.prototype,"error",{enumerable:true});Object.defineProperty(ErrorEvent.prototype,"message",{enumerable:true});class MessageEvent extends Event{constructor(e,t={}){super(e);this[o]=t.data===undefined?null:t.data}get data(){return this[o]}}Object.defineProperty(MessageEvent.prototype,"data",{enumerable:true});const d={addEventListener(e,t,r={}){for(const s of this.listeners(e)){if(!r[n]&&s[i]===t&&!s[n]){return}}let s;if(e==="message"){s=function onMessage(e,r){const n=new MessageEvent("message",{data:r?e:e.toString()});n[u]=this;callListener(t,this,n)}}else if(e==="close"){s=function onClose(e,r){const n=new CloseEvent("close",{code:e,reason:r.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});n[u]=this;callListener(t,this,n)}}else if(e==="error"){s=function onError(e){const r=new ErrorEvent("error",{error:e,message:e.message});r[u]=this;callListener(t,this,r)}}else if(e==="open"){s=function onOpen(){const e=new Event("open");e[u]=this;callListener(t,this,e)}}else{return}s[n]=!!r[n];s[i]=t;if(r.once){this.once(e,s)}else{this.on(e,s)}},removeEventListener(e,t){for(const r of this.listeners(e)){if(r[i]===t&&!r[n]){this.removeListener(e,r);break}}}};e.exports={CloseEvent:CloseEvent,ErrorEvent:ErrorEvent,Event:Event,EventTarget:d,MessageEvent:MessageEvent};function callListener(e,t,r){if(typeof e==="object"&&e.handleEvent){e.handleEvent.call(e,r)}else{e.call(t,r)}}},2035:(e,t,r)=>{"use strict";const{tokenChars:n}=r(6279);function push(e,t,r){if(e[t]===undefined)e[t]=[r];else e[t].push(r)}function parse(e){const t=Object.create(null);let r=Object.create(null);let i=false;let s=false;let o=false;let a;let c;let l=-1;let u=-1;let f=-1;let h=0;for(;h<e.length;h++){u=e.charCodeAt(h);if(a===undefined){if(f===-1&&n[u]===1){if(l===-1)l=h}else if(h!==0&&(u===32||u===9)){if(f===-1&&l!==-1)f=h}else if(u===59||u===44){if(l===-1){throw new SyntaxError(`Unexpected character at index ${h}`)}if(f===-1)f=h;const n=e.slice(l,f);if(u===44){push(t,n,r);r=Object.create(null)}else{a=n}l=f=-1}else{throw new SyntaxError(`Unexpected character at index ${h}`)}}else if(c===undefined){if(f===-1&&n[u]===1){if(l===-1)l=h}else if(u===32||u===9){if(f===-1&&l!==-1)f=h}else if(u===59||u===44){if(l===-1){throw new SyntaxError(`Unexpected character at index ${h}`)}if(f===-1)f=h;push(r,e.slice(l,f),true);if(u===44){push(t,a,r);r=Object.create(null);a=undefined}l=f=-1}else if(u===61&&l!==-1&&f===-1){c=e.slice(l,h);l=f=-1}else{throw new SyntaxError(`Unexpected character at index ${h}`)}}else{if(s){if(n[u]!==1){throw new SyntaxError(`Unexpected character at index ${h}`)}if(l===-1)l=h;else if(!i)i=true;s=false}else if(o){if(n[u]===1){if(l===-1)l=h}else if(u===34&&l!==-1){o=false;f=h}else if(u===92){s=true}else{throw new SyntaxError(`Unexpected character at index ${h}`)}}else if(u===34&&e.charCodeAt(h-1)===61){o=true}else if(f===-1&&n[u]===1){if(l===-1)l=h}else if(l!==-1&&(u===32||u===9)){if(f===-1)f=h}else if(u===59||u===44){if(l===-1){throw new SyntaxError(`Unexpected character at index ${h}`)}if(f===-1)f=h;let n=e.slice(l,f);if(i){n=n.replace(/\\/g,"");i=false}push(r,c,n);if(u===44){push(t,a,r);r=Object.create(null);a=undefined}c=undefined;l=f=-1}else{throw new SyntaxError(`Unexpected character at index ${h}`)}}}if(l===-1||o||u===32||u===9){throw new SyntaxError("Unexpected end of input")}if(f===-1)f=h;const d=e.slice(l,f);if(a===undefined){push(t,d,r)}else{if(c===undefined){push(r,d,true)}else if(i){push(r,c,d.replace(/\\/g,""))}else{push(r,c,d)}push(t,a,r)}return t}function format(e){return Object.keys(e).map((t=>{let r=e[t];if(!Array.isArray(r))r=[r];return r.map((e=>[t].concat(Object.keys(e).map((t=>{let r=e[t];if(!Array.isArray(r))r=[r];return r.map((e=>e===true?t:`${t}=${e}`)).join("; ")}))).join("; "))).join(", ")})).join(", ")}e.exports={format:format,parse:parse}},1356:e=>{"use strict";const t=Symbol("kDone");const r=Symbol("kRun");class Limiter{constructor(e){this[t]=()=>{this.pending--;this[r]()};this.concurrency=e||Infinity;this.jobs=[];this.pending=0}add(e){this.jobs.push(e);this[r]()}[r](){if(this.pending===this.concurrency)return;if(this.jobs.length){const e=this.jobs.shift();this.pending++;e(this[t])}}}e.exports=Limiter},6684:(e,t,r)=>{"use strict";const n=r(9796);const i=r(9436);const s=r(1356);const{kStatusCode:o}=r(5949);const a=Buffer[Symbol.species];const c=Buffer.from([0,0,255,255]);const l=Symbol("permessage-deflate");const u=Symbol("total-length");const f=Symbol("callback");const h=Symbol("buffers");const d=Symbol("error");let p;class PerMessageDeflate{constructor(e,t,r){this._maxPayload=r|0;this._options=e||{};this._threshold=this._options.threshold!==undefined?this._options.threshold:1024;this._isServer=!!t;this._deflate=null;this._inflate=null;this.params=null;if(!p){const e=this._options.concurrencyLimit!==undefined?this._options.concurrencyLimit:10;p=new s(e)}}static get extensionName(){return"permessage-deflate"}offer(){const e={};if(this._options.serverNoContextTakeover){e.server_no_context_takeover=true}if(this._options.clientNoContextTakeover){e.client_no_context_takeover=true}if(this._options.serverMaxWindowBits){e.server_max_window_bits=this._options.serverMaxWindowBits}if(this._options.clientMaxWindowBits){e.client_max_window_bits=this._options.clientMaxWindowBits}else if(this._options.clientMaxWindowBits==null){e.client_max_window_bits=true}return e}accept(e){e=this.normalizeParams(e);this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e);return this.params}cleanup(){if(this._inflate){this._inflate.close();this._inflate=null}if(this._deflate){const e=this._deflate[f];this._deflate.close();this._deflate=null;if(e){e(new Error("The deflate stream was closed while data was being processed"))}}}acceptAsServer(e){const t=this._options;const r=e.find((e=>{if(t.serverNoContextTakeover===false&&e.server_no_context_takeover||e.server_max_window_bits&&(t.serverMaxWindowBits===false||typeof t.serverMaxWindowBits==="number"&&t.serverMaxWindowBits>e.server_max_window_bits)||typeof t.clientMaxWindowBits==="number"&&!e.client_max_window_bits){return false}return true}));if(!r){throw new Error("None of the extension offers can be accepted")}if(t.serverNoContextTakeover){r.server_no_context_takeover=true}if(t.clientNoContextTakeover){r.client_no_context_takeover=true}if(typeof t.serverMaxWindowBits==="number"){r.server_max_window_bits=t.serverMaxWindowBits}if(typeof t.clientMaxWindowBits==="number"){r.client_max_window_bits=t.clientMaxWindowBits}else if(r.client_max_window_bits===true||t.clientMaxWindowBits===false){delete r.client_max_window_bits}return r}acceptAsClient(e){const t=e[0];if(this._options.clientNoContextTakeover===false&&t.client_no_context_takeover){throw new Error('Unexpected parameter "client_no_context_takeover"')}if(!t.client_max_window_bits){if(typeof this._options.clientMaxWindowBits==="number"){t.client_max_window_bits=this._options.clientMaxWindowBits}}else if(this._options.clientMaxWindowBits===false||typeof this._options.clientMaxWindowBits==="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits){throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}return t}normalizeParams(e){e.forEach((e=>{Object.keys(e).forEach((t=>{let r=e[t];if(r.length>1){throw new Error(`Parameter "${t}" must have only a single value`)}r=r[0];if(t==="client_max_window_bits"){if(r!==true){const e=+r;if(!Number.isInteger(e)||e<8||e>15){throw new TypeError(`Invalid value for parameter "${t}": ${r}`)}r=e}else if(!this._isServer){throw new TypeError(`Invalid value for parameter "${t}": ${r}`)}}else if(t==="server_max_window_bits"){const e=+r;if(!Number.isInteger(e)||e<8||e>15){throw new TypeError(`Invalid value for parameter "${t}": ${r}`)}r=e}else if(t==="client_no_context_takeover"||t==="server_no_context_takeover"){if(r!==true){throw new TypeError(`Invalid value for parameter "${t}": ${r}`)}}else{throw new Error(`Unknown parameter "${t}"`)}e[t]=r}))}));return e}decompress(e,t,r){p.add((n=>{this._decompress(e,t,((e,t)=>{n();r(e,t)}))}))}compress(e,t,r){p.add((n=>{this._compress(e,t,((e,t)=>{n();r(e,t)}))}))}_decompress(e,t,r){const s=this._isServer?"client":"server";if(!this._inflate){const e=`${s}_max_window_bits`;const t=typeof this.params[e]!=="number"?n.Z_DEFAULT_WINDOWBITS:this.params[e];this._inflate=n.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t});this._inflate[l]=this;this._inflate[u]=0;this._inflate[h]=[];this._inflate.on("error",inflateOnError);this._inflate.on("data",inflateOnData)}this._inflate[f]=r;this._inflate.write(e);if(t)this._inflate.write(c);this._inflate.flush((()=>{const e=this._inflate[d];if(e){this._inflate.close();this._inflate=null;r(e);return}const n=i.concat(this._inflate[h],this._inflate[u]);if(this._inflate._readableState.endEmitted){this._inflate.close();this._inflate=null}else{this._inflate[u]=0;this._inflate[h]=[];if(t&&this.params[`${s}_no_context_takeover`]){this._inflate.reset()}}r(null,n)}))}_compress(e,t,r){const s=this._isServer?"server":"client";if(!this._deflate){const e=`${s}_max_window_bits`;const t=typeof this.params[e]!=="number"?n.Z_DEFAULT_WINDOWBITS:this.params[e];this._deflate=n.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t});this._deflate[u]=0;this._deflate[h]=[];this._deflate.on("data",deflateOnData)}this._deflate[f]=r;this._deflate.write(e);this._deflate.flush(n.Z_SYNC_FLUSH,(()=>{if(!this._deflate){return}let e=i.concat(this._deflate[h],this._deflate[u]);if(t){e=new a(e.buffer,e.byteOffset,e.length-4)}this._deflate[f]=null;this._deflate[u]=0;this._deflate[h]=[];if(t&&this.params[`${s}_no_context_takeover`]){this._deflate.reset()}r(null,e)}))}}e.exports=PerMessageDeflate;function deflateOnData(e){this[h].push(e);this[u]+=e.length}function inflateOnData(e){this[u]+=e.length;if(this[l]._maxPayload<1||this[u]<=this[l]._maxPayload){this[h].push(e);return}this[d]=new RangeError("Max payload size exceeded");this[d].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH";this[d][o]=1009;this.removeListener("data",inflateOnData);this.reset()}function inflateOnError(e){this[l]._inflate=null;e[o]=1007;this[f](e)}},5066:(e,t,r)=>{"use strict";const{Writable:n}=r(2781);const i=r(6684);const{BINARY_TYPES:s,EMPTY_BUFFER:o,kStatusCode:a,kWebSocket:c}=r(5949);const{concat:l,toArrayBuffer:u,unmask:f}=r(9436);const{isValidStatusCode:h,isValidUTF8:d}=r(6279);const p=Buffer[Symbol.species];const m=Promise.resolve();const v=0;const _=1;const g=2;const y=3;const w=4;const b=5;const S=6;class Receiver extends n{constructor(e={}){super();this._binaryType=e.binaryType||s[0];this._extensions=e.extensions||{};this._isServer=!!e.isServer;this._maxPayload=e.maxPayload|0;this._skipUTF8Validation=!!e.skipUTF8Validation;this[c]=undefined;this._bufferedBytes=0;this._buffers=[];this._compressed=false;this._payloadLength=0;this._mask=undefined;this._fragmented=0;this._masked=false;this._fin=false;this._opcode=0;this._totalPayloadLength=0;this._messageLength=0;this._fragments=[];this._state=v;this._loop=false}_write(e,t,r){if(this._opcode===8&&this._state==v)return r();this._bufferedBytes+=e.length;this._buffers.push(e);this.startLoop(r)}consume(e){this._bufferedBytes-=e;if(e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){const t=this._buffers[0];this._buffers[0]=new p(t.buffer,t.byteOffset+e,t.length-e);return new p(t.buffer,t.byteOffset,e)}const t=Buffer.allocUnsafe(e);do{const r=this._buffers[0];const n=t.length-e;if(e>=r.length){t.set(this._buffers.shift(),n)}else{t.set(new Uint8Array(r.buffer,r.byteOffset,e),n);this._buffers[0]=new p(r.buffer,r.byteOffset+e,r.length-e)}e-=r.length}while(e>0);return t}startLoop(e){let t;this._loop=true;do{switch(this._state){case v:t=this.getInfo();break;case _:t=this.getPayloadLength16();break;case g:t=this.getPayloadLength64();break;case y:this.getMask();break;case w:t=this.getData(e);break;case b:this._loop=false;return;default:this._loop=false;m.then((()=>{this._state=v;this.startLoop(e)}));return}}while(this._loop);e(t)}getInfo(){if(this._bufferedBytes<2){this._loop=false;return}const e=this.consume(2);if((e[0]&48)!==0){this._loop=false;return error(RangeError,"RSV2 and RSV3 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_2_3")}const t=(e[0]&64)===64;if(t&&!this._extensions[i.extensionName]){this._loop=false;return error(RangeError,"RSV1 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_1")}this._fin=(e[0]&128)===128;this._opcode=e[0]&15;this._payloadLength=e[1]&127;if(this._opcode===0){if(t){this._loop=false;return error(RangeError,"RSV1 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_1")}if(!this._fragmented){this._loop=false;return error(RangeError,"invalid opcode 0",true,1002,"WS_ERR_INVALID_OPCODE")}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){this._loop=false;return error(RangeError,`invalid opcode ${this._opcode}`,true,1002,"WS_ERR_INVALID_OPCODE")}this._compressed=t}else if(this._opcode>7&&this._opcode<11){if(!this._fin){this._loop=false;return error(RangeError,"FIN must be set",true,1002,"WS_ERR_EXPECTED_FIN")}if(t){this._loop=false;return error(RangeError,"RSV1 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_1")}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){this._loop=false;return error(RangeError,`invalid payload length ${this._payloadLength}`,true,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}}else{this._loop=false;return error(RangeError,`invalid opcode ${this._opcode}`,true,1002,"WS_ERR_INVALID_OPCODE")}if(!this._fin&&!this._fragmented)this._fragmented=this._opcode;this._masked=(e[1]&128)===128;if(this._isServer){if(!this._masked){this._loop=false;return error(RangeError,"MASK must be set",true,1002,"WS_ERR_EXPECTED_MASK")}}else if(this._masked){this._loop=false;return error(RangeError,"MASK must be clear",true,1002,"WS_ERR_UNEXPECTED_MASK")}if(this._payloadLength===126)this._state=_;else if(this._payloadLength===127)this._state=g;else return this.haveLength()}getPayloadLength16(){if(this._bufferedBytes<2){this._loop=false;return}this._payloadLength=this.consume(2).readUInt16BE(0);return this.haveLength()}getPayloadLength64(){if(this._bufferedBytes<8){this._loop=false;return}const e=this.consume(8);const t=e.readUInt32BE(0);if(t>Math.pow(2,53-32)-1){this._loop=false;return error(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",false,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")}this._payloadLength=t*Math.pow(2,32)+e.readUInt32BE(4);return this.haveLength()}haveLength(){if(this._payloadLength&&this._opcode<8){this._totalPayloadLength+=this._payloadLength;if(this._totalPayloadLength>this._maxPayload&&this._maxPayload>0){this._loop=false;return error(RangeError,"Max payload size exceeded",false,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH")}}if(this._masked)this._state=y;else this._state=w}getMask(){if(this._bufferedBytes<4){this._loop=false;return}this._mask=this.consume(4);this._state=w}getData(e){let t=o;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=false;return}t=this.consume(this._payloadLength);if(this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0){f(t,this._mask)}}if(this._opcode>7)return this.controlMessage(t);if(this._compressed){this._state=b;this.decompress(t,e);return}if(t.length){this._messageLength=this._totalPayloadLength;this._fragments.push(t)}return this.dataMessage()}decompress(e,t){const r=this._extensions[i.extensionName];r.decompress(e,this._fin,((e,r)=>{if(e)return t(e);if(r.length){this._messageLength+=r.length;if(this._messageLength>this._maxPayload&&this._maxPayload>0){return t(error(RangeError,"Max payload size exceeded",false,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"))}this._fragments.push(r)}const n=this.dataMessage();if(n)return t(n);this.startLoop(t)}))}dataMessage(){if(this._fin){const e=this._messageLength;const t=this._fragments;this._totalPayloadLength=0;this._messageLength=0;this._fragmented=0;this._fragments=[];if(this._opcode===2){let r;if(this._binaryType==="nodebuffer"){r=l(t,e)}else if(this._binaryType==="arraybuffer"){r=u(l(t,e))}else{r=t}this.emit("message",r,true)}else{const r=l(t,e);if(!this._skipUTF8Validation&&!d(r)){this._loop=false;return error(Error,"invalid UTF-8 sequence",true,1007,"WS_ERR_INVALID_UTF8")}this.emit("message",r,false)}}this._state=S}controlMessage(e){if(this._opcode===8){this._loop=false;if(e.length===0){this.emit("conclude",1005,o);this.end();this._state=v}else{const t=e.readUInt16BE(0);if(!h(t)){return error(RangeError,`invalid status code ${t}`,true,1002,"WS_ERR_INVALID_CLOSE_CODE")}const r=new p(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!d(r)){return error(Error,"invalid UTF-8 sequence",true,1007,"WS_ERR_INVALID_UTF8")}this.emit("conclude",t,r);this.end();this._state=v}}else if(this._opcode===9){this.emit("ping",e);this._state=S}else{this.emit("pong",e);this._state=S}}}e.exports=Receiver;function error(e,t,r,n,i){const s=new e(r?`Invalid WebSocket frame: ${t}`:t);Error.captureStackTrace(s,error);s.code=i;s[a]=n;return s}},6947:(e,t,r)=>{"use strict";const{Duplex:n}=r(2781);const{randomFillSync:i}=r(6113);const s=r(6684);const{EMPTY_BUFFER:o}=r(5949);const{isValidStatusCode:a}=r(6279);const{mask:c,toBuffer:l}=r(9436);const u=Symbol("kByteLength");const f=Buffer.alloc(4);class Sender{constructor(e,t,r){this._extensions=t||{};if(r){this._generateMask=r;this._maskBuffer=Buffer.alloc(4)}this._socket=e;this._firstFragment=true;this._compress=false;this._bufferedBytes=0;this._deflating=false;this._queue=[]}static frame(e,t){let r;let n=false;let s=2;let o=false;if(t.mask){r=t.maskBuffer||f;if(t.generateMask){t.generateMask(r)}else{i(r,0,4)}o=(r[0]|r[1]|r[2]|r[3])===0;s=6}let a;if(typeof e==="string"){if((!t.mask||o)&&t[u]!==undefined){a=t[u]}else{e=Buffer.from(e);a=e.length}}else{a=e.length;n=t.mask&&t.readOnly&&!o}let l=a;if(a>=65536){s+=8;l=127}else if(a>125){s+=2;l=126}const h=Buffer.allocUnsafe(n?a+s:s);h[0]=t.fin?t.opcode|128:t.opcode;if(t.rsv1)h[0]|=64;h[1]=l;if(l===126){h.writeUInt16BE(a,2)}else if(l===127){h[2]=h[3]=0;h.writeUIntBE(a,4,6)}if(!t.mask)return[h,e];h[1]|=128;h[s-4]=r[0];h[s-3]=r[1];h[s-2]=r[2];h[s-1]=r[3];if(o)return[h,e];if(n){c(e,r,h,s,a);return[h]}c(e,r,e,0,a);return[h,e]}close(e,t,r,n){let i;if(e===undefined){i=o}else if(typeof e!=="number"||!a(e)){throw new TypeError("First argument must be a valid error code number")}else if(t===undefined||!t.length){i=Buffer.allocUnsafe(2);i.writeUInt16BE(e,0)}else{const r=Buffer.byteLength(t);if(r>123){throw new RangeError("The message must not be greater than 123 bytes")}i=Buffer.allocUnsafe(2+r);i.writeUInt16BE(e,0);if(typeof t==="string"){i.write(t,2)}else{i.set(t,2)}}const s={[u]:i.length,fin:true,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:false,rsv1:false};if(this._deflating){this.enqueue([this.dispatch,i,false,s,n])}else{this.sendFrame(Sender.frame(i,s),n)}}ping(e,t,r){let n;let i;if(typeof e==="string"){n=Buffer.byteLength(e);i=false}else{e=l(e);n=e.length;i=l.readOnly}if(n>125){throw new RangeError("The data size must not be greater than 125 bytes")}const s={[u]:n,fin:true,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:i,rsv1:false};if(this._deflating){this.enqueue([this.dispatch,e,false,s,r])}else{this.sendFrame(Sender.frame(e,s),r)}}pong(e,t,r){let n;let i;if(typeof e==="string"){n=Buffer.byteLength(e);i=false}else{e=l(e);n=e.length;i=l.readOnly}if(n>125){throw new RangeError("The data size must not be greater than 125 bytes")}const s={[u]:n,fin:true,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:i,rsv1:false};if(this._deflating){this.enqueue([this.dispatch,e,false,s,r])}else{this.sendFrame(Sender.frame(e,s),r)}}send(e,t,r){const n=this._extensions[s.extensionName];let i=t.binary?2:1;let o=t.compress;let a;let c;if(typeof e==="string"){a=Buffer.byteLength(e);c=false}else{e=l(e);a=e.length;c=l.readOnly}if(this._firstFragment){this._firstFragment=false;if(o&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]){o=a>=n._threshold}this._compress=o}else{o=false;i=0}if(t.fin)this._firstFragment=true;if(n){const n={[u]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:c,rsv1:o};if(this._deflating){this.enqueue([this.dispatch,e,this._compress,n,r])}else{this.dispatch(e,this._compress,n,r)}}else{this.sendFrame(Sender.frame(e,{[u]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:c,rsv1:false}),r)}}dispatch(e,t,r,n){if(!t){this.sendFrame(Sender.frame(e,r),n);return}const i=this._extensions[s.extensionName];this._bufferedBytes+=r[u];this._deflating=true;i.compress(e,r.fin,((e,t)=>{if(this._socket.destroyed){const e=new Error("The socket was closed while data was being compressed");if(typeof n==="function")n(e);for(let t=0;t<this._queue.length;t++){const r=this._queue[t];const n=r[r.length-1];if(typeof n==="function")n(e)}return}this._bufferedBytes-=r[u];this._deflating=false;r.readOnly=false;this.sendFrame(Sender.frame(t,r),n);this.dequeue()}))}dequeue(){while(!this._deflating&&this._queue.length){const e=this._queue.shift();this._bufferedBytes-=e[3][u];Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][u];this._queue.push(e)}sendFrame(e,t){if(e.length===2){this._socket.cork();this._socket.write(e[0]);this._socket.write(e[1],t);this._socket.uncork()}else{this._socket.write(e[0],t)}}}e.exports=Sender},1658:(e,t,r)=>{"use strict";const{Duplex:n}=r(2781);function emitClose(e){e.emit("close")}function duplexOnEnd(){if(!this.destroyed&&this._writableState.finished){this.destroy()}}function duplexOnError(e){this.removeListener("error",duplexOnError);this.destroy();if(this.listenerCount("error")===0){this.emit("error",e)}}function createWebSocketStream(e,t){let r=true;const i=new n({...t,autoDestroy:false,emitClose:false,objectMode:false,writableObjectMode:false});e.on("message",(function message(t,r){const n=!r&&i._readableState.objectMode?t.toString():t;if(!i.push(n))e.pause()}));e.once("error",(function error(e){if(i.destroyed)return;r=false;i.destroy(e)}));e.once("close",(function close(){if(i.destroyed)return;i.push(null)}));i._destroy=function(t,n){if(e.readyState===e.CLOSED){n(t);process.nextTick(emitClose,i);return}let s=false;e.once("error",(function error(e){s=true;n(e)}));e.once("close",(function close(){if(!s)n(t);process.nextTick(emitClose,i)}));if(r)e.terminate()};i._final=function(t){if(e.readyState===e.CONNECTING){e.once("open",(function open(){i._final(t)}));return}if(e._socket===null)return;if(e._socket._writableState.finished){t();if(i._readableState.endEmitted)i.destroy()}else{e._socket.once("finish",(function finish(){t()}));e.close()}};i._read=function(){if(e.isPaused)e.resume()};i._write=function(t,r,n){if(e.readyState===e.CONNECTING){e.once("open",(function open(){i._write(t,r,n)}));return}e.send(t,n)};i.on("end",duplexOnEnd);i.on("error",duplexOnError);return i}e.exports=createWebSocketStream},6668:(e,t,r)=>{"use strict";const{tokenChars:n}=r(6279);function parse(e){const t=new Set;let r=-1;let i=-1;let s=0;for(s;s<e.length;s++){const o=e.charCodeAt(s);if(i===-1&&n[o]===1){if(r===-1)r=s}else if(s!==0&&(o===32||o===9)){if(i===-1&&r!==-1)i=s}else if(o===44){if(r===-1){throw new SyntaxError(`Unexpected character at index ${s}`)}if(i===-1)i=s;const n=e.slice(r,i);if(t.has(n)){throw new SyntaxError(`The "${n}" subprotocol is duplicated`)}t.add(n);r=i=-1}else{throw new SyntaxError(`Unexpected character at index ${s}`)}}if(r===-1||i!==-1){throw new SyntaxError("Unexpected end of input")}const o=e.slice(r,s);if(t.has(o)){throw new SyntaxError(`The "${o}" subprotocol is duplicated`)}t.add(o);return t}e.exports={parse:parse}},6279:(e,t,r)=>{"use strict";const{isUtf8:n}=r(4300);const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function isValidStatusCode(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function _isValidUTF8(e){const t=e.length;let r=0;while(r<t){if((e[r]&128)===0){r++}else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192){return false}r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160){return false}r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244){return false}r+=4}else{return false}}return true}e.exports={isValidStatusCode:isValidStatusCode,isValidUTF8:_isValidUTF8,tokenChars:i};if(n){e.exports.isValidUTF8=function(e){return e.length<24?_isValidUTF8(e):n(e)}}else if(!process.env.WS_NO_UTF_8_VALIDATE){try{const t=r(4592);e.exports.isValidUTF8=function(e){return e.length<32?_isValidUTF8(e):t(e)}}catch(e){}}},8887:(e,t,r)=>{"use strict";const n=r(2361);const i=r(3685);const{Duplex:s}=r(2781);const{createHash:o}=r(6113);const a=r(2035);const c=r(6684);const l=r(6668);const u=r(1518);const{GUID:f,kWebSocket:h}=r(5949);const d=/^[+/0-9A-Za-z]{22}==$/;const p=0;const m=1;const v=2;class WebSocketServer extends n{constructor(e,t){super();e={maxPayload:100*1024*1024,skipUTF8Validation:false,perMessageDeflate:false,handleProtocols:null,clientTracking:true,verifyClient:null,noServer:false,backlog:null,server:null,host:null,path:null,port:null,WebSocket:u,...e};if(e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer){throw new TypeError('One and only one of the "port", "server", or "noServer" options '+"must be specified")}if(e.port!=null){this._server=i.createServer(((e,t)=>{const r=i.STATUS_CODES[426];t.writeHead(426,{"Content-Length":r.length,"Content-Type":"text/plain"});t.end(r)}));this._server.listen(e.port,e.host,e.backlog,t)}else if(e.server){this._server=e.server}if(this._server){const e=this.emit.bind(this,"connection");this._removeListeners=addListeners(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(t,r,n)=>{this.handleUpgrade(t,r,n,e)}})}if(e.perMessageDeflate===true)e.perMessageDeflate={};if(e.clientTracking){this.clients=new Set;this._shouldEmitClose=false}this.options=e;this._state=p}address(){if(this.options.noServer){throw new Error('The server is operating in "noServer" mode')}if(!this._server)return null;return this._server.address()}close(e){if(this._state===v){if(e){this.once("close",(()=>{e(new Error("The server is not running"))}))}process.nextTick(emitClose,this);return}if(e)this.once("close",e);if(this._state===m)return;this._state=m;if(this.options.noServer||this.options.server){if(this._server){this._removeListeners();this._removeListeners=this._server=null}if(this.clients){if(!this.clients.size){process.nextTick(emitClose,this)}else{this._shouldEmitClose=true}}else{process.nextTick(emitClose,this)}}else{const e=this._server;this._removeListeners();this._removeListeners=this._server=null;e.close((()=>{emitClose(this)}))}}shouldHandle(e){if(this.options.path){const t=e.url.indexOf("?");const r=t!==-1?e.url.slice(0,t):e.url;if(r!==this.options.path)return false}return true}handleUpgrade(e,t,r,n){t.on("error",socketOnError);const i=e.headers["sec-websocket-key"];const s=+e.headers["sec-websocket-version"];if(e.method!=="GET"){const r="Invalid HTTP method";abortHandshakeOrEmitwsClientError(this,e,t,405,r);return}if(e.headers.upgrade.toLowerCase()!=="websocket"){const r="Invalid Upgrade header";abortHandshakeOrEmitwsClientError(this,e,t,400,r);return}if(!i||!d.test(i)){const r="Missing or invalid Sec-WebSocket-Key header";abortHandshakeOrEmitwsClientError(this,e,t,400,r);return}if(s!==8&&s!==13){const r="Missing or invalid Sec-WebSocket-Version header";abortHandshakeOrEmitwsClientError(this,e,t,400,r);return}if(!this.shouldHandle(e)){abortHandshake(t,400);return}const o=e.headers["sec-websocket-protocol"];let u=new Set;if(o!==undefined){try{u=l.parse(o)}catch(r){const n="Invalid Sec-WebSocket-Protocol header";abortHandshakeOrEmitwsClientError(this,e,t,400,n);return}}const f=e.headers["sec-websocket-extensions"];const h={};if(this.options.perMessageDeflate&&f!==undefined){const r=new c(this.options.perMessageDeflate,true,this.options.maxPayload);try{const e=a.parse(f);if(e[c.extensionName]){r.accept(e[c.extensionName]);h[c.extensionName]=r}}catch(r){const n="Invalid or unacceptable Sec-WebSocket-Extensions header";abortHandshakeOrEmitwsClientError(this,e,t,400,n);return}}if(this.options.verifyClient){const o={origin:e.headers[`${s===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(o,((s,o,a,c)=>{if(!s){return abortHandshake(t,o||401,a,c)}this.completeUpgrade(h,i,u,e,t,r,n)}));return}if(!this.options.verifyClient(o))return abortHandshake(t,401)}this.completeUpgrade(h,i,u,e,t,r,n)}completeUpgrade(e,t,r,n,i,s,l){if(!i.readable||!i.writable)return i.destroy();if(i[h]){throw new Error("server.handleUpgrade() was called more than once with the same "+"socket, possibly due to a misconfiguration")}if(this._state>p)return abortHandshake(i,503);const u=o("sha1").update(t+f).digest("base64");const d=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${u}`];const m=new this.options.WebSocket(null);if(r.size){const e=this.options.handleProtocols?this.options.handleProtocols(r,n):r.values().next().value;if(e){d.push(`Sec-WebSocket-Protocol: ${e}`);m._protocol=e}}if(e[c.extensionName]){const t=e[c.extensionName].params;const r=a.format({[c.extensionName]:[t]});d.push(`Sec-WebSocket-Extensions: ${r}`);m._extensions=e}this.emit("headers",d,n);i.write(d.concat("\r\n").join("\r\n"));i.removeListener("error",socketOnError);m.setSocket(i,s,{maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation});if(this.clients){this.clients.add(m);m.on("close",(()=>{this.clients.delete(m);if(this._shouldEmitClose&&!this.clients.size){process.nextTick(emitClose,this)}}))}l(m,n)}}e.exports=WebSocketServer;function addListeners(e,t){for(const r of Object.keys(t))e.on(r,t[r]);return function removeListeners(){for(const r of Object.keys(t)){e.removeListener(r,t[r])}}}function emitClose(e){e._state=v;e.emit("close")}function socketOnError(){this.destroy()}function abortHandshake(e,t,r,n){r=r||i.STATUS_CODES[t];n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...n};e.once("finish",e.destroy);e.end(`HTTP/1.1 ${t} ${i.STATUS_CODES[t]}\r\n`+Object.keys(n).map((e=>`${e}: ${n[e]}`)).join("\r\n")+"\r\n\r\n"+r)}function abortHandshakeOrEmitwsClientError(e,t,r,n,i){if(e.listenerCount("wsClientError")){const n=new Error(i);Error.captureStackTrace(n,abortHandshakeOrEmitwsClientError);e.emit("wsClientError",n,r,t)}else{abortHandshake(r,n,i)}}},1518:(e,t,r)=>{"use strict";const n=r(2361);const i=r(5687);const s=r(3685);const o=r(1808);const a=r(4404);const{randomBytes:c,createHash:l}=r(6113);const{Duplex:u,Readable:f}=r(2781);const{URL:h}=r(7310);const d=r(6684);const p=r(5066);const m=r(6947);const{BINARY_TYPES:v,EMPTY_BUFFER:_,GUID:g,kForOnEventAttribute:y,kListener:w,kStatusCode:b,kWebSocket:S,NOOP:E}=r(5949);const{EventTarget:{addEventListener:x,removeEventListener:A}}=r(4561);const{format:k,parse:C}=r(2035);const{toBuffer:R}=r(9436);const O=30*1e3;const T=Symbol("kAborted");const I=[8,13];const P=["CONNECTING","OPEN","CLOSING","CLOSED"];const L=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class WebSocket extends n{constructor(e,t,r){super();this._binaryType=v[0];this._closeCode=1006;this._closeFrameReceived=false;this._closeFrameSent=false;this._closeMessage=_;this._closeTimer=null;this._extensions={};this._paused=false;this._protocol="";this._readyState=WebSocket.CONNECTING;this._receiver=null;this._sender=null;this._socket=null;if(e!==null){this._bufferedAmount=0;this._isServer=false;this._redirects=0;if(t===undefined){t=[]}else if(!Array.isArray(t)){if(typeof t==="object"&&t!==null){r=t;t=[]}else{t=[t]}}initAsClient(this,e,t,r)}else{this._isServer=true}}get binaryType(){return this._binaryType}set binaryType(e){if(!v.includes(e))return;this._binaryType=e;if(this._receiver)this._receiver._binaryType=e}get bufferedAmount(){if(!this._socket)return this._bufferedAmount;return this._socket._writableState.length+this._sender._bufferedBytes}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,r){const n=new p({binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation});this._sender=new m(e,this._extensions,r.generateMask);this._receiver=n;this._socket=e;n[S]=this;e[S]=this;n.on("conclude",receiverOnConclude);n.on("drain",receiverOnDrain);n.on("error",receiverOnError);n.on("message",receiverOnMessage);n.on("ping",receiverOnPing);n.on("pong",receiverOnPong);if(e.setTimeout)e.setTimeout(0);if(e.setNoDelay)e.setNoDelay();if(t.length>0)e.unshift(t);e.on("close",socketOnClose);e.on("data",socketOnData);e.on("end",socketOnEnd);e.on("error",socketOnError);this._readyState=WebSocket.OPEN;this.emit("open")}emitClose(){if(!this._socket){this._readyState=WebSocket.CLOSED;this.emit("close",this._closeCode,this._closeMessage);return}if(this._extensions[d.extensionName]){this._extensions[d.extensionName].cleanup()}this._receiver.removeAllListeners();this._readyState=WebSocket.CLOSED;this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState===WebSocket.CLOSED)return;if(this.readyState===WebSocket.CONNECTING){const e="WebSocket was closed before the connection was established";abortHandshake(this,this._req,e);return}if(this.readyState===WebSocket.CLOSING){if(this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)){this._socket.end()}return}this._readyState=WebSocket.CLOSING;this._sender.close(e,t,!this._isServer,(e=>{if(e)return;this._closeFrameSent=true;if(this._closeFrameReceived||this._receiver._writableState.errorEmitted){this._socket.end()}}));this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),O)}pause(){if(this.readyState===WebSocket.CONNECTING||this.readyState===WebSocket.CLOSED){return}this._paused=true;this._socket.pause()}ping(e,t,r){if(this.readyState===WebSocket.CONNECTING){throw new Error("WebSocket is not open: readyState 0 (CONNECTING)")}if(typeof e==="function"){r=e;e=t=undefined}else if(typeof t==="function"){r=t;t=undefined}if(typeof e==="number")e=e.toString();if(this.readyState!==WebSocket.OPEN){sendAfterClose(this,e,r);return}if(t===undefined)t=!this._isServer;this._sender.ping(e||_,t,r)}pong(e,t,r){if(this.readyState===WebSocket.CONNECTING){throw new Error("WebSocket is not open: readyState 0 (CONNECTING)")}if(typeof e==="function"){r=e;e=t=undefined}else if(typeof t==="function"){r=t;t=undefined}if(typeof e==="number")e=e.toString();if(this.readyState!==WebSocket.OPEN){sendAfterClose(this,e,r);return}if(t===undefined)t=!this._isServer;this._sender.pong(e||_,t,r)}resume(){if(this.readyState===WebSocket.CONNECTING||this.readyState===WebSocket.CLOSED){return}this._paused=false;if(!this._receiver._writableState.needDrain)this._socket.resume()}send(e,t,r){if(this.readyState===WebSocket.CONNECTING){throw new Error("WebSocket is not open: readyState 0 (CONNECTING)")}if(typeof t==="function"){r=t;t={}}if(typeof e==="number")e=e.toString();if(this.readyState!==WebSocket.OPEN){sendAfterClose(this,e,r);return}const n={binary:typeof e!=="string",mask:!this._isServer,compress:true,fin:true,...t};if(!this._extensions[d.extensionName]){n.compress=false}this._sender.send(e||_,n,r)}terminate(){if(this.readyState===WebSocket.CLOSED)return;if(this.readyState===WebSocket.CONNECTING){const e="WebSocket was closed before the connection was established";abortHandshake(this,this._req,e);return}if(this._socket){this._readyState=WebSocket.CLOSING;this._socket.destroy()}}}Object.defineProperty(WebSocket,"CONNECTING",{enumerable:true,value:P.indexOf("CONNECTING")});Object.defineProperty(WebSocket.prototype,"CONNECTING",{enumerable:true,value:P.indexOf("CONNECTING")});Object.defineProperty(WebSocket,"OPEN",{enumerable:true,value:P.indexOf("OPEN")});Object.defineProperty(WebSocket.prototype,"OPEN",{enumerable:true,value:P.indexOf("OPEN")});Object.defineProperty(WebSocket,"CLOSING",{enumerable:true,value:P.indexOf("CLOSING")});Object.defineProperty(WebSocket.prototype,"CLOSING",{enumerable:true,value:P.indexOf("CLOSING")});Object.defineProperty(WebSocket,"CLOSED",{enumerable:true,value:P.indexOf("CLOSED")});Object.defineProperty(WebSocket.prototype,"CLOSED",{enumerable:true,value:P.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach((e=>{Object.defineProperty(WebSocket.prototype,e,{enumerable:true})}));["open","error","close","message"].forEach((e=>{Object.defineProperty(WebSocket.prototype,`on${e}`,{enumerable:true,get(){for(const t of this.listeners(e)){if(t[y])return t[w]}return null},set(t){for(const t of this.listeners(e)){if(t[y]){this.removeListener(e,t);break}}if(typeof t!=="function")return;this.addEventListener(e,t,{[y]:true})}})}));WebSocket.prototype.addEventListener=x;WebSocket.prototype.removeEventListener=A;e.exports=WebSocket;function initAsClient(e,t,r,n){const o={protocolVersion:I[1],maxPayload:100*1024*1024,skipUTF8Validation:false,perMessageDeflate:true,followRedirects:false,maxRedirects:10,...n,createConnection:undefined,socketPath:undefined,hostname:undefined,protocol:undefined,timeout:undefined,method:"GET",host:undefined,path:undefined,port:undefined};if(!I.includes(o.protocolVersion)){throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} `+`(supported versions: ${I.join(", ")})`)}let a;if(t instanceof h){a=t}else{try{a=new h(t)}catch(e){throw new SyntaxError(`Invalid URL: ${t}`)}}if(a.protocol==="http:"){a.protocol="ws:"}else if(a.protocol==="https:"){a.protocol="wss:"}e._url=a.href;const u=a.protocol==="wss:";const f=a.protocol==="ws+unix:";let p;if(a.protocol!=="ws:"&&!u&&!f){p='The URL\'s protocol must be one of "ws:", "wss:", '+'"http:", "https", or "ws+unix:"'}else if(f&&!a.pathname){p="The URL's pathname is empty"}else if(a.hash){p="The URL contains a fragment identifier"}if(p){const t=new SyntaxError(p);if(e._redirects===0){throw t}else{emitErrorAndClose(e,t);return}}const m=u?443:80;const v=c(16).toString("base64");const _=u?i.request:s.request;const y=new Set;let w;o.createConnection=u?tlsConnect:netConnect;o.defaultPort=o.defaultPort||m;o.port=a.port||m;o.host=a.hostname.startsWith("[")?a.hostname.slice(1,-1):a.hostname;o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":v,Connection:"Upgrade",Upgrade:"websocket"};o.path=a.pathname+a.search;o.timeout=o.handshakeTimeout;if(o.perMessageDeflate){w=new d(o.perMessageDeflate!==true?o.perMessageDeflate:{},false,o.maxPayload);o.headers["Sec-WebSocket-Extensions"]=k({[d.extensionName]:w.offer()})}if(r.length){for(const e of r){if(typeof e!=="string"||!L.test(e)||y.has(e)){throw new SyntaxError("An invalid or duplicated subprotocol was specified")}y.add(e)}o.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(o.origin){if(o.protocolVersion<13){o.headers["Sec-WebSocket-Origin"]=o.origin}else{o.headers.Origin=o.origin}}if(a.username||a.password){o.auth=`${a.username}:${a.password}`}if(f){const e=o.path.split(":");o.socketPath=e[0];o.path=e[1]}let b;if(o.followRedirects){if(e._redirects===0){e._originalIpc=f;e._originalSecure=u;e._originalHostOrSocketPath=f?o.socketPath:a.host;const t=n&&n.headers;n={...n,headers:{}};if(t){for(const[e,r]of Object.entries(t)){n.headers[e.toLowerCase()]=r}}}else if(e.listenerCount("redirect")===0){const t=f?e._originalIpc?o.socketPath===e._originalHostOrSocketPath:false:e._originalIpc?false:a.host===e._originalHostOrSocketPath;if(!t||e._originalSecure&&!u){delete o.headers.authorization;delete o.headers.cookie;if(!t)delete o.headers.host;o.auth=undefined}}if(o.auth&&!n.headers.authorization){n.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64")}b=e._req=_(o);if(e._redirects){e.emit("redirect",e.url,b)}}else{b=e._req=_(o)}if(o.timeout){b.on("timeout",(()=>{abortHandshake(e,b,"Opening handshake has timed out")}))}b.on("error",(t=>{if(b===null||b[T])return;b=e._req=null;emitErrorAndClose(e,t)}));b.on("response",(i=>{const s=i.headers.location;const a=i.statusCode;if(s&&o.followRedirects&&a>=300&&a<400){if(++e._redirects>o.maxRedirects){abortHandshake(e,b,"Maximum redirects exceeded");return}b.abort();let i;try{i=new h(s,t)}catch(t){const r=new SyntaxError(`Invalid URL: ${s}`);emitErrorAndClose(e,r);return}initAsClient(e,i,r,n)}else if(!e.emit("unexpected-response",b,i)){abortHandshake(e,b,`Unexpected server response: ${i.statusCode}`)}}));b.on("upgrade",((t,r,n)=>{e.emit("upgrade",t);if(e.readyState!==WebSocket.CONNECTING)return;b=e._req=null;if(t.headers.upgrade.toLowerCase()!=="websocket"){abortHandshake(e,r,"Invalid Upgrade header");return}const i=l("sha1").update(v+g).digest("base64");if(t.headers["sec-websocket-accept"]!==i){abortHandshake(e,r,"Invalid Sec-WebSocket-Accept header");return}const s=t.headers["sec-websocket-protocol"];let a;if(s!==undefined){if(!y.size){a="Server sent a subprotocol but none was requested"}else if(!y.has(s)){a="Server sent an invalid subprotocol"}}else if(y.size){a="Server sent no subprotocol"}if(a){abortHandshake(e,r,a);return}if(s)e._protocol=s;const c=t.headers["sec-websocket-extensions"];if(c!==undefined){if(!w){const t="Server sent a Sec-WebSocket-Extensions header but no extension "+"was requested";abortHandshake(e,r,t);return}let t;try{t=C(c)}catch(t){const n="Invalid Sec-WebSocket-Extensions header";abortHandshake(e,r,n);return}const n=Object.keys(t);if(n.length!==1||n[0]!==d.extensionName){const t="Server indicated an extension that was not requested";abortHandshake(e,r,t);return}try{w.accept(t[d.extensionName])}catch(t){const n="Invalid Sec-WebSocket-Extensions header";abortHandshake(e,r,n);return}e._extensions[d.extensionName]=w}e.setSocket(r,n,{generateMask:o.generateMask,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})}));if(o.finishRequest){o.finishRequest(b,e)}else{b.end()}}function emitErrorAndClose(e,t){e._readyState=WebSocket.CLOSING;e.emit("error",t);e.emitClose()}function netConnect(e){e.path=e.socketPath;return o.connect(e)}function tlsConnect(e){e.path=undefined;if(!e.servername&&e.servername!==""){e.servername=o.isIP(e.host)?"":e.host}return a.connect(e)}function abortHandshake(e,t,r){e._readyState=WebSocket.CLOSING;const n=new Error(r);Error.captureStackTrace(n,abortHandshake);if(t.setHeader){t[T]=true;t.abort();if(t.socket&&!t.socket.destroyed){t.socket.destroy()}process.nextTick(emitErrorAndClose,e,n)}else{t.destroy(n);t.once("error",e.emit.bind(e,"error"));t.once("close",e.emitClose.bind(e))}}function sendAfterClose(e,t,r){if(t){const r=R(t).length;if(e._socket)e._sender._bufferedBytes+=r;else e._bufferedAmount+=r}if(r){const t=new Error(`WebSocket is not open: readyState ${e.readyState} `+`(${P[e.readyState]})`);process.nextTick(r,t)}}function receiverOnConclude(e,t){const r=this[S];r._closeFrameReceived=true;r._closeMessage=t;r._closeCode=e;if(r._socket[S]===undefined)return;r._socket.removeListener("data",socketOnData);process.nextTick(resume,r._socket);if(e===1005)r.close();else r.close(e,t)}function receiverOnDrain(){const e=this[S];if(!e.isPaused)e._socket.resume()}function receiverOnError(e){const t=this[S];if(t._socket[S]!==undefined){t._socket.removeListener("data",socketOnData);process.nextTick(resume,t._socket);t.close(e[b])}t.emit("error",e)}function receiverOnFinish(){this[S].emitClose()}function receiverOnMessage(e,t){this[S].emit("message",e,t)}function receiverOnPing(e){const t=this[S];t.pong(e,!t._isServer,E);t.emit("ping",e)}function receiverOnPong(e){this[S].emit("pong",e)}function resume(e){e.resume()}function socketOnClose(){const e=this[S];this.removeListener("close",socketOnClose);this.removeListener("data",socketOnData);this.removeListener("end",socketOnEnd);e._readyState=WebSocket.CLOSING;let t;if(!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&(t=e._socket.read())!==null){e._receiver.write(t)}e._receiver.end();this[S]=undefined;clearTimeout(e._closeTimer);if(e._receiver._writableState.finished||e._receiver._writableState.errorEmitted){e.emitClose()}else{e._receiver.on("error",receiverOnFinish);e._receiver.on("finish",receiverOnFinish)}}function socketOnData(e){if(!this[S]._receiver.write(e)){this.pause()}}function socketOnEnd(){const e=this[S];e._readyState=WebSocket.CLOSING;e._receiver.end();this.end()}function socketOnError(){const e=this[S];this.removeListener("error",socketOnError);this.on("error",E);if(e){e._readyState=WebSocket.CLOSING;this.destroy()}}},1529:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.helmChartModifiedEvent=void 0;const i=n(r(2361));t.helmChartModifiedEvent=new i.default},5020:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.computeSources=t.computeTemplated=t.computeChart=void 0;const s=r(6113);const o=r(798);const a=r(7147);const c=i(r(1917));const l=r(1017);const u=r(2037);function computeChart(e,t,r=[]){return n(this,void 0,void 0,(function*(){let n;if(r.length===0){({stdout:n}=yield(0,o.$)`helm template --name-template ${t} ${e}`)}else if(r.length===1){({stdout:n}=yield(0,o.$)`helm template --name-template ${t} ${e} --values ${r.at(0)}`)}else if(r.length===2){({stdout:n}=yield(0,o.$)`helm template --name-template ${t} ${e} --values ${r.at(0)} --values ${r.at(1)}`)}const{templated:i}=yield computeTemplated(n);const{sources:s}=yield computeSources(n,e);const{version:a,name:l}=c.default.load(s["Chart.yaml"]);return{name:l,version:a,templated:i,sources:s}}))}t.computeChart=computeChart;function computeTemplated(e){var t;return n(this,void 0,void 0,(function*(){const r={templated:{}};const n=e.split("---");for(const e of n){const n=c.default.load(e);if(n){if(!r["templated"][n.kind]){r["templated"][n.kind]={}}r["templated"][n.kind][(t=n===null||n===void 0?void 0:n.metadata)===null||t===void 0?void 0:t.name.replaceAll("-","_")]=e}}return r}))}t.computeTemplated=computeTemplated;function computeSources(e,t){var r;return n(this,void 0,void 0,(function*(){const n=`${(0,u.tmpdir)()}/${(0,s.randomUUID)()}`;(0,a.mkdirSync)(n,{recursive:true});(0,a.mkdirSync)(`${n}/sources`,{recursive:true});(0,a.mkdirSync)(`${n}/templated`,{recursive:true});const i={sources:{}};const o=e.split("---");for(const e of o){const t=c.default.load(e);if(t){const i=t.kind+"_"+((r=t===null||t===void 0?void 0:t.metadata)===null||r===void 0?void 0:r.name.replaceAll("-","_"));(0,a.writeFileSync)(`${n}/templated/${i}.yaml`,e)}}const f=(0,a.readdirSync)(t);for(const e of f.filter((e=>!e.includes("tgz")))){const r=(0,l.join)(t,e);if(!(0,a.statSync)(r).isDirectory()){const t=(0,a.readFileSync)(r);i["sources"][e]=String(t)}}return i}))}t.computeSources=computeSources},7017:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.decrypt=t.encrypt=void 0;const i=n(r(4134));function encrypt(e,t){return i.default.AES.encrypt(e,t).toString()}t.encrypt=encrypt;function decrypt(e,t){const r=i.default.AES.decrypt(e,t);return r.toString(i.default.enc.Utf8)}t.decrypt=decrypt},7893:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.watchHelmChartFilesModifications=void 0;const s=i(r(2677));const o=r(1529);function watchHelmChartFilesModifications(e){return n(this,void 0,void 0,(function*(){s.default.watch(e).on("all",((e,t)=>{o.helmChartModifiedEvent.emit("changed",t)}))}))}t.watchHelmChartFilesModifications=watchHelmChartFilesModifications},2620:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.isChartFolder=void 0;const i=n(r(7561));function isChartFolder(e){const t=i.default.readdirSync(e);return t.includes("Chart.yaml")}t.isChartFolder=isChartFolder},6601:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getArguments=void 0;const n=r(6005);const i=r(7261);function getArguments(){return(0,i.parseArgs)({options:{watch:{type:"boolean",short:"w",default:false},push:{type:"boolean",short:"p",default:false},encryptionKey:{type:"string",short:"k",default:(0,n.randomUUID)()},browser:{type:"string",short:"b",default:"default"},values:{type:"string",short:"v",multiple:true,default:[]},help:{type:"boolean",short:"h",default:false},name:{type:"string",short:"n",default:"release-name"}},allowPositionals:true})}t.getArguments=getArguments},8597:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.serverFileTemporary=void 0;const i=n(r(3685));const s=n(r(385));function serverFileTemporary(e,t){return new Promise((r=>{const n=i.default.createServer(((i,o)=>{const a={"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"OPTIONS, POST, GET"};if(i.method==="OPTIONS"){o.writeHead(200,a);o.end();return}o.writeHead(200,a);o.end(JSON.stringify(e),"utf-8");console.log(s.default.cyanBright(`Closing server on port ${t}...`));n.close((()=>{r(undefined)}));setTimeout((()=>{n.emit("close")}),100)}));n.listen(t)}))}t.serverFileTemporary=serverFileTemporary},5989:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.startWebsocketServer=void 0;const s=i(r(385));const o=r(8867);const a=r(1529);const c=r(5020);function startWebsocketServer(e,t){const r=new o.WebSocketServer({port:12096});console.log(s.default.cyanBright(`⚡️ Web socket started on 12096`));console.log(s.default.cyanBright(`Don't touch this terminal anymore and see your chart change directly in the browser`));r.on("connection",(function connection(r){r.on("error",console.error);a.helmChartModifiedEvent.addListener("changed",(i=>n(this,void 0,void 0,(function*(){try{const n=yield(0,c.computeChart)(e,t);r.send(JSON.stringify({filePath:i,chartContentUpdated:n,error:null}))}catch(e){r.send(JSON.stringify({filePath:null,chartContentUpdated:null,error:e.stderr}))}}))))}))}t.startWebsocketServer=startWebsocketServer},6144:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const s=r(2620);const o=r(7147);const a=r(6113);const c=i(r(385));const l=r(2037);const u=r(8597);const f=i(r(5768));const h=i(r(1917));const d=r(7017);const p=i(r(7147));const m=r(5989);const v=r(7893);const _=r(6601);const g=r(5020);const y=process.env.NODE_ENV==="development"?"http://localhost:3000":"https://helm-viewer.vercel.app";function run(){var e,t;return n(this,void 0,void 0,(function*(){const r=(0,_.getArguments)();if(r.values.help){console.log(`\nhelm-viewer v0.7.6\n\n -b/--browser: allow to open with a specific browser (firefox, chromium)\n -h/--help: displays this menu\n -k/--encryptionKey: specify the encryption key\n -n/--name: provide a release name to Helm\n -p/--push: push the result of the build online and returns an URL\n -v/--values: provide values files for the chart, can be provided several times\n -w/--watch: activate the watch mode\n\n # When you are in a chart helm folder\n helm-viewer\n \n # To target a specific path\n helm-viewer path/of/the/chart\n \n # To compute the chart with an external values file\n helm-viewer path/of/the/chart --values path/of/the/values/file1 --values path/of/the/values/file2\n \n # To get a public link (with encrypted data)\n helm-viewer path/of/the/chart --push\n `);process.exit(0)}const n=(e=r.positionals.at(0))!==null&&e!==void 0?e:process.cwd();const i=r.values.values;console.log(c.default.cyanBright(`⚡️ Path detected ${n}`));console.log(i.length>0?c.default.greenBright(`🔑 Values detected : ${i.join(",")}`):c.default.yellowBright(`⚠️ No value detected, computing with default values in the Chart`));const u=`${(0,l.tmpdir)()}/${(0,a.randomUUID)()}`;(0,o.mkdirSync)(u,{recursive:true});(0,o.mkdirSync)(`${u}/sources`,{recursive:true});(0,o.mkdirSync)(`${u}/templated`,{recursive:true});if(!(0,s.isChartFolder)(n)){console.log("Not a chart folder");process.exit(1)}let f;try{f=yield(0,g.computeChart)(n,r.values.name,i)}catch(e){console.log("\n");console.log(c.default.bgRedBright("The computation of the chart failed. (message below)"));console.log(e.message);console.log("\n");process.exit(1)}if(r.values.push){yield pushOnlineFunction(f,r.values.encryptionKey)}else{yield serveLocally(f,n,r.values.watch,(t=r.values.browser)!==null&&t!==void 0?t:null,r.values.name)}process.exit(0)}))}function pushOnlineFunction(e,t){return n(this,void 0,void 0,(function*(){const r=(0,a.randomUUID)();const{version:n,name:i}=h.default.load(e.sources["Chart.yaml"]);const s={chartVersion:n,chartName:i,content:(0,d.encrypt)(JSON.stringify(e),t)};yield fetch(`${y}/api/chart-upload`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:JSON.stringify(s),chartId:r})});console.log("");console.log(`${y}?id=${r}&encryptionKey=${t}&online=true`);console.log("");p.default.writeFileSync(".helm-viewer-url",`${y}?id=${r}&encryptionKey=${t}&online=true`)}))}function serveLocally(e,t,r,i,s){return n(this,void 0,void 0,(function*(){const n=(0,a.randomUUID)();if(process.env.NODE_ENV==="development"){(0,f.default)(`${y}?id=${n}`,{app:{name:"firefox"}})}else{if(i!=="default"){(0,f.default)(`${y}?id=${n}`,{app:{name:i}})}else{(0,f.default)(`${y}?id=${n}`)}}const{version:o,name:c}=h.default.load(e.sources["Chart.yaml"]);yield Promise.all([(0,u.serverFileTemporary)(JSON.stringify(e),12094),(0,u.serverFileTemporary)({chartName:c,chartVersion:o},12095)]);if(r){(0,m.startWebsocketServer)(t,s);(0,v.watchHelmChartFilesModifications)(t);yield new Promise((e=>setTimeout(e,1e8)))}}))}run()},2982:(e,t,r)=>{e.exports=require(r.ab+"fsevents.node")},1269:module=>{module.exports=eval("require")("bufferutil")},4592:module=>{module.exports=eval("require")("utf-8-validate")},4300:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1808:e=>{"use strict";e.exports=require("net")},6005:e=>{"use strict";e.exports=require("node:crypto")},7561:e=>{"use strict";e.exports=require("node:fs")},612:e=>{"use strict";e.exports=require("node:os")},7742:e=>{"use strict";e.exports=require("node:process")},7261:e=>{"use strict";e.exports=require("node:util")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},2781:e=>{"use strict";e.exports=require("stream")},4404:e=>{"use strict";e.exports=require("tls")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},9796:e=>{"use strict";e.exports=require("zlib")},385:(e,t,r)=>{"use strict";r.r(t);r.d(t,{Chalk:()=>Chalk,backgroundColorNames:()=>a,backgroundColors:()=>a,chalkStderr:()=>R,colorNames:()=>c,colors:()=>c,default:()=>O,foregroundColorNames:()=>o,foregroundColors:()=>o,modifierNames:()=>s,modifiers:()=>s,supportsColor:()=>g,supportsColorStderr:()=>y});const n=10;const wrapAnsi16=(e=0)=>t=>`[${t+e}m`;const wrapAnsi256=(e=0)=>t=>`[${38+e};5;${t}m`;const wrapAnsi16m=(e=0)=>(t,r,n)=>`[${38+e};2;${t};${r};${n}m`;const i={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};const s=Object.keys(i.modifier);const o=Object.keys(i.color);const a=Object.keys(i.bgColor);const c=[...o,...a];function assembleStyles(){const e=new Map;for(const[t,r]of Object.entries(i)){for(const[t,n]of Object.entries(r)){i[t]={open:`[${n[0]}m`,close:`[${n[1]}m`};r[t]=i[t];e.set(n[0],n[1])}Object.defineProperty(i,t,{value:r,enumerable:false})}Object.defineProperty(i,"codes",{value:e,enumerable:false});i.color.close="";i.bgColor.close="";i.color.ansi=wrapAnsi16();i.color.ansi256=wrapAnsi256();i.color.ansi16m=wrapAnsi16m();i.bgColor.ansi=wrapAnsi16(n);i.bgColor.ansi256=wrapAnsi256(n);i.bgColor.ansi16m=wrapAnsi16m(n);Object.defineProperties(i,{rgbToAnsi256:{value(e,t,r){if(e===t&&t===r){if(e<8){return 16}if(e>248){return 231}return Math.round((e-8)/247*24)+232}return 16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)},enumerable:false},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t){return[0,0,0]}let[r]=t;if(r.length===3){r=[...r].map((e=>e+e)).join("")}const n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:false},hexToAnsi256:{value:e=>i.rgbToAnsi256(...i.hexToRgb(e)),enumerable:false},ansi256ToAnsi:{value(e){if(e<8){return 30+e}if(e<16){return 90+(e-8)}let t;let r;let n;if(e>=232){t=((e-232)*10+8)/255;r=t;n=t}else{e-=16;const i=e%36;t=Math.floor(e/36)/5;r=Math.floor(i/6)/5;n=i%6/5}const i=Math.max(t,r,n)*2;if(i===0){return 30}let s=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));if(i===2){s+=60}return s},enumerable:false},rgbToAnsi:{value:(e,t,r)=>i.ansi256ToAnsi(i.rgbToAnsi256(e,t,r)),enumerable:false},hexToAnsi:{value:e=>i.ansi256ToAnsi(i.hexToAnsi256(e)),enumerable:false}});return i}const l=assembleStyles();const u=l;var f=r(7742);var h=r(612);const d=require("node:tty");function hasFlag(e,t=(globalThis.Deno?globalThis.Deno.args:f.argv)){const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}const{env:p}=f;let m;if(hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")){m=0}else if(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always")){m=1}function envForceColor(){if("FORCE_COLOR"in p){if(p.FORCE_COLOR==="true"){return 1}if(p.FORCE_COLOR==="false"){return 0}return p.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(p.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function _supportsColor(e,{streamIsTTY:t,sniffFlags:r=true}={}){const n=envForceColor();if(n!==undefined){m=n}const i=r?m:n;if(i===0){return 0}if(r){if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor")){return 3}if(hasFlag("color=256")){return 2}}if("TF_BUILD"in p&&"AGENT_NAME"in p){return 1}if(e&&!t&&i===undefined){return 0}const s=i||0;if(p.TERM==="dumb"){return s}if(f.platform==="win32"){const e=h.release().split(".");if(Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in p){if("GITHUB_ACTIONS"in p||"GITEA_ACTIONS"in p){return 3}if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((e=>e in p))||p.CI_NAME==="codeship"){return 1}return s}if("TEAMCITY_VERSION"in p){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(p.TEAMCITY_VERSION)?1:0}if(p.COLORTERM==="truecolor"){return 3}if(p.TERM==="xterm-kitty"){return 3}if("TERM_PROGRAM"in p){const e=Number.parseInt((p.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(p.TERM_PROGRAM){case"iTerm.app":{return e>=3?3:2}case"Apple_Terminal":{return 2}}}if(/-256(color)?$/i.test(p.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(p.TERM)){return 1}if("COLORTERM"in p){return 1}return s}function createSupportsColor(e,t={}){const r=_supportsColor(e,{streamIsTTY:e&&e.isTTY,...t});return translateLevel(r)}const v={stdout:createSupportsColor({isTTY:d.isatty(1)}),stderr:createSupportsColor({isTTY:d.isatty(2)})};const _=v;function stringReplaceAll(e,t,r){let n=e.indexOf(t);if(n===-1){return e}const i=t.length;let s=0;let o="";do{o+=e.slice(s,n)+t+r;s=n+i;n=e.indexOf(t,s)}while(n!==-1);o+=e.slice(s);return o}function stringEncaseCRLFWithFirstIndex(e,t,r,n){let i=0;let s="";do{const o=e[n-1]==="\r";s+=e.slice(i,o?n-1:n)+t+(o?"\r\n":"\n")+r;i=n+1;n=e.indexOf("\n",i)}while(n!==-1);s+=e.slice(i);return s}const{stdout:g,stderr:y}=_;const w=Symbol("GENERATOR");const b=Symbol("STYLER");const S=Symbol("IS_EMPTY");const E=["ansi","ansi","ansi256","ansi16m"];const x=Object.create(null);const applyOptions=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const r=g?g.level:0;e.level=t.level===undefined?r:t.level};class Chalk{constructor(e){return chalkFactory(e)}}const chalkFactory=e=>{const chalk=(...e)=>e.join(" ");applyOptions(chalk,e);Object.setPrototypeOf(chalk,createChalk.prototype);return chalk};function createChalk(e){return chalkFactory(e)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(const[e,t]of Object.entries(u)){x[e]={get(){const r=createBuilder(this,createStyler(t.open,t.close,this[b]),this[S]);Object.defineProperty(this,e,{value:r});return r}}}x.visible={get(){const e=createBuilder(this,this[b],true);Object.defineProperty(this,"visible",{value:e});return e}};const getModelAnsi=(e,t,r,...n)=>{if(e==="rgb"){if(t==="ansi16m"){return u[r].ansi16m(...n)}if(t==="ansi256"){return u[r].ansi256(u.rgbToAnsi256(...n))}return u[r].ansi(u.rgbToAnsi(...n))}if(e==="hex"){return getModelAnsi("rgb",t,r,...u.hexToRgb(...n))}return u[r][e](...n)};const A=["rgb","hex","ansi256"];for(const e of A){x[e]={get(){const{level:t}=this;return function(...r){const n=createStyler(getModelAnsi(e,E[t],"color",...r),u.color.close,this[b]);return createBuilder(this,n,this[S])}}};const t="bg"+e[0].toUpperCase()+e.slice(1);x[t]={get(){const{level:t}=this;return function(...r){const n=createStyler(getModelAnsi(e,E[t],"bgColor",...r),u.bgColor.close,this[b]);return createBuilder(this,n,this[S])}}}}const k=Object.defineProperties((()=>{}),{...x,level:{enumerable:true,get(){return this[w].level},set(e){this[w].level=e}}});const createStyler=(e,t,r)=>{let n;let i;if(r===undefined){n=e;i=t}else{n=r.openAll+e;i=t+r.closeAll}return{open:e,close:t,openAll:n,closeAll:i,parent:r}};const createBuilder=(e,t,r)=>{const builder=(...e)=>applyStyle(builder,e.length===1?""+e[0]:e.join(" "));Object.setPrototypeOf(builder,k);builder[w]=e;builder[b]=t;builder[S]=r;return builder};const applyStyle=(e,t)=>{if(e.level<=0||!t){return e[S]?"":t}let r=e[b];if(r===undefined){return t}const{openAll:n,closeAll:i}=r;if(t.includes("")){while(r!==undefined){t=stringReplaceAll(t,r.close,r.open);r=r.parent}}const s=t.indexOf("\n");if(s!==-1){t=stringEncaseCRLFWithFirstIndex(t,i,n,s)}return n+t+i};Object.defineProperties(createChalk.prototype,x);const C=createChalk();const R=createChalk({level:y?y.level:0});const O=C},798:(e,t,r)=>{"use strict";r.r(t);r.d(t,{$:()=>X,execa:()=>execa,execaCommand:()=>execaCommand,execaCommandSync:()=>execaCommandSync,execaNode:()=>execaNode,execaSync:()=>execaSync});const n=require("node:buffer");const i=require("node:path");const s=require("node:child_process");var o=r(7742);var a=r(2746);function stripFinalNewline(e){const t=typeof e==="string"?"\n":"\n".charCodeAt();const r=typeof e==="string"?"\r":"\r".charCodeAt();if(e[e.length-1]===t){e=e.slice(0,-1)}if(e[e.length-1]===r){e=e.slice(0,-1)}return e}const c=require("node:url");function pathKey(e={}){const{env:t=process.env,platform:r=process.platform}=e;if(r!=="win32"){return"PATH"}return Object.keys(t).reverse().find((e=>e.toUpperCase()==="PATH"))||"Path"}function npmRunPath(e={}){const{cwd:t=o.cwd(),path:r=o.env[pathKey()],execPath:n=o.execPath}=e;let s;const a=t instanceof URL?c.fileURLToPath(t):t;let l=i.resolve(a);const u=[];while(s!==l){u.push(i.join(l,"node_modules/.bin"));s=l;l=i.resolve(l,"..")}u.push(i.resolve(a,n,".."));return[...u,r].join(i.delimiter)}function npmRunPathEnv({env:e=o.env,...t}={}){e={...e};const r=pathKey({env:e});t.path=e[r];e[r]=npmRunPath(t);return e}const copyProperty=(e,t,r,n)=>{if(r==="length"||r==="prototype"){return}if(r==="arguments"||r==="caller"){return}const i=Object.getOwnPropertyDescriptor(e,r);const s=Object.getOwnPropertyDescriptor(t,r);if(!canCopyProperty(i,s)&&n){return}Object.defineProperty(e,r,s)};const canCopyProperty=function(e,t){return e===undefined||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)};const changePrototype=(e,t)=>{const r=Object.getPrototypeOf(t);if(r===Object.getPrototypeOf(e)){return}Object.setPrototypeOf(e,r)};const wrappedToString=(e,t)=>`/* Wrapped ${e}*/\n${t}`;const l=Object.getOwnPropertyDescriptor(Function.prototype,"toString");const u=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");const changeToString=(e,t,r)=>{const n=r===""?"":`with ${r.trim()}() `;const i=wrappedToString.bind(null,n,t.toString());Object.defineProperty(i,"name",u);Object.defineProperty(e,"toString",{...l,value:i})};function mimicFunction(e,t,{ignoreNonConfigurable:r=false}={}){const{name:n}=e;for(const n of Reflect.ownKeys(t)){copyProperty(e,t,n,r)}changePrototype(e,t);changeToString(e,t,n);return e}const f=new WeakMap;const onetime=(e,t={})=>{if(typeof e!=="function"){throw new TypeError("Expected a function")}let r;let n=0;const i=e.displayName||e.name||"<anonymous>";const onetime=function(...s){f.set(onetime,++n);if(n===1){r=e.apply(this,s);e=null}else if(t.throw===true){throw new Error(`Function \`${i}\` can only be called once`)}return r};mimicFunction(onetime,e);f.set(onetime,n);return onetime};onetime.callCount=e=>{if(!f.has(e)){throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`)}return f.get(e)};const h=onetime;var d=r(612);const getRealtimeSignals=()=>{const e=m-p+1;return Array.from({length:e},getRealtimeSignal)};const getRealtimeSignal=(e,t)=>({name:`SIGRT${t+1}`,number:p+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"});const p=34;const m=64;const v=[{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:true},{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:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{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"}];const getSignals=()=>{const e=getRealtimeSignals();const t=[...v,...e].map(normalizeSignal);return t};const normalizeSignal=({name:e,number:t,description:r,action:n,forced:i=false,standard:s})=>{const{signals:{[e]:o}}=d.constants;const a=o!==undefined;const c=a?o:t;return{name:e,number:c,description:r,supported:a,action:n,forced:i,standard:s}};const getSignalsByName=()=>{const e=getSignals();return Object.fromEntries(e.map(getSignalByName))};const getSignalByName=({name:e,number:t,description:r,supported:n,action:i,forced:s,standard:o})=>[e,{name:e,number:t,description:r,supported:n,action:i,forced:s,standard:o}];const _=getSignalsByName();const getSignalsByNumber=()=>{const e=getSignals();const t=m+1;const r=Array.from({length:t},((t,r)=>getSignalByNumber(r,e)));return Object.assign({},...r)};const getSignalByNumber=(e,t)=>{const r=findSignalByNumber(e,t);if(r===undefined){return{}}const{name:n,description:i,supported:s,action:o,forced:a,standard:c}=r;return{[e]:{name:n,number:e,description:i,supported:s,action:o,forced:a,standard:c}}};const findSignalByNumber=(e,t)=>{const r=t.find((({name:t})=>d.constants.signals[t]===e));if(r!==undefined){return r}return t.find((t=>t.number===e))};const g=getSignalsByNumber();const getErrorPrefix=({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:i,exitCode:s,isCanceled:o})=>{if(e){return`timed out after ${t} milliseconds`}if(o){return"was canceled"}if(r!==undefined){return`failed with ${r}`}if(n!==undefined){return`was killed with ${n} (${i})`}if(s!==undefined){return`failed with exit code ${s}`}return"failed"};const makeError=({stdout:e,stderr:t,all:r,error:n,signal:i,exitCode:s,command:a,escapedCommand:c,timedOut:l,isCanceled:u,killed:f,parsed:{options:{timeout:h,cwd:d=o.cwd()}}})=>{s=s===null?undefined:s;i=i===null?undefined:i;const p=i===undefined?undefined:_[i].description;const m=n&&n.code;const v=getErrorPrefix({timedOut:l,timeout:h,errorCode:m,signal:i,signalDescription:p,exitCode:s,isCanceled:u});const g=`Command ${v}: ${a}`;const y=Object.prototype.toString.call(n)==="[object Error]";const w=y?`${g}\n${n.message}`:g;const b=[w,t,e].filter(Boolean).join("\n");if(y){n.originalMessage=n.message;n.message=b}else{n=new Error(b)}n.shortMessage=w;n.command=a;n.escapedCommand=c;n.exitCode=s;n.signal=i;n.signalDescription=p;n.stdout=e;n.stderr=t;n.cwd=d;if(r!==undefined){n.all=r}if("bufferedData"in n){delete n.bufferedData}n.failed=true;n.timedOut=Boolean(l);n.isCanceled=u;n.killed=f&&!l;return n};const y=["stdin","stdout","stderr"];const hasAlias=e=>y.some((t=>e[t]!==undefined));const normalizeStdio=e=>{if(!e){return}const{stdio:t}=e;if(t===undefined){return y.map((t=>e[t]))}if(hasAlias(e)){throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${y.map((e=>`\`${e}\``)).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,y.length);return Array.from({length:r},((e,r)=>t[r]))};const normalizeStdioNode=e=>{const t=normalizeStdio(e);if(t==="ipc"){return"ipc"}if(t===undefined||typeof t==="string"){return[t,t,t,"ipc"]}if(t.includes("ipc")){return t}return[...t,"ipc"]};const w=[];w.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32"){w.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){w.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")}const processOk=e=>!!e&&typeof e==="object"&&typeof e.removeListener==="function"&&typeof e.emit==="function"&&typeof e.reallyExit==="function"&&typeof e.listeners==="function"&&typeof e.kill==="function"&&typeof e.pid==="number"&&typeof e.on==="function";const b=Symbol.for("signal-exit emitter");const S=globalThis;const E=Object.defineProperty.bind(Object);class Emitter{emitted={afterExit:false,exit:false};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(S[b]){return S[b]}E(S,b,{value:this,writable:false,enumerable:false,configurable:false})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const r=this.listeners[e];const n=r.indexOf(t);if(n===-1){return}if(n===0&&r.length===1){r.length=0}else{r.splice(n,1)}}emit(e,t,r){if(this.emitted[e]){return false}this.emitted[e]=true;let n=false;for(const i of this.listeners[e]){n=i(t,r)===true||n}if(e==="exit"){n=this.emit("afterExit",t,r)||n}return n}}class SignalExitBase{}const signalExitWrap=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}});class SignalExitFallback extends SignalExitBase{onExit(){return()=>{}}load(){}unload(){}}class SignalExit extends SignalExitBase{#e=x.platform==="win32"?"SIGINT":"SIGHUP";#t=new Emitter;#r;#n;#i;#s={};#o=false;constructor(e){super();this.#r=e;this.#s={};for(const t of w){this.#s[t]=()=>{const r=this.#r.listeners(t);let{count:n}=this.#t;const i=e;if(typeof i.__signal_exit_emitter__==="object"&&typeof i.__signal_exit_emitter__.count==="number"){n+=i.__signal_exit_emitter__.count}if(r.length===n){this.unload();const r=this.#t.emit("exit",null,t);const n=t==="SIGHUP"?this.#e:t;if(!r)e.kill(e.pid,n)}}}this.#i=e.reallyExit;this.#n=e.emit}onExit(e,t){if(!processOk(this.#r)){return()=>{}}if(this.#o===false){this.load()}const r=t?.alwaysLast?"afterExit":"exit";this.#t.on(r,e);return()=>{this.#t.removeListener(r,e);if(this.#t.listeners["exit"].length===0&&this.#t.listeners["afterExit"].length===0){this.unload()}}}load(){if(this.#o){return}this.#o=true;this.#t.count+=1;for(const e of w){try{const t=this.#s[e];if(t)this.#r.on(e,t)}catch(e){}}this.#r.emit=(e,...t)=>this.#a(e,...t);this.#r.reallyExit=e=>this.#c(e)}unload(){if(!this.#o){return}this.#o=false;w.forEach((e=>{const t=this.#s[e];if(!t){throw new Error("Listener not defined for signal: "+e)}try{this.#r.removeListener(e,t)}catch(e){}}));this.#r.emit=this.#n;this.#r.reallyExit=this.#i;this.#t.count-=1}#c(e){if(!processOk(this.#r)){return 0}this.#r.exitCode=e||0;this.#t.emit("exit",this.#r.exitCode,null);return this.#i.call(this.#r,this.#r.exitCode)}#a(e,...t){const r=this.#n;if(e==="exit"&&processOk(this.#r)){if(typeof t[0]==="number"){this.#r.exitCode=t[0]}const n=r.call(this.#r,e,...t);this.#t.emit("exit",this.#r.exitCode,null);return n}else{return r.call(this.#r,e,...t)}}}const x=globalThis.process;const{onExit:A,load:k,unload:C}=signalExitWrap(processOk(x)?new SignalExit(x):new SignalExitFallback);const R=1e3*5;const spawnedKill=(e,t="SIGTERM",r={})=>{const n=e(t);setKillTimeout(e,t,r,n);return n};const setKillTimeout=(e,t,r,n)=>{if(!shouldForceKill(t,r,n)){return}const i=getForceKillAfterTimeout(r);const s=setTimeout((()=>{e("SIGKILL")}),i);if(s.unref){s.unref()}};const shouldForceKill=(e,{forceKillAfterTimeout:t},r)=>isSigterm(e)&&t!==false&&r;const isSigterm=e=>e===d.constants.signals.SIGTERM||typeof e==="string"&&e.toUpperCase()==="SIGTERM";const getForceKillAfterTimeout=({forceKillAfterTimeout:e=true})=>{if(e===true){return R}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};const spawnedCancel=(e,t)=>{const r=e.kill();if(r){t.isCanceled=true}};const timeoutKill=(e,t,r)=>{e.kill(t);r(Object.assign(new Error("Timed out"),{timedOut:true,signal:t}))};const setupTimeout=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(t===0||t===undefined){return n}let i;const s=new Promise(((n,s)=>{i=setTimeout((()=>{timeoutKill(e,r,s)}),t)}));const o=n.finally((()=>{clearTimeout(i)}));return Promise.race([s,o])};const validateTimeout=({timeout:e})=>{if(e!==undefined&&(!Number.isFinite(e)||e<0)){throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)}};const setExitHandler=async(e,{cleanup:t,detached:r},n)=>{if(!t||r){return n}const i=A((()=>{e.kill()}));return n.finally((()=>{i()}))};var O=r(7561);function isStream(e){return e!==null&&typeof e==="object"&&typeof e.pipe==="function"}function isWritableStream(e){return isStream(e)&&e.writable!==false&&typeof e._write==="function"&&typeof e._writableState==="object"}function isReadableStream(e){return isStream(e)&&e.readable!==false&&typeof e._read==="function"&&typeof e._readableState==="object"}function isDuplexStream(e){return isWritableStream(e)&&isReadableStream(e)}function isTransformStream(e){return isDuplexStream(e)&&typeof e._transform==="function"}const isExecaChildProcess=e=>e instanceof s.ChildProcess&&typeof e.then==="function";const pipeToTarget=(e,t,r)=>{if(typeof r==="string"){e[t].pipe((0,O.createWriteStream)(r));return e}if(isWritableStream(r)){e[t].pipe(r);return e}if(!isExecaChildProcess(r)){throw new TypeError("The second argument must be a string, a stream or an Execa child process.")}if(!isWritableStream(r.stdin)){throw new TypeError("The target child process's stdin must be available.")}e[t].pipe(r.stdin);return r};const addPipeMethods=e=>{if(e.stdout!==null){e.pipeStdout=pipeToTarget.bind(undefined,e,"stdout")}if(e.stderr!==null){e.pipeStderr=pipeToTarget.bind(undefined,e,"stderr")}if(e.all!==undefined){e.pipeAll=pipeToTarget.bind(undefined,e,"all")}};const T=require("node:timers/promises");const contents_getStreamContents=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:i,addChunk:s,getFinalChunk:o,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{if(!isAsyncIterable(e)){throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.")}const l=t();l.length=0;try{for await(const t of e){const e=getChunkType(t);const o=r[e](t,l);appendChunk({convertedChunk:o,state:l,getSize:n,truncateChunk:i,addChunk:s,maxBuffer:c})}appendFinalChunk({state:l,convertChunk:r,getSize:n,truncateChunk:i,addChunk:s,getFinalChunk:o,maxBuffer:c});return a(l)}catch(e){e.bufferedData=a(l);throw e}};const appendFinalChunk=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:i,maxBuffer:s})=>{const o=i(e);if(o!==undefined){appendChunk({convertedChunk:o,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:s})}};const appendChunk=({convertedChunk:e,state:t,getSize:r,truncateChunk:n,addChunk:i,maxBuffer:s})=>{const o=r(e);const a=t.length+o;if(a<=s){addNewChunk(e,t,i,a);return}const c=n(e,s-t.length);if(c!==undefined){addNewChunk(c,t,i,s)}throw new MaxBufferError};const addNewChunk=(e,t,r,n)=>{t.contents=r(e,t,n);t.length=n};const isAsyncIterable=e=>typeof e==="object"&&e!==null&&typeof e[Symbol.asyncIterator]==="function";const getChunkType=e=>{const t=typeof e;if(t==="string"){return"string"}if(t!=="object"||e===null){return"others"}if(globalThis.Buffer?.isBuffer(e)){return"buffer"}const r=I.call(e);if(r==="[object ArrayBuffer]"){return"arrayBuffer"}if(r==="[object DataView]"){return"dataView"}if(Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&I.call(e.buffer)==="[object ArrayBuffer]"){return"typedArray"}return"others"};const{toString:I}=Object.prototype;class MaxBufferError extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const identity=e=>e;const noop=()=>undefined;const getContentsProp=({contents:e})=>e;const throwObjectStream=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)};const getLengthProp=e=>e.length;async function getStreamAsArray(e,t){return getStreamContents(e,P,t)}const initArray=()=>({contents:[]});const increment=()=>1;const addArrayChunk=(e,{contents:t})=>{t.push(e);return t};const P={init:initArray,convertChunk:{string:identity,buffer:identity,arrayBuffer:identity,dataView:identity,typedArray:identity,others:identity},getSize:increment,truncateChunk:noop,addChunk:addArrayChunk,getFinalChunk:noop,finalize:getContentsProp};async function getStreamAsArrayBuffer(e,t){return contents_getStreamContents(e,B,t)}const initArrayBuffer=()=>({contents:new ArrayBuffer(0)});const useTextEncoder=e=>L.encode(e);const L=new TextEncoder;const useUint8Array=e=>new Uint8Array(e);const useUint8ArrayWithOffset=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);const truncateArrayBufferChunk=(e,t)=>e.slice(0,t);const addArrayBufferChunk=(e,{contents:t,length:r},n)=>{const i=hasArrayBufferResize()?resizeArrayBuffer(t,n):resizeArrayBufferSlow(t,n);new Uint8Array(i).set(e,r);return i};const resizeArrayBufferSlow=(e,t)=>{if(t<=e.byteLength){return e}const r=new ArrayBuffer(getNewContentsLength(t));new Uint8Array(r).set(new Uint8Array(e),0);return r};const resizeArrayBuffer=(e,t)=>{if(t<=e.maxByteLength){e.resize(t);return e}const r=new ArrayBuffer(t,{maxByteLength:getNewContentsLength(t)});new Uint8Array(r).set(new Uint8Array(e),0);return r};const getNewContentsLength=e=>N**Math.ceil(Math.log(e)/Math.log(N));const N=2;const finalizeArrayBuffer=({contents:e,length:t})=>hasArrayBufferResize()?e:e.slice(0,t);const hasArrayBufferResize=()=>"resize"in ArrayBuffer.prototype;const B={init:initArrayBuffer,convertChunk:{string:useTextEncoder,buffer:useUint8Array,arrayBuffer:useUint8Array,dataView:useUint8ArrayWithOffset,typedArray:useUint8ArrayWithOffset,others:throwObjectStream},getSize:getLengthProp,truncateChunk:truncateArrayBufferChunk,addChunk:addArrayBufferChunk,getFinalChunk:noop,finalize:finalizeArrayBuffer};async function getStreamAsBuffer(e,t){if(!("Buffer"in globalThis)){throw new Error("getStreamAsBuffer() is only supported in Node.js")}try{return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(e,t))}catch(e){if(e.bufferedData!==undefined){e.bufferedData=arrayBufferToNodeBuffer(e.bufferedData)}throw e}}const arrayBufferToNodeBuffer=e=>globalThis.Buffer.from(e);async function getStreamAsString(e,t){return contents_getStreamContents(e,H,t)}const initString=()=>({contents:"",textDecoder:new TextDecoder});const useTextDecoder=(e,{textDecoder:t})=>t.decode(e,{stream:true});const addStringChunk=(e,{contents:t})=>t+e;const truncateStringChunk=(e,t)=>e.slice(0,t);const getFinalStringChunk=({textDecoder:e})=>{const t=e.decode();return t===""?undefined:t};const H={init:initString,convertChunk:{string:identity,buffer:useTextDecoder,arrayBuffer:useTextDecoder,dataView:useTextDecoder,typedArray:useTextDecoder,others:throwObjectStream},getSize:getLengthProp,truncateChunk:truncateStringChunk,addChunk:addStringChunk,getFinalChunk:getFinalStringChunk,finalize:getContentsProp};var W=r(2621);const validateInputOptions=e=>{if(e!==undefined){throw new TypeError("The `input` and `inputFile` options cannot be both set.")}};const getInputSync=({input:e,inputFile:t})=>{if(typeof t!=="string"){return e}validateInputOptions(e);return(0,O.readFileSync)(t)};const handleInputSync=e=>{const t=getInputSync(e);if(isStream(t)){throw new TypeError("The `input` option cannot be a stream in sync mode")}return t};const getInput=({input:e,inputFile:t})=>{if(typeof t!=="string"){return e}validateInputOptions(e);return(0,O.createReadStream)(t)};const handleInput=(e,t)=>{const r=getInput(t);if(r===undefined){return}if(isStream(r)){r.pipe(e.stdin)}else{e.stdin.end(r)}};const makeAllStream=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr){return}const r=W();if(e.stdout){r.add(e.stdout)}if(e.stderr){r.add(e.stderr)}return r};const getBufferedData=async(e,t)=>{if(!e||t===undefined){return}await(0,T.setTimeout)(0);e.destroy();try{return await t}catch(e){return e.bufferedData}};const getStreamPromise=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(!e||!r){return}if(t==="utf8"||t==="utf-8"){return getStreamAsString(e,{maxBuffer:n})}if(t===null||t==="buffer"){return getStreamAsBuffer(e,{maxBuffer:n})}return applyEncoding(e,n,t)};const applyEncoding=async(e,t,r)=>{const n=await getStreamAsBuffer(e,{maxBuffer:t});return n.toString(r)};const getSpawnedResult=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:s},o)=>{const a=getStreamPromise(e,{encoding:n,buffer:i,maxBuffer:s});const c=getStreamPromise(t,{encoding:n,buffer:i,maxBuffer:s});const l=getStreamPromise(r,{encoding:n,buffer:i,maxBuffer:s*2});try{return await Promise.all([o,a,c,l])}catch(n){return Promise.all([{error:n,signal:n.signal,timedOut:n.timedOut},getBufferedData(e,a),getBufferedData(t,c),getBufferedData(r,l)])}};const M=(async()=>{})().constructor.prototype;const D=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(M,e)]));const mergePromise=(e,t)=>{for(const[r,n]of D){const i=typeof t==="function"?(...e)=>Reflect.apply(n.value,t(),e):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:i})}};const getSpawnedPromise=e=>new Promise(((t,r)=>{e.on("exit",((e,r)=>{t({exitCode:e,signal:r})}));e.on("error",(e=>{r(e)}));if(e.stdin){e.stdin.on("error",(e=>{r(e)}))}}));const normalizeArgs=(e,t=[])=>{if(!Array.isArray(t)){return[e]}return[e,...t]};const j=/^[\w.-]+$/;const escapeArg=e=>{if(typeof e!=="string"||j.test(e)){return e}return`"${e.replaceAll('"','\\"')}"`};const joinCommand=(e,t)=>normalizeArgs(e,t).join(" ");const getEscapedCommand=(e,t)=>normalizeArgs(e,t).map((e=>escapeArg(e))).join(" ");const U=/ +/g;const parseCommand=e=>{const t=[];for(const r of e.trim().split(U)){const e=t.at(-1);if(e&&e.endsWith("\\")){t[t.length-1]=`${e.slice(0,-1)} ${r}`}else{t.push(r)}}return t};const parseExpression=e=>{const t=typeof e;if(t==="string"){return e}if(t==="number"){return String(e)}if(t==="object"&&e!==null&&!(e instanceof s.ChildProcess)&&"stdout"in e){const t=typeof e.stdout;if(t==="string"){return e.stdout}if(n.Buffer.isBuffer(e.stdout)){return e.stdout.toString()}throw new TypeError(`Unexpected "${t}" stdout in template expression`)}throw new TypeError(`Unexpected "${t}" in template expression`)};const concatTokens=(e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)];const parseTemplate=({templates:e,expressions:t,tokens:r,index:n,template:i})=>{const s=i??e.raw[n];const o=s.split(U).filter(Boolean);const a=concatTokens(r,o,s.startsWith(" "));if(n===t.length){return a}const c=t[n];const l=Array.isArray(c)?c.map((e=>parseExpression(e))):[parseExpression(c)];return concatTokens(a,l,s.endsWith(" "))};const parseTemplates=(e,t)=>{let r=[];for(const[n,i]of e.entries()){r=parseTemplate({templates:e,expressions:t,tokens:r,index:n,template:i})}return r};var G=r(7261);const z=(0,G.debuglog)("execa").enabled;const padField=(e,t)=>String(e).padStart(t,"0");const getTimestamp=()=>{const e=new Date;return`${padField(e.getHours(),2)}:${padField(e.getMinutes(),2)}:${padField(e.getSeconds(),2)}.${padField(e.getMilliseconds(),3)}`};const logCommand=(e,{verbose:t})=>{if(!t){return}o.stderr.write(`[${getTimestamp()}] ${e}\n`)};const Y=1e3*1e3*100;const getEnv=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{const s=t?{...o.env,...e}:e;if(r){return npmRunPathEnv({env:s,cwd:n,execPath:i})}return s};const handleArguments=(e,t,r={})=>{const n=a._parse(e,t,r);e=n.command;t=n.args;r=n.options;r={maxBuffer:Y,buffer:true,stripFinalNewline:true,extendEnv:true,preferLocal:false,localDir:r.cwd||o.cwd(),execPath:o.execPath,encoding:"utf8",reject:true,cleanup:true,all:false,windowsHide:true,verbose:z,...r};r.env=getEnv(r);r.stdio=normalizeStdio(r);if(o.platform==="win32"&&i.basename(e,".exe")==="cmd"){t.unshift("/q")}return{file:e,args:t,options:r,parsed:n}};const handleOutput=(e,t,r)=>{if(typeof t!=="string"&&!n.Buffer.isBuffer(t)){return r===undefined?undefined:""}if(e.stripFinalNewline){return stripFinalNewline(t)}return t};function execa(e,t,r){const n=handleArguments(e,t,r);const i=joinCommand(e,t);const o=getEscapedCommand(e,t);logCommand(o,n.options);validateTimeout(n.options);let a;try{a=s.spawn(n.file,n.args,n.options)}catch(e){const t=new s.ChildProcess;const r=Promise.reject(makeError({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:o,parsed:n,timedOut:false,isCanceled:false,killed:false}));mergePromise(t,r);return t}const c=getSpawnedPromise(a);const l=setupTimeout(a,n.options,c);const u=setExitHandler(a,n.options,l);const f={isCanceled:false};a.kill=spawnedKill.bind(null,a.kill.bind(a));a.cancel=spawnedCancel.bind(null,a,f);const handlePromise=async()=>{const[{error:e,exitCode:t,signal:r,timedOut:s},c,l,h]=await getSpawnedResult(a,n.options,u);const d=handleOutput(n.options,c);const p=handleOutput(n.options,l);const m=handleOutput(n.options,h);if(e||t!==0||r!==null){const c=makeError({error:e,exitCode:t,signal:r,stdout:d,stderr:p,all:m,command:i,escapedCommand:o,parsed:n,timedOut:s,isCanceled:f.isCanceled||(n.options.signal?n.options.signal.aborted:false),killed:a.killed});if(!n.options.reject){return c}throw c}return{command:i,escapedCommand:o,exitCode:0,stdout:d,stderr:p,all:m,failed:false,timedOut:false,isCanceled:false,killed:false}};const d=h(handlePromise);handleInput(a,n.options);a.all=makeAllStream(a,n.options);addPipeMethods(a);mergePromise(a,d);return a}function execaSync(e,t,r){const n=handleArguments(e,t,r);const i=joinCommand(e,t);const o=getEscapedCommand(e,t);logCommand(o,n.options);const a=handleInputSync(n.options);let c;try{c=s.spawnSync(n.file,n.args,{...n.options,input:a})}catch(e){throw makeError({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:o,parsed:n,timedOut:false,isCanceled:false,killed:false})}const l=handleOutput(n.options,c.stdout,c.error);const u=handleOutput(n.options,c.stderr,c.error);if(c.error||c.status!==0||c.signal!==null){const e=makeError({stdout:l,stderr:u,error:c.error,signal:c.signal,exitCode:c.status,command:i,escapedCommand:o,parsed:n,timedOut:c.error&&c.error.code==="ETIMEDOUT",isCanceled:false,killed:c.signal!==null});if(!n.options.reject){return e}throw e}return{command:i,escapedCommand:o,exitCode:0,stdout:l,stderr:u,failed:false,timedOut:false,isCanceled:false,killed:false}}const normalizeScriptStdin=({input:e,inputFile:t,stdio:r})=>e===undefined&&t===undefined&&r===undefined?{stdin:"inherit"}:{};const normalizeScriptOptions=(e={})=>({preferLocal:true,...normalizeScriptStdin(e),...e});function create$(e){function $(t,...r){if(!Array.isArray(t)){return create$({...e,...t})}const[n,...i]=parseTemplates(t,r);return execa(n,i,normalizeScriptOptions(e))}$.sync=(t,...r)=>{if(!Array.isArray(t)){throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.")}const[n,...i]=parseTemplates(t,r);return execaSync(n,i,normalizeScriptOptions(e))};return $}const X=create$();function execaCommand(e,t){const[r,...n]=parseCommand(e);return execa(r,n,t)}function execaCommandSync(e,t){const[r,...n]=parseCommand(e);return execaSync(r,n,t)}function execaNode(e,t,r={}){if(t&&!Array.isArray(t)&&typeof t==="object"){r=t;t=[]}const n=normalizeStdioNode(r);const i=o.execArgv.filter((e=>!e.startsWith("--inspect")));const{nodePath:s=o.execPath,nodeOptions:a=i}=r;return execa(s,[...a,e,...Array.isArray(t)?t:[]],{...r,stdin:undefined,stdout:undefined,stderr:undefined,stdio:n,shell:false})}},5133:e=>{"use strict";e.exports=JSON.parse('["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]')}};var __webpack_module_cache__={};function __nccwpck_require__(e){var t=__webpack_module_cache__[e];if(t!==undefined){return t.exports}var r=__webpack_module_cache__[e]={exports:{}};var n=true;try{__webpack_modules__[e].call(r.exports,r,r.exports,__nccwpck_require__);n=false}finally{if(n)delete __webpack_module_cache__[e]}return r.exports}(()=>{__nccwpck_require__.d=(e,t)=>{for(var r in t){if(__nccwpck_require__.o(t,r)&&!__nccwpck_require__.o(e,r)){Object.defineProperty(e,r,{enumerable:true,get:t[r]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();(()=>{__nccwpck_require__.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__=__nccwpck_require__(6144);module.exports=__webpack_exports__})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "helm-viewer",
3
- "version": "0.7.4",
3
+ "version": "0.7.6",
4
4
  "description": "Quick tool to easily view your helm charts.",
5
5
  "author": "Tchoupinax <corentinfiloche@hotmail.fr> (https://corentinfiloche.xyz)",
6
6
  "license": "MIT",
@@ -25,7 +25,7 @@
25
25
  "pack": "npm pack --dry-run",
26
26
  "publish": "npm publish",
27
27
  "=== RUN ==============================================": "",
28
- "run": "NODE_ENV=development npx vite-node src/index.ts ~/Downloads/traefik-helm-chart/traefik",
28
+ "run": "NODE_ENV=development npx vite-node src/index.ts ~/Documents/swan/helm-charts/redpanda",
29
29
  "=== BUILD ============================================": "",
30
30
  "test": "vitest",
31
31
  "build": "tsc",