@gadgetinc/ggt 1.7.1 → 1.7.3
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.
- package/README.md +1 -0
- package/dist/{add-M2YVCVDJ.js → add-VP2I3CKE.js} +2 -2
- package/dist/{chunk-UAZBF6WU.js → chunk-22W3HJQG.js} +2 -2
- package/dist/{chunk-2WKENYA3.js → chunk-DRI75CDO.js} +2 -2
- package/dist/{chunk-GC4CQ6BI.js → chunk-IZO5RL5L.js} +2 -2
- package/dist/{chunk-TPWSJOGX.js → chunk-L5H5T2T6.js} +3 -3
- package/dist/{chunk-TPWSJOGX.js.map → chunk-L5H5T2T6.js.map} +2 -2
- package/dist/{chunk-ILB6CSBN.js → chunk-MHTXRD5G.js} +2 -2
- package/dist/{chunk-KMNQ3LJT.js → chunk-OIVNACS7.js} +2 -2
- package/dist/{chunk-KMNQ3LJT.js.map → chunk-OIVNACS7.js.map} +2 -2
- package/dist/{chunk-DP2MEKPK.js → chunk-OKVWONGO.js} +2 -2
- package/dist/{chunk-DYAWQS24.js → chunk-X47UA3VR.js} +2 -2
- package/dist/{configure-LD5XC2MR.js → configure-CXY6JQB7.js} +2 -2
- package/dist/{deploy-QX2ELPOA.js → deploy-ZRLKAGWM.js} +2 -2
- package/dist/{dev-ODLZZUI4.js → dev-XI2RDRXJ.js} +3 -2
- package/dist/{dev-ODLZZUI4.js.map → dev-XI2RDRXJ.js.map} +2 -2
- package/dist/{list-E3DN5VVW.js → list-3QZTSHQV.js} +2 -2
- package/dist/login-HKGCVIWO.js +2 -0
- package/dist/{logout-ACRXIJEF.js → logout-SWWGI27Q.js} +2 -2
- package/dist/{logs-VGDAULNT.js → logs-36QPFIDT.js} +2 -2
- package/dist/main.js +1 -1
- package/dist/{open-LBVP7DXX.js → open-65LHZE2M.js} +2 -2
- package/dist/{pull-I3WM4RL3.js → pull-GS2VSBLT.js} +2 -2
- package/dist/push-4LGFNWTC.js +2 -0
- package/dist/{status-2PKSATWL.js → status-6QVAIYUR.js} +2 -2
- package/dist/{whoami-LEZVATND.js → whoami-MIJFO4MW.js} +2 -2
- package/package.json +1 -1
- package/dist/login-LXGUUTW3.js +0 -2
- package/dist/push-GE55G6KR.js +0 -2
- /package/dist/{add-M2YVCVDJ.js.map → add-VP2I3CKE.js.map} +0 -0
- /package/dist/{chunk-UAZBF6WU.js.map → chunk-22W3HJQG.js.map} +0 -0
- /package/dist/{chunk-2WKENYA3.js.map → chunk-DRI75CDO.js.map} +0 -0
- /package/dist/{chunk-GC4CQ6BI.js.map → chunk-IZO5RL5L.js.map} +0 -0
- /package/dist/{chunk-ILB6CSBN.js.map → chunk-MHTXRD5G.js.map} +0 -0
- /package/dist/{chunk-DP2MEKPK.js.map → chunk-OKVWONGO.js.map} +0 -0
- /package/dist/{chunk-DYAWQS24.js.map → chunk-X47UA3VR.js.map} +0 -0
- /package/dist/{configure-LD5XC2MR.js.map → configure-CXY6JQB7.js.map} +0 -0
- /package/dist/{deploy-QX2ELPOA.js.map → deploy-ZRLKAGWM.js.map} +0 -0
- /package/dist/{list-E3DN5VVW.js.map → list-3QZTSHQV.js.map} +0 -0
- /package/dist/{login-LXGUUTW3.js.map → login-HKGCVIWO.js.map} +0 -0
- /package/dist/{logout-ACRXIJEF.js.map → logout-SWWGI27Q.js.map} +0 -0
- /package/dist/{logs-VGDAULNT.js.map → logs-36QPFIDT.js.map} +0 -0
- /package/dist/{open-LBVP7DXX.js.map → open-65LHZE2M.js.map} +0 -0
- /package/dist/{pull-I3WM4RL3.js.map → pull-GS2VSBLT.js.map} +0 -0
- /package/dist/{push-GE55G6KR.js.map → push-4LGFNWTC.js.map} +0 -0
- /package/dist/{status-2PKSATWL.js.map → status-6QVAIYUR.js.map} +0 -0
- /package/dist/{whoami-LEZVATND.js.map → whoami-MIJFO4MW.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as O,g as R,h as M,i as j,j as k,k as P,p as b}from"./chunk-
|
|
1
|
+
import{f as O,g as R,h as M,i as j,j as k,k as P,p as b}from"./chunk-DRI75CDO.js";import{g as N,l as D,m as _,n as E}from"./chunk-22W3HJQG.js";import"./chunk-JSGXXXFU.js";import"./chunk-WNAYBYSG.js";import{c as f}from"./chunk-IZO5RL5L.js";import{a as J}from"./chunk-JBY5A44K.js";import"./chunk-HN3YKQ3C.js";import{B as U,C as L,a as T,e as C,f as S,l as B,n as y}from"./chunk-L5H5T2T6.js";import"./chunk-X47UA3VR.js";import{b as w}from"./chunk-XGQQOMPO.js";import"./chunk-OIVNACS7.js";import{b as m,ha as d,ja as p,n as F}from"./chunk-24OT7GHO.js";import"./chunk-GFQYFEEH.js";import{a as g,h as $}from"./chunk-7DYQUG5M.js";$();var h=class extends S{static{g(this,"AddClientError")}isBug=C.NO;constructor(o){let i="";if(F(o.cause)){let a=B(o.cause.map(e=>e.message));i=d` • ${a.map(e=>e.split(`
|
|
2
2
|
`).join(`
|
|
3
3
|
\u200E \u2022 `)).join(`
|
|
4
4
|
`)}`}else i=d`${o.cause}`;super(i)}render(){return`${m.redBright(w.cross)} Failed to add:
|
|
@@ -78,4 +78,4 @@ import{f as O,g as R,h as M,i as j,j as k,k as P,p as b}from"./chunk-2WKENYA3.js
|
|
|
78
78
|
|
|
79
79
|
{gray Usage}
|
|
80
80
|
{cyanBright ggt add field ${e[0]}/<field_name>:<field_type>}`);try{let n=(await a.edit.mutate({mutation:j,variables:{path:e[0],fields:r.map(s=>({name:s.name,fieldType:s.fieldType}))}})).createModelFields;await i.writeToLocalFilesystem(t,{filesVersion:n.remoteFilesVersion,files:n.changed,delete:[]})}catch(n){throw n instanceof y?new h(n):n}p({ensureEmptyLineAbove:!0,content:`Field ${m.cyanBright(r[0]?.name)} added successfully.`})},"fieldSubCommand"),Q=g(async(t,{args:o,filesync:i})=>{let a=i.syncJson,e=o._[1]??Y();try{await a.edit.mutate({mutation:k,variables:{environment:{slug:e,sourceSlug:a.environment.name}}})}catch(n){throw n instanceof y?new h(n):n}if(p({ensureEmptyLineAbove:!0,content:`Environment ${m.cyanBright(e)} added successfully.`}),await _.load(t,{command:"pull",args:{_:[],"--app":void 0,"--allow-unknown-directory":void 0,"--allow-different-app":void 0,"--env":e},directory:await E(process.cwd())})){let n=new b(a),s=await n.hashes(t);if(s.environmentChangesToPull.size===0){p({ensureEmptyLineAbove:!0,content:"Nothing to pull."});return}s.localChangesToPush.size>0&&await n.print(t,{hashes:s}),await n.pull(t,{hashes:s,force:!0})}},"envSubCommand"),Y=g(()=>{let t=new Date;return`env-${t.toISOString().slice(0,10).replace(/-/g,"")}-${t.toLocaleTimeString("en-US",{hour12:!1}).replace(/:/g,"")}`},"makeDefaultEnvName");export{h as AddClientError,ue as args,fe as run,G as usage};
|
|
81
|
-
//# sourceMappingURL=add-
|
|
81
|
+
//# sourceMappingURL=add-VP2I3CKE.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as K}from"./chunk-
|
|
1
|
+
import{c as K}from"./chunk-IZO5RL5L.js";import{a as be}from"./chunk-JBY5A44K.js";import{a as no,b as so}from"./chunk-HN3YKQ3C.js";import{A as Lr,D as kt,a as ft,b as Rr,e as wt,f as _t,j as io,k as Ar,m as ge,n as X,o as Fr,w as jr,x as Dr,y as ye,z as ve}from"./chunk-L5H5T2T6.js";import{a as $r}from"./chunk-OIVNACS7.js";import{$ as Or,A as ro,N as Pr,U as vt,Z as he,b as st,e as J,g as br,h as wr,ha as C,i as _r,ia as $,ja as bt,m as kr,n as Tr,u as Sr,v as Cr,w as xr,z as Er}from"./chunk-24OT7GHO.js";import{a as eo}from"./chunk-GFQYFEEH.js";import{a as n,b as de,d as nt,f as pt,h as T}from"./chunk-7DYQUG5M.js";var Gr=nt(N=>{"use strict";T();var uo=N&&N.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(N,"__esModule",{value:!0});var co=de("fs"),lo=uo(so()),mt=lo.default("@kwsites/file-exists");function po(t,e,r){mt("checking %s",t);try{let s=co.statSync(t);return s.isFile()&&e?(mt("[OK] path represents a file"),!0):s.isDirectory()&&r?(mt("[OK] path represents a directory"),!0):(mt("[FAIL] path represents something other than a file or directory"),!1)}catch(s){if(s.code==="ENOENT")return mt("[FAIL] path is not accessible: %o",s),!1;throw mt("[FATAL] %o",s),s}}n(po,"check");function fo(t,e=N.READABLE){return po(t,(e&N.FILE)>0,(e&N.FOLDER)>0)}n(fo,"exists");N.exists=fo;N.FILE=1;N.FOLDER=2;N.READABLE=N.FILE+N.FOLDER});var Ur=nt(Bt=>{"use strict";T();function mo(t){for(var e in t)Bt.hasOwnProperty(e)||(Bt[e]=t[e])}n(mo,"__export");Object.defineProperty(Bt,"__esModule",{value:!0});mo(Gr())});var _e=nt((kl,qr)=>{T();function ho(t){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=i,r.enabled=a,r.humanize=eo(),r.destroy=d,Object.keys(t).forEach(p=>{r[p]=t[p]}),r.names=[],r.skips=[],r.formatters={};function e(p){let m=0;for(let h=0;h<p.length;h++)m=(m<<5)-m+p.charCodeAt(h),m|=0;return r.colors[Math.abs(m)%r.colors.length]}n(e,"selectColor"),r.selectColor=e;function r(p){let m,h=null,g,I;function q(...D){if(!q.enabled)return;let Y=q,ct=Number(new Date),le=ct-(m||ct);Y.diff=le,Y.prev=m,Y.curr=ct,m=ct,D[0]=r.coerce(D[0]),typeof D[0]!="string"&&D.unshift("%O");let lt=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,(yt,pe)=>{if(yt==="%%")return"%";lt++;let Lt=r.formatters[pe];if(typeof Lt=="function"){let fe=D[lt];yt=Lt.call(Y,fe),D.splice(lt,1),lt--}return yt}),r.formatArgs.call(Y,D),(Y.log||r.log).apply(Y,D)}return n(q,"debug"),q.namespace=p,q.useColors=r.useColors(),q.color=r.selectColor(p),q.extend=s,q.destroy=r.destroy,Object.defineProperty(q,"enabled",{enumerable:!0,configurable:!1,get:n(()=>h!==null?h:(g!==r.namespaces&&(g=r.namespaces,I=r.enabled(p)),I),"get"),set:n(D=>{h=D},"set")}),typeof r.init=="function"&&r.init(q),q}n(r,"createDebug");function s(p,m){let h=r(this.namespace+(typeof m>"u"?":":m)+p);return h.log=this.log,h}n(s,"extend");function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let m,h=(typeof p=="string"?p:"").split(/[\s,]+/),g=h.length;for(m=0;m<g;m++)h[m]&&(p=h[m].replace(/\*/g,".*?"),p[0]==="-"?r.skips.push(new RegExp("^"+p.slice(1)+"$")):r.names.push(new RegExp("^"+p+"$")))}n(i,"enable");function o(){let p=[...r.names.map(u),...r.skips.map(u).map(m=>"-"+m)].join(",");return r.enable(""),p}n(o,"disable");function a(p){if(p[p.length-1]==="*")return!0;let m,h;for(m=0,h=r.skips.length;m<h;m++)if(r.skips[m].test(p))return!1;for(m=0,h=r.names.length;m<h;m++)if(r.names[m].test(p))return!0;return!1}n(a,"enabled");function u(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}n(u,"toNamespace");function c(p){return p instanceof Error?p.stack||p.message:p}n(c,"coerce");function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n(d,"destroy"),r.enable(r.load()),r}n(ho,"setup");qr.exports=ho});var Jr=nt((G,It)=>{T();G.formatArgs=yo;G.save=vo;G.load=bo;G.useColors=go;G.storage=wo();G.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();G.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function go(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}n(go,"useColors");function yo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+It.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(s=r))}),t.splice(s,0,e)}n(yo,"formatArgs");G.log=console.debug||console.log||(()=>{});function vo(t){try{t?G.storage.setItem("debug",t):G.storage.removeItem("debug")}catch{}}n(vo,"save");function bo(){let t;try{t=G.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}n(bo,"load");function wo(){try{return localStorage}catch{}}n(wo,"localstorage");It.exports=_e()(G);var{formatters:_o}=It.exports;_o.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Vr=nt((R,Gt)=>{T();var ko=de("tty"),Nt=de("util");R.init=Oo;R.log=xo;R.formatArgs=So;R.save=Eo;R.load=Po;R.useColors=To;R.destroy=Nt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");R.colors=[6,2,3,4,5,1];try{let t=no();t&&(t.stderr||t).level>=2&&(R.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}R.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),s=process.env[e];return/^(yes|on|true|enabled)$/i.test(s)?s=!0:/^(no|off|false|disabled)$/i.test(s)?s=!1:s==="null"?s=null:s=Number(s),t[r]=s,t},{});function To(){return"colors"in R.inspectOpts?!!R.inspectOpts.colors:ko.isatty(process.stderr.fd)}n(To,"useColors");function So(t){let{namespace:e,useColors:r}=this;if(r){let s=this.color,i="\x1B[3"+(s<8?s:"8;5;"+s),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
|
|
2
2
|
`).join(`
|
|
3
3
|
`+o),t.push(i+"m+"+Gt.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Co()+e+" "+t[0]}n(So,"formatArgs");function Co(){return R.inspectOpts.hideDate?"":new Date().toISOString()+" "}n(Co,"getDate");function xo(...t){return process.stderr.write(Nt.formatWithOptions(R.inspectOpts,...t)+`
|
|
4
4
|
`)}n(xo,"log");function Eo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}n(Eo,"save");function Po(){return process.env.DEBUG}n(Po,"load");function Oo(t){t.inspectOpts={};let e=Object.keys(R.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=R.inspectOpts[e[r]]}n(Oo,"init");Gt.exports=_e()(R);var{formatters:zr}=Gt.exports;zr.o=function(t){return this.inspectOpts.colors=this.useColors,Nt.inspect(t,this.inspectOpts).split(`
|
|
@@ -113,4 +113,4 @@ import{c as K}from"./chunk-GC4CQ6BI.js";import{a as be}from"./chunk-JBY5A44K.js"
|
|
|
113
113
|
• ${u.join(`
|
|
114
114
|
\u2022 `)}
|
|
115
115
|
`)},"loadEnvironment"),Uc=n(async(t,{directory:e})=>{try{return await Pi(e.path).revparse(["--abbrev-ref","HEAD"])}catch(r){t.log.warn("failed to read git branch",{error:r});return}},"loadBranch"),qc=J.object({application:J.string(),environment:J.string(),environments:J.record(J.object({filesVersion:J.string()}))}),Jc=J.object({app:J.string(),filesVersion:J.string(),mtime:J.number()}),zc=J.union([qc,Jc]),Vc=zc.transform(t=>"environment"in t?t:{application:t.app,environment:"development",environments:{development:{filesVersion:t.filesVersion}}});export{Xc as a,we as b,Zc as c,tl as d,el as e,Br as f,Mt as g,Ir as h,Nr as i,ao as j,fl as k,Hp as l,gr as m,Yp as n};
|
|
116
|
-
//# sourceMappingURL=chunk-
|
|
116
|
+
//# sourceMappingURL=chunk-22W3HJQG.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as bt,e as Et,h as xt,j as Ie,k as ne}from"./chunk-UAZBF6WU.js";import{a as ft,b as ht}from"./chunk-JSGXXXFU.js";import{b as W}from"./chunk-WNAYBYSG.js";import{c as St}from"./chunk-GC4CQ6BI.js";import{a as Ct}from"./chunk-JBY5A44K.js";import{F as _t,h as Me,i as vr,j as gt,p as Mt,u as Ae}from"./chunk-TPWSJOGX.js";import{b as N}from"./chunk-XGQQOMPO.js";import{b as It,c as At}from"./chunk-KMNQ3LJT.js";import{A as Tr,O as ct,R as dt,S as D,V as xe,W as te,Z as yt,aa as mt,b as E,d as ot,g as st,ha as g,ia as G,ja as O,o as it,q as Ee,r as lt,s as ut,t as pt}from"./chunk-24OT7GHO.js";import{a as Cr}from"./chunk-GFQYFEEH.js";import{a,b as F,d as x,f as w,h as p}from"./chunk-7DYQUG5M.js";var $t=x((Ts,Ut)=>{p();Ut.exports=Ht;Ht.sync=Br;var Dt=F("fs");function Nr(e,t){var n=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var o=n[r].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}a(Nr,"checkPathExt");function Gt(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:Nr(t,n)}a(Gt,"checkStat");function Ht(e,t,n){Dt.stat(e,function(r,o){n(r,r?!1:Gt(o,e,t))})}a(Ht,"isexe");function Br(e,t){return Gt(Dt.statSync(e),e,t)}a(Br,"sync")});var qt=x((Rs,Wt)=>{p();Wt.exports=jt;jt.sync=kr;var Qt=F("fs");function jt(e,t,n){Qt.stat(e,function(r,o){n(r,r?!1:Jt(o,t))})}a(jt,"isexe");function kr(e,t){return Jt(Qt.statSync(e),t)}a(kr,"sync");function Jt(e,t){return e.isFile()&&Lr(e,t)}a(Jt,"checkStat");function Lr(e,t){var n=e.mode,r=e.uid,o=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),i=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),l=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),d=l|u,y=n&c||n&u&&o===i||n&l&&r===s||n&d&&s===0;return y}a(Lr,"checkMode")});var zt=x((Ns,Yt)=>{p();var Os=F("fs"),oe;process.platform==="win32"||global.TESTING_WINDOWS?oe=$t():oe=qt();Yt.exports=Te;Te.sync=Vr;function Te(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,o){Te(e,t||{},function(s,i){s?o(s):r(i)})})}oe(e,t||{},function(r,o){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,o=!1),n(r,o)})}a(Te,"isexe");function Vr(e,t){try{return oe.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}a(Vr,"sync")});var rn=x((Ls,nn)=>{p();var $=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Kt=F("path"),Dr=$?";":":",Xt=zt(),Zt=a(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),en=a((e,t)=>{let n=t.colon||Dr,r=e.match(/\//)||$&&e.match(/\\/)?[""]:[...$?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],o=$?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=$?o.split(n):[""];return $&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:r,pathExt:s,pathExtExe:o}},"getPathInfo"),tn=a((e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:o,pathExtExe:s}=en(e,t),i=[],l=a(c=>new Promise((d,y)=>{if(c===r.length)return t.all&&i.length?d(i):y(Zt(e));let m=r[c],S=/^".*"$/.test(m)?m.slice(1,-1):m,f=Kt.join(S,e),h=!S&&/^\.[\\\/]/.test(e)?e.slice(0,2)+f:f;d(u(h,c,0))}),"step"),u=a((c,d,y)=>new Promise((m,S)=>{if(y===o.length)return m(l(d+1));let f=o[y];Xt(c+f,{pathExt:s},(h,b)=>{if(!h&&b)if(t.all)i.push(c+f);else return m(c+f);return m(u(c,d,y+1))})}),"subStep");return n?l(0).then(c=>n(null,c),n):l(0)},"which"),Gr=a((e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:o}=en(e,t),s=[];for(let i=0;i<n.length;i++){let l=n[i],u=/^".*"$/.test(l)?l.slice(1,-1):l,c=Kt.join(u,e),d=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+c:c;for(let y=0;y<r.length;y++){let m=d+r[y];try{if(Xt.sync(m,{pathExt:o}))if(t.all)s.push(m);else return m}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Zt(e)},"whichSync");nn.exports=tn;tn.sync=Gr});var on=x((Gs,ve)=>{"use strict";p();var an=a((e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"},"pathKey");ve.exports=an;ve.exports.default=an});var pn=x(($s,un)=>{"use strict";p();var sn=F("path"),Hr=rn(),Ur=on();function ln(e,t){let n=e.options.env||process.env,r=process.cwd(),o=e.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let i;try{i=Hr.sync(e.command,{path:n[Ur({env:n})],pathExt:t?sn.delimiter:void 0})}catch{}finally{s&&process.chdir(r)}return i&&(i=sn.resolve(o?e.options.cwd:"",i)),i}a(ln,"resolveCommandAttempt");function $r(e){return ln(e)||ln(e,!0)}a($r,"resolveCommand");un.exports=$r});var cn=x((Js,Re)=>{"use strict";p();var Fe=/([()\][%!^"`<>&|;, *?])/g;function Qr(e){return e=e.replace(Fe,"^$1"),e}a(Qr,"escapeCommand");function jr(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(Fe,"^$1"),t&&(e=e.replace(Fe,"^$1")),e}a(jr,"escapeArgument");Re.exports.command=Qr;Re.exports.argument=jr});var yn=x((Ys,dn)=>{"use strict";p();dn.exports=/^#!(.*)/});var Sn=x((Ks,mn)=>{"use strict";p();var Jr=yn();mn.exports=(e="")=>{let t=e.match(Jr);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,"").split(" "),o=n.split("/").pop();return o==="env"?r:r?`${o} ${r}`:o}});var fn=x((Zs,gn)=>{"use strict";p();var we=F("fs"),Wr=Sn();function qr(e){let n=Buffer.alloc(150),r;try{r=we.openSync(e,"r"),we.readSync(r,n,0,150,0),we.closeSync(r)}catch{}return Wr(n.toString())}a(qr,"readShebang");gn.exports=qr});var xn=x((ni,En)=>{"use strict";p();var Yr=F("path"),hn=pn(),bn=cn(),zr=fn(),Kr=process.platform==="win32",Xr=/\.(?:com|exe)$/i,Zr=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function ea(e){e.file=hn(e);let t=e.file&&zr(e.file);return t?(e.args.unshift(e.file),e.command=t,hn(e)):e.file}a(ea,"detectShebang");function ta(e){if(!Kr)return e;let t=ea(e),n=!Xr.test(t);if(e.options.forceShell||n){let r=Zr.test(t);e.command=Yr.normalize(e.command),e.command=bn.command(e.command),e.args=e.args.map(s=>bn.argument(s,r));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}a(ta,"parseNonShell");function na(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:ta(r)}a(na,"parse");En.exports=na});var An=x((oi,In)=>{"use strict";p();var Pe=process.platform==="win32";function Oe(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}a(Oe,"notFoundError");function ra(e,t){if(!Pe)return;let n=e.emit;e.emit=function(r,o){if(r==="exit"){let s=Mn(o,t,"spawn");if(s)return n.call(e,"error",s)}return n.apply(e,arguments)}}a(ra,"hookChildProcess");function Mn(e,t){return Pe&&e===1&&!t.file?Oe(t.original,"spawn"):null}a(Mn,"verifyENOENT");function aa(e,t){return Pe&&e===1&&!t.file?Oe(t.original,"spawnSync"):null}a(aa,"verifyENOENTSync");In.exports={hookChildProcess:ra,verifyENOENT:Mn,verifyENOENTSync:aa,notFoundError:Oe}});var Tn=x((li,Q)=>{"use strict";p();var _n=F("child_process"),Ne=xn(),Be=An();function Cn(e,t,n){let r=Ne(e,t,n),o=_n.spawn(r.command,r.args,r.options);return Be.hookChildProcess(o,r),o}a(Cn,"spawn");function oa(e,t,n){let r=Ne(e,t,n),o=_n.spawnSync(r.command,r.args,r.options);return o.error=o.error||Be.verifyENOENTSync(o.status,r),o}a(oa,"spawnSync");Q.exports=Cn;Q.exports.spawn=Cn;Q.exports.sync=oa;Q.exports._parse=Ne;Q.exports._enoent=Be});var Zn=x((zl,Xn)=>{"use strict";p();var{PassThrough:to}=F("stream");Xn.exports=function(){var e=[],t=new to({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(n),t;function n(s){return Array.isArray(s)?(s.forEach(n),this):(e.push(s),s.once("end",o.bind(null,s)),s.once("error",t.emit.bind(t,"error")),s.pipe(t,{end:!1}),this)}a(n,"add");function r(){return e.length==0}a(r,"isEmpty");function o(s){e=e.filter(function(i){return i!==s}),!e.length&&t.readable&&t.end()}a(o,"remove")}});var fr=x(($u,gr)=>{p();function A(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}a(A,"RetryOperation");gr.exports=A;A.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};A.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};A.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0};A.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};A.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};A.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};A.prototype.start=A.prototype.try;A.prototype.errors=function(){return this._errors};A.prototype.attempts=function(){return this._attempts};A.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var o=this._errors[r],s=o.message,i=(e[s]||0)+1;e[s]=i,i>=n&&(t=o,n=i)}return t}});var hr=x(L=>{p();var Co=fr();L.operation=function(e){var t=L.timeouts(e);return new Co(t,{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};L.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],o=0;o<t.retries;o++)r.push(this.createTimeout(o,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(o,t)),r.sort(function(s,i){return s-i}),r};L.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*Math.pow(t.factor,e));return r=Math.min(r,t.maxTimeout),r};L.wrap=function(e,t,n){if(t instanceof Array&&(n=t,t=null),!n){n=[];for(var r in e)typeof e[r]=="function"&&n.push(r)}for(var o=0;o<n.length;o++){var s=n[o],i=e[s];e[s]=a(function(u){var c=L.operation(t),d=Array.prototype.slice.call(arguments,1),y=d.pop();d.push(function(m){c.retry(m)||(m&&(arguments[0]=c.mainError()),y.apply(this,arguments))}),c.attempt(function(){u.apply(e,d)})},"retryWrapper").bind(e,i),e[s].options=t}}});var Er=x((Yu,br)=>{p();br.exports=hr()});p();var q=w(gt(),1);var re=class extends Map{static{a(this,"Changes")}created=D(()=>Array.from(this.entries()).filter(([,t])=>t.type==="create").map(([t])=>t));updated=D(()=>Array.from(this.entries()).filter(([,t])=>t.type==="update").map(([t])=>t));deleted=D(()=>Array.from(this.entries()).filter(([,t])=>t.type==="delete").map(([t])=>t))},Fr=E.greenBright("+"),Rr=E.blueBright("\xB1"),wr=E.redBright("-"),Tt=E.yellowBright("\u2192"),Y=a((e,{changes:t,tense:n,limit:r=1/0,...o})=>{yt.logLevel<=te.TRACE&&(r=1/0);let s=Array.from(t.entries()).filter(([m])=>!m.startsWith(".gadget/"));if(s.length===0)return"";let i=E.yellowBright(n==="past"?"renamed":"rename"),l=E.greenBright(n==="past"?"created":"create"),u=E.blueBright(n==="past"?"updated":"update"),c=E.redBright(n==="past"?"deleted":"delete"),d=s.sort((m,S)=>m[0].localeCompare(S[0])).slice(0,r).map(([m,S])=>{switch(!0){case(S.type==="create"&&st(S.oldPath)):return[Tt,E.yellowBright(S.oldPath),i,Tt,E.yellowBright(m)];case S.type==="create":return[Fr,E.greenBright(m),l];case S.type==="update":return[Rr,E.blueBright(m),u];case S.type==="delete":return[wr,E.redBright(m),c];default:return it(S)}});s.length>r&&d.push([E.gray(N.ellipsis),g`{gray ${s.length-r} more}`,""]);let y;if(s.length>=5){let m=[],S=s.filter(([,b])=>b.type==="create").length;if(S>0){let b=n==="past"?`${S} created`:(0,q.default)("create",S,!0);m.push(g`{greenBright ${b}}`)}let f=s.filter(([,b])=>b.type==="update").length;if(f>0){let b=n==="past"?`${f} updated`:(0,q.default)("update",f,!0);m.push(g`{blueBright ${b}}`)}let h=s.filter(([,b])=>b.type==="delete").length;if(h>0){let b=n==="past"?`${h} deleted`:(0,q.default)("delete",h,!0);m.push(g`{redBright ${b}}`)}y=G`
|
|
1
|
+
import{b as bt,e as Et,h as xt,j as Ie,k as ne}from"./chunk-22W3HJQG.js";import{a as ft,b as ht}from"./chunk-JSGXXXFU.js";import{b as W}from"./chunk-WNAYBYSG.js";import{c as St}from"./chunk-IZO5RL5L.js";import{a as Ct}from"./chunk-JBY5A44K.js";import{F as _t,h as Me,i as vr,j as gt,p as Mt,u as Ae}from"./chunk-L5H5T2T6.js";import{b as N}from"./chunk-XGQQOMPO.js";import{b as It,c as At}from"./chunk-OIVNACS7.js";import{A as Tr,O as ct,R as dt,S as D,V as xe,W as te,Z as yt,aa as mt,b as E,d as ot,g as st,ha as g,ia as G,ja as O,o as it,q as Ee,r as lt,s as ut,t as pt}from"./chunk-24OT7GHO.js";import{a as Cr}from"./chunk-GFQYFEEH.js";import{a,b as F,d as x,f as w,h as p}from"./chunk-7DYQUG5M.js";var $t=x((Ts,Ut)=>{p();Ut.exports=Ht;Ht.sync=Br;var Dt=F("fs");function Nr(e,t){var n=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var o=n[r].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}a(Nr,"checkPathExt");function Gt(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:Nr(t,n)}a(Gt,"checkStat");function Ht(e,t,n){Dt.stat(e,function(r,o){n(r,r?!1:Gt(o,e,t))})}a(Ht,"isexe");function Br(e,t){return Gt(Dt.statSync(e),e,t)}a(Br,"sync")});var qt=x((Rs,Wt)=>{p();Wt.exports=jt;jt.sync=kr;var Qt=F("fs");function jt(e,t,n){Qt.stat(e,function(r,o){n(r,r?!1:Jt(o,t))})}a(jt,"isexe");function kr(e,t){return Jt(Qt.statSync(e),t)}a(kr,"sync");function Jt(e,t){return e.isFile()&&Lr(e,t)}a(Jt,"checkStat");function Lr(e,t){var n=e.mode,r=e.uid,o=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),i=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),l=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),d=l|u,y=n&c||n&u&&o===i||n&l&&r===s||n&d&&s===0;return y}a(Lr,"checkMode")});var zt=x((Ns,Yt)=>{p();var Os=F("fs"),oe;process.platform==="win32"||global.TESTING_WINDOWS?oe=$t():oe=qt();Yt.exports=Te;Te.sync=Vr;function Te(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,o){Te(e,t||{},function(s,i){s?o(s):r(i)})})}oe(e,t||{},function(r,o){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,o=!1),n(r,o)})}a(Te,"isexe");function Vr(e,t){try{return oe.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}a(Vr,"sync")});var rn=x((Ls,nn)=>{p();var $=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Kt=F("path"),Dr=$?";":":",Xt=zt(),Zt=a(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),en=a((e,t)=>{let n=t.colon||Dr,r=e.match(/\//)||$&&e.match(/\\/)?[""]:[...$?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],o=$?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=$?o.split(n):[""];return $&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:r,pathExt:s,pathExtExe:o}},"getPathInfo"),tn=a((e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:o,pathExtExe:s}=en(e,t),i=[],l=a(c=>new Promise((d,y)=>{if(c===r.length)return t.all&&i.length?d(i):y(Zt(e));let m=r[c],S=/^".*"$/.test(m)?m.slice(1,-1):m,f=Kt.join(S,e),h=!S&&/^\.[\\\/]/.test(e)?e.slice(0,2)+f:f;d(u(h,c,0))}),"step"),u=a((c,d,y)=>new Promise((m,S)=>{if(y===o.length)return m(l(d+1));let f=o[y];Xt(c+f,{pathExt:s},(h,b)=>{if(!h&&b)if(t.all)i.push(c+f);else return m(c+f);return m(u(c,d,y+1))})}),"subStep");return n?l(0).then(c=>n(null,c),n):l(0)},"which"),Gr=a((e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:o}=en(e,t),s=[];for(let i=0;i<n.length;i++){let l=n[i],u=/^".*"$/.test(l)?l.slice(1,-1):l,c=Kt.join(u,e),d=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+c:c;for(let y=0;y<r.length;y++){let m=d+r[y];try{if(Xt.sync(m,{pathExt:o}))if(t.all)s.push(m);else return m}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Zt(e)},"whichSync");nn.exports=tn;tn.sync=Gr});var on=x((Gs,ve)=>{"use strict";p();var an=a((e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"},"pathKey");ve.exports=an;ve.exports.default=an});var pn=x(($s,un)=>{"use strict";p();var sn=F("path"),Hr=rn(),Ur=on();function ln(e,t){let n=e.options.env||process.env,r=process.cwd(),o=e.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let i;try{i=Hr.sync(e.command,{path:n[Ur({env:n})],pathExt:t?sn.delimiter:void 0})}catch{}finally{s&&process.chdir(r)}return i&&(i=sn.resolve(o?e.options.cwd:"",i)),i}a(ln,"resolveCommandAttempt");function $r(e){return ln(e)||ln(e,!0)}a($r,"resolveCommand");un.exports=$r});var cn=x((Js,Re)=>{"use strict";p();var Fe=/([()\][%!^"`<>&|;, *?])/g;function Qr(e){return e=e.replace(Fe,"^$1"),e}a(Qr,"escapeCommand");function jr(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(Fe,"^$1"),t&&(e=e.replace(Fe,"^$1")),e}a(jr,"escapeArgument");Re.exports.command=Qr;Re.exports.argument=jr});var yn=x((Ys,dn)=>{"use strict";p();dn.exports=/^#!(.*)/});var Sn=x((Ks,mn)=>{"use strict";p();var Jr=yn();mn.exports=(e="")=>{let t=e.match(Jr);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,"").split(" "),o=n.split("/").pop();return o==="env"?r:r?`${o} ${r}`:o}});var fn=x((Zs,gn)=>{"use strict";p();var we=F("fs"),Wr=Sn();function qr(e){let n=Buffer.alloc(150),r;try{r=we.openSync(e,"r"),we.readSync(r,n,0,150,0),we.closeSync(r)}catch{}return Wr(n.toString())}a(qr,"readShebang");gn.exports=qr});var xn=x((ni,En)=>{"use strict";p();var Yr=F("path"),hn=pn(),bn=cn(),zr=fn(),Kr=process.platform==="win32",Xr=/\.(?:com|exe)$/i,Zr=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function ea(e){e.file=hn(e);let t=e.file&&zr(e.file);return t?(e.args.unshift(e.file),e.command=t,hn(e)):e.file}a(ea,"detectShebang");function ta(e){if(!Kr)return e;let t=ea(e),n=!Xr.test(t);if(e.options.forceShell||n){let r=Zr.test(t);e.command=Yr.normalize(e.command),e.command=bn.command(e.command),e.args=e.args.map(s=>bn.argument(s,r));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}a(ta,"parseNonShell");function na(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:ta(r)}a(na,"parse");En.exports=na});var An=x((oi,In)=>{"use strict";p();var Pe=process.platform==="win32";function Oe(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}a(Oe,"notFoundError");function ra(e,t){if(!Pe)return;let n=e.emit;e.emit=function(r,o){if(r==="exit"){let s=Mn(o,t,"spawn");if(s)return n.call(e,"error",s)}return n.apply(e,arguments)}}a(ra,"hookChildProcess");function Mn(e,t){return Pe&&e===1&&!t.file?Oe(t.original,"spawn"):null}a(Mn,"verifyENOENT");function aa(e,t){return Pe&&e===1&&!t.file?Oe(t.original,"spawnSync"):null}a(aa,"verifyENOENTSync");In.exports={hookChildProcess:ra,verifyENOENT:Mn,verifyENOENTSync:aa,notFoundError:Oe}});var Tn=x((li,Q)=>{"use strict";p();var _n=F("child_process"),Ne=xn(),Be=An();function Cn(e,t,n){let r=Ne(e,t,n),o=_n.spawn(r.command,r.args,r.options);return Be.hookChildProcess(o,r),o}a(Cn,"spawn");function oa(e,t,n){let r=Ne(e,t,n),o=_n.spawnSync(r.command,r.args,r.options);return o.error=o.error||Be.verifyENOENTSync(o.status,r),o}a(oa,"spawnSync");Q.exports=Cn;Q.exports.spawn=Cn;Q.exports.sync=oa;Q.exports._parse=Ne;Q.exports._enoent=Be});var Zn=x((zl,Xn)=>{"use strict";p();var{PassThrough:to}=F("stream");Xn.exports=function(){var e=[],t=new to({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(n),t;function n(s){return Array.isArray(s)?(s.forEach(n),this):(e.push(s),s.once("end",o.bind(null,s)),s.once("error",t.emit.bind(t,"error")),s.pipe(t,{end:!1}),this)}a(n,"add");function r(){return e.length==0}a(r,"isEmpty");function o(s){e=e.filter(function(i){return i!==s}),!e.length&&t.readable&&t.end()}a(o,"remove")}});var fr=x(($u,gr)=>{p();function A(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}a(A,"RetryOperation");gr.exports=A;A.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};A.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};A.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0};A.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};A.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};A.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};A.prototype.start=A.prototype.try;A.prototype.errors=function(){return this._errors};A.prototype.attempts=function(){return this._attempts};A.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var o=this._errors[r],s=o.message,i=(e[s]||0)+1;e[s]=i,i>=n&&(t=o,n=i)}return t}});var hr=x(L=>{p();var Co=fr();L.operation=function(e){var t=L.timeouts(e);return new Co(t,{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};L.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],o=0;o<t.retries;o++)r.push(this.createTimeout(o,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(o,t)),r.sort(function(s,i){return s-i}),r};L.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*Math.pow(t.factor,e));return r=Math.min(r,t.maxTimeout),r};L.wrap=function(e,t,n){if(t instanceof Array&&(n=t,t=null),!n){n=[];for(var r in e)typeof e[r]=="function"&&n.push(r)}for(var o=0;o<n.length;o++){var s=n[o],i=e[s];e[s]=a(function(u){var c=L.operation(t),d=Array.prototype.slice.call(arguments,1),y=d.pop();d.push(function(m){c.retry(m)||(m&&(arguments[0]=c.mainError()),y.apply(this,arguments))}),c.attempt(function(){u.apply(e,d)})},"retryWrapper").bind(e,i),e[s].options=t}}});var Er=x((Yu,br)=>{p();br.exports=hr()});p();var q=w(gt(),1);var re=class extends Map{static{a(this,"Changes")}created=D(()=>Array.from(this.entries()).filter(([,t])=>t.type==="create").map(([t])=>t));updated=D(()=>Array.from(this.entries()).filter(([,t])=>t.type==="update").map(([t])=>t));deleted=D(()=>Array.from(this.entries()).filter(([,t])=>t.type==="delete").map(([t])=>t))},Fr=E.greenBright("+"),Rr=E.blueBright("\xB1"),wr=E.redBright("-"),Tt=E.yellowBright("\u2192"),Y=a((e,{changes:t,tense:n,limit:r=1/0,...o})=>{yt.logLevel<=te.TRACE&&(r=1/0);let s=Array.from(t.entries()).filter(([m])=>!m.startsWith(".gadget/"));if(s.length===0)return"";let i=E.yellowBright(n==="past"?"renamed":"rename"),l=E.greenBright(n==="past"?"created":"create"),u=E.blueBright(n==="past"?"updated":"update"),c=E.redBright(n==="past"?"deleted":"delete"),d=s.sort((m,S)=>m[0].localeCompare(S[0])).slice(0,r).map(([m,S])=>{switch(!0){case(S.type==="create"&&st(S.oldPath)):return[Tt,E.yellowBright(S.oldPath),i,Tt,E.yellowBright(m)];case S.type==="create":return[Fr,E.greenBright(m),l];case S.type==="update":return[Rr,E.blueBright(m),u];case S.type==="delete":return[wr,E.redBright(m),c];default:return it(S)}});s.length>r&&d.push([E.gray(N.ellipsis),g`{gray ${s.length-r} more}`,""]);let y;if(s.length>=5){let m=[],S=s.filter(([,b])=>b.type==="create").length;if(S>0){let b=n==="past"?`${S} created`:(0,q.default)("create",S,!0);m.push(g`{greenBright ${b}}`)}let f=s.filter(([,b])=>b.type==="update").length;if(f>0){let b=n==="past"?`${f} updated`:(0,q.default)("update",f,!0);m.push(g`{blueBright ${b}}`)}let h=s.filter(([,b])=>b.type==="delete").length;if(h>0){let b=n==="past"?`${h} deleted`:(0,q.default)("delete",h,!0);m.push(g`{redBright ${b}}`)}y=G`
|
|
2
2
|
${(0,q.default)("change",s.length,!0)} in total. ${m.join(", ")}.
|
|
3
3
|
`}return ft({rows:d,footer:y,ensureEmptyLineAbove:!0,ensureEmptyLineAboveBody:!1,ensureEmptyLineAboveFooter:!0,indent:0,...o})},"sprintChanges"),ae=a((e,t)=>{let n=Y(e,t);n&&O(n)},"printChanges");p();var vt=g(`
|
|
4
4
|
subscription EnvironmentLogs($query: String!, $start: DateTime, $limit: Int) {
|
|
@@ -191,4 +191,4 @@ ${r.message}`:b,T=[M,t,e].filter(Boolean).join(`
|
|
|
191
191
|
|
|
192
192
|
{red Your app will not be operational until all fatal errors are fixed.}
|
|
193
193
|
`})}catch(c){throw Ie(c)?u.clear():u.fail(),c}}};export{re as a,Rr as b,wr as c,rn as d,Jo as e,Wo as f,qo as g,Yo as h,zo as i,Ko as j,B as k,Lt as l,Vt as m,Ms as n,Is as o,Ir as p};
|
|
194
|
-
//# sourceMappingURL=chunk-
|
|
194
|
+
//# sourceMappingURL=chunk-DRI75CDO.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as C,f as b,g as E}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as C,f as b,g as E}from"./chunk-L5H5T2T6.js";import{b as D}from"./chunk-XGQQOMPO.js";import{b as N,f as G}from"./chunk-24OT7GHO.js";import{a as m,d as $,f as P,h as y}from"./chunk-7DYQUG5M.js";var S=$((F,I)=>{y();var _=Symbol("arg flag"),a=class n extends Error{static{m(this,"ArgError")}constructor(e,p){super(e),this.name="ArgError",this.code=p,Object.setPrototypeOf(this,n.prototype)}};function A(n,{argv:e=process.argv.slice(2),permissive:p=!1,stopAtPositional:w=!1}={}){if(!n)throw new a("argument specification object is required","ARG_CONFIG_NO_SPEC");let t={_:[]},s={},c={};for(let r of Object.keys(n)){if(!r)throw new a("argument key cannot be an empty string","ARG_CONFIG_EMPTY_KEY");if(r[0]!=="-")throw new a(`argument key must start with '-' but found: '${r}'`,"ARG_CONFIG_NONOPT_KEY");if(r.length===1)throw new a(`argument key must have a name; singular '-' keys are not allowed: ${r}`,"ARG_CONFIG_NONAME_KEY");if(typeof n[r]=="string"){s[r]=n[r];continue}let l=n[r],i=!1;if(Array.isArray(l)&&l.length===1&&typeof l[0]=="function"){let[u]=l;l=m((f,d,g=[])=>(g.push(u(f,d,g[g.length-1])),g),"type"),i=u===Boolean||u[_]===!0}else if(typeof l=="function")i=l===Boolean||l[_]===!0;else throw new a(`type missing or not a function or valid array type: ${r}`,"ARG_CONFIG_VAD_TYPE");if(r[1]!=="-"&&r.length>2)throw new a(`short argument keys (with a single hyphen) must have only one character: ${r}`,"ARG_CONFIG_SHORTOPT_TOOLONG");c[r]=[l,i]}for(let r=0,l=e.length;r<l;r++){let i=e[r];if(w&&t._.length>0){t._=t._.concat(e.slice(r));break}if(i==="--"){t._=t._.concat(e.slice(r+1));break}if(i.length>1&&i[0]==="-"){let u=i[1]==="-"||i.length===2?[i]:i.slice(1).split("").map(f=>`-${f}`);for(let f=0;f<u.length;f++){let d=u[f],[g,O]=d[1]==="-"?d.split(/=(.*)/,2):[d,void 0],o=g;for(;o in s;)o=s[o];if(!(o in c))if(p){t._.push(d);continue}else throw new a(`unknown or unexpected option: ${g}`,"ARG_UNKNOWN_OPTION");let[h,R]=c[o];if(!R&&f+1<u.length)throw new a(`option requires argument (but was followed by another short argument): ${g}`,"ARG_MISSING_REQUIRED_SHORTARG");if(R)t[o]=h(!0,o,t[o]);else if(O===void 0){if(e.length<r+2||e[r+1].length>1&&e[r+1][0]==="-"&&!(e[r+1].match(/^-?\d*(\.(?=\d))?\d*$/)&&(h===Number||typeof BigInt<"u"&&h===BigInt))){let T=g===o?"":` (alias for ${o})`;throw new a(`option requires argument: ${g}${T}`,"ARG_MISSING_REQUIRED_LONGARG")}t[o]=h(e[r+1],o,t[o]),++r}else t[o]=h(O,o,t[o])}}else t._.push(i)}return t}m(A,"arg");A.flag=n=>(n[_]=!0,n);A.COUNT=A.flag((n,e,p)=>(p||0)+1);A.ArgError=a;I.exports=A});y();var k=P(S(),1);var L=m((n,e)=>{let p={},w={};for(let[t,s]of Object.entries(n)){if(!("type"in s)){p[t]=s;continue}if(p[t]=s.type,w[t]=s.default,s.alias)for(let c of Array.isArray(s.alias)?s.alias:[s.alias])p[c]=t}try{let t=(0,k.default)(p,e);for(let[s,c]of Object.entries(w))G(t[s])&&(t[s]=c);return t}catch(t){throw t instanceof k.default.ArgError&&(t=new x(t.message)),t instanceof b?t:new E(t)}},"parseArgs"),x=class extends b{static{m(this,"ArgError")}isBug=C.NO;render(){return`${N.redBright(D.cross)} `+this.message}};y();import j from"node:assert";var H=["dev","deploy","status","push","pull","add","open","list","login","logout","logs","whoami","configure","version"],K=m(n=>H.includes(n),"isCommand"),J=m(async n=>{j(K(n),`invalid command: ${n}`);let e;switch(n){case"dev":e=await import("./dev-XI2RDRXJ.js");break;case"deploy":e=await import("./deploy-ZRLKAGWM.js");break;case"status":e=await import("./status-6QVAIYUR.js");break;case"push":e=await import("./push-4LGFNWTC.js");break;case"pull":e=await import("./pull-GS2VSBLT.js");break;case"add":e=await import("./add-VP2I3CKE.js");break;case"open":e=await import("./open-65LHZE2M.js");break;case"list":e=await import("./list-3QZTSHQV.js");break;case"login":e=await import("./login-HKGCVIWO.js");break;case"logout":e=await import("./logout-SWWGI27Q.js");break;case"logs":e=await import("./logs-36QPFIDT.js");break;case"whoami":e=await import("./whoami-MIJFO4MW.js");break;case"configure":e=await import("./configure-CXY6JQB7.js");break;case"version":e=await import("./version-NZHW3VLV.js");break}return e},"importCommand");export{S as a,L as b,x as c,H as d,K as e,J as f};
|
|
2
|
+
//# sourceMappingURL=chunk-IZO5RL5L.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Mn,b as Je,c as Dn}from"./chunk-DYAWQS24.js";import{a as Cn,b as Bn,c as Un}from"./chunk-XGQQOMPO.js";import{K as Ye,L as Pn,N as dr,O as le,P as Nn,Q as Ke,U as ae,V as In,W as G,X as Rn,Z as R,a as Tn,b as Me,ba as pr,c as On,ca as De,d as we,e as $,f as kn,g as Bt,h as Qe,ha as ne,i as cr,ia as Ue,j as lr,ja as fe,k as ur,l as fr,n as hr,p as $n,x as Ln,y as An}from"./chunk-24OT7GHO.js";import{a as Rt}from"./chunk-GFQYFEEH.js";import{a as o,b as j,d as B,f as Z,h}from"./chunk-7DYQUG5M.js";var ti=B((mu,gt)=>{"use strict";h();var jt={decodeValues:!0,map:!1,silent:!1};function Tr(e){return typeof e=="string"&&!!e.trim()}o(Tr,"isNonEmptyString");function Or(e,t){var r=e.split(";").filter(Tr),n=r.shift(),i=Yo(n),s=i.name,a=i.value;t=t?Object.assign({},jt,t):jt;try{a=t.decodeValues?decodeURIComponent(a):a}catch(c){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+a+"'. Set options.decodeValues to false to disable this feature.",c)}var l={name:s,value:a};return r.forEach(function(c){var f=c.split("="),d=f.shift().trimLeft().toLowerCase(),p=f.join("=");d==="expires"?l.expires=new Date(p):d==="max-age"?l.maxAge=parseInt(p,10):d==="secure"?l.secure=!0:d==="httponly"?l.httpOnly=!0:d==="samesite"?l.sameSite=p:d==="partitioned"?l.partitioned=!0:l[d]=p}),l}o(Or,"parseString");function Yo(e){var t="",r="",n=e.split("=");return n.length>1?(t=n.shift(),r=n.join("=")):r=e,{name:t,value:r}}o(Yo,"parseNameValuePair");function ei(e,t){if(t=t?Object.assign({},jt,t):jt,!e)return t.map?{}:[];if(e.headers)if(typeof e.headers.getSetCookie=="function")e=e.headers.getSetCookie();else if(e.headers["set-cookie"])e=e.headers["set-cookie"];else{var r=e.headers[Object.keys(e.headers).find(function(i){return i.toLowerCase()==="set-cookie"})];!r&&e.headers.cookie&&!t.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),e=r}if(Array.isArray(e)||(e=[e]),t.map){var n={};return e.filter(Tr).reduce(function(i,s){var a=Or(s,t);return i[a.name]=a,i},n)}else return e.filter(Tr).map(function(i){return Or(i,t)})}o(ei,"parse");function Ko(e){if(Array.isArray(e))return e;if(typeof e!="string")return[];var t=[],r=0,n,i,s,a,l;function c(){for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length}o(c,"skipWhitespace");function f(){return i=e.charAt(r),i!=="="&&i!==";"&&i!==","}for(o(f,"notSpecialChar");r<e.length;){for(n=r,l=!1;c();)if(i=e.charAt(r),i===","){for(s=r,r+=1,c(),a=r;r<e.length&&f();)r+=1;r<e.length&&e.charAt(r)==="="?(l=!0,r=a,t.push(e.substring(n,s)),n=r):r=s+1}else r+=1;(!l||r>=e.length)&&t.push(e.substring(n,e.length))}return t}o(Ko,"splitCookiesString");gt.exports=ei;gt.exports.parse=ei;gt.exports.parseString=Or;gt.exports.splitCookiesString=Ko});var ui=B((kr,$r)=>{h();(function(e,t){typeof kr=="object"&&typeof $r<"u"?$r.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(kr,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",i="second",s="minute",a="hour",l="day",c="week",f="month",d="quarter",p="year",y="date",u="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,T={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:o(function(O){var E=["th","st","nd","rd"],v=O%100;return"["+O+(E[(v-20)%10]||E[v]||E[0])+"]"},"ordinal")},P=o(function(O,E,v){var b=String(O);return!b||b.length>=E?O:""+Array(E+1-b.length).join(v)+O},"m"),D={s:P,z:o(function(O){var E=-O.utcOffset(),v=Math.abs(E),b=Math.floor(v/60),g=v%60;return(E<=0?"+":"-")+P(b,2,"0")+":"+P(g,2,"0")},"z"),m:o(function O(E,v){if(E.date()<v.date())return-O(v,E);var b=12*(v.year()-E.year())+(v.month()-E.month()),g=E.clone().add(b,f),_=v-g<0,x=E.clone().add(b+(_?-1:1),f);return+(-(b+(v-g)/(_?g-x:x-g))||0)},"t"),a:o(function(O){return O<0?Math.ceil(O)||0:Math.floor(O)},"a"),p:o(function(O){return{M:f,y:p,w:c,d:l,D:y,h:a,m:s,s:i,ms:n,Q:d}[O]||String(O||"").toLowerCase().replace(/s$/,"")},"p"),u:o(function(O){return O===void 0},"u")},Q="en",k={};k[Q]=T;var z="$isDayjsObject",Y=o(function(O){return O instanceof te||!(!O||!O[z])},"S"),W=o(function O(E,v,b){var g;if(!E)return Q;if(typeof E=="string"){var _=E.toLowerCase();k[_]&&(g=_),v&&(k[_]=v,g=_);var x=E.split("-");if(!g&&x.length>1)return O(x[0])}else{var S=E.name;k[S]=E,g=S}return!b&&g&&(Q=g),g||!b&&Q},"t"),I=o(function(O,E){if(Y(O))return O.clone();var v=typeof E=="object"?E:{};return v.date=O,v.args=arguments,new te(v)},"O"),L=D;L.l=W,L.i=Y,L.w=function(O,E){return I(O,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var te=function(){function O(v){this.$L=W(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[z]=!0}o(O,"M");var E=O.prototype;return E.parse=function(v){this.$d=function(b){var g=b.date,_=b.utc;if(g===null)return new Date(NaN);if(L.u(g))return new Date;if(g instanceof Date)return new Date(g);if(typeof g=="string"&&!/Z$/i.test(g)){var x=g.match(m);if(x){var S=x[2]-1||0,N=(x[7]||"0").substring(0,3);return _?new Date(Date.UTC(x[1],S,x[3]||1,x[4]||0,x[5]||0,x[6]||0,N)):new Date(x[1],S,x[3]||1,x[4]||0,x[5]||0,x[6]||0,N)}}return new Date(g)}(v),this.init()},E.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},E.$utils=function(){return L},E.isValid=function(){return this.$d.toString()!==u},E.isSame=function(v,b){var g=I(v);return this.startOf(b)<=g&&g<=this.endOf(b)},E.isAfter=function(v,b){return I(v)<this.startOf(b)},E.isBefore=function(v,b){return this.endOf(b)<I(v)},E.$g=function(v,b,g){return L.u(v)?this[b]:this.set(g,v)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(v,b){var g=this,_=!!L.u(b)||b,x=L.p(v),S=o(function(F,re){var _e=L.w(g.$u?Date.UTC(g.$y,re,F):new Date(g.$y,re,F),g);return _?_e:_e.endOf(l)},"l"),N=o(function(F,re){return L.w(g.toDate()[F].apply(g.toDate("s"),(_?[0,0,0,0]:[23,59,59,999]).slice(re)),g)},"$"),C=this.$W,U=this.$M,K=this.$D,me="set"+(this.$u?"UTC":"");switch(x){case p:return _?S(1,0):S(31,11);case f:return _?S(1,U):S(0,U+1);case c:var oe=this.$locale().weekStart||0,V=(C<oe?C+7:C)-oe;return S(_?K-V:K+(6-V),U);case l:case y:return N(me+"Hours",0);case a:return N(me+"Minutes",1);case s:return N(me+"Seconds",2);case i:return N(me+"Milliseconds",3);default:return this.clone()}},E.endOf=function(v){return this.startOf(v,!1)},E.$set=function(v,b){var g,_=L.p(v),x="set"+(this.$u?"UTC":""),S=(g={},g[l]=x+"Date",g[y]=x+"Date",g[f]=x+"Month",g[p]=x+"FullYear",g[a]=x+"Hours",g[s]=x+"Minutes",g[i]=x+"Seconds",g[n]=x+"Milliseconds",g)[_],N=_===l?this.$D+(b-this.$W):b;if(_===f||_===p){var C=this.clone().set(y,1);C.$d[S](N),C.init(),this.$d=C.set(y,Math.min(this.$D,C.daysInMonth())).$d}else S&&this.$d[S](N);return this.init(),this},E.set=function(v,b){return this.clone().$set(v,b)},E.get=function(v){return this[L.p(v)]()},E.add=function(v,b){var g,_=this;v=Number(v);var x=L.p(b),S=o(function(U){var K=I(_);return L.w(K.date(K.date()+Math.round(U*v)),_)},"y");if(x===f)return this.set(f,this.$M+v);if(x===p)return this.set(p,this.$y+v);if(x===l)return S(1);if(x===c)return S(7);var N=(g={},g[s]=t,g[a]=r,g[i]=e,g)[x]||1,C=this.$d.getTime()+v*N;return L.w(C,this)},E.subtract=function(v,b){return this.add(-1*v,b)},E.format=function(v){var b=this,g=this.$locale();if(!this.isValid())return g.invalidDate||u;var _=v||"YYYY-MM-DDTHH:mm:ssZ",x=L.z(this),S=this.$H,N=this.$m,C=this.$M,U=g.weekdays,K=g.months,me=g.meridiem,oe=o(function(re,_e,pt,It){return re&&(re[_e]||re(b,_))||pt[_e].slice(0,It)},"h"),V=o(function(re){return L.s(S%12||12,re,"0")},"d"),F=me||function(re,_e,pt){var It=re<12?"AM":"PM";return pt?It.toLowerCase():It};return _.replace(w,function(re,_e){return _e||function(pt){switch(pt){case"YY":return String(b.$y).slice(-2);case"YYYY":return L.s(b.$y,4,"0");case"M":return C+1;case"MM":return L.s(C+1,2,"0");case"MMM":return oe(g.monthsShort,C,K,3);case"MMMM":return oe(K,C);case"D":return b.$D;case"DD":return L.s(b.$D,2,"0");case"d":return String(b.$W);case"dd":return oe(g.weekdaysMin,b.$W,U,2);case"ddd":return oe(g.weekdaysShort,b.$W,U,3);case"dddd":return U[b.$W];case"H":return String(S);case"HH":return L.s(S,2,"0");case"h":return V(1);case"hh":return V(2);case"a":return F(S,N,!0);case"A":return F(S,N,!1);case"m":return String(N);case"mm":return L.s(N,2,"0");case"s":return String(b.$s);case"ss":return L.s(b.$s,2,"0");case"SSS":return L.s(b.$ms,3,"0");case"Z":return x}return null}(re)||x.replace(":","")})},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(v,b,g){var _,x=this,S=L.p(b),N=I(v),C=(N.utcOffset()-this.utcOffset())*t,U=this-N,K=o(function(){return L.m(x,N)},"D");switch(S){case p:_=K()/12;break;case f:_=K();break;case d:_=K()/3;break;case c:_=(U-C)/6048e5;break;case l:_=(U-C)/864e5;break;case a:_=U/r;break;case s:_=U/t;break;case i:_=U/e;break;default:_=U}return g?_:L.a(_)},E.daysInMonth=function(){return this.endOf(f).$D},E.$locale=function(){return k[this.$L]},E.locale=function(v,b){if(!v)return this.$L;var g=this.clone(),_=W(v,b,!0);return _&&(g.$L=_),g},E.clone=function(){return L.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},O}(),dt=te.prototype;return I.prototype=dt,[["$ms",n],["$s",i],["$m",s],["$H",a],["$W",l],["$M",f],["$y",p],["$D",y]].forEach(function(O){dt[O[1]]=function(E){return this.$g(E,O[0],O[1])}}),I.extend=function(O,E){return O.$i||(O(E,te,I),O.$i=!0),I},I.locale=W,I.isDayjs=Y,I.unix=function(O){return I(1e3*O)},I.en=k[Q],I.Ls=k,I.p={},I})});var Lr=B((Iu,fi)=>{"use strict";h();fi.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}});var pi=B((Bu,di)=>{"use strict";h();var Jo=j("os"),hi=j("tty"),he=Lr(),{env:J}=process,Ae;he("no-color")||he("no-colors")||he("color=false")||he("color=never")?Ae=0:(he("color")||he("colors")||he("color=true")||he("color=always"))&&(Ae=1);"FORCE_COLOR"in J&&(J.FORCE_COLOR==="true"?Ae=1:J.FORCE_COLOR==="false"?Ae=0:Ae=J.FORCE_COLOR.length===0?1:Math.min(parseInt(J.FORCE_COLOR,10),3));function Ar(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}o(Ar,"translateLevel");function Pr(e,t){if(Ae===0)return 0;if(he("color=16m")||he("color=full")||he("color=truecolor"))return 3;if(he("color=256"))return 2;if(e&&!t&&Ae===void 0)return 0;let r=Ae||0;if(J.TERM==="dumb")return r;if(process.platform==="win32"){let n=Jo.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in J)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in J)||J.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in J)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(J.TEAMCITY_VERSION)?1:0;if(J.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in J){let n=parseInt((J.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(J.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(J.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(J.TERM)||"COLORTERM"in J?1:r}o(Pr,"supportsColor");function Xo(e){let t=Pr(e,e&&e.isTTY);return Ar(t)}o(Xo,"getSupportLevel");di.exports={supportsColor:Xo,stdout:Ar(Pr(!0,hi.isatty(1))),stderr:Ar(Pr(!0,hi.isatty(2)))}});var yi=B((Uu,gi)=>{"use strict";h();var Zo=pi(),tt=Lr();function mi(e){if(/^\d{3,4}$/.test(e)){let r=/(\d{1,2})(\d{2})/.exec(e)||[];return{major:0,minor:parseInt(r[1],10),patch:parseInt(r[2],10)}}let t=(e||"").split(".").map(r=>parseInt(r,10));return{major:t[0],minor:t[1],patch:t[2]}}o(mi,"parseVersion");function Nr(e){let{CI:t,FORCE_HYPERLINK:r,NETLIFY:n,TEAMCITY_VERSION:i,TERM_PROGRAM:s,TERM_PROGRAM_VERSION:a,VTE_VERSION:l,TERM:c}=process.env;if(r)return!(r.length>0&&parseInt(r,10)===0);if(tt("no-hyperlink")||tt("no-hyperlinks")||tt("hyperlink=false")||tt("hyperlink=never"))return!1;if(tt("hyperlink=true")||tt("hyperlink=always")||n)return!0;if(!Zo.supportsColor(e)||e&&!e.isTTY)return!1;if("WT_SESSION"in process.env)return!0;if(process.platform==="win32"||t||i)return!1;if(s){let f=mi(a||"");switch(s){case"iTerm.app":return f.major===3?f.minor>=1:f.major>3;case"WezTerm":return f.major>=20200620;case"vscode":return f.major>1||f.major===1&&f.minor>=72;case"ghostty":return!0}}if(l){if(l==="0.50.0")return!1;let f=mi(l);return f.major>0||f.minor>=50}switch(c){case"alacritty":return!0}return!1}o(Nr,"supportsHyperlink");gi.exports={supportsHyperlink:Nr,stdout:Nr(process.stdout),stderr:Nr(process.stderr)}});var Si=B((of,Br)=>{"use strict";h();var na=Object.prototype.hasOwnProperty,se="~";function yt(){}o(yt,"Events");Object.create&&(yt.prototype=Object.create(null),new yt().__proto__||(se=!1));function ia(e,t,r){this.fn=e,this.context=t,this.once=r||!1}o(ia,"EE");function Ei(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var s=new ia(r,n||e,i),a=se?se+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],s]:e._events[a].push(s):(e._events[a]=s,e._eventsCount++),e}o(Ei,"addListener");function Wt(e,t){--e._eventsCount===0?e._events=new yt:delete e._events[t]}o(Wt,"clearEvent");function ee(){this._events=new yt,this._eventsCount=0}o(ee,"EventEmitter");ee.prototype.eventNames=o(function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)na.call(r,n)&&t.push(se?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t},"eventNames");ee.prototype.listeners=o(function(t){var r=se?se+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,a=new Array(s);i<s;i++)a[i]=n[i].fn;return a},"listeners");ee.prototype.listenerCount=o(function(t){var r=se?se+t:t,n=this._events[r];return n?n.fn?1:n.length:0},"listenerCount");ee.prototype.emit=o(function(t,r,n,i,s,a){var l=se?se+t:t;if(!this._events[l])return!1;var c=this._events[l],f=arguments.length,d,p;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),f){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,r),!0;case 3:return c.fn.call(c.context,r,n),!0;case 4:return c.fn.call(c.context,r,n,i),!0;case 5:return c.fn.call(c.context,r,n,i,s),!0;case 6:return c.fn.call(c.context,r,n,i,s,a),!0}for(p=1,d=new Array(f-1);p<f;p++)d[p-1]=arguments[p];c.fn.apply(c.context,d)}else{var y=c.length,u;for(p=0;p<y;p++)switch(c[p].once&&this.removeListener(t,c[p].fn,void 0,!0),f){case 1:c[p].fn.call(c[p].context);break;case 2:c[p].fn.call(c[p].context,r);break;case 3:c[p].fn.call(c[p].context,r,n);break;case 4:c[p].fn.call(c[p].context,r,n,i);break;default:if(!d)for(u=1,d=new Array(f-1);u<f;u++)d[u-1]=arguments[u];c[p].fn.apply(c[p].context,d)}}return!0},"emit");ee.prototype.on=o(function(t,r,n){return Ei(this,t,r,n,!1)},"on");ee.prototype.once=o(function(t,r,n){return Ei(this,t,r,n,!0)},"once");ee.prototype.removeListener=o(function(t,r,n,i){var s=se?se+t:t;if(!this._events[s])return this;if(!r)return Wt(this,s),this;var a=this._events[s];if(a.fn)a.fn===r&&(!i||a.once)&&(!n||a.context===n)&&Wt(this,s);else{for(var l=0,c=[],f=a.length;l<f;l++)(a[l].fn!==r||i&&!a[l].once||n&&a[l].context!==n)&&c.push(a[l]);c.length?this._events[s]=c.length===1?c[0]:c:Wt(this,s)}return this},"removeListener");ee.prototype.removeAllListeners=o(function(t){var r;return t?(r=se?se+t:t,this._events[r]&&Wt(this,r)):(this._events=new yt,this._eventsCount=0),this},"removeAllListeners");ee.prototype.off=ee.prototype.removeListener;ee.prototype.addListener=ee.prototype.on;ee.prefixed=se;ee.EventEmitter=ee;typeof Br<"u"&&(Br.exports=ee)});var Li=B((Cf,$i)=>{"use strict";h();var{Duplex:sa}=j("stream");function Ci(e){e.emit("close")}o(Ci,"emitClose");function oa(){!this.destroyed&&this._writableState.finished&&this.destroy()}o(oa,"duplexOnEnd");function ki(e){this.removeListener("error",ki),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}o(ki,"duplexOnError");function aa(e,t){let r=!0,n=new sa({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",o(function(s,a){let l=!a&&n._readableState.objectMode?s.toString():s;n.push(l)||e.pause()},"message")),e.once("error",o(function(s){n.destroyed||(r=!1,n.destroy(s))},"error")),e.once("close",o(function(){n.destroyed||n.push(null)},"close")),n._destroy=function(i,s){if(e.readyState===e.CLOSED){s(i),process.nextTick(Ci,n);return}let a=!1;e.once("error",o(function(c){a=!0,s(c)},"error")),e.once("close",o(function(){a||s(i),process.nextTick(Ci,n)},"close")),r&&e.terminate()},n._final=function(i){if(e.readyState===e.CONNECTING){e.once("open",o(function(){n._final(i)},"open"));return}e._socket!==null&&(e._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(e._socket.once("finish",o(function(){i()},"finish")),e.close()))},n._read=function(){e.isPaused&&e.resume()},n._write=function(i,s,a){if(e.readyState===e.CONNECTING){e.once("open",o(function(){n._write(i,s,a)},"open"));return}e.send(i,a)},n.on("end",oa),n.on("error",ki),n}o(aa,"createWebSocketStream");$i.exports=aa});var Se=B((Lf,Ni)=>{"use strict";h();var Ai=["nodebuffer","arraybuffer","fragments"],Pi=typeof Blob<"u";Pi&&Ai.push("blob");Ni.exports={BINARY_TYPES:Ai,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Pi,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:o(()=>{},"NOOP")}});var vt=B((Nf,zt)=>{"use strict";h();var{EMPTY_BUFFER:ca}=Se(),jr=Buffer[Symbol.species];function la(e,t){if(e.length===0)return ca;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),n=0;for(let i=0;i<e.length;i++){let s=e[i];r.set(s,n),n+=s.length}return n<t?new jr(r.buffer,r.byteOffset,n):r}o(la,"concat");function Ii(e,t,r,n,i){for(let s=0;s<i;s++)r[n+s]=e[s]^t[s&3]}o(Ii,"_mask");function Ri(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}o(Ri,"_unmask");function ua(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}o(ua,"toArrayBuffer");function Gr(e){if(Gr.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new jr(e):ArrayBuffer.isView(e)?t=new jr(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Gr.readOnly=!1),t}o(Gr,"toBuffer");zt.exports={concat:la,mask:Ii,toArrayBuffer:ua,toBuffer:Gr,unmask:Ri};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=j("bufferutil");zt.exports.mask=function(t,r,n,i,s){s<48?Ii(t,r,n,i,s):e.mask(t,r,n,i,s)},zt.exports.unmask=function(t,r){t.length<32?Ri(t,r):e.unmask(t,r)}}catch{}});var Di=B((Bf,Mi)=>{"use strict";h();var Bi=Symbol("kDone"),qr=Symbol("kRun"),Wr=class{static{o(this,"Limiter")}constructor(t){this[Bi]=()=>{this.pending--,this[qr]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[qr]()}[qr](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[Bi])}}};Mi.exports=Wr});var St=B((Uf,Gi)=>{"use strict";h();var wt=j("zlib"),Ui=vt(),fa=Di(),{kStatusCode:Fi}=Se(),ha=Buffer[Symbol.species],da=Buffer.from([0,0,255,255]),Qt=Symbol("permessage-deflate"),Te=Symbol("total-length"),Et=Symbol("callback"),Pe=Symbol("buffers"),Ht=Symbol("error"),Vt,zr=class{static{o(this,"PerMessageDeflate")}constructor(t,r,n){if(this._maxPayload=n|0,this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!Vt){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Vt=new fa(i)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Et];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,n=t.find(i=>!(r.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>i.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!i.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(t){let r=t[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(t){return t.forEach(r=>{Object.keys(r).forEach(n=>{let i=r[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);r[n]=i})}),t}decompress(t,r,n){Vt.add(i=>{this._decompress(t,r,(s,a)=>{i(),n(s,a)})})}compress(t,r,n){Vt.add(i=>{this._compress(t,r,(s,a)=>{i(),n(s,a)})})}_decompress(t,r,n){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,a=typeof this.params[s]!="number"?wt.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=wt.createInflateRaw({...this._options.zlibInflateOptions,windowBits:a}),this._inflate[Qt]=this,this._inflate[Te]=0,this._inflate[Pe]=[],this._inflate.on("error",ma),this._inflate.on("data",ji)}this._inflate[Et]=n,this._inflate.write(t),r&&this._inflate.write(da),this._inflate.flush(()=>{let s=this._inflate[Ht];if(s){this._inflate.close(),this._inflate=null,n(s);return}let a=Ui.concat(this._inflate[Pe],this._inflate[Te]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Te]=0,this._inflate[Pe]=[],r&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,a)})}_compress(t,r,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,a=typeof this.params[s]!="number"?wt.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=wt.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:a}),this._deflate[Te]=0,this._deflate[Pe]=[],this._deflate.on("data",pa)}this._deflate[Et]=n,this._deflate.write(t),this._deflate.flush(wt.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=Ui.concat(this._deflate[Pe],this._deflate[Te]);r&&(s=new ha(s.buffer,s.byteOffset,s.length-4)),this._deflate[Et]=null,this._deflate[Te]=0,this._deflate[Pe]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};Gi.exports=zr;function pa(e){this[Pe].push(e),this[Te]+=e.length}o(pa,"deflateOnData");function ji(e){if(this[Te]+=e.length,this[Qt]._maxPayload<1||this[Te]<=this[Qt]._maxPayload){this[Pe].push(e);return}this[Ht]=new RangeError("Max payload size exceeded"),this[Ht].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Ht][Fi]=1009,this.removeListener("data",ji),this.reset()}o(ji,"inflateOnData");function ma(e){this[Qt]._inflate=null,e[Fi]=1007,this[Et](e)}o(ma,"inflateOnError")});var it=B((Gf,Yt)=>{"use strict";h();var{isUtf8:qi}=j("buffer"),{hasBlob:ga}=Se(),ya=[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 ba(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}o(ba,"isValidStatusCode");function Vr(e){let t=e.length,r=0;for(;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!1;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!1;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!1;r+=4}else return!1;return!0}o(Vr,"_isValidUTF8");function _a(e){return ga&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}o(_a,"isBlob");Yt.exports={isBlob:_a,isValidStatusCode:ba,isValidUTF8:Vr,tokenChars:ya};if(qi)Yt.exports.isValidUTF8=function(e){return e.length<24?Vr(e):qi(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=j("utf-8-validate");Yt.exports.isValidUTF8=function(t){return t.length<32?Vr(t):e(t)}}catch{}});var Jr=B((zf,Ki)=>{"use strict";h();var{Writable:xa}=j("stream"),Wi=St(),{BINARY_TYPES:va,EMPTY_BUFFER:zi,kStatusCode:wa,kWebSocket:Ea}=Se(),{concat:Hr,toArrayBuffer:Sa,unmask:Ta}=vt(),{isValidStatusCode:Oa,isValidUTF8:Vi}=it(),Kt=Buffer[Symbol.species],de=0,Hi=1,Qi=2,Yi=3,Qr=4,Yr=5,Jt=6,Kr=class extends xa{static{o(this,"Receiver")}constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||va[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[Ea]=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=de}_write(t,r,n){if(this._opcode===8&&this._state==de)return n();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(n)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new Kt(n.buffer,n.byteOffset+t,n.length-t),new Kt(n.buffer,n.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let n=this._buffers[0],i=r.length-t;t>=n.length?r.set(this._buffers.shift(),i):(r.set(new Uint8Array(n.buffer,n.byteOffset,t),i),this._buffers[0]=new Kt(n.buffer,n.byteOffset+t,n.length-t)),t-=n.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case de:this.getInfo(t);break;case Hi:this.getPayloadLength16(t);break;case Qi:this.getPayloadLength64(t);break;case Yi:this.getMask();break;case Qr:this.getData(t);break;case Yr:case Jt:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(i);return}let n=(r[0]&64)===64;if(n&&!this._extensions[Wi.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(i);return}this._payloadLength===126?this._state=Hi:this._payloadLength===127?this._state=Qi:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){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 i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(i);return}this._payloadLength=n*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){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");t(r);return}this._masked?this._state=Yi:this._state=Qr}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Qr}getData(t){let r=zi;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&&Ta(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=Yr,this.decompress(r,t);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}decompress(t,r){this._extensions[Wi.extensionName].decompress(t,this._fin,(i,s)=>{if(i)return r(i);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===de&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=de;return}let r=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=Hr(n,r):this._binaryType==="arraybuffer"?i=Sa(Hr(n,r)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=de):(this._state=Jt,setImmediate(()=>{this.emit("message",i,!0),this._state=de,this.startLoop(t)}))}else{let i=Hr(n,r);if(!this._skipUTF8Validation&&!Vi(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._state===Yr||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=de):(this._state=Jt,setImmediate(()=>{this.emit("message",i,!1),this._state=de,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,zi),this.end();else{let n=t.readUInt16BE(0);if(!Oa(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(s);return}let i=new Kt(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!Vi(i)){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,i),this.end()}this._state=de;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=de):(this._state=Jt,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=de,this.startLoop(r)}))}createError(t,r,n,i,s){this._loop=!1,this._errored=!0;let a=new t(n?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(a,this.createError),a.code=s,a[wa]=i,a}};Ki.exports=Kr});var en=B((Yf,Zi)=>{"use strict";h();var{Duplex:Qf}=j("stream"),{randomFillSync:Ca}=j("crypto"),Ji=St(),{EMPTY_BUFFER:ka,kWebSocket:$a,NOOP:La}=Se(),{isBlob:st,isValidStatusCode:Aa}=it(),{mask:Xi,toBuffer:Ge}=vt(),pe=Symbol("kByteLength"),Pa=Buffer.alloc(4),Xt=8*1024,qe,ot=Xt,be=0,Na=1,Ia=2,Xr=class e{static{o(this,"Sender")}constructor(t,r,n){this._extensions=r||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=be,this.onerror=La,this[$a]=void 0}static frame(t,r){let n,i=!1,s=2,a=!1;r.mask&&(n=r.maskBuffer||Pa,r.generateMask?r.generateMask(n):(ot===Xt&&(qe===void 0&&(qe=Buffer.alloc(Xt)),Ca(qe,0,Xt),ot=0),n[0]=qe[ot++],n[1]=qe[ot++],n[2]=qe[ot++],n[3]=qe[ot++]),a=(n[0]|n[1]|n[2]|n[3])===0,s=6);let l;typeof t=="string"?(!r.mask||a)&&r[pe]!==void 0?l=r[pe]:(t=Buffer.from(t),l=t.length):(l=t.length,i=r.mask&&r.readOnly&&!a);let c=l;l>=65536?(s+=8,c=127):l>125&&(s+=2,c=126);let f=Buffer.allocUnsafe(i?l+s:s);return f[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(f[0]|=64),f[1]=c,c===126?f.writeUInt16BE(l,2):c===127&&(f[2]=f[3]=0,f.writeUIntBE(l,4,6)),r.mask?(f[1]|=128,f[s-4]=n[0],f[s-3]=n[1],f[s-2]=n[2],f[s-1]=n[3],a?[f,t]:i?(Xi(t,n,f,s,l),[f]):(Xi(t,n,t,0,l),[f,t])):[f,t]}close(t,r,n,i){let s;if(t===void 0)s=ka;else{if(typeof t!="number"||!Aa(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(t,0);else{let l=Buffer.byteLength(r);if(l>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+l),s.writeUInt16BE(t,0),typeof r=="string"?s.write(r,2):s.set(r,2)}}let a={[pe]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==be?this.enqueue([this.dispatch,s,!1,a,i]):this.sendFrame(e.frame(s,a),i)}ping(t,r,n){let i,s;if(typeof t=="string"?(i=Buffer.byteLength(t),s=!1):st(t)?(i=t.size,s=!1):(t=Ge(t),i=t.length,s=Ge.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let a={[pe]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};st(t)?this._state!==be?this.enqueue([this.getBlobData,t,!1,a,n]):this.getBlobData(t,!1,a,n):this._state!==be?this.enqueue([this.dispatch,t,!1,a,n]):this.sendFrame(e.frame(t,a),n)}pong(t,r,n){let i,s;if(typeof t=="string"?(i=Buffer.byteLength(t),s=!1):st(t)?(i=t.size,s=!1):(t=Ge(t),i=t.length,s=Ge.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let a={[pe]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};st(t)?this._state!==be?this.enqueue([this.getBlobData,t,!1,a,n]):this.getBlobData(t,!1,a,n):this._state!==be?this.enqueue([this.dispatch,t,!1,a,n]):this.sendFrame(e.frame(t,a),n)}send(t,r,n){let i=this._extensions[Ji.extensionName],s=r.binary?2:1,a=r.compress,l,c;typeof t=="string"?(l=Buffer.byteLength(t),c=!1):st(t)?(l=t.size,c=!1):(t=Ge(t),l=t.length,c=Ge.readOnly),this._firstFragment?(this._firstFragment=!1,a&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(a=l>=i._threshold),this._compress=a):(a=!1,s=0),r.fin&&(this._firstFragment=!0);let f={[pe]:l,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:a};st(t)?this._state!==be?this.enqueue([this.getBlobData,t,this._compress,f,n]):this.getBlobData(t,this._compress,f,n):this._state!==be?this.enqueue([this.dispatch,t,this._compress,f,n]):this.dispatch(t,this._compress,f,n)}getBlobData(t,r,n,i){this._bufferedBytes+=n[pe],this._state=Ia,t.arrayBuffer().then(s=>{if(this._socket.destroyed){let l=new Error("The socket was closed while the blob was being read");process.nextTick(Zr,this,l,i);return}this._bufferedBytes-=n[pe];let a=Ge(s);r?this.dispatch(a,r,n,i):(this._state=be,this.sendFrame(e.frame(a,n),i),this.dequeue())}).catch(s=>{process.nextTick(Ra,this,s,i)})}dispatch(t,r,n,i){if(!r){this.sendFrame(e.frame(t,n),i);return}let s=this._extensions[Ji.extensionName];this._bufferedBytes+=n[pe],this._state=Na,s.compress(t,n.fin,(a,l)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Zr(this,c,i);return}this._bufferedBytes-=n[pe],this._state=be,n.readOnly=!1,this.sendFrame(e.frame(l,n),i),this.dequeue()})}dequeue(){for(;this._state===be&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][pe],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][pe],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};Zi.exports=Xr;function Zr(e,t,r){typeof r=="function"&&r(t);for(let n=0;n<e._queue.length;n++){let i=e._queue[n],s=i[i.length-1];typeof s=="function"&&s(t)}}o(Zr,"callCallbacks");function Ra(e,t,r){Zr(e,t,r),e.onerror(t)}o(Ra,"onError")});var cs=B((Xf,as)=>{"use strict";h();var{kForOnEventAttribute:Tt,kListener:tn}=Se(),es=Symbol("kCode"),ts=Symbol("kData"),rs=Symbol("kError"),ns=Symbol("kMessage"),is=Symbol("kReason"),at=Symbol("kTarget"),ss=Symbol("kType"),os=Symbol("kWasClean"),Oe=class{static{o(this,"Event")}constructor(t){this[at]=null,this[ss]=t}get target(){return this[at]}get type(){return this[ss]}};Object.defineProperty(Oe.prototype,"target",{enumerable:!0});Object.defineProperty(Oe.prototype,"type",{enumerable:!0});var We=class extends Oe{static{o(this,"CloseEvent")}constructor(t,r={}){super(t),this[es]=r.code===void 0?0:r.code,this[is]=r.reason===void 0?"":r.reason,this[os]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[es]}get reason(){return this[is]}get wasClean(){return this[os]}};Object.defineProperty(We.prototype,"code",{enumerable:!0});Object.defineProperty(We.prototype,"reason",{enumerable:!0});Object.defineProperty(We.prototype,"wasClean",{enumerable:!0});var ct=class extends Oe{static{o(this,"ErrorEvent")}constructor(t,r={}){super(t),this[rs]=r.error===void 0?null:r.error,this[ns]=r.message===void 0?"":r.message}get error(){return this[rs]}get message(){return this[ns]}};Object.defineProperty(ct.prototype,"error",{enumerable:!0});Object.defineProperty(ct.prototype,"message",{enumerable:!0});var Ot=class extends Oe{static{o(this,"MessageEvent")}constructor(t,r={}){super(t),this[ts]=r.data===void 0?null:r.data}get data(){return this[ts]}};Object.defineProperty(Ot.prototype,"data",{enumerable:!0});var Ba={addEventListener(e,t,r={}){for(let i of this.listeners(e))if(!r[Tt]&&i[tn]===t&&!i[Tt])return;let n;if(e==="message")n=o(function(s,a){let l=new Ot("message",{data:a?s:s.toString()});l[at]=this,Zt(t,this,l)},"onMessage");else if(e==="close")n=o(function(s,a){let l=new We("close",{code:s,reason:a.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});l[at]=this,Zt(t,this,l)},"onClose");else if(e==="error")n=o(function(s){let a=new ct("error",{error:s,message:s.message});a[at]=this,Zt(t,this,a)},"onError");else if(e==="open")n=o(function(){let s=new Oe("open");s[at]=this,Zt(t,this,s)},"onOpen");else return;n[Tt]=!!r[Tt],n[tn]=t,r.once?this.once(e,n):this.on(e,n)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[tn]===t&&!r[Tt]){this.removeListener(e,r);break}}};as.exports={CloseEvent:We,ErrorEvent:ct,Event:Oe,EventTarget:Ba,MessageEvent:Ot};function Zt(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}o(Zt,"callListener")});var rn=B((th,ls)=>{"use strict";h();var{tokenChars:Ct}=it();function xe(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}o(xe,"push");function Ma(e){let t=Object.create(null),r=Object.create(null),n=!1,i=!1,s=!1,a,l,c=-1,f=-1,d=-1,p=0;for(;p<e.length;p++)if(f=e.charCodeAt(p),a===void 0)if(d===-1&&Ct[f]===1)c===-1&&(c=p);else if(p!==0&&(f===32||f===9))d===-1&&c!==-1&&(d=p);else if(f===59||f===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p);let u=e.slice(c,d);f===44?(xe(t,u,r),r=Object.create(null)):a=u,c=d=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(l===void 0)if(d===-1&&Ct[f]===1)c===-1&&(c=p);else if(f===32||f===9)d===-1&&c!==-1&&(d=p);else if(f===59||f===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p),xe(r,e.slice(c,d),!0),f===44&&(xe(t,a,r),r=Object.create(null),a=void 0),c=d=-1}else if(f===61&&c!==-1&&d===-1)l=e.slice(c,p),c=d=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(i){if(Ct[f]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);c===-1?c=p:n||(n=!0),i=!1}else if(s)if(Ct[f]===1)c===-1&&(c=p);else if(f===34&&c!==-1)s=!1,d=p;else if(f===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(f===34&&e.charCodeAt(p-1)===61)s=!0;else if(d===-1&&Ct[f]===1)c===-1&&(c=p);else if(c!==-1&&(f===32||f===9))d===-1&&(d=p);else if(f===59||f===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p);let u=e.slice(c,d);n&&(u=u.replace(/\\/g,""),n=!1),xe(r,l,u),f===44&&(xe(t,a,r),r=Object.create(null),a=void 0),l=void 0,c=d=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(c===-1||s||f===32||f===9)throw new SyntaxError("Unexpected end of input");d===-1&&(d=p);let y=e.slice(c,d);return a===void 0?xe(t,y,r):(l===void 0?xe(r,y,!0):n?xe(r,l,y.replace(/\\/g,"")):xe(r,l,y),xe(t,a,r)),t}o(Ma,"parse");function Da(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(n=>[t].concat(Object.keys(n).map(i=>{let s=n[i];return Array.isArray(s)||(s=[s]),s.map(a=>a===!0?i:`${i}=${a}`).join("; ")})).join("; ")).join(", ")}).join(", ")}o(Da,"format");ls.exports={format:Da,parse:Ma}});var cn=B((oh,vs)=>{"use strict";h();var Ua=j("events"),Fa=j("https"),ja=j("http"),hs=j("net"),Ga=j("tls"),{randomBytes:qa,createHash:Wa}=j("crypto"),{Duplex:ih,Readable:sh}=j("stream"),{URL:nn}=j("url"),Ne=St(),za=Jr(),Va=en(),{isBlob:Ha}=it(),{BINARY_TYPES:us,EMPTY_BUFFER:er,GUID:Qa,kForOnEventAttribute:sn,kListener:Ya,kStatusCode:Ka,kWebSocket:X,NOOP:ds}=Se(),{EventTarget:{addEventListener:Ja,removeEventListener:Xa}}=cs(),{format:Za,parse:ec}=rn(),{toBuffer:tc}=vt(),rc=30*1e3,ps=Symbol("kAborted"),on=[8,13],Ce=["CONNECTING","OPEN","CLOSING","CLOSED"],nc=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,q=class e extends Ua{static{o(this,"WebSocket")}constructor(t,r,n){super(),this._binaryType=us[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=er,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==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]),ms(this,t,r,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){us.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}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(t,r,n){let i=new za({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new Va(t,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=t,i[X]=this,s[X]=this,t[X]=this,i.on("conclude",oc),i.on("drain",ac),i.on("error",cc),i.on("message",lc),i.on("ping",uc),i.on("pong",fc),s.onerror=hc,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",bs),t.on("data",rr),t.on("end",_s),t.on("error",xs),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Ne.extensionName]&&this._extensions[Ne.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){ue(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),ys(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){an(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||er,r,n)}pong(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){an(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||er,r,n)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(n=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){an(this,t,n);return}let i={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[Ne.extensionName]||(i.compress=!1),this._sender.send(t||er,i,n)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){ue(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(q,"CONNECTING",{enumerable:!0,value:Ce.indexOf("CONNECTING")});Object.defineProperty(q.prototype,"CONNECTING",{enumerable:!0,value:Ce.indexOf("CONNECTING")});Object.defineProperty(q,"OPEN",{enumerable:!0,value:Ce.indexOf("OPEN")});Object.defineProperty(q.prototype,"OPEN",{enumerable:!0,value:Ce.indexOf("OPEN")});Object.defineProperty(q,"CLOSING",{enumerable:!0,value:Ce.indexOf("CLOSING")});Object.defineProperty(q.prototype,"CLOSING",{enumerable:!0,value:Ce.indexOf("CLOSING")});Object.defineProperty(q,"CLOSED",{enumerable:!0,value:Ce.indexOf("CLOSED")});Object.defineProperty(q.prototype,"CLOSED",{enumerable:!0,value:Ce.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(q.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(q.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[sn])return t[Ya];return null},set(t){for(let r of this.listeners(e))if(r[sn]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[sn]:!0})}})});q.prototype.addEventListener=Ja;q.prototype.removeEventListener=Xa;vs.exports=q;function ms(e,t,r,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:on[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(e._autoPong=i.autoPong,!on.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${on.join(", ")})`);let s;if(t instanceof nn)s=t;else try{s=new nn(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),e._url=s.href;let a=s.protocol==="wss:",l=s.protocol==="ws+unix:",c;if(s.protocol!=="ws:"&&!a&&!l?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"`:l&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let w=new SyntaxError(c);if(e._redirects===0)throw w;tr(e,w);return}let f=a?443:80,d=qa(16).toString("base64"),p=a?Fa.request:ja.request,y=new Set,u;if(i.createConnection=i.createConnection||(a?sc:ic),i.defaultPort=i.defaultPort||f,i.port=s.port||f,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":d,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(u=new Ne(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=Za({[Ne.extensionName]:u.offer()})),r.length){for(let w of r){if(typeof w!="string"||!nc.test(w)||y.has(w))throw new SyntaxError("An invalid or duplicated subprotocol was specified");y.add(w)}i.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(s.username||s.password)&&(i.auth=`${s.username}:${s.password}`),l){let w=i.path.split(":");i.socketPath=w[0],i.path=w[1]}let m;if(i.followRedirects){if(e._redirects===0){e._originalIpc=l,e._originalSecure=a,e._originalHostOrSocketPath=l?i.socketPath:s.host;let w=n&&n.headers;if(n={...n,headers:{}},w)for(let[T,P]of Object.entries(w))n.headers[T.toLowerCase()]=P}else if(e.listenerCount("redirect")===0){let w=l?e._originalIpc?i.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:s.host===e._originalHostOrSocketPath;(!w||e._originalSecure&&!a)&&(delete i.headers.authorization,delete i.headers.cookie,w||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),m=e._req=p(i),e._redirects&&e.emit("redirect",e.url,m)}else m=e._req=p(i);i.timeout&&m.on("timeout",()=>{ue(e,m,"Opening handshake has timed out")}),m.on("error",w=>{m===null||m[ps]||(m=e._req=null,tr(e,w))}),m.on("response",w=>{let T=w.headers.location,P=w.statusCode;if(T&&i.followRedirects&&P>=300&&P<400){if(++e._redirects>i.maxRedirects){ue(e,m,"Maximum redirects exceeded");return}m.abort();let D;try{D=new nn(T,t)}catch{let k=new SyntaxError(`Invalid URL: ${T}`);tr(e,k);return}ms(e,D,r,n)}else e.emit("unexpected-response",m,w)||ue(e,m,`Unexpected server response: ${w.statusCode}`)}),m.on("upgrade",(w,T,P)=>{if(e.emit("upgrade",w),e.readyState!==q.CONNECTING)return;m=e._req=null;let D=w.headers.upgrade;if(D===void 0||D.toLowerCase()!=="websocket"){ue(e,T,"Invalid Upgrade header");return}let Q=Wa("sha1").update(d+Qa).digest("base64");if(w.headers["sec-websocket-accept"]!==Q){ue(e,T,"Invalid Sec-WebSocket-Accept header");return}let k=w.headers["sec-websocket-protocol"],z;if(k!==void 0?y.size?y.has(k)||(z="Server sent an invalid subprotocol"):z="Server sent a subprotocol but none was requested":y.size&&(z="Server sent no subprotocol"),z){ue(e,T,z);return}k&&(e._protocol=k);let Y=w.headers["sec-websocket-extensions"];if(Y!==void 0){if(!u){ue(e,T,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let W;try{W=ec(Y)}catch{ue(e,T,"Invalid Sec-WebSocket-Extensions header");return}let I=Object.keys(W);if(I.length!==1||I[0]!==Ne.extensionName){ue(e,T,"Server indicated an extension that was not requested");return}try{u.accept(W[Ne.extensionName])}catch{ue(e,T,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[Ne.extensionName]=u}e.setSocket(T,P,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(m,e):m.end()}o(ms,"initAsClient");function tr(e,t){e._readyState=q.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}o(tr,"emitErrorAndClose");function ic(e){return e.path=e.socketPath,hs.connect(e)}o(ic,"netConnect");function sc(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=hs.isIP(e.host)?"":e.host),Ga.connect(e)}o(sc,"tlsConnect");function ue(e,t,r){e._readyState=q.CLOSING;let n=new Error(r);Error.captureStackTrace(n,ue),t.setHeader?(t[ps]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(tr,e,n)):(t.destroy(n),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}o(ue,"abortHandshake");function an(e,t,r){if(t){let n=Ha(t)?t.size:tc(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${e.readyState} (${Ce[e.readyState]})`);process.nextTick(r,n)}}o(an,"sendAfterClose");function oc(e,t){let r=this[X];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[X]!==void 0&&(r._socket.removeListener("data",rr),process.nextTick(gs,r._socket),e===1005?r.close():r.close(e,t))}o(oc,"receiverOnConclude");function ac(){let e=this[X];e.isPaused||e._socket.resume()}o(ac,"receiverOnDrain");function cc(e){let t=this[X];t._socket[X]!==void 0&&(t._socket.removeListener("data",rr),process.nextTick(gs,t._socket),t.close(e[Ka])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}o(cc,"receiverOnError");function fs(){this[X].emitClose()}o(fs,"receiverOnFinish");function lc(e,t){this[X].emit("message",e,t)}o(lc,"receiverOnMessage");function uc(e){let t=this[X];t._autoPong&&t.pong(e,!this._isServer,ds),t.emit("ping",e)}o(uc,"receiverOnPing");function fc(e){this[X].emit("pong",e)}o(fc,"receiverOnPong");function gs(e){e.resume()}o(gs,"resume");function hc(e){let t=this[X];t.readyState!==q.CLOSED&&(t.readyState===q.OPEN&&(t._readyState=q.CLOSING,ys(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}o(hc,"senderOnError");function ys(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),rc)}o(ys,"setCloseTimer");function bs(){let e=this[X];this.removeListener("close",bs),this.removeListener("data",rr),this.removeListener("end",_s),e._readyState=q.CLOSING;let t;!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&(t=e._socket.read())!==null&&e._receiver.write(t),e._receiver.end(),this[X]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",fs),e._receiver.on("finish",fs))}o(bs,"socketOnClose");function rr(e){this[X]._receiver.write(e)||this.pause()}o(rr,"socketOnData");function _s(){let e=this[X];e._readyState=q.CLOSING,e._receiver.end(),this.end()}o(_s,"socketOnEnd");function xs(){let e=this[X];this.removeListener("error",xs),this.on("error",ds),e&&(e._readyState=q.CLOSING,this.destroy())}o(xs,"socketOnError")});var Es=B((lh,ws)=>{"use strict";h();var{tokenChars:dc}=it();function pc(e){let t=new Set,r=-1,n=-1,i=0;for(i;i<e.length;i++){let a=e.charCodeAt(i);if(n===-1&&dc[a]===1)r===-1&&(r=i);else if(i!==0&&(a===32||a===9))n===-1&&r!==-1&&(n=i);else if(a===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let l=e.slice(r,n);if(t.has(l))throw new SyntaxError(`The "${l}" subprotocol is duplicated`);t.add(l),r=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(r===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=e.slice(r,i);if(t.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return t.add(s),t}o(pc,"parse");ws.exports={parse:pc}});var Ls=B((dh,$s)=>{"use strict";h();var mc=j("events"),nr=j("http"),{Duplex:hh}=j("stream"),{createHash:gc}=j("crypto"),Ss=rn(),ze=St(),yc=Es(),bc=cn(),{GUID:_c,kWebSocket:xc}=Se(),vc=/^[+/0-9A-Za-z]{22}==$/,Ts=0,Os=1,ks=2,ln=class extends mc{static{o(this,"WebSocketServer")}constructor(t,r){if(super(),t={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:bc,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=nr.createServer((n,i)=>{let s=nr.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=wc(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:o((i,s,a)=>{this.handleUpgrade(i,s,a,n)},"upgrade")})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=Ts}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===ks){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(kt,this);return}if(t&&this.once("close",t),this._state!==Os)if(this._state=Os,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(kt,this):process.nextTick(kt,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{kt(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,n,i){r.on("error",Cs);let s=t.headers["sec-websocket-key"],a=t.headers.upgrade,l=+t.headers["sec-websocket-version"];if(t.method!=="GET"){Ve(this,t,r,405,"Invalid HTTP method");return}if(a===void 0||a.toLowerCase()!=="websocket"){Ve(this,t,r,400,"Invalid Upgrade header");return}if(s===void 0||!vc.test(s)){Ve(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(l!==8&&l!==13){Ve(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(t)){$t(r,400);return}let c=t.headers["sec-websocket-protocol"],f=new Set;if(c!==void 0)try{f=yc.parse(c)}catch{Ve(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let d=t.headers["sec-websocket-extensions"],p={};if(this.options.perMessageDeflate&&d!==void 0){let y=new ze(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let u=Ss.parse(d);u[ze.extensionName]&&(y.accept(u[ze.extensionName]),p[ze.extensionName]=y)}catch{Ve(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let y={origin:t.headers[`${l===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(y,(u,m,w,T)=>{if(!u)return $t(r,m||401,w,T);this.completeUpgrade(p,s,f,t,r,n,i)});return}if(!this.options.verifyClient(y))return $t(r,401)}this.completeUpgrade(p,s,f,t,r,n,i)}completeUpgrade(t,r,n,i,s,a,l){if(!s.readable||!s.writable)return s.destroy();if(s[xc])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Ts)return $t(s,503);let f=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${gc("sha1").update(r+_c).digest("base64")}`],d=new this.options.WebSocket(null,void 0,this.options);if(n.size){let p=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;p&&(f.push(`Sec-WebSocket-Protocol: ${p}`),d._protocol=p)}if(t[ze.extensionName]){let p=t[ze.extensionName].params,y=Ss.format({[ze.extensionName]:[p]});f.push(`Sec-WebSocket-Extensions: ${y}`),d._extensions=t}this.emit("headers",f,i),s.write(f.concat(`\r
|
|
1
|
+
import{a as Mn,b as Je,c as Dn}from"./chunk-X47UA3VR.js";import{a as Cn,b as Bn,c as Un}from"./chunk-XGQQOMPO.js";import{K as Ye,L as Pn,N as dr,O as le,P as Nn,Q as Ke,U as ae,V as In,W as G,X as Rn,Z as R,a as Tn,b as Me,ba as pr,c as On,ca as De,d as we,e as $,f as kn,g as Bt,h as Qe,ha as ne,i as cr,ia as Ue,j as lr,ja as fe,k as ur,l as fr,n as hr,p as $n,x as Ln,y as An}from"./chunk-24OT7GHO.js";import{a as Rt}from"./chunk-GFQYFEEH.js";import{a as o,b as j,d as B,f as Z,h}from"./chunk-7DYQUG5M.js";var ti=B((mu,gt)=>{"use strict";h();var jt={decodeValues:!0,map:!1,silent:!1};function Tr(e){return typeof e=="string"&&!!e.trim()}o(Tr,"isNonEmptyString");function Or(e,t){var r=e.split(";").filter(Tr),n=r.shift(),i=Yo(n),s=i.name,a=i.value;t=t?Object.assign({},jt,t):jt;try{a=t.decodeValues?decodeURIComponent(a):a}catch(c){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+a+"'. Set options.decodeValues to false to disable this feature.",c)}var l={name:s,value:a};return r.forEach(function(c){var f=c.split("="),d=f.shift().trimLeft().toLowerCase(),p=f.join("=");d==="expires"?l.expires=new Date(p):d==="max-age"?l.maxAge=parseInt(p,10):d==="secure"?l.secure=!0:d==="httponly"?l.httpOnly=!0:d==="samesite"?l.sameSite=p:d==="partitioned"?l.partitioned=!0:l[d]=p}),l}o(Or,"parseString");function Yo(e){var t="",r="",n=e.split("=");return n.length>1?(t=n.shift(),r=n.join("=")):r=e,{name:t,value:r}}o(Yo,"parseNameValuePair");function ei(e,t){if(t=t?Object.assign({},jt,t):jt,!e)return t.map?{}:[];if(e.headers)if(typeof e.headers.getSetCookie=="function")e=e.headers.getSetCookie();else if(e.headers["set-cookie"])e=e.headers["set-cookie"];else{var r=e.headers[Object.keys(e.headers).find(function(i){return i.toLowerCase()==="set-cookie"})];!r&&e.headers.cookie&&!t.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),e=r}if(Array.isArray(e)||(e=[e]),t.map){var n={};return e.filter(Tr).reduce(function(i,s){var a=Or(s,t);return i[a.name]=a,i},n)}else return e.filter(Tr).map(function(i){return Or(i,t)})}o(ei,"parse");function Ko(e){if(Array.isArray(e))return e;if(typeof e!="string")return[];var t=[],r=0,n,i,s,a,l;function c(){for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length}o(c,"skipWhitespace");function f(){return i=e.charAt(r),i!=="="&&i!==";"&&i!==","}for(o(f,"notSpecialChar");r<e.length;){for(n=r,l=!1;c();)if(i=e.charAt(r),i===","){for(s=r,r+=1,c(),a=r;r<e.length&&f();)r+=1;r<e.length&&e.charAt(r)==="="?(l=!0,r=a,t.push(e.substring(n,s)),n=r):r=s+1}else r+=1;(!l||r>=e.length)&&t.push(e.substring(n,e.length))}return t}o(Ko,"splitCookiesString");gt.exports=ei;gt.exports.parse=ei;gt.exports.parseString=Or;gt.exports.splitCookiesString=Ko});var ui=B((kr,$r)=>{h();(function(e,t){typeof kr=="object"&&typeof $r<"u"?$r.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(kr,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",i="second",s="minute",a="hour",l="day",c="week",f="month",d="quarter",p="year",y="date",u="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,T={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:o(function(O){var E=["th","st","nd","rd"],v=O%100;return"["+O+(E[(v-20)%10]||E[v]||E[0])+"]"},"ordinal")},P=o(function(O,E,v){var b=String(O);return!b||b.length>=E?O:""+Array(E+1-b.length).join(v)+O},"m"),D={s:P,z:o(function(O){var E=-O.utcOffset(),v=Math.abs(E),b=Math.floor(v/60),g=v%60;return(E<=0?"+":"-")+P(b,2,"0")+":"+P(g,2,"0")},"z"),m:o(function O(E,v){if(E.date()<v.date())return-O(v,E);var b=12*(v.year()-E.year())+(v.month()-E.month()),g=E.clone().add(b,f),_=v-g<0,x=E.clone().add(b+(_?-1:1),f);return+(-(b+(v-g)/(_?g-x:x-g))||0)},"t"),a:o(function(O){return O<0?Math.ceil(O)||0:Math.floor(O)},"a"),p:o(function(O){return{M:f,y:p,w:c,d:l,D:y,h:a,m:s,s:i,ms:n,Q:d}[O]||String(O||"").toLowerCase().replace(/s$/,"")},"p"),u:o(function(O){return O===void 0},"u")},Q="en",k={};k[Q]=T;var z="$isDayjsObject",Y=o(function(O){return O instanceof te||!(!O||!O[z])},"S"),W=o(function O(E,v,b){var g;if(!E)return Q;if(typeof E=="string"){var _=E.toLowerCase();k[_]&&(g=_),v&&(k[_]=v,g=_);var x=E.split("-");if(!g&&x.length>1)return O(x[0])}else{var S=E.name;k[S]=E,g=S}return!b&&g&&(Q=g),g||!b&&Q},"t"),I=o(function(O,E){if(Y(O))return O.clone();var v=typeof E=="object"?E:{};return v.date=O,v.args=arguments,new te(v)},"O"),L=D;L.l=W,L.i=Y,L.w=function(O,E){return I(O,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var te=function(){function O(v){this.$L=W(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[z]=!0}o(O,"M");var E=O.prototype;return E.parse=function(v){this.$d=function(b){var g=b.date,_=b.utc;if(g===null)return new Date(NaN);if(L.u(g))return new Date;if(g instanceof Date)return new Date(g);if(typeof g=="string"&&!/Z$/i.test(g)){var x=g.match(m);if(x){var S=x[2]-1||0,N=(x[7]||"0").substring(0,3);return _?new Date(Date.UTC(x[1],S,x[3]||1,x[4]||0,x[5]||0,x[6]||0,N)):new Date(x[1],S,x[3]||1,x[4]||0,x[5]||0,x[6]||0,N)}}return new Date(g)}(v),this.init()},E.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},E.$utils=function(){return L},E.isValid=function(){return this.$d.toString()!==u},E.isSame=function(v,b){var g=I(v);return this.startOf(b)<=g&&g<=this.endOf(b)},E.isAfter=function(v,b){return I(v)<this.startOf(b)},E.isBefore=function(v,b){return this.endOf(b)<I(v)},E.$g=function(v,b,g){return L.u(v)?this[b]:this.set(g,v)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(v,b){var g=this,_=!!L.u(b)||b,x=L.p(v),S=o(function(F,re){var _e=L.w(g.$u?Date.UTC(g.$y,re,F):new Date(g.$y,re,F),g);return _?_e:_e.endOf(l)},"l"),N=o(function(F,re){return L.w(g.toDate()[F].apply(g.toDate("s"),(_?[0,0,0,0]:[23,59,59,999]).slice(re)),g)},"$"),C=this.$W,U=this.$M,K=this.$D,me="set"+(this.$u?"UTC":"");switch(x){case p:return _?S(1,0):S(31,11);case f:return _?S(1,U):S(0,U+1);case c:var oe=this.$locale().weekStart||0,V=(C<oe?C+7:C)-oe;return S(_?K-V:K+(6-V),U);case l:case y:return N(me+"Hours",0);case a:return N(me+"Minutes",1);case s:return N(me+"Seconds",2);case i:return N(me+"Milliseconds",3);default:return this.clone()}},E.endOf=function(v){return this.startOf(v,!1)},E.$set=function(v,b){var g,_=L.p(v),x="set"+(this.$u?"UTC":""),S=(g={},g[l]=x+"Date",g[y]=x+"Date",g[f]=x+"Month",g[p]=x+"FullYear",g[a]=x+"Hours",g[s]=x+"Minutes",g[i]=x+"Seconds",g[n]=x+"Milliseconds",g)[_],N=_===l?this.$D+(b-this.$W):b;if(_===f||_===p){var C=this.clone().set(y,1);C.$d[S](N),C.init(),this.$d=C.set(y,Math.min(this.$D,C.daysInMonth())).$d}else S&&this.$d[S](N);return this.init(),this},E.set=function(v,b){return this.clone().$set(v,b)},E.get=function(v){return this[L.p(v)]()},E.add=function(v,b){var g,_=this;v=Number(v);var x=L.p(b),S=o(function(U){var K=I(_);return L.w(K.date(K.date()+Math.round(U*v)),_)},"y");if(x===f)return this.set(f,this.$M+v);if(x===p)return this.set(p,this.$y+v);if(x===l)return S(1);if(x===c)return S(7);var N=(g={},g[s]=t,g[a]=r,g[i]=e,g)[x]||1,C=this.$d.getTime()+v*N;return L.w(C,this)},E.subtract=function(v,b){return this.add(-1*v,b)},E.format=function(v){var b=this,g=this.$locale();if(!this.isValid())return g.invalidDate||u;var _=v||"YYYY-MM-DDTHH:mm:ssZ",x=L.z(this),S=this.$H,N=this.$m,C=this.$M,U=g.weekdays,K=g.months,me=g.meridiem,oe=o(function(re,_e,pt,It){return re&&(re[_e]||re(b,_))||pt[_e].slice(0,It)},"h"),V=o(function(re){return L.s(S%12||12,re,"0")},"d"),F=me||function(re,_e,pt){var It=re<12?"AM":"PM";return pt?It.toLowerCase():It};return _.replace(w,function(re,_e){return _e||function(pt){switch(pt){case"YY":return String(b.$y).slice(-2);case"YYYY":return L.s(b.$y,4,"0");case"M":return C+1;case"MM":return L.s(C+1,2,"0");case"MMM":return oe(g.monthsShort,C,K,3);case"MMMM":return oe(K,C);case"D":return b.$D;case"DD":return L.s(b.$D,2,"0");case"d":return String(b.$W);case"dd":return oe(g.weekdaysMin,b.$W,U,2);case"ddd":return oe(g.weekdaysShort,b.$W,U,3);case"dddd":return U[b.$W];case"H":return String(S);case"HH":return L.s(S,2,"0");case"h":return V(1);case"hh":return V(2);case"a":return F(S,N,!0);case"A":return F(S,N,!1);case"m":return String(N);case"mm":return L.s(N,2,"0");case"s":return String(b.$s);case"ss":return L.s(b.$s,2,"0");case"SSS":return L.s(b.$ms,3,"0");case"Z":return x}return null}(re)||x.replace(":","")})},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(v,b,g){var _,x=this,S=L.p(b),N=I(v),C=(N.utcOffset()-this.utcOffset())*t,U=this-N,K=o(function(){return L.m(x,N)},"D");switch(S){case p:_=K()/12;break;case f:_=K();break;case d:_=K()/3;break;case c:_=(U-C)/6048e5;break;case l:_=(U-C)/864e5;break;case a:_=U/r;break;case s:_=U/t;break;case i:_=U/e;break;default:_=U}return g?_:L.a(_)},E.daysInMonth=function(){return this.endOf(f).$D},E.$locale=function(){return k[this.$L]},E.locale=function(v,b){if(!v)return this.$L;var g=this.clone(),_=W(v,b,!0);return _&&(g.$L=_),g},E.clone=function(){return L.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},O}(),dt=te.prototype;return I.prototype=dt,[["$ms",n],["$s",i],["$m",s],["$H",a],["$W",l],["$M",f],["$y",p],["$D",y]].forEach(function(O){dt[O[1]]=function(E){return this.$g(E,O[0],O[1])}}),I.extend=function(O,E){return O.$i||(O(E,te,I),O.$i=!0),I},I.locale=W,I.isDayjs=Y,I.unix=function(O){return I(1e3*O)},I.en=k[Q],I.Ls=k,I.p={},I})});var Lr=B((Iu,fi)=>{"use strict";h();fi.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}});var pi=B((Bu,di)=>{"use strict";h();var Jo=j("os"),hi=j("tty"),he=Lr(),{env:J}=process,Ae;he("no-color")||he("no-colors")||he("color=false")||he("color=never")?Ae=0:(he("color")||he("colors")||he("color=true")||he("color=always"))&&(Ae=1);"FORCE_COLOR"in J&&(J.FORCE_COLOR==="true"?Ae=1:J.FORCE_COLOR==="false"?Ae=0:Ae=J.FORCE_COLOR.length===0?1:Math.min(parseInt(J.FORCE_COLOR,10),3));function Ar(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}o(Ar,"translateLevel");function Pr(e,t){if(Ae===0)return 0;if(he("color=16m")||he("color=full")||he("color=truecolor"))return 3;if(he("color=256"))return 2;if(e&&!t&&Ae===void 0)return 0;let r=Ae||0;if(J.TERM==="dumb")return r;if(process.platform==="win32"){let n=Jo.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in J)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in J)||J.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in J)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(J.TEAMCITY_VERSION)?1:0;if(J.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in J){let n=parseInt((J.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(J.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(J.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(J.TERM)||"COLORTERM"in J?1:r}o(Pr,"supportsColor");function Xo(e){let t=Pr(e,e&&e.isTTY);return Ar(t)}o(Xo,"getSupportLevel");di.exports={supportsColor:Xo,stdout:Ar(Pr(!0,hi.isatty(1))),stderr:Ar(Pr(!0,hi.isatty(2)))}});var yi=B((Uu,gi)=>{"use strict";h();var Zo=pi(),tt=Lr();function mi(e){if(/^\d{3,4}$/.test(e)){let r=/(\d{1,2})(\d{2})/.exec(e)||[];return{major:0,minor:parseInt(r[1],10),patch:parseInt(r[2],10)}}let t=(e||"").split(".").map(r=>parseInt(r,10));return{major:t[0],minor:t[1],patch:t[2]}}o(mi,"parseVersion");function Nr(e){let{CI:t,FORCE_HYPERLINK:r,NETLIFY:n,TEAMCITY_VERSION:i,TERM_PROGRAM:s,TERM_PROGRAM_VERSION:a,VTE_VERSION:l,TERM:c}=process.env;if(r)return!(r.length>0&&parseInt(r,10)===0);if(tt("no-hyperlink")||tt("no-hyperlinks")||tt("hyperlink=false")||tt("hyperlink=never"))return!1;if(tt("hyperlink=true")||tt("hyperlink=always")||n)return!0;if(!Zo.supportsColor(e)||e&&!e.isTTY)return!1;if("WT_SESSION"in process.env)return!0;if(process.platform==="win32"||t||i)return!1;if(s){let f=mi(a||"");switch(s){case"iTerm.app":return f.major===3?f.minor>=1:f.major>3;case"WezTerm":return f.major>=20200620;case"vscode":return f.major>1||f.major===1&&f.minor>=72;case"ghostty":return!0}}if(l){if(l==="0.50.0")return!1;let f=mi(l);return f.major>0||f.minor>=50}switch(c){case"alacritty":return!0}return!1}o(Nr,"supportsHyperlink");gi.exports={supportsHyperlink:Nr,stdout:Nr(process.stdout),stderr:Nr(process.stderr)}});var Si=B((of,Br)=>{"use strict";h();var na=Object.prototype.hasOwnProperty,se="~";function yt(){}o(yt,"Events");Object.create&&(yt.prototype=Object.create(null),new yt().__proto__||(se=!1));function ia(e,t,r){this.fn=e,this.context=t,this.once=r||!1}o(ia,"EE");function Ei(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var s=new ia(r,n||e,i),a=se?se+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],s]:e._events[a].push(s):(e._events[a]=s,e._eventsCount++),e}o(Ei,"addListener");function Wt(e,t){--e._eventsCount===0?e._events=new yt:delete e._events[t]}o(Wt,"clearEvent");function ee(){this._events=new yt,this._eventsCount=0}o(ee,"EventEmitter");ee.prototype.eventNames=o(function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)na.call(r,n)&&t.push(se?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t},"eventNames");ee.prototype.listeners=o(function(t){var r=se?se+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,a=new Array(s);i<s;i++)a[i]=n[i].fn;return a},"listeners");ee.prototype.listenerCount=o(function(t){var r=se?se+t:t,n=this._events[r];return n?n.fn?1:n.length:0},"listenerCount");ee.prototype.emit=o(function(t,r,n,i,s,a){var l=se?se+t:t;if(!this._events[l])return!1;var c=this._events[l],f=arguments.length,d,p;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),f){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,r),!0;case 3:return c.fn.call(c.context,r,n),!0;case 4:return c.fn.call(c.context,r,n,i),!0;case 5:return c.fn.call(c.context,r,n,i,s),!0;case 6:return c.fn.call(c.context,r,n,i,s,a),!0}for(p=1,d=new Array(f-1);p<f;p++)d[p-1]=arguments[p];c.fn.apply(c.context,d)}else{var y=c.length,u;for(p=0;p<y;p++)switch(c[p].once&&this.removeListener(t,c[p].fn,void 0,!0),f){case 1:c[p].fn.call(c[p].context);break;case 2:c[p].fn.call(c[p].context,r);break;case 3:c[p].fn.call(c[p].context,r,n);break;case 4:c[p].fn.call(c[p].context,r,n,i);break;default:if(!d)for(u=1,d=new Array(f-1);u<f;u++)d[u-1]=arguments[u];c[p].fn.apply(c[p].context,d)}}return!0},"emit");ee.prototype.on=o(function(t,r,n){return Ei(this,t,r,n,!1)},"on");ee.prototype.once=o(function(t,r,n){return Ei(this,t,r,n,!0)},"once");ee.prototype.removeListener=o(function(t,r,n,i){var s=se?se+t:t;if(!this._events[s])return this;if(!r)return Wt(this,s),this;var a=this._events[s];if(a.fn)a.fn===r&&(!i||a.once)&&(!n||a.context===n)&&Wt(this,s);else{for(var l=0,c=[],f=a.length;l<f;l++)(a[l].fn!==r||i&&!a[l].once||n&&a[l].context!==n)&&c.push(a[l]);c.length?this._events[s]=c.length===1?c[0]:c:Wt(this,s)}return this},"removeListener");ee.prototype.removeAllListeners=o(function(t){var r;return t?(r=se?se+t:t,this._events[r]&&Wt(this,r)):(this._events=new yt,this._eventsCount=0),this},"removeAllListeners");ee.prototype.off=ee.prototype.removeListener;ee.prototype.addListener=ee.prototype.on;ee.prefixed=se;ee.EventEmitter=ee;typeof Br<"u"&&(Br.exports=ee)});var Li=B((Cf,$i)=>{"use strict";h();var{Duplex:sa}=j("stream");function Ci(e){e.emit("close")}o(Ci,"emitClose");function oa(){!this.destroyed&&this._writableState.finished&&this.destroy()}o(oa,"duplexOnEnd");function ki(e){this.removeListener("error",ki),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}o(ki,"duplexOnError");function aa(e,t){let r=!0,n=new sa({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",o(function(s,a){let l=!a&&n._readableState.objectMode?s.toString():s;n.push(l)||e.pause()},"message")),e.once("error",o(function(s){n.destroyed||(r=!1,n.destroy(s))},"error")),e.once("close",o(function(){n.destroyed||n.push(null)},"close")),n._destroy=function(i,s){if(e.readyState===e.CLOSED){s(i),process.nextTick(Ci,n);return}let a=!1;e.once("error",o(function(c){a=!0,s(c)},"error")),e.once("close",o(function(){a||s(i),process.nextTick(Ci,n)},"close")),r&&e.terminate()},n._final=function(i){if(e.readyState===e.CONNECTING){e.once("open",o(function(){n._final(i)},"open"));return}e._socket!==null&&(e._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(e._socket.once("finish",o(function(){i()},"finish")),e.close()))},n._read=function(){e.isPaused&&e.resume()},n._write=function(i,s,a){if(e.readyState===e.CONNECTING){e.once("open",o(function(){n._write(i,s,a)},"open"));return}e.send(i,a)},n.on("end",oa),n.on("error",ki),n}o(aa,"createWebSocketStream");$i.exports=aa});var Se=B((Lf,Ni)=>{"use strict";h();var Ai=["nodebuffer","arraybuffer","fragments"],Pi=typeof Blob<"u";Pi&&Ai.push("blob");Ni.exports={BINARY_TYPES:Ai,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Pi,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:o(()=>{},"NOOP")}});var vt=B((Nf,zt)=>{"use strict";h();var{EMPTY_BUFFER:ca}=Se(),jr=Buffer[Symbol.species];function la(e,t){if(e.length===0)return ca;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),n=0;for(let i=0;i<e.length;i++){let s=e[i];r.set(s,n),n+=s.length}return n<t?new jr(r.buffer,r.byteOffset,n):r}o(la,"concat");function Ii(e,t,r,n,i){for(let s=0;s<i;s++)r[n+s]=e[s]^t[s&3]}o(Ii,"_mask");function Ri(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}o(Ri,"_unmask");function ua(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}o(ua,"toArrayBuffer");function Gr(e){if(Gr.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new jr(e):ArrayBuffer.isView(e)?t=new jr(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Gr.readOnly=!1),t}o(Gr,"toBuffer");zt.exports={concat:la,mask:Ii,toArrayBuffer:ua,toBuffer:Gr,unmask:Ri};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=j("bufferutil");zt.exports.mask=function(t,r,n,i,s){s<48?Ii(t,r,n,i,s):e.mask(t,r,n,i,s)},zt.exports.unmask=function(t,r){t.length<32?Ri(t,r):e.unmask(t,r)}}catch{}});var Di=B((Bf,Mi)=>{"use strict";h();var Bi=Symbol("kDone"),qr=Symbol("kRun"),Wr=class{static{o(this,"Limiter")}constructor(t){this[Bi]=()=>{this.pending--,this[qr]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[qr]()}[qr](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[Bi])}}};Mi.exports=Wr});var St=B((Uf,Gi)=>{"use strict";h();var wt=j("zlib"),Ui=vt(),fa=Di(),{kStatusCode:Fi}=Se(),ha=Buffer[Symbol.species],da=Buffer.from([0,0,255,255]),Qt=Symbol("permessage-deflate"),Te=Symbol("total-length"),Et=Symbol("callback"),Pe=Symbol("buffers"),Ht=Symbol("error"),Vt,zr=class{static{o(this,"PerMessageDeflate")}constructor(t,r,n){if(this._maxPayload=n|0,this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!Vt){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Vt=new fa(i)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Et];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,n=t.find(i=>!(r.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>i.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!i.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(t){let r=t[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(t){return t.forEach(r=>{Object.keys(r).forEach(n=>{let i=r[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);r[n]=i})}),t}decompress(t,r,n){Vt.add(i=>{this._decompress(t,r,(s,a)=>{i(),n(s,a)})})}compress(t,r,n){Vt.add(i=>{this._compress(t,r,(s,a)=>{i(),n(s,a)})})}_decompress(t,r,n){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,a=typeof this.params[s]!="number"?wt.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=wt.createInflateRaw({...this._options.zlibInflateOptions,windowBits:a}),this._inflate[Qt]=this,this._inflate[Te]=0,this._inflate[Pe]=[],this._inflate.on("error",ma),this._inflate.on("data",ji)}this._inflate[Et]=n,this._inflate.write(t),r&&this._inflate.write(da),this._inflate.flush(()=>{let s=this._inflate[Ht];if(s){this._inflate.close(),this._inflate=null,n(s);return}let a=Ui.concat(this._inflate[Pe],this._inflate[Te]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Te]=0,this._inflate[Pe]=[],r&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,a)})}_compress(t,r,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,a=typeof this.params[s]!="number"?wt.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=wt.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:a}),this._deflate[Te]=0,this._deflate[Pe]=[],this._deflate.on("data",pa)}this._deflate[Et]=n,this._deflate.write(t),this._deflate.flush(wt.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=Ui.concat(this._deflate[Pe],this._deflate[Te]);r&&(s=new ha(s.buffer,s.byteOffset,s.length-4)),this._deflate[Et]=null,this._deflate[Te]=0,this._deflate[Pe]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};Gi.exports=zr;function pa(e){this[Pe].push(e),this[Te]+=e.length}o(pa,"deflateOnData");function ji(e){if(this[Te]+=e.length,this[Qt]._maxPayload<1||this[Te]<=this[Qt]._maxPayload){this[Pe].push(e);return}this[Ht]=new RangeError("Max payload size exceeded"),this[Ht].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Ht][Fi]=1009,this.removeListener("data",ji),this.reset()}o(ji,"inflateOnData");function ma(e){this[Qt]._inflate=null,e[Fi]=1007,this[Et](e)}o(ma,"inflateOnError")});var it=B((Gf,Yt)=>{"use strict";h();var{isUtf8:qi}=j("buffer"),{hasBlob:ga}=Se(),ya=[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 ba(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}o(ba,"isValidStatusCode");function Vr(e){let t=e.length,r=0;for(;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!1;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!1;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!1;r+=4}else return!1;return!0}o(Vr,"_isValidUTF8");function _a(e){return ga&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}o(_a,"isBlob");Yt.exports={isBlob:_a,isValidStatusCode:ba,isValidUTF8:Vr,tokenChars:ya};if(qi)Yt.exports.isValidUTF8=function(e){return e.length<24?Vr(e):qi(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=j("utf-8-validate");Yt.exports.isValidUTF8=function(t){return t.length<32?Vr(t):e(t)}}catch{}});var Jr=B((zf,Ki)=>{"use strict";h();var{Writable:xa}=j("stream"),Wi=St(),{BINARY_TYPES:va,EMPTY_BUFFER:zi,kStatusCode:wa,kWebSocket:Ea}=Se(),{concat:Hr,toArrayBuffer:Sa,unmask:Ta}=vt(),{isValidStatusCode:Oa,isValidUTF8:Vi}=it(),Kt=Buffer[Symbol.species],de=0,Hi=1,Qi=2,Yi=3,Qr=4,Yr=5,Jt=6,Kr=class extends xa{static{o(this,"Receiver")}constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||va[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[Ea]=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=de}_write(t,r,n){if(this._opcode===8&&this._state==de)return n();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(n)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new Kt(n.buffer,n.byteOffset+t,n.length-t),new Kt(n.buffer,n.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let n=this._buffers[0],i=r.length-t;t>=n.length?r.set(this._buffers.shift(),i):(r.set(new Uint8Array(n.buffer,n.byteOffset,t),i),this._buffers[0]=new Kt(n.buffer,n.byteOffset+t,n.length-t)),t-=n.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case de:this.getInfo(t);break;case Hi:this.getPayloadLength16(t);break;case Qi:this.getPayloadLength64(t);break;case Yi:this.getMask();break;case Qr:this.getData(t);break;case Yr:case Jt:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(i);return}let n=(r[0]&64)===64;if(n&&!this._extensions[Wi.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(i);return}this._payloadLength===126?this._state=Hi:this._payloadLength===127?this._state=Qi:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){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 i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(i);return}this._payloadLength=n*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){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");t(r);return}this._masked?this._state=Yi:this._state=Qr}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Qr}getData(t){let r=zi;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&&Ta(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=Yr,this.decompress(r,t);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}decompress(t,r){this._extensions[Wi.extensionName].decompress(t,this._fin,(i,s)=>{if(i)return r(i);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===de&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=de;return}let r=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=Hr(n,r):this._binaryType==="arraybuffer"?i=Sa(Hr(n,r)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=de):(this._state=Jt,setImmediate(()=>{this.emit("message",i,!0),this._state=de,this.startLoop(t)}))}else{let i=Hr(n,r);if(!this._skipUTF8Validation&&!Vi(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._state===Yr||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=de):(this._state=Jt,setImmediate(()=>{this.emit("message",i,!1),this._state=de,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,zi),this.end();else{let n=t.readUInt16BE(0);if(!Oa(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(s);return}let i=new Kt(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!Vi(i)){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,i),this.end()}this._state=de;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=de):(this._state=Jt,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=de,this.startLoop(r)}))}createError(t,r,n,i,s){this._loop=!1,this._errored=!0;let a=new t(n?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(a,this.createError),a.code=s,a[wa]=i,a}};Ki.exports=Kr});var en=B((Yf,Zi)=>{"use strict";h();var{Duplex:Qf}=j("stream"),{randomFillSync:Ca}=j("crypto"),Ji=St(),{EMPTY_BUFFER:ka,kWebSocket:$a,NOOP:La}=Se(),{isBlob:st,isValidStatusCode:Aa}=it(),{mask:Xi,toBuffer:Ge}=vt(),pe=Symbol("kByteLength"),Pa=Buffer.alloc(4),Xt=8*1024,qe,ot=Xt,be=0,Na=1,Ia=2,Xr=class e{static{o(this,"Sender")}constructor(t,r,n){this._extensions=r||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=be,this.onerror=La,this[$a]=void 0}static frame(t,r){let n,i=!1,s=2,a=!1;r.mask&&(n=r.maskBuffer||Pa,r.generateMask?r.generateMask(n):(ot===Xt&&(qe===void 0&&(qe=Buffer.alloc(Xt)),Ca(qe,0,Xt),ot=0),n[0]=qe[ot++],n[1]=qe[ot++],n[2]=qe[ot++],n[3]=qe[ot++]),a=(n[0]|n[1]|n[2]|n[3])===0,s=6);let l;typeof t=="string"?(!r.mask||a)&&r[pe]!==void 0?l=r[pe]:(t=Buffer.from(t),l=t.length):(l=t.length,i=r.mask&&r.readOnly&&!a);let c=l;l>=65536?(s+=8,c=127):l>125&&(s+=2,c=126);let f=Buffer.allocUnsafe(i?l+s:s);return f[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(f[0]|=64),f[1]=c,c===126?f.writeUInt16BE(l,2):c===127&&(f[2]=f[3]=0,f.writeUIntBE(l,4,6)),r.mask?(f[1]|=128,f[s-4]=n[0],f[s-3]=n[1],f[s-2]=n[2],f[s-1]=n[3],a?[f,t]:i?(Xi(t,n,f,s,l),[f]):(Xi(t,n,t,0,l),[f,t])):[f,t]}close(t,r,n,i){let s;if(t===void 0)s=ka;else{if(typeof t!="number"||!Aa(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(t,0);else{let l=Buffer.byteLength(r);if(l>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+l),s.writeUInt16BE(t,0),typeof r=="string"?s.write(r,2):s.set(r,2)}}let a={[pe]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==be?this.enqueue([this.dispatch,s,!1,a,i]):this.sendFrame(e.frame(s,a),i)}ping(t,r,n){let i,s;if(typeof t=="string"?(i=Buffer.byteLength(t),s=!1):st(t)?(i=t.size,s=!1):(t=Ge(t),i=t.length,s=Ge.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let a={[pe]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};st(t)?this._state!==be?this.enqueue([this.getBlobData,t,!1,a,n]):this.getBlobData(t,!1,a,n):this._state!==be?this.enqueue([this.dispatch,t,!1,a,n]):this.sendFrame(e.frame(t,a),n)}pong(t,r,n){let i,s;if(typeof t=="string"?(i=Buffer.byteLength(t),s=!1):st(t)?(i=t.size,s=!1):(t=Ge(t),i=t.length,s=Ge.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let a={[pe]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};st(t)?this._state!==be?this.enqueue([this.getBlobData,t,!1,a,n]):this.getBlobData(t,!1,a,n):this._state!==be?this.enqueue([this.dispatch,t,!1,a,n]):this.sendFrame(e.frame(t,a),n)}send(t,r,n){let i=this._extensions[Ji.extensionName],s=r.binary?2:1,a=r.compress,l,c;typeof t=="string"?(l=Buffer.byteLength(t),c=!1):st(t)?(l=t.size,c=!1):(t=Ge(t),l=t.length,c=Ge.readOnly),this._firstFragment?(this._firstFragment=!1,a&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(a=l>=i._threshold),this._compress=a):(a=!1,s=0),r.fin&&(this._firstFragment=!0);let f={[pe]:l,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:a};st(t)?this._state!==be?this.enqueue([this.getBlobData,t,this._compress,f,n]):this.getBlobData(t,this._compress,f,n):this._state!==be?this.enqueue([this.dispatch,t,this._compress,f,n]):this.dispatch(t,this._compress,f,n)}getBlobData(t,r,n,i){this._bufferedBytes+=n[pe],this._state=Ia,t.arrayBuffer().then(s=>{if(this._socket.destroyed){let l=new Error("The socket was closed while the blob was being read");process.nextTick(Zr,this,l,i);return}this._bufferedBytes-=n[pe];let a=Ge(s);r?this.dispatch(a,r,n,i):(this._state=be,this.sendFrame(e.frame(a,n),i),this.dequeue())}).catch(s=>{process.nextTick(Ra,this,s,i)})}dispatch(t,r,n,i){if(!r){this.sendFrame(e.frame(t,n),i);return}let s=this._extensions[Ji.extensionName];this._bufferedBytes+=n[pe],this._state=Na,s.compress(t,n.fin,(a,l)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Zr(this,c,i);return}this._bufferedBytes-=n[pe],this._state=be,n.readOnly=!1,this.sendFrame(e.frame(l,n),i),this.dequeue()})}dequeue(){for(;this._state===be&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][pe],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][pe],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};Zi.exports=Xr;function Zr(e,t,r){typeof r=="function"&&r(t);for(let n=0;n<e._queue.length;n++){let i=e._queue[n],s=i[i.length-1];typeof s=="function"&&s(t)}}o(Zr,"callCallbacks");function Ra(e,t,r){Zr(e,t,r),e.onerror(t)}o(Ra,"onError")});var cs=B((Xf,as)=>{"use strict";h();var{kForOnEventAttribute:Tt,kListener:tn}=Se(),es=Symbol("kCode"),ts=Symbol("kData"),rs=Symbol("kError"),ns=Symbol("kMessage"),is=Symbol("kReason"),at=Symbol("kTarget"),ss=Symbol("kType"),os=Symbol("kWasClean"),Oe=class{static{o(this,"Event")}constructor(t){this[at]=null,this[ss]=t}get target(){return this[at]}get type(){return this[ss]}};Object.defineProperty(Oe.prototype,"target",{enumerable:!0});Object.defineProperty(Oe.prototype,"type",{enumerable:!0});var We=class extends Oe{static{o(this,"CloseEvent")}constructor(t,r={}){super(t),this[es]=r.code===void 0?0:r.code,this[is]=r.reason===void 0?"":r.reason,this[os]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[es]}get reason(){return this[is]}get wasClean(){return this[os]}};Object.defineProperty(We.prototype,"code",{enumerable:!0});Object.defineProperty(We.prototype,"reason",{enumerable:!0});Object.defineProperty(We.prototype,"wasClean",{enumerable:!0});var ct=class extends Oe{static{o(this,"ErrorEvent")}constructor(t,r={}){super(t),this[rs]=r.error===void 0?null:r.error,this[ns]=r.message===void 0?"":r.message}get error(){return this[rs]}get message(){return this[ns]}};Object.defineProperty(ct.prototype,"error",{enumerable:!0});Object.defineProperty(ct.prototype,"message",{enumerable:!0});var Ot=class extends Oe{static{o(this,"MessageEvent")}constructor(t,r={}){super(t),this[ts]=r.data===void 0?null:r.data}get data(){return this[ts]}};Object.defineProperty(Ot.prototype,"data",{enumerable:!0});var Ba={addEventListener(e,t,r={}){for(let i of this.listeners(e))if(!r[Tt]&&i[tn]===t&&!i[Tt])return;let n;if(e==="message")n=o(function(s,a){let l=new Ot("message",{data:a?s:s.toString()});l[at]=this,Zt(t,this,l)},"onMessage");else if(e==="close")n=o(function(s,a){let l=new We("close",{code:s,reason:a.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});l[at]=this,Zt(t,this,l)},"onClose");else if(e==="error")n=o(function(s){let a=new ct("error",{error:s,message:s.message});a[at]=this,Zt(t,this,a)},"onError");else if(e==="open")n=o(function(){let s=new Oe("open");s[at]=this,Zt(t,this,s)},"onOpen");else return;n[Tt]=!!r[Tt],n[tn]=t,r.once?this.once(e,n):this.on(e,n)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[tn]===t&&!r[Tt]){this.removeListener(e,r);break}}};as.exports={CloseEvent:We,ErrorEvent:ct,Event:Oe,EventTarget:Ba,MessageEvent:Ot};function Zt(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}o(Zt,"callListener")});var rn=B((th,ls)=>{"use strict";h();var{tokenChars:Ct}=it();function xe(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}o(xe,"push");function Ma(e){let t=Object.create(null),r=Object.create(null),n=!1,i=!1,s=!1,a,l,c=-1,f=-1,d=-1,p=0;for(;p<e.length;p++)if(f=e.charCodeAt(p),a===void 0)if(d===-1&&Ct[f]===1)c===-1&&(c=p);else if(p!==0&&(f===32||f===9))d===-1&&c!==-1&&(d=p);else if(f===59||f===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p);let u=e.slice(c,d);f===44?(xe(t,u,r),r=Object.create(null)):a=u,c=d=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(l===void 0)if(d===-1&&Ct[f]===1)c===-1&&(c=p);else if(f===32||f===9)d===-1&&c!==-1&&(d=p);else if(f===59||f===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p),xe(r,e.slice(c,d),!0),f===44&&(xe(t,a,r),r=Object.create(null),a=void 0),c=d=-1}else if(f===61&&c!==-1&&d===-1)l=e.slice(c,p),c=d=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(i){if(Ct[f]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);c===-1?c=p:n||(n=!0),i=!1}else if(s)if(Ct[f]===1)c===-1&&(c=p);else if(f===34&&c!==-1)s=!1,d=p;else if(f===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(f===34&&e.charCodeAt(p-1)===61)s=!0;else if(d===-1&&Ct[f]===1)c===-1&&(c=p);else if(c!==-1&&(f===32||f===9))d===-1&&(d=p);else if(f===59||f===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p);let u=e.slice(c,d);n&&(u=u.replace(/\\/g,""),n=!1),xe(r,l,u),f===44&&(xe(t,a,r),r=Object.create(null),a=void 0),l=void 0,c=d=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(c===-1||s||f===32||f===9)throw new SyntaxError("Unexpected end of input");d===-1&&(d=p);let y=e.slice(c,d);return a===void 0?xe(t,y,r):(l===void 0?xe(r,y,!0):n?xe(r,l,y.replace(/\\/g,"")):xe(r,l,y),xe(t,a,r)),t}o(Ma,"parse");function Da(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(n=>[t].concat(Object.keys(n).map(i=>{let s=n[i];return Array.isArray(s)||(s=[s]),s.map(a=>a===!0?i:`${i}=${a}`).join("; ")})).join("; ")).join(", ")}).join(", ")}o(Da,"format");ls.exports={format:Da,parse:Ma}});var cn=B((oh,vs)=>{"use strict";h();var Ua=j("events"),Fa=j("https"),ja=j("http"),hs=j("net"),Ga=j("tls"),{randomBytes:qa,createHash:Wa}=j("crypto"),{Duplex:ih,Readable:sh}=j("stream"),{URL:nn}=j("url"),Ne=St(),za=Jr(),Va=en(),{isBlob:Ha}=it(),{BINARY_TYPES:us,EMPTY_BUFFER:er,GUID:Qa,kForOnEventAttribute:sn,kListener:Ya,kStatusCode:Ka,kWebSocket:X,NOOP:ds}=Se(),{EventTarget:{addEventListener:Ja,removeEventListener:Xa}}=cs(),{format:Za,parse:ec}=rn(),{toBuffer:tc}=vt(),rc=30*1e3,ps=Symbol("kAborted"),on=[8,13],Ce=["CONNECTING","OPEN","CLOSING","CLOSED"],nc=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,q=class e extends Ua{static{o(this,"WebSocket")}constructor(t,r,n){super(),this._binaryType=us[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=er,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==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]),ms(this,t,r,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){us.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}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(t,r,n){let i=new za({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new Va(t,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=t,i[X]=this,s[X]=this,t[X]=this,i.on("conclude",oc),i.on("drain",ac),i.on("error",cc),i.on("message",lc),i.on("ping",uc),i.on("pong",fc),s.onerror=hc,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",bs),t.on("data",rr),t.on("end",_s),t.on("error",xs),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Ne.extensionName]&&this._extensions[Ne.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){ue(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),ys(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){an(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||er,r,n)}pong(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){an(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||er,r,n)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(n=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){an(this,t,n);return}let i={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[Ne.extensionName]||(i.compress=!1),this._sender.send(t||er,i,n)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){ue(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(q,"CONNECTING",{enumerable:!0,value:Ce.indexOf("CONNECTING")});Object.defineProperty(q.prototype,"CONNECTING",{enumerable:!0,value:Ce.indexOf("CONNECTING")});Object.defineProperty(q,"OPEN",{enumerable:!0,value:Ce.indexOf("OPEN")});Object.defineProperty(q.prototype,"OPEN",{enumerable:!0,value:Ce.indexOf("OPEN")});Object.defineProperty(q,"CLOSING",{enumerable:!0,value:Ce.indexOf("CLOSING")});Object.defineProperty(q.prototype,"CLOSING",{enumerable:!0,value:Ce.indexOf("CLOSING")});Object.defineProperty(q,"CLOSED",{enumerable:!0,value:Ce.indexOf("CLOSED")});Object.defineProperty(q.prototype,"CLOSED",{enumerable:!0,value:Ce.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(q.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(q.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[sn])return t[Ya];return null},set(t){for(let r of this.listeners(e))if(r[sn]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[sn]:!0})}})});q.prototype.addEventListener=Ja;q.prototype.removeEventListener=Xa;vs.exports=q;function ms(e,t,r,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:on[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(e._autoPong=i.autoPong,!on.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${on.join(", ")})`);let s;if(t instanceof nn)s=t;else try{s=new nn(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),e._url=s.href;let a=s.protocol==="wss:",l=s.protocol==="ws+unix:",c;if(s.protocol!=="ws:"&&!a&&!l?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"`:l&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let w=new SyntaxError(c);if(e._redirects===0)throw w;tr(e,w);return}let f=a?443:80,d=qa(16).toString("base64"),p=a?Fa.request:ja.request,y=new Set,u;if(i.createConnection=i.createConnection||(a?sc:ic),i.defaultPort=i.defaultPort||f,i.port=s.port||f,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":d,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(u=new Ne(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=Za({[Ne.extensionName]:u.offer()})),r.length){for(let w of r){if(typeof w!="string"||!nc.test(w)||y.has(w))throw new SyntaxError("An invalid or duplicated subprotocol was specified");y.add(w)}i.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(s.username||s.password)&&(i.auth=`${s.username}:${s.password}`),l){let w=i.path.split(":");i.socketPath=w[0],i.path=w[1]}let m;if(i.followRedirects){if(e._redirects===0){e._originalIpc=l,e._originalSecure=a,e._originalHostOrSocketPath=l?i.socketPath:s.host;let w=n&&n.headers;if(n={...n,headers:{}},w)for(let[T,P]of Object.entries(w))n.headers[T.toLowerCase()]=P}else if(e.listenerCount("redirect")===0){let w=l?e._originalIpc?i.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:s.host===e._originalHostOrSocketPath;(!w||e._originalSecure&&!a)&&(delete i.headers.authorization,delete i.headers.cookie,w||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),m=e._req=p(i),e._redirects&&e.emit("redirect",e.url,m)}else m=e._req=p(i);i.timeout&&m.on("timeout",()=>{ue(e,m,"Opening handshake has timed out")}),m.on("error",w=>{m===null||m[ps]||(m=e._req=null,tr(e,w))}),m.on("response",w=>{let T=w.headers.location,P=w.statusCode;if(T&&i.followRedirects&&P>=300&&P<400){if(++e._redirects>i.maxRedirects){ue(e,m,"Maximum redirects exceeded");return}m.abort();let D;try{D=new nn(T,t)}catch{let k=new SyntaxError(`Invalid URL: ${T}`);tr(e,k);return}ms(e,D,r,n)}else e.emit("unexpected-response",m,w)||ue(e,m,`Unexpected server response: ${w.statusCode}`)}),m.on("upgrade",(w,T,P)=>{if(e.emit("upgrade",w),e.readyState!==q.CONNECTING)return;m=e._req=null;let D=w.headers.upgrade;if(D===void 0||D.toLowerCase()!=="websocket"){ue(e,T,"Invalid Upgrade header");return}let Q=Wa("sha1").update(d+Qa).digest("base64");if(w.headers["sec-websocket-accept"]!==Q){ue(e,T,"Invalid Sec-WebSocket-Accept header");return}let k=w.headers["sec-websocket-protocol"],z;if(k!==void 0?y.size?y.has(k)||(z="Server sent an invalid subprotocol"):z="Server sent a subprotocol but none was requested":y.size&&(z="Server sent no subprotocol"),z){ue(e,T,z);return}k&&(e._protocol=k);let Y=w.headers["sec-websocket-extensions"];if(Y!==void 0){if(!u){ue(e,T,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let W;try{W=ec(Y)}catch{ue(e,T,"Invalid Sec-WebSocket-Extensions header");return}let I=Object.keys(W);if(I.length!==1||I[0]!==Ne.extensionName){ue(e,T,"Server indicated an extension that was not requested");return}try{u.accept(W[Ne.extensionName])}catch{ue(e,T,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[Ne.extensionName]=u}e.setSocket(T,P,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(m,e):m.end()}o(ms,"initAsClient");function tr(e,t){e._readyState=q.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}o(tr,"emitErrorAndClose");function ic(e){return e.path=e.socketPath,hs.connect(e)}o(ic,"netConnect");function sc(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=hs.isIP(e.host)?"":e.host),Ga.connect(e)}o(sc,"tlsConnect");function ue(e,t,r){e._readyState=q.CLOSING;let n=new Error(r);Error.captureStackTrace(n,ue),t.setHeader?(t[ps]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(tr,e,n)):(t.destroy(n),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}o(ue,"abortHandshake");function an(e,t,r){if(t){let n=Ha(t)?t.size:tc(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${e.readyState} (${Ce[e.readyState]})`);process.nextTick(r,n)}}o(an,"sendAfterClose");function oc(e,t){let r=this[X];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[X]!==void 0&&(r._socket.removeListener("data",rr),process.nextTick(gs,r._socket),e===1005?r.close():r.close(e,t))}o(oc,"receiverOnConclude");function ac(){let e=this[X];e.isPaused||e._socket.resume()}o(ac,"receiverOnDrain");function cc(e){let t=this[X];t._socket[X]!==void 0&&(t._socket.removeListener("data",rr),process.nextTick(gs,t._socket),t.close(e[Ka])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}o(cc,"receiverOnError");function fs(){this[X].emitClose()}o(fs,"receiverOnFinish");function lc(e,t){this[X].emit("message",e,t)}o(lc,"receiverOnMessage");function uc(e){let t=this[X];t._autoPong&&t.pong(e,!this._isServer,ds),t.emit("ping",e)}o(uc,"receiverOnPing");function fc(e){this[X].emit("pong",e)}o(fc,"receiverOnPong");function gs(e){e.resume()}o(gs,"resume");function hc(e){let t=this[X];t.readyState!==q.CLOSED&&(t.readyState===q.OPEN&&(t._readyState=q.CLOSING,ys(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}o(hc,"senderOnError");function ys(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),rc)}o(ys,"setCloseTimer");function bs(){let e=this[X];this.removeListener("close",bs),this.removeListener("data",rr),this.removeListener("end",_s),e._readyState=q.CLOSING;let t;!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&(t=e._socket.read())!==null&&e._receiver.write(t),e._receiver.end(),this[X]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",fs),e._receiver.on("finish",fs))}o(bs,"socketOnClose");function rr(e){this[X]._receiver.write(e)||this.pause()}o(rr,"socketOnData");function _s(){let e=this[X];e._readyState=q.CLOSING,e._receiver.end(),this.end()}o(_s,"socketOnEnd");function xs(){let e=this[X];this.removeListener("error",xs),this.on("error",ds),e&&(e._readyState=q.CLOSING,this.destroy())}o(xs,"socketOnError")});var Es=B((lh,ws)=>{"use strict";h();var{tokenChars:dc}=it();function pc(e){let t=new Set,r=-1,n=-1,i=0;for(i;i<e.length;i++){let a=e.charCodeAt(i);if(n===-1&&dc[a]===1)r===-1&&(r=i);else if(i!==0&&(a===32||a===9))n===-1&&r!==-1&&(n=i);else if(a===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let l=e.slice(r,n);if(t.has(l))throw new SyntaxError(`The "${l}" subprotocol is duplicated`);t.add(l),r=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(r===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=e.slice(r,i);if(t.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return t.add(s),t}o(pc,"parse");ws.exports={parse:pc}});var Ls=B((dh,$s)=>{"use strict";h();var mc=j("events"),nr=j("http"),{Duplex:hh}=j("stream"),{createHash:gc}=j("crypto"),Ss=rn(),ze=St(),yc=Es(),bc=cn(),{GUID:_c,kWebSocket:xc}=Se(),vc=/^[+/0-9A-Za-z]{22}==$/,Ts=0,Os=1,ks=2,ln=class extends mc{static{o(this,"WebSocketServer")}constructor(t,r){if(super(),t={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:bc,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=nr.createServer((n,i)=>{let s=nr.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=wc(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:o((i,s,a)=>{this.handleUpgrade(i,s,a,n)},"upgrade")})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=Ts}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===ks){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(kt,this);return}if(t&&this.once("close",t),this._state!==Os)if(this._state=Os,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(kt,this):process.nextTick(kt,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{kt(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,n,i){r.on("error",Cs);let s=t.headers["sec-websocket-key"],a=t.headers.upgrade,l=+t.headers["sec-websocket-version"];if(t.method!=="GET"){Ve(this,t,r,405,"Invalid HTTP method");return}if(a===void 0||a.toLowerCase()!=="websocket"){Ve(this,t,r,400,"Invalid Upgrade header");return}if(s===void 0||!vc.test(s)){Ve(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(l!==8&&l!==13){Ve(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(t)){$t(r,400);return}let c=t.headers["sec-websocket-protocol"],f=new Set;if(c!==void 0)try{f=yc.parse(c)}catch{Ve(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let d=t.headers["sec-websocket-extensions"],p={};if(this.options.perMessageDeflate&&d!==void 0){let y=new ze(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let u=Ss.parse(d);u[ze.extensionName]&&(y.accept(u[ze.extensionName]),p[ze.extensionName]=y)}catch{Ve(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let y={origin:t.headers[`${l===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(y,(u,m,w,T)=>{if(!u)return $t(r,m||401,w,T);this.completeUpgrade(p,s,f,t,r,n,i)});return}if(!this.options.verifyClient(y))return $t(r,401)}this.completeUpgrade(p,s,f,t,r,n,i)}completeUpgrade(t,r,n,i,s,a,l){if(!s.readable||!s.writable)return s.destroy();if(s[xc])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Ts)return $t(s,503);let f=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${gc("sha1").update(r+_c).digest("base64")}`],d=new this.options.WebSocket(null,void 0,this.options);if(n.size){let p=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;p&&(f.push(`Sec-WebSocket-Protocol: ${p}`),d._protocol=p)}if(t[ze.extensionName]){let p=t[ze.extensionName].params,y=Ss.format({[ze.extensionName]:[p]});f.push(`Sec-WebSocket-Extensions: ${y}`),d._extensions=t}this.emit("headers",f,i),s.write(f.concat(`\r
|
|
2
2
|
`).join(`\r
|
|
3
3
|
`)),s.removeListener("error",Cs),d.setSocket(s,a,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(d),d.on("close",()=>{this.clients.delete(d),this._shouldEmitClose&&!this.clients.size&&process.nextTick(kt,this)})),l(d,i)}};$s.exports=ln;function wc(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return o(function(){for(let n of Object.keys(t))e.removeListener(n,t[n])},"removeListeners")}o(wc,"addListeners");function kt(e){e._state=ks,e.emit("close")}o(kt,"emitClose");function Cs(){this.destroy()}o(Cs,"socketOnError");function $t(e,t,r,n){r=r||nr.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} ${nr.STATUS_CODES[t]}\r
|
|
4
4
|
`+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
|
|
@@ -21,7 +21,7 @@ tell application "System Events" to get value of property list item "CFBundleNam
|
|
|
21
21
|
\u2022 `)}
|
|
22
22
|
`;break}case ur(this.cause):r="The connection to Gadget closed unexpectedly.";break;case(fr(this.cause)||lr(this.cause)):r=this.cause.message;break;case cr(this.cause):this.cause.length===1?r=String(this.cause[0]):r=this.cause.join(", ");break;default:r=this.cause;break}return this.message+`
|
|
23
23
|
|
|
24
|
-
`+r}},ir=class extends $e{static{o(this,"AuthenticationError")}constructor(t){super(t,"Request authentication failed due to the session expiring while running the command. Please sign-in again.",Ie.NO)}};var sr=class{constructor(t,r,n){this.environment=r;this.endpoint=n;this.ctx=t.child({name:"client"}),this._graphqlWsClient=wi({url:`wss://${r.application.slug}.${R.domains.app}/edit/api/graphql-ws`,keepAlive:(0,mn.default)("10s"),shouldRetry:o(()=>!0,"shouldRetry"),connectionParams:{environment:r.name},webSocketImpl:class extends Ps{static{o(this,"webSocketImpl")}constructor(i,s,a){super(i,s,{signal:t.signal,...a,headers:{...a?.headers,"user-agent":R.versionFull,...Sr(t)}})}},on:{opened:o(()=>{this.ctx.log.trace("opened")},"opened"),ping:o(i=>{this.ctx.log.trace("ping",{received:i})},"ping"),pong:o(i=>{this.ctx.log.trace("pong",{received:i})},"pong"),connecting:o(()=>{switch(this.status){case 1:this.status=2,this.ctx.log.info("reconnecting");break;case 2:this.ctx.log.info("retrying");break;default:this.ctx.log.debug("connecting");break}},"connecting"),connected:o(()=>{this.status===2?this.ctx.log.info("reconnected"):this.ctx.log.debug("connected"),setImmediate(()=>this.status=0)},"connected"),closed:o(()=>{this.status=1,this.ctx.log.debug("disconnected")},"closed"),error:o(i=>{this.status===2?this.ctx.log.error("failed to reconnect",{error:i}):this.ctx.log.error("connection error",{error:i})},"error")}})}static{o(this,"Client")}status=0;ctx;_graphqlWsClient;_sessionUpdateInterval;subscribe(t,{subscription:r,variables:n,onResponse:i,onError:s,onComplete:a=In}){let l={query:r,variables:ae(n)},c=this._graphqlWsClient.on("connected",()=>{this.status===2&&(l.variables=ae(n),t.log.info("re-subscribing to graphql subscription")),this._sessionUpdateInterval=setInterval(()=>{ut(this.ctx).catch(y=>this.ctx.abort(y)).then(y=>{y||this.ctx.abort(new ir(void 0))})},(0,mn.default)("30m")),this.ctx.done.finally(()=>{this._sessionUpdateInterval&&clearInterval(this._sessionUpdateInterval)})}),f=new xt({concurrency:1}),d=o(y=>s(new $e(r,y)),"onError"),p=this._graphqlWsClient.subscribe(l,{next:o(y=>void f.add(()=>i(y)).catch(d),"next"),error:o(y=>void f.add(()=>d(y)),"error"),complete:o(()=>void f.add(()=>a()).catch(d),"complete")});return()=>{t.log.trace("unsubscribing from graphql subscription"),c(),f.clear(),p()}}async execute(t,r){let n=this.environment.application.slug;this.environment.application.multiEnvironmentEnabled?this.environment.type!=="production"&&(n+=`--${this.environment.name}`):this.environment.application.hasSplitEnvironments&&(n+="--development");try{let i=await ft({context:{ctx:t},method:"POST",url:`https://${n}.${R.domains.app}${this.endpoint}`,headers:{...Sr(t),"x-gadget-environment":this.environment.name},json:{query:r.operation,variables:ae(r.variables)},responseType:"json",resolveBodyOnly:!0,throwHttpErrors:!1,...r.http});if(!Qe(i)||!("data"in i)&&!("errors"in i))throw t.log.error("received invalid graphql response",{error:i}),i;return i}catch(i){throw new $e(r.operation,i)}}async dispose(){await this._graphqlWsClient.dispose()}};var At=class{static{o(this,"Api")}ctx;#e;constructor(t,r){this.ctx=t.child({name:"api"}),this.#e=new sr(this.ctx,r,"/api/graphql")}async query({query:t,variables:r,...n}){let i=/query (\w+)/.exec(t)?.[1];Ic(i,"query name not found");let s=this.ctx.child({name:"api",fields:{edit:{query:i}},devFields:{edit:{query:i,variables:ae(r)}}});s.log.info("executing graphql query");let a=await this.#e.execute(s,{operation:t,variables:r,...n,http:{retry:{methods:["POST"]},...n.http}});if(a.errors)throw new $e(t,a.errors);if(!a.data)throw new $e(t,"Query response did not contain data");return a.data}async dispose(){await this.#e.dispose()}};h();var Fs=ne(`
|
|
24
|
+
`+r}},ir=class extends $e{static{o(this,"AuthenticationError")}constructor(t){super(t,"Request authentication failed due to the session expiring while running the command. Please sign-in again.",Ie.NO)}};var sr=class{constructor(t,r,n){this.environment=r;this.endpoint=n;this.ctx=t.child({name:"client"}),this._graphqlWsClient=wi({url:`wss://${r.application.slug}.${R.domains.app}/edit/api/graphql-ws`,keepAlive:(0,mn.default)("10s"),shouldRetry:o(()=>!0,"shouldRetry"),connectionParams:{environment:r.name},webSocketImpl:class extends Ps{static{o(this,"webSocketImpl")}constructor(i,s,a){super(i,s,{signal:t.signal,...a,headers:{...a?.headers,"user-agent":R.versionFull,...Sr(t)}})}},on:{opened:o(()=>{this.ctx.log.trace("opened")},"opened"),ping:o(i=>{this.ctx.log.trace("ping",{received:i})},"ping"),pong:o(i=>{this.ctx.log.trace("pong",{received:i})},"pong"),connecting:o(()=>{switch(this.status){case 1:this.status=2,this.ctx.log.info("reconnecting");break;case 2:this.ctx.log.info("retrying");break;default:this.ctx.log.debug("connecting");break}},"connecting"),connected:o(()=>{this.status===2?this.ctx.log.info("reconnected"):this.ctx.log.debug("connected"),setImmediate(()=>this.status=0)},"connected"),closed:o(()=>{this.status=1,this.ctx.log.debug("disconnected")},"closed"),error:o(i=>{this.status===2?this.ctx.log.error("failed to reconnect",{error:i}):this.ctx.log.error("connection error",{error:i})},"error")}})}static{o(this,"Client")}status=0;ctx;_graphqlWsClient;_sessionUpdateInterval;subscribe(t,{subscription:r,variables:n,onResponse:i,onError:s,onComplete:a=In}){let l={query:r,variables:ae(n)},c=this._graphqlWsClient.on("connected",()=>{this.status===2&&(l.variables=ae(n),t.log.info("re-subscribing to graphql subscription")),this._sessionUpdateInterval=setInterval(()=>{ut(this.ctx).catch(y=>this.ctx.abort(y)).then(y=>{y||this.ctx.abort(new ir(void 0))})},(0,mn.default)("30m")).unref(),this.ctx.done.finally(()=>{this._sessionUpdateInterval&&clearInterval(this._sessionUpdateInterval)})}),f=new xt({concurrency:1}),d=o(y=>s(new $e(r,y)),"onError"),p=this._graphqlWsClient.subscribe(l,{next:o(y=>void f.add(()=>i(y)).catch(d),"next"),error:o(y=>void f.add(()=>d(y)),"error"),complete:o(()=>void f.add(()=>a()).catch(d),"complete")});return()=>{t.log.trace("unsubscribing from graphql subscription"),c(),f.clear(),p()}}async execute(t,r){let n=this.environment.application.slug;this.environment.application.multiEnvironmentEnabled?this.environment.type!=="production"&&(n+=`--${this.environment.name}`):this.environment.application.hasSplitEnvironments&&(n+="--development");try{let i=await ft({context:{ctx:t},method:"POST",url:`https://${n}.${R.domains.app}${this.endpoint}`,headers:{...Sr(t),"x-gadget-environment":this.environment.name},json:{query:r.operation,variables:ae(r.variables)},responseType:"json",resolveBodyOnly:!0,throwHttpErrors:!1,...r.http});if(!Qe(i)||!("data"in i)&&!("errors"in i))throw t.log.error("received invalid graphql response",{error:i}),i;return i}catch(i){throw new $e(r.operation,i)}}async dispose(){await this._graphqlWsClient.dispose()}};var At=class{static{o(this,"Api")}ctx;#e;constructor(t,r){this.ctx=t.child({name:"api"}),this.#e=new sr(this.ctx,r,"/api/graphql")}async query({query:t,variables:r,...n}){let i=/query (\w+)/.exec(t)?.[1];Ic(i,"query name not found");let s=this.ctx.child({name:"api",fields:{edit:{query:i}},devFields:{edit:{query:i,variables:ae(r)}}});s.log.info("executing graphql query");let a=await this.#e.execute(s,{operation:t,variables:r,...n,http:{retry:{methods:["POST"]},...n.http}});if(a.errors)throw new $e(t,a.errors);if(!a.data)throw new $e(t,"Query response did not contain data");return a.data}async dispose(){await this.#e.dispose()}};h();var Fs=ne(`
|
|
25
25
|
query GadgetMetaModels {
|
|
26
26
|
gadgetMeta {
|
|
27
27
|
models {
|
|
@@ -63,4 +63,4 @@ tell application "System Events" to get value of property list item "CFBundleNam
|
|
|
63
63
|
|
|
64
64
|
Once logged in, return to this terminal.
|
|
65
65
|
`})}await n}finally{t?.close()}},"run"),bo=cl;export{ye as a,Eu as b,kc as c,Lh as d,Ie as e,He as f,hn as g,Is as h,ui as i,Ns as j,Fh as k,Ds as l,jh as m,$e as n,ir as o,xt as p,Xn as q,Wm as r,cl as s,bo as t,yo as u,ut as v,Am as w,sr as x,Rc as y,Pd as z,Nd as A,Id as B,Rd as C,M as D,Ip as E,Rp as F,zp as G,ar as H,ft as I};
|
|
66
|
-
//# sourceMappingURL=chunk-
|
|
66
|
+
//# sourceMappingURL=chunk-L5H5T2T6.js.map
|