本地降级npm版本后iflow无法使用

本地的npm卸载重装后,新npm版本16.19.1,iflow启动即报错:

file:///Users/yangye/.npm-global/lib/node_modules/@iflow-ai/iflow-cli/bundle/iflow.js:24

`).length,o={width:r,height:n};return Mpr.set(t,o),o},udt=JTi});function t8i(){let t=new Map;for(let[e,r]of Object.entries(cf)){for(let[n,o]of Object.entries(r))cf[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=cf[n],t.set(o[0],o[1]);Object.defineProperty(cf,e,{value:r,enumerable:!1})}return Object.defineProperty(cf,“codes”,{value:t,enumerable:!1}),cf.color.close=“\x1B[39m”,cf.bgColor.close=“\x1B[49m”,cf.color.ansi=Lpr(),cf.color.ansi256=Upr(),cf.color.ansi16m=Qpr(),cf.bgColor.ansi=Lpr(10),cf.bgColor.ansi256=Upr(10),cf.bgColor.ansi16m=Qpr(10),Object.defineProperties(cf,{rgbToAnsi256:{value(e,r,n){return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[…n].map(s=>s+s).join(“”));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:e=>cf.rgbToAnsi256(…cf.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,o;if(e>=232)r=((e-232)*10+8)/255,n=r,o=r;else{e-=16;let c=e%36;r=Math.floor(e/36)/5,n=Math.floor(c/6)/5,o=c%6/5}let s=Math.max(r,n,o)*2;if(s===0)return 30;let a=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>cf.ansi256ToAnsi(cf.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>cf.ansi256ToAnsi(cf.hexToAnsi256(e)),enumerable:!1}}),cf}var Lpr,Upr,Qpr,cf,WDa,ZTi,e8i,zDa,r8i,c7,jpr=q(()=>{Lpr=(t=0)=>e=>`\x1B[${e+t}m`,Upr=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Qpr=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,cf={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]}},WDa=Object.keys(cf.modifier),ZTi=Object.keys(cf.color),e8i=Object.keys(cf.bgColor),zDa=[…ZTi,…e8i];r8i=t8i(),c7=r8i});function dfe(t){return Number.isInteger(t)?ife(t)||ofe(t):!1}var ddt=q(()=>{lU()});function a8i(t){if(pdt.has(t))return t;if(fdt.has(t))return fdt.get(t);t=t.slice(2),t.includes(“;”)&&(t=t[0]+“0”);let e=c7.codes.get(Number.parseInt(t,10));return e?c7.color.ansi(e):c7.reset.open}function c8i(t){for(let e=0;e<t.length;e++){let r=t.codePointAt(e);if(r>=i8i&&r<=o8i)return e}return-1}function l8i(t,e){t=t.slice(e,e+s8i);let r=c8i(t);if(r!==-1){let n=t.indexOf(“m”,r);return n===-1&&(n=t.length),t.slice(0,n+1)}}function u8i(t,e=Number.POSITIVE_INFINITY){let r=,n=0,o=0;for(;n<t.length;){let s=t.codePointAt(n);if(n8i.has(s)){let u=l8i(t,n);if(u){r.push({type:“ansi”,code:u,endCode:a8i(u)}),n+=u.length;continue}}let a=dfe(s),c=String.fromCodePoint(s);if(r.push({type:“character”,value:c,isFullWidth:a}),n+=c.length,o+=a?2:c.length,o>=e)break}return r}function $pr(t){let e=;for(let r of t)r.code===c7.reset.open?e=:pdt.has(r.code)?e=e.filter(n=>n.endCode!==r.code):(e=e.filter(n=>n.endCode!==r.endCode),e.push(r));return e}function d8i(t){return $pr(t).map(({endCode:n})=>n).reverse().join(“”)}function mv(t,e,r){let n=u8i(t,r),o=,s=0,a=“”,c=!1;for(let u of n){if(r!==void 0&&s>=r)break;u.type===“ansi”?(o.push(u),c&&(a+=u.code)):(!c&&s>=e&&(c=!0,o=$pr(o),a=o.map(({code:d})=>d).join(“”)),c&&(a+=u.value),s+=u.isFullWidth?2:u.value.length)}return a+=d8i(o),a}var n8i,i8i,o8i,s8i,pdt,fdt,hdt=q(()=>{jpr();ddt();n8i=new Set([27,155]),i8i=“0”.codePointAt(0),o8i=“9”.codePointAt(0),s8i=19,pdt=new Set,fdt=new Map;for(let[t,e]of c7.codes)pdt.add(c7.color.ansi(e)),fdt.set(c7.color.ansi(t),c7.color.ansi(e))});function g8i(t){return t.replace(h8i,“”)}function A8i(t){return p8i.test(t)}function y8i(t,e){let r=0;if(t.length>1)for(let n of t.slice(1))n>=“\uFF00”&&n<=“\uFFEF”&&(r+=pv(n.codePointAt(0),e));return r}function JY(t,e={}){if(typeof t!=“string”||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e,o=t;if(n||(o=Sd(o)),o.length===0)return 0;let s=0,a={ambiguousAsWide:!r};for(let{segment:c}of f8i.segment(o)){if(A8i(c))continue;if(m8i.test(c)){s+=2;continue}let u=g8i(c).codePointAt(0);s+=pv(u,a),s+=y8i(c,a)}return s}var f8i,p8i,h8i,m8i,Gpr=q(()=>{SC();lU();f8i=new Intl.Segmenter,p8i=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Mark}|\p{Surrogate})+$/v,h8i=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,m8i=/^\p{RGI_Emoji}$/v});function C5e(t,e,r){if(t.charAt(e)===" “)return e;let n=r?1:-1;for(let o=0;o<=3;o++){let s=e+o*n;if(t.charAt(s)===” “)return s}return e}function mdt(t,e,r={}){let{position:n=“end”,space:o=!1,preferTruncationOnSpace:s=!1}=r,{truncationCharacter:a=”\u2026"}=r;if(typeof t!=“string”)throw new TypeError(`Expected \`input\` to be a string, got ${typeof t}`);if(typeof e!=“number”)throw new TypeError(`Expected \`columns\` to be a number, got ${typeof e}`);if(e<1)return"“;let c=JY(t);if(c<=e)return t;if(e===1)return a;let u={ESC:27,LEFT_BRACKET:91,LETTER_M:109},d=g=>g>=48&&g<=57||g===59;function f(g){let A=0;for(;A+2<g.length&&g.codePointAt(A)===u.ESC&&g.codePointAt(A+1)===u.LEFT_BRACKET;){let y=A+2;for(;y<g.length&&d(g.codePointAt(y));)y++;if(y<g.length&&g.codePointAt(y)===u.LETTER_M){A=y+1;continue}break}return A}function p(g){let A=g.length;for(;A>1&&g.codePointAt(A-1)===u.LETTER_M;){let y=A-2;for(;y>=0&&d(g.codePointAt(y));)y–;if(y>=1&&g.codePointAt(y-1)===u.ESC&&g.codePointAt(y)===u.LEFT_BRACKET){A=y-1;continue}break}return A}function h(g,A){let y=p(g);return y===g.length?g+A:g.slice(0,y)+A+g.slice(y)}function m(g,A){let y=f(A);return y===0?g+A:A.slice(0,y)+g+A.slice(y)}if(n===“start”){if(s){let A=C5e(t,c-e+1,!0),y=mv(t,A,c).trim();return m(a,y)}o&&(a+=” “);let g=mv(t,c-e+JY(a),c);return m(a,g)}if(n===“middle”){o&&(a=` ${a} `);let g=Math.floor(e/2);if(s){let A=C5e(t,g),y=C5e(t,c-(e-g)+1,!0);return mv(t,0,A)+a+mv(t,y,c).trim()}return mv(t,0,g)+a+mv(t,c-(e-g)+JY(a),c)}if(n===“end”){if(s){let A=C5e(t,e-1),y=mv(t,0,A);return h(y,a)}o&&(a=` ${a}`);let g=mv(t,0,e-JY(a));return h(g,a)}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${n}`)}var qpr=q(()=>{hdt();Gpr()});var Hpr,_8i,S5e,gdt=q(()=>{edt();qpr();Hpr={},_8i=(t,e,r)=>{let n=t+String(e)+String(r),o=Hpr[n];if(o)return o;let s=t;if(r===“wrap”&&(s=sfe(t,e,{trim:!1,hard:!0})),r.startsWith(“truncate”)){let a=“end”;r===“truncate-middle”&&(a=“middle”),r===“truncate-start”&&(a=“start”),s=mdt(t,e,{position:a})}return Hpr[n]=s,s},S5e=_8i});var Vpr,ffe,Adt=q(()=>{Vpr=t=>{let e=”“;for(let r=0;r<t.childNodes.length;r++){let n=t.childNodes[r];if(n===void 0)continue;let o=”“;n.nodeName===”#text"?o=n.nodeValue:((n.nodeName===“ink-text”||n.nodeName===“ink-virtual-text”)&&(o=Vpr(n)),o.length>0&&typeof n.internal_transform==“function”&&(o=n.internal_transform(o,r))),e+=o}return e},ffe=Vpr});var x5e,w5e,ydt,pfe,_dt,Edt,Wpr,E8i,zpr,T5e,hfe,vdt=q(async()=>{await cU();Fpr();gdt();Adt();x5e=t=>{let e={nodeName:t,style:{},attributes:{},childNodes:,parentNode:void 0,yogaNode:t===“ink-virtual-text”?void 0:ai.Node.create(),internal_accessibility:{}};return t===“ink-text”&&e.yogaNode?.setMeasureFunc(E8i.bind(null,e)),e},w5e=(t,e)=>{e.parentNode&&pfe(e.parentNode,e),e.parentNode=t,t.childNodes.push(e),e.yogaNode&&t.yogaNode?.insertChild(e.yogaNode,t.yogaNode.getChildCount()),(t.nodeName===“ink-text”||t.nodeName===“ink-virtual-text”)&&T5e(t)},ydt=(t,e,r)=>{e.parentNode&&pfe(e.parentNode,e),e.parentNode=t;let n=t.childNodes.indexOf(r);if(n>=0){t.childNodes.splice(n,0,e),e.yogaNode&&t.yogaNode?.insertChild(e.yogaNode,n);return}t.childNodes.push(e),e.yogaNode&&t.yogaNode?.insertChild(e.yogaNode,t.yogaNode.getChildCount()),(t.nodeName===“ink-text”||t.nodeName===“ink-virtual-text”)&&T5e(t)},pfe=(t,e)=>{e.yogaNode&&e.parentNode?.yogaNode?.removeChild(e.yogaNode),e.parentNode=void 0;let r=t.childNodes.indexOf(e);r>=0&&t.childNodes.splice(r,1),(t.nodeName===“ink-text”||t.nodeName===“ink-virtual-text”)&&T5e(t)},_dt=(t,e,r)=>{if(e===“internal_accessibility”){t.internal_accessibility=r;return}t.attributes[e]=r},Edt=(t,e)=>{t.style=e},Wpr=t=>{let e={nodeName:“#text”,nodeValue:t,yogaNode:void 0,parentNode:void 0,style:{}};return hfe(e,t),e},E8i=function(t,e){let r=t.nodeName===“#text”?t.nodeValue:ffe(t),n=udt(r);if(n.width<=e||n.width>=1&&e>0&&e<1)return n;let o=t.style?.textWrap??“wrap”,s=S5e(r,e,o);return udt(s)},zpr=t=>{if(t?.parentNode)return t.yogaNode??zpr(t.parentNode)},T5e=t=>{zpr(t)?.markDirty()},hfe=(t,e)=>{typeof e!=“string”&&(e=String(e)),t.nodeValue=e,T5e(t)}});var b8i,C8i,S8i,x8i,w8i,T8i,I8i,D8i,R8i,bdt,Ypr=q(async()=>{await cU();b8i=(t,e)=>{"position"in e&&t.setPositionType(e.position===“absolute”?ai.POSITION_TYPE_ABSOLUTE:ai.POSITION_TYPE_RELATIVE)},C8i=(t,e)=>{"margin"in e&&t.setMargin(ai.EDGE_ALL,e.margin??0),"marginX"in e&&t.setMargin(ai.EDGE_HORIZONTAL,e.marginX??0),"marginY"in e&&t.setMargin(ai.EDGE_VERTICAL,e.marginY??0),"marginLeft"in e&&t.setMargin(ai.EDGE_START,e.marginLeft||0),"marginRight"in e&&t.setMargin(ai.EDGE_END,e.marginRight||0),"marginTop"in e&&t.setMargin(ai.EDGE_TOP,e.marginTop||0),"marginBottom"in e&&t.setMargin(ai.EDGE_BOTTOM,e.marginBottom||0)},S8i=(t,e)=>{"padding"in e&&t.setPadding(ai.EDGE_ALL,e.padding??0),"paddingX"in e&&t.setPadding(ai.EDGE_HORIZONTAL,e.paddingX??0),"paddingY"in e&&t.setPadding(ai.EDGE_VERTICAL,e.paddingY??0),“paddingLeft"in e&&t.setPadding(ai.EDGE_LEFT,e.paddingLeft||0),“paddingRight"in e&&t.setPadding(ai.EDGE_RIGHT,e.paddingRight||0),“paddingTop"in e&&t.setPadding(ai.EDGE_TOP,e.paddingTop||0),“paddingBottom"in e&&t.setPadding(ai.EDGE_BOTTOM,e.paddingBottom||0)},x8i=(t,e)=>{“flexGrow"in e&&t.setFlexGrow(e.flexGrow??0),“flexShrink"in e&&t.setFlexShrink(typeof e.flexShrink==“number”?e.flexShrink:1),“flexWrap"in e&&(e.flexWrap===“nowrap”&&t.setFlexWrap(ai.WRAP_NO_WRAP),e.flexWrap===“wrap”&&t.setFlexWrap(ai.WRAP_WRAP),e.flexWrap===“wrap-reverse”&&t.setFlexWrap(ai.WRAP_WRAP_REVERSE)),“flexDirection"in e&&(e.flexDirection===“row”&&t.setFlexDirection(ai.FLEX_DIRECTION_ROW),e.flexDirection===“row-reverse”&&t.setFlexDirection(ai.FLEX_DIRECTION_ROW_REVERSE),e.flexDirection===“column”&&t.setFlexDirection(ai.FLEX_DIRECTION_COLUMN),e.flexDirection===“column-reverse”&&t.setFlexDirection(ai.FLEX_DIRECTION_COLUMN_REVERSE)),“flexBasis"in e&&(typeof e.flexBasis==“number”?t.setFlexBasis(e.flexBasis):typeof e.flexBasis==“string”?t.setFlexBasisPercent(Number.parseInt(e.flexBasis,10)):t.setFlexBasis(Number.NaN)),“alignItems"in e&&((e.alignItems===“stretch”||!e.alignItems)&&t.setAlignItems(ai.ALIGN_STRETCH),e.alignItems===“flex-start”&&t.setAlignItems(ai.ALIGN_FLEX_START),e.alignItems===“center”&&t.setAlignItems(ai.ALIGN_CENTER),e.alignItems===“flex-end”&&t.setAlignItems(ai.ALIGN_FLEX_END)),“alignSelf"in e&&((e.alignSelf===“auto”||!e.alignSelf)&&t.setAlignSelf(ai.ALIGN_AUTO),e.alignSelf===“flex-start”&&t.setAlignSelf(ai.ALIGN_FLEX_START),e.alignSelf===“center”&&t.setAlignSelf(ai.ALIGN_CENTER),e.alignSelf===“flex-end”&&t.setAlignSelf(ai.ALIGN_FLEX_END)),“justifyContent"in e&&((e.justifyContent===“flex-start”||!e.justifyContent)&&t.setJustifyContent(ai.JUSTIFY_FLEX_START),e.justifyContent===“center”&&t.setJustifyContent(ai.JUSTIFY_CENTER),e.justifyContent===“flex-end”&&t.setJustifyContent(ai.JUSTIFY_FLEX_END),e.justifyContent===“space-between”&&t.setJustifyContent(ai.JUSTIFY_SPACE_BETWEEN),e.justifyContent===“space-around”&&t.setJustifyContent(ai.JUSTIFY_SPACE_AROUND),e.justifyContent===“space-evenly”&&t.setJustifyContent(ai.JUSTIFY_SPACE_EVENLY))},w8i=(t,e)=>{“width"in e&&(typeof e.width==“number”?t.setWidth(e.width):typeof e.width==“string”?t.setWidthPercent(Number.parseInt(e.width,10)):t.setWidthAuto()),“height"in e&&(typeof e.height==“number”?t.setHeight(e.height):typeof e.height==“string”?t.setHeightPercent(Number.parseInt(e.height,10)):t.setHeightAuto()),“minWidth"in e&&(typeof e.minWidth==“string”?t.setMinWidthPercent(Number.parseInt(e.minWidth,10)):t.setMinWidth(e.minWidth??0)),“minHeight"in e&&(typeof e.minHeight==“string”?t.setMinHeightPercent(Number.parseInt(e.minHeight,10)):t.setMinHeight(e.minHeight??0))},T8i=(t,e)=>{“display"in e&&t.setDisplay(e.display===“flex”?ai.DISPLAY_FLEX:ai.DISPLAY_NONE)},I8i=(t,e)=>{if(“borderStyle"in e){let r=e.borderStyle?1:0;e.borderTop!==!1&&t.setBorder(ai.EDGE_TOP,r),e.borderBottom!==!1&&t.setBorder(ai.EDGE_BOTTOM,r),e.borderLeft!==!1&&t.setBorder(ai.EDGE_LEFT,r),e.borderRight!==!1&&t.setBorder(ai.EDGE_RIGHT,r)}},D8i=(t,e)=>{“gap"in e&&t.setGap(ai.GUTTER_ALL,e.gap??0),“columnGap"in e&&t.setGap(ai.GUTTER_COLUMN,e.columnGap??0),“rowGap"in e&&t.setGap(ai.GUTTER_ROW,e.rowGap??0)},R8i=(t,e={})=>{b8i(t,e),C8i(t,e),S8i(t,e),x8i(t,e),w8i(t,e),T8i(t,e),I8i(t,e),D8i(t,e)},bdt=R8i});var l7=I((ARa,Jpr)=>{“use strict”;var Kpr=[“nodebuffer”,“arraybuffer”,“fragments”],Xpr=typeof Blob<“u”;Xpr&&Kpr.push(“blob”);Jpr.exports={BINARY_TYPES:Kpr,EMPTY_BUFFER:Buffer.alloc(0),GUID:“258EAFA5-E914-47DA-95CA-C5AB0DC85B11”,hasBlob:Xpr,kForOnEventAttribute:Symbol(“kIsForOnEventAttribute”),kListener:Symbol(“kListener”),kStatusCode:Symbol(“status-code”),kWebSocket:Symbol(“websocket”),NOOP:()=>{}}});var mfe=I((yRa,I5e)=>{“use strict”;var{EMPTY_BUFFER:k8i}=l7(),Cdt=Buffer[Symbol.species];function N8i(t,e){if(t.length===0)return k8i;if(t.length===1)return t[0];let r=Buffer.allocUnsafe(e),n=0;for(let o=0;o<t.length;o++){let s=t[o];r.set(s,n),n+=s.length}return n<e?new Cdt(r.buffer,r.byteOffset,n):r}function Zpr(t,e,r,n,o){for(let s=0;s<o;s++)r[n+s]=t[s]^e[s&3]}function ehr(t,e){for(let r=0;r<t.length;r++)t[r]^=e[r&3]}function O8i(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.length)}function Sdt(t){if(Sdt.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=new Cdt(t):ArrayBuffer.isView(t)?e=new Cdt(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),Sdt.readOnly=!1),e}I5e.exports={concat:N8i,mask:Zpr,toArrayBuffer:O8i,toBuffer:Sdt,unmask:ehr};if(!process.env.WS_NO_BUFFER_UTIL)try{let t=_e(“bufferutil”);I5e.exports.mask=function(e,r,n,o,s){s<48?Zpr(e,r,n,o,s):t.mask(e,r,n,o,s)},I5e.exports.unmask=function(e,r){e.length<32?ehr(e,r):t.unmask(e,r)}}catch{}});var nhr=I((_Ra,rhr)=>{“use strict”;var thr=Symbol(“kDone”),xdt=Symbol(“kRun”),wdt=class{constructor(e){this[thr]=()=>{this.pending–,this[xdt]()},this.concurrency=e||1/0,this.jobs=,this.pending=0}add(e){this.jobs.push(e),this[xdt]()}[xdt](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[thr])}}};rhr.exports=wdt});var Afe=I((ERa,ahr)=>{“use strict”;var gfe=_e(“zlib”),ihr=mfe(),B8i=nhr(),{kStatusCode:ohr}=l7(),P8i=Buffer[Symbol.species],M8i=Buffer.from([0,0,255,255]),R5e=Symbol(“permessage-deflate”),u7=Symbol(“total-length”),ZY=Symbol(“callback”),eN=Symbol(“buffers”),eK=Symbol(“error”),D5e,Tdt=class{constructor(e,r,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!D5e){let o=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;D5e=new B8i(o)}}static get extensionName(){return"permessage-deflate”}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[ZY];this._deflate.close(),this._deflate=null,e&&e(new Error(“The deflate stream was closed while data was being processed”))}}acceptAsServer(e){let r=this._options,n=e.find(o=>!(r.serverNoContextTakeover===!1&&o.server_no_context_takeover||o.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits==“number”&&r.serverMaxWindowBits>o.server_max_window_bits)||typeof r.clientMaxWindowBits==“number”&&!o.client_max_window_bits));if(!n)throw new Error(“None of the extension offers can be accepted”);return r.serverNoContextTakeover&&(n.server_no_context_takeover=!0),r.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof r.serverMaxWindowBits==“number”&&(n.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits==“number”?n.client_max_window_bits=r.clientMaxWindowBits:(n.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let r=e[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error(‘Unexpected parameter “client_no_context_takeover”’);if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits==“number”&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits==“number”&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error(‘Unexpected or invalid parameter “client_max_window_bits”’);return r}normalizeParams(e){return e.forEach(r=>{Object.keys(r).forEach(n=>{let o=r[n];if(o.length>1)throw new Error(`Parameter “${n}” must have only a single value`);if(o=o[0],n===“client_max_window_bits”){if(o!==!0){let s=+o;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter “${n}”: ${o}`);o=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter “${n}”: ${o}`)}else if(n===“server_max_window_bits”){let s=+o;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter “${n}”: ${o}`);o=s}else if(n===“client_no_context_takeover”||n===“server_no_context_takeover”){if(o!==!0)throw new TypeError(`Invalid value for parameter “${n}”: ${o}`)}else throw new Error(`Unknown parameter “${n}”`);r[n]=o})}),e}decompress(e,r,n){D5e.add(o=>{this._decompress(e,r,(s,a)=>{o(),n(s,a)})})}compress(e,r,n){D5e.add(o=>{this._compress(e,r,(s,a)=>{o(),n(s,a)})})}_decompress(e,r,n){let o=this._isServer?“client”:“server”;if(!this._inflate){let s=`${o}_max_window_bits`,a=typeof this.params[s]!=“number”?gfe.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=gfe.createInflateRaw({…this._options.zlibInflateOptions,windowBits:a}),this._inflate[R5e]=this,this._inflate[u7]=0,this._inflate[eN]=,this._inflate.on(“error”,L8i),this._inflate.on(“data”,shr)}this._inflate[ZY]=n,this._inflate.write(e),r&&this._inflate.write(M8i),this._inflate.flush(()=>{let s=this._inflate[eK];if(s){this._inflate.close(),this._inflate=null,n(s);return}let a=ihr.concat(this._inflate[eN],this._inflate[u7]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[u7]=0,this._inflate[eN]=,r&&this.params[`${o}_no_context_takeover`]&&this._inflate.reset()),n(null,a)})}_compress(e,r,n){let o=this._isServer?“server”:“client”;if(!this._deflate){let s=`${o}_max_window_bits`,a=typeof this.params[s]!=“number”?gfe.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=gfe.createDeflateRaw({…this._options.zlibDeflateOptions,windowBits:a}),this._deflate[u7]=0,this._deflate[eN]=,this._deflate.on(“data”,F8i)}this._deflate[ZY]=n,this._deflate.write(e),this._deflate.flush(gfe.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=ihr.concat(this._deflate[eN],this._deflate[u7]);r&&(s=new P8i(s.buffer,s.byteOffset,s.length-4)),this._deflate[ZY]=null,this._deflate[u7]=0,this._deflate[eN]=,r&&this.params[`${o}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};ahr.exports=Tdt;function F8i(t){this[eN].push(t),this[u7]+=t.length}function shr(t){if(this[u7]+=t.length,this[R5e]._maxPayload<1||this[u7]<=this[R5e]._maxPayload){this[eN].push(t);return}this[eK]=new RangeError(“Max payload size exceeded”),this[eK].code=“WS_ERR_UNSUPPORTED_MESSAGE_LENGTH”,this[eK][ohr]=1009,this.removeListener(“data”,shr),this.reset()}function L8i(t){if(this[R5e]._inflate=null,this[eK]){this[ZY](this[eK]);return}t[ohr]=1007,this[ZY](t)}});var tK=I((vRa,k5e)=>{“use strict”;var{isUtf8:chr}=_e(“buffer”),{hasBlob:U8i}=l7(),Q8i=[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 j8i(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function Idt(t){let e=t.length,r=0;for(;r<e;)if((t[r]&128)===0)r++;else if((t[r]&224)===192){if(r+1===e||(t[r+1]&192)!==128||(t[r]&254)===192)return!1;r+=2}else if((t[r]&240)===224){if(r+2>=e||(t[r+1]&192)!==128||(t[r+2]&192)!==128||t[r]===224&&(t[r+1]&224)===128||t[r]===237&&(t[r+1]&224)===160)return!1;r+=3}else if((t[r]&248)===240){if(r+3>=e||(t[r+1]&192)!==128||(t[r+2]&192)!==128||(t[r+3]&192)!==128||t[r]===240&&(t[r+1]&240)===128||t[r]===244&&t[r+1]>143||t[r]>244)return!1;r+=4}else return!1;return!0}function $8i(t){return U8i&&typeof t==“object”&&typeof t.arrayBuffer==“function”&&typeof t.type==“string”&&typeof t.stream==“function”&&(t[Symbol.toStringTag]===“Blob”||t[Symbol.toStringTag]===“File”)}k5e.exports={isBlob:$8i,isValidStatusCode:j8i,isValidUTF8:Idt,tokenChars:Q8i};if(chr)k5e.exports.isValidUTF8=function(t){return t.length<24?Idt(t):chr(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=_e(“utf-8-validate”);k5e.exports.isValidUTF8=function(e){return e.length<32?Idt(e):t(e)}}catch{}});var Odt=I((bRa,mhr)=>{“use strict”;var{Writable:G8i}=_e(“stream”),lhr=Afe(),{BINARY_TYPES:q8i,EMPTY_BUFFER:uhr,kStatusCode:H8i,kWebSocket:V8i}=l7(),{concat:Ddt,toArrayBuffer:W8i,unmask:z8i}=mfe(),{isValidStatusCode:Y8i,isValidUTF8:dhr}=tK(),N5e=Buffer[Symbol.species],gv=0,fhr=1,phr=2,hhr=3,Rdt=4,kdt=5,O5e=6,Ndt=class extends G8i{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||q8i[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[V8i]=void 0,this._bufferedBytes=0,this._buffers=,this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=,this._errored=!1,this._loop=!1,this._state=gv}_write(e,r,n){if(this._opcode===8&&this._state==gv)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new N5e(n.buffer,n.byteOffset+e,n.length-e),new N5e(n.buffer,n.byteOffset,e)}let r=Buffer.allocUnsafe(e);do{let n=this._buffers[0],o=r.length-e;e>=n.length?r.set(this._buffers.shift(),o):(r.set(new Uint8Array(n.buffer,n.byteOffset,e),o),this._buffers[0]=new N5e(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return r}startLoop(e){this._loop=!0;do switch(this._state){case gv:this.getInfo(e);break;case fhr:this.getPayloadLength16(e);break;case phr:this.getPayloadLength64(e);break;case hhr:this.getMask();break;case Rdt:this.getData(e);break;case kdt:case O5e:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let o=this.createError(RangeError,“RSV2 and RSV3 must be clear”,!0,1002,“WS_ERR_UNEXPECTED_RSV_2_3”);e(o);return}let n=(r[0]&64)===64;if(n&&!this._extensions[lhr.extensionName]){let o=this.createError(RangeError,“RSV1 must be clear”,!0,1002,“WS_ERR_UNEXPECTED_RSV_1”);e(o);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(n){let o=this.createError(RangeError,“RSV1 must be clear”,!0,1002,“WS_ERR_UNEXPECTED_RSV_1”);e(o);return}if(!this._fragmented){let o=this.createError(RangeError,“invalid opcode 0”,!0,1002,“WS_ERR_INVALID_OPCODE”);e(o);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,“WS_ERR_INVALID_OPCODE”);e(o);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let o=this.createError(RangeError,“FIN must be set”,!0,1002,“WS_ERR_EXPECTED_FIN”);e(o);return}if(n){let o=this.createError(RangeError,“RSV1 must be clear”,!0,1002,“WS_ERR_UNEXPECTED_RSV_1”);e(o);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let o=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,“WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH”);e(o);return}}else{let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,“WS_ERR_INVALID_OPCODE”);e(o);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let o=this.createError(RangeError,“MASK must be set”,!0,1002,“WS_ERR_EXPECTED_MASK”);e(o);return}}else if(this._masked){let o=this.createError(RangeError,“MASK must be clear”,!0,1002,“WS_ERR_UNEXPECTED_MASK”);e(o);return}this._payloadLength===126?this._state=fhr:this._payloadLength===127?this._state=phr:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),n=r.readUInt32BE(0);if(n>Math.pow(2,21)-1){let o=this.createError(RangeError,“Unsupported WebSocket frame: payload length > 2^53 - 1”,!1,1009,“WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH”);e(o);return}this._payloadLength=n*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,“Max payload size exceeded”,!1,1009,“WS_ERR_UNSUPPORTED_MESSAGE_LENGTH”);e(r);return}this._masked?this._state=hhr:this._state=Rdt}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Rdt}getData(e){let r=uhr;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&z8i(r,this._mask)}if(this._opcode>7){this.controlMessage(r,e);return}if(this._compressed){this._state=kdt,this.decompress(r,e);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(e)}decompress(e,r){this._extensions[lhr.extensionName].decompress(e,this._fin,(o,s)=>{if(o)return r(o);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let a=this.createError(RangeError,“Max payload size exceeded”,!1,1009,“WS_ERR_UNSUPPORTED_MESSAGE_LENGTH”);r(a);return}this._fragments.push(s)}this.dataMessage(r),this._state===gv&&this.startLoop(r)})}dataMessage(e){if(!this._fin){this._state=gv;return}let r=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=,this._opcode===2){let o;this._binaryType===“nodebuffer”?o=Ddt(n,r):this._binaryType===“arraybuffer”?o=W8i(Ddt(n,r)):this._binaryType===“blob”?o=new Blob(n):o=n,this._allowSynchronousEvents?(this.emit(“message”,o,!0),this._state=gv):(this._state=O5e,setImmediate(()=>{this.emit(“message”,o,!0),this._state=gv,this.startLoop(e)}))}else{let o=Ddt(n,r);if(!this._skipUTF8Validation&&!dhr(o)){let s=this.createError(Error,“invalid UTF-8 sequence”,!0,1007,“WS_ERR_INVALID_UTF8”);e(s);return}this._state===kdt||this._allowSynchronousEvents?(this.emit(“message”,o,!1),this._state=gv):(this._state=O5e,setImmediate(()=>{this.emit(“message”,o,!1),this._state=gv,this.startLoop(e)}))}}controlMessage(e,r){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit(“conclude”,1005,uhr),this.end();else{let n=e.readUInt16BE(0);if(!Y8i(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,“WS_ERR_INVALID_CLOSE_CODE”);r(s);return}let o=new N5e(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!dhr(o)){let s=this.createError(Error,“invalid UTF-8 sequence”,!0,1007,“WS_ERR_INVALID_UTF8”);r(s);return}this._loop=!1,this.emit(“conclude”,n,o),this.end()}this._state=gv;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?“ping”:“pong”,e),this._state=gv):(this._state=O5e,setImmediate(()=>{this.emit(this._opcode===9?“ping”:“pong”,e),this._state=gv,this.startLoop(r)}))}createError(e,r,n,o,s){this._loop=!1,this._errored=!0;let a=new e(n?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(a,this.createError),a.code=s,a[H8i]=o,a}};mhr.exports=Ndt});var Mdt=I((SRa,yhr)=>{“use strict”;var{Duplex:CRa}=_e(“stream”),{randomFillSync:K8i}=_e(“crypto”),ghr=Afe(),{EMPTY_BUFFER:X8i,kWebSocket:J8i,NOOP:Z8i}=l7(),{isBlob:rK,isValidStatusCode:e9i}=tK(),{mask:Ahr,toBuffer:fU}=mfe(),Av=Symbol(“kByteLength”),t9i=Buffer.alloc(4),B5e=8*1024,pU,nK=B5e,xC=0,r9i=1,n9i=2,Bdt=class t{constructor(e,r,n){this._extensions=r||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=,this._state=xC,this.onerror=Z8i,this[J8i]=void 0}static frame(e,r){let n,o=!1,s=2,a=!1;r.mask&&(n=r.maskBuffer||t9i,r.generateMask?r.generateMask(n):(nK===B5e&&(pU===void 0&&(pU=Buffer.alloc(B5e)),K8i(pU,0,B5e),nK=0),n[0]=pU[nK++],n[1]=pU[nK++],n[2]=pU[nK++],n[3]=pU[nK++]),a=(n[0]|n[1]|n[2]|n[3])===0,s=6);let c;typeof e==“string”?(!r.mask||a)&&r[Av]!==void 0?c=r[Av]:(e=Buffer.from(e),c=e.length):(c=e.length,o=r.mask&&r.readOnly&&!a);let u=c;c>=65536?(s+=8,u=127):c>125&&(s+=2,u=126);let d=Buffer.allocUnsafe(o?c+s:s);return d[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(d[0]|=64),d[1]=u,u===126?d.writeUInt16BE(c,2):u===127&&(d[2]=d[3]=0,d.writeUIntBE(c,4,6)),r.mask?(d[1]|=128,d[s-4]=n[0],d[s-3]=n[1],d[s-2]=n[2],d[s-1]=n[3],a?[d,e]:o?(Ahr(e,n,d,s,c),[d]):(Ahr(e,n,e,0,c),[d,e])):[d,e]}close(e,r,n,o){let s;if(e===void 0)s=X8i;else{if(typeof e!=“number”||!e9i(e))throw new TypeError(“First argument must be a valid error code number”);if(r===void 0||!r.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let c=Buffer.byteLength(r);if(c>123)throw new RangeError(“The message must not be greater than 123 bytes”);s=Buffer.allocUnsafe(2+c),s.writeUInt16BE(e,0),typeof r==“string”?s.write(r,2):s.set(r,2)}}let a={[Av]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==xC?this.enqueue([this.dispatch,s,!1,a,o]):this.sendFrame(t.frame(s,a),o)}ping(e,r,n){let o,s;if(typeof e==“string”?(o=Buffer.byteLength(e),s=!1):rK(e)?(o=e.size,s=!1):(e=fU(e),o=e.length,s=fU.readOnly),o>125)throw new RangeError(“The data size must not be greater than 125 bytes”);let a={[Av]:o,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};rK(e)?this._state!==xC?this.enqueue([this.getBlobData,e,!1,a,n]):this.getBlobData(e,!1,a,n):this._state!==xC?this.enqueue([this.dispatch,e,!1,a,n]):this.sendFrame(t.frame(e,a),n)}pong(e,r,n){let o,s;if(typeof e==“string”?(o=Buffer.byteLength(e),s=!1):rK(e)?(o=e.size,s=!1):(e=fU(e),o=e.length,s=fU.readOnly),o>125)throw new RangeError(“The data size must not be greater than 125 bytes”);let a={[Av]:o,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};rK(e)?this._state!==xC?this.enqueue([this.getBlobData,e,!1,a,n]):this.getBlobData(e,!1,a,n):this._state!==xC?this.enqueue([this.dispatch,e,!1,a,n]):this.sendFrame(t.frame(e,a),n)}send(e,r,n){let o=this._extensions[ghr.extensionName],s=r.binary?2:1,a=r.compress,c,u;typeof e==“string”?(c=Buffer.byteLength(e),u=!1):rK(e)?(c=e.size,u=!1):(e=fU(e),c=e.length,u=fU.readOnly),this._firstFragment?(this._firstFragment=!1,a&&o&&o.params[o._isServer?“server_no_context_takeover”:“client_no_context_takeover”]&&(a=c>=o._threshold),this._compress=a):(a=!1,s=0),r.fin&&(this._firstFragment=!0);let d={[Av]:c,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:u,rsv1:a};rK(e)?this._state!==xC?this.enqueue([this.getBlobData,e,this._compress,d,n]):this.getBlobData(e,this._compress,d,n):this._state!==xC?this.enqueue([this.dispatch,e,this._compress,d,n]):this.dispatch(e,this._compress,d,n)}getBlobData(e,r,n,o){this._bufferedBytes+=n[Av],this._state=n9i,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let c=new Error(“The socket was closed while the blob was being read”);process.nextTick(Pdt,this,c,o);return}this._bufferedBytes-=n[Av];let a=fU(s);r?this.dispatch(a,r,n,o):(this._state=xC,this.sendFrame(t.frame(a,n),o),this.dequeue())}).catch(s=>{process.nextTick(i9i,this,s,o)})}dispatch(e,r,n,o){if(!r){this.sendFrame(t.frame(e,n),o);return}let s=this._extensions[ghr.extensionName];this._bufferedBytes+=n[Av],this._state=r9i,s.compress(e,n.fin,(a,c)=>{if(this._socket.destroyed){let u=new Error(“The socket was closed while data was being compressed”);Pdt(this,u,o);return}this._bufferedBytes-=n[Av],this._state=xC,n.readOnly=!1,this.sendFrame(t.frame(c,n),o),this.dequeue()})}dequeue(){for(;this._state===xC&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][Av],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][Av],this._queue.push(e)}sendFrame(e,r){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],r),this._socket.uncork()):this._socket.write(e[0],r)}};yhr.exports=Bdt;function Pdt(t,e,r){typeof r==“function”&&r(e);for(let n=0;n<t._queue.length;n++){let o=t._queue[n],s=o[o.length-1];typeof s==“function”&&s(e)}}function i9i(t,e,r){Pdt(t,e,r),t.onerror(e)}});var Thr=I((xRa,whr)=>{“use strict”;var{kForOnEventAttribute:yfe,kListener:Fdt}=l7(),_hr=Symbol(“kCode”),Ehr=Symbol(“kData”),vhr=Symbol(“kError”),bhr=Symbol(“kMessage”),Chr=Symbol(“kReason”),iK=Symbol(“kTarget”),Shr=Symbol(“kType”),xhr=Symbol(“kWasClean”),d7=class{constructor(e){this[iK]=null,this[Shr]=e}get target(){return this[iK]}get type(){return this[Shr]}};Object.defineProperty(d7.prototype,“target”,{enumerable:!0});Object.defineProperty(d7.prototype,“type”,{enumerable:!0});var hU=class extends d7{constructor(e,r={}){super(e),this[_hr]=r.code===void 0?0:r.code,this[Chr]=r.reason===void 0?””:r.reason,this[xhr]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[_hr]}get reason(){return this[Chr]}get wasClean(){return this[xhr]}};Object.defineProperty(hU.prototype,“code”,{enumerable:!0});Object.defineProperty(hU.prototype,“reason”,{enumerable:!0});Object.defineProperty(hU.prototype,“wasClean”,{enumerable:!0});var oK=class extends d7{constructor(e,r={}){super(e),this[vhr]=r.error===void 0?null:r.error,this[bhr]=r.message===void 0?””:r.message}get error(){return this[vhr]}get message(){return this[bhr]}};Object.defineProperty(oK.prototype,“error”,{enumerable:!0});Object.defineProperty(oK.prototype,“message”,{enumerable:!0});var _fe=class extends d7{constructor(e,r={}){super(e),this[Ehr]=r.data===void 0?null:r.data}get data(){return this[Ehr]}};Object.defineProperty(_fe.prototype,“data”,{enumerable:!0});var o9i={addEventListener(t,e,r={}){for(let o of this.listeners(t))if(!r[yfe]&&o[Fdt]===e&&!o[yfe])return;let n;if(t===“message”)n=function(s,a){let c=new _fe(“message”,{data:a?s:s.toString()});c[iK]=this,P5e(e,this,c)};else if(t===“close”)n=function(s,a){let c=new hU(“close”,{code:s,reason:a.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});c[iK]=this,P5e(e,this,c)};else if(t===“error”)n=function(s){let a=new oK(“error”,{error:s,message:s.message});a[iK]=this,P5e(e,this,a)};else if(t===“open”)n=function(){let s=new d7(“open”);s[iK]=this,P5e(e,this,s)};else return;n[yfe]=!!r[yfe],n[Fdt]=e,r.once?this.once(t,n):this.on(t,n)},removeEventListener(t,e){for(let r of this.listeners(t))if(r[Fdt]===e&&!r[yfe]){this.removeListener(t,r);break}}};whr.exports={CloseEvent:hU,ErrorEvent:oK,Event:d7,EventTarget:o9i,MessageEvent:_fe};function P5e(t,e,r){typeof t==“object”&&t.handleEvent?t.handleEvent.call(t,r):t.call(e,r)}});var Ldt=I((wRa,Ihr)=>{“use strict”;var{tokenChars:Efe}=tK();function Sx(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}function s9i(t){let e=Object.create(null),r=Object.create(null),n=!1,o=!1,s=!1,a,c,u=-1,d=-1,f=-1,p=0;for(;p<t.length;p++)if(d=t.charCodeAt(p),a===void 0)if(f===-1&&Efe[d]===1)u===-1&&(u=p);else if(p!==0&&(d===32||d===9))f===-1&&u!==-1&&(f=p);else if(d===59||d===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p);let m=t.slice(u,f);d===44?(Sx(e,m,r),r=Object.create(null)):a=m,u=f=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(c===void 0)if(f===-1&&Efe[d]===1)u===-1&&(u=p);else if(d===32||d===9)f===-1&&u!==-1&&(f=p);else if(d===59||d===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p),Sx(r,t.slice(u,f),!0),d===44&&(Sx(e,a,r),r=Object.create(null),a=void 0),u=f=-1}else if(d===61&&u!==-1&&f===-1)c=t.slice(u,p),u=f=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(o){if(Efe[d]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);u===-1?u=p:n||(n=!0),o=!1}else if(s)if(Efe[d]===1)u===-1&&(u=p);else if(d===34&&u!==-1)s=!1,f=p;else if(d===92)o=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(d===34&&t.charCodeAt(p-1)===61)s=!0;else if(f===-1&&Efe[d]===1)u===-1&&(u=p);else if(u!==-1&&(d===32||d===9))f===-1&&(f=p);else if(d===59||d===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p);let m=t.slice(u,f);n&&(m=m.replace(/\\/g,””),n=!1),Sx(r,c,m),d===44&&(Sx(e,a,r),r=Object.create(null),a=void 0),c=void 0,u=f=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(u===-1||s||d===32||d===9)throw new SyntaxError(“Unexpected end of input”);f===-1&&(f=p);let h=t.slice(u,f);return a===void 0?Sx(e,h,r):(c===void 0?Sx(r,h,!0):n?Sx(r,c,h.replace(/\\/g,””)):Sx(r,c,h),Sx(e,a,r)),e}function a9i(t){return Object.keys(t).map(e=>{let r=t[e];return Array.isArray(r)||(r=[r]),r.map(n=>[e].concat(Object.keys(n).map(o=>{let s=n[o];return Array.isArray(s)||(s=[s]),s.map(a=>a===!0?o:`${o}=${a}`).join(”; “)})).join(”; “)).join(”, “)}).join(”, “)}Ihr.exports={format:a9i,parse:s9i}});var U5e=I((DRa,Qhr)=>{“use strict”;var c9i=_e(“events”),l9i=_e(“https”),u9i=_e(“http”),khr=_e(“net”),d9i=_e(“tls”),{randomBytes:f9i,createHash:p9i}=_e(“crypto”),{Duplex:TRa,Readable:IRa}=_e(“stream”),{URL:Udt}=_e(“url”),tN=Afe(),h9i=Odt(),m9i=Mdt(),{isBlob:g9i}=tK(),{BINARY_TYPES:Dhr,EMPTY_BUFFER:M5e,GUID:A9i,kForOnEventAttribute:Qdt,kListener:y9i,kStatusCode:_9i,kWebSocket:gg,NOOP:Nhr}=l7(),{EventTarget:{addEventListener:E9i,removeEventListener:v9i}}=Thr(),{format:b9i,parse:C9i}=Ldt(),{toBuffer:S9i}=mfe(),x9i=30*1e3,Ohr=Symbol(“kAborted”),jdt=[8,13],f7=[“CONNECTING”,“OPEN”,“CLOSING”,“CLOSED”],w9i=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,lf=class t extends c9i{constructor(e,r,n){super(),this._binaryType=Dhr[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=M5e,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol=””,this._readyState=t.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=:Array.isArray(r)||(typeof r==“object”&&r!==null?(n=r,r=):r=[r]),Bhr(this,e,r,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Dhr.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}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,r,n){let o=new h9i({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new m9i(e,this._extensions,n.generateMask);this._receiver=o,this._sender=s,this._socket=e,o[gg]=this,s[gg]=this,e[gg]=this,o.on(“conclude”,D9i),o.on(“drain”,R9i),o.on(“error”,k9i),o.on(“message”,N9i),o.on(“ping”,O9i),o.on(“pong”,B9i),s.onerror=P9i,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),r.length>0&&e.unshift(r),e.on(“close”,Fhr),e.on(“data”,L5e),e.on(“end”,Lhr),e.on(“error”,Uhr),this._readyState=t.OPEN,this.emit(“open”)}emitClose(){if(!this._socket){this._readyState=t.CLOSED,this.emit(“close”,this._closeCode,this._closeMessage);return}this._extensions[tN.extensionName]&&this._extensions[tN.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=t.CLOSED,this.emit(“close”,this._closeCode,this._closeMessage)}close(e,r){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){cE(this,this._req,“WebSocket was closed before the connection was established”);return}if(this.readyState===t.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=t.CLOSING,this._sender.close(e,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Mhr(this)}}pause(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,r,n){if(this.readyState===t.CONNECTING)throw new Error(“WebSocket is not open: readyState 0 (CONNECTING)”);if(typeof e==“function”?(n=e,e=r=void 0):typeof r==“function”&&(n=r,r=void 0),typeof e==“number”&&(e=e.toString()),this.readyState!==t.OPEN){$dt(this,e,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(e||M5e,r,n)}pong(e,r,n){if(this.readyState===t.CONNECTING)throw new Error(“WebSocket is not open: readyState 0 (CONNECTING)”);if(typeof e==“function”?(n=e,e=r=void 0):typeof r==“function”&&(n=r,r=void 0),typeof e==“number”&&(e=e.toString()),this.readyState!==t.OPEN){$dt(this,e,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(e||M5e,r,n)}resume(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,r,n){if(this.readyState===t.CONNECTING)throw new Error(“WebSocket is not open: readyState 0 (CONNECTING)”);if(typeof r==“function”&&(n=r,r={}),typeof e==“number”&&(e=e.toString()),this.readyState!==t.OPEN){$dt(this,e,n);return}let o={binary:typeof e!=“string”,mask:!this._isServer,compress:!0,fin:!0,…r};this._extensions[tN.extensionName]||(o.compress=!1),this._sender.send(e||M5e,o,n)}terminate(){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){cE(this,this._req,“WebSocket was closed before the connection was established”);return}this._socket&&(this._readyState=t.CLOSING,this._socket.destroy())}}};Object.defineProperty(lf,“CONNECTING”,{enumerable:!0,value:f7.indexOf(“CONNECTING”)});Object.defineProperty(lf.prototype,“CONNECTING”,{enumerable:!0,value:f7.indexOf(“CONNECTING”)});Object.defineProperty(lf,“OPEN”,{enumerable:!0,value:f7.indexOf(“OPEN”)});Object.defineProperty(lf.prototype,“OPEN”,{enumerable:!0,value:f7.indexOf(“OPEN”)});Object.defineProperty(lf,“CLOSING”,{enumerable:!0,value:f7.indexOf(“CLOSING”)});Object.defineProperty(lf.prototype,“CLOSING”,{enumerable:!0,value:f7.indexOf(“CLOSING”)});Object.defineProperty(lf,“CLOSED”,{enumerable:!0,value:f7.indexOf(“CLOSED”)});Object.defineProperty(lf.prototype,“CLOSED”,{enumerable:!0,value:f7.indexOf(“CLOSED”)});[“binaryType”,“bufferedAmount”,“extensions”,“isPaused”,“protocol”,“readyState”,“url”].forEach(t=>{Object.defineProperty(lf.prototype,t,{enumerable:!0})});[“open”,“error”,“close”,“message”].forEach(t=>{Object.defineProperty(lf.prototype,`on${t}`,{enumerable:!0,get(){for(let e of this.listeners(t))if(e[Qdt])return e[y9i];return null},set(e){for(let r of this.listeners(t))if(r[Qdt]){this.removeListener(t,r);break}typeof e==“function”&&this.addEventListener(t,e,{[Qdt]:!0})}})});lf.prototype.addEventListener=E9i;lf.prototype.removeEventListener=v9i;Qhr.exports=lf;function Bhr(t,e,r,n){let o={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:jdt[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,…n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:“GET”,host:void 0,path:void 0,port:void 0};if(t._autoPong=o.autoPong,!jdt.includes(o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${jdt.join(”, “)})`);let s;if(e instanceof Udt)s=e;else try{s=new Udt(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol===“http:”?s.protocol=“ws:”:s.protocol===“https:”&&(s.protocol=“wss:”),t._url=s.href;let a=s.protocol===“wss:”,c=s.protocol===“ws+unix:”,u;if(s.protocol!==“ws:”&&!a&&!c?u=`The URL’s protocol must be one of “ws:”, “wss:”, “http:”, “https:”, or “ws+unix:”`:c&&!s.pathname?u=“The URL’s pathname is empty”:s.hash&&(u=“The URL contains a fragment identifier”),u){let A=new SyntaxError(u);if(t._redirects===0)throw A;F5e(t,A);return}let d=a?443:80,f=f9i(16).toString(“base64”),p=a?l9i.request:u9i.request,h=new Set,m;if(o.createConnection=o.createConnection||(a?I9i:T9i),o.defaultPort=o.defaultPort||d,o.port=s.port||d,o.host=s.hostname.startsWith(”[”)?s.hostname.slice(1,-1):s.hostname,o.headers={…o.headers,“Sec-WebSocket-Version”:o.protocolVersion,“Sec-WebSocket-Key”:f,Connection:“Upgrade”,Upgrade:“websocket”},o.path=s.pathname+s.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&(m=new tN(o.perMessageDeflate!==!0?o.perMessageDeflate:{},!1,o.maxPayload),o.headers[“Sec-WebSocket-Extensions”]=b9i({[tN.extensionName]:m.offer()})),r.length){for(let A of r){if(typeof A!=“string”||!w9i.test(A)||h.has(A))throw new SyntaxError(“An invalid or duplicated subprotocol was specified”);h.add(A)}o.headers[“Sec-WebSocket-Protocol”]=r.join(”,”)}if(o.origin&&(o.protocolVersion<13?o.headers[“Sec-WebSocket-Origin”]=o.origin:o.headers.Origin=o.origin),(s.username||s.password)&&(o.auth=`${s.username}:${s.password}`),c){let A=o.path.split(”:”);o.socketPath=A[0],o.path=A[1]}let g;if(o.followRedirects){if(t._redirects===0){t._originalIpc=c,t._originalSecure=a,t._originalHostOrSocketPath=c?o.socketPath:s.host;let A=n&&n.headers;if(n={…n,headers:{}},A)for(let[y,E]of Object.entries(A))n.headers[y.toLowerCase()]=E}else if(t.listenerCount(“redirect”)===0){let A=c?t._originalIpc?o.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:s.host===t._originalHostOrSocketPath;(!A||t._originalSecure&&!a)&&(delete o.headers.authorization,delete o.headers.cookie,A||delete o.headers.host,o.auth=void 0)}o.auth&&!n.headers.authorization&&(n.headers.authorization=“Basic “+Buffer.from(o.auth).toString(“base64”)),g=t._req=p(o),t._redirects&&t.emit(“redirect”,t.url,g)}else g=t._req=p(o);o.timeout&&g.on(“timeout”,()=>{cE(t,g,“Opening handshake has timed out”)}),g.on(“error”,A=>{g===null||g[Ohr]||(g=t._req=null,F5e(t,A))}),g.on(“response”,A=>{let y=A.headers.location,E=A.statusCode;if(y&&o.followRedirects&&E>=300&&E<400){if(++t._redirects>o.maxRedirects){cE(t,g,“Maximum redirects exceeded”);return}g.abort();let v;try{v=new Udt(y,e)}catch{let S=new SyntaxError(`Invalid URL: ${y}`);F5e(t,S);return}Bhr(t,v,r,n)}else t.emit(“unexpected-response”,g,A)||cE(t,g,`Unexpected server response: ${A.statusCode}`)}),g.on(“upgrade”,(A,y,E)=>{if(t.emit(“upgrade”,A),t.readyState!==lf.CONNECTING)return;g=t._req=null;let v=A.headers.upgrade;if(v===void 0||v.toLowerCase()!==“websocket”){cE(t,y,“Invalid Upgrade header”);return}let b=p9i(“sha1”).update(f+A9i).digest(“base64”);if(A.headers[“sec-websocket-accept”]!==b){cE(t,y,“Invalid Sec-WebSocket-Accept header”);return}let S=A.headers[“sec-websocket-protocol”],w;if(S!==void 0?h.size?h.has(S)||(w=“Server sent an invalid subprotocol”):w=“Server sent a subprotocol but none was requested”:h.size&&(w=“Server sent no subprotocol”),w){cE(t,y,w);return}S&&(t._protocol=S);let k=A.headers[“sec-websocket-extensions”];if(k!==void 0){if(!m){cE(t,y,“Server sent a Sec-WebSocket-Extensions header but no extension was requested”);return}let D;try{D=C9i(k)}catch{cE(t,y,“Invalid Sec-WebSocket-Extensions header”);return}let P=Object.keys(D);if(P.length!==1||P[0]!==tN.extensionName){cE(t,y,“Server indicated an extension that was not requested”);return}try{m.accept(D[tN.extensionName])}catch{cE(t,y,“Invalid Sec-WebSocket-Extensions header”);return}t._extensions[tN.extensionName]=m}t.setSocket(y,E,{allowSynchronousEvents:o.allowSynchronousEvents,generateMask:o.generateMask,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})}),o.finishRequest?o.finishRequest(g,t):g.end()}function F5e(t,e){t._readyState=lf.CLOSING,t._errorEmitted=!0,t.emit(“error”,e),t.emitClose()}function T9i(t){return t.path=t.socketPath,khr.connect(t)}function I9i(t){return t.path=void 0,!t.servername&&t.servername!==””&&(t.servername=khr.isIP(t.host)?””:t.host),d9i.connect(t)}function cE(t,e,r){t._readyState=lf.CLOSING;let n=new Error(r);Error.captureStackTrace(n,cE),e.setHeader?(e[Ohr]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(F5e,t,n)):(e.destroy(n),e.once(“error”,t.emit.bind(t,“error”)),e.once(“close”,t.emitClose.bind(t)))}function $dt(t,e,r){if(e){let n=g9i(e)?e.size:S9i(e).length;t._socket?t._sender._bufferedBytes+=n:t._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${t.readyState} (${f7[t.readyState]})`);process.nextTick(r,n)}}function D9i(t,e){let r=this[gg];r._closeFrameReceived=!0,r._closeMessage=e,r._closeCode=t,r._socket[gg]!==void 0&&(r._socket.removeListener(“data”,L5e),process.nextTick(Phr,r._socket),t===1005?r.close():r.close(t,e))}function R9i(){let t=this[gg];t.isPaused||t._socket.resume()}function k9i(t){let e=this[gg];e._socket[gg]!==void 0&&(e._socket.removeListener(“data”,L5e),process.nextTick(Phr,e._socket),e.close(t[_9i])),e._errorEmitted||(e._errorEmitted=!0,e.emit(“error”,t))}function Rhr(){this[gg].emitClose()}function N9i(t,e){this[gg].emit(“message”,t,e)}function O9i(t){let e=this[gg];e._autoPong&&e.pong(t,!this._isServer,Nhr),e.emit(“ping”,t)}function B9i(t){this[gg].emit(“pong”,t)}function Phr(t){t.resume()}function P9i(t){let e=this[gg];e.readyState!==lf.CLOSED&&(e.readyState===lf.OPEN&&(e._readyState=lf.CLOSING,Mhr(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit(“error”,t)))}function Mhr(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),x9i)}function Fhr(){let t=this[gg];this.removeListener(“close”,Fhr),this.removeListener(“data”,L5e),this.removeListener(“end”,Lhr),t._readyState=lf.CLOSING;let e;!this._readableState.endEmitted&&!t._closeFrameReceived&&!t._receiver._writableState.errorEmitted&&(e=t._socket.read())!==null&&t._receiver.write(e),t._receiver.end(),this[gg]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on(“error”,Rhr),t._receiver.on(“finish”,Rhr))}function L5e(t){this[gg]._receiver.write(t)||this.pause()}function Lhr(){let t=this[gg];t._readyState=lf.CLOSING,t._receiver.end(),this.end()}function Uhr(){let t=this[gg];this.removeListener(“error”,Uhr),this.on(“error”,Nhr),t&&(t._readyState=lf.CLOSING,this.destroy())}});var qhr=I((kRa,Ghr)=>{“use strict”;var RRa=U5e(),{Duplex:M9i}=_e(“stream”);function jhr(t){t.emit(“close”)}function F9i(){!this.destroyed&&this._writableState.finished&&this.destroy()}function $hr(t){this.removeListener(“error”,$hr),this.destroy(),this.listenerCount(“error”)===0&&this.emit(“error”,t)}function L9i(t,e){let r=!0,n=new M9i({…e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return t.on(“message”,function(s,a){let c=!a&&n._readableState.objectMode?s.toString():s;n.push(c)||t.pause()}),t.once(“error”,function(s){n.destroyed||(r=!1,n.destroy(s))}),t.once(“close”,function(){n.destroyed||n.push(null)}),n._destroy=function(o,s){if(t.readyState===t.CLOSED){s(o),process.nextTick(jhr,n);return}let a=!1;t.once(“error”,function(u){a=!0,s(u)}),t.once(“close”,function(){a||s(o),process.nextTick(jhr,n)}),r&&t.terminate()},n._final=function(o){if(t.readyState===t.CONNECTING){t.once(“open”,function(){n._final(o)});return}t._socket!==null&&(t._socket._writableState.finished?(o(),n._readableState.endEmitted&&n.destroy()):(t._socket.once(“finish”,function(){o()}),t.close()))},n._read=function(){t.isPaused&&t.resume()},n._write=function(o,s,a){if(t.readyState===t.CONNECTING){t.once(“open”,function(){n._write(o,s,a)});return}t.send(o,a)},n.on(“end”,F9i),n.on(“error”,$hr),n}Ghr.exports=L9i});var Vhr=I((NRa,Hhr)=>{“use strict”;var{tokenChars:U9i}=tK();function Q9i(t){let e=new Set,r=-1,n=-1,o=0;for(o;o<t.length;o++){let a=t.charCodeAt(o);if(n===-1&&U9i[a]===1)r===-1&&(r=o);else if(o!==0&&(a===32||a===9))n===-1&&r!==-1&&(n=o);else if(a===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${o}`);n===-1&&(n=o);let c=t.slice(r,n);if(e.has(c))throw new SyntaxError(`The “${c}” subprotocol is duplicated`);e.add(c),r=n=-1}else throw new SyntaxError(`Unexpected character at index ${o}`)}if(r===-1||n!==-1)throw new SyntaxError(“Unexpected end of input”);let s=t.slice(r,o);if(e.has(s))throw new SyntaxError(`The “${s}” subprotocol is duplicated`);return e.add(s),e}Hhr.exports={parse:Q9i}});var Zhr=I((BRa,Jhr)=>{“use strict”;var j9i=_e(“events”),Q5e=_e(“http”),{Duplex:ORa}=_e(“stream”),{createHash:$9i}=_e(“crypto”),Whr=Ldt(),mU=Afe(),G9i=Vhr(),q9i=U5e(),{GUID:H9i,kWebSocket:V9i}=l7(),W9i=/^[+/0-9A-Za-z]{22}==$/,zhr=0,Yhr=1,Xhr=2,Gdt=class extends j9i{constructor(e,r){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:q9i,…e},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=Q5e.createServer((n,o)=>{let s=Q5e.STATUS_CODES[426];o.writeHead(426,{“Content-Length”:s.length,“Content-Type”:“text/plain”}),o.end(s)}),this._server.listen(e.port,e.host,e.backlog,r)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,“connection”);this._removeListeners=z9i(this._server,{listening:this.emit.bind(this,“listening”),error:this.emit.bind(this,“error”),upgrade:(o,s,a)=>{this.handleUpgrade(o,s,a,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=zhr}address(){if(this.options.noServer)throw new Error(‘The server is operating in “noServer” mode’);return this._server?this._server.address():null}close(e){if(this._state===Xhr){e&&this.once(“close”,()=>{e(new Error(“The server is not running”))}),process.nextTick(vfe,this);return}if(e&&this.once(“close”,e),this._state!==Yhr)if(this._state=Yhr,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(vfe,this):process.nextTick(vfe,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{vfe(this)})}}shouldHandle(e){if(this.options.path){let r=e.url.indexOf(”?”);if((r!==-1?e.url.slice(0,r):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,r,n,o){r.on(“error”,Khr);let s=e.headers[“sec-websocket-key”],a=e.headers.upgrade,c=+e.headers[“sec-websocket-version”];if(e.method!==“GET”){gU(this,e,r,405,“Invalid HTTP method”);return}if(a===void 0||a.toLowerCase()!==“websocket”){gU(this,e,r,400,“Invalid Upgrade header”);return}if(s===void 0||!W9i.test(s)){gU(this,e,r,400,“Missing or invalid Sec-WebSocket-Key header”);return}if(c!==13&&c!==8){gU(this,e,r,400,“Missing or invalid Sec-WebSocket-Version header”,{“Sec-WebSocket-Version”:“13, 8”});return}if(!this.shouldHandle(e)){bfe(r,400);return}let u=e.headers[“sec-websocket-protocol”],d=new Set;if(u!==void 0)try{d=G9i.parse(u)}catch{gU(this,e,r,400,“Invalid Sec-WebSocket-Protocol header”);return}let f=e.headers[“sec-websocket-extensions”],p={};if(this.options.perMessageDeflate&&f!==void 0){let h=new mU(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let m=Whr.parse(f);m[mU.extensionName]&&(h.accept(m[mU.extensionName]),p[mU.extensionName]=h)}catch{gU(this,e,r,400,“Invalid or unacceptable Sec-WebSocket-Extensions header”);return}}if(this.options.verifyClient){let h={origin:e.headers[`${c===8?“sec-websocket-origin”:“origin”}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(h,(m,g,A,y)=>{if(!m)return bfe(r,g||401,A,y);this.completeUpgrade(p,s,d,e,r,n,o)});return}if(!this.options.verifyClient(h))return bfe(r,401)}this.completeUpgrade(p,s,d,e,r,n,o)}completeUpgrade(e,r,n,o,s,a,c){if(!s.readable||!s.writable)return s.destroy();if(s[V9i])throw new Error(“server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration”);if(this._state>zhr)return bfe(s,503);let d=[“HTTP/1.1 101 Switching Protocols”,“Upgrade: websocket”,“Connection: Upgrade”,`Sec-WebSocket-Accept: ${$9i(“sha1”).update(r+H9i).digest(“base64”)}`],f=new this.options.WebSocket(null,void 0,this.options);if(n.size){let p=this.options.handleProtocols?this.options.handleProtocols(n,o):n.values().next().value;p&&(d.push(`Sec-WebSocket-Protocol: ${p}`),f._protocol=p)}if(e[mU.extensionName]){let p=e[mU.extensionName].params,h=Whr.format({[mU.extensionName]:[p]});d.push(`Sec-WebSocket-Extensions: ${h}`),f._extensions=e}this.emit(“headers”,d,o),s.write(d.concat(`\r

SyntaxError: Invalid regular expression flags

at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:119:18)

at ESMLoader.moduleProvider (node:internal/modules/esm/loader:468:14)

at async link (node:internal/modules/esm/module_job:67:21)

您好,可以使用以下一键安装脚本,会安装全部所需依赖:
bash -c “$(curl -fsSL https://gitee.com/iflow-ai/iflow-cli/raw/main/install.sh)”

2 个赞

问题解决了,感谢