9remote 2.0.68 → 2.0.70

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/dist/server.cjs CHANGED
@@ -1,38 +1,38 @@
1
1
  const __importMetaUrl = require('url').pathToFileURL(__filename).href;
2
- var WO=Object.create;var Ha=Object.defineProperty;var GO=Object.getOwnPropertyDescriptor;var zO=Object.getOwnPropertyNames;var VO=Object.getPrototypeOf,KO=Object.prototype.hasOwnProperty;var Ce=(r,e)=>()=>(r&&(e=r(r=0)),e);var O=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Jr=(r,e)=>{for(var t in e)Ha(r,t,{get:e[t],enumerable:!0})},bv=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of zO(e))!KO.call(r,i)&&i!==t&&Ha(r,i,{get:()=>e[i],enumerable:!(n=GO(e,i))||n.enumerable});return r};var J=(r,e,t)=>(t=r!=null?WO(VO(r)):{},bv(e||!r||!r.__esModule?Ha(t,"default",{value:r,enumerable:!0}):t,r)),YO=r=>bv(Ha({},"__esModule",{value:!0}),r);var Li={};Jr(Li,{createRouter:()=>Op,jsonErr:()=>ce,jsonOk:()=>ee,parseJsonBody:()=>It});function uM(r){return new Promise(e=>{let t="";r.on("data",n=>t+=n),r.on("end",()=>e(t))})}function ee(r,e={ok:!0}){r.setHeader("Content-Type","application/json"),r.writeHead(200),r.end(JSON.stringify(e))}function ce(r,e,t){r.setHeader("Content-Type","application/json"),r.writeHead(e),r.end(JSON.stringify({error:t}))}async function It(r,e){try{let t=await uM(r);return JSON.parse(t||"{}")}catch{return ce(e,400,"Invalid JSON"),null}}function Op(r,{fallback:e}={}){let t=new Map,n=[];for(let a of r){let c=a.method==="*"?["GET","POST","PUT","DELETE"]:[a.method];for(let u of c)a.path.endsWith("/*")?n.push({...a,prefix:a.path.slice(0,-2),method:u}):t.set(`${u}:${a.path}`,a)}let i=new Set,s=[];for(let a of r)a.public&&(a.path.endsWith("/*")?s.push(a.path.slice(0,-2)):i.add(a.path));function o(a){return i.has(a)?!0:s.some(c=>a.startsWith(c))}return async(a,c)=>{let u=(0,Iv.parse)(a.url,!0),{pathname:p,search:f}=u,m=!!a.headers["cf-connecting-ip"],y=a.socket.remoteAddress==="127.0.0.1"||a.socket.remoteAddress==="::1";if(!o(p)&&(m||!y)){ce(c,403,"Forbidden");return}let _=`${a.method}:${p}`,S=t.get(_);if(S){try{await S.handler(a,c,{pathname:p,query:u.query,search:f})}catch(A){console.error("Error:",a.url,A),ce(c,500,A.message)}return}for(let A of n)if(A.method===a.method&&p.startsWith(A.prefix)){try{await A.handler(a,c,{pathname:p,query:u.query,search:f})}catch(M){console.error("Error:",a.url,M),ce(c,500,M.message)}return}if(e){try{await e(a,c,{pathname:p,search:f})}catch(A){console.error("Error:",a.url,A),ce(c,500,A.message)}return}ce(c,404,"Not found")}}var Iv,Nt=Ce(()=>{Iv=require("url")});function po(r,e={}){return fetch(r,{...e,headers:{...dM,...e.headers}})}var za,Qr,Lv,Di,Pp,pM,kn,oe,Dv,Mp,fM,Ga,Nv,co,Va,lo,Ip,Xn,Bv,jv,Fv,uo,$v,Hv,dM,xt=Ce(()=>{za=J(require("dns"),1),Qr=J(require("path"),1),Lv=J(require("os"),1),Di="9remote",Pp=process.env.NREMOTE_REGISTRY||`https://registry.npmjs.org/${Di}/latest`,pM=`${Di}@latest`,kn=Qr.default.join(Lv.default.homedir(),".9remote"),oe={ROOT:kn,LOGS:Qr.default.join(kn,"logs"),STATE:Qr.default.join(kn,"state"),CONFIG:Qr.default.join(kn,"config"),BIN:Qr.default.join(kn,"bin"),PIDS:Qr.default.join(kn,"pids"),BUFFERS:Qr.default.join(kn,"buffers"),DAEMON:Qr.default.join(kn,"daemon")},Dv=new za.default.promises.Resolver;Dv.setServers(["1.1.1.1","1.0.0.1","8.8.8.8"]);Mp=za.default.lookup,fM=/^(\d{1,3}\.){3}\d{1,3}$|^::1$|^[0-9a-f:]+$/i;za.default.lookup=(r,e,t)=>{if(typeof e=="function"&&(t=e,e={}),r==="localhost"||fM.test(r))return Mp(r,e,t);Dv.resolve4(r).then(n=>{if(!n?.length)return Mp(r,e,t);e.all?t(null,n.map(i=>({address:i,family:4}))):t(null,n[0],4)}).catch(()=>Mp(r,e,t))};Ga=2208,Nv=5173,co="local-ui",Va=[`http://localhost:${Ga}`,`http://127.0.0.1:${Ga}`,`http://localhost:${Nv}`,`http://127.0.0.1:${Nv}`],lo={fileName:"agent.log",rotatedName:"agent.log.1",maxBytes:2*1024*1024,cleanupAfterDays:7},Ip=60,Xn={STOPPED:0,PREPARING:1,CONNECTING:2,TUNNELING:3,VERIFYING:4,READY:5},Bv=5e3,jv=1e3,Fv=6e4,uo={CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN:"1"},$v=["claude","codex","gemini","opencode"],Hv={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode"},dM={Accept:"application/json, text/plain, */*","Accept-Language":"en-US,en;q=0.9","Cache-Control":"no-cache",Pragma:"no-cache","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"}});function hM(){Nr.default.existsSync(Ka)||Nr.default.mkdirSync(Ka,{recursive:!0})}function mM(){try{if(Nr.default.statSync(Ya).size<lo.maxBytes)return;try{Nr.default.rmSync(Xa,{force:!0})}catch{}Nr.default.renameSync(Ya,Xa)}catch{}}function gM(){try{let r=Nr.default.statSync(Xa);Date.now()-r.mtimeMs>lo.cleanupAfterDays*864e5&&Nr.default.rmSync(Xa,{force:!0})}catch{}}function Bp(r){try{mM(),Nr.default.appendFileSync(Ya,r+`
3
- `)}catch{}}function Np(r){return r.map(e=>{if(e instanceof Error)return e.stack||e.message;if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}).join(" ")}function qv(){let r=new Date,e=(t,n=2)=>String(t).padStart(n,"0");return`${e(r.getHours())}:${e(r.getMinutes())}:${e(r.getSeconds())}.${e(r.getMilliseconds(),3)}`}function yM(r){return String(r).replace(vM,"").replace(xM,"").replace(/\s+$/g,"")}function fo(r,e,t){let n=yM(t);if(!n)return;let i=e==="info"?r:`${r}:${e}`,s=`${qv()} [${i}] ${n}`;if(Bp(s),Lp)try{Lp(s)}catch{}}function _M(){process.on("uncaughtException",r=>fo("crash","error",`uncaughtException: ${r?.stack||r?.message||r}`)),process.on("unhandledRejection",r=>{let e=r instanceof Error?r.stack||r.message:String(r);fo("crash","error",`unhandledRejection: ${e}`)}),process.on("exit",r=>Bp(`${qv()} [exit] code=${r} pid=${process.pid}`))}function Wv(){Uv||(Uv=!0,hM(),gM(),Bp(`
4
- === SESSION ${new Date().toISOString()} pid=${process.pid} argv=${process.argv.slice(2).join(" ")} ===`),_M())}function Gv(r){Lp=r}function zv(r=60){try{return Nr.default.readFileSync(Ya,"utf8").split(`
5
- `).filter(Boolean).slice(-r)}catch{return[]}}function On(r){return{info:(...e)=>fo(r,"info",Np(e)),warn:(...e)=>fo(r,"warn",Np(e)),error:(...e)=>fo(r,"error",Np(e))}}var Nr,Dp,Ka,Ya,Xa,Uv,Lp,vM,xM,Bi=Ce(()=>{Nr=J(require("fs"),1),Dp=J(require("path"),1);xt();Ka=oe.LOGS,Ya=Dp.default.join(Ka,lo.fileName),Xa=Dp.default.join(Ka,lo.rotatedName),Uv=!1,Lp=null;vM=/\x1b\[[0-9;]*m/g,xM=/https?:\/\/[^\s]+/g});var Xv=O((i6,jp)=>{"use strict";jp.exports=Yv;jp.exports.preferredCharsets=Yv;var bM=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function wM(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=SM(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function SM(r,e){var t=bM.exec(r);if(!t)return null;var n=t[1],i=1;if(t[2])for(var s=t[2].split(";"),o=0;o<s.length;o++){var a=s[o].trim().split("=");if(a[0]==="q"){i=parseFloat(a[1]);break}}return{charset:n,q:i,i:e}}function EM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=TM(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function TM(r,e,t){var n=0;if(e.charset.toLowerCase()===r.toLowerCase())n|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function Yv(r,e){var t=wM(r===void 0?"*":r||"");if(!e)return t.filter(Kv).sort(Vv).map(CM);var n=e.map(function(s,o){return EM(s,t,o)});return n.filter(Kv).sort(Vv).map(function(s){return e[n.indexOf(s)]})}function Vv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function CM(r){return r.charset}function Kv(r){return r.q>0}});var tx=O((s6,Fp)=>{"use strict";Fp.exports=ex;Fp.exports.preferredEncodings=ex;var AM=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function RM(r){for(var e=r.split(","),t=!1,n=1,i=0,s=0;i<e.length;i++){var o=kM(e[i].trim(),i);o&&(e[s++]=o,t=t||Zv("identity",o),n=Math.min(n,o.q||1))}return t||(e[s++]={encoding:"identity",q:n,i}),e.length=s,e}function kM(r,e){var t=AM.exec(r);if(!t)return null;var n=t[1],i=1;if(t[2])for(var s=t[2].split(";"),o=0;o<s.length;o++){var a=s[o].trim().split("=");if(a[0]==="q"){i=parseFloat(a[1]);break}}return{encoding:n,q:i,i:e}}function OM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=Zv(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function Zv(r,e,t){var n=0;if(e.encoding.toLowerCase()===r.toLowerCase())n|=1;else if(e.encoding!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function ex(r,e){var t=RM(r||"");if(!e)return t.filter(Qv).sort(Jv).map(MM);var n=e.map(function(s,o){return OM(s,t,o)});return n.filter(Qv).sort(Jv).map(function(s){return e[n.indexOf(s)]})}function Jv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function MM(r){return r.encoding}function Qv(r){return r.q>0}});var ox=O((o6,$p)=>{"use strict";$p.exports=sx;$p.exports.preferredLanguages=sx;var PM=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function IM(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=ix(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function ix(r,e){var t=PM.exec(r);if(!t)return null;var n=t[1],i=t[2],s=n;i&&(s+="-"+i);var o=1;if(t[3])for(var a=t[3].split(";"),c=0;c<a.length;c++){var u=a[c].split("=");u[0]==="q"&&(o=parseFloat(u[1]))}return{prefix:n,suffix:i,q:o,i:e,full:s}}function NM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=LM(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function LM(r,e,t){var n=ix(r);if(!n)return null;var i=0;if(e.full.toLowerCase()===n.full.toLowerCase())i|=4;else if(e.prefix.toLowerCase()===n.full.toLowerCase())i|=2;else if(e.full.toLowerCase()===n.prefix.toLowerCase())i|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s:i}}function sx(r,e){var t=IM(r===void 0?"*":r||"");if(!e)return t.filter(nx).sort(rx).map(DM);var n=e.map(function(s,o){return NM(s,t,o)});return n.filter(nx).sort(rx).map(function(s){return e[n.indexOf(s)]})}function rx(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function DM(r){return r.full}function nx(r){return r.q>0}});var fx=O((a6,Hp)=>{"use strict";Hp.exports=ux;Hp.exports.preferredMediaTypes=ux;var BM=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function jM(r){for(var e=qM(r),t=0,n=0;t<e.length;t++){var i=lx(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function lx(r,e){var t=BM.exec(r);if(!t)return null;var n=Object.create(null),i=1,s=t[2],o=t[1];if(t[3])for(var a=WM(t[3]).map(UM),c=0;c<a.length;c++){var u=a[c],p=u[0].toLowerCase(),f=u[1],m=f&&f[0]==='"'&&f[f.length-1]==='"'?f.substr(1,f.length-2):f;if(p==="q"){i=parseFloat(m);break}n[p]=m}return{type:o,subtype:s,params:n,q:i,i:e}}function FM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=$M(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function $M(r,e,t){var n=lx(r),i=0;if(!n)return null;if(e.type.toLowerCase()==n.type.toLowerCase())i|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==n.subtype.toLowerCase())i|=2;else if(e.subtype!="*")return null;var s=Object.keys(e.params);if(s.length>0)if(s.every(function(o){return e.params[o]=="*"||(e.params[o]||"").toLowerCase()==(n.params[o]||"").toLowerCase()}))i|=1;else return null;return{i:t,o:e.i,q:e.q,s:i}}function ux(r,e){var t=jM(r===void 0?"*/*":r||"");if(!e)return t.filter(cx).sort(ax).map(HM);var n=e.map(function(s,o){return FM(s,t,o)});return n.filter(cx).sort(ax).map(function(s){return e[n.indexOf(s)]})}function ax(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function HM(r){return r.type+"/"+r.subtype}function cx(r){return r.q>0}function px(r){for(var e=0,t=0;(t=r.indexOf('"',t))!==-1;)e++,t++;return e}function UM(r){var e=r.indexOf("="),t,n;return e===-1?t=r:(t=r.substr(0,e),n=r.substr(e+1)),[t,n]}function qM(r){for(var e=r.split(","),t=1,n=0;t<e.length;t++)px(e[n])%2==0?e[++n]=e[t]:e[n]+=","+e[t];return e.length=n+1,e}function WM(r){for(var e=r.split(";"),t=1,n=0;t<e.length;t++)px(e[n])%2==0?e[++n]=e[t]:e[n]+=";"+e[t];e.length=n+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}});var dx=O((c6,Up)=>{"use strict";var GM=Xv(),zM=tx(),VM=ox(),KM=fx();Up.exports=ue;Up.exports.Negotiator=ue;function ue(r){if(!(this instanceof ue))return new ue(r);this.request=r}ue.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};ue.prototype.charsets=function(e){return GM(this.request.headers["accept-charset"],e)};ue.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};ue.prototype.encodings=function(e){return zM(this.request.headers["accept-encoding"],e)};ue.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};ue.prototype.languages=function(e){return VM(this.request.headers["accept-language"],e)};ue.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};ue.prototype.mediaTypes=function(e){return KM(this.request.headers.accept,e)};ue.prototype.preferredCharset=ue.prototype.charset;ue.prototype.preferredCharsets=ue.prototype.charsets;ue.prototype.preferredEncoding=ue.prototype.encoding;ue.prototype.preferredEncodings=ue.prototype.encodings;ue.prototype.preferredLanguage=ue.prototype.language;ue.prototype.preferredLanguages=ue.prototype.languages;ue.prototype.preferredMediaType=ue.prototype.mediaType;ue.prototype.preferredMediaTypes=ue.prototype.mediaTypes});var hx=O((l6,YM)=>{YM.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var gx=O((u6,mx)=>{mx.exports=hx()});var yx=O(Lt=>{"use strict";var Ja=gx(),XM=require("path").extname,vx=/^\s*([^;\s]*)(?:;|\s|$)/,JM=/^text\//i;Lt.charset=xx;Lt.charsets={lookup:xx};Lt.contentType=QM;Lt.extension=ZM;Lt.extensions=Object.create(null);Lt.lookup=eP;Lt.types=Object.create(null);tP(Lt.extensions,Lt.types);function xx(r){if(!r||typeof r!="string")return!1;var e=vx.exec(r),t=e&&Ja[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&JM.test(e[1])?"UTF-8":!1}function QM(r){if(!r||typeof r!="string")return!1;var e=r.indexOf("/")===-1?Lt.lookup(r):r;if(!e)return!1;if(e.indexOf("charset")===-1){var t=Lt.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function ZM(r){if(!r||typeof r!="string")return!1;var e=vx.exec(r),t=e&&Lt.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function eP(r){if(!r||typeof r!="string")return!1;var e=XM("x."+r).toLowerCase().substr(1);return e&&Lt.types[e]||!1}function tP(r,e){var t=["nginx","apache",void 0,"iana"];Object.keys(Ja).forEach(function(i){var s=Ja[i],o=s.extensions;if(!(!o||!o.length)){r[i]=o;for(var a=0;a<o.length;a++){var c=o[a];if(e[c]){var u=t.indexOf(Ja[e[c]].source),p=t.indexOf(s.source);if(e[c]!=="application/octet-stream"&&(u>p||u===p&&e[c].substr(0,12)==="application/"))continue}e[c]=i}}})}});var Qa=O((f6,_x)=>{"use strict";var rP=dx(),nP=yx();_x.exports=zt;function zt(r){if(!(this instanceof zt))return new zt(r);this.headers=r.headers,this.negotiator=new rP(r)}zt.prototype.type=zt.prototype.types=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}if(!e||e.length===0)return this.negotiator.mediaTypes();if(!this.headers.accept)return e[0];var n=e.map(iP),i=this.negotiator.mediaTypes(n.filter(sP)),s=i[0];return s?e[n.indexOf(s)]:!1};zt.prototype.encoding=zt.prototype.encodings=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.encodings():this.negotiator.encodings(e)[0]||!1};zt.prototype.charset=zt.prototype.charsets=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.charsets():this.negotiator.charsets(e)[0]||!1};zt.prototype.lang=zt.prototype.langs=zt.prototype.language=zt.prototype.languages=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.languages():this.negotiator.languages(e)[0]||!1};function iP(r){return r.indexOf("/")===-1?nP.lookup(r):r}function sP(r){return typeof r=="string"}});var Wp=O((bx,wx)=>{var ho=require("crypto"),qp=function(){};qp.prototype.getRandomBytes=function(r){var e=4096,t=this;if(r=r||12,r>e)return ho.randomBytes(r);var n=parseInt(e/r),i=parseInt(n*.85);if(!i||(this.bytesBufferIndex==null&&(this.bytesBufferIndex=-1),this.bytesBufferIndex==n&&(this.bytesBuffer=null,this.bytesBufferIndex=-1),(this.bytesBufferIndex==-1||this.bytesBufferIndex>i)&&(this.isGeneratingBytes||(this.isGeneratingBytes=!0,ho.randomBytes(e,function(o,a){t.bytesBuffer=a,t.bytesBufferIndex=0,t.isGeneratingBytes=!1})),this.bytesBufferIndex==-1)))return ho.randomBytes(r);var s=this.bytesBuffer.slice(r*this.bytesBufferIndex,r*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,s};qp.prototype.generateId=function(){var r=Buffer.alloc(15);return r.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,r.writeInt32BE(this.sequenceNumber,11),ho.randomBytes?this.getRandomBytes(12).copy(r):[0,4,8].forEach(function(e){r.writeInt32BE(Math.random()*Math.pow(2,32)|0,e)}),r.toString("base64").replace(/\//g,"_").replace(/\+/g,"-")):Math.abs(Math.random()*Math.random()*Date.now()|0).toString()+Math.abs(Math.random()*Math.random()*Date.now()|0).toString()};bx=wx.exports=new qp});var Za=O(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.ERROR_PACKET=Mn.PACKET_TYPES_REVERSE=Mn.PACKET_TYPES=void 0;var Lr=Object.create(null);Mn.PACKET_TYPES=Lr;Lr.open="0";Lr.close="1";Lr.ping="2";Lr.pong="3";Lr.message="4";Lr.upgrade="5";Lr.noop="6";var Sx=Object.create(null);Mn.PACKET_TYPES_REVERSE=Sx;Object.keys(Lr).forEach(r=>{Sx[Lr[r]]=r});var oP={type:"error",data:"parser error"};Mn.ERROR_PACKET=oP});var Tx=O(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.encodePacket=void 0;ji.encodePacketToBinary=lP;var aP=Za(),cP=({type:r,data:e},t,n)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?n(t?e:"b"+Ex(e,!0).toString("base64")):n(aP.PACKET_TYPES[r]+(e||""));ji.encodePacket=cP;var Ex=(r,e)=>Buffer.isBuffer(r)||r instanceof Uint8Array&&!e?r:r instanceof ArrayBuffer?Buffer.from(r):Buffer.from(r.buffer,r.byteOffset,r.byteLength),Gp;function lP(r,e){if(r.data instanceof ArrayBuffer||ArrayBuffer.isView(r.data))return e(Ex(r.data,!1));(0,ji.encodePacket)(r,!0,t=>{Gp||(Gp=new TextEncoder),e(Gp.encode(t))})}});var Ax=O(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.decodePacket=void 0;var ec=Za(),uP=(r,e)=>{if(typeof r!="string")return{type:"message",data:Cx(r,e)};let t=r.charAt(0);if(t==="b"){let n=Buffer.from(r.substring(1),"base64");return{type:"message",data:Cx(n,e)}}return ec.PACKET_TYPES_REVERSE[t]?r.length>1?{type:ec.PACKET_TYPES_REVERSE[t],data:r.substring(1)}:{type:ec.PACKET_TYPES_REVERSE[t]}:ec.ERROR_PACKET};tc.decodePacket=uP;var Cx=(r,e)=>e==="arraybuffer"?r instanceof ArrayBuffer?r:Buffer.isBuffer(r)?r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength):r.buffer:Buffer.isBuffer(r)?r:Buffer.from(r)});var mo=O(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.decodePayload=Dt.decodePacket=Dt.encodePayload=Dt.encodePacket=Dt.protocol=void 0;Dt.createPacketEncoderStream=dP;Dt.createPacketDecoderStream=hP;var Vp=Tx();Object.defineProperty(Dt,"encodePacket",{enumerable:!0,get:function(){return Vp.encodePacket}});var Kp=Ax();Object.defineProperty(Dt,"decodePacket",{enumerable:!0,get:function(){return Kp.decodePacket}});var Rx=Za(),kx="",pP=(r,e)=>{let t=r.length,n=new Array(t),i=0;r.forEach((s,o)=>{(0,Vp.encodePacket)(s,!1,a=>{n[o]=a,++i===t&&e(n.join(kx))})})};Dt.encodePayload=pP;var fP=(r,e)=>{let t=r.split(kx),n=[];for(let i=0;i<t.length;i++){let s=(0,Kp.decodePacket)(t[i],e);if(n.push(s),s.type==="error")break}return n};Dt.decodePayload=fP;function dP(){return new TransformStream({transform(r,e){(0,Vp.encodePacketToBinary)(r,t=>{let n=t.length,i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);let s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,n)}else{i=new Uint8Array(9);let s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(n))}r.data&&typeof r.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}var zp;function rc(r){return r.reduce((e,t)=>e+t.length,0)}function nc(r,e){if(r[0].length===e)return r.shift();let t=new Uint8Array(e),n=0;for(let i=0;i<e;i++)t[i]=r[0][n++],n===r[0].length&&(r.shift(),n=0);return r.length&&n<r[0].length&&(r[0]=r[0].slice(n)),t}function hP(r,e){zp||(zp=new TextDecoder);let t=[],n=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(n===0){if(rc(t)<1)break;let c=nc(t,1);s=(c[0]&128)===128,i=c[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(rc(t)<2)break;let c=nc(t,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if(rc(t)<8)break;let c=nc(t,8),u=new DataView(c.buffer,c.byteOffset,c.length),p=u.getUint32(0);if(p>Math.pow(2,21)-1){a.enqueue(Rx.ERROR_PACKET);break}i=p*Math.pow(2,32)+u.getUint32(4),n=3}else{if(rc(t)<i)break;let c=nc(t,i);a.enqueue((0,Kp.decodePacket)(s?c:zp.decode(c),e)),n=0}if(i===0||i>r){a.enqueue(Rx.ERROR_PACKET);break}}}})}Dt.protocol=4});var Ix=O((v6,Px)=>{var Pn=String.fromCharCode;function Ox(r){for(var e=[],t=0,n=r.length,i,s;t<n;)i=r.charCodeAt(t++),i>=55296&&i<=56319&&t<n?(s=r.charCodeAt(t++),(s&64512)==56320?e.push(((i&1023)<<10)+(s&1023)+65536):(e.push(i),t--)):e.push(i);return e}function mP(r){for(var e=r.length,t=-1,n,i="";++t<e;)n=r[t],n>65535&&(n-=65536,i+=Pn(n>>>10&1023|55296),n=56320|n&1023),i+=Pn(n);return i}function Mx(r,e){if(r>=55296&&r<=57343){if(e)throw Error("Lone surrogate U+"+r.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function Yp(r,e){return Pn(r>>e&63|128)}function gP(r,e){if((r&4294967168)==0)return Pn(r);var t="";return(r&4294965248)==0?t=Pn(r>>6&31|192):(r&4294901760)==0?(Mx(r,e)||(r=65533),t=Pn(r>>12&15|224),t+=Yp(r,6)):(r&4292870144)==0&&(t=Pn(r>>18&7|240),t+=Yp(r,12),t+=Yp(r,6)),t+=Pn(r&63|128),t}function vP(r,e){e=e||{};for(var t=e.strict!==!1,n=Ox(r),i=n.length,s=-1,o,a="";++s<i;)o=n[s],a+=gP(o,t);return a}function Fi(){if(In>=sc)throw Error("Invalid byte index");var r=ic[In]&255;if(In++,(r&192)==128)return r&63;throw Error("Invalid continuation byte")}function xP(r){var e,t,n,i,s;if(In>sc)throw Error("Invalid byte index");if(In==sc)return!1;if(e=ic[In]&255,In++,(e&128)==0)return e;if((e&224)==192){if(t=Fi(),s=(e&31)<<6|t,s>=128)return s;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=Fi(),n=Fi(),s=(e&15)<<12|t<<6|n,s>=2048)return Mx(s,r)?s:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=Fi(),n=Fi(),i=Fi(),s=(e&7)<<18|t<<12|n<<6|i,s>=65536&&s<=1114111))return s;throw Error("Invalid UTF-8 detected")}var ic,sc,In;function yP(r,e){e=e||{};var t=e.strict!==!1;ic=Ox(r),sc=ic.length,In=0;for(var n=[],i;(i=xP(t))!==!1;)n.push(i);return mP(n)}Px.exports={version:"2.1.2",encode:vP,decode:yP}});var Hx=O(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.packets=ut.protocol=void 0;ut.encodePacket=Xp;ut.encodeBase64Packet=Dx;ut.decodePacket=Jp;ut.decodeBase64Packet=Bx;ut.encodePayload=SP;ut.decodePayload=TP;ut.encodePayloadAsBinary=Fx;ut.decodePayloadAsBinary=$x;var Lx=Ix();ut.protocol=3;var _P=r=>{for(let e of r)if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return!0;return!1};ut.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var $i=Object.keys(ut.packets),br={type:"error",data:"parser error"},bP=Buffer.concat([]);function Xp(r,e,t,n){if(typeof e=="function"&&(n=e,e=null),typeof t=="function"&&(n=t,t=null),Buffer.isBuffer(r.data))return Nx(r,e,n);if(r.data&&(r.data.buffer||r.data)instanceof ArrayBuffer)return Nx({type:r.type,data:Qp(r.data)},e,n);var i=ut.packets[r.type];return r.data!==void 0&&(i+=t?Lx.encode(String(r.data),{strict:!1}):String(r.data)),n(""+i)}function Nx(r,e,t){if(!e)return Dx(r,t);var n=r.data,i=Buffer.allocUnsafe(1);return i[0]=ut.packets[r.type],t(Buffer.concat([i,n]))}function Dx(r,e){var t=Buffer.isBuffer(r.data)?r.data:Qp(r.data),n="b"+ut.packets[r.type];return n+=t.toString("base64"),e(n)}function Jp(r,e,t){if(r===void 0)return br;let n;if(typeof r=="string")return n=r.charAt(0),n==="b"?Bx(r.slice(1),e):t&&(r=wP(r),r===!1)||Number(n)!=n||!$i[n]?br:r.length>1?{type:$i[n],data:r.slice(1)}:{type:$i[n]};if(e==="arraybuffer"){var i=new Uint8Array(r);return n=i[0],{type:$i[n],data:i.buffer.slice(1)}}return r instanceof ArrayBuffer&&(r=Qp(r)),n=r[0],{type:$i[n],data:r.slice(1)}}function wP(r){try{r=Lx.decode(r,{strict:!1})}catch{return!1}return r}function Bx(r,e){var t=$i[r.charAt(0)],n=Buffer.from(r.slice(1),"base64");if(e==="arraybuffer"){for(var i=new Uint8Array(n.length),s=0;s<i.length;s++)i[s]=n[s];n=i.buffer}return{type:t,data:n}}function SP(r,e,t){if(typeof e=="function"&&(t=e,e=null),e&&_P(r))return Fx(r,t);if(!r.length)return t("0:");function n(i,s){Xp(i,e,!1,function(o){s(null,EP(o))})}jx(r,n,function(i,s){return t(s.join(""))})}function EP(r){return r.length+":"+r}function jx(r,e,t){let n=new Array(r.length),i=0;for(let s=0;s<r.length;s++)e(r[s],(o,a)=>{n[s]=a,++i===r.length&&t(null,n)})}function TP(r,e,t){if(typeof r!="string")return $x(r,e,t);if(typeof e=="function"&&(t=e,e=null),r==="")return t(br,0,1);for(var n="",i,s,o,a=0,c=r.length;a<c;a++){var u=r.charAt(a);if(u!==":"){n+=u;continue}if(n===""||n!=(i=Number(n))||(s=r.slice(a+1,a+1+i),n!=s.length))return t(br,0,1);if(s.length){if(o=Jp(s,e,!1),br.type===o.type&&br.data===o.data)return t(br,0,1);var p=t(o,a+i,c);if(p===!1)return}a+=i,n=""}if(n!=="")return t(br,0,1)}function CP(r){for(var e="",t=0,n=r.length;t<n;t++)e+=String.fromCharCode(r[t]);return e}function AP(r){for(var e=Buffer.allocUnsafe(r.length),t=0,n=r.length;t<n;t++)e.writeUInt8(r.charCodeAt(t),t);return e}function Qp(r){var e=r.byteLength||r.length,t=r.byteOffset||0;return Buffer.from(r.buffer||r,t,e)}function Fx(r,e){if(!r.length)return e(bP);jx(r,RP,function(t,n){return e(Buffer.concat(n))})}function RP(r,e){function t(n){var i=""+n.length,s;if(typeof n=="string"){s=Buffer.allocUnsafe(i.length+2),s[0]=0;for(var o=0;o<i.length;o++)s[o+1]=parseInt(i[o],10);return s[s.length-1]=255,e(null,Buffer.concat([s,AP(n)]))}s=Buffer.allocUnsafe(i.length+2),s[0]=1;for(var o=0;o<i.length;o++)s[o+1]=parseInt(i[o],10);s[s.length-1]=255,e(null,Buffer.concat([s,n]))}Xp(r,!0,!0,t)}function $x(r,e,t){typeof e=="function"&&(t=e,e=null);for(var n=r,i=[],s;n.length>0;){var o="",a=n[0]===0;for(s=1;n[s]!==255;s++){if(o.length>310)return t(br,0,1);o+=""+n[s]}n=n.slice(o.length+1);var c=parseInt(o,10),u=n.slice(1,c+1);a&&(u=CP(u)),i.push(u),n=n.slice(c+1)}var p=i.length;for(s=0;s<p;s++){var f=i[s];t(Jp(f,e,!0),s,p)}}});var qx=O((y6,Ux)=>{var Hi=1e3,Ui=Hi*60,qi=Ui*60,Jn=qi*24,kP=Jn*7,OP=Jn*365.25;Ux.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return MP(r);if(t==="number"&&isFinite(r))return e.long?IP(r):PP(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function MP(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*OP;case"weeks":case"week":case"w":return t*kP;case"days":case"day":case"d":return t*Jn;case"hours":case"hour":case"hrs":case"hr":case"h":return t*qi;case"minutes":case"minute":case"mins":case"min":case"m":return t*Ui;case"seconds":case"second":case"secs":case"sec":case"s":return t*Hi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function PP(r){var e=Math.abs(r);return e>=Jn?Math.round(r/Jn)+"d":e>=qi?Math.round(r/qi)+"h":e>=Ui?Math.round(r/Ui)+"m":e>=Hi?Math.round(r/Hi)+"s":r+"ms"}function IP(r){var e=Math.abs(r);return e>=Jn?oc(r,e,Jn,"day"):e>=qi?oc(r,e,qi,"hour"):e>=Ui?oc(r,e,Ui,"minute"):e>=Hi?oc(r,e,Hi,"second"):r+" ms"}function oc(r,e,t,n){var i=e>=t*1.5;return Math.round(r/t)+" "+n+(i?"s":"")}});var Zp=O((_6,Wx)=>{function NP(r){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=a,t.humanize=qx(),t.destroy=u,Object.keys(r).forEach(p=>{t[p]=r[p]}),t.names=[],t.skips=[],t.formatters={};function e(p){let f=0;for(let m=0;m<p.length;m++)f=(f<<5)-f+p.charCodeAt(m),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(p){let f,m=null,y,_;function S(...A){if(!S.enabled)return;let M=S,L=Number(new Date),N=L-(f||L);M.diff=N,M.prev=f,M.curr=L,f=L,A[0]=t.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let j=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(q,G)=>{if(q==="%%")return"%";j++;let P=t.formatters[G];if(typeof P=="function"){let $=A[j];q=P.call(M,$),A.splice(j,1),j--}return q}),t.formatArgs.call(M,A),(M.log||t.log).apply(M,A)}return S.namespace=p,S.useColors=t.useColors(),S.color=t.selectColor(p),S.extend=n,S.destroy=t.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(y!==t.namespaces&&(y=t.namespaces,_=t.enabled(p)),_),set:A=>{m=A}}),typeof t.init=="function"&&t.init(S),S}function n(p,f){let m=t(this.namespace+(typeof f>"u"?":":f)+p);return m.log=this.log,m}function i(p){t.save(p),t.namespaces=p,t.names=[],t.skips=[];let f=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of f)m[0]==="-"?t.skips.push(m.slice(1)):t.names.push(m)}function s(p,f){let m=0,y=0,_=-1,S=0;for(;m<p.length;)if(y<f.length&&(f[y]===p[m]||f[y]==="*"))f[y]==="*"?(_=y,S=m,y++):(m++,y++);else if(_!==-1)y=_+1,S++,m=S;else return!1;for(;y<f.length&&f[y]==="*";)y++;return y===f.length}function o(){let p=[...t.names,...t.skips.map(f=>"-"+f)].join(",");return t.enable(""),p}function a(p){for(let f of t.skips)if(s(p,f))return!1;for(let f of t.names)if(s(p,f))return!0;return!1}function c(p){return p instanceof Error?p.stack||p.message:p}function u(){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 t.enable(t.load()),t}Wx.exports=NP});var Gx=O((Bt,ac)=>{Bt.formatArgs=DP;Bt.save=BP;Bt.load=jP;Bt.useColors=LP;Bt.storage=FP();Bt.destroy=(()=>{let r=!1;return()=>{r||(r=!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`."))}})();Bt.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 LP(){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 r;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&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function DP(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+ac.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,n=0;r[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(t++,i==="%c"&&(n=t))}),r.splice(n,0,e)}Bt.log=console.debug||console.log||(()=>{});function BP(r){try{r?Bt.storage.setItem("debug",r):Bt.storage.removeItem("debug")}catch{}}function jP(){let r;try{r=Bt.storage.getItem("debug")||Bt.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function FP(){try{return localStorage}catch{}}ac.exports=Zp()(Bt);var{formatters:$P}=ac.exports;$P.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Vx=O((b6,zx)=>{"use strict";zx.exports=(r,e)=>{e=e||process.argv;let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1?!0:n<i)}});var Yx=O((w6,Kx)=>{"use strict";var HP=require("os"),wr=Vx(),yt=process.env,Wi;wr("no-color")||wr("no-colors")||wr("color=false")?Wi=!1:(wr("color")||wr("colors")||wr("color=true")||wr("color=always"))&&(Wi=!0);"FORCE_COLOR"in yt&&(Wi=yt.FORCE_COLOR.length===0||parseInt(yt.FORCE_COLOR,10)!==0);function UP(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function qP(r){if(Wi===!1)return 0;if(wr("color=16m")||wr("color=full")||wr("color=truecolor"))return 3;if(wr("color=256"))return 2;if(r&&!r.isTTY&&Wi!==!0)return 0;let e=Wi?1:0;if(process.platform==="win32"){let t=HP.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in yt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(t=>t in yt)||yt.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in yt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(yt.TEAMCITY_VERSION)?1:0;if(yt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in yt){let t=parseInt((yt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(yt.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(yt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(yt.TERM)||"COLORTERM"in yt?1:(yt.TERM==="dumb",e)}function ef(r){let e=qP(r);return UP(e)}Kx.exports={supportsColor:ef,stdout:ef(process.stdout),stderr:ef(process.stderr)}});var Jx=O((pt,lc)=>{var WP=require("tty"),cc=require("util");pt.init=JP;pt.log=KP;pt.formatArgs=zP;pt.save=YP;pt.load=XP;pt.useColors=GP;pt.destroy=cc.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");pt.colors=[6,2,3,4,5,1];try{let r=Yx();r&&(r.stderr||r).level>=2&&(pt.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{}pt.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),r[t]=n,r},{});function GP(){return"colors"in pt.inspectOpts?!!pt.inspectOpts.colors:WP.isatty(process.stderr.fd)}function zP(r){let{namespace:e,useColors:t}=this;if(t){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;r[0]=s+r[0].split(`
2
+ var oM=Object.create;var Ga=Object.defineProperty;var aM=Object.getOwnPropertyDescriptor;var cM=Object.getOwnPropertyNames;var lM=Object.getPrototypeOf,uM=Object.prototype.hasOwnProperty;var Re=(r,e)=>()=>(r&&(e=r(r=0)),e);var O=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),tn=(r,e)=>{for(var t in e)Ga(r,t,{get:e[t],enumerable:!0})},Rv=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of cM(e))!uM.call(r,s)&&s!==t&&Ga(r,s,{get:()=>e[s],enumerable:!(n=aM(e,s))||n.enumerable});return r};var J=(r,e,t)=>(t=r!=null?oM(lM(r)):{},Rv(e||!r||!r.__esModule?Ga(t,"default",{value:r,enumerable:!0}):t,r)),pM=r=>Rv(Ga({},"__esModule",{value:!0}),r);var Fs={};tn(Fs,{createRouter:()=>Lp,jsonErr:()=>le,jsonOk:()=>ee,parseJsonBody:()=>Bt});function CM(r){return new Promise(e=>{let t="";r.on("data",n=>t+=n),r.on("end",()=>e(t))})}function ee(r,e={ok:!0}){r.setHeader("Content-Type","application/json"),r.writeHead(200),r.end(JSON.stringify(e))}function le(r,e,t){r.setHeader("Content-Type","application/json"),r.writeHead(e),r.end(JSON.stringify({error:t}))}async function Bt(r,e){try{let t=await CM(r);return JSON.parse(t||"{}")}catch{return le(e,400,"Invalid JSON"),null}}function Lp(r,{fallback:e}={}){let t=new Map,n=[];for(let a of r){let c=a.method==="*"?["GET","POST","PUT","DELETE"]:[a.method];for(let l of c)a.path.endsWith("/*")?n.push({...a,prefix:a.path.slice(0,-2),method:l}):t.set(`${l}:${a.path}`,a)}let s=new Set,i=[];for(let a of r)a.public&&(a.path.endsWith("/*")?i.push(a.path.slice(0,-2)):s.add(a.path));function o(a){return s.has(a)?!0:i.some(c=>a.startsWith(c))}return async(a,c)=>{let l=(0,Hv.parse)(a.url,!0),{pathname:p,search:f}=l,h=!!a.headers["cf-connecting-ip"],x=a.socket.remoteAddress==="127.0.0.1"||a.socket.remoteAddress==="::1";if(!o(p)&&(h||!x)){le(c,403,"Forbidden");return}let _=`${a.method}:${p}`,S=t.get(_);if(S){try{await S.handler(a,c,{pathname:p,query:l.query,search:f})}catch(A){console.error("Error:",a.url,A),le(c,500,A.message)}return}for(let A of n)if(A.method===a.method&&p.startsWith(A.prefix)){try{await A.handler(a,c,{pathname:p,query:l.query,search:f})}catch(M){console.error("Error:",a.url,M),le(c,500,M.message)}return}if(e){try{await e(a,c,{pathname:p,search:f})}catch(A){console.error("Error:",a.url,A),le(c,500,A.message)}return}le(c,404,"Not found")}}var Hv,jt=Re(()=>{Hv=require("url")});function go(r,e={}){return fetch(r,{...e,headers:{...kM,...e.headers}})}var Xa,rn,Uv,Hs,Bp,AM,Pn,oe,qv,Dp,RM,Ya,$v,fo,Ja,ho,jp,Zn,Wv,Gv,zv,mo,Vv,Kv,kM,_t=Re(()=>{Xa=J(require("dns"),1),rn=J(require("path"),1),Uv=J(require("os"),1),Hs="9remote",Bp=process.env.NREMOTE_REGISTRY||`https://registry.npmjs.org/${Hs}/latest`,AM=`${Hs}@latest`,Pn=rn.default.join(Uv.default.homedir(),".9remote"),oe={ROOT:Pn,LOGS:rn.default.join(Pn,"logs"),STATE:rn.default.join(Pn,"state"),CONFIG:rn.default.join(Pn,"config"),BIN:rn.default.join(Pn,"bin"),PIDS:rn.default.join(Pn,"pids"),BUFFERS:rn.default.join(Pn,"buffers"),DAEMON:rn.default.join(Pn,"daemon")},qv=new Xa.default.promises.Resolver;qv.setServers(["1.1.1.1","1.0.0.1","8.8.8.8"]);Dp=Xa.default.lookup,RM=/^(\d{1,3}\.){3}\d{1,3}$|^::1$|^[0-9a-f:]+$/i;Xa.default.lookup=(r,e,t)=>{if(typeof e=="function"&&(t=e,e={}),r==="localhost"||RM.test(r))return Dp(r,e,t);qv.resolve4(r).then(n=>{if(!n?.length)return Dp(r,e,t);e.all?t(null,n.map(s=>({address:s,family:4}))):t(null,n[0],4)}).catch(()=>Dp(r,e,t))};Ya=2208,$v=5173,fo="local-ui",Ja=[`http://localhost:${Ya}`,`http://127.0.0.1:${Ya}`,`http://localhost:${$v}`,`http://127.0.0.1:${$v}`],ho={fileName:"agent.log",rotatedName:"agent.log.1",maxBytes:2*1024*1024,cleanupAfterDays:7},jp=60,Zn={STOPPED:0,PREPARING:1,CONNECTING:2,TUNNELING:3,VERIFYING:4,READY:5},Wv=5e3,Gv=1e3,zv=6e4,mo={CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN:"1"},Vv=["claude","codex","gemini","opencode","grok","cursor","antigravity","kiro","copilot","codebuddy","factory","qoder","rovodev","hermes","amp","pi"],Kv={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode",grok:"Grok",cursor:"Cursor",antigravity:"Antigravity",kiro:"Kiro",copilot:"Copilot",codebuddy:"CodeBuddy",factory:"Factory",qoder:"Qoder",rovodev:"Rovo Dev",hermes:"Hermes",amp:"Amp",pi:"Pi"},kM={Accept:"application/json, text/plain, */*","Accept-Language":"en-US,en;q=0.9","Cache-Control":"no-cache",Pragma:"no-cache","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"}});function OM(){jr.default.existsSync(Qa)||jr.default.mkdirSync(Qa,{recursive:!0})}function MM(){try{if(jr.default.statSync(Za).size<ho.maxBytes)return;try{jr.default.rmSync(ec,{force:!0})}catch{}jr.default.renameSync(Za,ec)}catch{}}function PM(){try{let r=jr.default.statSync(ec);Date.now()-r.mtimeMs>ho.cleanupAfterDays*864e5&&jr.default.rmSync(ec,{force:!0})}catch{}}function Up(r){try{MM(),jr.default.appendFileSync(Za,r+`
3
+ `)}catch{}}function Fp(r){return r.map(e=>{if(e instanceof Error)return e.stack||e.message;if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}).join(" ")}function Xv(){let r=new Date,e=(t,n=2)=>String(t).padStart(n,"0");return`${e(r.getHours())}:${e(r.getMinutes())}:${e(r.getSeconds())}.${e(r.getMilliseconds(),3)}`}function LM(r){return String(r).replace(IM,"").replace(NM,"").replace(/\s+$/g,"")}function vo(r,e,t){let n=LM(t);if(!n)return;let s=e==="info"?r:`${r}:${e}`,i=`${Xv()} [${s}] ${n}`;if(Up(i),Hp)try{Hp(i)}catch{}}function DM(){process.on("uncaughtException",r=>vo("crash","error",`uncaughtException: ${r?.stack||r?.message||r}`)),process.on("unhandledRejection",r=>{let e=r instanceof Error?r.stack||r.message:String(r);vo("crash","error",`unhandledRejection: ${e}`)}),process.on("exit",r=>Up(`${Xv()} [exit] code=${r} pid=${process.pid}`))}function Jv(){Yv||(Yv=!0,OM(),PM(),Up(`
4
+ === SESSION ${new Date().toISOString()} pid=${process.pid} argv=${process.argv.slice(2).join(" ")} ===`),DM())}function Qv(r){Hp=r}function Zv(r=60){try{return jr.default.readFileSync(Za,"utf8").split(`
5
+ `).filter(Boolean).slice(-r)}catch{return[]}}function In(r){return{info:(...e)=>vo(r,"info",Fp(e)),warn:(...e)=>vo(r,"warn",Fp(e)),error:(...e)=>vo(r,"error",Fp(e))}}var jr,$p,Qa,Za,ec,Yv,Hp,IM,NM,$s=Re(()=>{jr=J(require("fs"),1),$p=J(require("path"),1);_t();Qa=oe.LOGS,Za=$p.default.join(Qa,ho.fileName),ec=$p.default.join(Qa,ho.rotatedName),Yv=!1,Hp=null;IM=/\x1b\[[0-9;]*m/g,NM=/https?:\/\/[^\s]+/g});var ny=O((q6,qp)=>{"use strict";qp.exports=ry;qp.exports.preferredCharsets=ry;var BM=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function jM(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var s=FM(e[t].trim(),t);s&&(e[n++]=s)}return e.length=n,e}function FM(r,e){var t=BM.exec(r);if(!t)return null;var n=t[1],s=1;if(t[2])for(var i=t[2].split(";"),o=0;o<i.length;o++){var a=i[o].trim().split("=");if(a[0]==="q"){s=parseFloat(a[1]);break}}return{charset:n,q:s,i:e}}function HM(r,e,t){for(var n={o:-1,q:0,s:0},s=0;s<e.length;s++){var i=$M(r,e[s],t);i&&(n.s-i.s||n.q-i.q||n.o-i.o)<0&&(n=i)}return n}function $M(r,e,t){var n=0;if(e.charset.toLowerCase()===r.toLowerCase())n|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function ry(r,e){var t=jM(r===void 0?"*":r||"");if(!e)return t.filter(ty).sort(ey).map(UM);var n=e.map(function(i,o){return HM(i,t,o)});return n.filter(ty).sort(ey).map(function(i){return e[n.indexOf(i)]})}function ey(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function UM(r){return r.charset}function ty(r){return r.q>0}});var cy=O((W6,Wp)=>{"use strict";Wp.exports=ay;Wp.exports.preferredEncodings=ay;var qM=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function WM(r){for(var e=r.split(","),t=!1,n=1,s=0,i=0;s<e.length;s++){var o=GM(e[s].trim(),s);o&&(e[i++]=o,t=t||oy("identity",o),n=Math.min(n,o.q||1))}return t||(e[i++]={encoding:"identity",q:n,i:s}),e.length=i,e}function GM(r,e){var t=qM.exec(r);if(!t)return null;var n=t[1],s=1;if(t[2])for(var i=t[2].split(";"),o=0;o<i.length;o++){var a=i[o].trim().split("=");if(a[0]==="q"){s=parseFloat(a[1]);break}}return{encoding:n,q:s,i:e}}function zM(r,e,t){for(var n={o:-1,q:0,s:0},s=0;s<e.length;s++){var i=oy(r,e[s],t);i&&(n.s-i.s||n.q-i.q||n.o-i.o)<0&&(n=i)}return n}function oy(r,e,t){var n=0;if(e.encoding.toLowerCase()===r.toLowerCase())n|=1;else if(e.encoding!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function ay(r,e){var t=WM(r||"");if(!e)return t.filter(iy).sort(sy).map(VM);var n=e.map(function(i,o){return zM(i,t,o)});return n.filter(iy).sort(sy).map(function(i){return e[n.indexOf(i)]})}function sy(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function VM(r){return r.encoding}function iy(r){return r.q>0}});var dy=O((G6,Gp)=>{"use strict";Gp.exports=fy;Gp.exports.preferredLanguages=fy;var KM=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function YM(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var s=py(e[t].trim(),t);s&&(e[n++]=s)}return e.length=n,e}function py(r,e){var t=KM.exec(r);if(!t)return null;var n=t[1],s=t[2],i=n;s&&(i+="-"+s);var o=1;if(t[3])for(var a=t[3].split(";"),c=0;c<a.length;c++){var l=a[c].split("=");l[0]==="q"&&(o=parseFloat(l[1]))}return{prefix:n,suffix:s,q:o,i:e,full:i}}function XM(r,e,t){for(var n={o:-1,q:0,s:0},s=0;s<e.length;s++){var i=JM(r,e[s],t);i&&(n.s-i.s||n.q-i.q||n.o-i.o)<0&&(n=i)}return n}function JM(r,e,t){var n=py(r);if(!n)return null;var s=0;if(e.full.toLowerCase()===n.full.toLowerCase())s|=4;else if(e.prefix.toLowerCase()===n.full.toLowerCase())s|=2;else if(e.full.toLowerCase()===n.prefix.toLowerCase())s|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s}}function fy(r,e){var t=YM(r===void 0?"*":r||"");if(!e)return t.filter(uy).sort(ly).map(QM);var n=e.map(function(i,o){return XM(i,t,o)});return n.filter(uy).sort(ly).map(function(i){return e[n.indexOf(i)]})}function ly(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function QM(r){return r.full}function uy(r){return r.q>0}});var xy=O((z6,zp)=>{"use strict";zp.exports=vy;zp.exports.preferredMediaTypes=vy;var ZM=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function eP(r){for(var e=iP(r),t=0,n=0;t<e.length;t++){var s=gy(e[t].trim(),t);s&&(e[n++]=s)}return e.length=n,e}function gy(r,e){var t=ZM.exec(r);if(!t)return null;var n=Object.create(null),s=1,i=t[2],o=t[1];if(t[3])for(var a=oP(t[3]).map(sP),c=0;c<a.length;c++){var l=a[c],p=l[0].toLowerCase(),f=l[1],h=f&&f[0]==='"'&&f[f.length-1]==='"'?f.substr(1,f.length-2):f;if(p==="q"){s=parseFloat(h);break}n[p]=h}return{type:o,subtype:i,params:n,q:s,i:e}}function tP(r,e,t){for(var n={o:-1,q:0,s:0},s=0;s<e.length;s++){var i=rP(r,e[s],t);i&&(n.s-i.s||n.q-i.q||n.o-i.o)<0&&(n=i)}return n}function rP(r,e,t){var n=gy(r),s=0;if(!n)return null;if(e.type.toLowerCase()==n.type.toLowerCase())s|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==n.subtype.toLowerCase())s|=2;else if(e.subtype!="*")return null;var i=Object.keys(e.params);if(i.length>0)if(i.every(function(o){return e.params[o]=="*"||(e.params[o]||"").toLowerCase()==(n.params[o]||"").toLowerCase()}))s|=1;else return null;return{i:t,o:e.i,q:e.q,s}}function vy(r,e){var t=eP(r===void 0?"*/*":r||"");if(!e)return t.filter(my).sort(hy).map(nP);var n=e.map(function(i,o){return tP(i,t,o)});return n.filter(my).sort(hy).map(function(i){return e[n.indexOf(i)]})}function hy(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function nP(r){return r.type+"/"+r.subtype}function my(r){return r.q>0}function yy(r){for(var e=0,t=0;(t=r.indexOf('"',t))!==-1;)e++,t++;return e}function sP(r){var e=r.indexOf("="),t,n;return e===-1?t=r:(t=r.substr(0,e),n=r.substr(e+1)),[t,n]}function iP(r){for(var e=r.split(","),t=1,n=0;t<e.length;t++)yy(e[n])%2==0?e[++n]=e[t]:e[n]+=","+e[t];return e.length=n+1,e}function oP(r){for(var e=r.split(";"),t=1,n=0;t<e.length;t++)yy(e[n])%2==0?e[++n]=e[t]:e[n]+=";"+e[t];e.length=n+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}});var _y=O((V6,Vp)=>{"use strict";var aP=ny(),cP=cy(),lP=dy(),uP=xy();Vp.exports=pe;Vp.exports.Negotiator=pe;function pe(r){if(!(this instanceof pe))return new pe(r);this.request=r}pe.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};pe.prototype.charsets=function(e){return aP(this.request.headers["accept-charset"],e)};pe.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};pe.prototype.encodings=function(e){return cP(this.request.headers["accept-encoding"],e)};pe.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};pe.prototype.languages=function(e){return lP(this.request.headers["accept-language"],e)};pe.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};pe.prototype.mediaTypes=function(e){return uP(this.request.headers.accept,e)};pe.prototype.preferredCharset=pe.prototype.charset;pe.prototype.preferredCharsets=pe.prototype.charsets;pe.prototype.preferredEncoding=pe.prototype.encoding;pe.prototype.preferredEncodings=pe.prototype.encodings;pe.prototype.preferredLanguage=pe.prototype.language;pe.prototype.preferredLanguages=pe.prototype.languages;pe.prototype.preferredMediaType=pe.prototype.mediaType;pe.prototype.preferredMediaTypes=pe.prototype.mediaTypes});var by=O((K6,pP)=>{pP.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var Sy=O((Y6,wy)=>{wy.exports=by()});var Cy=O(Ft=>{"use strict";var tc=Sy(),fP=require("path").extname,Ey=/^\s*([^;\s]*)(?:;|\s|$)/,dP=/^text\//i;Ft.charset=Ty;Ft.charsets={lookup:Ty};Ft.contentType=hP;Ft.extension=mP;Ft.extensions=Object.create(null);Ft.lookup=gP;Ft.types=Object.create(null);vP(Ft.extensions,Ft.types);function Ty(r){if(!r||typeof r!="string")return!1;var e=Ey.exec(r),t=e&&tc[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&dP.test(e[1])?"UTF-8":!1}function hP(r){if(!r||typeof r!="string")return!1;var e=r.indexOf("/")===-1?Ft.lookup(r):r;if(!e)return!1;if(e.indexOf("charset")===-1){var t=Ft.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function mP(r){if(!r||typeof r!="string")return!1;var e=Ey.exec(r),t=e&&Ft.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function gP(r){if(!r||typeof r!="string")return!1;var e=fP("x."+r).toLowerCase().substr(1);return e&&Ft.types[e]||!1}function vP(r,e){var t=["nginx","apache",void 0,"iana"];Object.keys(tc).forEach(function(s){var i=tc[s],o=i.extensions;if(!(!o||!o.length)){r[s]=o;for(var a=0;a<o.length;a++){var c=o[a];if(e[c]){var l=t.indexOf(tc[e[c]].source),p=t.indexOf(i.source);if(e[c]!=="application/octet-stream"&&(l>p||l===p&&e[c].substr(0,12)==="application/"))continue}e[c]=s}}})}});var rc=O((J6,Ay)=>{"use strict";var yP=_y(),xP=Cy();Ay.exports=Yt;function Yt(r){if(!(this instanceof Yt))return new Yt(r);this.headers=r.headers,this.negotiator=new yP(r)}Yt.prototype.type=Yt.prototype.types=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}if(!e||e.length===0)return this.negotiator.mediaTypes();if(!this.headers.accept)return e[0];var n=e.map(_P),s=this.negotiator.mediaTypes(n.filter(bP)),i=s[0];return i?e[n.indexOf(i)]:!1};Yt.prototype.encoding=Yt.prototype.encodings=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.encodings():this.negotiator.encodings(e)[0]||!1};Yt.prototype.charset=Yt.prototype.charsets=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.charsets():this.negotiator.charsets(e)[0]||!1};Yt.prototype.lang=Yt.prototype.langs=Yt.prototype.language=Yt.prototype.languages=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.languages():this.negotiator.languages(e)[0]||!1};function _P(r){return r.indexOf("/")===-1?xP.lookup(r):r}function bP(r){return typeof r=="string"}});var Yp=O((Ry,ky)=>{var yo=require("crypto"),Kp=function(){};Kp.prototype.getRandomBytes=function(r){var e=4096,t=this;if(r=r||12,r>e)return yo.randomBytes(r);var n=parseInt(e/r),s=parseInt(n*.85);if(!s||(this.bytesBufferIndex==null&&(this.bytesBufferIndex=-1),this.bytesBufferIndex==n&&(this.bytesBuffer=null,this.bytesBufferIndex=-1),(this.bytesBufferIndex==-1||this.bytesBufferIndex>s)&&(this.isGeneratingBytes||(this.isGeneratingBytes=!0,yo.randomBytes(e,function(o,a){t.bytesBuffer=a,t.bytesBufferIndex=0,t.isGeneratingBytes=!1})),this.bytesBufferIndex==-1)))return yo.randomBytes(r);var i=this.bytesBuffer.slice(r*this.bytesBufferIndex,r*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,i};Kp.prototype.generateId=function(){var r=Buffer.alloc(15);return r.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,r.writeInt32BE(this.sequenceNumber,11),yo.randomBytes?this.getRandomBytes(12).copy(r):[0,4,8].forEach(function(e){r.writeInt32BE(Math.random()*Math.pow(2,32)|0,e)}),r.toString("base64").replace(/\//g,"_").replace(/\+/g,"-")):Math.abs(Math.random()*Math.random()*Date.now()|0).toString()+Math.abs(Math.random()*Math.random()*Date.now()|0).toString()};Ry=ky.exports=new Kp});var nc=O(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.ERROR_PACKET=Nn.PACKET_TYPES_REVERSE=Nn.PACKET_TYPES=void 0;var Fr=Object.create(null);Nn.PACKET_TYPES=Fr;Fr.open="0";Fr.close="1";Fr.ping="2";Fr.pong="3";Fr.message="4";Fr.upgrade="5";Fr.noop="6";var Oy=Object.create(null);Nn.PACKET_TYPES_REVERSE=Oy;Object.keys(Fr).forEach(r=>{Oy[Fr[r]]=r});var wP={type:"error",data:"parser error"};Nn.ERROR_PACKET=wP});var Py=O(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.encodePacket=void 0;Us.encodePacketToBinary=TP;var SP=nc(),EP=({type:r,data:e},t,n)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?n(t?e:"b"+My(e,!0).toString("base64")):n(SP.PACKET_TYPES[r]+(e||""));Us.encodePacket=EP;var My=(r,e)=>Buffer.isBuffer(r)||r instanceof Uint8Array&&!e?r:r instanceof ArrayBuffer?Buffer.from(r):Buffer.from(r.buffer,r.byteOffset,r.byteLength),Xp;function TP(r,e){if(r.data instanceof ArrayBuffer||ArrayBuffer.isView(r.data))return e(My(r.data,!1));(0,Us.encodePacket)(r,!0,t=>{Xp||(Xp=new TextEncoder),e(Xp.encode(t))})}});var Ny=O(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.decodePacket=void 0;var sc=nc(),CP=(r,e)=>{if(typeof r!="string")return{type:"message",data:Iy(r,e)};let t=r.charAt(0);if(t==="b"){let n=Buffer.from(r.substring(1),"base64");return{type:"message",data:Iy(n,e)}}return sc.PACKET_TYPES_REVERSE[t]?r.length>1?{type:sc.PACKET_TYPES_REVERSE[t],data:r.substring(1)}:{type:sc.PACKET_TYPES_REVERSE[t]}:sc.ERROR_PACKET};ic.decodePacket=CP;var Iy=(r,e)=>e==="arraybuffer"?r instanceof ArrayBuffer?r:Buffer.isBuffer(r)?r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength):r.buffer:Buffer.isBuffer(r)?r:Buffer.from(r)});var xo=O(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.decodePayload=Ht.decodePacket=Ht.encodePayload=Ht.encodePacket=Ht.protocol=void 0;Ht.createPacketEncoderStream=kP;Ht.createPacketDecoderStream=OP;var Qp=Py();Object.defineProperty(Ht,"encodePacket",{enumerable:!0,get:function(){return Qp.encodePacket}});var Zp=Ny();Object.defineProperty(Ht,"decodePacket",{enumerable:!0,get:function(){return Zp.decodePacket}});var Ly=nc(),Dy="",AP=(r,e)=>{let t=r.length,n=new Array(t),s=0;r.forEach((i,o)=>{(0,Qp.encodePacket)(i,!1,a=>{n[o]=a,++s===t&&e(n.join(Dy))})})};Ht.encodePayload=AP;var RP=(r,e)=>{let t=r.split(Dy),n=[];for(let s=0;s<t.length;s++){let i=(0,Zp.decodePacket)(t[s],e);if(n.push(i),i.type==="error")break}return n};Ht.decodePayload=RP;function kP(){return new TransformStream({transform(r,e){(0,Qp.encodePacketToBinary)(r,t=>{let n=t.length,s;if(n<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,n);else if(n<65536){s=new Uint8Array(3);let i=new DataView(s.buffer);i.setUint8(0,126),i.setUint16(1,n)}else{s=new Uint8Array(9);let i=new DataView(s.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(n))}r.data&&typeof r.data!="string"&&(s[0]|=128),e.enqueue(s),e.enqueue(t)})}})}var Jp;function oc(r){return r.reduce((e,t)=>e+t.length,0)}function ac(r,e){if(r[0].length===e)return r.shift();let t=new Uint8Array(e),n=0;for(let s=0;s<e;s++)t[s]=r[0][n++],n===r[0].length&&(r.shift(),n=0);return r.length&&n<r[0].length&&(r[0]=r[0].slice(n)),t}function OP(r,e){Jp||(Jp=new TextDecoder);let t=[],n=0,s=-1,i=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(n===0){if(oc(t)<1)break;let c=ac(t,1);i=(c[0]&128)===128,s=c[0]&127,s<126?n=3:s===126?n=1:n=2}else if(n===1){if(oc(t)<2)break;let c=ac(t,2);s=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if(oc(t)<8)break;let c=ac(t,8),l=new DataView(c.buffer,c.byteOffset,c.length),p=l.getUint32(0);if(p>Math.pow(2,21)-1){a.enqueue(Ly.ERROR_PACKET);break}s=p*Math.pow(2,32)+l.getUint32(4),n=3}else{if(oc(t)<s)break;let c=ac(t,s);a.enqueue((0,Zp.decodePacket)(i?c:Jp.decode(c),e)),n=0}if(s===0||s>r){a.enqueue(Ly.ERROR_PACKET);break}}}})}Ht.protocol=4});var Hy=O((rW,Fy)=>{var Ln=String.fromCharCode;function By(r){for(var e=[],t=0,n=r.length,s,i;t<n;)s=r.charCodeAt(t++),s>=55296&&s<=56319&&t<n?(i=r.charCodeAt(t++),(i&64512)==56320?e.push(((s&1023)<<10)+(i&1023)+65536):(e.push(s),t--)):e.push(s);return e}function MP(r){for(var e=r.length,t=-1,n,s="";++t<e;)n=r[t],n>65535&&(n-=65536,s+=Ln(n>>>10&1023|55296),n=56320|n&1023),s+=Ln(n);return s}function jy(r,e){if(r>=55296&&r<=57343){if(e)throw Error("Lone surrogate U+"+r.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function ef(r,e){return Ln(r>>e&63|128)}function PP(r,e){if((r&4294967168)==0)return Ln(r);var t="";return(r&4294965248)==0?t=Ln(r>>6&31|192):(r&4294901760)==0?(jy(r,e)||(r=65533),t=Ln(r>>12&15|224),t+=ef(r,6)):(r&4292870144)==0&&(t=Ln(r>>18&7|240),t+=ef(r,12),t+=ef(r,6)),t+=Ln(r&63|128),t}function IP(r,e){e=e||{};for(var t=e.strict!==!1,n=By(r),s=n.length,i=-1,o,a="";++i<s;)o=n[i],a+=PP(o,t);return a}function qs(){if(Dn>=lc)throw Error("Invalid byte index");var r=cc[Dn]&255;if(Dn++,(r&192)==128)return r&63;throw Error("Invalid continuation byte")}function NP(r){var e,t,n,s,i;if(Dn>lc)throw Error("Invalid byte index");if(Dn==lc)return!1;if(e=cc[Dn]&255,Dn++,(e&128)==0)return e;if((e&224)==192){if(t=qs(),i=(e&31)<<6|t,i>=128)return i;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=qs(),n=qs(),i=(e&15)<<12|t<<6|n,i>=2048)return jy(i,r)?i:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=qs(),n=qs(),s=qs(),i=(e&7)<<18|t<<12|n<<6|s,i>=65536&&i<=1114111))return i;throw Error("Invalid UTF-8 detected")}var cc,lc,Dn;function LP(r,e){e=e||{};var t=e.strict!==!1;cc=By(r),lc=cc.length,Dn=0;for(var n=[],s;(s=NP(t))!==!1;)n.push(s);return MP(n)}Fy.exports={version:"2.1.2",encode:IP,decode:LP}});var Ky=O(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.packets=dt.protocol=void 0;dt.encodePacket=tf;dt.encodeBase64Packet=qy;dt.decodePacket=rf;dt.decodeBase64Packet=Wy;dt.encodePayload=FP;dt.decodePayload=$P;dt.encodePayloadAsBinary=zy;dt.decodePayloadAsBinary=Vy;var Uy=Hy();dt.protocol=3;var DP=r=>{for(let e of r)if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return!0;return!1};dt.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Ws=Object.keys(dt.packets),Tr={type:"error",data:"parser error"},BP=Buffer.concat([]);function tf(r,e,t,n){if(typeof e=="function"&&(n=e,e=null),typeof t=="function"&&(n=t,t=null),Buffer.isBuffer(r.data))return $y(r,e,n);if(r.data&&(r.data.buffer||r.data)instanceof ArrayBuffer)return $y({type:r.type,data:nf(r.data)},e,n);var s=dt.packets[r.type];return r.data!==void 0&&(s+=t?Uy.encode(String(r.data),{strict:!1}):String(r.data)),n(""+s)}function $y(r,e,t){if(!e)return qy(r,t);var n=r.data,s=Buffer.allocUnsafe(1);return s[0]=dt.packets[r.type],t(Buffer.concat([s,n]))}function qy(r,e){var t=Buffer.isBuffer(r.data)?r.data:nf(r.data),n="b"+dt.packets[r.type];return n+=t.toString("base64"),e(n)}function rf(r,e,t){if(r===void 0)return Tr;let n;if(typeof r=="string")return n=r.charAt(0),n==="b"?Wy(r.slice(1),e):t&&(r=jP(r),r===!1)||Number(n)!=n||!Ws[n]?Tr:r.length>1?{type:Ws[n],data:r.slice(1)}:{type:Ws[n]};if(e==="arraybuffer"){var s=new Uint8Array(r);return n=s[0],{type:Ws[n],data:s.buffer.slice(1)}}return r instanceof ArrayBuffer&&(r=nf(r)),n=r[0],{type:Ws[n],data:r.slice(1)}}function jP(r){try{r=Uy.decode(r,{strict:!1})}catch{return!1}return r}function Wy(r,e){var t=Ws[r.charAt(0)],n=Buffer.from(r.slice(1),"base64");if(e==="arraybuffer"){for(var s=new Uint8Array(n.length),i=0;i<s.length;i++)s[i]=n[i];n=s.buffer}return{type:t,data:n}}function FP(r,e,t){if(typeof e=="function"&&(t=e,e=null),e&&DP(r))return zy(r,t);if(!r.length)return t("0:");function n(s,i){tf(s,e,!1,function(o){i(null,HP(o))})}Gy(r,n,function(s,i){return t(i.join(""))})}function HP(r){return r.length+":"+r}function Gy(r,e,t){let n=new Array(r.length),s=0;for(let i=0;i<r.length;i++)e(r[i],(o,a)=>{n[i]=a,++s===r.length&&t(null,n)})}function $P(r,e,t){if(typeof r!="string")return Vy(r,e,t);if(typeof e=="function"&&(t=e,e=null),r==="")return t(Tr,0,1);for(var n="",s,i,o,a=0,c=r.length;a<c;a++){var l=r.charAt(a);if(l!==":"){n+=l;continue}if(n===""||n!=(s=Number(n))||(i=r.slice(a+1,a+1+s),n!=i.length))return t(Tr,0,1);if(i.length){if(o=rf(i,e,!1),Tr.type===o.type&&Tr.data===o.data)return t(Tr,0,1);var p=t(o,a+s,c);if(p===!1)return}a+=s,n=""}if(n!=="")return t(Tr,0,1)}function UP(r){for(var e="",t=0,n=r.length;t<n;t++)e+=String.fromCharCode(r[t]);return e}function qP(r){for(var e=Buffer.allocUnsafe(r.length),t=0,n=r.length;t<n;t++)e.writeUInt8(r.charCodeAt(t),t);return e}function nf(r){var e=r.byteLength||r.length,t=r.byteOffset||0;return Buffer.from(r.buffer||r,t,e)}function zy(r,e){if(!r.length)return e(BP);Gy(r,WP,function(t,n){return e(Buffer.concat(n))})}function WP(r,e){function t(n){var s=""+n.length,i;if(typeof n=="string"){i=Buffer.allocUnsafe(s.length+2),i[0]=0;for(var o=0;o<s.length;o++)i[o+1]=parseInt(s[o],10);return i[i.length-1]=255,e(null,Buffer.concat([i,qP(n)]))}i=Buffer.allocUnsafe(s.length+2),i[0]=1;for(var o=0;o<s.length;o++)i[o+1]=parseInt(s[o],10);i[i.length-1]=255,e(null,Buffer.concat([i,n]))}tf(r,!0,!0,t)}function Vy(r,e,t){typeof e=="function"&&(t=e,e=null);for(var n=r,s=[],i;n.length>0;){var o="",a=n[0]===0;for(i=1;n[i]!==255;i++){if(o.length>310)return t(Tr,0,1);o+=""+n[i]}n=n.slice(o.length+1);var c=parseInt(o,10),l=n.slice(1,c+1);a&&(l=UP(l)),s.push(l),n=n.slice(c+1)}var p=s.length;for(i=0;i<p;i++){var f=s[i];t(rf(f,e,!0),i,p)}}});var Xy=O((sW,Yy)=>{var Gs=1e3,zs=Gs*60,Vs=zs*60,es=Vs*24,GP=es*7,zP=es*365.25;Yy.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return VP(r);if(t==="number"&&isFinite(r))return e.long?YP(r):KP(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function VP(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*zP;case"weeks":case"week":case"w":return t*GP;case"days":case"day":case"d":return t*es;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Vs;case"minutes":case"minute":case"mins":case"min":case"m":return t*zs;case"seconds":case"second":case"secs":case"sec":case"s":return t*Gs;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function KP(r){var e=Math.abs(r);return e>=es?Math.round(r/es)+"d":e>=Vs?Math.round(r/Vs)+"h":e>=zs?Math.round(r/zs)+"m":e>=Gs?Math.round(r/Gs)+"s":r+"ms"}function YP(r){var e=Math.abs(r);return e>=es?uc(r,e,es,"day"):e>=Vs?uc(r,e,Vs,"hour"):e>=zs?uc(r,e,zs,"minute"):e>=Gs?uc(r,e,Gs,"second"):r+" ms"}function uc(r,e,t,n){var s=e>=t*1.5;return Math.round(r/t)+" "+n+(s?"s":"")}});var sf=O((iW,Jy)=>{function XP(r){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=s,t.enabled=a,t.humanize=Xy(),t.destroy=l,Object.keys(r).forEach(p=>{t[p]=r[p]}),t.names=[],t.skips=[],t.formatters={};function e(p){let f=0;for(let h=0;h<p.length;h++)f=(f<<5)-f+p.charCodeAt(h),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(p){let f,h=null,x,_;function S(...A){if(!S.enabled)return;let M=S,N=Number(new Date),L=N-(f||N);M.diff=L,M.prev=f,M.curr=N,f=N,A[0]=t.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let j=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(q,G)=>{if(q==="%%")return"%";j++;let P=t.formatters[G];if(typeof P=="function"){let H=A[j];q=P.call(M,H),A.splice(j,1),j--}return q}),t.formatArgs.call(M,A),(M.log||t.log).apply(M,A)}return S.namespace=p,S.useColors=t.useColors(),S.color=t.selectColor(p),S.extend=n,S.destroy=t.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(x!==t.namespaces&&(x=t.namespaces,_=t.enabled(p)),_),set:A=>{h=A}}),typeof t.init=="function"&&t.init(S),S}function n(p,f){let h=t(this.namespace+(typeof f>"u"?":":f)+p);return h.log=this.log,h}function s(p){t.save(p),t.namespaces=p,t.names=[],t.skips=[];let f=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let h of f)h[0]==="-"?t.skips.push(h.slice(1)):t.names.push(h)}function i(p,f){let h=0,x=0,_=-1,S=0;for(;h<p.length;)if(x<f.length&&(f[x]===p[h]||f[x]==="*"))f[x]==="*"?(_=x,S=h,x++):(h++,x++);else if(_!==-1)x=_+1,S++,h=S;else return!1;for(;x<f.length&&f[x]==="*";)x++;return x===f.length}function o(){let p=[...t.names,...t.skips.map(f=>"-"+f)].join(",");return t.enable(""),p}function a(p){for(let f of t.skips)if(i(p,f))return!1;for(let f of t.names)if(i(p,f))return!0;return!1}function c(p){return p instanceof Error?p.stack||p.message:p}function l(){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 t.enable(t.load()),t}Jy.exports=XP});var Qy=O(($t,pc)=>{$t.formatArgs=QP;$t.save=ZP;$t.load=eI;$t.useColors=JP;$t.storage=tI();$t.destroy=(()=>{let r=!1;return()=>{r||(r=!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`."))}})();$t.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 JP(){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 r;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&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function QP(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+pc.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,n=0;r[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(t++,s==="%c"&&(n=t))}),r.splice(n,0,e)}$t.log=console.debug||console.log||(()=>{});function ZP(r){try{r?$t.storage.setItem("debug",r):$t.storage.removeItem("debug")}catch{}}function eI(){let r;try{r=$t.storage.getItem("debug")||$t.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function tI(){try{return localStorage}catch{}}pc.exports=sf()($t);var{formatters:rI}=pc.exports;rI.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var ex=O((oW,Zy)=>{"use strict";Zy.exports=(r,e)=>{e=e||process.argv;let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),s=e.indexOf("--");return n!==-1&&(s===-1?!0:n<s)}});var rx=O((aW,tx)=>{"use strict";var nI=require("os"),Cr=ex(),wt=process.env,Ks;Cr("no-color")||Cr("no-colors")||Cr("color=false")?Ks=!1:(Cr("color")||Cr("colors")||Cr("color=true")||Cr("color=always"))&&(Ks=!0);"FORCE_COLOR"in wt&&(Ks=wt.FORCE_COLOR.length===0||parseInt(wt.FORCE_COLOR,10)!==0);function sI(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function iI(r){if(Ks===!1)return 0;if(Cr("color=16m")||Cr("color=full")||Cr("color=truecolor"))return 3;if(Cr("color=256"))return 2;if(r&&!r.isTTY&&Ks!==!0)return 0;let e=Ks?1:0;if(process.platform==="win32"){let t=nI.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in wt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(t=>t in wt)||wt.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in wt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(wt.TEAMCITY_VERSION)?1:0;if(wt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in wt){let t=parseInt((wt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(wt.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(wt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(wt.TERM)||"COLORTERM"in wt?1:(wt.TERM==="dumb",e)}function of(r){let e=iI(r);return sI(e)}tx.exports={supportsColor:of,stdout:of(process.stdout),stderr:of(process.stderr)}});var sx=O((ht,dc)=>{var oI=require("tty"),fc=require("util");ht.init=dI;ht.log=uI;ht.formatArgs=cI;ht.save=pI;ht.load=fI;ht.useColors=aI;ht.destroy=fc.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ht.colors=[6,2,3,4,5,1];try{let r=rx();r&&(r.stderr||r).level>=2&&(ht.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{}ht.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,i)=>i.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),r[t]=n,r},{});function aI(){return"colors"in ht.inspectOpts?!!ht.inspectOpts.colors:oI.isatty(process.stderr.fd)}function cI(r){let{namespace:e,useColors:t}=this;if(t){let n=this.color,s="\x1B[3"+(n<8?n:"8;5;"+n),i=` ${s};1m${e} \x1B[0m`;r[0]=i+r[0].split(`
6
6
  `).join(`
7
- `+s),r.push(i+"m+"+lc.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=VP()+e+" "+r[0]}function VP(){return pt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function KP(...r){return process.stderr.write(cc.formatWithOptions(pt.inspectOpts,...r)+`
8
- `)}function YP(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function XP(){return process.env.DEBUG}function JP(r){r.inspectOpts={};let e=Object.keys(pt.inspectOpts);for(let t=0;t<e.length;t++)r.inspectOpts[e[t]]=pt.inspectOpts[e[t]]}lc.exports=Zp()(pt);var{formatters:Xx}=lc.exports;Xx.o=function(r){return this.inspectOpts.colors=this.useColors,cc.inspect(r,this.inspectOpts).split(`
9
- `).map(e=>e.trim()).join(" ")};Xx.O=function(r){return this.inspectOpts.colors=this.useColors,cc.inspect(r,this.inspectOpts)}});var Ae=O((S6,tf)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?tf.exports=Gx():tf.exports=Jx()});var Qn=O(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc.Transport=void 0;var QP=require("events"),ZP=mo(),eI=Hx(),tI=Ae(),Qx=(0,tI.default)("engine:transport");function rI(){}var uc=class extends QP.EventEmitter{get readyState(){return this._readyState}set readyState(e){Qx("readyState updated from %s to %s (%s)",this._readyState,e,this.name),this._readyState=e}constructor(e){super(),this.writable=!1,this._readyState="open",this.discarded=!1,this.protocol=e._query.EIO==="4"?4:3,this.parser=this.protocol===4?ZP:eI,this.supportsBinary=!(e._query&&e._query.b64)}discard(){this.discarded=!0}onRequest(e){}close(e){this.readyState==="closed"||this.readyState==="closing"||(this.readyState="closing",this.doClose(e||rI))}onError(e,t){if(this.listeners("error").length){let n=new Error(e);n.type="TransportError",n.description=t,this.emit("error",n)}else Qx("ignored transport error %s (%s)",e,t)}onPacket(e){this.emit("packet",e)}onData(e){this.onPacket(this.parser.decodePacket(e))}onClose(){this.readyState="closed",this.emit("close")}};pc.Transport=uc;uc.upgradesTo=[]});var nf=O(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.Polling=void 0;var nI=Qn(),Zx=require("zlib"),iI=Qa(),sI=Ae(),Vt=(0,sI.default)("engine:polling"),oI={gzip:Zx.createGzip,deflate:Zx.createDeflate},rf=class extends nI.Transport{constructor(e){super(e),this.closeTimeout=30*1e3}get name(){return"polling"}onRequest(e){let t=e.res;e.res=null,e.method==="GET"?this.onPollRequest(e,t):e.method==="POST"?this.onDataRequest(e,t):(t.writeHead(500),t.end())}onPollRequest(e,t){if(this.req){Vt("request overlap"),this.onError("overlap from client"),t.writeHead(400),t.end();return}Vt("setting request"),this.req=e,this.res=t;let n=()=>{this.onError("poll connection closed prematurely")},i=()=>{e.removeListener("close",n),this.req=this.res=null};e.cleanup=i,e.on("close",n),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(Vt("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq){this.onError("data request overlap from client"),t.writeHead(400),t.end();return}let n=e.headers["content-type"]==="application/octet-stream";if(n&&this.protocol===4)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let i=n?Buffer.concat([]):"",s=()=>{e.removeListener("data",a),e.removeListener("end",c),e.removeListener("close",o),this.dataReq=this.dataRes=i=null},o=()=>{s(),this.onError("data request connection closed prematurely")},a=u=>{let p;n?(i=Buffer.concat([i,u]),p=i.length):(i+=u,p=Buffer.byteLength(i)),p>this.maxHttpBufferSize&&(t.writeHead(413).end(),s())},c=()=>{this.onData(i);let u={"Content-Type":"text/html","Content-Length":"2"};t.writeHead(200,this.headers(e,u)),t.end("ok"),s()};e.on("close",o),n||e.setEncoding("utf8"),e.on("data",a),e.on("end",c)}onData(e){Vt('received "%s"',e);let t=n=>{if(n.type==="close")return Vt("got xhr close packet"),this.onClose(),!1;this.onPacket(n)};this.protocol===3?this.parser.decodePayload(e,t):this.parser.decodePayload(e).forEach(t)}onClose(){this.writable&&this.send([{type:"noop"}]),super.onClose()}send(e){this.writable=!1,this.shouldClose&&(Vt("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let i=e.some(s=>s.options&&s.options.compress);this.write(n,{compress:i})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){Vt('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let i=typeof e=="string",o={"Content-Type":i?"text/plain; charset=UTF-8":"application/octet-stream"},a=p=>{o["Content-Length"]=typeof p=="string"?Buffer.byteLength(p):p.length,this.res.writeHead(200,this.headers(this.req,o)),this.res.end(p),n()};if(!this.httpCompression||!t.compress){a(e);return}if((i?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let u=iI(this.req).encodings(["gzip","deflate"]);if(!u){a(e);return}this.compress(e,u,(p,f)=>{if(p){this.res.writeHead(500),this.res.end(),n(p);return}o["Content-Encoding"]=u,a(f)})}compress(e,t,n){Vt("compressing");let i=[],s=0;oI[t](this.httpCompression).on("error",n).on("data",function(o){i.push(o),s+=o.length}).on("end",function(){n(null,Buffer.concat(i,s))}).end(e)}doClose(e){Vt("closing");let t;this.dataReq&&(Vt("aborting ongoing data request"),this.dataReq.destroy());let n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(Vt("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(Vt("transport discarded - closing right away"),n()):(Vt("transport not writable - buffering orderly close"),this.shouldClose=n,t=setTimeout(n,this.closeTimeout))}headers(e,t={}){let n=e.headers["user-agent"];return n&&(~n.indexOf(";MSIE")||~n.indexOf("Trident/"))&&(t["X-XSS-Protection"]="0"),t["cache-control"]="no-store",this.emit("headers",t,e),t}};fc.Polling=rf});var e0=O(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.JSONP=void 0;var aI=nf(),cI=require("querystring"),lI=/\\\\n/g,uI=/(\\)?\\n/g,sf=class extends aI.Polling{constructor(e){super(e),this.head="___eio["+(e._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(e){e=cI.parse(e).d,typeof e=="string"&&(e=e.replace(uI,function(t,n){return n?t:`
10
- `}),super.onData(e.replace(lI,"\\n")))}doWrite(e,t,n){let i=JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");e=this.head+i+this.foot,super.doWrite(e,t,n)}};dc.JSONP=sf});var r0=O(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.WebSocket=void 0;var pI=Qn(),fI=Ae(),t0=(0,fI.default)("engine:ws"),of=class extends pI.Transport{constructor(e){super(e),this._doSend=t=>{this.socket.send(t,this._onSent)},this._doSendLast=t=>{this.socket.send(t,this._onSentLast)},this._onSent=t=>{t&&this.onError("write error",t.stack)},this._onSentLast=t=>{t?this.onError("write error",t.stack):(this.emit("drain"),this.writable=!0,this.emit("ready"))},this.socket=e.websocket,this.socket.on("message",(t,n)=>{let i=n?t:t.toString();t0('received "%s"',i),super.onData(i)}),this.socket.once("close",this.onClose.bind(this)),this.socket.on("error",this.onError.bind(this)),this.writable=!0,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],i=t+1===e.length;this._canSendPreEncodedFrame(n)?this.socket._sender.sendFrame(n.options.wsPreEncodedFrame,i?this._onSentLast:this._onSent):this.parser.encodePacket(n,this.supportsBinary,i?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(e){var t,n,i;return!this.perMessageDeflate&&typeof((n=(t=this.socket)===null||t===void 0?void 0:t._sender)===null||n===void 0?void 0:n.sendFrame)=="function"&&((i=e.options)===null||i===void 0?void 0:i.wsPreEncodedFrame)!==void 0}doClose(e){t0("closing"),this.socket.close(),e&&e()}};hc.WebSocket=of});var cf=O(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.WebTransport=void 0;var dI=Qn(),hI=Ae(),mI=mo(),Gi=(0,hI.default)("engine:webtransport"),af=class extends dI.Transport{constructor(e,t,n){super({_query:{EIO:"4"}}),this.session=e;let i=(0,mI.createPacketEncoderStream)();i.readable.pipeTo(t.writable).catch(()=>{Gi("the stream was closed")}),this.writer=i.writable.getWriter(),(async()=>{try{for(;;){let{value:s,done:o}=await n.read();if(o){Gi("session is closed");break}Gi("received chunk: %o",s),this.onPacket(s)}}catch(s){Gi("error while reading: %s",s.message)}})(),e.closed.then(()=>this.onClose()),this.writable=!0}get name(){return"webtransport"}async send(e){this.writable=!1;try{for(let t=0;t<e.length;t++){let n=e[t];await this.writer.write(n)}}catch(t){Gi("error while writing: %s",t.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(e){Gi("closing WebTransport session"),this.session.close(),e&&e()}};mc.WebTransport=af});var uf=O(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});var gI=nf(),vI=e0(),xI=r0(),yI=cf();lf.default={polling:n0,websocket:xI.WebSocket,webtransport:yI.WebTransport};function n0(r){return typeof r._query.j=="string"?new vI.JSONP(r):new gI.Polling(r)}n0.upgradesTo=["websocket","webtransport"]});var ff=O(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.Socket=void 0;var _I=require("events"),bI=Ae(),Zr=require("timers"),Re=(0,bI.default)("engine:socket"),pf=class extends _I.EventEmitter{get readyState(){return this._readyState}set readyState(e){Re("readyState updated from %s to %s",this._readyState,e),this._readyState=e}constructor(e,t,n,i,s){super(),this._readyState="opening",this.upgrading=!1,this.upgraded=!1,this.writeBuffer=[],this.packetsFn=[],this.sentCallbackFn=[],this.cleanupFn=[],this.id=e,this.server=t,this.request=i,this.protocol=s,i&&(i.websocket&&i.websocket._socket?this.remoteAddress=i.websocket._socket.remoteAddress:this.remoteAddress=i.connection.remoteAddress),this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(n),this.onOpen()}onOpen(){this.readyState="open",this.transport.sid=this.id,this.sendPacket("open",JSON.stringify({sid:this.id,upgrades:this.getAvailableUpgrades(),pingInterval:this.server.opts.pingInterval,pingTimeout:this.server.opts.pingTimeout,maxPayload:this.server.opts.maxHttpBufferSize})),this.server.opts.initialPacket&&this.sendPacket("message",this.server.opts.initialPacket),this.emit("open"),this.protocol===3?this.resetPingTimeout():this.schedulePing()}onPacket(e){if(this.readyState!=="open")return Re("packet received with closed socket");switch(Re(`received packet ${e.type}`),this.emit("packet",e),e.type){case"ping":if(this.transport.protocol!==3){this.onError(new Error("invalid heartbeat direction"));return}Re("got ping"),this.pingTimeoutTimer.refresh(),this.sendPacket("pong"),this.emit("heartbeat");break;case"pong":if(this.transport.protocol===3){this.onError(new Error("invalid heartbeat direction"));return}Re("got pong"),(0,Zr.clearTimeout)(this.pingTimeoutTimer),this.pingIntervalTimer.refresh(),this.emit("heartbeat");break;case"error":this.onClose("parse error");break;case"message":this.emit("data",e.data),this.emit("message",e.data);break}}onError(e){Re("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,Zr.setTimeout)(()=>{Re("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,Zr.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,Zr.setTimeout)(()=>{this.readyState!=="closed"&&this.onClose("ping timeout")},this.protocol===3?this.server.opts.pingInterval+this.server.opts.pingTimeout:this.server.opts.pingTimeout)}setTransport(e){let t=this.onError.bind(this),n=()=>this.flush(),i=this.onPacket.bind(this),s=this.onDrain.bind(this),o=this.onClose.bind(this,"transport close");this.transport=e,this.transport.once("error",t),this.transport.on("ready",n),this.transport.on("packet",i),this.transport.on("drain",s),this.transport.once("close",o),this.cleanupFn.push(function(){e.removeListener("error",t),e.removeListener("ready",n),e.removeListener("packet",i),e.removeListener("drain",s),e.removeListener("close",o)})}onDrain(){if(this.sentCallbackFn.length>0){Re("executing batch send callback");let e=this.sentCallbackFn.shift();if(e)for(let t=0;t<e.length;t++)e[t](this.transport)}}_maybeUpgrade(e){Re('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;let t=(0,Zr.setTimeout)(()=>{Re("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),n,i=p=>{p.type==="ping"&&p.data==="probe"?(Re("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(n),n=setInterval(s,100)):p.type==="upgrade"&&this.readyState!=="closed"?(Re("got upgrade packet - upgrading"),o(),this.transport.discard(),this.upgraded=!0,this.clearTransport(),this.setTransport(e),this.emit("upgrade",e),this.flush(),this.readyState==="closing"&&e.close(()=>{this.onClose("forced close")})):(o(),e.close())},s=()=>{this.transport.name==="polling"&&this.transport.writable&&(Re("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},o=()=>{this.upgrading=!1,clearInterval(n),(0,Zr.clearTimeout)(t),e.removeListener("packet",i),e.removeListener("close",c),e.removeListener("error",a),this.removeListener("close",u)},a=p=>{Re("client did not complete upgrade - %s",p),o(),e.close(),e=null},c=()=>{a("transport closed")},u=()=>{a("socket closed")};e.on("packet",i),e.once("close",c),e.once("error",a),this.once("close",u)}clearTransport(){let e,t=this.cleanupFn.length;for(let n=0;n<t;n++)e=this.cleanupFn.shift(),e();this.transport.on("error",function(){Re("error triggered by discarded transport")}),this.transport.close(),(0,Zr.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,Zr.clearTimeout)(this.pingIntervalTimer),(0,Zr.clearTimeout)(this.pingTimeoutTimer),process.nextTick(()=>{this.writeBuffer=[]}),this.packetsFn=[],this.sentCallbackFn=[],this.clearTransport(),this.emit("close",e,t))}send(e,t,n){return this.sendPacket("message",e,t,n),this}write(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n={},i){if(typeof n=="function"&&(i=n,n={}),this.readyState!=="closing"&&this.readyState!=="closed"){Re('sending packet "%s" (%s)',e,t),n.compress=n.compress!==!1;let s={type:e,options:n};t&&(s.data=t),this.emit("packetCreate",s),this.writeBuffer.push(s),typeof i=="function"&&this.packetsFn.push(i),this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){Re("flushing buffer to transport"),this.emit("flush",this.writeBuffer),this.server.emit("flush",this,this.writeBuffer);let e=this.writeBuffer;this.writeBuffer=[],this.packetsFn.length?(this.sentCallbackFn.push(this.packetsFn),this.packetsFn=[]):this.sentCallbackFn.push(null),this.transport.send(e),this.emit("drain"),this.server.emit("drain",this)}}getAvailableUpgrades(){let e=[],t=this.server.upgrades(this.transport.name);for(let n=0;n<t.length;++n){let i=t[n];this.server.opts.transports.indexOf(i)!==-1&&e.push(i)}return e}close(e){if(e&&(this.readyState==="open"||this.readyState==="closing"))return this.closeTransport(e);if(this.readyState==="open"){if(this.readyState="closing",this.writeBuffer.length){Re("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{Re("all packets have been sent, closing the transport"),this.closeTransport(e)});return}Re("the buffer is empty, closing the transport right away"),this.closeTransport(e)}}closeTransport(e){Re("closing the transport (discard? %s)",!!e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};gc.Socket=pf});var o0=O(df=>{"use strict";df.parse=RI;df.serialize=kI;var wI=Object.prototype.toString,SI=Object.prototype.hasOwnProperty,EI=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,TI=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,CI=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,AI=/^[\u0020-\u003A\u003D-\u007E]*$/;function RI(r,e){if(typeof r!="string")throw new TypeError("argument str must be a string");var t={},n=r.length;if(n<2)return t;var i=e&&e.decode||OI,s=0,o=0,a=0;do{if(o=r.indexOf("=",s),o===-1)break;if(a=r.indexOf(";",s),a===-1)a=n;else if(o>a){s=r.lastIndexOf(";",o-1)+1;continue}var c=i0(r,s,o),u=s0(r,o,c),p=r.slice(c,u);if(!SI.call(t,p)){var f=i0(r,o+1,a),m=s0(r,a,f);r.charCodeAt(f)===34&&r.charCodeAt(m-1)===34&&(f++,m--);var y=r.slice(f,m);t[p]=PI(y,i)}s=a+1}while(s<n);return t}function i0(r,e,t){do{var n=r.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<t);return t}function s0(r,e,t){for(;e>t;){var n=r.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return t}function kI(r,e,t){var n=t&&t.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!EI.test(r))throw new TypeError("argument name is invalid");var i=n(e);if(!TI.test(i))throw new TypeError("argument val is invalid");var s=r+"="+i;if(!t)return s;if(t.maxAge!=null){var o=Math.floor(t.maxAge);if(!isFinite(o))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+o}if(t.domain){if(!CI.test(t.domain))throw new TypeError("option domain is invalid");s+="; Domain="+t.domain}if(t.path){if(!AI.test(t.path))throw new TypeError("option path is invalid");s+="; Path="+t.path}if(t.expires){var a=t.expires;if(!MI(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+a.toUTCString()}if(t.httpOnly&&(s+="; HttpOnly"),t.secure&&(s+="; Secure"),t.partitioned&&(s+="; Partitioned"),t.priority){var c=typeof t.priority=="string"?t.priority.toLowerCase():t.priority;switch(c){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(t.sameSite){var u=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(u){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s}function OI(r){return r.indexOf("%")!==-1?decodeURIComponent(r):r}function MI(r){return wI.call(r)==="[object Date]"}function PI(r,e){try{return e(r)}catch{return r}}});var en=O((P6,l0)=>{"use strict";var a0=["nodebuffer","arraybuffer","fragments"],c0=typeof Blob<"u";c0&&a0.push("blob");l0.exports={BINARY_TYPES:a0,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:c0,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var T0=O((I6,E0)=>{var d0=require("fs"),tn=require("path"),h0=require("os"),m0=typeof __webpack_require__=="function"?__non_webpack_require__:require,II=process.config&&process.config.variables||{},NI=!!process.env.PREBUILDS_ONLY,u0=process.versions.modules,hf=BI()?"electron":DI()?"node-webkit":"node",mf=process.env.npm_config_arch||h0.arch(),gf=process.env.npm_config_platform||h0.platform(),g0=process.env.LIBC||(jI(gf)?"musl":"glibc"),vf=process.env.ARM_VERSION||(mf==="arm64"?"8":II.arm_version)||"",v0=(process.versions.uv||"").split(".")[0];E0.exports=Dr;function Dr(r){return m0(Dr.resolve(r))}Dr.resolve=Dr.path=function(r){r=tn.resolve(r||".");try{var e=m0(tn.join(r,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(r=process.env[e+"_PREBUILD"])}catch{}if(!NI){var t=p0(tn.join(r,"build/Release"),f0);if(t)return t;var n=p0(tn.join(r,"build/Debug"),f0);if(n)return n}var i=a(r);if(i)return i;var s=a(tn.dirname(process.execPath));if(s)return s;var o=["platform="+gf,"arch="+mf,"runtime="+hf,"abi="+u0,"uv="+v0,vf?"armv="+vf:"","libc="+g0,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"",typeof __webpack_require__=="function"?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+o+`
7
+ `+i),r.push(s+"m+"+dc.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=lI()+e+" "+r[0]}function lI(){return ht.inspectOpts.hideDate?"":new Date().toISOString()+" "}function uI(...r){return process.stderr.write(fc.formatWithOptions(ht.inspectOpts,...r)+`
8
+ `)}function pI(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function fI(){return process.env.DEBUG}function dI(r){r.inspectOpts={};let e=Object.keys(ht.inspectOpts);for(let t=0;t<e.length;t++)r.inspectOpts[e[t]]=ht.inspectOpts[e[t]]}dc.exports=sf()(ht);var{formatters:nx}=dc.exports;nx.o=function(r){return this.inspectOpts.colors=this.useColors,fc.inspect(r,this.inspectOpts).split(`
9
+ `).map(e=>e.trim()).join(" ")};nx.O=function(r){return this.inspectOpts.colors=this.useColors,fc.inspect(r,this.inspectOpts)}});var ke=O((cW,af)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?af.exports=Qy():af.exports=sx()});var ts=O(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.Transport=void 0;var hI=require("events"),mI=xo(),gI=Ky(),vI=ke(),ix=(0,vI.default)("engine:transport");function yI(){}var hc=class extends hI.EventEmitter{get readyState(){return this._readyState}set readyState(e){ix("readyState updated from %s to %s (%s)",this._readyState,e,this.name),this._readyState=e}constructor(e){super(),this.writable=!1,this._readyState="open",this.discarded=!1,this.protocol=e._query.EIO==="4"?4:3,this.parser=this.protocol===4?mI:gI,this.supportsBinary=!(e._query&&e._query.b64)}discard(){this.discarded=!0}onRequest(e){}close(e){this.readyState==="closed"||this.readyState==="closing"||(this.readyState="closing",this.doClose(e||yI))}onError(e,t){if(this.listeners("error").length){let n=new Error(e);n.type="TransportError",n.description=t,this.emit("error",n)}else ix("ignored transport error %s (%s)",e,t)}onPacket(e){this.emit("packet",e)}onData(e){this.onPacket(this.parser.decodePacket(e))}onClose(){this.readyState="closed",this.emit("close")}};mc.Transport=hc;hc.upgradesTo=[]});var lf=O(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.Polling=void 0;var xI=ts(),ox=require("zlib"),_I=rc(),bI=ke(),Xt=(0,bI.default)("engine:polling"),wI={gzip:ox.createGzip,deflate:ox.createDeflate},cf=class extends xI.Transport{constructor(e){super(e),this.closeTimeout=30*1e3}get name(){return"polling"}onRequest(e){let t=e.res;e.res=null,e.method==="GET"?this.onPollRequest(e,t):e.method==="POST"?this.onDataRequest(e,t):(t.writeHead(500),t.end())}onPollRequest(e,t){if(this.req){Xt("request overlap"),this.onError("overlap from client"),t.writeHead(400),t.end();return}Xt("setting request"),this.req=e,this.res=t;let n=()=>{this.onError("poll connection closed prematurely")},s=()=>{e.removeListener("close",n),this.req=this.res=null};e.cleanup=s,e.on("close",n),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(Xt("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq){this.onError("data request overlap from client"),t.writeHead(400),t.end();return}let n=e.headers["content-type"]==="application/octet-stream";if(n&&this.protocol===4)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let s=n?Buffer.concat([]):"",i=()=>{e.removeListener("data",a),e.removeListener("end",c),e.removeListener("close",o),this.dataReq=this.dataRes=s=null},o=()=>{i(),this.onError("data request connection closed prematurely")},a=l=>{let p;n?(s=Buffer.concat([s,l]),p=s.length):(s+=l,p=Buffer.byteLength(s)),p>this.maxHttpBufferSize&&(t.writeHead(413).end(),i())},c=()=>{this.onData(s);let l={"Content-Type":"text/html","Content-Length":"2"};t.writeHead(200,this.headers(e,l)),t.end("ok"),i()};e.on("close",o),n||e.setEncoding("utf8"),e.on("data",a),e.on("end",c)}onData(e){Xt('received "%s"',e);let t=n=>{if(n.type==="close")return Xt("got xhr close packet"),this.onClose(),!1;this.onPacket(n)};this.protocol===3?this.parser.decodePayload(e,t):this.parser.decodePayload(e).forEach(t)}onClose(){this.writable&&this.send([{type:"noop"}]),super.onClose()}send(e){this.writable=!1,this.shouldClose&&(Xt("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let s=e.some(i=>i.options&&i.options.compress);this.write(n,{compress:s})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){Xt('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let s=typeof e=="string",o={"Content-Type":s?"text/plain; charset=UTF-8":"application/octet-stream"},a=p=>{o["Content-Length"]=typeof p=="string"?Buffer.byteLength(p):p.length,this.res.writeHead(200,this.headers(this.req,o)),this.res.end(p),n()};if(!this.httpCompression||!t.compress){a(e);return}if((s?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let l=_I(this.req).encodings(["gzip","deflate"]);if(!l){a(e);return}this.compress(e,l,(p,f)=>{if(p){this.res.writeHead(500),this.res.end(),n(p);return}o["Content-Encoding"]=l,a(f)})}compress(e,t,n){Xt("compressing");let s=[],i=0;wI[t](this.httpCompression).on("error",n).on("data",function(o){s.push(o),i+=o.length}).on("end",function(){n(null,Buffer.concat(s,i))}).end(e)}doClose(e){Xt("closing");let t;this.dataReq&&(Xt("aborting ongoing data request"),this.dataReq.destroy());let n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(Xt("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(Xt("transport discarded - closing right away"),n()):(Xt("transport not writable - buffering orderly close"),this.shouldClose=n,t=setTimeout(n,this.closeTimeout))}headers(e,t={}){let n=e.headers["user-agent"];return n&&(~n.indexOf(";MSIE")||~n.indexOf("Trident/"))&&(t["X-XSS-Protection"]="0"),t["cache-control"]="no-store",this.emit("headers",t,e),t}};gc.Polling=cf});var ax=O(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.JSONP=void 0;var SI=lf(),EI=require("querystring"),TI=/\\\\n/g,CI=/(\\)?\\n/g,uf=class extends SI.Polling{constructor(e){super(e),this.head="___eio["+(e._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(e){e=EI.parse(e).d,typeof e=="string"&&(e=e.replace(CI,function(t,n){return n?t:`
10
+ `}),super.onData(e.replace(TI,"\\n")))}doWrite(e,t,n){let s=JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");e=this.head+s+this.foot,super.doWrite(e,t,n)}};vc.JSONP=uf});var lx=O(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.WebSocket=void 0;var AI=ts(),RI=ke(),cx=(0,RI.default)("engine:ws"),pf=class extends AI.Transport{constructor(e){super(e),this._doSend=t=>{this.socket.send(t,this._onSent)},this._doSendLast=t=>{this.socket.send(t,this._onSentLast)},this._onSent=t=>{t&&this.onError("write error",t.stack)},this._onSentLast=t=>{t?this.onError("write error",t.stack):(this.emit("drain"),this.writable=!0,this.emit("ready"))},this.socket=e.websocket,this.socket.on("message",(t,n)=>{let s=n?t:t.toString();cx('received "%s"',s),super.onData(s)}),this.socket.once("close",this.onClose.bind(this)),this.socket.on("error",this.onError.bind(this)),this.writable=!0,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],s=t+1===e.length;this._canSendPreEncodedFrame(n)?this.socket._sender.sendFrame(n.options.wsPreEncodedFrame,s?this._onSentLast:this._onSent):this.parser.encodePacket(n,this.supportsBinary,s?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(e){var t,n,s;return!this.perMessageDeflate&&typeof((n=(t=this.socket)===null||t===void 0?void 0:t._sender)===null||n===void 0?void 0:n.sendFrame)=="function"&&((s=e.options)===null||s===void 0?void 0:s.wsPreEncodedFrame)!==void 0}doClose(e){cx("closing"),this.socket.close(),e&&e()}};yc.WebSocket=pf});var df=O(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.WebTransport=void 0;var kI=ts(),OI=ke(),MI=xo(),Ys=(0,OI.default)("engine:webtransport"),ff=class extends kI.Transport{constructor(e,t,n){super({_query:{EIO:"4"}}),this.session=e;let s=(0,MI.createPacketEncoderStream)();s.readable.pipeTo(t.writable).catch(()=>{Ys("the stream was closed")}),this.writer=s.writable.getWriter(),(async()=>{try{for(;;){let{value:i,done:o}=await n.read();if(o){Ys("session is closed");break}Ys("received chunk: %o",i),this.onPacket(i)}}catch(i){Ys("error while reading: %s",i.message)}})(),e.closed.then(()=>this.onClose()),this.writable=!0}get name(){return"webtransport"}async send(e){this.writable=!1;try{for(let t=0;t<e.length;t++){let n=e[t];await this.writer.write(n)}}catch(t){Ys("error while writing: %s",t.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(e){Ys("closing WebTransport session"),this.session.close(),e&&e()}};xc.WebTransport=ff});var mf=O(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});var PI=lf(),II=ax(),NI=lx(),LI=df();hf.default={polling:ux,websocket:NI.WebSocket,webtransport:LI.WebTransport};function ux(r){return typeof r._query.j=="string"?new II.JSONP(r):new PI.Polling(r)}ux.upgradesTo=["websocket","webtransport"]});var vf=O(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.Socket=void 0;var DI=require("events"),BI=ke(),nn=require("timers"),Oe=(0,BI.default)("engine:socket"),gf=class extends DI.EventEmitter{get readyState(){return this._readyState}set readyState(e){Oe("readyState updated from %s to %s",this._readyState,e),this._readyState=e}constructor(e,t,n,s,i){super(),this._readyState="opening",this.upgrading=!1,this.upgraded=!1,this.writeBuffer=[],this.packetsFn=[],this.sentCallbackFn=[],this.cleanupFn=[],this.id=e,this.server=t,this.request=s,this.protocol=i,s&&(s.websocket&&s.websocket._socket?this.remoteAddress=s.websocket._socket.remoteAddress:this.remoteAddress=s.connection.remoteAddress),this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(n),this.onOpen()}onOpen(){this.readyState="open",this.transport.sid=this.id,this.sendPacket("open",JSON.stringify({sid:this.id,upgrades:this.getAvailableUpgrades(),pingInterval:this.server.opts.pingInterval,pingTimeout:this.server.opts.pingTimeout,maxPayload:this.server.opts.maxHttpBufferSize})),this.server.opts.initialPacket&&this.sendPacket("message",this.server.opts.initialPacket),this.emit("open"),this.protocol===3?this.resetPingTimeout():this.schedulePing()}onPacket(e){if(this.readyState!=="open")return Oe("packet received with closed socket");switch(Oe(`received packet ${e.type}`),this.emit("packet",e),e.type){case"ping":if(this.transport.protocol!==3){this.onError(new Error("invalid heartbeat direction"));return}Oe("got ping"),this.pingTimeoutTimer.refresh(),this.sendPacket("pong"),this.emit("heartbeat");break;case"pong":if(this.transport.protocol===3){this.onError(new Error("invalid heartbeat direction"));return}Oe("got pong"),(0,nn.clearTimeout)(this.pingTimeoutTimer),this.pingIntervalTimer.refresh(),this.emit("heartbeat");break;case"error":this.onClose("parse error");break;case"message":this.emit("data",e.data),this.emit("message",e.data);break}}onError(e){Oe("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,nn.setTimeout)(()=>{Oe("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,nn.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,nn.setTimeout)(()=>{this.readyState!=="closed"&&this.onClose("ping timeout")},this.protocol===3?this.server.opts.pingInterval+this.server.opts.pingTimeout:this.server.opts.pingTimeout)}setTransport(e){let t=this.onError.bind(this),n=()=>this.flush(),s=this.onPacket.bind(this),i=this.onDrain.bind(this),o=this.onClose.bind(this,"transport close");this.transport=e,this.transport.once("error",t),this.transport.on("ready",n),this.transport.on("packet",s),this.transport.on("drain",i),this.transport.once("close",o),this.cleanupFn.push(function(){e.removeListener("error",t),e.removeListener("ready",n),e.removeListener("packet",s),e.removeListener("drain",i),e.removeListener("close",o)})}onDrain(){if(this.sentCallbackFn.length>0){Oe("executing batch send callback");let e=this.sentCallbackFn.shift();if(e)for(let t=0;t<e.length;t++)e[t](this.transport)}}_maybeUpgrade(e){Oe('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;let t=(0,nn.setTimeout)(()=>{Oe("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),n,s=p=>{p.type==="ping"&&p.data==="probe"?(Oe("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(n),n=setInterval(i,100)):p.type==="upgrade"&&this.readyState!=="closed"?(Oe("got upgrade packet - upgrading"),o(),this.transport.discard(),this.upgraded=!0,this.clearTransport(),this.setTransport(e),this.emit("upgrade",e),this.flush(),this.readyState==="closing"&&e.close(()=>{this.onClose("forced close")})):(o(),e.close())},i=()=>{this.transport.name==="polling"&&this.transport.writable&&(Oe("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},o=()=>{this.upgrading=!1,clearInterval(n),(0,nn.clearTimeout)(t),e.removeListener("packet",s),e.removeListener("close",c),e.removeListener("error",a),this.removeListener("close",l)},a=p=>{Oe("client did not complete upgrade - %s",p),o(),e.close(),e=null},c=()=>{a("transport closed")},l=()=>{a("socket closed")};e.on("packet",s),e.once("close",c),e.once("error",a),this.once("close",l)}clearTransport(){let e,t=this.cleanupFn.length;for(let n=0;n<t;n++)e=this.cleanupFn.shift(),e();this.transport.on("error",function(){Oe("error triggered by discarded transport")}),this.transport.close(),(0,nn.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,nn.clearTimeout)(this.pingIntervalTimer),(0,nn.clearTimeout)(this.pingTimeoutTimer),process.nextTick(()=>{this.writeBuffer=[]}),this.packetsFn=[],this.sentCallbackFn=[],this.clearTransport(),this.emit("close",e,t))}send(e,t,n){return this.sendPacket("message",e,t,n),this}write(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n={},s){if(typeof n=="function"&&(s=n,n={}),this.readyState!=="closing"&&this.readyState!=="closed"){Oe('sending packet "%s" (%s)',e,t),n.compress=n.compress!==!1;let i={type:e,options:n};t&&(i.data=t),this.emit("packetCreate",i),this.writeBuffer.push(i),typeof s=="function"&&this.packetsFn.push(s),this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){Oe("flushing buffer to transport"),this.emit("flush",this.writeBuffer),this.server.emit("flush",this,this.writeBuffer);let e=this.writeBuffer;this.writeBuffer=[],this.packetsFn.length?(this.sentCallbackFn.push(this.packetsFn),this.packetsFn=[]):this.sentCallbackFn.push(null),this.transport.send(e),this.emit("drain"),this.server.emit("drain",this)}}getAvailableUpgrades(){let e=[],t=this.server.upgrades(this.transport.name);for(let n=0;n<t.length;++n){let s=t[n];this.server.opts.transports.indexOf(s)!==-1&&e.push(s)}return e}close(e){if(e&&(this.readyState==="open"||this.readyState==="closing"))return this.closeTransport(e);if(this.readyState==="open"){if(this.readyState="closing",this.writeBuffer.length){Oe("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{Oe("all packets have been sent, closing the transport"),this.closeTransport(e)});return}Oe("the buffer is empty, closing the transport right away"),this.closeTransport(e)}}closeTransport(e){Oe("closing the transport (discard? %s)",!!e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};_c.Socket=gf});var dx=O(yf=>{"use strict";yf.parse=WI;yf.serialize=GI;var jI=Object.prototype.toString,FI=Object.prototype.hasOwnProperty,HI=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,$I=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,UI=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,qI=/^[\u0020-\u003A\u003D-\u007E]*$/;function WI(r,e){if(typeof r!="string")throw new TypeError("argument str must be a string");var t={},n=r.length;if(n<2)return t;var s=e&&e.decode||zI,i=0,o=0,a=0;do{if(o=r.indexOf("=",i),o===-1)break;if(a=r.indexOf(";",i),a===-1)a=n;else if(o>a){i=r.lastIndexOf(";",o-1)+1;continue}var c=px(r,i,o),l=fx(r,o,c),p=r.slice(c,l);if(!FI.call(t,p)){var f=px(r,o+1,a),h=fx(r,a,f);r.charCodeAt(f)===34&&r.charCodeAt(h-1)===34&&(f++,h--);var x=r.slice(f,h);t[p]=KI(x,s)}i=a+1}while(i<n);return t}function px(r,e,t){do{var n=r.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<t);return t}function fx(r,e,t){for(;e>t;){var n=r.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return t}function GI(r,e,t){var n=t&&t.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!HI.test(r))throw new TypeError("argument name is invalid");var s=n(e);if(!$I.test(s))throw new TypeError("argument val is invalid");var i=r+"="+s;if(!t)return i;if(t.maxAge!=null){var o=Math.floor(t.maxAge);if(!isFinite(o))throw new TypeError("option maxAge is invalid");i+="; Max-Age="+o}if(t.domain){if(!UI.test(t.domain))throw new TypeError("option domain is invalid");i+="; Domain="+t.domain}if(t.path){if(!qI.test(t.path))throw new TypeError("option path is invalid");i+="; Path="+t.path}if(t.expires){var a=t.expires;if(!VI(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");i+="; Expires="+a.toUTCString()}if(t.httpOnly&&(i+="; HttpOnly"),t.secure&&(i+="; Secure"),t.partitioned&&(i+="; Partitioned"),t.priority){var c=typeof t.priority=="string"?t.priority.toLowerCase():t.priority;switch(c){case"low":i+="; Priority=Low";break;case"medium":i+="; Priority=Medium";break;case"high":i+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(t.sameSite){var l=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(l){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return i}function zI(r){return r.indexOf("%")!==-1?decodeURIComponent(r):r}function VI(r){return jI.call(r)==="[object Date]"}function KI(r,e){try{return e(r)}catch{return r}}});var sn=O((vW,gx)=>{"use strict";var hx=["nodebuffer","arraybuffer","fragments"],mx=typeof Blob<"u";mx&&hx.push("blob");gx.exports={BINARY_TYPES:hx,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:mx,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Px=O((yW,Mx)=>{var _x=require("fs"),on=require("path"),bx=require("os"),wx=typeof __webpack_require__=="function"?__non_webpack_require__:require,YI=process.config&&process.config.variables||{},XI=!!process.env.PREBUILDS_ONLY,vx=process.versions.modules,xf=ZI()?"electron":QI()?"node-webkit":"node",_f=process.env.npm_config_arch||bx.arch(),bf=process.env.npm_config_platform||bx.platform(),Sx=process.env.LIBC||(eN(bf)?"musl":"glibc"),wf=process.env.ARM_VERSION||(_f==="arm64"?"8":YI.arm_version)||"",Ex=(process.versions.uv||"").split(".")[0];Mx.exports=Hr;function Hr(r){return wx(Hr.resolve(r))}Hr.resolve=Hr.path=function(r){r=on.resolve(r||".");try{var e=wx(on.join(r,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(r=process.env[e+"_PREBUILD"])}catch{}if(!XI){var t=yx(on.join(r,"build/Release"),xx);if(t)return t;var n=yx(on.join(r,"build/Debug"),xx);if(n)return n}var s=a(r);if(s)return s;var i=a(on.dirname(process.execPath));if(i)return i;var o=["platform="+bf,"arch="+_f,"runtime="+xf,"abi="+vx,"uv="+Ex,wf?"armv="+wf:"","libc="+Sx,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"",typeof __webpack_require__=="function"?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+o+`
11
11
  loaded from: `+r+`
12
- `);function a(c){var u=xf(tn.join(c,"prebuilds")).map(x0),p=u.filter(y0(gf,mf)).sort(_0)[0];if(p){var f=tn.join(c,"prebuilds",p.name),m=xf(f).map(b0),y=m.filter(w0(hf,u0)),_=y.sort(S0(hf))[0];if(_)return tn.join(f,_.file)}}};function xf(r){try{return d0.readdirSync(r)}catch{return[]}}function p0(r,e){var t=xf(r).filter(e);return t[0]&&tn.join(r,t[0])}function f0(r){return/\.node$/.test(r)}function x0(r){var e=r.split("-");if(e.length===2){var t=e[0],n=e[1].split("+");if(t&&n.length&&n.every(Boolean))return{name:r,platform:t,architectures:n}}}function y0(r,e){return function(t){return t==null||t.platform!==r?!1:t.architectures.includes(e)}}function _0(r,e){return r.architectures.length-e.architectures.length}function b0(r){var e=r.split("."),t=e.pop(),n={file:r,specificity:0};if(t==="node"){for(var i=0;i<e.length;i++){var s=e[i];if(s==="node"||s==="electron"||s==="node-webkit")n.runtime=s;else if(s==="napi")n.napi=!0;else if(s.slice(0,3)==="abi")n.abi=s.slice(3);else if(s.slice(0,2)==="uv")n.uv=s.slice(2);else if(s.slice(0,4)==="armv")n.armv=s.slice(4);else if(s==="glibc"||s==="musl")n.libc=s;else continue;n.specificity++}return n}}function w0(r,e){return function(t){return!(t==null||t.runtime&&t.runtime!==r&&!LI(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==v0||t.armv&&t.armv!==vf||t.libc&&t.libc!==g0)}}function LI(r){return r.runtime==="node"&&r.napi}function S0(r){return function(e,t){return e.runtime!==t.runtime?e.runtime===r?-1:1:e.abi!==t.abi?e.abi?-1:1:e.specificity!==t.specificity?e.specificity>t.specificity?-1:1:0}}function DI(){return!!(process.versions&&process.versions.nw)}function BI(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function jI(r){return r==="linux"&&d0.existsSync("/etc/alpine-release")}Dr.parseTags=b0;Dr.matchTags=w0;Dr.compareTags=S0;Dr.parseTuple=x0;Dr.matchTuple=y0;Dr.compareTuples=_0});var bf=O((N6,_f)=>{var yf=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof yf.addon=="function"?_f.exports=yf.addon.bind(yf):_f.exports=T0()});var A0=O((L6,C0)=>{"use strict";var FI=(r,e,t,n,i)=>{for(var s=0;s<i;s++)t[n+s]=r[s]^e[s&3]},$I=(r,e)=>{let t=r.length;for(var n=0;n<t;n++)r[n]^=e[n&3]};C0.exports={mask:FI,unmask:$I}});var Sf=O((D6,wf)=>{"use strict";try{wf.exports=bf()(__dirname)}catch{wf.exports=A0()}});var go=O((B6,vc)=>{"use strict";var{EMPTY_BUFFER:HI}=en(),Ef=Buffer[Symbol.species];function UI(r,e){if(r.length===0)return HI;if(r.length===1)return r[0];let t=Buffer.allocUnsafe(e),n=0;for(let i=0;i<r.length;i++){let s=r[i];t.set(s,n),n+=s.length}return n<e?new Ef(t.buffer,t.byteOffset,n):t}function R0(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function k0(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function qI(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function Tf(r){if(Tf.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new Ef(r):ArrayBuffer.isView(r)?e=new Ef(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),Tf.readOnly=!1),e}vc.exports={concat:UI,mask:R0,toArrayBuffer:qI,toBuffer:Tf,unmask:k0};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=Sf();vc.exports.mask=function(e,t,n,i,s){s<48?R0(e,t,n,i,s):r.mask(e,t,n,i,s)},vc.exports.unmask=function(e,t){e.length<32?k0(e,t):r.unmask(e,t)}}catch{}});var P0=O((j6,M0)=>{"use strict";var O0=Symbol("kDone"),Cf=Symbol("kRun"),Af=class{constructor(e){this[O0]=()=>{this.pending--,this[Cf]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Cf]()}[Cf](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[O0])}}};M0.exports=Af});var xo=O((F6,D0)=>{"use strict";var vo=require("zlib"),I0=go(),WI=P0(),{kStatusCode:N0}=en(),GI=Buffer[Symbol.species],zI=Buffer.from([0,0,255,255]),yc=Symbol("permessage-deflate"),rn=Symbol("total-length"),zi=Symbol("callback"),Nn=Symbol("buffers"),Vi=Symbol("error"),xc,Rf=class{constructor(e,t,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!xc){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;xc=new WI(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[zi];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,n=e.find(i=>!(t.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>i.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(n=>{let i=t[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}"`);t[n]=i})}),e}decompress(e,t,n){xc.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){xc.add(i=>{this._compress(e,t,(s,o)=>{i(),n(s,o)})})}_decompress(e,t,n){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?vo.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=vo.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[yc]=this,this._inflate[rn]=0,this._inflate[Nn]=[],this._inflate.on("error",KI),this._inflate.on("data",L0)}this._inflate[zi]=n,this._inflate.write(e),t&&this._inflate.write(zI),this._inflate.flush(()=>{let s=this._inflate[Vi];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=I0.concat(this._inflate[Nn],this._inflate[rn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[rn]=0,this._inflate[Nn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?vo.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=vo.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[rn]=0,this._deflate[Nn]=[],this._deflate.on("data",VI)}this._deflate[zi]=n,this._deflate.write(e),this._deflate.flush(vo.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=I0.concat(this._deflate[Nn],this._deflate[rn]);t&&(s=new GI(s.buffer,s.byteOffset,s.length-4)),this._deflate[zi]=null,this._deflate[rn]=0,this._deflate[Nn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};D0.exports=Rf;function VI(r){this[Nn].push(r),this[rn]+=r.length}function L0(r){if(this[rn]+=r.length,this[yc]._maxPayload<1||this[rn]<=this[yc]._maxPayload){this[Nn].push(r);return}this[Vi]=new RangeError("Max payload size exceeded"),this[Vi].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Vi][N0]=1009,this.removeListener("data",L0),this.reset()}function KI(r){if(this[yc]._inflate=null,this[Vi]){this[zi](this[Vi]);return}r[N0]=1007,this[zi](r)}});var j0=O(($6,B0)=>{"use strict";function YI(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}B0.exports=YI});var Of=O((H6,kf)=>{"use strict";try{kf.exports=bf()(__dirname)}catch{kf.exports=j0()}});var Ki=O((U6,_c)=>{"use strict";var{isUtf8:F0}=require("buffer"),{hasBlob:XI}=en(),JI=[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 QI(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function Mf(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}function ZI(r){return XI&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}_c.exports={isBlob:ZI,isValidStatusCode:QI,isValidUTF8:Mf,tokenChars:JI};if(F0)_c.exports.isValidUTF8=function(r){return r.length<24?Mf(r):F0(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=Of();_c.exports.isValidUTF8=function(e){return e.length<32?Mf(e):r(e)}}catch{}});var Df=O((q6,z0)=>{"use strict";var{Writable:eN}=require("stream"),$0=xo(),{BINARY_TYPES:tN,EMPTY_BUFFER:H0,kStatusCode:rN,kWebSocket:nN}=en(),{concat:Pf,toArrayBuffer:iN,unmask:sN}=go(),{isValidStatusCode:oN,isValidUTF8:U0}=Ki(),bc=Buffer[Symbol.species],nr=0,q0=1,W0=2,G0=3,If=4,Nf=5,wc=6,Lf=class extends eN{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||tN[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[nN]=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=nr}_write(e,t,n){if(this._opcode===8&&this._state==nr)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new bc(n.buffer,n.byteOffset+e,n.length-e),new bc(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],i=t.length-e;e>=n.length?t.set(this._buffers.shift(),i):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),i),this._buffers[0]=new bc(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case nr:this.getInfo(e);break;case q0:this.getPayloadLength16(e);break;case W0:this.getPayloadLength64(e);break;case G0:this.getMask();break;case If:this.getData(e);break;case Nf:case wc:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let n=(t[0]&64)===64;if(n&&!this._extensions[$0.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(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");e(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");e(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(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");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=q0:this._payloadLength===127?this._state=W0:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.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");e(i);return}this._payloadLength=n*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=G0:this._state=If}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=If}getData(e){let t=H0;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&sN(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=Nf,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[$0.extensionName].decompress(e,this._fin,(i,s)=>{if(i)return t(i);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._fragments.push(s)}this.dataMessage(t),this._state===nr&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=nr;return}let t=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=Pf(n,t):this._binaryType==="arraybuffer"?i=iN(Pf(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=nr):(this._state=wc,setImmediate(()=>{this.emit("message",i,!0),this._state=nr,this.startLoop(e)}))}else{let i=Pf(n,t);if(!this._skipUTF8Validation&&!U0(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===Nf||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=nr):(this._state=wc,setImmediate(()=>{this.emit("message",i,!1),this._state=nr,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,H0),this.end();else{let n=e.readUInt16BE(0);if(!oN(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new bc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!U0(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=nr;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=nr):(this._state=wc,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=nr,this.startLoop(t)}))}createError(e,t,n,i,s){this._loop=!1,this._errored=!0;let o=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=s,o[rN]=i,o}};z0.exports=Lf});var Ff=O((G6,Y0)=>{"use strict";var{Duplex:W6}=require("stream"),{randomFillSync:aN}=require("crypto"),V0=xo(),{EMPTY_BUFFER:cN,kWebSocket:lN,NOOP:uN}=en(),{isBlob:Yi,isValidStatusCode:pN}=Ki(),{mask:K0,toBuffer:Zn}=go(),ir=Symbol("kByteLength"),fN=Buffer.alloc(4),Sc=8*1024,ei,Xi=Sc,Sr=0,dN=1,hN=2,Bf=class r{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Sr,this.onerror=uN,this[lN]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||fN,t.generateMask?t.generateMask(n):(Xi===Sc&&(ei===void 0&&(ei=Buffer.alloc(Sc)),aN(ei,0,Sc),Xi=0),n[0]=ei[Xi++],n[1]=ei[Xi++],n[2]=ei[Xi++],n[3]=ei[Xi++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[ir]!==void 0?a=t[ir]:(e=Buffer.from(e),a=e.length):(a=e.length,i=t.mask&&t.readOnly&&!o);let c=a;a>=65536?(s+=8,c=127):a>125&&(s+=2,c=126);let u=Buffer.allocUnsafe(i?a+s:s);return u[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),t.mask?(u[1]|=128,u[s-4]=n[0],u[s-3]=n[1],u[s-2]=n[2],u[s-1]=n[3],o?[u,e]:i?(K0(e,n,u,s,a),[u]):(K0(e,n,e,0,a),[u,e])):[u,e]}close(e,t,n,i){let s;if(e===void 0)s=cN;else{if(typeof e!="number"||!pN(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+a),s.writeUInt16BE(e,0),typeof t=="string"?s.write(t,2):s.set(t,2)}}let o={[ir]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Sr?this.enqueue([this.dispatch,s,!1,o,i]):this.sendFrame(r.frame(s,o),i)}ping(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):Yi(e)?(i=e.size,s=!1):(e=Zn(e),i=e.length,s=Zn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[ir]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};Yi(e)?this._state!==Sr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Sr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}pong(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):Yi(e)?(i=e.size,s=!1):(e=Zn(e),i=e.length,s=Zn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[ir]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};Yi(e)?this._state!==Sr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Sr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let i=this._extensions[V0.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):Yi(e)?(a=e.size,c=!1):(e=Zn(e),a=e.length,c=Zn.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=i._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let u={[ir]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};Yi(e)?this._state!==Sr?this.enqueue([this.getBlobData,e,this._compress,u,n]):this.getBlobData(e,this._compress,u,n):this._state!==Sr?this.enqueue([this.dispatch,e,this._compress,u,n]):this.dispatch(e,this._compress,u,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[ir],this._state=hN,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(jf,this,a,i);return}this._bufferedBytes-=n[ir];let o=Zn(s);t?this.dispatch(o,t,n,i):(this._state=Sr,this.sendFrame(r.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(mN,this,s,i)})}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[V0.extensionName];this._bufferedBytes+=n[ir],this._state=dN,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");jf(this,c,i);return}this._bufferedBytes-=n[ir],this._state=Sr,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===Sr&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][ir],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][ir],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};Y0.exports=Bf;function jf(r,e,t){typeof t=="function"&&t(e);for(let n=0;n<r._queue.length;n++){let i=r._queue[n],s=i[i.length-1];typeof s=="function"&&s(e)}}function mN(r,e,t){jf(r,e,t),r.onerror(e)}});var iy=O((z6,ny)=>{"use strict";var{kForOnEventAttribute:yo,kListener:$f}=en(),X0=Symbol("kCode"),J0=Symbol("kData"),Q0=Symbol("kError"),Z0=Symbol("kMessage"),ey=Symbol("kReason"),Ji=Symbol("kTarget"),ty=Symbol("kType"),ry=Symbol("kWasClean"),nn=class{constructor(e){this[Ji]=null,this[ty]=e}get target(){return this[Ji]}get type(){return this[ty]}};Object.defineProperty(nn.prototype,"target",{enumerable:!0});Object.defineProperty(nn.prototype,"type",{enumerable:!0});var ti=class extends nn{constructor(e,t={}){super(e),this[X0]=t.code===void 0?0:t.code,this[ey]=t.reason===void 0?"":t.reason,this[ry]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[X0]}get reason(){return this[ey]}get wasClean(){return this[ry]}};Object.defineProperty(ti.prototype,"code",{enumerable:!0});Object.defineProperty(ti.prototype,"reason",{enumerable:!0});Object.defineProperty(ti.prototype,"wasClean",{enumerable:!0});var Qi=class extends nn{constructor(e,t={}){super(e),this[Q0]=t.error===void 0?null:t.error,this[Z0]=t.message===void 0?"":t.message}get error(){return this[Q0]}get message(){return this[Z0]}};Object.defineProperty(Qi.prototype,"error",{enumerable:!0});Object.defineProperty(Qi.prototype,"message",{enumerable:!0});var _o=class extends nn{constructor(e,t={}){super(e),this[J0]=t.data===void 0?null:t.data}get data(){return this[J0]}};Object.defineProperty(_o.prototype,"data",{enumerable:!0});var gN={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[yo]&&i[$f]===e&&!i[yo])return;let n;if(r==="message")n=function(s,o){let a=new _o("message",{data:o?s:s.toString()});a[Ji]=this,Ec(e,this,a)};else if(r==="close")n=function(s,o){let a=new ti("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Ji]=this,Ec(e,this,a)};else if(r==="error")n=function(s){let o=new Qi("error",{error:s,message:s.message});o[Ji]=this,Ec(e,this,o)};else if(r==="open")n=function(){let s=new nn("open");s[Ji]=this,Ec(e,this,s)};else return;n[yo]=!!t[yo],n[$f]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[$f]===e&&!t[yo]){this.removeListener(r,t);break}}};ny.exports={CloseEvent:ti,ErrorEvent:Qi,Event:nn,EventTarget:gN,MessageEvent:_o};function Ec(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var Hf=O((V6,sy)=>{"use strict";var{tokenChars:bo}=Ki();function Br(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function vN(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,u=-1,p=-1,f=0;for(;f<r.length;f++)if(u=r.charCodeAt(f),o===void 0)if(p===-1&&bo[u]===1)c===-1&&(c=f);else if(f!==0&&(u===32||u===9))p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);u===44?(Br(e,y,t),t=Object.create(null)):o=y,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(p===-1&&bo[u]===1)c===-1&&(c=f);else if(u===32||u===9)p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f),Br(t,r.slice(c,p),!0),u===44&&(Br(e,o,t),t=Object.create(null),o=void 0),c=p=-1}else if(u===61&&c!==-1&&p===-1)a=r.slice(c,f),c=p=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(bo[u]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if(bo[u]===1)c===-1&&(c=f);else if(u===34&&c!==-1)s=!1,p=f;else if(u===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(u===34&&r.charCodeAt(f-1)===61)s=!0;else if(p===-1&&bo[u]===1)c===-1&&(c=f);else if(c!==-1&&(u===32||u===9))p===-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);n&&(y=y.replace(/\\/g,""),n=!1),Br(t,a,y),u===44&&(Br(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||u===32||u===9)throw new SyntaxError("Unexpected end of input");p===-1&&(p=f);let m=r.slice(c,p);return o===void 0?Br(e,m,t):(a===void 0?Br(t,m,!0):n?Br(t,a,m.replace(/\\/g,"")):Br(t,a,m),Br(e,o,t)),e}function xN(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(i=>{let s=n[i];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}sy.exports={format:xN,parse:vN}});var Rc=O((X6,vy)=>{"use strict";var yN=require("events"),_N=require("https"),bN=require("http"),cy=require("net"),wN=require("tls"),{randomBytes:SN,createHash:EN}=require("crypto"),{Duplex:K6,Readable:Y6}=require("stream"),{URL:Uf}=require("url"),Ln=xo(),TN=Df(),CN=Ff(),{isBlob:AN}=Ki(),{BINARY_TYPES:oy,EMPTY_BUFFER:Tc,GUID:RN,kForOnEventAttribute:qf,kListener:kN,kStatusCode:ON,kWebSocket:ft,NOOP:ly}=en(),{EventTarget:{addEventListener:MN,removeEventListener:PN}}=iy(),{format:IN,parse:NN}=Hf(),{toBuffer:LN}=go(),DN=30*1e3,uy=Symbol("kAborted"),Wf=[8,13],sn=["CONNECTING","OPEN","CLOSING","CLOSED"],BN=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,we=class r extends yN{constructor(e,t,n){super(),this._binaryType=oy[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Tc,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(n=t,t=[]):t=[t]),py(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){oy.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,n){let i=new TN({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new CN(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[ft]=this,s[ft]=this,e[ft]=this,i.on("conclude",$N),i.on("drain",HN),i.on("error",UN),i.on("message",qN),i.on("ping",WN),i.on("pong",GN),s.onerror=zN,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",hy),e.on("data",Ac),e.on("end",my),e.on("error",gy),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Ln.extensionName]&&this._extensions[Ln.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Kt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),dy(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Gf(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||Tc,t,n)}pong(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Gf(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||Tc,t,n)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(n=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Gf(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[Ln.extensionName]||(i.compress=!1),this._sender.send(e||Tc,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Kt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(we,"CONNECTING",{enumerable:!0,value:sn.indexOf("CONNECTING")});Object.defineProperty(we.prototype,"CONNECTING",{enumerable:!0,value:sn.indexOf("CONNECTING")});Object.defineProperty(we,"OPEN",{enumerable:!0,value:sn.indexOf("OPEN")});Object.defineProperty(we.prototype,"OPEN",{enumerable:!0,value:sn.indexOf("OPEN")});Object.defineProperty(we,"CLOSING",{enumerable:!0,value:sn.indexOf("CLOSING")});Object.defineProperty(we.prototype,"CLOSING",{enumerable:!0,value:sn.indexOf("CLOSING")});Object.defineProperty(we,"CLOSED",{enumerable:!0,value:sn.indexOf("CLOSED")});Object.defineProperty(we.prototype,"CLOSED",{enumerable:!0,value:sn.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(we.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(we.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[qf])return e[kN];return null},set(e){for(let t of this.listeners(r))if(t[qf]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[qf]:!0})}})});we.prototype.addEventListener=MN;we.prototype.removeEventListener=PN;vy.exports=we;function py(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Wf[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(r._autoPong=i.autoPong,!Wf.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Wf.join(", ")})`);let s;if(e instanceof Uf)s=e;else try{s=new Uf(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),r._url=s.href;let o=s.protocol==="wss:",a=s.protocol==="ws+unix:",c;if(s.protocol!=="ws:"&&!o&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let S=new SyntaxError(c);if(r._redirects===0)throw S;Cc(r,S);return}let u=o?443:80,p=SN(16).toString("base64"),f=o?_N.request:bN.request,m=new Set,y;if(i.createConnection=i.createConnection||(o?FN:jN),i.defaultPort=i.defaultPort||u,i.port=s.port||u,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":p,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(y=new Ln(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=IN({[Ln.extensionName]:y.offer()})),t.length){for(let S of t){if(typeof S!="string"||!BN.test(S)||m.has(S))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(S)}i.headers["Sec-WebSocket-Protocol"]=t.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}`),a){let S=i.path.split(":");i.socketPath=S[0],i.path=S[1]}let _;if(i.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=o,r._originalHostOrSocketPath=a?i.socketPath:s.host;let S=n&&n.headers;if(n={...n,headers:{}},S)for(let[A,M]of Object.entries(S))n.headers[A.toLowerCase()]=M}else if(r.listenerCount("redirect")===0){let S=a?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:s.host===r._originalHostOrSocketPath;(!S||r._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,S||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),_=r._req=f(i),r._redirects&&r.emit("redirect",r.url,_)}else _=r._req=f(i);i.timeout&&_.on("timeout",()=>{Kt(r,_,"Opening handshake has timed out")}),_.on("error",S=>{_===null||_[uy]||(_=r._req=null,Cc(r,S))}),_.on("response",S=>{let A=S.headers.location,M=S.statusCode;if(A&&i.followRedirects&&M>=300&&M<400){if(++r._redirects>i.maxRedirects){Kt(r,_,"Maximum redirects exceeded");return}_.abort();let L;try{L=new Uf(A,e)}catch{let j=new SyntaxError(`Invalid URL: ${A}`);Cc(r,j);return}py(r,L,t,n)}else r.emit("unexpected-response",_,S)||Kt(r,_,`Unexpected server response: ${S.statusCode}`)}),_.on("upgrade",(S,A,M)=>{if(r.emit("upgrade",S),r.readyState!==we.CONNECTING)return;_=r._req=null;let L=S.headers.upgrade;if(L===void 0||L.toLowerCase()!=="websocket"){Kt(r,A,"Invalid Upgrade header");return}let N=EN("sha1").update(p+RN).digest("base64");if(S.headers["sec-websocket-accept"]!==N){Kt(r,A,"Invalid Sec-WebSocket-Accept header");return}let j=S.headers["sec-websocket-protocol"],W;if(j!==void 0?m.size?m.has(j)||(W="Server sent an invalid subprotocol"):W="Server sent a subprotocol but none was requested":m.size&&(W="Server sent no subprotocol"),W){Kt(r,A,W);return}j&&(r._protocol=j);let q=S.headers["sec-websocket-extensions"];if(q!==void 0){if(!y){Kt(r,A,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let G;try{G=NN(q)}catch{Kt(r,A,"Invalid Sec-WebSocket-Extensions header");return}let P=Object.keys(G);if(P.length!==1||P[0]!==Ln.extensionName){Kt(r,A,"Server indicated an extension that was not requested");return}try{y.accept(G[Ln.extensionName])}catch{Kt(r,A,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[Ln.extensionName]=y}r.setSocket(A,M,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(_,r):_.end()}function Cc(r,e){r._readyState=we.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function jN(r){return r.path=r.socketPath,cy.connect(r)}function FN(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=cy.isIP(r.host)?"":r.host),wN.connect(r)}function Kt(r,e,t){r._readyState=we.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Kt),e.setHeader?(e[uy]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Cc,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Gf(r,e,t){if(e){let n=AN(e)?e.size:LN(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${sn[r.readyState]})`);process.nextTick(t,n)}}function $N(r,e){let t=this[ft];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[ft]!==void 0&&(t._socket.removeListener("data",Ac),process.nextTick(fy,t._socket),r===1005?t.close():t.close(r,e))}function HN(){let r=this[ft];r.isPaused||r._socket.resume()}function UN(r){let e=this[ft];e._socket[ft]!==void 0&&(e._socket.removeListener("data",Ac),process.nextTick(fy,e._socket),e.close(r[ON])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function ay(){this[ft].emitClose()}function qN(r,e){this[ft].emit("message",r,e)}function WN(r){let e=this[ft];e._autoPong&&e.pong(r,!this._isServer,ly),e.emit("ping",r)}function GN(r){this[ft].emit("pong",r)}function fy(r){r.resume()}function zN(r){let e=this[ft];e.readyState!==we.CLOSED&&(e.readyState===we.OPEN&&(e._readyState=we.CLOSING,dy(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function dy(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),DN)}function hy(){let r=this[ft];this.removeListener("close",hy),this.removeListener("data",Ac),this.removeListener("end",my),r._readyState=we.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[ft]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",ay),r._receiver.on("finish",ay))}function Ac(r){this[ft]._receiver.write(r)||this.pause()}function my(){let r=this[ft];r._readyState=we.CLOSING,r._receiver.end(),this.end()}function gy(){let r=this[ft];this.removeListener("error",gy),this.on("error",ly),r&&(r._readyState=we.CLOSING,this.destroy())}});var by=O((Q6,_y)=>{"use strict";var J6=Rc(),{Duplex:VN}=require("stream");function xy(r){r.emit("close")}function KN(){!this.destroyed&&this._writableState.finished&&this.destroy()}function yy(r){this.removeListener("error",yy),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function YN(r,e){let t=!0,n=new VN({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(s,o){let a=!o&&n._readableState.objectMode?s.toString():s;n.push(a)||r.pause()}),r.once("error",function(s){n.destroyed||(t=!1,n.destroy(s))}),r.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,s){if(r.readyState===r.CLOSED){s(i),process.nextTick(xy,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(xy,n)}),t&&r.terminate()},n._final=function(i){if(r.readyState===r.CONNECTING){r.once("open",function(){n._final(i)});return}r._socket!==null&&(r._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(r._socket.once("finish",function(){i()}),r.close()))},n._read=function(){r.isPaused&&r.resume()},n._write=function(i,s,o){if(r.readyState===r.CONNECTING){r.once("open",function(){n._write(i,s,o)});return}r.send(i,o)},n.on("end",KN),n.on("error",yy),n}_y.exports=YN});var Sy=O((Z6,wy)=>{"use strict";var{tokenChars:XN}=Ki();function JN(r){let e=new Set,t=-1,n=-1,i=0;for(i;i<r.length;i++){let o=r.charCodeAt(i);if(n===-1&&XN[o]===1)t===-1&&(t=i);else if(i!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=i);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=r.slice(t,n);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=r.slice(t,i);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}wy.exports={parse:JN}});var Oy=O((tW,ky)=>{"use strict";var QN=require("events"),kc=require("http"),{Duplex:eW}=require("stream"),{createHash:ZN}=require("crypto"),Ey=Hf(),ri=xo(),eL=Sy(),tL=Rc(),{GUID:rL,kWebSocket:nL}=en(),iL=/^[+/0-9A-Za-z]{22}==$/,Ty=0,Cy=1,Ry=2,zf=class extends QN{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:tL,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=kc.createServer((n,i)=>{let s=kc.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=sL(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,s,o)=>{this.handleUpgrade(i,s,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=Ty}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===Ry){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(wo,this);return}if(e&&this.once("close",e),this._state!==Cy)if(this._state=Cy,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(wo,this):process.nextTick(wo,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{wo(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,i){t.on("error",Ay);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){ni(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){ni(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!iL.test(s)){ni(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){ni(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){So(t,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=eL.parse(c)}catch{ni(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let p=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&p!==void 0){let m=new ri(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let y=Ey.parse(p);y[ri.extensionName]&&(m.accept(y[ri.extensionName]),f[ri.extensionName]=m)}catch{ni(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(y,_,S,A)=>{if(!y)return So(t,_||401,S,A);this.completeUpgrade(f,s,u,e,t,n,i)});return}if(!this.options.verifyClient(m))return So(t,401)}this.completeUpgrade(f,s,u,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[nL])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Ty)return So(s,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${ZN("sha1").update(t+rL).digest("base64")}`],p=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;f&&(u.push(`Sec-WebSocket-Protocol: ${f}`),p._protocol=f)}if(e[ri.extensionName]){let f=e[ri.extensionName].params,m=Ey.format({[ri.extensionName]:[f]});u.push(`Sec-WebSocket-Extensions: ${m}`),p._extensions=e}this.emit("headers",u,i),s.write(u.concat(`\r
12
+ `);function a(c){var l=Sf(on.join(c,"prebuilds")).map(Tx),p=l.filter(Cx(bf,_f)).sort(Ax)[0];if(p){var f=on.join(c,"prebuilds",p.name),h=Sf(f).map(Rx),x=h.filter(kx(xf,vx)),_=x.sort(Ox(xf))[0];if(_)return on.join(f,_.file)}}};function Sf(r){try{return _x.readdirSync(r)}catch{return[]}}function yx(r,e){var t=Sf(r).filter(e);return t[0]&&on.join(r,t[0])}function xx(r){return/\.node$/.test(r)}function Tx(r){var e=r.split("-");if(e.length===2){var t=e[0],n=e[1].split("+");if(t&&n.length&&n.every(Boolean))return{name:r,platform:t,architectures:n}}}function Cx(r,e){return function(t){return t==null||t.platform!==r?!1:t.architectures.includes(e)}}function Ax(r,e){return r.architectures.length-e.architectures.length}function Rx(r){var e=r.split("."),t=e.pop(),n={file:r,specificity:0};if(t==="node"){for(var s=0;s<e.length;s++){var i=e[s];if(i==="node"||i==="electron"||i==="node-webkit")n.runtime=i;else if(i==="napi")n.napi=!0;else if(i.slice(0,3)==="abi")n.abi=i.slice(3);else if(i.slice(0,2)==="uv")n.uv=i.slice(2);else if(i.slice(0,4)==="armv")n.armv=i.slice(4);else if(i==="glibc"||i==="musl")n.libc=i;else continue;n.specificity++}return n}}function kx(r,e){return function(t){return!(t==null||t.runtime&&t.runtime!==r&&!JI(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==Ex||t.armv&&t.armv!==wf||t.libc&&t.libc!==Sx)}}function JI(r){return r.runtime==="node"&&r.napi}function Ox(r){return function(e,t){return e.runtime!==t.runtime?e.runtime===r?-1:1:e.abi!==t.abi?e.abi?-1:1:e.specificity!==t.specificity?e.specificity>t.specificity?-1:1:0}}function QI(){return!!(process.versions&&process.versions.nw)}function ZI(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function eN(r){return r==="linux"&&_x.existsSync("/etc/alpine-release")}Hr.parseTags=Rx;Hr.matchTags=kx;Hr.compareTags=Ox;Hr.parseTuple=Tx;Hr.matchTuple=Cx;Hr.compareTuples=Ax});var Cf=O((xW,Tf)=>{var Ef=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof Ef.addon=="function"?Tf.exports=Ef.addon.bind(Ef):Tf.exports=Px()});var Nx=O((_W,Ix)=>{"use strict";var tN=(r,e,t,n,s)=>{for(var i=0;i<s;i++)t[n+i]=r[i]^e[i&3]},rN=(r,e)=>{let t=r.length;for(var n=0;n<t;n++)r[n]^=e[n&3]};Ix.exports={mask:tN,unmask:rN}});var Rf=O((bW,Af)=>{"use strict";try{Af.exports=Cf()(__dirname)}catch{Af.exports=Nx()}});var _o=O((wW,bc)=>{"use strict";var{EMPTY_BUFFER:nN}=sn(),kf=Buffer[Symbol.species];function sN(r,e){if(r.length===0)return nN;if(r.length===1)return r[0];let t=Buffer.allocUnsafe(e),n=0;for(let s=0;s<r.length;s++){let i=r[s];t.set(i,n),n+=i.length}return n<e?new kf(t.buffer,t.byteOffset,n):t}function Lx(r,e,t,n,s){for(let i=0;i<s;i++)t[n+i]=r[i]^e[i&3]}function Dx(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function iN(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function Of(r){if(Of.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new kf(r):ArrayBuffer.isView(r)?e=new kf(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),Of.readOnly=!1),e}bc.exports={concat:sN,mask:Lx,toArrayBuffer:iN,toBuffer:Of,unmask:Dx};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=Rf();bc.exports.mask=function(e,t,n,s,i){i<48?Lx(e,t,n,s,i):r.mask(e,t,n,s,i)},bc.exports.unmask=function(e,t){e.length<32?Dx(e,t):r.unmask(e,t)}}catch{}});var Fx=O((SW,jx)=>{"use strict";var Bx=Symbol("kDone"),Mf=Symbol("kRun"),Pf=class{constructor(e){this[Bx]=()=>{this.pending--,this[Mf]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Mf]()}[Mf](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[Bx])}}};jx.exports=Pf});var wo=O((EW,qx)=>{"use strict";var bo=require("zlib"),Hx=_o(),oN=Fx(),{kStatusCode:$x}=sn(),aN=Buffer[Symbol.species],cN=Buffer.from([0,0,255,255]),Sc=Symbol("permessage-deflate"),an=Symbol("total-length"),Xs=Symbol("callback"),Bn=Symbol("buffers"),Js=Symbol("error"),wc,If=class{constructor(e,t,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!wc){let s=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;wc=new oN(s)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[Xs];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,n=e.find(s=>!(t.serverNoContextTakeover===!1&&s.server_no_context_takeover||s.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>s.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!s.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(n=>{let s=t[n];if(s.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(s=s[0],n==="client_max_window_bits"){if(s!==!0){let i=+s;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${n}": ${s}`);s=i}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${s}`)}else if(n==="server_max_window_bits"){let i=+s;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${n}": ${s}`);s=i}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(s!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${s}`)}else throw new Error(`Unknown parameter "${n}"`);t[n]=s})}),e}decompress(e,t,n){wc.add(s=>{this._decompress(e,t,(i,o)=>{s(),n(i,o)})})}compress(e,t,n){wc.add(s=>{this._compress(e,t,(i,o)=>{s(),n(i,o)})})}_decompress(e,t,n){let s=this._isServer?"client":"server";if(!this._inflate){let i=`${s}_max_window_bits`,o=typeof this.params[i]!="number"?bo.Z_DEFAULT_WINDOWBITS:this.params[i];this._inflate=bo.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[Sc]=this,this._inflate[an]=0,this._inflate[Bn]=[],this._inflate.on("error",uN),this._inflate.on("data",Ux)}this._inflate[Xs]=n,this._inflate.write(e),t&&this._inflate.write(cN),this._inflate.flush(()=>{let i=this._inflate[Js];if(i){this._inflate.close(),this._inflate=null,n(i);return}let o=Hx.concat(this._inflate[Bn],this._inflate[an]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[an]=0,this._inflate[Bn]=[],t&&this.params[`${s}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let s=this._isServer?"server":"client";if(!this._deflate){let i=`${s}_max_window_bits`,o=typeof this.params[i]!="number"?bo.Z_DEFAULT_WINDOWBITS:this.params[i];this._deflate=bo.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[an]=0,this._deflate[Bn]=[],this._deflate.on("data",lN)}this._deflate[Xs]=n,this._deflate.write(e),this._deflate.flush(bo.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let i=Hx.concat(this._deflate[Bn],this._deflate[an]);t&&(i=new aN(i.buffer,i.byteOffset,i.length-4)),this._deflate[Xs]=null,this._deflate[an]=0,this._deflate[Bn]=[],t&&this.params[`${s}_no_context_takeover`]&&this._deflate.reset(),n(null,i)})}};qx.exports=If;function lN(r){this[Bn].push(r),this[an]+=r.length}function Ux(r){if(this[an]+=r.length,this[Sc]._maxPayload<1||this[an]<=this[Sc]._maxPayload){this[Bn].push(r);return}this[Js]=new RangeError("Max payload size exceeded"),this[Js].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Js][$x]=1009,this.removeListener("data",Ux),this.reset()}function uN(r){if(this[Sc]._inflate=null,this[Js]){this[Xs](this[Js]);return}r[$x]=1007,this[Xs](r)}});var Gx=O((TW,Wx)=>{"use strict";function pN(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}Wx.exports=pN});var Lf=O((CW,Nf)=>{"use strict";try{Nf.exports=Cf()(__dirname)}catch{Nf.exports=Gx()}});var Qs=O((AW,Ec)=>{"use strict";var{isUtf8:zx}=require("buffer"),{hasBlob:fN}=sn(),dN=[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 hN(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function Df(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}function mN(r){return fN&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}Ec.exports={isBlob:mN,isValidStatusCode:hN,isValidUTF8:Df,tokenChars:dN};if(zx)Ec.exports.isValidUTF8=function(r){return r.length<24?Df(r):zx(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=Lf();Ec.exports.isValidUTF8=function(e){return e.length<32?Df(e):r(e)}}catch{}});var $f=O((RW,Zx)=>{"use strict";var{Writable:gN}=require("stream"),Vx=wo(),{BINARY_TYPES:vN,EMPTY_BUFFER:Kx,kStatusCode:yN,kWebSocket:xN}=sn(),{concat:Bf,toArrayBuffer:_N,unmask:bN}=_o(),{isValidStatusCode:wN,isValidUTF8:Yx}=Qs(),Tc=Buffer[Symbol.species],or=0,Xx=1,Jx=2,Qx=3,jf=4,Ff=5,Cc=6,Hf=class extends gN{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||vN[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[xN]=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=or}_write(e,t,n){if(this._opcode===8&&this._state==or)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new Tc(n.buffer,n.byteOffset+e,n.length-e),new Tc(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],s=t.length-e;e>=n.length?t.set(this._buffers.shift(),s):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),s),this._buffers[0]=new Tc(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case or:this.getInfo(e);break;case Xx:this.getPayloadLength16(e);break;case Jx:this.getPayloadLength64(e);break;case Qx:this.getMask();break;case jf:this.getData(e);break;case Ff:case Cc:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let s=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(s);return}let n=(t[0]&64)===64;if(n&&!this._extensions[Vx.extensionName]){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(s);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(s);return}if(!this._fragmented){let s=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(s);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let s=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(s);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let s=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(s);return}if(n){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(s);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let s=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(s);return}}else{let s=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(s);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let s=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(s);return}}else if(this._masked){let s=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(s);return}this._payloadLength===126?this._state=Xx:this._payloadLength===127?this._state=Jx:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>Math.pow(2,21)-1){let s=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(s);return}this._payloadLength=n*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=Qx:this._state=jf}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=jf}getData(e){let t=Kx;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&bN(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=Ff,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[Vx.extensionName].decompress(e,this._fin,(s,i)=>{if(s)return t(s);if(i.length){if(this._messageLength+=i.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._fragments.push(i)}this.dataMessage(t),this._state===or&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=or;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let s;this._binaryType==="nodebuffer"?s=Bf(n,t):this._binaryType==="arraybuffer"?s=_N(Bf(n,t)):this._binaryType==="blob"?s=new Blob(n):s=n,this._allowSynchronousEvents?(this.emit("message",s,!0),this._state=or):(this._state=Cc,setImmediate(()=>{this.emit("message",s,!0),this._state=or,this.startLoop(e)}))}else{let s=Bf(n,t);if(!this._skipUTF8Validation&&!Yx(s)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(i);return}this._state===Ff||this._allowSynchronousEvents?(this.emit("message",s,!1),this._state=or):(this._state=Cc,setImmediate(()=>{this.emit("message",s,!1),this._state=or,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Kx),this.end();else{let n=e.readUInt16BE(0);if(!wN(n)){let i=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(i);return}let s=new Tc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Yx(s)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(i);return}this._loop=!1,this.emit("conclude",n,s),this.end()}this._state=or;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=or):(this._state=Cc,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=or,this.startLoop(t)}))}createError(e,t,n,s,i){this._loop=!1,this._errored=!0;let o=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=i,o[yN]=s,o}};Zx.exports=Hf});var Wf=O((OW,r0)=>{"use strict";var{Duplex:kW}=require("stream"),{randomFillSync:SN}=require("crypto"),e0=wo(),{EMPTY_BUFFER:EN,kWebSocket:TN,NOOP:CN}=sn(),{isBlob:Zs,isValidStatusCode:AN}=Qs(),{mask:t0,toBuffer:rs}=_o(),ar=Symbol("kByteLength"),RN=Buffer.alloc(4),Ac=8*1024,ns,ei=Ac,Ar=0,kN=1,ON=2,Uf=class r{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Ar,this.onerror=CN,this[TN]=void 0}static frame(e,t){let n,s=!1,i=2,o=!1;t.mask&&(n=t.maskBuffer||RN,t.generateMask?t.generateMask(n):(ei===Ac&&(ns===void 0&&(ns=Buffer.alloc(Ac)),SN(ns,0,Ac),ei=0),n[0]=ns[ei++],n[1]=ns[ei++],n[2]=ns[ei++],n[3]=ns[ei++]),o=(n[0]|n[1]|n[2]|n[3])===0,i=6);let a;typeof e=="string"?(!t.mask||o)&&t[ar]!==void 0?a=t[ar]:(e=Buffer.from(e),a=e.length):(a=e.length,s=t.mask&&t.readOnly&&!o);let c=a;a>=65536?(i+=8,c=127):a>125&&(i+=2,c=126);let l=Buffer.allocUnsafe(s?a+i:i);return l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(l[0]|=64),l[1]=c,c===126?l.writeUInt16BE(a,2):c===127&&(l[2]=l[3]=0,l.writeUIntBE(a,4,6)),t.mask?(l[1]|=128,l[i-4]=n[0],l[i-3]=n[1],l[i-2]=n[2],l[i-1]=n[3],o?[l,e]:s?(t0(e,n,l,i,a),[l]):(t0(e,n,e,0,a),[l,e])):[l,e]}close(e,t,n,s){let i;if(e===void 0)i=EN;else{if(typeof e!="number"||!AN(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)i=Buffer.allocUnsafe(2),i.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");i=Buffer.allocUnsafe(2+a),i.writeUInt16BE(e,0),typeof t=="string"?i.write(t,2):i.set(t,2)}}let o={[ar]:i.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Ar?this.enqueue([this.dispatch,i,!1,o,s]):this.sendFrame(r.frame(i,o),s)}ping(e,t,n){let s,i;if(typeof e=="string"?(s=Buffer.byteLength(e),i=!1):Zs(e)?(s=e.size,i=!1):(e=rs(e),s=e.length,i=rs.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[ar]:s,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:i,rsv1:!1};Zs(e)?this._state!==Ar?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Ar?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}pong(e,t,n){let s,i;if(typeof e=="string"?(s=Buffer.byteLength(e),i=!1):Zs(e)?(s=e.size,i=!1):(e=rs(e),s=e.length,i=rs.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[ar]:s,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:i,rsv1:!1};Zs(e)?this._state!==Ar?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Ar?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let s=this._extensions[e0.extensionName],i=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):Zs(e)?(a=e.size,c=!1):(e=rs(e),a=e.length,c=rs.readOnly),this._firstFragment?(this._firstFragment=!1,o&&s&&s.params[s._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=s._threshold),this._compress=o):(o=!1,i=0),t.fin&&(this._firstFragment=!0);let l={[ar]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:c,rsv1:o};Zs(e)?this._state!==Ar?this.enqueue([this.getBlobData,e,this._compress,l,n]):this.getBlobData(e,this._compress,l,n):this._state!==Ar?this.enqueue([this.dispatch,e,this._compress,l,n]):this.dispatch(e,this._compress,l,n)}getBlobData(e,t,n,s){this._bufferedBytes+=n[ar],this._state=ON,e.arrayBuffer().then(i=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(qf,this,a,s);return}this._bufferedBytes-=n[ar];let o=rs(i);t?this.dispatch(o,t,n,s):(this._state=Ar,this.sendFrame(r.frame(o,n),s),this.dequeue())}).catch(i=>{process.nextTick(MN,this,i,s)})}dispatch(e,t,n,s){if(!t){this.sendFrame(r.frame(e,n),s);return}let i=this._extensions[e0.extensionName];this._bufferedBytes+=n[ar],this._state=kN,i.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");qf(this,c,s);return}this._bufferedBytes-=n[ar],this._state=Ar,n.readOnly=!1,this.sendFrame(r.frame(a,n),s),this.dequeue()})}dequeue(){for(;this._state===Ar&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][ar],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][ar],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};r0.exports=Uf;function qf(r,e,t){typeof t=="function"&&t(e);for(let n=0;n<r._queue.length;n++){let s=r._queue[n],i=s[s.length-1];typeof i=="function"&&i(e)}}function MN(r,e,t){qf(r,e,t),r.onerror(e)}});var p0=O((MW,u0)=>{"use strict";var{kForOnEventAttribute:So,kListener:Gf}=sn(),n0=Symbol("kCode"),s0=Symbol("kData"),i0=Symbol("kError"),o0=Symbol("kMessage"),a0=Symbol("kReason"),ti=Symbol("kTarget"),c0=Symbol("kType"),l0=Symbol("kWasClean"),cn=class{constructor(e){this[ti]=null,this[c0]=e}get target(){return this[ti]}get type(){return this[c0]}};Object.defineProperty(cn.prototype,"target",{enumerable:!0});Object.defineProperty(cn.prototype,"type",{enumerable:!0});var ss=class extends cn{constructor(e,t={}){super(e),this[n0]=t.code===void 0?0:t.code,this[a0]=t.reason===void 0?"":t.reason,this[l0]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[n0]}get reason(){return this[a0]}get wasClean(){return this[l0]}};Object.defineProperty(ss.prototype,"code",{enumerable:!0});Object.defineProperty(ss.prototype,"reason",{enumerable:!0});Object.defineProperty(ss.prototype,"wasClean",{enumerable:!0});var ri=class extends cn{constructor(e,t={}){super(e),this[i0]=t.error===void 0?null:t.error,this[o0]=t.message===void 0?"":t.message}get error(){return this[i0]}get message(){return this[o0]}};Object.defineProperty(ri.prototype,"error",{enumerable:!0});Object.defineProperty(ri.prototype,"message",{enumerable:!0});var Eo=class extends cn{constructor(e,t={}){super(e),this[s0]=t.data===void 0?null:t.data}get data(){return this[s0]}};Object.defineProperty(Eo.prototype,"data",{enumerable:!0});var PN={addEventListener(r,e,t={}){for(let s of this.listeners(r))if(!t[So]&&s[Gf]===e&&!s[So])return;let n;if(r==="message")n=function(i,o){let a=new Eo("message",{data:o?i:i.toString()});a[ti]=this,Rc(e,this,a)};else if(r==="close")n=function(i,o){let a=new ss("close",{code:i,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[ti]=this,Rc(e,this,a)};else if(r==="error")n=function(i){let o=new ri("error",{error:i,message:i.message});o[ti]=this,Rc(e,this,o)};else if(r==="open")n=function(){let i=new cn("open");i[ti]=this,Rc(e,this,i)};else return;n[So]=!!t[So],n[Gf]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[Gf]===e&&!t[So]){this.removeListener(r,t);break}}};u0.exports={CloseEvent:ss,ErrorEvent:ri,Event:cn,EventTarget:PN,MessageEvent:Eo};function Rc(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var zf=O((PW,f0)=>{"use strict";var{tokenChars:To}=Qs();function $r(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function IN(r){let e=Object.create(null),t=Object.create(null),n=!1,s=!1,i=!1,o,a,c=-1,l=-1,p=-1,f=0;for(;f<r.length;f++)if(l=r.charCodeAt(f),o===void 0)if(p===-1&&To[l]===1)c===-1&&(c=f);else if(f!==0&&(l===32||l===9))p===-1&&c!==-1&&(p=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let x=r.slice(c,p);l===44?($r(e,x,t),t=Object.create(null)):o=x,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(p===-1&&To[l]===1)c===-1&&(c=f);else if(l===32||l===9)p===-1&&c!==-1&&(p=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f),$r(t,r.slice(c,p),!0),l===44&&($r(e,o,t),t=Object.create(null),o=void 0),c=p=-1}else if(l===61&&c!==-1&&p===-1)a=r.slice(c,f),c=p=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(s){if(To[l]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),s=!1}else if(i)if(To[l]===1)c===-1&&(c=f);else if(l===34&&c!==-1)i=!1,p=f;else if(l===92)s=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(l===34&&r.charCodeAt(f-1)===61)i=!0;else if(p===-1&&To[l]===1)c===-1&&(c=f);else if(c!==-1&&(l===32||l===9))p===-1&&(p=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let x=r.slice(c,p);n&&(x=x.replace(/\\/g,""),n=!1),$r(t,a,x),l===44&&($r(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||i||l===32||l===9)throw new SyntaxError("Unexpected end of input");p===-1&&(p=f);let h=r.slice(c,p);return o===void 0?$r(e,h,t):(a===void 0?$r(t,h,!0):n?$r(t,a,h.replace(/\\/g,"")):$r(t,a,h),$r(e,o,t)),e}function NN(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(s=>{let i=n[s];return Array.isArray(i)||(i=[i]),i.map(o=>o===!0?s:`${s}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}f0.exports={format:NN,parse:IN}});var Pc=O((LW,E0)=>{"use strict";var LN=require("events"),DN=require("https"),BN=require("http"),m0=require("net"),jN=require("tls"),{randomBytes:FN,createHash:HN}=require("crypto"),{Duplex:IW,Readable:NW}=require("stream"),{URL:Vf}=require("url"),jn=wo(),$N=$f(),UN=Wf(),{isBlob:qN}=Qs(),{BINARY_TYPES:d0,EMPTY_BUFFER:kc,GUID:WN,kForOnEventAttribute:Kf,kListener:GN,kStatusCode:zN,kWebSocket:mt,NOOP:g0}=sn(),{EventTarget:{addEventListener:VN,removeEventListener:KN}}=p0(),{format:YN,parse:XN}=zf(),{toBuffer:JN}=_o(),QN=30*1e3,v0=Symbol("kAborted"),Yf=[8,13],ln=["CONNECTING","OPEN","CLOSING","CLOSED"],ZN=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Se=class r extends LN{constructor(e,t,n){super(),this._binaryType=d0[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=kc,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(n=t,t=[]):t=[t]),y0(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){d0.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,n){let s=new $N({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),i=new UN(e,this._extensions,n.generateMask);this._receiver=s,this._sender=i,this._socket=e,s[mt]=this,i[mt]=this,e[mt]=this,s.on("conclude",rL),s.on("drain",nL),s.on("error",sL),s.on("message",iL),s.on("ping",oL),s.on("pong",aL),i.onerror=cL,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",b0),e.on("data",Mc),e.on("end",w0),e.on("error",S0),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[jn.extensionName]&&this._extensions[jn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Jt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),_0(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Xf(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||kc,t,n)}pong(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Xf(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||kc,t,n)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(n=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Xf(this,e,n);return}let s={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[jn.extensionName]||(s.compress=!1),this._sender.send(e||kc,s,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Jt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(Se,"CONNECTING",{enumerable:!0,value:ln.indexOf("CONNECTING")});Object.defineProperty(Se.prototype,"CONNECTING",{enumerable:!0,value:ln.indexOf("CONNECTING")});Object.defineProperty(Se,"OPEN",{enumerable:!0,value:ln.indexOf("OPEN")});Object.defineProperty(Se.prototype,"OPEN",{enumerable:!0,value:ln.indexOf("OPEN")});Object.defineProperty(Se,"CLOSING",{enumerable:!0,value:ln.indexOf("CLOSING")});Object.defineProperty(Se.prototype,"CLOSING",{enumerable:!0,value:ln.indexOf("CLOSING")});Object.defineProperty(Se,"CLOSED",{enumerable:!0,value:ln.indexOf("CLOSED")});Object.defineProperty(Se.prototype,"CLOSED",{enumerable:!0,value:ln.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(Se.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(Se.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Kf])return e[GN];return null},set(e){for(let t of this.listeners(r))if(t[Kf]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[Kf]:!0})}})});Se.prototype.addEventListener=VN;Se.prototype.removeEventListener=KN;E0.exports=Se;function y0(r,e,t,n){let s={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Yf[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(r._autoPong=s.autoPong,!Yf.includes(s.protocolVersion))throw new RangeError(`Unsupported protocol version: ${s.protocolVersion} (supported versions: ${Yf.join(", ")})`);let i;if(e instanceof Vf)i=e;else try{i=new Vf(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}i.protocol==="http:"?i.protocol="ws:":i.protocol==="https:"&&(i.protocol="wss:"),r._url=i.href;let o=i.protocol==="wss:",a=i.protocol==="ws+unix:",c;if(i.protocol!=="ws:"&&!o&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!i.pathname?c="The URL's pathname is empty":i.hash&&(c="The URL contains a fragment identifier"),c){let S=new SyntaxError(c);if(r._redirects===0)throw S;Oc(r,S);return}let l=o?443:80,p=FN(16).toString("base64"),f=o?DN.request:BN.request,h=new Set,x;if(s.createConnection=s.createConnection||(o?tL:eL),s.defaultPort=s.defaultPort||l,s.port=i.port||l,s.host=i.hostname.startsWith("[")?i.hostname.slice(1,-1):i.hostname,s.headers={...s.headers,"Sec-WebSocket-Version":s.protocolVersion,"Sec-WebSocket-Key":p,Connection:"Upgrade",Upgrade:"websocket"},s.path=i.pathname+i.search,s.timeout=s.handshakeTimeout,s.perMessageDeflate&&(x=new jn(s.perMessageDeflate!==!0?s.perMessageDeflate:{},!1,s.maxPayload),s.headers["Sec-WebSocket-Extensions"]=YN({[jn.extensionName]:x.offer()})),t.length){for(let S of t){if(typeof S!="string"||!ZN.test(S)||h.has(S))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(S)}s.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(s.origin&&(s.protocolVersion<13?s.headers["Sec-WebSocket-Origin"]=s.origin:s.headers.Origin=s.origin),(i.username||i.password)&&(s.auth=`${i.username}:${i.password}`),a){let S=s.path.split(":");s.socketPath=S[0],s.path=S[1]}let _;if(s.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=o,r._originalHostOrSocketPath=a?s.socketPath:i.host;let S=n&&n.headers;if(n={...n,headers:{}},S)for(let[A,M]of Object.entries(S))n.headers[A.toLowerCase()]=M}else if(r.listenerCount("redirect")===0){let S=a?r._originalIpc?s.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:i.host===r._originalHostOrSocketPath;(!S||r._originalSecure&&!o)&&(delete s.headers.authorization,delete s.headers.cookie,S||delete s.headers.host,s.auth=void 0)}s.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(s.auth).toString("base64")),_=r._req=f(s),r._redirects&&r.emit("redirect",r.url,_)}else _=r._req=f(s);s.timeout&&_.on("timeout",()=>{Jt(r,_,"Opening handshake has timed out")}),_.on("error",S=>{_===null||_[v0]||(_=r._req=null,Oc(r,S))}),_.on("response",S=>{let A=S.headers.location,M=S.statusCode;if(A&&s.followRedirects&&M>=300&&M<400){if(++r._redirects>s.maxRedirects){Jt(r,_,"Maximum redirects exceeded");return}_.abort();let N;try{N=new Vf(A,e)}catch{let j=new SyntaxError(`Invalid URL: ${A}`);Oc(r,j);return}y0(r,N,t,n)}else r.emit("unexpected-response",_,S)||Jt(r,_,`Unexpected server response: ${S.statusCode}`)}),_.on("upgrade",(S,A,M)=>{if(r.emit("upgrade",S),r.readyState!==Se.CONNECTING)return;_=r._req=null;let N=S.headers.upgrade;if(N===void 0||N.toLowerCase()!=="websocket"){Jt(r,A,"Invalid Upgrade header");return}let L=HN("sha1").update(p+WN).digest("base64");if(S.headers["sec-websocket-accept"]!==L){Jt(r,A,"Invalid Sec-WebSocket-Accept header");return}let j=S.headers["sec-websocket-protocol"],W;if(j!==void 0?h.size?h.has(j)||(W="Server sent an invalid subprotocol"):W="Server sent a subprotocol but none was requested":h.size&&(W="Server sent no subprotocol"),W){Jt(r,A,W);return}j&&(r._protocol=j);let q=S.headers["sec-websocket-extensions"];if(q!==void 0){if(!x){Jt(r,A,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let G;try{G=XN(q)}catch{Jt(r,A,"Invalid Sec-WebSocket-Extensions header");return}let P=Object.keys(G);if(P.length!==1||P[0]!==jn.extensionName){Jt(r,A,"Server indicated an extension that was not requested");return}try{x.accept(G[jn.extensionName])}catch{Jt(r,A,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[jn.extensionName]=x}r.setSocket(A,M,{allowSynchronousEvents:s.allowSynchronousEvents,generateMask:s.generateMask,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation})}),s.finishRequest?s.finishRequest(_,r):_.end()}function Oc(r,e){r._readyState=Se.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function eL(r){return r.path=r.socketPath,m0.connect(r)}function tL(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=m0.isIP(r.host)?"":r.host),jN.connect(r)}function Jt(r,e,t){r._readyState=Se.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Jt),e.setHeader?(e[v0]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Oc,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Xf(r,e,t){if(e){let n=qN(e)?e.size:JN(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${ln[r.readyState]})`);process.nextTick(t,n)}}function rL(r,e){let t=this[mt];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[mt]!==void 0&&(t._socket.removeListener("data",Mc),process.nextTick(x0,t._socket),r===1005?t.close():t.close(r,e))}function nL(){let r=this[mt];r.isPaused||r._socket.resume()}function sL(r){let e=this[mt];e._socket[mt]!==void 0&&(e._socket.removeListener("data",Mc),process.nextTick(x0,e._socket),e.close(r[zN])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function h0(){this[mt].emitClose()}function iL(r,e){this[mt].emit("message",r,e)}function oL(r){let e=this[mt];e._autoPong&&e.pong(r,!this._isServer,g0),e.emit("ping",r)}function aL(r){this[mt].emit("pong",r)}function x0(r){r.resume()}function cL(r){let e=this[mt];e.readyState!==Se.CLOSED&&(e.readyState===Se.OPEN&&(e._readyState=Se.CLOSING,_0(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function _0(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),QN)}function b0(){let r=this[mt];this.removeListener("close",b0),this.removeListener("data",Mc),this.removeListener("end",w0),r._readyState=Se.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[mt]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",h0),r._receiver.on("finish",h0))}function Mc(r){this[mt]._receiver.write(r)||this.pause()}function w0(){let r=this[mt];r._readyState=Se.CLOSING,r._receiver.end(),this.end()}function S0(){let r=this[mt];this.removeListener("error",S0),this.on("error",g0),r&&(r._readyState=Se.CLOSING,this.destroy())}});var R0=O((BW,A0)=>{"use strict";var DW=Pc(),{Duplex:lL}=require("stream");function T0(r){r.emit("close")}function uL(){!this.destroyed&&this._writableState.finished&&this.destroy()}function C0(r){this.removeListener("error",C0),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function pL(r,e){let t=!0,n=new lL({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(i,o){let a=!o&&n._readableState.objectMode?i.toString():i;n.push(a)||r.pause()}),r.once("error",function(i){n.destroyed||(t=!1,n.destroy(i))}),r.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(s,i){if(r.readyState===r.CLOSED){i(s),process.nextTick(T0,n);return}let o=!1;r.once("error",function(c){o=!0,i(c)}),r.once("close",function(){o||i(s),process.nextTick(T0,n)}),t&&r.terminate()},n._final=function(s){if(r.readyState===r.CONNECTING){r.once("open",function(){n._final(s)});return}r._socket!==null&&(r._socket._writableState.finished?(s(),n._readableState.endEmitted&&n.destroy()):(r._socket.once("finish",function(){s()}),r.close()))},n._read=function(){r.isPaused&&r.resume()},n._write=function(s,i,o){if(r.readyState===r.CONNECTING){r.once("open",function(){n._write(s,i,o)});return}r.send(s,o)},n.on("end",uL),n.on("error",C0),n}A0.exports=pL});var O0=O((jW,k0)=>{"use strict";var{tokenChars:fL}=Qs();function dL(r){let e=new Set,t=-1,n=-1,s=0;for(s;s<r.length;s++){let o=r.charCodeAt(s);if(n===-1&&fL[o]===1)t===-1&&(t=s);else if(s!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=s);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${s}`);n===-1&&(n=s);let a=r.slice(t,n);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${s}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let i=r.slice(t,s);if(e.has(i))throw new SyntaxError(`The "${i}" subprotocol is duplicated`);return e.add(i),e}k0.exports={parse:dL}});var B0=O((HW,D0)=>{"use strict";var hL=require("events"),Ic=require("http"),{Duplex:FW}=require("stream"),{createHash:mL}=require("crypto"),M0=zf(),is=wo(),gL=O0(),vL=Pc(),{GUID:yL,kWebSocket:xL}=sn(),_L=/^[+/0-9A-Za-z]{22}==$/,P0=0,I0=1,L0=2,Jf=class extends hL{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:vL,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=Ic.createServer((n,s)=>{let i=Ic.STATUS_CODES[426];s.writeHead(426,{"Content-Length":i.length,"Content-Type":"text/plain"}),s.end(i)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=bL(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(s,i,o)=>{this.handleUpgrade(s,i,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=P0}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===L0){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Co,this);return}if(e&&this.once("close",e),this._state!==I0)if(this._state=I0,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(Co,this):process.nextTick(Co,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{Co(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,s){t.on("error",N0);let i=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){os(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){os(this,e,t,400,"Invalid Upgrade header");return}if(i===void 0||!_L.test(i)){os(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){os(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Ao(t,400);return}let c=e.headers["sec-websocket-protocol"],l=new Set;if(c!==void 0)try{l=gL.parse(c)}catch{os(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let p=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&p!==void 0){let h=new is(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let x=M0.parse(p);x[is.extensionName]&&(h.accept(x[is.extensionName]),f[is.extensionName]=h)}catch{os(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let h={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(h,(x,_,S,A)=>{if(!x)return Ao(t,_||401,S,A);this.completeUpgrade(f,i,l,e,t,n,s)});return}if(!this.options.verifyClient(h))return Ao(t,401)}this.completeUpgrade(f,i,l,e,t,n,s)}completeUpgrade(e,t,n,s,i,o,a){if(!i.readable||!i.writable)return i.destroy();if(i[xL])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>P0)return Ao(i,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${mL("sha1").update(t+yL).digest("base64")}`],p=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,s):n.values().next().value;f&&(l.push(`Sec-WebSocket-Protocol: ${f}`),p._protocol=f)}if(e[is.extensionName]){let f=e[is.extensionName].params,h=M0.format({[is.extensionName]:[f]});l.push(`Sec-WebSocket-Extensions: ${h}`),p._extensions=e}this.emit("headers",l,s),i.write(l.concat(`\r
13
13
  `).join(`\r
14
- `)),s.removeListener("error",Ay),p.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(p),p.on("close",()=>{this.clients.delete(p),this._shouldEmitClose&&!this.clients.size&&process.nextTick(wo,this)})),a(p,i)}};ky.exports=zf;function sL(r,e){for(let t of Object.keys(e))r.on(t,e[t]);return function(){for(let n of Object.keys(e))r.removeListener(n,e[n])}}function wo(r){r._state=Ry,r.emit("close")}function Ay(){this.destroy()}function So(r,e,t,n){t=t||kc.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${kc.STATUS_CODES[e]}\r
15
- `+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
14
+ `)),i.removeListener("error",N0),p.setSocket(i,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(p),p.on("close",()=>{this.clients.delete(p),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Co,this)})),a(p,s)}};D0.exports=Jf;function bL(r,e){for(let t of Object.keys(e))r.on(t,e[t]);return function(){for(let n of Object.keys(e))r.removeListener(n,e[n])}}function Co(r){r._state=L0,r.emit("close")}function N0(){this.destroy()}function Ao(r,e,t,n){t=t||Ic.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${Ic.STATUS_CODES[e]}\r
15
+ `+Object.keys(n).map(s=>`${s}: ${n[s]}`).join(`\r
16
16
  `)+`\r
17
17
  \r
18
- `+t)}function ni(r,e,t,n,i,s){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,ni),r.emit("wsClientError",o,t,e)}else So(t,n,i,s)}});var Py=O((rW,My)=>{"use strict";var on=Rc();on.createWebSocketStream=by();on.Server=Oy();on.Receiver=Df();on.Sender=Ff();on.WebSocket=on;on.WebSocketServer=on.Server;My.exports=on});var Ly=O((nW,Ny)=>{"use strict";var Iy=Object.getOwnPropertySymbols,oL=Object.prototype.hasOwnProperty,aL=Object.prototype.propertyIsEnumerable;function cL(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function lL(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(e).map(function(s){return e[s]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(s){i[s]=s}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Ny.exports=lL()?Object.assign:function(r,e){for(var t,n=cL(r),i,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)oL.call(t,o)&&(n[o]=t[o]);if(Iy){i=Iy(t);for(var a=0;a<i.length;a++)aL.call(t,i[a])&&(n[i[a]]=t[i[a]])}}return n}});var jy=O((iW,Vf)=>{"use strict";Vf.exports=pL;Vf.exports.append=By;var uL=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function By(r,e){if(typeof r!="string")throw new TypeError("header argument is required");if(!e)throw new TypeError("field argument is required");for(var t=Array.isArray(e)?e:Dy(String(e)),n=0;n<t.length;n++)if(!uL.test(t[n]))throw new TypeError("field argument contains an invalid header name");if(r==="*")return r;var i=r,s=Dy(r.toLowerCase());if(t.indexOf("*")!==-1||s.indexOf("*")!==-1)return"*";for(var o=0;o<t.length;o++){var a=t[o].toLowerCase();s.indexOf(a)===-1&&(s.push(a),i=i?i+", "+t[o]:t[o])}return i}function Dy(r){for(var e=0,t=[],n=0,i=0,s=r.length;i<s;i++)switch(r.charCodeAt(i)){case 32:n===e&&(n=e=i+1);break;case 44:t.push(r.substring(n,e)),n=e=i+1;break;default:e=i+1;break}return t.push(r.substring(n,e)),t}function pL(r,e){if(!r||!r.getHeader||!r.setHeader)throw new TypeError("res argument is required");var t=r.getHeader("Vary")||"",n=Array.isArray(t)?t.join(", "):String(t);(t=By(n,e))&&r.setHeader("Vary",t)}});var Kf=O((sW,Fy)=>{(function(){"use strict";var r=Ly(),e=jy(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function n(_){return typeof _=="string"||_ instanceof String}function i(_,S){if(Array.isArray(S)){for(var A=0;A<S.length;++A)if(i(_,S[A]))return!0;return!1}else return n(S)?_===S:S instanceof RegExp?S.test(_):!!S}function s(_,S){var A=S.headers.origin,M=[],L;return!_.origin||_.origin==="*"?M.push([{key:"Access-Control-Allow-Origin",value:"*"}]):n(_.origin)?(M.push([{key:"Access-Control-Allow-Origin",value:_.origin}]),M.push([{key:"Vary",value:"Origin"}])):(L=i(A,_.origin),M.push([{key:"Access-Control-Allow-Origin",value:L?A:!1}]),M.push([{key:"Vary",value:"Origin"}])),M}function o(_){var S=_.methods;return S.join&&(S=_.methods.join(",")),{key:"Access-Control-Allow-Methods",value:S}}function a(_){return _.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function c(_,S){var A=_.allowedHeaders||_.headers,M=[];return A?A.join&&(A=A.join(",")):(A=S.headers["access-control-request-headers"],M.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),A&&A.length&&M.push([{key:"Access-Control-Allow-Headers",value:A}]),M}function u(_){var S=_.exposedHeaders;if(S)S.join&&(S=S.join(","));else return null;return S&&S.length?{key:"Access-Control-Expose-Headers",value:S}:null}function p(_){var S=(typeof _.maxAge=="number"||_.maxAge)&&_.maxAge.toString();return S&&S.length?{key:"Access-Control-Max-Age",value:S}:null}function f(_,S){for(var A=0,M=_.length;A<M;A++){var L=_[A];L&&(Array.isArray(L)?f(L,S):L.key==="Vary"&&L.value?e(S,L.value):L.value&&S.setHeader(L.key,L.value))}}function m(_,S,A,M){var L=[],N=S.method&&S.method.toUpperCase&&S.method.toUpperCase();N==="OPTIONS"?(L.push(s(_,S)),L.push(a(_)),L.push(o(_)),L.push(c(_,S)),L.push(p(_)),L.push(u(_)),f(L,A),_.preflightContinue?M():(A.statusCode=_.optionsSuccessStatus,A.setHeader("Content-Length","0"),A.end())):(L.push(s(_,S)),L.push(a(_)),L.push(u(_)),f(L,A),M())}function y(_){var S=null;return typeof _=="function"?S=_:S=function(A,M){M(null,_)},function(M,L,N){S(M,function(j,W){if(j)N(j);else{var q=r({},t,W),G=null;q.origin&&typeof q.origin=="function"?G=q.origin:q.origin&&(G=function(P,$){$(null,q.origin)}),G?G(M.headers.origin,function(P,$){P||!$?N(P):(q.origin=$,m(q,M,L,N))}):N()}})}}Fy.exports=y})()});var Xf=O(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.Server=ts.BaseServer=void 0;var $y=Wp(),Oc=uf(),fL=require("events"),Hy=ff(),dL=Ae(),hL=o0(),mL=Py(),Uy=cf(),gL=mo(),ne=(0,dL.default)("engine"),Zi=Symbol("responseHeaders");function vL(r){try{let e=JSON.parse(r);if(typeof e.sid=="string")return e.sid}catch{}}var es=class extends fL.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:mL.Server,pingTimeout:2e4,pingInterval:25e3,upgradeTimeout:1e4,maxHttpBufferSize:1e6,transports:["polling","websocket"],allowUpgrades:!0,httpCompression:{threshold:1024},cors:!1,allowEIO3:!1},e),e.cookie&&(this.opts.cookie=Object.assign({name:"io",path:"/",httpOnly:e.cookie.path!==!1,sameSite:"lax"},e.cookie)),this.opts.cors&&this.use(Kf()(this.opts.cors)),e.perMessageDeflate&&(this.opts.perMessageDeflate=Object.assign({threshold:1024},e.perMessageDeflate)),this.init()}_computePath(e){let t=(e.path||"/engine.io").replace(/\/$/,"");return e.addTrailingSlash!==!1&&(t+="/"),t}upgrades(e){return this.opts.allowUpgrades?Oc.default[e].upgradesTo||[]:[]}verify(e,t,n){let i=e._query.transport;if(!~this.opts.transports.indexOf(i)||i==="webtransport")return ne('unknown transport "%s"',i),n(xe.errors.UNKNOWN_TRANSPORT,{transport:i});if(xL(e.headers.origin)){let a=e.headers.origin;return e.headers.origin=null,ne("origin header invalid"),n(xe.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:a})}let o=e._query.sid;if(o){if(!this.clients.hasOwnProperty(o))return ne('unknown sid "%s"',o),n(xe.errors.UNKNOWN_SID,{sid:o});let a=this.clients[o].transport.name;if(!t&&a!==i)return ne("bad request: unexpected transport without upgrade"),n(xe.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:i,previousTransport:a})}else return e.method!=="GET"?n(xe.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):i==="websocket"&&!t?(ne("invalid transport upgrade"),n(xe.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(e,(a,c)=>{if(!c)return n(xe.errors.FORBIDDEN,{message:a});n()}):n();n()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return ne("no middleware to apply, skipping"),n();let i=s=>{ne("applying middleware n\xB0%d",s+1),this.middlewares[s](e,t,o=>{if(o)return n(o);s+1<this.middlewares.length?i(s+1):n()})};i(0)}close(){ne("closing all open clients");for(let e in this.clients)this.clients.hasOwnProperty(e)&&this.clients[e].close(!0);return this.cleanup(),this}generateId(e){return $y.generateId()}async handshake(e,t,n){let i=t._query.EIO==="4"?4:3;if(i===3&&!this.opts.allowEIO3){ne("unsupported protocol version"),this.emit("connection_error",{req:t,code:xe.errors.UNSUPPORTED_PROTOCOL_VERSION,message:xe.errorMessages[xe.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:i}}),n(xe.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let s;try{s=await this.generateId(t)}catch(c){ne("error while generating an id"),this.emit("connection_error",{req:t,code:xe.errors.BAD_REQUEST,message:xe.errorMessages[xe.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:c}}),n(xe.errors.BAD_REQUEST);return}ne('handshaking client "%s"',s);try{var o=this.createTransport(e,t);e==="polling"?(o.maxHttpBufferSize=this.opts.maxHttpBufferSize,o.httpCompression=this.opts.httpCompression):e==="websocket"&&(o.perMessageDeflate=this.opts.perMessageDeflate)}catch(c){ne('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:xe.errors.BAD_REQUEST,message:xe.errorMessages[xe.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:c}}),n(xe.errors.BAD_REQUEST);return}let a=new Hy.Socket(s,this,o,t,i);return o.on("headers",(c,u)=>{!u._query.sid&&(this.opts.cookie&&(c["Set-Cookie"]=[(0,hL.serialize)(this.opts.cookie.name,s,this.opts.cookie)]),this.emit("initial_headers",c,u)),this.emit("headers",c,u)}),o.onRequest(t),this.clients[s]=a,this.clientsCount++,a.once("close",()=>{delete this.clients[s],this.clientsCount--}),this.emit("connection",a),o}async onWebTransportSession(e){let t=setTimeout(()=>{ne("the client failed to establish a bidirectional stream in the given period"),e.close()},this.opts.upgradeTimeout),i=await e.incomingBidirectionalStreams.getReader().read();if(i.done){ne("session is closed");return}let s=i.value,o=(0,gL.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),a=s.readable.pipeThrough(o).getReader(),{value:c,done:u}=await a.read();if(u){ne("stream is closed");return}if(clearTimeout(t),c.type!=="open")return ne("invalid WebTransport handshake"),e.close();if(c.data===void 0){let m=new Uy.WebTransport(e,s,a),y=$y.generateId();ne('handshaking client "%s" (WebTransport)',y);let _=new Hy.Socket(y,this,m,null,4);this.clients[y]=_,this.clientsCount++,_.once("close",()=>{delete this.clients[y],this.clientsCount--}),this.emit("connection",_);return}let p=vL(c.data);if(!p)return ne("invalid WebTransport handshake"),e.close();let f=this.clients[p];if(!f)ne("upgrade attempt for closed client"),e.close();else if(f.upgrading)ne("transport has already been trying to upgrade"),e.close();else if(f.upgraded)ne("transport had already been upgraded"),e.close();else{ne("upgrading existing transport");let m=new Uy.WebTransport(e,s,a);f._maybeUpgrade(m)}}};ts.BaseServer=es;es.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};es.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var Yf=class{constructor(e,t){this.req=e,this.socket=t,e[Zi]={}}setHeader(e,t){this.req[Zi][e]=t}getHeader(e){return this.req[Zi][e]}removeHeader(e){delete this.req[Zi][e]}write(){}writeHead(){}end(){this.socket.destroy()}},xe=class r extends es{init(){~this.opts.transports.indexOf("websocket")&&(this.ws&&this.ws.close(),this.ws=new this.opts.wsEngine({noServer:!0,clientTracking:!1,perMessageDeflate:this.opts.perMessageDeflate,maxPayload:this.opts.maxHttpBufferSize}),typeof this.ws.on=="function"&&this.ws.on("headers",(e,t)=>{let n=t[Zi]||{};delete t[Zi],!t._query.sid&&this.emit("initial_headers",n,t),this.emit("headers",n,t),ne("writing headers: %j",n),Object.keys(n).forEach(s=>{e.push(`${s}: ${n[s]}`)})}))}cleanup(){this.ws&&(ne("closing webSocketServer"),this.ws.close())}prepare(e){if(!e._query){let t=new URL(e.url,"https://socket.io");e._query=Object.fromEntries(t.searchParams.entries())}}createTransport(e,t){return new Oc.default[e](t)}handleRequest(e,t){ne('handling "%s" http request "%s"',e.method,e.url),this.prepare(e),e.res=t;let n=(i,s)=>{if(i!==void 0){this.emit("connection_error",{req:e,code:i,message:r.errorMessages[i],context:s}),qy(t,i,s);return}if(e._query.sid)ne("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(a,c)=>qy(t,a,c);this.handshake(e._query.transport,e,o)}};this._applyMiddlewares(e,t,i=>{i?n(r.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!1,n)})}handleUpgrade(e,t,n){this.prepare(e);let i=new Yf(e,t),s=(o,a)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:r.errorMessages[o],context:a}),Wy(t,o,a);return}let c=Buffer.from(n);n=null,i.writeHead(),this.ws.handleUpgrade(e,t,c,u=>{this.onWebSocket(e,t,u)})};this._applyMiddlewares(e,i,o=>{o?s(r.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!0,s)})}onWebSocket(e,t,n){if(n.on("error",s),Oc.default[e._query.transport]!==void 0&&!Oc.default[e._query.transport].prototype.handlesUpgrades){ne("transport doesnt handle upgraded requests"),n.close();return}let i=e._query.sid;if(e.websocket=n,i){let o=this.clients[i];if(!o)ne("upgrade attempt for closed client"),n.close();else if(o.upgrading)ne("transport has already been trying to upgrade"),n.close();else if(o.upgraded)ne("transport had already been upgraded"),n.close();else{ne("upgrading existing transport"),n.removeListener("error",s);let a=this.createTransport(e._query.transport,e);a.perMessageDeflate=this.opts.perMessageDeflate,o._maybeUpgrade(a)}}else{let o=(a,c)=>Wy(t,a,c);this.handshake(e._query.transport,e,o)}function s(){ne("websocket error before upgrade")}}attach(e,t={}){let n=this._computePath(t),i=t.destroyUpgradeTimeout||1e3;function s(a){return n===a.url.slice(0,n.length)}let o=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("close",this.close.bind(this)),e.on("listening",this.init.bind(this)),e.on("request",(a,c)=>{if(s(a))ne('intercepting request for path "%s"',n),this.handleRequest(a,c);else{let u=0,p=o.length;for(;u<p;u++)o[u].call(e,a,c)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(a,c,u)=>{s(a)?this.handleUpgrade(a,c,u):t.destroyUpgrade!==!1&&setTimeout(function(){if(c.writable&&c.bytesWritten<=0)return c.on("error",p=>{ne("error while destroying upgrade: %s",p.message)}),c.end()},i)})}};ts.Server=xe;function qy(r,e,t){let n=e===xe.errors.FORBIDDEN?403:400,i=t&&t.message?t.message:xe.errorMessages[e];r.writeHead(n,{"Content-Type":"application/json"}),r.end(JSON.stringify({code:e,message:i}))}function Wy(r,e,t={}){if(r.on("error",()=>{ne("ignoring error from closed connection")}),r.writable){let n=t.message||xe.errorMessages[e],i=Buffer.byteLength(n);r.write(`HTTP/1.1 400 Bad Request\r
18
+ `+t)}function os(r,e,t,n,s,i){if(r.listenerCount("wsClientError")){let o=new Error(s);Error.captureStackTrace(o,os),r.emit("wsClientError",o,t,e)}else Ao(t,n,s,i)}});var F0=O(($W,j0)=>{"use strict";var un=Pc();un.createWebSocketStream=R0();un.Server=B0();un.Receiver=$f();un.Sender=Wf();un.WebSocket=un;un.WebSocketServer=un.Server;j0.exports=un});var U0=O((UW,$0)=>{"use strict";var H0=Object.getOwnPropertySymbols,wL=Object.prototype.hasOwnProperty,SL=Object.prototype.propertyIsEnumerable;function EL(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function TL(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(e).map(function(i){return e[i]});if(n.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(i){s[i]=i}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}$0.exports=TL()?Object.assign:function(r,e){for(var t,n=EL(r),s,i=1;i<arguments.length;i++){t=Object(arguments[i]);for(var o in t)wL.call(t,o)&&(n[o]=t[o]);if(H0){s=H0(t);for(var a=0;a<s.length;a++)SL.call(t,s[a])&&(n[s[a]]=t[s[a]])}}return n}});var G0=O((qW,Qf)=>{"use strict";Qf.exports=AL;Qf.exports.append=W0;var CL=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function W0(r,e){if(typeof r!="string")throw new TypeError("header argument is required");if(!e)throw new TypeError("field argument is required");for(var t=Array.isArray(e)?e:q0(String(e)),n=0;n<t.length;n++)if(!CL.test(t[n]))throw new TypeError("field argument contains an invalid header name");if(r==="*")return r;var s=r,i=q0(r.toLowerCase());if(t.indexOf("*")!==-1||i.indexOf("*")!==-1)return"*";for(var o=0;o<t.length;o++){var a=t[o].toLowerCase();i.indexOf(a)===-1&&(i.push(a),s=s?s+", "+t[o]:t[o])}return s}function q0(r){for(var e=0,t=[],n=0,s=0,i=r.length;s<i;s++)switch(r.charCodeAt(s)){case 32:n===e&&(n=e=s+1);break;case 44:t.push(r.substring(n,e)),n=e=s+1;break;default:e=s+1;break}return t.push(r.substring(n,e)),t}function AL(r,e){if(!r||!r.getHeader||!r.setHeader)throw new TypeError("res argument is required");var t=r.getHeader("Vary")||"",n=Array.isArray(t)?t.join(", "):String(t);(t=W0(n,e))&&r.setHeader("Vary",t)}});var Zf=O((WW,z0)=>{(function(){"use strict";var r=U0(),e=G0(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function n(_){return typeof _=="string"||_ instanceof String}function s(_,S){if(Array.isArray(S)){for(var A=0;A<S.length;++A)if(s(_,S[A]))return!0;return!1}else return n(S)?_===S:S instanceof RegExp?S.test(_):!!S}function i(_,S){var A=S.headers.origin,M=[],N;return!_.origin||_.origin==="*"?M.push([{key:"Access-Control-Allow-Origin",value:"*"}]):n(_.origin)?(M.push([{key:"Access-Control-Allow-Origin",value:_.origin}]),M.push([{key:"Vary",value:"Origin"}])):(N=s(A,_.origin),M.push([{key:"Access-Control-Allow-Origin",value:N?A:!1}]),M.push([{key:"Vary",value:"Origin"}])),M}function o(_){var S=_.methods;return S.join&&(S=_.methods.join(",")),{key:"Access-Control-Allow-Methods",value:S}}function a(_){return _.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function c(_,S){var A=_.allowedHeaders||_.headers,M=[];return A?A.join&&(A=A.join(",")):(A=S.headers["access-control-request-headers"],M.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),A&&A.length&&M.push([{key:"Access-Control-Allow-Headers",value:A}]),M}function l(_){var S=_.exposedHeaders;if(S)S.join&&(S=S.join(","));else return null;return S&&S.length?{key:"Access-Control-Expose-Headers",value:S}:null}function p(_){var S=(typeof _.maxAge=="number"||_.maxAge)&&_.maxAge.toString();return S&&S.length?{key:"Access-Control-Max-Age",value:S}:null}function f(_,S){for(var A=0,M=_.length;A<M;A++){var N=_[A];N&&(Array.isArray(N)?f(N,S):N.key==="Vary"&&N.value?e(S,N.value):N.value&&S.setHeader(N.key,N.value))}}function h(_,S,A,M){var N=[],L=S.method&&S.method.toUpperCase&&S.method.toUpperCase();L==="OPTIONS"?(N.push(i(_,S)),N.push(a(_)),N.push(o(_)),N.push(c(_,S)),N.push(p(_)),N.push(l(_)),f(N,A),_.preflightContinue?M():(A.statusCode=_.optionsSuccessStatus,A.setHeader("Content-Length","0"),A.end())):(N.push(i(_,S)),N.push(a(_)),N.push(l(_)),f(N,A),M())}function x(_){var S=null;return typeof _=="function"?S=_:S=function(A,M){M(null,_)},function(M,N,L){S(M,function(j,W){if(j)L(j);else{var q=r({},t,W),G=null;q.origin&&typeof q.origin=="function"?G=q.origin:q.origin&&(G=function(P,H){H(null,q.origin)}),G?G(M.headers.origin,function(P,H){P||!H?L(P):(q.origin=H,h(q,M,N,L))}):L()}})}}z0.exports=x})()});var td=O(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.Server=ii.BaseServer=void 0;var V0=Yp(),Nc=mf(),RL=require("events"),K0=vf(),kL=ke(),OL=dx(),ML=F0(),Y0=df(),PL=xo(),ne=(0,kL.default)("engine"),ni=Symbol("responseHeaders");function IL(r){try{let e=JSON.parse(r);if(typeof e.sid=="string")return e.sid}catch{}}var si=class extends RL.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:ML.Server,pingTimeout:2e4,pingInterval:25e3,upgradeTimeout:1e4,maxHttpBufferSize:1e6,transports:["polling","websocket"],allowUpgrades:!0,httpCompression:{threshold:1024},cors:!1,allowEIO3:!1},e),e.cookie&&(this.opts.cookie=Object.assign({name:"io",path:"/",httpOnly:e.cookie.path!==!1,sameSite:"lax"},e.cookie)),this.opts.cors&&this.use(Zf()(this.opts.cors)),e.perMessageDeflate&&(this.opts.perMessageDeflate=Object.assign({threshold:1024},e.perMessageDeflate)),this.init()}_computePath(e){let t=(e.path||"/engine.io").replace(/\/$/,"");return e.addTrailingSlash!==!1&&(t+="/"),t}upgrades(e){return this.opts.allowUpgrades?Nc.default[e].upgradesTo||[]:[]}verify(e,t,n){let s=e._query.transport;if(!~this.opts.transports.indexOf(s)||s==="webtransport")return ne('unknown transport "%s"',s),n(xe.errors.UNKNOWN_TRANSPORT,{transport:s});if(NL(e.headers.origin)){let a=e.headers.origin;return e.headers.origin=null,ne("origin header invalid"),n(xe.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:a})}let o=e._query.sid;if(o){if(!this.clients.hasOwnProperty(o))return ne('unknown sid "%s"',o),n(xe.errors.UNKNOWN_SID,{sid:o});let a=this.clients[o].transport.name;if(!t&&a!==s)return ne("bad request: unexpected transport without upgrade"),n(xe.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:s,previousTransport:a})}else return e.method!=="GET"?n(xe.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):s==="websocket"&&!t?(ne("invalid transport upgrade"),n(xe.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(e,(a,c)=>{if(!c)return n(xe.errors.FORBIDDEN,{message:a});n()}):n();n()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return ne("no middleware to apply, skipping"),n();let s=i=>{ne("applying middleware n\xB0%d",i+1),this.middlewares[i](e,t,o=>{if(o)return n(o);i+1<this.middlewares.length?s(i+1):n()})};s(0)}close(){ne("closing all open clients");for(let e in this.clients)this.clients.hasOwnProperty(e)&&this.clients[e].close(!0);return this.cleanup(),this}generateId(e){return V0.generateId()}async handshake(e,t,n){let s=t._query.EIO==="4"?4:3;if(s===3&&!this.opts.allowEIO3){ne("unsupported protocol version"),this.emit("connection_error",{req:t,code:xe.errors.UNSUPPORTED_PROTOCOL_VERSION,message:xe.errorMessages[xe.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:s}}),n(xe.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let i;try{i=await this.generateId(t)}catch(c){ne("error while generating an id"),this.emit("connection_error",{req:t,code:xe.errors.BAD_REQUEST,message:xe.errorMessages[xe.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:c}}),n(xe.errors.BAD_REQUEST);return}ne('handshaking client "%s"',i);try{var o=this.createTransport(e,t);e==="polling"?(o.maxHttpBufferSize=this.opts.maxHttpBufferSize,o.httpCompression=this.opts.httpCompression):e==="websocket"&&(o.perMessageDeflate=this.opts.perMessageDeflate)}catch(c){ne('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:xe.errors.BAD_REQUEST,message:xe.errorMessages[xe.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:c}}),n(xe.errors.BAD_REQUEST);return}let a=new K0.Socket(i,this,o,t,s);return o.on("headers",(c,l)=>{!l._query.sid&&(this.opts.cookie&&(c["Set-Cookie"]=[(0,OL.serialize)(this.opts.cookie.name,i,this.opts.cookie)]),this.emit("initial_headers",c,l)),this.emit("headers",c,l)}),o.onRequest(t),this.clients[i]=a,this.clientsCount++,a.once("close",()=>{delete this.clients[i],this.clientsCount--}),this.emit("connection",a),o}async onWebTransportSession(e){let t=setTimeout(()=>{ne("the client failed to establish a bidirectional stream in the given period"),e.close()},this.opts.upgradeTimeout),s=await e.incomingBidirectionalStreams.getReader().read();if(s.done){ne("session is closed");return}let i=s.value,o=(0,PL.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),a=i.readable.pipeThrough(o).getReader(),{value:c,done:l}=await a.read();if(l){ne("stream is closed");return}if(clearTimeout(t),c.type!=="open")return ne("invalid WebTransport handshake"),e.close();if(c.data===void 0){let h=new Y0.WebTransport(e,i,a),x=V0.generateId();ne('handshaking client "%s" (WebTransport)',x);let _=new K0.Socket(x,this,h,null,4);this.clients[x]=_,this.clientsCount++,_.once("close",()=>{delete this.clients[x],this.clientsCount--}),this.emit("connection",_);return}let p=IL(c.data);if(!p)return ne("invalid WebTransport handshake"),e.close();let f=this.clients[p];if(!f)ne("upgrade attempt for closed client"),e.close();else if(f.upgrading)ne("transport has already been trying to upgrade"),e.close();else if(f.upgraded)ne("transport had already been upgraded"),e.close();else{ne("upgrading existing transport");let h=new Y0.WebTransport(e,i,a);f._maybeUpgrade(h)}}};ii.BaseServer=si;si.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};si.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var ed=class{constructor(e,t){this.req=e,this.socket=t,e[ni]={}}setHeader(e,t){this.req[ni][e]=t}getHeader(e){return this.req[ni][e]}removeHeader(e){delete this.req[ni][e]}write(){}writeHead(){}end(){this.socket.destroy()}},xe=class r extends si{init(){~this.opts.transports.indexOf("websocket")&&(this.ws&&this.ws.close(),this.ws=new this.opts.wsEngine({noServer:!0,clientTracking:!1,perMessageDeflate:this.opts.perMessageDeflate,maxPayload:this.opts.maxHttpBufferSize}),typeof this.ws.on=="function"&&this.ws.on("headers",(e,t)=>{let n=t[ni]||{};delete t[ni],!t._query.sid&&this.emit("initial_headers",n,t),this.emit("headers",n,t),ne("writing headers: %j",n),Object.keys(n).forEach(i=>{e.push(`${i}: ${n[i]}`)})}))}cleanup(){this.ws&&(ne("closing webSocketServer"),this.ws.close())}prepare(e){if(!e._query){let t=new URL(e.url,"https://socket.io");e._query=Object.fromEntries(t.searchParams.entries())}}createTransport(e,t){return new Nc.default[e](t)}handleRequest(e,t){ne('handling "%s" http request "%s"',e.method,e.url),this.prepare(e),e.res=t;let n=(s,i)=>{if(s!==void 0){this.emit("connection_error",{req:e,code:s,message:r.errorMessages[s],context:i}),X0(t,s,i);return}if(e._query.sid)ne("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(a,c)=>X0(t,a,c);this.handshake(e._query.transport,e,o)}};this._applyMiddlewares(e,t,s=>{s?n(r.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!1,n)})}handleUpgrade(e,t,n){this.prepare(e);let s=new ed(e,t),i=(o,a)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:r.errorMessages[o],context:a}),J0(t,o,a);return}let c=Buffer.from(n);n=null,s.writeHead(),this.ws.handleUpgrade(e,t,c,l=>{this.onWebSocket(e,t,l)})};this._applyMiddlewares(e,s,o=>{o?i(r.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!0,i)})}onWebSocket(e,t,n){if(n.on("error",i),Nc.default[e._query.transport]!==void 0&&!Nc.default[e._query.transport].prototype.handlesUpgrades){ne("transport doesnt handle upgraded requests"),n.close();return}let s=e._query.sid;if(e.websocket=n,s){let o=this.clients[s];if(!o)ne("upgrade attempt for closed client"),n.close();else if(o.upgrading)ne("transport has already been trying to upgrade"),n.close();else if(o.upgraded)ne("transport had already been upgraded"),n.close();else{ne("upgrading existing transport"),n.removeListener("error",i);let a=this.createTransport(e._query.transport,e);a.perMessageDeflate=this.opts.perMessageDeflate,o._maybeUpgrade(a)}}else{let o=(a,c)=>J0(t,a,c);this.handshake(e._query.transport,e,o)}function i(){ne("websocket error before upgrade")}}attach(e,t={}){let n=this._computePath(t),s=t.destroyUpgradeTimeout||1e3;function i(a){return n===a.url.slice(0,n.length)}let o=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("close",this.close.bind(this)),e.on("listening",this.init.bind(this)),e.on("request",(a,c)=>{if(i(a))ne('intercepting request for path "%s"',n),this.handleRequest(a,c);else{let l=0,p=o.length;for(;l<p;l++)o[l].call(e,a,c)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(a,c,l)=>{i(a)?this.handleUpgrade(a,c,l):t.destroyUpgrade!==!1&&setTimeout(function(){if(c.writable&&c.bytesWritten<=0)return c.on("error",p=>{ne("error while destroying upgrade: %s",p.message)}),c.end()},s)})}};ii.Server=xe;function X0(r,e,t){let n=e===xe.errors.FORBIDDEN?403:400,s=t&&t.message?t.message:xe.errorMessages[e];r.writeHead(n,{"Content-Type":"application/json"}),r.end(JSON.stringify({code:e,message:s}))}function J0(r,e,t={}){if(r.on("error",()=>{ne("ignoring error from closed connection")}),r.writable){let n=t.message||xe.errorMessages[e],s=Buffer.byteLength(n);r.write(`HTTP/1.1 400 Bad Request\r
19
19
  Connection: close\r
20
20
  Content-type: text/html\r
21
- Content-Length: `+i+`\r
21
+ Content-Length: `+s+`\r
22
22
  \r
23
- `+n)}r.destroy()}var Eo=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,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,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,1,1,1,1,1,1,1,1,1,1,1,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,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,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,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,1,1,1,1,1,1,1,1,1,1,1,1];function xL(r){if(r+="",r.length<1)return!1;if(!Eo[r.charCodeAt(0)])return ne('invalid header, index 0, char "%s"',r.charCodeAt(0)),!0;if(r.length<2)return!1;if(!Eo[r.charCodeAt(1)])return ne('invalid header, index 1, char "%s"',r.charCodeAt(1)),!0;if(r.length<3)return!1;if(!Eo[r.charCodeAt(2)])return ne('invalid header, index 2, char "%s"',r.charCodeAt(2)),!0;if(r.length<4)return!1;if(!Eo[r.charCodeAt(3)])return ne('invalid header, index 3, char "%s"',r.charCodeAt(3)),!0;for(let e=4;e<r.length;++e)if(!Eo[r.charCodeAt(e)])return ne('invalid header, index "%i", char "%s"',e,r.charCodeAt(e)),!0;return!1}});var zy=O(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.Polling=void 0;var yL=Qn(),Gy=require("zlib"),_L=Qa(),bL=Ae(),sr=(0,bL.default)("engine:polling"),wL={gzip:Gy.createGzip,deflate:Gy.createDeflate},Jf=class extends yL.Transport{constructor(e){super(e),this.closeTimeout=30*1e3}get name(){return"polling"}onRequest(e){let t=e.res;e.res=null,e.getMethod()==="get"?this.onPollRequest(e,t):e.getMethod()==="post"?this.onDataRequest(e,t):(t.writeStatus("500 Internal Server Error"),t.end())}onPollRequest(e,t){if(this.req){sr("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}sr("setting request"),this.req=e,this.res=t;let n=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},i=()=>{this.req=this.res=null};e.cleanup=i,t.onAborted(n),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(sr("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq){this.onError("data request overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}let n=Number(e.headers["content-length"]);if(!n){this.onError("content-length header required"),t.writeStatus("411 Length Required").end();return}if(n>this.maxHttpBufferSize){this.onError("payload too large"),t.writeStatus("413 Payload Too Large").end();return}if(e.headers["content-type"]==="application/octet-stream"&&this.protocol===4)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let s,o=0,a={"Content-Type":"text/html"};this.headers(e,a);for(let u in a)t.writeHeader(u,String(a[u]));let c=u=>{this.onData(u.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((u,p)=>{let f=o+u.byteLength;if(f>n){this.onError("content-length mismatch"),t.close();return}if(!s){if(p){c(Buffer.from(u));return}s=Buffer.allocUnsafe(n)}if(Buffer.from(u).copy(s,o),p){if(f!=n){this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}c(s);return}o=f})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(e){sr('received "%s"',e);let t=n=>{if(n.type==="close")return sr("got xhr close packet"),this.onClose(),!1;this.onPacket(n)};this.protocol===3?this.parser.decodePayload(e,t):this.parser.decodePayload(e).forEach(t)}onClose(){this.writable&&this.send([{type:"noop"}]),super.onClose()}send(e){this.writable=!1,this.shouldClose&&(sr("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let i=e.some(s=>s.options&&s.options.compress);this.write(n,{compress:i})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){sr('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let i=typeof e=="string",o={"Content-Type":i?"text/plain; charset=UTF-8":"application/octet-stream"},a=p=>{this.headers(this.req,o),this.res.cork(()=>{Object.keys(o).forEach(f=>{this.res.writeHeader(f,String(o[f]))}),this.res.end(p)}),n()};if(!this.httpCompression||!t.compress){a(e);return}if((i?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let u=_L(this.req).encodings(["gzip","deflate"]);if(!u){a(e);return}this.compress(e,u,(p,f)=>{if(p){this.res.writeStatus("500 Internal Server Error"),this.res.end(),n(p);return}o["Content-Encoding"]=u,a(f)})}compress(e,t,n){sr("compressing");let i=[],s=0;wL[t](this.httpCompression).on("error",n).on("data",function(o){i.push(o),s+=o.length}).on("end",function(){n(null,Buffer.concat(i,s))}).end(e)}doClose(e){sr("closing");let t,n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(sr("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(sr("transport discarded - closing right away"),n()):(sr("transport not writable - buffering orderly close"),this.shouldClose=n,t=setTimeout(n,this.closeTimeout))}headers(e,t){t=t||{};let n=e.headers["user-agent"];return n&&(~n.indexOf(";MSIE")||~n.indexOf("Trident/"))&&(t["X-XSS-Protection"]="0"),t["cache-control"]="no-store",this.emit("headers",t,e),t}};Mc.Polling=Jf});var Ky=O(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.WebSocket=void 0;var SL=Qn(),EL=Ae(),Vy=(0,EL.default)("engine:ws"),Qf=class extends SL.Transport{constructor(e){super(e),this.writable=!1,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],i=t+1===e.length,s=o=>{let a=typeof o!="string",c=this.perMessageDeflate&&Buffer.byteLength(o)>this.perMessageDeflate.threshold;Vy('writing "%s"',o),this.socket.send(o,a,c),i&&(this.emit("drain"),this.writable=!0,this.emit("ready"))};n.options&&typeof n.options.wsPreEncoded=="string"?s(n.options.wsPreEncoded):this.parser.encodePacket(n,this.supportsBinary,s)}}doClose(e){Vy("closing"),e&&e(),this.socket.end()}};Pc.WebSocket=Qf});var Yy=O(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0});var TL=zy(),CL=Ky();Zf.default={polling:TL.Polling,websocket:CL.WebSocket}});var Xy=O(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.uServer=void 0;var AL=Ae(),ii=Xf(),RL=Yy(),Dn=(0,AL.default)("engine:uws"),ed=class extends ii.BaseServer{init(){}cleanup(){}prepare(e,t){e.method=e.getMethod().toUpperCase(),e.url=e.getUrl();let n=new URLSearchParams(e.getQuery());e._query=Object.fromEntries(n.entries()),e.headers={},e.forEach((i,s)=>{e.headers[i]=s}),e.connection={remoteAddress:Buffer.from(t.getRemoteAddressAsText()).toString()},t.onAborted(()=>{Dn("response has been aborted")})}createTransport(e,t){return new RL.default[e](t)}attach(e,t={}){let n=this._computePath(t);e.any(n,this.handleRequest.bind(this)).ws(n,{compression:t.compression,idleTimeout:t.idleTimeout,maxBackpressure:t.maxBackpressure,maxPayloadLength:this.opts.maxHttpBufferSize,upgrade:this.handleUpgrade.bind(this),open:i=>{let s=i.getUserData().transport;s.socket=i,s.writable=!0,s.emit("ready")},message:(i,s,o)=>{i.getUserData().transport.onData(o?s:Buffer.from(s).toString())},close:(i,s,o)=>{i.getUserData().transport.onClose(s,o)}})}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return n();e.res=new td(t),super._applyMiddlewares(e,e.res,i=>{e.res.writeHead(),n(i)})}handleRequest(e,t){Dn('handling "%s" http request "%s"',t.getMethod(),t.getUrl()),this.prepare(t,e),t.res=e;let n=(i,s)=>{if(i!==void 0){this.emit("connection_error",{req:t,code:i,message:ii.Server.errorMessages[i],context:s}),this.abortRequest(t.res,i,s);return}if(t._query.sid)Dn("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{let o=(a,c)=>this.abortRequest(e,a,c);this.handshake(t._query.transport,t,o)}};this._applyMiddlewares(t,e,i=>{i?n(ii.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,n)})}handleUpgrade(e,t,n){Dn("on upgrade"),this.prepare(t,e),t.res=e;let i=async(s,o)=>{if(s!==void 0){this.emit("connection_error",{req:t,code:s,message:ii.Server.errorMessages[s],context:o}),this.abortRequest(e,s,o);return}let a=t._query.sid,c;if(a){let f=this.clients[a];if(f){if(f.upgrading)return Dn("transport has already been trying to upgrade"),e.close();if(f.upgraded)return Dn("transport had already been upgraded"),e.close();Dn("upgrading existing transport"),c=this.createTransport(t._query.transport,t),f._maybeUpgrade(c)}else return Dn("upgrade attempt for closed client"),e.close()}else if(c=await this.handshake(t._query.transport,t,(f,m)=>this.abortRequest(e,f,m)),!c)return;let u={};!a&&this.emit("initial_headers",u,t),this.emit("headers",u,t),t.res.writeStatus("101 Switching Protocols"),Object.keys(u).forEach(f=>{t.res.writeHeader(f,u[f])}),e.upgrade({transport:c},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),n)};this._applyMiddlewares(t,e,s=>{s?i(ii.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,i)})}abortRequest(e,t,n){let i=t===ii.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",s=n&&n.message?n.message:ii.Server.errorMessages[t];e.writeStatus(i),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:s}))}};Ic.uServer=ed;var td=class{constructor(e){this.res=e,this.statusWritten=!1,this.headers=[],this.isAborted=!1}set statusCode(e){e&&this.writeStatus(e===200?"200 OK":"204 No Content")}writeHead(e){this.statusCode=e}setHeader(e,t){Array.isArray(t)?t.forEach(n=>{this.writeHeader(e,n)}):this.writeHeader(e,t)}removeHeader(){}getHeader(){}writeStatus(e){if(!this.isAborted)return this.res.writeStatus(e),this.statusWritten=!0,this.writeBufferedHeaders(),this}writeHeader(e,t){this.isAborted||e!=="Content-Length"&&(this.statusWritten?this.res.writeHeader(e,t):this.headers.push([e,t]))}writeBufferedHeaders(){this.headers.forEach(([e,t])=>{this.res.writeHeader(e,t)})}end(e){this.isAborted||this.res.cork(()=>{this.statusWritten||this.writeBufferedHeaders(),this.res.end(e)})}onData(e){this.isAborted||this.res.onData(e)}onAborted(e){this.isAborted||this.res.onAborted(()=>{this.isAborted=!0,e()})}cork(e){this.isAborted||this.res.cork(e)}}});var e_=O(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.protocol=dt.Transport=dt.Socket=dt.uServer=dt.parser=dt.transports=dt.Server=void 0;dt.listen=NL;dt.attach=Zy;var kL=require("http"),Jy=Xf();Object.defineProperty(dt,"Server",{enumerable:!0,get:function(){return Jy.Server}});var OL=uf();dt.transports=OL.default;var Qy=mo();dt.parser=Qy;var ML=Xy();Object.defineProperty(dt,"uServer",{enumerable:!0,get:function(){return ML.uServer}});var PL=ff();Object.defineProperty(dt,"Socket",{enumerable:!0,get:function(){return PL.Socket}});var IL=Qn();Object.defineProperty(dt,"Transport",{enumerable:!0,get:function(){return IL.Transport}});dt.protocol=Qy.protocol;function NL(r,e,t){typeof e=="function"&&(t=e,e={});let n=(0,kL.createServer)(function(s,o){o.writeHead(501),o.end("Not Implemented")}),i=Zy(n,e);return i.httpServer=n,n.listen(r,t),i}function Zy(r,e){let t=new Jy.Server(e);return t.attach(r,e),t}});var r_=O(t_=>{t_.Emitter=Rt;function Rt(r){if(r)return LL(r)}function LL(r){for(var e in Rt.prototype)r[e]=Rt.prototype[e];return r}Rt.prototype.on=Rt.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};Rt.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};Rt.prototype.off=Rt.prototype.removeListener=Rt.prototype.removeAllListeners=Rt.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var n,i=0;i<t.length;i++)if(n=t[i],n===e||n.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+r],this};Rt.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,i=t.length;n<i;++n)t[n].apply(this,e)}return this};Rt.prototype.emitReserved=Rt.prototype.emit;Rt.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};Rt.prototype.hasListeners=function(r){return!!this.listeners(r).length}});var rd=O(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.isBinary=i_;Lc.hasBinary=Nc;var DL=typeof ArrayBuffer=="function",BL=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,n_=Object.prototype.toString,jL=typeof Blob=="function"||typeof Blob<"u"&&n_.call(Blob)==="[object BlobConstructor]",FL=typeof File=="function"||typeof File<"u"&&n_.call(File)==="[object FileConstructor]";function i_(r){return DL&&(r instanceof ArrayBuffer||BL(r))||jL&&r instanceof Blob||FL&&r instanceof File}function Nc(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,n=r.length;t<n;t++)if(Nc(r[t]))return!0;return!1}if(i_(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return Nc(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&Nc(r[t]))return!0;return!1}});var s_=O(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.deconstructPacket=HL;Dc.reconstructPacket=UL;var $L=rd();function HL(r){let e=[],t=r.data,n=r;return n.data=nd(t,e),n.attachments=e.length,{packet:n,buffers:e}}function nd(r,e){if(!r)return r;if((0,$L.isBinary)(r)){let t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){let t=new Array(r.length);for(let n=0;n<r.length;n++)t[n]=nd(r[n],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){let t={};for(let n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=nd(r[n],e));return t}return r}function UL(r,e){return r.data=id(r.data,e),delete r.attachments,r}function id(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=id(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=id(r[t],e));return r}});var To=O(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.Decoder=Er.Encoder=Er.PacketType=Er.protocol=void 0;Er.isPacketValid=KL;var qL=r_(),o_=s_(),a_=rd(),WL=Ae(),sd=(0,WL.default)("socket.io-parser"),c_=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];Er.protocol=5;var pe;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(pe||(Er.PacketType=pe={}));var od=class{constructor(e){this.replacer=e}encode(e){return sd("encoding packet %j",e),(e.type===pe.EVENT||e.type===pe.ACK)&&(0,a_.hasBinary)(e)?this.encodeAsBinary({type:e.type===pe.EVENT?pe.BINARY_EVENT:pe.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===pe.BINARY_EVENT||e.type===pe.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),sd("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,o_.deconstructPacket)(e),n=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(n),i}};Er.Encoder=od;var ad=class r extends qL.Emitter{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let n=t.type===pe.BINARY_EVENT;n||t.type===pe.BINARY_ACK?(t.type=n?pe.EVENT:pe.ACK,this.reconstructor=new cd(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,a_.isBinary)(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,n={type:Number(e.charAt(0))};if(pe[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===pe.BINARY_EVENT||n.type===pe.BINARY_ACK){let s=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(s,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");let a=Number(o);if(!l_(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");n.attachments=a}if(e.charAt(t+1)==="/"){let s=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(s,t)}else n.nsp="/";let i=e.charAt(t+1);if(i!==""&&Number(i)==i){let s=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}n.id=Number(e.substring(s,t+1))}if(e.charAt(++t)){let s=this.tryParse(e.substr(t));if(r.isPayloadValid(n.type,s))n.data=s;else throw new Error("invalid payload")}return sd("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case pe.CONNECT:return Bc(t);case pe.DISCONNECT:return t===void 0;case pe.CONNECT_ERROR:return typeof t=="string"||Bc(t);case pe.EVENT:case pe.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&c_.indexOf(t[0])===-1);case pe.ACK:case pe.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};Er.Decoder=ad;var cd=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=(0,o_.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function GL(r){return typeof r=="string"}var l_=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function zL(r){return r===void 0||l_(r)}function Bc(r){return Object.prototype.toString.call(r)==="[object Object]"}function VL(r,e){switch(r){case pe.CONNECT:return e===void 0||Bc(e);case pe.DISCONNECT:return e===void 0;case pe.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&c_.indexOf(e[0])===-1);case pe.ACK:return Array.isArray(e);case pe.CONNECT_ERROR:return typeof e=="string"||Bc(e);default:return!1}}function KL(r){return GL(r.nsp)&&zL(r.id)&&VL(r.type,r.data)}});var u_=O(rs=>{"use strict";var YL=rs&&rs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(rs,"__esModule",{value:!0});rs.Client=void 0;var jc=To(),XL=YL(Ae()),Tr=(0,XL.default)("socket.io:client"),ld=class{constructor(e,t){this.sockets=new Map,this.nsps=new Map,this.server=e,this.conn=t,this.encoder=e.encoder,this.decoder=new e._parser.Decoder,this.id=t.id,this.setup()}get request(){return this.conn.request}setup(){this.onclose=this.onclose.bind(this),this.ondata=this.ondata.bind(this),this.onerror=this.onerror.bind(this),this.ondecoded=this.ondecoded.bind(this),this.decoder.on("decoded",this.ondecoded),this.conn.on("data",this.ondata),this.conn.on("error",this.onerror),this.conn.on("close",this.onclose),this.connectTimeout=setTimeout(()=>{this.nsps.size===0?(Tr("no namespace joined yet, close the client"),this.close()):Tr("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return Tr("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,n=>{n?this.doConnect(e,t):(Tr("creation of namespace %s was denied",e),this._packet({type:jc.PacketType.CONNECT_ERROR,nsp:e,data:{message:"Invalid namespace"}}))})}doConnect(e,t){let n=this.server.of(e);n._add(this,t,i=>{this.sockets.set(i.id,i),this.nsps.set(n.name,i),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0)})}_disconnect(){for(let e of this.sockets.values())e.disconnect();this.sockets.clear(),this.close()}_remove(e){if(this.sockets.has(e.id)){let t=this.sockets.get(e.id).nsp.name;this.sockets.delete(e.id),this.nsps.delete(t)}else Tr("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(Tr("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){Tr("ignoring packet write %j",e);return}let n=t.preEncoded?e:this.encoder.encode(e);this.writeToEngine(n,t)}writeToEngine(e,t){if(t.volatile&&!this.conn.transport.writable){Tr("volatile packet is discarded since the transport is not currently writable");return}let n=Array.isArray(e)?e:[e];for(let i of n)this.conn.write(i,t)}ondata(e){try{this.decoder.add(e)}catch(t){Tr("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:n}=this._parseNamespace(e),i=this.nsps.get(t);!i&&e.type===jc.PacketType.CONNECT?this.connect(t,n):i&&e.type!==jc.PacketType.CONNECT&&e.type!==jc.PacketType.CONNECT_ERROR?process.nextTick(function(){i._onpacket(e)}):(Tr("invalid state (packet type: %s)",e.type),this.close())}_parseNamespace(e){if(this.conn.protocol!==3)return{namespace:e.nsp,authPayload:e.data};let t=new URL(e.nsp,"https://socket.io");return{namespace:t.pathname,authPayload:Object.fromEntries(t.searchParams.entries())}}onerror(e){for(let t of this.sockets.values())t._onerror(e);this.conn.close()}onclose(e,t){Tr("client close with reason %s",e),this.destroy();for(let n of this.sockets.values())n._onclose(e,t);this.sockets.clear(),this.decoder.destroy()}destroy(){this.conn.removeListener("data",this.ondata),this.conn.removeListener("error",this.onerror),this.conn.removeListener("close",this.onclose),this.decoder.removeListener("decoded",this.ondecoded),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0)}};rs.Client=ld});var $c=O(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.StrictEventEmitter=void 0;var JL=require("events"),ud=class extends JL.EventEmitter{on(e,t){return super.on(e,t)}once(e,t){return super.once(e,t)}emit(e,...t){return super.emit(e,...t)}emitReserved(e,...t){return super.emit(e,...t)}emitUntyped(e,...t){return super.emit(e,...t)}listeners(e){return super.listeners(e)}};Fc.StrictEventEmitter=ud});var pd=O(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.RESERVED_EVENTS=void 0;Hc.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var fd=O(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.RemoteSocket=ns.BroadcastOperator=void 0;var QL=pd(),ZL=To(),Uc=class r{constructor(e,t=new Set,n=new Set,i={}){this.adapter=e,this.rooms=t,this.exceptRooms=n,this.flags=i}to(e){let t=new Set(this.rooms);return Array.isArray(e)?e.forEach(n=>t.add(n)):t.add(e),new r(this.adapter,t,this.exceptRooms,this.flags)}in(e){return this.to(e)}except(e){let t=new Set(this.exceptRooms);return Array.isArray(e)?e.forEach(n=>t.add(n)):t.add(e),new r(this.adapter,this.rooms,t,this.flags)}compress(e){let t=Object.assign({},this.flags,{compress:e});return new r(this.adapter,this.rooms,this.exceptRooms,t)}get volatile(){let e=Object.assign({},this.flags,{volatile:!0});return new r(this.adapter,this.rooms,this.exceptRooms,e)}get local(){let e=Object.assign({},this.flags,{local:!0});return new r(this.adapter,this.rooms,this.exceptRooms,e)}timeout(e){let t=Object.assign({},this.flags,{timeout:e});return new r(this.adapter,this.rooms,this.exceptRooms,t)}emit(e,...t){if(QL.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],i={type:ZL.PacketType.EVENT,data:n};if(!(typeof n[n.length-1]=="function"))return this.adapter.broadcast(i,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let o=n.pop(),a=!1,c=[],u=setTimeout(()=>{a=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:c])},this.flags.timeout),p=-1,f=0,m=0,y=()=>{!a&&p===f&&c.length===m&&(clearTimeout(u),o.apply(this,[null,this.flags.expectSingleResponse?c[0]:c]))};return this.adapter.broadcastWithAck(i,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},_=>{m+=_,f++,y()},_=>{c.push(_),y()}),this.adapter.serverCount().then(_=>{p=_,y()}),!0}emitWithAck(e,...t){return new Promise((n,i)=>{t.push((s,o)=>s?(s.responses=o,i(s)):n(o)),this.emit(e,...t)})}allSockets(){if(!this.adapter)throw new Error("No adapter for this namespace, are you trying to get the list of clients of a dynamic namespace?");return this.adapter.sockets(this.rooms)}fetchSockets(){return this.adapter.fetchSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags}).then(e=>e.map(t=>t.server?t:new qc(this.adapter,t)))}socketsJoin(e){this.adapter.addSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(e)?e:[e])}socketsLeave(e){this.adapter.delSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(e)?e:[e])}disconnectSockets(e=!1){this.adapter.disconnectSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},e)}};ns.BroadcastOperator=Uc;var qc=class{constructor(e,t){this.id=t.id,this.handshake=t.handshake,this.rooms=new Set(t.rooms),this.data=t.data,this.operator=new Uc(e,new Set([this.id]),new Set,{expectSingleResponse:!0})}timeout(e){return this.operator.timeout(e)}emit(e,...t){return this.operator.emit(e,...t)}join(e){return this.operator.socketsJoin(e)}leave(e){return this.operator.socketsLeave(e)}disconnect(e=!1){return this.operator.disconnectSockets(e),this}};ns.RemoteSocket=qc});var hd=O(is=>{"use strict";var d_=is&&is.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(is,"__esModule",{value:!0});is.Socket=void 0;var or=To(),eD=d_(Ae()),tD=$c(),p_=d_(Wp()),rD=fd(),nD=pd(),_t=(0,eD.default)("socket.io:socket"),iD=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function f_(){}var dd=class extends tD.StrictEventEmitter{constructor(e,t,n,i){super(),this.nsp=e,this.client=t,this.recovered=!1,this.data={},this.connected=!1,this.acks=new Map,this.fns=[],this.flags={},this.server=e.server,this.adapter=e.adapter,i?(this.id=i.sid,this.pid=i.pid,i.rooms.forEach(s=>this.join(s)),this.data=i.data,i.missedPackets.forEach(s=>{this.packet({type:or.PacketType.EVENT,data:s})}),this.recovered=!0):(t.conn.protocol===3?this.id=e.name!=="/"?e.name+"#"+t.id:t.id:this.id=p_.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=p_.default.generateId())),this.handshake=this.buildHandshake(n),this.on("error",f_)}buildHandshake(e){var t,n,i,s;return{headers:((t=this.request)===null||t===void 0?void 0:t.headers)||{},time:new Date+"",address:this.conn.remoteAddress,xdomain:!!(!((n=this.request)===null||n===void 0)&&n.headers.origin),secure:!this.request||!!this.request.connection.encrypted,issued:+new Date,url:(i=this.request)===null||i===void 0?void 0:i.url,query:((s=this.request)===null||s===void 0?void 0:s._query)||{},auth:e}}emit(e,...t){if(nD.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],i={type:or.PacketType.EVENT,data:n};if(typeof n[n.length-1]=="function"){let o=this.nsp._ids++;_t("emitting packet with ack id %d",o),this.registerAckCallback(o,n.pop()),i.id=o}let s=Object.assign({},this.flags);return this.flags={},this.nsp.server.opts.connectionStateRecovery?this.adapter.broadcast(i,{rooms:new Set([this.id]),except:new Set,flags:s}):(this.notifyOutgoingListeners(i),this.packet(i,s)),!0}emitWithAck(e,...t){let n=this.flags.timeout!==void 0;return new Promise((i,s)=>{t.push((o,a)=>n?o?s(o):i(a):i(o)),this.emit(e,...t)})}registerAckCallback(e,t){let n=this.flags.timeout;if(n===void 0){this.acks.set(e,t);return}let i=setTimeout(()=>{_t("event with ack id %d has timed out after %d ms",e,n),this.acks.delete(e),t.call(this,new Error("operation has timed out"))},n);this.acks.set(e,(...s)=>{clearTimeout(i),t.apply(this,[null,...s])})}to(e){return this.newBroadcastOperator().to(e)}in(e){return this.newBroadcastOperator().in(e)}except(e){return this.newBroadcastOperator().except(e)}send(...e){return this.emit("message",...e),this}write(...e){return this.emit("message",...e),this}packet(e,t={}){e.nsp=this.nsp.name,t.compress=t.compress!==!1,this.client._packet(e,t)}join(e){return _t("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return _t("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){_t("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3?this.packet({type:or.PacketType.CONNECT}):this.packet({type:or.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(_t("got packet %j",e),e.type){case or.PacketType.EVENT:this.onevent(e);break;case or.PacketType.BINARY_EVENT:this.onevent(e);break;case or.PacketType.ACK:this.onack(e);break;case or.PacketType.BINARY_ACK:this.onack(e);break;case or.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(e){let t=e.data||[];if(_t("emitting event %j",t),e.id!=null&&(_t("attaching ack callback to event"),t.push(this.ack(e.id))),this._anyListeners&&this._anyListeners.length){let n=this._anyListeners.slice();for(let i of n)i.apply(this,t)}this.dispatch(t)}ack(e){let t=this,n=!1;return function(){if(n)return;let i=Array.prototype.slice.call(arguments);_t("sending ack %j",i),t.packet({id:e,type:or.PacketType.ACK,data:i}),n=!0}}onack(e){let t=this.acks.get(e.id);typeof t=="function"?(_t("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):_t("bad ack %s",e.id)}ondisconnect(){_t("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;_t("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&iD.has(e)&&(_t("connection state recovery is enabled for sid %s",this.id),this.adapter.persistSession({sid:this.id,pid:this.pid,rooms:[...this.rooms],data:this.data})),this._cleanup(),this.client._remove(this),this.connected=!1,this.emitReserved("disconnect",e,t)}_cleanup(){this.leaveAll(),this.nsp._remove(this),this.join=f_}_error(e){this.packet({type:or.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:or.PacketType.DISCONNECT}),this._onclose("server namespace disconnect")),this):this}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}get broadcast(){return this.newBroadcastOperator()}get local(){return this.newBroadcastOperator().local}timeout(e){return this.flags.timeout=e,this}dispatch(e){_t("dispatching an event %j",e),this.run(e,t=>{process.nextTick(()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):_t("ignore packet received after disconnection")})})}use(e){return this.fns.push(e),this}run(e,t){if(!this.fns.length)return t();let n=this.fns.slice(0);function i(s){n[s](e,o=>{if(o)return t(o);if(!n[s+1])return t();i(s+1)})}i(0)}get disconnected(){return!this.connected}get request(){return this.client.request}get conn(){return this.client.conn}get rooms(){return this.adapter.socketRooms(this.id)||new Set}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}newBroadcastOperator(){let e=Object.assign({},this.flags);return this.flags={},new rD.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};is.Socket=dd});var gd=O(an=>{"use strict";var sD=an&&an.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(an,"__esModule",{value:!0});an.Namespace=an.RESERVED_EVENTS=void 0;var h_=hd(),oD=$c(),aD=sD(Ae()),Yt=fd(),ss=(0,aD.default)("socket.io:namespace");an.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var md=class extends oD.StrictEventEmitter{constructor(e,t){super(),this.sockets=new Map,this._preConnectSockets=new Map,this._fns=[],this._ids=0,this.server=e,this.name=t,this._initAdapter()}_initAdapter(){this.adapter=new(this.server.adapter())(this),Promise.resolve(this.adapter.init()).catch(e=>{ss("error while initializing adapter: %s",e)})}use(e){return this._fns.push(e),this}run(e,t){if(!this._fns.length)return t();let n=this._fns.slice(0);function i(s){n[s](e,o=>{if(o)return t(o);if(!n[s+1])return t();i(s+1)})}i(0)}to(e){return new Yt.BroadcastOperator(this.adapter).to(e)}in(e){return new Yt.BroadcastOperator(this.adapter).in(e)}except(e){return new Yt.BroadcastOperator(this.adapter).except(e)}async _add(e,t,n){var i;ss("adding socket to nsp %s",this.name);let s=await this._createSocket(e,t);if(this._preConnectSockets.set(s.id,s),!((i=this.server.opts.connectionStateRecovery)===null||i===void 0)&&i.skipMiddlewares&&s.recovered&&e.conn.readyState==="open")return this._doConnect(s,n);this.run(s,o=>{process.nextTick(()=>{if(e.conn.readyState!=="open"){ss("next called after client was closed - ignoring socket"),s._cleanup();return}if(o)return ss("middleware error, sending CONNECT_ERROR packet to the client"),s._cleanup(),e.conn.protocol===3?s._error(o.data||o.message):s._error({message:o.message,data:o.data});this._doConnect(s,n)})})}async _createSocket(e,t){let n=t.pid,i=t.offset;if(this.server.opts.connectionStateRecovery&&typeof n=="string"&&typeof i=="string"){let s;try{s=await this.adapter.restoreSession(n,i)}catch(o){ss("error while restoring session: %s",o)}if(s)return ss("connection state recovered for sid %s",s.sid),new h_.Socket(this,e,t,s)}return new h_.Socket(this,e,t)}_doConnect(e,t){this._preConnectSockets.delete(e.id),this.sockets.set(e.id,e),e._onconnect(),t&&t(e),this.emitReserved("connect",e),this.emitReserved("connection",e)}_remove(e){this.sockets.delete(e.id)||this._preConnectSockets.delete(e.id)}emit(e,...t){return new Yt.BroadcastOperator(this.adapter).emit(e,...t)}send(...e){return this.emit("message",...e),this}write(...e){return this.emit("message",...e),this}serverSideEmit(e,...t){if(an.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);return t.unshift(e),this.adapter.serverSideEmit(t),!0}serverSideEmitWithAck(e,...t){return new Promise((n,i)=>{t.push((s,o)=>s?(s.responses=o,i(s)):n(o)),this.serverSideEmit(e,...t)})}_onServerSideEmit(e){super.emitUntyped.apply(this,e)}allSockets(){return new Yt.BroadcastOperator(this.adapter).allSockets()}compress(e){return new Yt.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new Yt.BroadcastOperator(this.adapter).volatile}get local(){return new Yt.BroadcastOperator(this.adapter).local}timeout(e){return new Yt.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new Yt.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new Yt.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new Yt.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new Yt.BroadcastOperator(this.adapter).disconnectSockets(e)}};an.Namespace=md});var y_=O(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.encode=vd;Co.decode=cD;Co.yeast=lD;var v_="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Wc=64,x_={},m_=0,Bn=0,g_;function vd(r){let e="";do e=v_[r%Wc]+e,r=Math.floor(r/Wc);while(r>0);return e}function cD(r){let e=0;for(Bn=0;Bn<r.length;Bn++)e=e*Wc+x_[r.charAt(Bn)];return e}function lD(){let r=vd(+new Date);return r!==g_?(m_=0,g_=r):r+"."+vd(m_++)}for(;Bn<Wc;Bn++)x_[v_[Bn]]=Bn});var cn=O((SW,w_)=>{"use strict";var __=["nodebuffer","arraybuffer","fragments"],b_=typeof Blob<"u";b_&&__.push("blob");w_.exports={BINARY_TYPES:__,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:b_,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Ao=O((EW,Gc)=>{"use strict";var{EMPTY_BUFFER:uD}=cn(),xd=Buffer[Symbol.species];function pD(r,e){if(r.length===0)return uD;if(r.length===1)return r[0];let t=Buffer.allocUnsafe(e),n=0;for(let i=0;i<r.length;i++){let s=r[i];t.set(s,n),n+=s.length}return n<e?new xd(t.buffer,t.byteOffset,n):t}function S_(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function E_(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function fD(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function yd(r){if(yd.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new xd(r):ArrayBuffer.isView(r)?e=new xd(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),yd.readOnly=!1),e}Gc.exports={concat:pD,mask:S_,toArrayBuffer:fD,toBuffer:yd,unmask:E_};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=Sf();Gc.exports.mask=function(e,t,n,i,s){s<48?S_(e,t,n,i,s):r.mask(e,t,n,i,s)},Gc.exports.unmask=function(e,t){e.length<32?E_(e,t):r.unmask(e,t)}}catch{}});var A_=O((TW,C_)=>{"use strict";var T_=Symbol("kDone"),_d=Symbol("kRun"),bd=class{constructor(e){this[T_]=()=>{this.pending--,this[_d]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[_d]()}[_d](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[T_])}}};C_.exports=bd});var ko=O((CW,M_)=>{"use strict";var Ro=require("zlib"),R_=Ao(),dD=A_(),{kStatusCode:k_}=cn(),hD=Buffer[Symbol.species],mD=Buffer.from([0,0,255,255]),Vc=Symbol("permessage-deflate"),ln=Symbol("total-length"),os=Symbol("callback"),jn=Symbol("buffers"),as=Symbol("error"),zc,wd=class{constructor(e,t,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!zc){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;zc=new dD(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[os];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,n=e.find(i=>!(t.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>i.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(n=>{let i=t[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}"`);t[n]=i})}),e}decompress(e,t,n){zc.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){zc.add(i=>{this._compress(e,t,(s,o)=>{i(),n(s,o)})})}_decompress(e,t,n){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?Ro.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Ro.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[Vc]=this,this._inflate[ln]=0,this._inflate[jn]=[],this._inflate.on("error",vD),this._inflate.on("data",O_)}this._inflate[os]=n,this._inflate.write(e),t&&this._inflate.write(mD),this._inflate.flush(()=>{let s=this._inflate[as];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=R_.concat(this._inflate[jn],this._inflate[ln]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[ln]=0,this._inflate[jn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?Ro.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Ro.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[ln]=0,this._deflate[jn]=[],this._deflate.on("data",gD)}this._deflate[os]=n,this._deflate.write(e),this._deflate.flush(Ro.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=R_.concat(this._deflate[jn],this._deflate[ln]);t&&(s=new hD(s.buffer,s.byteOffset,s.length-4)),this._deflate[os]=null,this._deflate[ln]=0,this._deflate[jn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};M_.exports=wd;function gD(r){this[jn].push(r),this[ln]+=r.length}function O_(r){if(this[ln]+=r.length,this[Vc]._maxPayload<1||this[ln]<=this[Vc]._maxPayload){this[jn].push(r);return}this[as]=new RangeError("Max payload size exceeded"),this[as].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[as][k_]=1009,this.removeListener("data",O_),this.reset()}function vD(r){if(this[Vc]._inflate=null,this[as]){this[os](this[as]);return}r[k_]=1007,this[os](r)}});var cs=O((AW,Kc)=>{"use strict";var{isUtf8:P_}=require("buffer"),{hasBlob:xD}=cn(),yD=[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 _D(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function Sd(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}function bD(r){return xD&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}Kc.exports={isBlob:bD,isValidStatusCode:_D,isValidUTF8:Sd,tokenChars:yD};if(P_)Kc.exports.isValidUTF8=function(r){return r.length<24?Sd(r):P_(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=Of();Kc.exports.isValidUTF8=function(e){return e.length<32?Sd(e):r(e)}}catch{}});var Rd=O((RW,F_)=>{"use strict";var{Writable:wD}=require("stream"),I_=ko(),{BINARY_TYPES:SD,EMPTY_BUFFER:N_,kStatusCode:ED,kWebSocket:TD}=cn(),{concat:Ed,toArrayBuffer:CD,unmask:AD}=Ao(),{isValidStatusCode:RD,isValidUTF8:L_}=cs(),Yc=Buffer[Symbol.species],ar=0,D_=1,B_=2,j_=3,Td=4,Cd=5,Xc=6,Ad=class extends wD{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||SD[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[TD]=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=ar}_write(e,t,n){if(this._opcode===8&&this._state==ar)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new Yc(n.buffer,n.byteOffset+e,n.length-e),new Yc(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],i=t.length-e;e>=n.length?t.set(this._buffers.shift(),i):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),i),this._buffers[0]=new Yc(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case ar:this.getInfo(e);break;case D_:this.getPayloadLength16(e);break;case B_:this.getPayloadLength64(e);break;case j_:this.getMask();break;case Td:this.getData(e);break;case Cd:case Xc:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let n=(t[0]&64)===64;if(n&&!this._extensions[I_.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(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");e(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");e(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(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");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=D_:this._payloadLength===127?this._state=B_:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.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");e(i);return}this._payloadLength=n*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=j_:this._state=Td}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Td}getData(e){let t=N_;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&AD(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=Cd,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[I_.extensionName].decompress(e,this._fin,(i,s)=>{if(i)return t(i);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._fragments.push(s)}this.dataMessage(t),this._state===ar&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=ar;return}let t=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=Ed(n,t):this._binaryType==="arraybuffer"?i=CD(Ed(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=ar):(this._state=Xc,setImmediate(()=>{this.emit("message",i,!0),this._state=ar,this.startLoop(e)}))}else{let i=Ed(n,t);if(!this._skipUTF8Validation&&!L_(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===Cd||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=ar):(this._state=Xc,setImmediate(()=>{this.emit("message",i,!1),this._state=ar,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,N_),this.end();else{let n=e.readUInt16BE(0);if(!RD(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new Yc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!L_(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=ar;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=ar):(this._state=Xc,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=ar,this.startLoop(t)}))}createError(e,t,n,i,s){this._loop=!1,this._errored=!0;let o=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=s,o[ED]=i,o}};F_.exports=Ad});var Md=O((OW,U_)=>{"use strict";var{Duplex:kW}=require("stream"),{randomFillSync:kD}=require("crypto"),$_=ko(),{EMPTY_BUFFER:OD,kWebSocket:MD,NOOP:PD}=cn(),{isBlob:ls,isValidStatusCode:ID}=cs(),{mask:H_,toBuffer:si}=Ao(),cr=Symbol("kByteLength"),ND=Buffer.alloc(4),Jc=8*1024,oi,us=Jc,Cr=0,LD=1,DD=2,kd=class r{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Cr,this.onerror=PD,this[MD]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||ND,t.generateMask?t.generateMask(n):(us===Jc&&(oi===void 0&&(oi=Buffer.alloc(Jc)),kD(oi,0,Jc),us=0),n[0]=oi[us++],n[1]=oi[us++],n[2]=oi[us++],n[3]=oi[us++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[cr]!==void 0?a=t[cr]:(e=Buffer.from(e),a=e.length):(a=e.length,i=t.mask&&t.readOnly&&!o);let c=a;a>=65536?(s+=8,c=127):a>125&&(s+=2,c=126);let u=Buffer.allocUnsafe(i?a+s:s);return u[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),t.mask?(u[1]|=128,u[s-4]=n[0],u[s-3]=n[1],u[s-2]=n[2],u[s-1]=n[3],o?[u,e]:i?(H_(e,n,u,s,a),[u]):(H_(e,n,e,0,a),[u,e])):[u,e]}close(e,t,n,i){let s;if(e===void 0)s=OD;else{if(typeof e!="number"||!ID(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+a),s.writeUInt16BE(e,0),typeof t=="string"?s.write(t,2):s.set(t,2)}}let o={[cr]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Cr?this.enqueue([this.dispatch,s,!1,o,i]):this.sendFrame(r.frame(s,o),i)}ping(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):ls(e)?(i=e.size,s=!1):(e=si(e),i=e.length,s=si.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[cr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};ls(e)?this._state!==Cr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Cr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}pong(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):ls(e)?(i=e.size,s=!1):(e=si(e),i=e.length,s=si.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[cr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};ls(e)?this._state!==Cr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Cr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let i=this._extensions[$_.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):ls(e)?(a=e.size,c=!1):(e=si(e),a=e.length,c=si.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=i._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let u={[cr]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};ls(e)?this._state!==Cr?this.enqueue([this.getBlobData,e,this._compress,u,n]):this.getBlobData(e,this._compress,u,n):this._state!==Cr?this.enqueue([this.dispatch,e,this._compress,u,n]):this.dispatch(e,this._compress,u,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[cr],this._state=DD,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Od,this,a,i);return}this._bufferedBytes-=n[cr];let o=si(s);t?this.dispatch(o,t,n,i):(this._state=Cr,this.sendFrame(r.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(BD,this,s,i)})}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[$_.extensionName];this._bufferedBytes+=n[cr],this._state=LD,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Od(this,c,i);return}this._bufferedBytes-=n[cr],this._state=Cr,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===Cr&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][cr],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][cr],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};U_.exports=kd;function Od(r,e,t){typeof t=="function"&&t(e);for(let n=0;n<r._queue.length;n++){let i=r._queue[n],s=i[i.length-1];typeof s=="function"&&s(e)}}function BD(r,e,t){Od(r,e,t),r.onerror(e)}});var J_=O((MW,X_)=>{"use strict";var{kForOnEventAttribute:Oo,kListener:Pd}=cn(),q_=Symbol("kCode"),W_=Symbol("kData"),G_=Symbol("kError"),z_=Symbol("kMessage"),V_=Symbol("kReason"),ps=Symbol("kTarget"),K_=Symbol("kType"),Y_=Symbol("kWasClean"),un=class{constructor(e){this[ps]=null,this[K_]=e}get target(){return this[ps]}get type(){return this[K_]}};Object.defineProperty(un.prototype,"target",{enumerable:!0});Object.defineProperty(un.prototype,"type",{enumerable:!0});var ai=class extends un{constructor(e,t={}){super(e),this[q_]=t.code===void 0?0:t.code,this[V_]=t.reason===void 0?"":t.reason,this[Y_]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[q_]}get reason(){return this[V_]}get wasClean(){return this[Y_]}};Object.defineProperty(ai.prototype,"code",{enumerable:!0});Object.defineProperty(ai.prototype,"reason",{enumerable:!0});Object.defineProperty(ai.prototype,"wasClean",{enumerable:!0});var fs=class extends un{constructor(e,t={}){super(e),this[G_]=t.error===void 0?null:t.error,this[z_]=t.message===void 0?"":t.message}get error(){return this[G_]}get message(){return this[z_]}};Object.defineProperty(fs.prototype,"error",{enumerable:!0});Object.defineProperty(fs.prototype,"message",{enumerable:!0});var Mo=class extends un{constructor(e,t={}){super(e),this[W_]=t.data===void 0?null:t.data}get data(){return this[W_]}};Object.defineProperty(Mo.prototype,"data",{enumerable:!0});var jD={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[Oo]&&i[Pd]===e&&!i[Oo])return;let n;if(r==="message")n=function(s,o){let a=new Mo("message",{data:o?s:s.toString()});a[ps]=this,Qc(e,this,a)};else if(r==="close")n=function(s,o){let a=new ai("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[ps]=this,Qc(e,this,a)};else if(r==="error")n=function(s){let o=new fs("error",{error:s,message:s.message});o[ps]=this,Qc(e,this,o)};else if(r==="open")n=function(){let s=new un("open");s[ps]=this,Qc(e,this,s)};else return;n[Oo]=!!t[Oo],n[Pd]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[Pd]===e&&!t[Oo]){this.removeListener(r,t);break}}};X_.exports={CloseEvent:ai,ErrorEvent:fs,Event:un,EventTarget:jD,MessageEvent:Mo};function Qc(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var Id=O((PW,Q_)=>{"use strict";var{tokenChars:Po}=cs();function jr(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function FD(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,u=-1,p=-1,f=0;for(;f<r.length;f++)if(u=r.charCodeAt(f),o===void 0)if(p===-1&&Po[u]===1)c===-1&&(c=f);else if(f!==0&&(u===32||u===9))p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);u===44?(jr(e,y,t),t=Object.create(null)):o=y,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(p===-1&&Po[u]===1)c===-1&&(c=f);else if(u===32||u===9)p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f),jr(t,r.slice(c,p),!0),u===44&&(jr(e,o,t),t=Object.create(null),o=void 0),c=p=-1}else if(u===61&&c!==-1&&p===-1)a=r.slice(c,f),c=p=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(Po[u]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if(Po[u]===1)c===-1&&(c=f);else if(u===34&&c!==-1)s=!1,p=f;else if(u===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(u===34&&r.charCodeAt(f-1)===61)s=!0;else if(p===-1&&Po[u]===1)c===-1&&(c=f);else if(c!==-1&&(u===32||u===9))p===-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);n&&(y=y.replace(/\\/g,""),n=!1),jr(t,a,y),u===44&&(jr(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||u===32||u===9)throw new SyntaxError("Unexpected end of input");p===-1&&(p=f);let m=r.slice(c,p);return o===void 0?jr(e,m,t):(a===void 0?jr(t,m,!0):n?jr(t,a,m.replace(/\\/g,"")):jr(t,a,m),jr(e,o,t)),e}function $D(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(i=>{let s=n[i];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Q_.exports={format:$D,parse:FD}});var rl=O((LW,ub)=>{"use strict";var HD=require("events"),UD=require("https"),qD=require("http"),tb=require("net"),WD=require("tls"),{randomBytes:GD,createHash:zD}=require("crypto"),{Duplex:IW,Readable:NW}=require("stream"),{URL:Nd}=require("url"),Fn=ko(),VD=Rd(),KD=Md(),{isBlob:YD}=cs(),{BINARY_TYPES:Z_,EMPTY_BUFFER:Zc,GUID:XD,kForOnEventAttribute:Ld,kListener:JD,kStatusCode:QD,kWebSocket:ht,NOOP:rb}=cn(),{EventTarget:{addEventListener:ZD,removeEventListener:e2}}=J_(),{format:t2,parse:r2}=Id(),{toBuffer:n2}=Ao(),i2=30*1e3,nb=Symbol("kAborted"),Dd=[8,13],pn=["CONNECTING","OPEN","CLOSING","CLOSED"],s2=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Se=class r extends HD{constructor(e,t,n){super(),this._binaryType=Z_[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Zc,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(n=t,t=[]):t=[t]),ib(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Z_.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,n){let i=new VD({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new KD(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[ht]=this,s[ht]=this,e[ht]=this,i.on("conclude",c2),i.on("drain",l2),i.on("error",u2),i.on("message",p2),i.on("ping",f2),i.on("pong",d2),s.onerror=h2,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",ab),e.on("data",tl),e.on("end",cb),e.on("error",lb),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Fn.extensionName]&&this._extensions[Fn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Xt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),ob(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Bd(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||Zc,t,n)}pong(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Bd(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||Zc,t,n)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(n=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Bd(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[Fn.extensionName]||(i.compress=!1),this._sender.send(e||Zc,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Xt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(Se,"CONNECTING",{enumerable:!0,value:pn.indexOf("CONNECTING")});Object.defineProperty(Se.prototype,"CONNECTING",{enumerable:!0,value:pn.indexOf("CONNECTING")});Object.defineProperty(Se,"OPEN",{enumerable:!0,value:pn.indexOf("OPEN")});Object.defineProperty(Se.prototype,"OPEN",{enumerable:!0,value:pn.indexOf("OPEN")});Object.defineProperty(Se,"CLOSING",{enumerable:!0,value:pn.indexOf("CLOSING")});Object.defineProperty(Se.prototype,"CLOSING",{enumerable:!0,value:pn.indexOf("CLOSING")});Object.defineProperty(Se,"CLOSED",{enumerable:!0,value:pn.indexOf("CLOSED")});Object.defineProperty(Se.prototype,"CLOSED",{enumerable:!0,value:pn.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(Se.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(Se.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Ld])return e[JD];return null},set(e){for(let t of this.listeners(r))if(t[Ld]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[Ld]:!0})}})});Se.prototype.addEventListener=ZD;Se.prototype.removeEventListener=e2;ub.exports=Se;function ib(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Dd[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(r._autoPong=i.autoPong,!Dd.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Dd.join(", ")})`);let s;if(e instanceof Nd)s=e;else try{s=new Nd(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),r._url=s.href;let o=s.protocol==="wss:",a=s.protocol==="ws+unix:",c;if(s.protocol!=="ws:"&&!o&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let S=new SyntaxError(c);if(r._redirects===0)throw S;el(r,S);return}let u=o?443:80,p=GD(16).toString("base64"),f=o?UD.request:qD.request,m=new Set,y;if(i.createConnection=i.createConnection||(o?a2:o2),i.defaultPort=i.defaultPort||u,i.port=s.port||u,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":p,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(y=new Fn(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=t2({[Fn.extensionName]:y.offer()})),t.length){for(let S of t){if(typeof S!="string"||!s2.test(S)||m.has(S))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(S)}i.headers["Sec-WebSocket-Protocol"]=t.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}`),a){let S=i.path.split(":");i.socketPath=S[0],i.path=S[1]}let _;if(i.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=o,r._originalHostOrSocketPath=a?i.socketPath:s.host;let S=n&&n.headers;if(n={...n,headers:{}},S)for(let[A,M]of Object.entries(S))n.headers[A.toLowerCase()]=M}else if(r.listenerCount("redirect")===0){let S=a?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:s.host===r._originalHostOrSocketPath;(!S||r._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,S||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),_=r._req=f(i),r._redirects&&r.emit("redirect",r.url,_)}else _=r._req=f(i);i.timeout&&_.on("timeout",()=>{Xt(r,_,"Opening handshake has timed out")}),_.on("error",S=>{_===null||_[nb]||(_=r._req=null,el(r,S))}),_.on("response",S=>{let A=S.headers.location,M=S.statusCode;if(A&&i.followRedirects&&M>=300&&M<400){if(++r._redirects>i.maxRedirects){Xt(r,_,"Maximum redirects exceeded");return}_.abort();let L;try{L=new Nd(A,e)}catch{let j=new SyntaxError(`Invalid URL: ${A}`);el(r,j);return}ib(r,L,t,n)}else r.emit("unexpected-response",_,S)||Xt(r,_,`Unexpected server response: ${S.statusCode}`)}),_.on("upgrade",(S,A,M)=>{if(r.emit("upgrade",S),r.readyState!==Se.CONNECTING)return;_=r._req=null;let L=S.headers.upgrade;if(L===void 0||L.toLowerCase()!=="websocket"){Xt(r,A,"Invalid Upgrade header");return}let N=zD("sha1").update(p+XD).digest("base64");if(S.headers["sec-websocket-accept"]!==N){Xt(r,A,"Invalid Sec-WebSocket-Accept header");return}let j=S.headers["sec-websocket-protocol"],W;if(j!==void 0?m.size?m.has(j)||(W="Server sent an invalid subprotocol"):W="Server sent a subprotocol but none was requested":m.size&&(W="Server sent no subprotocol"),W){Xt(r,A,W);return}j&&(r._protocol=j);let q=S.headers["sec-websocket-extensions"];if(q!==void 0){if(!y){Xt(r,A,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let G;try{G=r2(q)}catch{Xt(r,A,"Invalid Sec-WebSocket-Extensions header");return}let P=Object.keys(G);if(P.length!==1||P[0]!==Fn.extensionName){Xt(r,A,"Server indicated an extension that was not requested");return}try{y.accept(G[Fn.extensionName])}catch{Xt(r,A,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[Fn.extensionName]=y}r.setSocket(A,M,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(_,r):_.end()}function el(r,e){r._readyState=Se.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function o2(r){return r.path=r.socketPath,tb.connect(r)}function a2(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=tb.isIP(r.host)?"":r.host),WD.connect(r)}function Xt(r,e,t){r._readyState=Se.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Xt),e.setHeader?(e[nb]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(el,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Bd(r,e,t){if(e){let n=YD(e)?e.size:n2(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${pn[r.readyState]})`);process.nextTick(t,n)}}function c2(r,e){let t=this[ht];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[ht]!==void 0&&(t._socket.removeListener("data",tl),process.nextTick(sb,t._socket),r===1005?t.close():t.close(r,e))}function l2(){let r=this[ht];r.isPaused||r._socket.resume()}function u2(r){let e=this[ht];e._socket[ht]!==void 0&&(e._socket.removeListener("data",tl),process.nextTick(sb,e._socket),e.close(r[QD])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function eb(){this[ht].emitClose()}function p2(r,e){this[ht].emit("message",r,e)}function f2(r){let e=this[ht];e._autoPong&&e.pong(r,!this._isServer,rb),e.emit("ping",r)}function d2(r){this[ht].emit("pong",r)}function sb(r){r.resume()}function h2(r){let e=this[ht];e.readyState!==Se.CLOSED&&(e.readyState===Se.OPEN&&(e._readyState=Se.CLOSING,ob(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function ob(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),i2)}function ab(){let r=this[ht];this.removeListener("close",ab),this.removeListener("data",tl),this.removeListener("end",cb),r._readyState=Se.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[ht]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",eb),r._receiver.on("finish",eb))}function tl(r){this[ht]._receiver.write(r)||this.pause()}function cb(){let r=this[ht];r._readyState=Se.CLOSING,r._receiver.end(),this.end()}function lb(){let r=this[ht];this.removeListener("error",lb),this.on("error",rb),r&&(r._readyState=Se.CLOSING,this.destroy())}});var hb=O((BW,db)=>{"use strict";var DW=rl(),{Duplex:m2}=require("stream");function pb(r){r.emit("close")}function g2(){!this.destroyed&&this._writableState.finished&&this.destroy()}function fb(r){this.removeListener("error",fb),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function v2(r,e){let t=!0,n=new m2({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(s,o){let a=!o&&n._readableState.objectMode?s.toString():s;n.push(a)||r.pause()}),r.once("error",function(s){n.destroyed||(t=!1,n.destroy(s))}),r.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,s){if(r.readyState===r.CLOSED){s(i),process.nextTick(pb,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(pb,n)}),t&&r.terminate()},n._final=function(i){if(r.readyState===r.CONNECTING){r.once("open",function(){n._final(i)});return}r._socket!==null&&(r._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(r._socket.once("finish",function(){i()}),r.close()))},n._read=function(){r.isPaused&&r.resume()},n._write=function(i,s,o){if(r.readyState===r.CONNECTING){r.once("open",function(){n._write(i,s,o)});return}r.send(i,o)},n.on("end",g2),n.on("error",fb),n}db.exports=v2});var gb=O((jW,mb)=>{"use strict";var{tokenChars:x2}=cs();function y2(r){let e=new Set,t=-1,n=-1,i=0;for(i;i<r.length;i++){let o=r.charCodeAt(i);if(n===-1&&x2[o]===1)t===-1&&(t=i);else if(i!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=i);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=r.slice(t,n);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=r.slice(t,i);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}mb.exports={parse:y2}});var Sb=O(($W,wb)=>{"use strict";var _2=require("events"),nl=require("http"),{Duplex:FW}=require("stream"),{createHash:b2}=require("crypto"),vb=Id(),ci=ko(),w2=gb(),S2=rl(),{GUID:E2,kWebSocket:T2}=cn(),C2=/^[+/0-9A-Za-z]{22}==$/,xb=0,yb=1,bb=2,jd=class extends _2{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:S2,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=nl.createServer((n,i)=>{let s=nl.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=A2(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,s,o)=>{this.handleUpgrade(i,s,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=xb}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===bb){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Io,this);return}if(e&&this.once("close",e),this._state!==yb)if(this._state=yb,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(Io,this):process.nextTick(Io,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{Io(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,i){t.on("error",_b);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){li(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){li(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!C2.test(s)){li(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){li(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){No(t,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=w2.parse(c)}catch{li(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let p=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&p!==void 0){let m=new ci(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let y=vb.parse(p);y[ci.extensionName]&&(m.accept(y[ci.extensionName]),f[ci.extensionName]=m)}catch{li(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(y,_,S,A)=>{if(!y)return No(t,_||401,S,A);this.completeUpgrade(f,s,u,e,t,n,i)});return}if(!this.options.verifyClient(m))return No(t,401)}this.completeUpgrade(f,s,u,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[T2])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>xb)return No(s,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${b2("sha1").update(t+E2).digest("base64")}`],p=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;f&&(u.push(`Sec-WebSocket-Protocol: ${f}`),p._protocol=f)}if(e[ci.extensionName]){let f=e[ci.extensionName].params,m=vb.format({[ci.extensionName]:[f]});u.push(`Sec-WebSocket-Extensions: ${m}`),p._extensions=e}this.emit("headers",u,i),s.write(u.concat(`\r
23
+ `+n)}r.destroy()}var Ro=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,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,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,1,1,1,1,1,1,1,1,1,1,1,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,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,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,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,1,1,1,1,1,1,1,1,1,1,1,1];function NL(r){if(r+="",r.length<1)return!1;if(!Ro[r.charCodeAt(0)])return ne('invalid header, index 0, char "%s"',r.charCodeAt(0)),!0;if(r.length<2)return!1;if(!Ro[r.charCodeAt(1)])return ne('invalid header, index 1, char "%s"',r.charCodeAt(1)),!0;if(r.length<3)return!1;if(!Ro[r.charCodeAt(2)])return ne('invalid header, index 2, char "%s"',r.charCodeAt(2)),!0;if(r.length<4)return!1;if(!Ro[r.charCodeAt(3)])return ne('invalid header, index 3, char "%s"',r.charCodeAt(3)),!0;for(let e=4;e<r.length;++e)if(!Ro[r.charCodeAt(e)])return ne('invalid header, index "%i", char "%s"',e,r.charCodeAt(e)),!0;return!1}});var Z0=O(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.Polling=void 0;var LL=ts(),Q0=require("zlib"),DL=rc(),BL=ke(),cr=(0,BL.default)("engine:polling"),jL={gzip:Q0.createGzip,deflate:Q0.createDeflate},rd=class extends LL.Transport{constructor(e){super(e),this.closeTimeout=30*1e3}get name(){return"polling"}onRequest(e){let t=e.res;e.res=null,e.getMethod()==="get"?this.onPollRequest(e,t):e.getMethod()==="post"?this.onDataRequest(e,t):(t.writeStatus("500 Internal Server Error"),t.end())}onPollRequest(e,t){if(this.req){cr("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}cr("setting request"),this.req=e,this.res=t;let n=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},s=()=>{this.req=this.res=null};e.cleanup=s,t.onAborted(n),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(cr("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq){this.onError("data request overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}let n=Number(e.headers["content-length"]);if(!n){this.onError("content-length header required"),t.writeStatus("411 Length Required").end();return}if(n>this.maxHttpBufferSize){this.onError("payload too large"),t.writeStatus("413 Payload Too Large").end();return}if(e.headers["content-type"]==="application/octet-stream"&&this.protocol===4)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let i,o=0,a={"Content-Type":"text/html"};this.headers(e,a);for(let l in a)t.writeHeader(l,String(a[l]));let c=l=>{this.onData(l.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((l,p)=>{let f=o+l.byteLength;if(f>n){this.onError("content-length mismatch"),t.close();return}if(!i){if(p){c(Buffer.from(l));return}i=Buffer.allocUnsafe(n)}if(Buffer.from(l).copy(i,o),p){if(f!=n){this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}c(i);return}o=f})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(e){cr('received "%s"',e);let t=n=>{if(n.type==="close")return cr("got xhr close packet"),this.onClose(),!1;this.onPacket(n)};this.protocol===3?this.parser.decodePayload(e,t):this.parser.decodePayload(e).forEach(t)}onClose(){this.writable&&this.send([{type:"noop"}]),super.onClose()}send(e){this.writable=!1,this.shouldClose&&(cr("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let s=e.some(i=>i.options&&i.options.compress);this.write(n,{compress:s})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){cr('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let s=typeof e=="string",o={"Content-Type":s?"text/plain; charset=UTF-8":"application/octet-stream"},a=p=>{this.headers(this.req,o),this.res.cork(()=>{Object.keys(o).forEach(f=>{this.res.writeHeader(f,String(o[f]))}),this.res.end(p)}),n()};if(!this.httpCompression||!t.compress){a(e);return}if((s?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let l=DL(this.req).encodings(["gzip","deflate"]);if(!l){a(e);return}this.compress(e,l,(p,f)=>{if(p){this.res.writeStatus("500 Internal Server Error"),this.res.end(),n(p);return}o["Content-Encoding"]=l,a(f)})}compress(e,t,n){cr("compressing");let s=[],i=0;jL[t](this.httpCompression).on("error",n).on("data",function(o){s.push(o),i+=o.length}).on("end",function(){n(null,Buffer.concat(s,i))}).end(e)}doClose(e){cr("closing");let t,n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(cr("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(cr("transport discarded - closing right away"),n()):(cr("transport not writable - buffering orderly close"),this.shouldClose=n,t=setTimeout(n,this.closeTimeout))}headers(e,t){t=t||{};let n=e.headers["user-agent"];return n&&(~n.indexOf(";MSIE")||~n.indexOf("Trident/"))&&(t["X-XSS-Protection"]="0"),t["cache-control"]="no-store",this.emit("headers",t,e),t}};Lc.Polling=rd});var t_=O(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.WebSocket=void 0;var FL=ts(),HL=ke(),e_=(0,HL.default)("engine:ws"),nd=class extends FL.Transport{constructor(e){super(e),this.writable=!1,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],s=t+1===e.length,i=o=>{let a=typeof o!="string",c=this.perMessageDeflate&&Buffer.byteLength(o)>this.perMessageDeflate.threshold;e_('writing "%s"',o),this.socket.send(o,a,c),s&&(this.emit("drain"),this.writable=!0,this.emit("ready"))};n.options&&typeof n.options.wsPreEncoded=="string"?i(n.options.wsPreEncoded):this.parser.encodePacket(n,this.supportsBinary,i)}}doClose(e){e_("closing"),e&&e(),this.socket.end()}};Dc.WebSocket=nd});var r_=O(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});var $L=Z0(),UL=t_();sd.default={polling:$L.Polling,websocket:UL.WebSocket}});var n_=O(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.uServer=void 0;var qL=ke(),as=td(),WL=r_(),Fn=(0,qL.default)("engine:uws"),id=class extends as.BaseServer{init(){}cleanup(){}prepare(e,t){e.method=e.getMethod().toUpperCase(),e.url=e.getUrl();let n=new URLSearchParams(e.getQuery());e._query=Object.fromEntries(n.entries()),e.headers={},e.forEach((s,i)=>{e.headers[s]=i}),e.connection={remoteAddress:Buffer.from(t.getRemoteAddressAsText()).toString()},t.onAborted(()=>{Fn("response has been aborted")})}createTransport(e,t){return new WL.default[e](t)}attach(e,t={}){let n=this._computePath(t);e.any(n,this.handleRequest.bind(this)).ws(n,{compression:t.compression,idleTimeout:t.idleTimeout,maxBackpressure:t.maxBackpressure,maxPayloadLength:this.opts.maxHttpBufferSize,upgrade:this.handleUpgrade.bind(this),open:s=>{let i=s.getUserData().transport;i.socket=s,i.writable=!0,i.emit("ready")},message:(s,i,o)=>{s.getUserData().transport.onData(o?i:Buffer.from(i).toString())},close:(s,i,o)=>{s.getUserData().transport.onClose(i,o)}})}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return n();e.res=new od(t),super._applyMiddlewares(e,e.res,s=>{e.res.writeHead(),n(s)})}handleRequest(e,t){Fn('handling "%s" http request "%s"',t.getMethod(),t.getUrl()),this.prepare(t,e),t.res=e;let n=(s,i)=>{if(s!==void 0){this.emit("connection_error",{req:t,code:s,message:as.Server.errorMessages[s],context:i}),this.abortRequest(t.res,s,i);return}if(t._query.sid)Fn("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{let o=(a,c)=>this.abortRequest(e,a,c);this.handshake(t._query.transport,t,o)}};this._applyMiddlewares(t,e,s=>{s?n(as.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,n)})}handleUpgrade(e,t,n){Fn("on upgrade"),this.prepare(t,e),t.res=e;let s=async(i,o)=>{if(i!==void 0){this.emit("connection_error",{req:t,code:i,message:as.Server.errorMessages[i],context:o}),this.abortRequest(e,i,o);return}let a=t._query.sid,c;if(a){let f=this.clients[a];if(f){if(f.upgrading)return Fn("transport has already been trying to upgrade"),e.close();if(f.upgraded)return Fn("transport had already been upgraded"),e.close();Fn("upgrading existing transport"),c=this.createTransport(t._query.transport,t),f._maybeUpgrade(c)}else return Fn("upgrade attempt for closed client"),e.close()}else if(c=await this.handshake(t._query.transport,t,(f,h)=>this.abortRequest(e,f,h)),!c)return;let l={};!a&&this.emit("initial_headers",l,t),this.emit("headers",l,t),t.res.writeStatus("101 Switching Protocols"),Object.keys(l).forEach(f=>{t.res.writeHeader(f,l[f])}),e.upgrade({transport:c},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),n)};this._applyMiddlewares(t,e,i=>{i?s(as.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,s)})}abortRequest(e,t,n){let s=t===as.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",i=n&&n.message?n.message:as.Server.errorMessages[t];e.writeStatus(s),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:i}))}};Bc.uServer=id;var od=class{constructor(e){this.res=e,this.statusWritten=!1,this.headers=[],this.isAborted=!1}set statusCode(e){e&&this.writeStatus(e===200?"200 OK":"204 No Content")}writeHead(e){this.statusCode=e}setHeader(e,t){Array.isArray(t)?t.forEach(n=>{this.writeHeader(e,n)}):this.writeHeader(e,t)}removeHeader(){}getHeader(){}writeStatus(e){if(!this.isAborted)return this.res.writeStatus(e),this.statusWritten=!0,this.writeBufferedHeaders(),this}writeHeader(e,t){this.isAborted||e!=="Content-Length"&&(this.statusWritten?this.res.writeHeader(e,t):this.headers.push([e,t]))}writeBufferedHeaders(){this.headers.forEach(([e,t])=>{this.res.writeHeader(e,t)})}end(e){this.isAborted||this.res.cork(()=>{this.statusWritten||this.writeBufferedHeaders(),this.res.end(e)})}onData(e){this.isAborted||this.res.onData(e)}onAborted(e){this.isAborted||this.res.onAborted(()=>{this.isAborted=!0,e()})}cork(e){this.isAborted||this.res.cork(e)}}});var a_=O(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.protocol=gt.Transport=gt.Socket=gt.uServer=gt.parser=gt.transports=gt.Server=void 0;gt.listen=XL;gt.attach=o_;var GL=require("http"),s_=td();Object.defineProperty(gt,"Server",{enumerable:!0,get:function(){return s_.Server}});var zL=mf();gt.transports=zL.default;var i_=xo();gt.parser=i_;var VL=n_();Object.defineProperty(gt,"uServer",{enumerable:!0,get:function(){return VL.uServer}});var KL=vf();Object.defineProperty(gt,"Socket",{enumerable:!0,get:function(){return KL.Socket}});var YL=ts();Object.defineProperty(gt,"Transport",{enumerable:!0,get:function(){return YL.Transport}});gt.protocol=i_.protocol;function XL(r,e,t){typeof e=="function"&&(t=e,e={});let n=(0,GL.createServer)(function(i,o){o.writeHead(501),o.end("Not Implemented")}),s=o_(n,e);return s.httpServer=n,n.listen(r,t),s}function o_(r,e){let t=new s_.Server(e);return t.attach(r,e),t}});var l_=O(c_=>{c_.Emitter=Ot;function Ot(r){if(r)return JL(r)}function JL(r){for(var e in Ot.prototype)r[e]=Ot.prototype[e];return r}Ot.prototype.on=Ot.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};Ot.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};Ot.prototype.off=Ot.prototype.removeListener=Ot.prototype.removeAllListeners=Ot.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var n,s=0;s<t.length;s++)if(n=t[s],n===e||n.fn===e){t.splice(s,1);break}return t.length===0&&delete this._callbacks["$"+r],this};Ot.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,s=t.length;n<s;++n)t[n].apply(this,e)}return this};Ot.prototype.emitReserved=Ot.prototype.emit;Ot.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};Ot.prototype.hasListeners=function(r){return!!this.listeners(r).length}});var ad=O(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.isBinary=p_;Fc.hasBinary=jc;var QL=typeof ArrayBuffer=="function",ZL=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,u_=Object.prototype.toString,eD=typeof Blob=="function"||typeof Blob<"u"&&u_.call(Blob)==="[object BlobConstructor]",tD=typeof File=="function"||typeof File<"u"&&u_.call(File)==="[object FileConstructor]";function p_(r){return QL&&(r instanceof ArrayBuffer||ZL(r))||eD&&r instanceof Blob||tD&&r instanceof File}function jc(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,n=r.length;t<n;t++)if(jc(r[t]))return!0;return!1}if(p_(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return jc(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&jc(r[t]))return!0;return!1}});var f_=O(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.deconstructPacket=nD;Hc.reconstructPacket=sD;var rD=ad();function nD(r){let e=[],t=r.data,n=r;return n.data=cd(t,e),n.attachments=e.length,{packet:n,buffers:e}}function cd(r,e){if(!r)return r;if((0,rD.isBinary)(r)){let t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){let t=new Array(r.length);for(let n=0;n<r.length;n++)t[n]=cd(r[n],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){let t={};for(let n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=cd(r[n],e));return t}return r}function sD(r,e){return r.data=ld(r.data,e),delete r.attachments,r}function ld(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=ld(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=ld(r[t],e));return r}});var ko=O(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.Decoder=Rr.Encoder=Rr.PacketType=Rr.protocol=void 0;Rr.isPacketValid=uD;var iD=l_(),d_=f_(),h_=ad(),oD=ke(),ud=(0,oD.default)("socket.io-parser"),m_=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];Rr.protocol=5;var fe;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(fe||(Rr.PacketType=fe={}));var pd=class{constructor(e){this.replacer=e}encode(e){return ud("encoding packet %j",e),(e.type===fe.EVENT||e.type===fe.ACK)&&(0,h_.hasBinary)(e)?this.encodeAsBinary({type:e.type===fe.EVENT?fe.BINARY_EVENT:fe.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===fe.BINARY_EVENT||e.type===fe.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),ud("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,d_.deconstructPacket)(e),n=this.encodeAsString(t.packet),s=t.buffers;return s.unshift(n),s}};Rr.Encoder=pd;var fd=class r extends iD.Emitter{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let n=t.type===fe.BINARY_EVENT;n||t.type===fe.BINARY_ACK?(t.type=n?fe.EVENT:fe.ACK,this.reconstructor=new dd(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,h_.isBinary)(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,n={type:Number(e.charAt(0))};if(fe[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===fe.BINARY_EVENT||n.type===fe.BINARY_ACK){let i=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(i,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");let a=Number(o);if(!g_(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");n.attachments=a}if(e.charAt(t+1)==="/"){let i=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(i,t)}else n.nsp="/";let s=e.charAt(t+1);if(s!==""&&Number(s)==s){let i=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}n.id=Number(e.substring(i,t+1))}if(e.charAt(++t)){let i=this.tryParse(e.substr(t));if(r.isPayloadValid(n.type,i))n.data=i;else throw new Error("invalid payload")}return ud("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case fe.CONNECT:return $c(t);case fe.DISCONNECT:return t===void 0;case fe.CONNECT_ERROR:return typeof t=="string"||$c(t);case fe.EVENT:case fe.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&m_.indexOf(t[0])===-1);case fe.ACK:case fe.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};Rr.Decoder=fd;var dd=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=(0,d_.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function aD(r){return typeof r=="string"}var g_=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function cD(r){return r===void 0||g_(r)}function $c(r){return Object.prototype.toString.call(r)==="[object Object]"}function lD(r,e){switch(r){case fe.CONNECT:return e===void 0||$c(e);case fe.DISCONNECT:return e===void 0;case fe.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&m_.indexOf(e[0])===-1);case fe.ACK:return Array.isArray(e);case fe.CONNECT_ERROR:return typeof e=="string"||$c(e);default:return!1}}function uD(r){return aD(r.nsp)&&cD(r.id)&&lD(r.type,r.data)}});var v_=O(oi=>{"use strict";var pD=oi&&oi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oi,"__esModule",{value:!0});oi.Client=void 0;var Uc=ko(),fD=pD(ke()),kr=(0,fD.default)("socket.io:client"),hd=class{constructor(e,t){this.sockets=new Map,this.nsps=new Map,this.server=e,this.conn=t,this.encoder=e.encoder,this.decoder=new e._parser.Decoder,this.id=t.id,this.setup()}get request(){return this.conn.request}setup(){this.onclose=this.onclose.bind(this),this.ondata=this.ondata.bind(this),this.onerror=this.onerror.bind(this),this.ondecoded=this.ondecoded.bind(this),this.decoder.on("decoded",this.ondecoded),this.conn.on("data",this.ondata),this.conn.on("error",this.onerror),this.conn.on("close",this.onclose),this.connectTimeout=setTimeout(()=>{this.nsps.size===0?(kr("no namespace joined yet, close the client"),this.close()):kr("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return kr("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,n=>{n?this.doConnect(e,t):(kr("creation of namespace %s was denied",e),this._packet({type:Uc.PacketType.CONNECT_ERROR,nsp:e,data:{message:"Invalid namespace"}}))})}doConnect(e,t){let n=this.server.of(e);n._add(this,t,s=>{this.sockets.set(s.id,s),this.nsps.set(n.name,s),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0)})}_disconnect(){for(let e of this.sockets.values())e.disconnect();this.sockets.clear(),this.close()}_remove(e){if(this.sockets.has(e.id)){let t=this.sockets.get(e.id).nsp.name;this.sockets.delete(e.id),this.nsps.delete(t)}else kr("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(kr("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){kr("ignoring packet write %j",e);return}let n=t.preEncoded?e:this.encoder.encode(e);this.writeToEngine(n,t)}writeToEngine(e,t){if(t.volatile&&!this.conn.transport.writable){kr("volatile packet is discarded since the transport is not currently writable");return}let n=Array.isArray(e)?e:[e];for(let s of n)this.conn.write(s,t)}ondata(e){try{this.decoder.add(e)}catch(t){kr("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:n}=this._parseNamespace(e),s=this.nsps.get(t);!s&&e.type===Uc.PacketType.CONNECT?this.connect(t,n):s&&e.type!==Uc.PacketType.CONNECT&&e.type!==Uc.PacketType.CONNECT_ERROR?process.nextTick(function(){s._onpacket(e)}):(kr("invalid state (packet type: %s)",e.type),this.close())}_parseNamespace(e){if(this.conn.protocol!==3)return{namespace:e.nsp,authPayload:e.data};let t=new URL(e.nsp,"https://socket.io");return{namespace:t.pathname,authPayload:Object.fromEntries(t.searchParams.entries())}}onerror(e){for(let t of this.sockets.values())t._onerror(e);this.conn.close()}onclose(e,t){kr("client close with reason %s",e),this.destroy();for(let n of this.sockets.values())n._onclose(e,t);this.sockets.clear(),this.decoder.destroy()}destroy(){this.conn.removeListener("data",this.ondata),this.conn.removeListener("error",this.onerror),this.conn.removeListener("close",this.onclose),this.decoder.removeListener("decoded",this.ondecoded),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0)}};oi.Client=hd});var Wc=O(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.StrictEventEmitter=void 0;var dD=require("events"),md=class extends dD.EventEmitter{on(e,t){return super.on(e,t)}once(e,t){return super.once(e,t)}emit(e,...t){return super.emit(e,...t)}emitReserved(e,...t){return super.emit(e,...t)}emitUntyped(e,...t){return super.emit(e,...t)}listeners(e){return super.listeners(e)}};qc.StrictEventEmitter=md});var gd=O(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.RESERVED_EVENTS=void 0;Gc.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var vd=O(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.RemoteSocket=ai.BroadcastOperator=void 0;var hD=gd(),mD=ko(),zc=class r{constructor(e,t=new Set,n=new Set,s={}){this.adapter=e,this.rooms=t,this.exceptRooms=n,this.flags=s}to(e){let t=new Set(this.rooms);return Array.isArray(e)?e.forEach(n=>t.add(n)):t.add(e),new r(this.adapter,t,this.exceptRooms,this.flags)}in(e){return this.to(e)}except(e){let t=new Set(this.exceptRooms);return Array.isArray(e)?e.forEach(n=>t.add(n)):t.add(e),new r(this.adapter,this.rooms,t,this.flags)}compress(e){let t=Object.assign({},this.flags,{compress:e});return new r(this.adapter,this.rooms,this.exceptRooms,t)}get volatile(){let e=Object.assign({},this.flags,{volatile:!0});return new r(this.adapter,this.rooms,this.exceptRooms,e)}get local(){let e=Object.assign({},this.flags,{local:!0});return new r(this.adapter,this.rooms,this.exceptRooms,e)}timeout(e){let t=Object.assign({},this.flags,{timeout:e});return new r(this.adapter,this.rooms,this.exceptRooms,t)}emit(e,...t){if(hD.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],s={type:mD.PacketType.EVENT,data:n};if(!(typeof n[n.length-1]=="function"))return this.adapter.broadcast(s,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let o=n.pop(),a=!1,c=[],l=setTimeout(()=>{a=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:c])},this.flags.timeout),p=-1,f=0,h=0,x=()=>{!a&&p===f&&c.length===h&&(clearTimeout(l),o.apply(this,[null,this.flags.expectSingleResponse?c[0]:c]))};return this.adapter.broadcastWithAck(s,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},_=>{h+=_,f++,x()},_=>{c.push(_),x()}),this.adapter.serverCount().then(_=>{p=_,x()}),!0}emitWithAck(e,...t){return new Promise((n,s)=>{t.push((i,o)=>i?(i.responses=o,s(i)):n(o)),this.emit(e,...t)})}allSockets(){if(!this.adapter)throw new Error("No adapter for this namespace, are you trying to get the list of clients of a dynamic namespace?");return this.adapter.sockets(this.rooms)}fetchSockets(){return this.adapter.fetchSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags}).then(e=>e.map(t=>t.server?t:new Vc(this.adapter,t)))}socketsJoin(e){this.adapter.addSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(e)?e:[e])}socketsLeave(e){this.adapter.delSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(e)?e:[e])}disconnectSockets(e=!1){this.adapter.disconnectSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},e)}};ai.BroadcastOperator=zc;var Vc=class{constructor(e,t){this.id=t.id,this.handshake=t.handshake,this.rooms=new Set(t.rooms),this.data=t.data,this.operator=new zc(e,new Set([this.id]),new Set,{expectSingleResponse:!0})}timeout(e){return this.operator.timeout(e)}emit(e,...t){return this.operator.emit(e,...t)}join(e){return this.operator.socketsJoin(e)}leave(e){return this.operator.socketsLeave(e)}disconnect(e=!1){return this.operator.disconnectSockets(e),this}};ai.RemoteSocket=Vc});var xd=O(ci=>{"use strict";var __=ci&&ci.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ci,"__esModule",{value:!0});ci.Socket=void 0;var lr=ko(),gD=__(ke()),vD=Wc(),y_=__(Yp()),yD=vd(),xD=gd(),St=(0,gD.default)("socket.io:socket"),_D=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function x_(){}var yd=class extends vD.StrictEventEmitter{constructor(e,t,n,s){super(),this.nsp=e,this.client=t,this.recovered=!1,this.data={},this.connected=!1,this.acks=new Map,this.fns=[],this.flags={},this.server=e.server,this.adapter=e.adapter,s?(this.id=s.sid,this.pid=s.pid,s.rooms.forEach(i=>this.join(i)),this.data=s.data,s.missedPackets.forEach(i=>{this.packet({type:lr.PacketType.EVENT,data:i})}),this.recovered=!0):(t.conn.protocol===3?this.id=e.name!=="/"?e.name+"#"+t.id:t.id:this.id=y_.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=y_.default.generateId())),this.handshake=this.buildHandshake(n),this.on("error",x_)}buildHandshake(e){var t,n,s,i;return{headers:((t=this.request)===null||t===void 0?void 0:t.headers)||{},time:new Date+"",address:this.conn.remoteAddress,xdomain:!!(!((n=this.request)===null||n===void 0)&&n.headers.origin),secure:!this.request||!!this.request.connection.encrypted,issued:+new Date,url:(s=this.request)===null||s===void 0?void 0:s.url,query:((i=this.request)===null||i===void 0?void 0:i._query)||{},auth:e}}emit(e,...t){if(xD.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],s={type:lr.PacketType.EVENT,data:n};if(typeof n[n.length-1]=="function"){let o=this.nsp._ids++;St("emitting packet with ack id %d",o),this.registerAckCallback(o,n.pop()),s.id=o}let i=Object.assign({},this.flags);return this.flags={},this.nsp.server.opts.connectionStateRecovery?this.adapter.broadcast(s,{rooms:new Set([this.id]),except:new Set,flags:i}):(this.notifyOutgoingListeners(s),this.packet(s,i)),!0}emitWithAck(e,...t){let n=this.flags.timeout!==void 0;return new Promise((s,i)=>{t.push((o,a)=>n?o?i(o):s(a):s(o)),this.emit(e,...t)})}registerAckCallback(e,t){let n=this.flags.timeout;if(n===void 0){this.acks.set(e,t);return}let s=setTimeout(()=>{St("event with ack id %d has timed out after %d ms",e,n),this.acks.delete(e),t.call(this,new Error("operation has timed out"))},n);this.acks.set(e,(...i)=>{clearTimeout(s),t.apply(this,[null,...i])})}to(e){return this.newBroadcastOperator().to(e)}in(e){return this.newBroadcastOperator().in(e)}except(e){return this.newBroadcastOperator().except(e)}send(...e){return this.emit("message",...e),this}write(...e){return this.emit("message",...e),this}packet(e,t={}){e.nsp=this.nsp.name,t.compress=t.compress!==!1,this.client._packet(e,t)}join(e){return St("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return St("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){St("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3?this.packet({type:lr.PacketType.CONNECT}):this.packet({type:lr.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(St("got packet %j",e),e.type){case lr.PacketType.EVENT:this.onevent(e);break;case lr.PacketType.BINARY_EVENT:this.onevent(e);break;case lr.PacketType.ACK:this.onack(e);break;case lr.PacketType.BINARY_ACK:this.onack(e);break;case lr.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(e){let t=e.data||[];if(St("emitting event %j",t),e.id!=null&&(St("attaching ack callback to event"),t.push(this.ack(e.id))),this._anyListeners&&this._anyListeners.length){let n=this._anyListeners.slice();for(let s of n)s.apply(this,t)}this.dispatch(t)}ack(e){let t=this,n=!1;return function(){if(n)return;let s=Array.prototype.slice.call(arguments);St("sending ack %j",s),t.packet({id:e,type:lr.PacketType.ACK,data:s}),n=!0}}onack(e){let t=this.acks.get(e.id);typeof t=="function"?(St("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):St("bad ack %s",e.id)}ondisconnect(){St("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;St("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&_D.has(e)&&(St("connection state recovery is enabled for sid %s",this.id),this.adapter.persistSession({sid:this.id,pid:this.pid,rooms:[...this.rooms],data:this.data})),this._cleanup(),this.client._remove(this),this.connected=!1,this.emitReserved("disconnect",e,t)}_cleanup(){this.leaveAll(),this.nsp._remove(this),this.join=x_}_error(e){this.packet({type:lr.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:lr.PacketType.DISCONNECT}),this._onclose("server namespace disconnect")),this):this}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}get broadcast(){return this.newBroadcastOperator()}get local(){return this.newBroadcastOperator().local}timeout(e){return this.flags.timeout=e,this}dispatch(e){St("dispatching an event %j",e),this.run(e,t=>{process.nextTick(()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):St("ignore packet received after disconnection")})})}use(e){return this.fns.push(e),this}run(e,t){if(!this.fns.length)return t();let n=this.fns.slice(0);function s(i){n[i](e,o=>{if(o)return t(o);if(!n[i+1])return t();s(i+1)})}s(0)}get disconnected(){return!this.connected}get request(){return this.client.request}get conn(){return this.client.conn}get rooms(){return this.adapter.socketRooms(this.id)||new Set}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}newBroadcastOperator(){let e=Object.assign({},this.flags);return this.flags={},new yD.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};ci.Socket=yd});var bd=O(pn=>{"use strict";var bD=pn&&pn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pn,"__esModule",{value:!0});pn.Namespace=pn.RESERVED_EVENTS=void 0;var b_=xd(),wD=Wc(),SD=bD(ke()),Qt=vd(),li=(0,SD.default)("socket.io:namespace");pn.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var _d=class extends wD.StrictEventEmitter{constructor(e,t){super(),this.sockets=new Map,this._preConnectSockets=new Map,this._fns=[],this._ids=0,this.server=e,this.name=t,this._initAdapter()}_initAdapter(){this.adapter=new(this.server.adapter())(this),Promise.resolve(this.adapter.init()).catch(e=>{li("error while initializing adapter: %s",e)})}use(e){return this._fns.push(e),this}run(e,t){if(!this._fns.length)return t();let n=this._fns.slice(0);function s(i){n[i](e,o=>{if(o)return t(o);if(!n[i+1])return t();s(i+1)})}s(0)}to(e){return new Qt.BroadcastOperator(this.adapter).to(e)}in(e){return new Qt.BroadcastOperator(this.adapter).in(e)}except(e){return new Qt.BroadcastOperator(this.adapter).except(e)}async _add(e,t,n){var s;li("adding socket to nsp %s",this.name);let i=await this._createSocket(e,t);if(this._preConnectSockets.set(i.id,i),!((s=this.server.opts.connectionStateRecovery)===null||s===void 0)&&s.skipMiddlewares&&i.recovered&&e.conn.readyState==="open")return this._doConnect(i,n);this.run(i,o=>{process.nextTick(()=>{if(e.conn.readyState!=="open"){li("next called after client was closed - ignoring socket"),i._cleanup();return}if(o)return li("middleware error, sending CONNECT_ERROR packet to the client"),i._cleanup(),e.conn.protocol===3?i._error(o.data||o.message):i._error({message:o.message,data:o.data});this._doConnect(i,n)})})}async _createSocket(e,t){let n=t.pid,s=t.offset;if(this.server.opts.connectionStateRecovery&&typeof n=="string"&&typeof s=="string"){let i;try{i=await this.adapter.restoreSession(n,s)}catch(o){li("error while restoring session: %s",o)}if(i)return li("connection state recovered for sid %s",i.sid),new b_.Socket(this,e,t,i)}return new b_.Socket(this,e,t)}_doConnect(e,t){this._preConnectSockets.delete(e.id),this.sockets.set(e.id,e),e._onconnect(),t&&t(e),this.emitReserved("connect",e),this.emitReserved("connection",e)}_remove(e){this.sockets.delete(e.id)||this._preConnectSockets.delete(e.id)}emit(e,...t){return new Qt.BroadcastOperator(this.adapter).emit(e,...t)}send(...e){return this.emit("message",...e),this}write(...e){return this.emit("message",...e),this}serverSideEmit(e,...t){if(pn.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);return t.unshift(e),this.adapter.serverSideEmit(t),!0}serverSideEmitWithAck(e,...t){return new Promise((n,s)=>{t.push((i,o)=>i?(i.responses=o,s(i)):n(o)),this.serverSideEmit(e,...t)})}_onServerSideEmit(e){super.emitUntyped.apply(this,e)}allSockets(){return new Qt.BroadcastOperator(this.adapter).allSockets()}compress(e){return new Qt.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new Qt.BroadcastOperator(this.adapter).volatile}get local(){return new Qt.BroadcastOperator(this.adapter).local}timeout(e){return new Qt.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new Qt.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new Qt.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new Qt.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new Qt.BroadcastOperator(this.adapter).disconnectSockets(e)}};pn.Namespace=_d});var C_=O(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.encode=wd;Oo.decode=ED;Oo.yeast=TD;var E_="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Kc=64,T_={},w_=0,Hn=0,S_;function wd(r){let e="";do e=E_[r%Kc]+e,r=Math.floor(r/Kc);while(r>0);return e}function ED(r){let e=0;for(Hn=0;Hn<r.length;Hn++)e=e*Kc+T_[r.charAt(Hn)];return e}function TD(){let r=wd(+new Date);return r!==S_?(w_=0,S_=r):r+"."+wd(w_++)}for(;Hn<Kc;Hn++)T_[E_[Hn]]=Hn});var fn=O((c8,k_)=>{"use strict";var A_=["nodebuffer","arraybuffer","fragments"],R_=typeof Blob<"u";R_&&A_.push("blob");k_.exports={BINARY_TYPES:A_,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:R_,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Mo=O((l8,Yc)=>{"use strict";var{EMPTY_BUFFER:CD}=fn(),Sd=Buffer[Symbol.species];function AD(r,e){if(r.length===0)return CD;if(r.length===1)return r[0];let t=Buffer.allocUnsafe(e),n=0;for(let s=0;s<r.length;s++){let i=r[s];t.set(i,n),n+=i.length}return n<e?new Sd(t.buffer,t.byteOffset,n):t}function O_(r,e,t,n,s){for(let i=0;i<s;i++)t[n+i]=r[i]^e[i&3]}function M_(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function RD(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function Ed(r){if(Ed.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new Sd(r):ArrayBuffer.isView(r)?e=new Sd(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),Ed.readOnly=!1),e}Yc.exports={concat:AD,mask:O_,toArrayBuffer:RD,toBuffer:Ed,unmask:M_};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=Rf();Yc.exports.mask=function(e,t,n,s,i){i<48?O_(e,t,n,s,i):r.mask(e,t,n,s,i)},Yc.exports.unmask=function(e,t){e.length<32?M_(e,t):r.unmask(e,t)}}catch{}});var N_=O((u8,I_)=>{"use strict";var P_=Symbol("kDone"),Td=Symbol("kRun"),Cd=class{constructor(e){this[P_]=()=>{this.pending--,this[Td]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Td]()}[Td](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[P_])}}};I_.exports=Cd});var Io=O((p8,j_)=>{"use strict";var Po=require("zlib"),L_=Mo(),kD=N_(),{kStatusCode:D_}=fn(),OD=Buffer[Symbol.species],MD=Buffer.from([0,0,255,255]),Jc=Symbol("permessage-deflate"),dn=Symbol("total-length"),ui=Symbol("callback"),$n=Symbol("buffers"),pi=Symbol("error"),Xc,Ad=class{constructor(e,t,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!Xc){let s=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Xc=new kD(s)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[ui];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,n=e.find(s=>!(t.serverNoContextTakeover===!1&&s.server_no_context_takeover||s.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>s.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!s.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(n=>{let s=t[n];if(s.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(s=s[0],n==="client_max_window_bits"){if(s!==!0){let i=+s;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${n}": ${s}`);s=i}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${s}`)}else if(n==="server_max_window_bits"){let i=+s;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${n}": ${s}`);s=i}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(s!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${s}`)}else throw new Error(`Unknown parameter "${n}"`);t[n]=s})}),e}decompress(e,t,n){Xc.add(s=>{this._decompress(e,t,(i,o)=>{s(),n(i,o)})})}compress(e,t,n){Xc.add(s=>{this._compress(e,t,(i,o)=>{s(),n(i,o)})})}_decompress(e,t,n){let s=this._isServer?"client":"server";if(!this._inflate){let i=`${s}_max_window_bits`,o=typeof this.params[i]!="number"?Po.Z_DEFAULT_WINDOWBITS:this.params[i];this._inflate=Po.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[Jc]=this,this._inflate[dn]=0,this._inflate[$n]=[],this._inflate.on("error",ID),this._inflate.on("data",B_)}this._inflate[ui]=n,this._inflate.write(e),t&&this._inflate.write(MD),this._inflate.flush(()=>{let i=this._inflate[pi];if(i){this._inflate.close(),this._inflate=null,n(i);return}let o=L_.concat(this._inflate[$n],this._inflate[dn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[dn]=0,this._inflate[$n]=[],t&&this.params[`${s}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let s=this._isServer?"server":"client";if(!this._deflate){let i=`${s}_max_window_bits`,o=typeof this.params[i]!="number"?Po.Z_DEFAULT_WINDOWBITS:this.params[i];this._deflate=Po.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[dn]=0,this._deflate[$n]=[],this._deflate.on("data",PD)}this._deflate[ui]=n,this._deflate.write(e),this._deflate.flush(Po.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let i=L_.concat(this._deflate[$n],this._deflate[dn]);t&&(i=new OD(i.buffer,i.byteOffset,i.length-4)),this._deflate[ui]=null,this._deflate[dn]=0,this._deflate[$n]=[],t&&this.params[`${s}_no_context_takeover`]&&this._deflate.reset(),n(null,i)})}};j_.exports=Ad;function PD(r){this[$n].push(r),this[dn]+=r.length}function B_(r){if(this[dn]+=r.length,this[Jc]._maxPayload<1||this[dn]<=this[Jc]._maxPayload){this[$n].push(r);return}this[pi]=new RangeError("Max payload size exceeded"),this[pi].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[pi][D_]=1009,this.removeListener("data",B_),this.reset()}function ID(r){if(this[Jc]._inflate=null,this[pi]){this[ui](this[pi]);return}r[D_]=1007,this[ui](r)}});var fi=O((f8,Qc)=>{"use strict";var{isUtf8:F_}=require("buffer"),{hasBlob:ND}=fn(),LD=[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 DD(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function Rd(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}function BD(r){return ND&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}Qc.exports={isBlob:BD,isValidStatusCode:DD,isValidUTF8:Rd,tokenChars:LD};if(F_)Qc.exports.isValidUTF8=function(r){return r.length<24?Rd(r):F_(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=Lf();Qc.exports.isValidUTF8=function(e){return e.length<32?Rd(e):r(e)}}catch{}});var Id=O((d8,z_)=>{"use strict";var{Writable:jD}=require("stream"),H_=Io(),{BINARY_TYPES:FD,EMPTY_BUFFER:$_,kStatusCode:HD,kWebSocket:$D}=fn(),{concat:kd,toArrayBuffer:UD,unmask:qD}=Mo(),{isValidStatusCode:WD,isValidUTF8:U_}=fi(),Zc=Buffer[Symbol.species],ur=0,q_=1,W_=2,G_=3,Od=4,Md=5,el=6,Pd=class extends jD{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||FD[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[$D]=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=ur}_write(e,t,n){if(this._opcode===8&&this._state==ur)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new Zc(n.buffer,n.byteOffset+e,n.length-e),new Zc(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],s=t.length-e;e>=n.length?t.set(this._buffers.shift(),s):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),s),this._buffers[0]=new Zc(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case ur:this.getInfo(e);break;case q_:this.getPayloadLength16(e);break;case W_:this.getPayloadLength64(e);break;case G_:this.getMask();break;case Od:this.getData(e);break;case Md:case el:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let s=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(s);return}let n=(t[0]&64)===64;if(n&&!this._extensions[H_.extensionName]){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(s);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(s);return}if(!this._fragmented){let s=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(s);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let s=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(s);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let s=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(s);return}if(n){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(s);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let s=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(s);return}}else{let s=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(s);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let s=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(s);return}}else if(this._masked){let s=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(s);return}this._payloadLength===126?this._state=q_:this._payloadLength===127?this._state=W_:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>Math.pow(2,21)-1){let s=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(s);return}this._payloadLength=n*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=G_:this._state=Od}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Od}getData(e){let t=$_;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&qD(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=Md,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[H_.extensionName].decompress(e,this._fin,(s,i)=>{if(s)return t(s);if(i.length){if(this._messageLength+=i.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._fragments.push(i)}this.dataMessage(t),this._state===ur&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=ur;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let s;this._binaryType==="nodebuffer"?s=kd(n,t):this._binaryType==="arraybuffer"?s=UD(kd(n,t)):this._binaryType==="blob"?s=new Blob(n):s=n,this._allowSynchronousEvents?(this.emit("message",s,!0),this._state=ur):(this._state=el,setImmediate(()=>{this.emit("message",s,!0),this._state=ur,this.startLoop(e)}))}else{let s=kd(n,t);if(!this._skipUTF8Validation&&!U_(s)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(i);return}this._state===Md||this._allowSynchronousEvents?(this.emit("message",s,!1),this._state=ur):(this._state=el,setImmediate(()=>{this.emit("message",s,!1),this._state=ur,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,$_),this.end();else{let n=e.readUInt16BE(0);if(!WD(n)){let i=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(i);return}let s=new Zc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!U_(s)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(i);return}this._loop=!1,this.emit("conclude",n,s),this.end()}this._state=ur;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=ur):(this._state=el,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=ur,this.startLoop(t)}))}createError(e,t,n,s,i){this._loop=!1,this._errored=!0;let o=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=i,o[HD]=s,o}};z_.exports=Pd});var Dd=O((m8,Y_)=>{"use strict";var{Duplex:h8}=require("stream"),{randomFillSync:GD}=require("crypto"),V_=Io(),{EMPTY_BUFFER:zD,kWebSocket:VD,NOOP:KD}=fn(),{isBlob:di,isValidStatusCode:YD}=fi(),{mask:K_,toBuffer:cs}=Mo(),pr=Symbol("kByteLength"),XD=Buffer.alloc(4),tl=8*1024,ls,hi=tl,Or=0,JD=1,QD=2,Nd=class r{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Or,this.onerror=KD,this[VD]=void 0}static frame(e,t){let n,s=!1,i=2,o=!1;t.mask&&(n=t.maskBuffer||XD,t.generateMask?t.generateMask(n):(hi===tl&&(ls===void 0&&(ls=Buffer.alloc(tl)),GD(ls,0,tl),hi=0),n[0]=ls[hi++],n[1]=ls[hi++],n[2]=ls[hi++],n[3]=ls[hi++]),o=(n[0]|n[1]|n[2]|n[3])===0,i=6);let a;typeof e=="string"?(!t.mask||o)&&t[pr]!==void 0?a=t[pr]:(e=Buffer.from(e),a=e.length):(a=e.length,s=t.mask&&t.readOnly&&!o);let c=a;a>=65536?(i+=8,c=127):a>125&&(i+=2,c=126);let l=Buffer.allocUnsafe(s?a+i:i);return l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(l[0]|=64),l[1]=c,c===126?l.writeUInt16BE(a,2):c===127&&(l[2]=l[3]=0,l.writeUIntBE(a,4,6)),t.mask?(l[1]|=128,l[i-4]=n[0],l[i-3]=n[1],l[i-2]=n[2],l[i-1]=n[3],o?[l,e]:s?(K_(e,n,l,i,a),[l]):(K_(e,n,e,0,a),[l,e])):[l,e]}close(e,t,n,s){let i;if(e===void 0)i=zD;else{if(typeof e!="number"||!YD(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)i=Buffer.allocUnsafe(2),i.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");i=Buffer.allocUnsafe(2+a),i.writeUInt16BE(e,0),typeof t=="string"?i.write(t,2):i.set(t,2)}}let o={[pr]:i.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Or?this.enqueue([this.dispatch,i,!1,o,s]):this.sendFrame(r.frame(i,o),s)}ping(e,t,n){let s,i;if(typeof e=="string"?(s=Buffer.byteLength(e),i=!1):di(e)?(s=e.size,i=!1):(e=cs(e),s=e.length,i=cs.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[pr]:s,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:i,rsv1:!1};di(e)?this._state!==Or?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Or?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}pong(e,t,n){let s,i;if(typeof e=="string"?(s=Buffer.byteLength(e),i=!1):di(e)?(s=e.size,i=!1):(e=cs(e),s=e.length,i=cs.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[pr]:s,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:i,rsv1:!1};di(e)?this._state!==Or?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Or?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let s=this._extensions[V_.extensionName],i=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):di(e)?(a=e.size,c=!1):(e=cs(e),a=e.length,c=cs.readOnly),this._firstFragment?(this._firstFragment=!1,o&&s&&s.params[s._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=s._threshold),this._compress=o):(o=!1,i=0),t.fin&&(this._firstFragment=!0);let l={[pr]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:c,rsv1:o};di(e)?this._state!==Or?this.enqueue([this.getBlobData,e,this._compress,l,n]):this.getBlobData(e,this._compress,l,n):this._state!==Or?this.enqueue([this.dispatch,e,this._compress,l,n]):this.dispatch(e,this._compress,l,n)}getBlobData(e,t,n,s){this._bufferedBytes+=n[pr],this._state=QD,e.arrayBuffer().then(i=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Ld,this,a,s);return}this._bufferedBytes-=n[pr];let o=cs(i);t?this.dispatch(o,t,n,s):(this._state=Or,this.sendFrame(r.frame(o,n),s),this.dequeue())}).catch(i=>{process.nextTick(ZD,this,i,s)})}dispatch(e,t,n,s){if(!t){this.sendFrame(r.frame(e,n),s);return}let i=this._extensions[V_.extensionName];this._bufferedBytes+=n[pr],this._state=JD,i.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Ld(this,c,s);return}this._bufferedBytes-=n[pr],this._state=Or,n.readOnly=!1,this.sendFrame(r.frame(a,n),s),this.dequeue()})}dequeue(){for(;this._state===Or&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][pr],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][pr],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};Y_.exports=Nd;function Ld(r,e,t){typeof t=="function"&&t(e);for(let n=0;n<r._queue.length;n++){let s=r._queue[n],i=s[s.length-1];typeof i=="function"&&i(e)}}function ZD(r,e,t){Ld(r,e,t),r.onerror(e)}});var sb=O((g8,nb)=>{"use strict";var{kForOnEventAttribute:No,kListener:Bd}=fn(),X_=Symbol("kCode"),J_=Symbol("kData"),Q_=Symbol("kError"),Z_=Symbol("kMessage"),eb=Symbol("kReason"),mi=Symbol("kTarget"),tb=Symbol("kType"),rb=Symbol("kWasClean"),hn=class{constructor(e){this[mi]=null,this[tb]=e}get target(){return this[mi]}get type(){return this[tb]}};Object.defineProperty(hn.prototype,"target",{enumerable:!0});Object.defineProperty(hn.prototype,"type",{enumerable:!0});var us=class extends hn{constructor(e,t={}){super(e),this[X_]=t.code===void 0?0:t.code,this[eb]=t.reason===void 0?"":t.reason,this[rb]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[X_]}get reason(){return this[eb]}get wasClean(){return this[rb]}};Object.defineProperty(us.prototype,"code",{enumerable:!0});Object.defineProperty(us.prototype,"reason",{enumerable:!0});Object.defineProperty(us.prototype,"wasClean",{enumerable:!0});var gi=class extends hn{constructor(e,t={}){super(e),this[Q_]=t.error===void 0?null:t.error,this[Z_]=t.message===void 0?"":t.message}get error(){return this[Q_]}get message(){return this[Z_]}};Object.defineProperty(gi.prototype,"error",{enumerable:!0});Object.defineProperty(gi.prototype,"message",{enumerable:!0});var Lo=class extends hn{constructor(e,t={}){super(e),this[J_]=t.data===void 0?null:t.data}get data(){return this[J_]}};Object.defineProperty(Lo.prototype,"data",{enumerable:!0});var e2={addEventListener(r,e,t={}){for(let s of this.listeners(r))if(!t[No]&&s[Bd]===e&&!s[No])return;let n;if(r==="message")n=function(i,o){let a=new Lo("message",{data:o?i:i.toString()});a[mi]=this,rl(e,this,a)};else if(r==="close")n=function(i,o){let a=new us("close",{code:i,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[mi]=this,rl(e,this,a)};else if(r==="error")n=function(i){let o=new gi("error",{error:i,message:i.message});o[mi]=this,rl(e,this,o)};else if(r==="open")n=function(){let i=new hn("open");i[mi]=this,rl(e,this,i)};else return;n[No]=!!t[No],n[Bd]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[Bd]===e&&!t[No]){this.removeListener(r,t);break}}};nb.exports={CloseEvent:us,ErrorEvent:gi,Event:hn,EventTarget:e2,MessageEvent:Lo};function rl(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var jd=O((v8,ib)=>{"use strict";var{tokenChars:Do}=fi();function Ur(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function t2(r){let e=Object.create(null),t=Object.create(null),n=!1,s=!1,i=!1,o,a,c=-1,l=-1,p=-1,f=0;for(;f<r.length;f++)if(l=r.charCodeAt(f),o===void 0)if(p===-1&&Do[l]===1)c===-1&&(c=f);else if(f!==0&&(l===32||l===9))p===-1&&c!==-1&&(p=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let x=r.slice(c,p);l===44?(Ur(e,x,t),t=Object.create(null)):o=x,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(p===-1&&Do[l]===1)c===-1&&(c=f);else if(l===32||l===9)p===-1&&c!==-1&&(p=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f),Ur(t,r.slice(c,p),!0),l===44&&(Ur(e,o,t),t=Object.create(null),o=void 0),c=p=-1}else if(l===61&&c!==-1&&p===-1)a=r.slice(c,f),c=p=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(s){if(Do[l]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),s=!1}else if(i)if(Do[l]===1)c===-1&&(c=f);else if(l===34&&c!==-1)i=!1,p=f;else if(l===92)s=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(l===34&&r.charCodeAt(f-1)===61)i=!0;else if(p===-1&&Do[l]===1)c===-1&&(c=f);else if(c!==-1&&(l===32||l===9))p===-1&&(p=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let x=r.slice(c,p);n&&(x=x.replace(/\\/g,""),n=!1),Ur(t,a,x),l===44&&(Ur(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||i||l===32||l===9)throw new SyntaxError("Unexpected end of input");p===-1&&(p=f);let h=r.slice(c,p);return o===void 0?Ur(e,h,t):(a===void 0?Ur(t,h,!0):n?Ur(t,a,h.replace(/\\/g,"")):Ur(t,a,h),Ur(e,o,t)),e}function r2(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(s=>{let i=n[s];return Array.isArray(i)||(i=[i]),i.map(o=>o===!0?s:`${s}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}ib.exports={format:r2,parse:t2}});var ol=O((_8,vb)=>{"use strict";var n2=require("events"),s2=require("https"),i2=require("http"),cb=require("net"),o2=require("tls"),{randomBytes:a2,createHash:c2}=require("crypto"),{Duplex:y8,Readable:x8}=require("stream"),{URL:Fd}=require("url"),Un=Io(),l2=Id(),u2=Dd(),{isBlob:p2}=fi(),{BINARY_TYPES:ob,EMPTY_BUFFER:nl,GUID:f2,kForOnEventAttribute:Hd,kListener:d2,kStatusCode:h2,kWebSocket:vt,NOOP:lb}=fn(),{EventTarget:{addEventListener:m2,removeEventListener:g2}}=sb(),{format:v2,parse:y2}=jd(),{toBuffer:x2}=Mo(),_2=30*1e3,ub=Symbol("kAborted"),$d=[8,13],mn=["CONNECTING","OPEN","CLOSING","CLOSED"],b2=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Ee=class r extends n2{constructor(e,t,n){super(),this._binaryType=ob[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=nl,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(n=t,t=[]):t=[t]),pb(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){ob.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,n){let s=new l2({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),i=new u2(e,this._extensions,n.generateMask);this._receiver=s,this._sender=i,this._socket=e,s[vt]=this,i[vt]=this,e[vt]=this,s.on("conclude",E2),s.on("drain",T2),s.on("error",C2),s.on("message",A2),s.on("ping",R2),s.on("pong",k2),i.onerror=O2,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",hb),e.on("data",il),e.on("end",mb),e.on("error",gb),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Un.extensionName]&&this._extensions[Un.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Zt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),db(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Ud(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||nl,t,n)}pong(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Ud(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||nl,t,n)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(n=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Ud(this,e,n);return}let s={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[Un.extensionName]||(s.compress=!1),this._sender.send(e||nl,s,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Zt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(Ee,"CONNECTING",{enumerable:!0,value:mn.indexOf("CONNECTING")});Object.defineProperty(Ee.prototype,"CONNECTING",{enumerable:!0,value:mn.indexOf("CONNECTING")});Object.defineProperty(Ee,"OPEN",{enumerable:!0,value:mn.indexOf("OPEN")});Object.defineProperty(Ee.prototype,"OPEN",{enumerable:!0,value:mn.indexOf("OPEN")});Object.defineProperty(Ee,"CLOSING",{enumerable:!0,value:mn.indexOf("CLOSING")});Object.defineProperty(Ee.prototype,"CLOSING",{enumerable:!0,value:mn.indexOf("CLOSING")});Object.defineProperty(Ee,"CLOSED",{enumerable:!0,value:mn.indexOf("CLOSED")});Object.defineProperty(Ee.prototype,"CLOSED",{enumerable:!0,value:mn.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(Ee.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(Ee.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Hd])return e[d2];return null},set(e){for(let t of this.listeners(r))if(t[Hd]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[Hd]:!0})}})});Ee.prototype.addEventListener=m2;Ee.prototype.removeEventListener=g2;vb.exports=Ee;function pb(r,e,t,n){let s={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:$d[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(r._autoPong=s.autoPong,!$d.includes(s.protocolVersion))throw new RangeError(`Unsupported protocol version: ${s.protocolVersion} (supported versions: ${$d.join(", ")})`);let i;if(e instanceof Fd)i=e;else try{i=new Fd(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}i.protocol==="http:"?i.protocol="ws:":i.protocol==="https:"&&(i.protocol="wss:"),r._url=i.href;let o=i.protocol==="wss:",a=i.protocol==="ws+unix:",c;if(i.protocol!=="ws:"&&!o&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!i.pathname?c="The URL's pathname is empty":i.hash&&(c="The URL contains a fragment identifier"),c){let S=new SyntaxError(c);if(r._redirects===0)throw S;sl(r,S);return}let l=o?443:80,p=a2(16).toString("base64"),f=o?s2.request:i2.request,h=new Set,x;if(s.createConnection=s.createConnection||(o?S2:w2),s.defaultPort=s.defaultPort||l,s.port=i.port||l,s.host=i.hostname.startsWith("[")?i.hostname.slice(1,-1):i.hostname,s.headers={...s.headers,"Sec-WebSocket-Version":s.protocolVersion,"Sec-WebSocket-Key":p,Connection:"Upgrade",Upgrade:"websocket"},s.path=i.pathname+i.search,s.timeout=s.handshakeTimeout,s.perMessageDeflate&&(x=new Un(s.perMessageDeflate!==!0?s.perMessageDeflate:{},!1,s.maxPayload),s.headers["Sec-WebSocket-Extensions"]=v2({[Un.extensionName]:x.offer()})),t.length){for(let S of t){if(typeof S!="string"||!b2.test(S)||h.has(S))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(S)}s.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(s.origin&&(s.protocolVersion<13?s.headers["Sec-WebSocket-Origin"]=s.origin:s.headers.Origin=s.origin),(i.username||i.password)&&(s.auth=`${i.username}:${i.password}`),a){let S=s.path.split(":");s.socketPath=S[0],s.path=S[1]}let _;if(s.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=o,r._originalHostOrSocketPath=a?s.socketPath:i.host;let S=n&&n.headers;if(n={...n,headers:{}},S)for(let[A,M]of Object.entries(S))n.headers[A.toLowerCase()]=M}else if(r.listenerCount("redirect")===0){let S=a?r._originalIpc?s.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:i.host===r._originalHostOrSocketPath;(!S||r._originalSecure&&!o)&&(delete s.headers.authorization,delete s.headers.cookie,S||delete s.headers.host,s.auth=void 0)}s.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(s.auth).toString("base64")),_=r._req=f(s),r._redirects&&r.emit("redirect",r.url,_)}else _=r._req=f(s);s.timeout&&_.on("timeout",()=>{Zt(r,_,"Opening handshake has timed out")}),_.on("error",S=>{_===null||_[ub]||(_=r._req=null,sl(r,S))}),_.on("response",S=>{let A=S.headers.location,M=S.statusCode;if(A&&s.followRedirects&&M>=300&&M<400){if(++r._redirects>s.maxRedirects){Zt(r,_,"Maximum redirects exceeded");return}_.abort();let N;try{N=new Fd(A,e)}catch{let j=new SyntaxError(`Invalid URL: ${A}`);sl(r,j);return}pb(r,N,t,n)}else r.emit("unexpected-response",_,S)||Zt(r,_,`Unexpected server response: ${S.statusCode}`)}),_.on("upgrade",(S,A,M)=>{if(r.emit("upgrade",S),r.readyState!==Ee.CONNECTING)return;_=r._req=null;let N=S.headers.upgrade;if(N===void 0||N.toLowerCase()!=="websocket"){Zt(r,A,"Invalid Upgrade header");return}let L=c2("sha1").update(p+f2).digest("base64");if(S.headers["sec-websocket-accept"]!==L){Zt(r,A,"Invalid Sec-WebSocket-Accept header");return}let j=S.headers["sec-websocket-protocol"],W;if(j!==void 0?h.size?h.has(j)||(W="Server sent an invalid subprotocol"):W="Server sent a subprotocol but none was requested":h.size&&(W="Server sent no subprotocol"),W){Zt(r,A,W);return}j&&(r._protocol=j);let q=S.headers["sec-websocket-extensions"];if(q!==void 0){if(!x){Zt(r,A,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let G;try{G=y2(q)}catch{Zt(r,A,"Invalid Sec-WebSocket-Extensions header");return}let P=Object.keys(G);if(P.length!==1||P[0]!==Un.extensionName){Zt(r,A,"Server indicated an extension that was not requested");return}try{x.accept(G[Un.extensionName])}catch{Zt(r,A,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[Un.extensionName]=x}r.setSocket(A,M,{allowSynchronousEvents:s.allowSynchronousEvents,generateMask:s.generateMask,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation})}),s.finishRequest?s.finishRequest(_,r):_.end()}function sl(r,e){r._readyState=Ee.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function w2(r){return r.path=r.socketPath,cb.connect(r)}function S2(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=cb.isIP(r.host)?"":r.host),o2.connect(r)}function Zt(r,e,t){r._readyState=Ee.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Zt),e.setHeader?(e[ub]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(sl,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Ud(r,e,t){if(e){let n=p2(e)?e.size:x2(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${mn[r.readyState]})`);process.nextTick(t,n)}}function E2(r,e){let t=this[vt];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[vt]!==void 0&&(t._socket.removeListener("data",il),process.nextTick(fb,t._socket),r===1005?t.close():t.close(r,e))}function T2(){let r=this[vt];r.isPaused||r._socket.resume()}function C2(r){let e=this[vt];e._socket[vt]!==void 0&&(e._socket.removeListener("data",il),process.nextTick(fb,e._socket),e.close(r[h2])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function ab(){this[vt].emitClose()}function A2(r,e){this[vt].emit("message",r,e)}function R2(r){let e=this[vt];e._autoPong&&e.pong(r,!this._isServer,lb),e.emit("ping",r)}function k2(r){this[vt].emit("pong",r)}function fb(r){r.resume()}function O2(r){let e=this[vt];e.readyState!==Ee.CLOSED&&(e.readyState===Ee.OPEN&&(e._readyState=Ee.CLOSING,db(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function db(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),_2)}function hb(){let r=this[vt];this.removeListener("close",hb),this.removeListener("data",il),this.removeListener("end",mb),r._readyState=Ee.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[vt]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",ab),r._receiver.on("finish",ab))}function il(r){this[vt]._receiver.write(r)||this.pause()}function mb(){let r=this[vt];r._readyState=Ee.CLOSING,r._receiver.end(),this.end()}function gb(){let r=this[vt];this.removeListener("error",gb),this.on("error",lb),r&&(r._readyState=Ee.CLOSING,this.destroy())}});var bb=O((w8,_b)=>{"use strict";var b8=ol(),{Duplex:M2}=require("stream");function yb(r){r.emit("close")}function P2(){!this.destroyed&&this._writableState.finished&&this.destroy()}function xb(r){this.removeListener("error",xb),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function I2(r,e){let t=!0,n=new M2({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(i,o){let a=!o&&n._readableState.objectMode?i.toString():i;n.push(a)||r.pause()}),r.once("error",function(i){n.destroyed||(t=!1,n.destroy(i))}),r.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(s,i){if(r.readyState===r.CLOSED){i(s),process.nextTick(yb,n);return}let o=!1;r.once("error",function(c){o=!0,i(c)}),r.once("close",function(){o||i(s),process.nextTick(yb,n)}),t&&r.terminate()},n._final=function(s){if(r.readyState===r.CONNECTING){r.once("open",function(){n._final(s)});return}r._socket!==null&&(r._socket._writableState.finished?(s(),n._readableState.endEmitted&&n.destroy()):(r._socket.once("finish",function(){s()}),r.close()))},n._read=function(){r.isPaused&&r.resume()},n._write=function(s,i,o){if(r.readyState===r.CONNECTING){r.once("open",function(){n._write(s,i,o)});return}r.send(s,o)},n.on("end",P2),n.on("error",xb),n}_b.exports=I2});var Sb=O((S8,wb)=>{"use strict";var{tokenChars:N2}=fi();function L2(r){let e=new Set,t=-1,n=-1,s=0;for(s;s<r.length;s++){let o=r.charCodeAt(s);if(n===-1&&N2[o]===1)t===-1&&(t=s);else if(s!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=s);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${s}`);n===-1&&(n=s);let a=r.slice(t,n);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${s}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let i=r.slice(t,s);if(e.has(i))throw new SyntaxError(`The "${i}" subprotocol is duplicated`);return e.add(i),e}wb.exports={parse:L2}});var Ob=O((T8,kb)=>{"use strict";var D2=require("events"),al=require("http"),{Duplex:E8}=require("stream"),{createHash:B2}=require("crypto"),Eb=jd(),ps=Io(),j2=Sb(),F2=ol(),{GUID:H2,kWebSocket:$2}=fn(),U2=/^[+/0-9A-Za-z]{22}==$/,Tb=0,Cb=1,Rb=2,qd=class extends D2{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:F2,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=al.createServer((n,s)=>{let i=al.STATUS_CODES[426];s.writeHead(426,{"Content-Length":i.length,"Content-Type":"text/plain"}),s.end(i)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=q2(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(s,i,o)=>{this.handleUpgrade(s,i,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=Tb}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===Rb){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Bo,this);return}if(e&&this.once("close",e),this._state!==Cb)if(this._state=Cb,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(Bo,this):process.nextTick(Bo,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{Bo(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,s){t.on("error",Ab);let i=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){fs(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){fs(this,e,t,400,"Invalid Upgrade header");return}if(i===void 0||!U2.test(i)){fs(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){fs(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){jo(t,400);return}let c=e.headers["sec-websocket-protocol"],l=new Set;if(c!==void 0)try{l=j2.parse(c)}catch{fs(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let p=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&p!==void 0){let h=new ps(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let x=Eb.parse(p);x[ps.extensionName]&&(h.accept(x[ps.extensionName]),f[ps.extensionName]=h)}catch{fs(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let h={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(h,(x,_,S,A)=>{if(!x)return jo(t,_||401,S,A);this.completeUpgrade(f,i,l,e,t,n,s)});return}if(!this.options.verifyClient(h))return jo(t,401)}this.completeUpgrade(f,i,l,e,t,n,s)}completeUpgrade(e,t,n,s,i,o,a){if(!i.readable||!i.writable)return i.destroy();if(i[$2])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Tb)return jo(i,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${B2("sha1").update(t+H2).digest("base64")}`],p=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,s):n.values().next().value;f&&(l.push(`Sec-WebSocket-Protocol: ${f}`),p._protocol=f)}if(e[ps.extensionName]){let f=e[ps.extensionName].params,h=Eb.format({[ps.extensionName]:[f]});l.push(`Sec-WebSocket-Extensions: ${h}`),p._extensions=e}this.emit("headers",l,s),i.write(l.concat(`\r
24
24
  `).join(`\r
25
- `)),s.removeListener("error",_b),p.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(p),p.on("close",()=>{this.clients.delete(p),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Io,this)})),a(p,i)}};wb.exports=jd;function A2(r,e){for(let t of Object.keys(e))r.on(t,e[t]);return function(){for(let n of Object.keys(e))r.removeListener(n,e[n])}}function Io(r){r._state=bb,r.emit("close")}function _b(){this.destroy()}function No(r,e,t,n){t=t||nl.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${nl.STATUS_CODES[e]}\r
26
- `+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
25
+ `)),i.removeListener("error",Ab),p.setSocket(i,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(p),p.on("close",()=>{this.clients.delete(p),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Bo,this)})),a(p,s)}};kb.exports=qd;function q2(r,e){for(let t of Object.keys(e))r.on(t,e[t]);return function(){for(let n of Object.keys(e))r.removeListener(n,e[n])}}function Bo(r){r._state=Rb,r.emit("close")}function Ab(){this.destroy()}function jo(r,e,t,n){t=t||al.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${al.STATUS_CODES[e]}\r
26
+ `+Object.keys(n).map(s=>`${s}: ${n[s]}`).join(`\r
27
27
  `)+`\r
28
28
  \r
29
- `+t)}function li(r,e,t,n,i,s){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,li),r.emit("wsClientError",o,t,e)}else No(t,n,i,s)}});var Tb=O((HW,Eb)=>{"use strict";var fn=rl();fn.createWebSocketStream=hb();fn.Server=Sb();fn.Receiver=Rd();fn.Sender=Md();fn.WebSocket=fn;fn.WebSocketServer=fn.Server;Eb.exports=fn});var Hd=O(ds=>{"use strict";var Fd;Object.defineProperty(ds,"__esModule",{value:!0});ds.SessionAwareAdapter=ds.Adapter=void 0;var R2=require("events"),k2=y_(),il=Tb(),O2=typeof((Fd=il?.Sender)===null||Fd===void 0?void 0:Fd.frame)=="function",sl=class extends R2.EventEmitter{constructor(e){super(),this.nsp=e,this.rooms=new Map,this.sids=new Map,this.encoder=e.server.encoder}init(){}close(){}serverCount(){return Promise.resolve(1)}addAll(e,t){this.sids.has(e)||this.sids.set(e,new Set);for(let n of t)this.sids.get(e).add(n),this.rooms.has(n)||(this.rooms.set(n,new Set),this.emit("create-room",n)),this.rooms.get(n).has(e)||(this.rooms.get(n).add(e),this.emit("join-room",n,e))}del(e,t){this.sids.has(e)&&this.sids.get(e).delete(t),this._del(t,e)}_del(e,t){let n=this.rooms.get(e);n!=null&&(n.delete(t)&&this.emit("leave-room",e,t),n.size===0&&this.rooms.delete(e)&&this.emit("delete-room",e))}delAll(e){if(this.sids.has(e)){for(let t of this.sids.get(e))this._del(t,e);this.sids.delete(e)}}broadcast(e,t){let n=t.flags||{},i={preEncoded:!0,volatile:n.volatile,compress:n.compress};e.nsp=this.nsp.name;let s=this._encode(e,i);this.apply(t,o=>{typeof o.notifyOutgoingListeners=="function"&&o.notifyOutgoingListeners(e),o.client.writeToEngine(s,i)})}broadcastWithAck(e,t,n,i){let s=t.flags||{},o={preEncoded:!0,volatile:s.volatile,compress:s.compress};e.nsp=this.nsp.name,e.id=this.nsp._ids++;let a=this._encode(e,o),c=0;this.apply(t,u=>{c++,u.acks.set(e.id,i),typeof u.notifyOutgoingListeners=="function"&&u.notifyOutgoingListeners(e),u.client.writeToEngine(a,o)}),n(c)}_encode(e,t){let n=this.encoder.encode(e);if(O2&&n.length===1&&typeof n[0]=="string"){let i=Buffer.from("4"+n[0]);t.wsPreEncodedFrame=il.Sender.frame(i,{readOnly:!1,mask:!1,rsv1:!1,opcode:1,fin:!0})}return n}sockets(e){let t=new Set;return this.apply({rooms:e},n=>{t.add(n.id)}),Promise.resolve(t)}socketRooms(e){return this.sids.get(e)}fetchSockets(e){let t=[];return this.apply(e,n=>{t.push(n)}),Promise.resolve(t)}addSockets(e,t){this.apply(e,n=>{n.join(t)})}delSockets(e,t){this.apply(e,n=>{t.forEach(i=>n.leave(i))})}disconnectSockets(e,t){this.apply(e,n=>{n.disconnect(t)})}apply(e,t){let n=e.rooms,i=this.computeExceptSids(e.except);if(n.size){let s=new Set;for(let o of n)if(this.rooms.has(o))for(let a of this.rooms.get(o)){if(s.has(a)||i.has(a))continue;let c=this.nsp.sockets.get(a);c&&(t(c),s.add(a))}}else for(let[s]of this.sids){if(i.has(s))continue;let o=this.nsp.sockets.get(s);o&&t(o)}}computeExceptSids(e){let t=new Set;if(e&&e.size>0)for(let n of e)this.rooms.has(n)&&this.rooms.get(n).forEach(i=>t.add(i));return t}serverSideEmit(e){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(e){}restoreSession(e,t){return null}};ds.Adapter=sl;var $d=class extends sl{constructor(e){super(e),this.nsp=e,this.sessions=new Map,this.packets=[],this.maxDisconnectionDuration=e.server.opts.connectionStateRecovery.maxDisconnectionDuration,setInterval(()=>{let n=Date.now()-this.maxDisconnectionDuration;this.sessions.forEach((i,s)=>{i.disconnectedAt<n&&this.sessions.delete(s)});for(let i=this.packets.length-1;i>=0;i--)if(this.packets[i].emittedAt<n){this.packets.splice(0,i+1);break}},60*1e3).unref()}persistSession(e){e.disconnectedAt=Date.now(),this.sessions.set(e.pid,e)}restoreSession(e,t){let n=this.sessions.get(e);if(!n)return null;if(n.disconnectedAt+this.maxDisconnectionDuration<Date.now())return this.sessions.delete(e),null;let s=this.packets.findIndex(a=>a.id===t);if(s===-1)return null;let o=[];for(let a=s+1;a<this.packets.length;a++){let c=this.packets[a];M2(n.rooms,c.opts)&&o.push(c.data)}return Promise.resolve(Object.assign(Object.assign({},n),{missedPackets:o}))}broadcast(e,t){var n;let i=e.type===2,s=e.id===void 0,o=((n=t.flags)===null||n===void 0?void 0:n.volatile)===void 0;if(i&&s&&o){let a=(0,k2.yeast)();e.data.push(a),this.packets.push({id:a,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};ds.SessionAwareAdapter=$d;function M2(r,e){let t=e.rooms.size===0||r.some(i=>e.rooms.has(i)),n=r.every(i=>!e.except.has(i));return t&&n}});var Cb=O(Fr=>{"use strict";var P2=Fr&&Fr.__rest||function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.ClusterAdapterWithHeartbeat=Fr.ClusterAdapter=Fr.MessageType=void 0;var I2=Hd(),N2=Ae(),L2=require("crypto"),Ee=(0,N2.debug)("socket.io-adapter"),D2="emitter",ol=5e3;function ms(){return(0,L2.randomBytes)(8).toString("hex")}var te;(function(r){r[r.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",r[r.HEARTBEAT=2]="HEARTBEAT",r[r.BROADCAST=3]="BROADCAST",r[r.SOCKETS_JOIN=4]="SOCKETS_JOIN",r[r.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",r[r.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",r[r.FETCH_SOCKETS=7]="FETCH_SOCKETS",r[r.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",r[r.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",r[r.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",r[r.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",r[r.BROADCAST_ACK=12]="BROADCAST_ACK",r[r.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(te||(Fr.MessageType=te={}));function ui(r){return{rooms:[...r.rooms],except:[...r.except],flags:r.flags}}function hs(r){return{rooms:new Set(r.rooms),except:new Set(r.except),flags:r.flags}}var al=class extends I2.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=ms()}onMessage(e,t){if(e.uid===this.uid)return Ee("[%s] ignore message from self",this.uid);if(e.nsp!==this.nsp.name)return Ee("[%s] ignore message from another namespace (%s)",this.uid,e.nsp);switch(Ee("[%s] new event of type %d from %s",this.uid,e.type,e.uid),e.type){case te.BROADCAST:{if(e.data.requestId!==void 0)super.broadcastWithAck(e.data.packet,hs(e.data.opts),i=>{Ee("[%s] waiting for %d client acknowledgements",this.uid,i),this.publishResponse(e.uid,{type:te.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:i}})},i=>{Ee("[%s] received acknowledgement with value %j",this.uid,i),this.publishResponse(e.uid,{type:te.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:i}})});else{let i=e.data.packet,s=hs(e.data.opts);this.addOffsetIfNecessary(i,s,t),super.broadcast(i,s)}break}case te.SOCKETS_JOIN:super.addSockets(hs(e.data.opts),e.data.rooms);break;case te.SOCKETS_LEAVE:super.delSockets(hs(e.data.opts),e.data.rooms);break;case te.DISCONNECT_SOCKETS:super.disconnectSockets(hs(e.data.opts),e.data.close);break;case te.FETCH_SOCKETS:{Ee("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(hs(e.data.opts)).then(n=>{this.publishResponse(e.uid,{type:te.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:n.map(i=>{let s=i.handshake,{sessionStore:o}=s,a=P2(s,["sessionStore"]);return{id:i.id,handshake:a,rooms:[...i.rooms],data:i.data}})}})});break}case te.SERVER_SIDE_EMIT:{let n=e.data.packet;if(!(e.data.requestId!==void 0)){this.nsp._onServerSideEmit(n);return}let s=!1,o=a=>{s||(s=!0,Ee("[%s] calling acknowledgement with %j",this.uid,a),this.publishResponse(e.uid,{type:te.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:a}}))};this.nsp._onServerSideEmit([...n,o]);break}case te.BROADCAST_CLIENT_COUNT:case te.BROADCAST_ACK:case te.FETCH_SOCKETS_RESPONSE:case te.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(e);break;default:Ee("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,n;let i=e.data.requestId;switch(Ee("[%s] received response %s to request %s",this.uid,e.type,i),e.type){case te.BROADCAST_CLIENT_COUNT:{(t=this.ackRequests.get(i))===null||t===void 0||t.clientCountCallback(e.data.clientCount);break}case te.BROADCAST_ACK:{(n=this.ackRequests.get(i))===null||n===void 0||n.ack(e.data.packet);break}case te.FETCH_SOCKETS_RESPONSE:{let s=this.requests.get(i);if(!s)return;s.current++,e.data.sockets.forEach(o=>s.responses.push(o)),s.current===s.expected&&(clearTimeout(s.timeout),s.resolve(s.responses),this.requests.delete(i));break}case te.SERVER_SIDE_EMIT_RESPONSE:{let s=this.requests.get(i);if(!s)return;s.current++,s.responses.push(e.data.packet),s.current===s.expected&&(clearTimeout(s.timeout),s.resolve(null,s.responses),this.requests.delete(i));break}default:Ee("[%s] unknown response type: %s",this.uid,e.type)}}async broadcast(e,t){var n;if(!((n=t.flags)===null||n===void 0?void 0:n.local))try{let s=await this.publishAndReturnOffset({type:te.BROADCAST,data:{packet:e,opts:ui(t)}});this.addOffsetIfNecessary(e,t,s)}catch(s){return Ee("[%s] error while broadcasting message: %s",this.uid,s.message)}super.broadcast(e,t)}addOffsetIfNecessary(e,t,n){var i;if(!this.nsp.server.opts.connectionStateRecovery)return;let s=e.type===2,o=e.id===void 0,a=((i=t.flags)===null||i===void 0?void 0:i.volatile)===void 0;s&&o&&a&&e.data.push(n)}broadcastWithAck(e,t,n,i){var s;if(!((s=t?.flags)===null||s===void 0?void 0:s.local)){let a=ms();this.ackRequests.set(a,{clientCountCallback:n,ack:i}),this.publish({type:te.BROADCAST,data:{packet:e,requestId:a,opts:ui(t)}}),setTimeout(()=>{this.ackRequests.delete(a)},t.flags.timeout)}super.broadcastWithAck(e,t,n,i)}async addSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:te.SOCKETS_JOIN,data:{opts:ui(e),rooms:t}})}catch(s){Ee("[%s] error while publishing message: %s",this.uid,s.message)}super.addSockets(e,t)}async delSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:te.SOCKETS_LEAVE,data:{opts:ui(e),rooms:t}})}catch(s){Ee("[%s] error while publishing message: %s",this.uid,s.message)}super.delSockets(e,t)}async disconnectSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:te.DISCONNECT_SOCKETS,data:{opts:ui(e),close:t}})}catch(s){Ee("[%s] error while publishing message: %s",this.uid,s.message)}super.disconnectSockets(e,t)}async fetchSockets(e){var t;let[n,i]=await Promise.all([super.fetchSockets(e),this.serverCount()]),s=i-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return n;let o=ms();return new Promise((a,c)=>{let u=setTimeout(()=>{let f=this.requests.get(o);f&&(c(new Error(`timeout reached: only ${f.current} responses received out of ${f.expected}`)),this.requests.delete(o))},e.flags.timeout||ol),p={type:te.FETCH_SOCKETS,resolve:a,timeout:u,current:0,expected:s,responses:n};this.requests.set(o,p),this.publish({type:te.FETCH_SOCKETS,data:{opts:ui(e),requestId:o}})})}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:te.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),i=await this.serverCount()-1;if(Ee('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=ms(),o=setTimeout(()=>{let c=this.requests.get(s);c&&(n(new Error(`timeout reached: only ${c.current} responses received out of ${c.expected}`),c.responses),this.requests.delete(s))},ol),a={type:te.SERVER_SIDE_EMIT,resolve:n,timeout:o,current:0,expected:i,responses:[]};this.requests.set(s,a),this.publish({type:te.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}publish(e){Ee("[%s] sending message %s",this.uid,e.type),this.publishAndReturnOffset(e).catch(t=>{Ee("[%s] error while publishing message: %s",this.uid,t)})}publishAndReturnOffset(e){return e.uid=this.uid,e.nsp=this.nsp.name,this.doPublish(e)}publishResponse(e,t){t.uid=this.uid,t.nsp=this.nsp.name,Ee("[%s] sending response %s to %s",this.uid,t.type,e),this.doPublishResponse(e,t).catch(n=>{Ee("[%s] error while publishing response: %s",this.uid,n)})}};Fr.ClusterAdapter=al;var Ud=class extends al{constructor(e,t){super(e),this.nodesMap=new Map,this.customRequests=new Map,this._opts=Object.assign({heartbeatInterval:5e3,heartbeatTimeout:1e4},t),this.cleanupTimer=setInterval(()=>{let n=Date.now();this.nodesMap.forEach((i,s)=>{n-i>this._opts.heartbeatTimeout&&(Ee("[%s] node %s seems down",this.uid,s),this.removeNode(s))})},1e3)}init(){this.publish({type:te.INITIAL_HEARTBEAT})}scheduleHeartbeat(){this.heartbeatTimer?this.heartbeatTimer.refresh():this.heartbeatTimer=setTimeout(()=>{this.publish({type:te.HEARTBEAT})},this._opts.heartbeatInterval)}close(){this.publish({type:te.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer&&clearInterval(this.cleanupTimer)}onMessage(e,t){if(e.uid===this.uid)return Ee("[%s] ignore message from self",this.uid);switch(e.uid&&e.uid!==D2&&this.nodesMap.set(e.uid,Date.now()),e.type){case te.INITIAL_HEARTBEAT:this.publish({type:te.HEARTBEAT});break;case te.HEARTBEAT:break;case te.ADAPTER_CLOSE:this.removeNode(e.uid);break;default:super.onMessage(e,t)}}serverCount(){return Promise.resolve(1+this.nodesMap.size)}publish(e){return this.scheduleHeartbeat(),super.publish(e)}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:te.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),i=this.nodesMap.size;if(Ee('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=ms(),o=setTimeout(()=>{let c=this.customRequests.get(s);c&&(n(new Error(`timeout reached: missing ${c.missingUids.size} responses`),c.responses),this.customRequests.delete(s))},ol),a={type:te.SERVER_SIDE_EMIT,resolve:n,timeout:o,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(s,a),this.publish({type:te.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}async fetchSockets(e){var t;let[n,i]=await Promise.all([super.fetchSockets({rooms:e.rooms,except:e.except,flags:{local:!0}}),this.serverCount()]),s=i-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return n;let o=ms();return new Promise((a,c)=>{let u=setTimeout(()=>{let f=this.customRequests.get(o);f&&(c(new Error(`timeout reached: missing ${f.missingUids.size} responses`)),this.customRequests.delete(o))},e.flags.timeout||ol),p={type:te.FETCH_SOCKETS,resolve:a,timeout:u,missingUids:new Set([...this.nodesMap.keys()]),responses:n};this.customRequests.set(o,p),this.publish({type:te.FETCH_SOCKETS,data:{opts:ui(e),requestId:o}})})}onResponse(e){let t=e.data.requestId;switch(Ee("[%s] received response %s to request %s",this.uid,e.type,t),e.type){case te.FETCH_SOCKETS_RESPONSE:{let n=this.customRequests.get(t);if(!n)return;e.data.sockets.forEach(i=>n.responses.push(i)),n.missingUids.delete(e.uid),n.missingUids.size===0&&(clearTimeout(n.timeout),n.resolve(n.responses),this.customRequests.delete(t));break}case te.SERVER_SIDE_EMIT_RESPONSE:{let n=this.customRequests.get(t);if(!n)return;n.responses.push(e.data.packet),n.missingUids.delete(e.uid),n.missingUids.size===0&&(clearTimeout(n.timeout),n.resolve(null,n.responses),this.customRequests.delete(t));break}default:super.onResponse(e)}}removeNode(e){this.customRequests.forEach((t,n)=>{t.missingUids.delete(e),t.missingUids.size===0&&(clearTimeout(t.timeout),t.type===te.FETCH_SOCKETS?t.resolve(t.responses):t.type===te.SERVER_SIDE_EMIT&&t.resolve(null,t.responses),this.customRequests.delete(n))}),this.nodesMap.delete(e)}};Fr.ClusterAdapterWithHeartbeat=Ud});var cl=O(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.MessageType=lr.ClusterAdapterWithHeartbeat=lr.ClusterAdapter=lr.SessionAwareAdapter=lr.Adapter=void 0;var Ab=Hd();Object.defineProperty(lr,"Adapter",{enumerable:!0,get:function(){return Ab.Adapter}});Object.defineProperty(lr,"SessionAwareAdapter",{enumerable:!0,get:function(){return Ab.SessionAwareAdapter}});var qd=Cb();Object.defineProperty(lr,"ClusterAdapter",{enumerable:!0,get:function(){return qd.ClusterAdapter}});Object.defineProperty(lr,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return qd.ClusterAdapterWithHeartbeat}});Object.defineProperty(lr,"MessageType",{enumerable:!0,get:function(){return qd.MessageType}})});var Ob=O(gs=>{"use strict";var B2=gs&&gs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(gs,"__esModule",{value:!0});gs.ParentNamespace=void 0;var Rb=gd(),j2=cl(),F2=B2(Ae()),kb=(0,F2.default)("socket.io:parent-namespace"),ll=class r extends Rb.Namespace{constructor(e){super(e,"/_"+r.count++),this.children=new Set}_initAdapter(){this.adapter=new Wd(this)}emit(e,...t){return this.children.forEach(n=>{n.emit(e,...t)}),!0}createChild(e){kb("creating child namespace %s",e);let t=new Rb.Namespace(this.server,e);if(this._fns.forEach(n=>t.use(n)),this.listeners("connect").forEach(n=>t.on("connect",n)),this.listeners("connection").forEach(n=>t.on("connection",n)),this.children.add(t),this.server._opts.cleanupEmptyChildNamespaces){let n=t._remove;t._remove=i=>{n.call(t,i),t.sockets.size===0&&(kb("closing child namespace %s",e),t.adapter.close(),this.server._nsps.delete(t.name),this.children.delete(t))}}return this.server._nsps.set(e,t),this.server.sockets.emitReserved("new_namespace",t),t}fetchSockets(){throw new Error("fetchSockets() is not supported on parent namespaces")}};gs.ParentNamespace=ll;ll.count=0;var Wd=class extends j2.Adapter{broadcast(e,t){this.nsp.children.forEach(n=>{n.adapter.broadcast(e,t)})}}});var Db=O(fi=>{"use strict";var $2=fi&&fi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fi,"__esModule",{value:!0});fi.patchAdapter=U2;fi.restoreAdapter=q2;fi.serveFile=G2;var pi=cl(),Mb=require("fs"),H2=$2(Ae()),ul=(0,H2.default)("socket.io:adapter-uws"),Gd="",{addAll:Ib,del:Nb,broadcast:Lb}=pi.Adapter.prototype;function U2(r){pi.Adapter.prototype.addAll=function(e,t){let n=!this.sids.has(e);Ib.call(this,e,t);let i=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(i){if(i.conn.transport.name==="websocket"){Pb(this.nsp.name,i,n,t);return}n&&i.conn.on("upgrade",()=>{let s=this.sids.get(e);s&&Pb(this.nsp.name,i,n,s)})}},pi.Adapter.prototype.del=function(e,t){Nb.call(this,e,t);let n=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(n&&n.conn.transport.name==="websocket"){let i=n.conn.id,s=n.conn.transport.socket,o=`${this.nsp.name}${Gd}${t}`;ul("unsubscribe connection %s from topic %s",i,o),s.unsubscribe(o)}},pi.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){Lb.call(this,e,t);return}let i=t.flags||{},s={preEncoded:!0,volatile:i.volatile,compress:i.compress};e.nsp=this.nsp.name;let o=this.encoder.encode(e),a=t.rooms.size===0?this.nsp.name:`${this.nsp.name}${Gd}${t.rooms.keys().next().value}`;ul("fast publish to %s",a),o.forEach(c=>{let u=typeof c!="string";r.publish(a,u?c:"4"+c,u)}),this.apply(t,c=>{c.conn.transport.name!=="websocket"&&c.client.writeToEngine(o,s)})}}function Pb(r,e,t,n){let i=e.conn.id,s=e.conn.transport.socket;t&&(ul("subscribe connection %s to topic %s",i,r),s.subscribe(r)),n.forEach(o=>{let a=`${r}${Gd}${o}`;ul("subscribe connection %s to topic %s",i,a),s.subscribe(a)})}function q2(){pi.Adapter.prototype.addAll=Ib,pi.Adapter.prototype.del=Nb,pi.Adapter.prototype.broadcast=Lb}var W2=r=>{let{buffer:e,byteOffset:t,byteLength:n}=r;return e.slice(t,t+n)};function G2(r,e){let{size:t}=(0,Mb.statSync)(e),n=(0,Mb.createReadStream)(e),i=()=>!n.destroyed&&n.destroy(),s=a=>{throw i(),a},o=a=>{let c=W2(a);r.cork(()=>{let u=r.getWriteOffset(),[p,f]=r.tryEnd(c,t);!f&&!p&&(n.pause(),r.onWritable(m=>{let[y,_]=r.tryEnd(c.slice(m-u),t);return!_&&y&&n.resume(),y}))})};r.onAborted(i),n.on("data",o).on("error",s).on("end",i)}});var Bb=O((VW,z2)=>{z2.exports={name:"socket.io",version:"4.8.3",description:"node.js realtime framework server",keywords:["realtime","framework","websocket","tcp","events","socket","io"],files:["dist/","client-dist/","wrapper.mjs","!**/*.tsbuildinfo"],directories:{doc:"docs/",example:"example/",lib:"lib/",test:"test/"},type:"commonjs",main:"./dist/index.js",exports:{".":{types:"./dist/index.d.ts",import:"./wrapper.mjs",require:"./dist/index.js"},"./package.json":"./package.json"},types:"./dist/index.d.ts",license:"MIT",homepage:"https://github.com/socketio/socket.io/tree/main/packages/socket.io#readme",repository:{type:"git",url:"git+https://github.com/socketio/socket.io.git"},bugs:{url:"https://github.com/socketio/socket.io/issues"},scripts:{compile:"rimraf ./dist && tsc",test:"npm run format:check && npm run compile && npm run test:types && npm run test:unit","test:types":"tsd","test:unit":"nyc mocha --import=tsx --reporter spec --slow 200 --bail --timeout 10000 test/index.ts","format:check":'prettier --check "lib/**/*.ts" "test/**/*.ts"',"format:fix":'prettier --write "lib/**/*.ts" "test/**/*.ts"',prepack:"npm run compile"},dependencies:{accepts:"~1.3.4",base64id:"~2.0.0",cors:"~2.8.5",debug:"~4.4.1","engine.io":"~6.6.0","socket.io-adapter":"~2.5.2","socket.io-parser":"~4.2.4"},contributors:[{name:"Guillermo Rauch",email:"rauchg@gmail.com"},{name:"Arnout Kazemier",email:"info@3rd-eden.com"},{name:"Vladimir Dronnikov",email:"dronnikov@gmail.com"},{name:"Einar Otto Stangvik",email:"einaros@gmail.com"}],engines:{node:">=10.2.0"},tsd:{directory:"test"}}});var Gb=O((bt,Lo)=>{"use strict";var V2=bt&&bt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),K2=bt&&bt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Y2=bt&&bt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&V2(e,r,t);return K2(e,r),e},Kd=bt&&bt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(bt,"__esModule",{value:!0});bt.Namespace=bt.Socket=bt.Server=void 0;var X2=Kd(require("http")),J2=require("fs"),zd=require("zlib"),Q2=Qa(),pl=require("stream"),jb=require("path"),Fb=e_(),Z2=u_(),$b=require("events"),Yd=gd();Object.defineProperty(bt,"Namespace",{enumerable:!0,get:function(){return Yd.Namespace}});var eB=Ob(),Hb=cl(),tB=Y2(To()),rB=Kd(Ae()),Wb=hd();Object.defineProperty(bt,"Socket",{enumerable:!0,get:function(){return Wb.Socket}});var nB=$c(),Vd=Db(),iB=Kd(Kf()),kt=(0,rB.default)("socket.io:server"),Ub=Bb().version,qb=/\.map/,vs=class r extends nB.StrictEventEmitter{constructor(e,t={}){super(),this._nsps=new Map,this.parentNsps=new Map,this.parentNamespacesFromRegExp=new Map,typeof e=="object"&&e instanceof Object&&!e.listen&&(t=e,e=void 0),this.path(t.path||"/socket.io"),this.connectTimeout(t.connectTimeout||45e3),this.serveClient(t.serveClient!==!1),this._parser=t.parser||tB,this.encoder=new this._parser.Encoder,this.opts=t,t.connectionStateRecovery?(t.connectionStateRecovery=Object.assign({maxDisconnectionDuration:120*1e3,skipMiddlewares:!0},t.connectionStateRecovery),this.adapter(t.adapter||Hb.SessionAwareAdapter)):this.adapter(t.adapter||Hb.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||typeof e=="number")&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,iB.default)(this.opts.cors))}get _opts(){return this.opts}serveClient(e){return arguments.length?(this._serveClient=e,this):this._serveClient}_checkNamespace(e,t,n){if(this.parentNsps.size===0)return n(!1);let i=this.parentNsps.keys(),s=()=>{let o=i.next();if(o.done)return n(!1);o.value(e,t,(a,c)=>{if(a||!c)return s();if(this._nsps.has(e))return kt("dynamic namespace %s already exists",e),n(this._nsps.get(e));let u=this.parentNsps.get(o.value).createChild(e);kt("dynamic namespace %s was created",e),n(u)})};s()}path(e){if(!arguments.length)return this._path;this._path=e.replace(/\/$/,"");let t=this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return this.clientPathRegex=new RegExp("^"+t+"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)"),this}connectTimeout(e){return e===void 0?this._connectTimeout:(this._connectTimeout=e,this)}adapter(e){if(!arguments.length)return this._adapter;this._adapter=e;for(let t of this._nsps.values())t._initAdapter();return this}listen(e,t={}){return this.attach(e,t)}attach(e,t={}){if(typeof e=="function"){let n="You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.";throw new Error(n)}if(Number(e)==e&&(e=Number(e)),typeof e=="number"){kt("creating http server and binding to %d",e);let n=e;e=X2.default.createServer((i,s)=>{s.writeHead(404),s.end()}),e.listen(n)}return Object.assign(t,this.opts),t.path=t.path||this._path,this.initEngine(e,t),this}attachApp(e,t={}){Object.assign(t,this.opts),t.path=t.path||this._path,kt("creating uWebSockets.js-based engine with opts %j",t);let n=new Fb.uServer(t);n.attach(e,t),this.bind(n),this._serveClient&&e.get(`${this._path}/*`,(i,s)=>{if(!this.clientPathRegex.test(s.getUrl())){s.setYield(!0);return}let o=s.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),a=qb.test(o),c=a?"map":"source",u='"'+Ub+'"',p="W/"+u,f=s.getHeader("if-none-match");if(f&&(u===f||p===f)){kt("serve client %s 304",c),i.writeStatus("304 Not Modified"),i.end();return}kt("serve client %s",c),i.writeHeader("cache-control","public, max-age=0"),i.writeHeader("content-type","application/"+(a?"json":"javascript")+"; charset=utf-8"),i.writeHeader("etag",u);let m=jb.join(__dirname,"../client-dist/",o);(0,Vd.serveFile)(i,m)}),(0,Vd.patchAdapter)(e)}initEngine(e,t){kt("creating engine.io instance with opts %j",t),this.eio=(0,Fb.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){kt("attaching client serving req handler");let t=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("request",(n,i)=>{if(this.clientPathRegex.test(n.url))this._corsMiddleware?this._corsMiddleware(n,i,()=>{this.serve(n,i)}):this.serve(n,i);else for(let s=0;s<t.length;s++)t[s].call(e,n,i)})}serve(e,t){let n=e.url.replace(this._path,"").replace(/\?.*$/,""),i=qb.test(n),s=i?"map":"source",o='"'+Ub+'"',a="W/"+o,c=e.headers["if-none-match"];if(c&&(o===c||a===c)){kt("serve client %s 304",s),t.writeHead(304),t.end();return}kt("serve client %s",s),t.setHeader("Cache-Control","public, max-age=0"),t.setHeader("Content-Type","application/"+(i?"json":"javascript")+"; charset=utf-8"),t.setHeader("ETag",o),r.sendFile(n,e,t)}static sendFile(e,t,n){let i=(0,J2.createReadStream)(jb.join(__dirname,"../client-dist/",e)),s=Q2(t).encodings(["br","gzip","deflate"]),o=a=>{a&&n.end()};switch(s){case"br":n.writeHead(200,{"content-encoding":"br"}),(0,pl.pipeline)(i,(0,zd.createBrotliCompress)(),n,o);break;case"gzip":n.writeHead(200,{"content-encoding":"gzip"}),(0,pl.pipeline)(i,(0,zd.createGzip)(),n,o);break;case"deflate":n.writeHead(200,{"content-encoding":"deflate"}),(0,pl.pipeline)(i,(0,zd.createDeflate)(),n,o);break;default:n.writeHead(200),(0,pl.pipeline)(i,n,o)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){kt("incoming connection with id %s",e.id);let t=new Z2.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let i=new eB.ParentNamespace(this);return kt("initializing parent namespace %s",i.name),typeof e=="function"?this.parentNsps.set(e,i):(this.parentNsps.set((s,o,a)=>a(null,e.test(s)),i),this.parentNamespacesFromRegExp.set(e,i)),t&&i.on("connect",t),i}String(e)[0]!=="/"&&(e="/"+e);let n=this._nsps.get(e);if(!n){for(let[i,s]of this.parentNamespacesFromRegExp)if(i.test(e))return kt("attaching namespace %s to parent namespace %s",e,i),s.createChild(e);kt("initializing namespace %s",e),n=new Yd.Namespace(this,e),this._nsps.set(e,n),e!=="/"&&this.sockets.emitReserved("new_namespace",n)}return t&&n.on("connect",t),n}async close(e){if(await Promise.allSettled([...this._nsps.values()].map(async t=>{t.sockets.forEach(n=>{n._onclose("server shutting down")}),await t.adapter.close()})),this.engine.close(),(0,Vd.restoreAdapter)(),this.httpServer)return new Promise(t=>{this.httpServer.close(n=>{e&&e(n),n&&kt("server was not running"),t()})});e&&e()}use(e){return this.sockets.use(e),this}to(e){return this.sockets.to(e)}in(e){return this.sockets.in(e)}except(e){return this.sockets.except(e)}send(...e){return this.sockets.emit("message",...e),this}write(...e){return this.sockets.emit("message",...e),this}serverSideEmit(e,...t){return this.sockets.serverSideEmit(e,...t)}serverSideEmitWithAck(e,...t){return this.sockets.serverSideEmitWithAck(e,...t)}allSockets(){return this.sockets.allSockets()}compress(e){return this.sockets.compress(e)}get volatile(){return this.sockets.volatile}get local(){return this.sockets.local}timeout(e){return this.sockets.timeout(e)}fetchSockets(){return this.sockets.fetchSockets()}socketsJoin(e){return this.sockets.socketsJoin(e)}socketsLeave(e){return this.sockets.socketsLeave(e)}disconnectSockets(e=!1){return this.sockets.disconnectSockets(e)}};bt.Server=vs;var sB=Object.keys($b.EventEmitter.prototype).filter(function(r){return typeof $b.EventEmitter.prototype[r]=="function"});sB.forEach(function(r){vs.prototype[r]=function(){return this.sockets[r].apply(this.sockets,arguments)}});Lo.exports=(r,e)=>new vs(r,e);Lo.exports.Server=vs;Lo.exports.Namespace=Yd.Namespace;Lo.exports.Socket=Wb.Socket});function Xd(){return Do=(0,Kb.randomBytes)(32).toString("hex"),Do}function Yb(){return Do||Xd(),Do}function Xb(r){return!!r&&typeof r=="string"&&r===Do}var Kb,Do,fl=Ce(()=>{Kb=require("crypto"),Do=null});var ew,hl,Y,lt=Ce(()=>{ew={darwin:{capture:"nodeScreenshots",encoder:"sharp",tileSize:128,inputFormat:"rgba"},win32:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"},linux:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"}},hl=ew[process.platform]||ew.linux,Y={pipeline:{captureLib:hl.capture,encoder:hl.encoder,inputFormat:hl.inputFormat,tileSize:hl.tileSize,tileFormat:"webp",webpEffort:0,jpegQuality:50,tileConcurrency:6,outputScale:1,adaptiveTiers:[{minEffective:1,outputScale:1,jpegQuality:72},{minEffective:.7,outputScale:.95,jpegQuality:62},{minEffective:.4,outputScale:.8,jpegQuality:52},{minEffective:0,outputScale:.65,jpegQuality:45}],tierHysteresis:.05,checksumSampling:{rowStep:3,colStep:8}},webrtc:{enableWebRTC:!0,enableTurn:!1,turnApiUrl:"https://9remote.cc/api/webrtc/turn-credentials",turnRefreshInterval:1380*60*1e3,dcMaxMessageSize:65536,dcBufferThreshold:65536,iceDisconnectGraceMs:6e3,dcChunkSize:8,dcMaxTilesPerFrame:32,dcReliable:!0,dcOrdered:!1,answerTimeout:1e4,maxControlBuffer:500},robotSettings:{mouseDelay:2,keyboardDelay:2},throttling:{mouseThrottle:8,keyThrottle:25,typeTextThrottle:100,maxTextLength:1e3},resourceManagement:{inactiveTimeout:120*1e3,memoryCheckInterval:6e4,memoryWarningThreshold:1e3,maxTimersPerClient:100,maxChunkTimersPerClient:50,disconnectGraceMs:3e4},streaming:{activeInterval:60,idleInterval:400,idleThreshold:3,actionCaptureDelay:50,chunkSize:32,chunkDelay:5},focus:{paddingTiles:4},displayWake:{enabled:!0,throttleMs:3e4,macDurationSec:5},sleepInhibit:{defaultMode:"never",presets:{"30m":1800*1e3,"1h":3600*1e3,"2h":7200*1e3,"4h":14400*1e3,"24h":1440*60*1e3,never:null}},desktopSwitch:{darwin:{prev:{keyCode:123,mods:"control down"},next:{keyCode:124,mods:"control down"},new:{type:"missionControl"}},win32:{prev:["left",["control","command"]],next:["right",["control","command"]],new:["d",["control","command"]]},linux:{prev:null,next:null,new:null}},logging:{lifecycle:!1,errors:!0,dpiDetection:!1,focus:!1,focusEveryFrames:60,metrics:!1,metricsEveryFrames:30,webrtc:!1}}});var Bo,jo,ve,Qd=Ce(()=>{lt();Bi();Bo=()=>Y.logging,jo=On("remote"),ve={lifecycle:r=>{Bo().lifecycle&&jo.info(r)},focus:r=>{Bo().focus&&jo.info(r)},dpi:r=>{Bo().dpiDetection&&jo.info(r)},error:(r,e)=>{Bo().errors&&jo.error(`${r} ${e?.message||e||""}`)},warn:r=>{Bo().errors&&jo.warn(r)}}});function $o(){for(let r of[oe.ROOT,oe.STATE])$r.default.existsSync(r)||$r.default.mkdirSync(r,{recursive:!0})}function th(){try{return $o(),$r.default.existsSync(eh)?JSON.parse($r.default.readFileSync(eh,"utf8"))||{}:{}}catch{return{}}}function aw(r){try{$o();let e={...th(),...r};return $r.default.writeFileSync(eh,JSON.stringify(e,null,2),{mode:384}),e}catch(e){return console.error("Error saving settings:",e),null}}function cw(){try{return $o(),$r.default.existsSync(Zd)?JSON.parse($r.default.readFileSync(Zd,"utf8")):{machineId:null,key:null,name:"Default",createdAt:null}}catch{return{machineId:null,key:null,name:"Default",createdAt:null}}}function $n(r){try{$o(),$r.default.writeFileSync(hB,JSON.stringify({cmd:r,ts:Date.now()}))}catch{}}function lw(r,e,t="Default"){try{$o();let n={machineId:r,key:e,name:t,createdAt:new Date().toISOString()};return $r.default.writeFileSync(Zd,JSON.stringify(n,null,2),{mode:384}),n}catch(n){return console.error("Error saving key:",n),null}}var $r,Fo,x8,y8,Zd,hB,eh,ys=Ce(()=>{$r=J(require("fs"),1),Fo=J(require("path"),1);xt();x8=oe.STATE,y8=Fo.default.join(oe.STATE,"state.json"),Zd=Fo.default.join(oe.ROOT,"keys.json"),hB=Fo.default.join(oe.STATE,"cmd.json"),eh=Fo.default.join(oe.STATE,"settings.json")});function uw(){return new Promise(r=>{if(process.platform!=="darwin"){r({screenRecording:!0,accessibility:!0});return}let e=!1,t=!1,n=0,i=()=>{++n===2&&r({screenRecording:e,accessibility:t})};(0,Ho.execFile)("osascript",["-e",'use framework "ApplicationServices"',"-e",`set checkOptions to current application's NSDictionary's dictionaryWithObject:(false) forKey:("AXTrustedCheckOptionPrompt" as string)`,"-e","return current application's AXIsProcessTrustedWithOptions(checkOptions) as boolean"],{timeout:3e3},(s,o)=>{t=!s&&o.trim()==="true",i()}),(0,Ho.exec)(`osascript -e 'use framework "CoreGraphics"' -e "return (current application's CGPreflightScreenCaptureAccess()) as boolean"`,{timeout:3e3},(s,o)=>{e=!s&&o.trim()==="true",i()})})}function pw(r){let e=mB[r];e&&process.platform==="darwin"&&(0,Ho.exec)(`open "${e}"`,()=>{})}var Ho,mB,fw=Ce(()=>{Ho=require("child_process"),mB={screenRecording:"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture",accessibility:"x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"}});function gB(){return!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY}function Go(){for(let r=dw,e=null;r!==e;e=r,r=Hr.default.dirname(r)){let t=Hr.default.join(r,"package.json");if((0,Te.existsSync)(t)){try{let n=JSON.parse((0,Te.readFileSync)(t,"utf8"));if(n.name!==Di)continue;let i=typeof n.bin=="string"?n.bin:n.bin?.[Di];if(i){let s=Hr.default.resolve(r,i);if((0,Te.existsSync)(s))return s}}catch{}break}}return process.argv[1]||Hr.default.resolve(dw,"..","index.js")}function ws(){return process.execPath}function gw(){let r=Hr.default.dirname(ws()),e=["/usr/local/bin","/usr/bin","/bin","/usr/sbin","/sbin","/opt/homebrew/bin"];return e.includes(r)||e.unshift(r),e.join(":")}function rh(r){return String(r).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function vB(r,e){let t=[r,e,...xl].map(n=>` <string>${rh(n)}</string>`).join(`
29
+ `+t)}function fs(r,e,t,n,s,i){if(r.listenerCount("wsClientError")){let o=new Error(s);Error.captureStackTrace(o,fs),r.emit("wsClientError",o,t,e)}else jo(t,n,s,i)}});var Pb=O((C8,Mb)=>{"use strict";var gn=ol();gn.createWebSocketStream=bb();gn.Server=Ob();gn.Receiver=Id();gn.Sender=Dd();gn.WebSocket=gn;gn.WebSocketServer=gn.Server;Mb.exports=gn});var zd=O(vi=>{"use strict";var Wd;Object.defineProperty(vi,"__esModule",{value:!0});vi.SessionAwareAdapter=vi.Adapter=void 0;var W2=require("events"),G2=C_(),cl=Pb(),z2=typeof((Wd=cl?.Sender)===null||Wd===void 0?void 0:Wd.frame)=="function",ll=class extends W2.EventEmitter{constructor(e){super(),this.nsp=e,this.rooms=new Map,this.sids=new Map,this.encoder=e.server.encoder}init(){}close(){}serverCount(){return Promise.resolve(1)}addAll(e,t){this.sids.has(e)||this.sids.set(e,new Set);for(let n of t)this.sids.get(e).add(n),this.rooms.has(n)||(this.rooms.set(n,new Set),this.emit("create-room",n)),this.rooms.get(n).has(e)||(this.rooms.get(n).add(e),this.emit("join-room",n,e))}del(e,t){this.sids.has(e)&&this.sids.get(e).delete(t),this._del(t,e)}_del(e,t){let n=this.rooms.get(e);n!=null&&(n.delete(t)&&this.emit("leave-room",e,t),n.size===0&&this.rooms.delete(e)&&this.emit("delete-room",e))}delAll(e){if(this.sids.has(e)){for(let t of this.sids.get(e))this._del(t,e);this.sids.delete(e)}}broadcast(e,t){let n=t.flags||{},s={preEncoded:!0,volatile:n.volatile,compress:n.compress};e.nsp=this.nsp.name;let i=this._encode(e,s);this.apply(t,o=>{typeof o.notifyOutgoingListeners=="function"&&o.notifyOutgoingListeners(e),o.client.writeToEngine(i,s)})}broadcastWithAck(e,t,n,s){let i=t.flags||{},o={preEncoded:!0,volatile:i.volatile,compress:i.compress};e.nsp=this.nsp.name,e.id=this.nsp._ids++;let a=this._encode(e,o),c=0;this.apply(t,l=>{c++,l.acks.set(e.id,s),typeof l.notifyOutgoingListeners=="function"&&l.notifyOutgoingListeners(e),l.client.writeToEngine(a,o)}),n(c)}_encode(e,t){let n=this.encoder.encode(e);if(z2&&n.length===1&&typeof n[0]=="string"){let s=Buffer.from("4"+n[0]);t.wsPreEncodedFrame=cl.Sender.frame(s,{readOnly:!1,mask:!1,rsv1:!1,opcode:1,fin:!0})}return n}sockets(e){let t=new Set;return this.apply({rooms:e},n=>{t.add(n.id)}),Promise.resolve(t)}socketRooms(e){return this.sids.get(e)}fetchSockets(e){let t=[];return this.apply(e,n=>{t.push(n)}),Promise.resolve(t)}addSockets(e,t){this.apply(e,n=>{n.join(t)})}delSockets(e,t){this.apply(e,n=>{t.forEach(s=>n.leave(s))})}disconnectSockets(e,t){this.apply(e,n=>{n.disconnect(t)})}apply(e,t){let n=e.rooms,s=this.computeExceptSids(e.except);if(n.size){let i=new Set;for(let o of n)if(this.rooms.has(o))for(let a of this.rooms.get(o)){if(i.has(a)||s.has(a))continue;let c=this.nsp.sockets.get(a);c&&(t(c),i.add(a))}}else for(let[i]of this.sids){if(s.has(i))continue;let o=this.nsp.sockets.get(i);o&&t(o)}}computeExceptSids(e){let t=new Set;if(e&&e.size>0)for(let n of e)this.rooms.has(n)&&this.rooms.get(n).forEach(s=>t.add(s));return t}serverSideEmit(e){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(e){}restoreSession(e,t){return null}};vi.Adapter=ll;var Gd=class extends ll{constructor(e){super(e),this.nsp=e,this.sessions=new Map,this.packets=[],this.maxDisconnectionDuration=e.server.opts.connectionStateRecovery.maxDisconnectionDuration,setInterval(()=>{let n=Date.now()-this.maxDisconnectionDuration;this.sessions.forEach((s,i)=>{s.disconnectedAt<n&&this.sessions.delete(i)});for(let s=this.packets.length-1;s>=0;s--)if(this.packets[s].emittedAt<n){this.packets.splice(0,s+1);break}},60*1e3).unref()}persistSession(e){e.disconnectedAt=Date.now(),this.sessions.set(e.pid,e)}restoreSession(e,t){let n=this.sessions.get(e);if(!n)return null;if(n.disconnectedAt+this.maxDisconnectionDuration<Date.now())return this.sessions.delete(e),null;let i=this.packets.findIndex(a=>a.id===t);if(i===-1)return null;let o=[];for(let a=i+1;a<this.packets.length;a++){let c=this.packets[a];V2(n.rooms,c.opts)&&o.push(c.data)}return Promise.resolve(Object.assign(Object.assign({},n),{missedPackets:o}))}broadcast(e,t){var n;let s=e.type===2,i=e.id===void 0,o=((n=t.flags)===null||n===void 0?void 0:n.volatile)===void 0;if(s&&i&&o){let a=(0,G2.yeast)();e.data.push(a),this.packets.push({id:a,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};vi.SessionAwareAdapter=Gd;function V2(r,e){let t=e.rooms.size===0||r.some(s=>e.rooms.has(s)),n=r.every(s=>!e.except.has(s));return t&&n}});var Ib=O(qr=>{"use strict";var K2=qr&&qr.__rest||function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(r);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(r,n[s])&&(t[n[s]]=r[n[s]]);return t};Object.defineProperty(qr,"__esModule",{value:!0});qr.ClusterAdapterWithHeartbeat=qr.ClusterAdapter=qr.MessageType=void 0;var Y2=zd(),X2=ke(),J2=require("crypto"),Te=(0,X2.debug)("socket.io-adapter"),Q2="emitter",ul=5e3;function xi(){return(0,J2.randomBytes)(8).toString("hex")}var te;(function(r){r[r.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",r[r.HEARTBEAT=2]="HEARTBEAT",r[r.BROADCAST=3]="BROADCAST",r[r.SOCKETS_JOIN=4]="SOCKETS_JOIN",r[r.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",r[r.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",r[r.FETCH_SOCKETS=7]="FETCH_SOCKETS",r[r.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",r[r.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",r[r.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",r[r.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",r[r.BROADCAST_ACK=12]="BROADCAST_ACK",r[r.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(te||(qr.MessageType=te={}));function ds(r){return{rooms:[...r.rooms],except:[...r.except],flags:r.flags}}function yi(r){return{rooms:new Set(r.rooms),except:new Set(r.except),flags:r.flags}}var pl=class extends Y2.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=xi()}onMessage(e,t){if(e.uid===this.uid)return Te("[%s] ignore message from self",this.uid);if(e.nsp!==this.nsp.name)return Te("[%s] ignore message from another namespace (%s)",this.uid,e.nsp);switch(Te("[%s] new event of type %d from %s",this.uid,e.type,e.uid),e.type){case te.BROADCAST:{if(e.data.requestId!==void 0)super.broadcastWithAck(e.data.packet,yi(e.data.opts),s=>{Te("[%s] waiting for %d client acknowledgements",this.uid,s),this.publishResponse(e.uid,{type:te.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:s}})},s=>{Te("[%s] received acknowledgement with value %j",this.uid,s),this.publishResponse(e.uid,{type:te.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:s}})});else{let s=e.data.packet,i=yi(e.data.opts);this.addOffsetIfNecessary(s,i,t),super.broadcast(s,i)}break}case te.SOCKETS_JOIN:super.addSockets(yi(e.data.opts),e.data.rooms);break;case te.SOCKETS_LEAVE:super.delSockets(yi(e.data.opts),e.data.rooms);break;case te.DISCONNECT_SOCKETS:super.disconnectSockets(yi(e.data.opts),e.data.close);break;case te.FETCH_SOCKETS:{Te("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(yi(e.data.opts)).then(n=>{this.publishResponse(e.uid,{type:te.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:n.map(s=>{let i=s.handshake,{sessionStore:o}=i,a=K2(i,["sessionStore"]);return{id:s.id,handshake:a,rooms:[...s.rooms],data:s.data}})}})});break}case te.SERVER_SIDE_EMIT:{let n=e.data.packet;if(!(e.data.requestId!==void 0)){this.nsp._onServerSideEmit(n);return}let i=!1,o=a=>{i||(i=!0,Te("[%s] calling acknowledgement with %j",this.uid,a),this.publishResponse(e.uid,{type:te.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:a}}))};this.nsp._onServerSideEmit([...n,o]);break}case te.BROADCAST_CLIENT_COUNT:case te.BROADCAST_ACK:case te.FETCH_SOCKETS_RESPONSE:case te.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(e);break;default:Te("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,n;let s=e.data.requestId;switch(Te("[%s] received response %s to request %s",this.uid,e.type,s),e.type){case te.BROADCAST_CLIENT_COUNT:{(t=this.ackRequests.get(s))===null||t===void 0||t.clientCountCallback(e.data.clientCount);break}case te.BROADCAST_ACK:{(n=this.ackRequests.get(s))===null||n===void 0||n.ack(e.data.packet);break}case te.FETCH_SOCKETS_RESPONSE:{let i=this.requests.get(s);if(!i)return;i.current++,e.data.sockets.forEach(o=>i.responses.push(o)),i.current===i.expected&&(clearTimeout(i.timeout),i.resolve(i.responses),this.requests.delete(s));break}case te.SERVER_SIDE_EMIT_RESPONSE:{let i=this.requests.get(s);if(!i)return;i.current++,i.responses.push(e.data.packet),i.current===i.expected&&(clearTimeout(i.timeout),i.resolve(null,i.responses),this.requests.delete(s));break}default:Te("[%s] unknown response type: %s",this.uid,e.type)}}async broadcast(e,t){var n;if(!((n=t.flags)===null||n===void 0?void 0:n.local))try{let i=await this.publishAndReturnOffset({type:te.BROADCAST,data:{packet:e,opts:ds(t)}});this.addOffsetIfNecessary(e,t,i)}catch(i){return Te("[%s] error while broadcasting message: %s",this.uid,i.message)}super.broadcast(e,t)}addOffsetIfNecessary(e,t,n){var s;if(!this.nsp.server.opts.connectionStateRecovery)return;let i=e.type===2,o=e.id===void 0,a=((s=t.flags)===null||s===void 0?void 0:s.volatile)===void 0;i&&o&&a&&e.data.push(n)}broadcastWithAck(e,t,n,s){var i;if(!((i=t?.flags)===null||i===void 0?void 0:i.local)){let a=xi();this.ackRequests.set(a,{clientCountCallback:n,ack:s}),this.publish({type:te.BROADCAST,data:{packet:e,requestId:a,opts:ds(t)}}),setTimeout(()=>{this.ackRequests.delete(a)},t.flags.timeout)}super.broadcastWithAck(e,t,n,s)}async addSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:te.SOCKETS_JOIN,data:{opts:ds(e),rooms:t}})}catch(i){Te("[%s] error while publishing message: %s",this.uid,i.message)}super.addSockets(e,t)}async delSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:te.SOCKETS_LEAVE,data:{opts:ds(e),rooms:t}})}catch(i){Te("[%s] error while publishing message: %s",this.uid,i.message)}super.delSockets(e,t)}async disconnectSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:te.DISCONNECT_SOCKETS,data:{opts:ds(e),close:t}})}catch(i){Te("[%s] error while publishing message: %s",this.uid,i.message)}super.disconnectSockets(e,t)}async fetchSockets(e){var t;let[n,s]=await Promise.all([super.fetchSockets(e),this.serverCount()]),i=s-1;if(!((t=e.flags)===null||t===void 0)&&t.local||i<=0)return n;let o=xi();return new Promise((a,c)=>{let l=setTimeout(()=>{let f=this.requests.get(o);f&&(c(new Error(`timeout reached: only ${f.current} responses received out of ${f.expected}`)),this.requests.delete(o))},e.flags.timeout||ul),p={type:te.FETCH_SOCKETS,resolve:a,timeout:l,current:0,expected:i,responses:n};this.requests.set(o,p),this.publish({type:te.FETCH_SOCKETS,data:{opts:ds(e),requestId:o}})})}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:te.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),s=await this.serverCount()-1;if(Te('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,s),s<=0)return n(null,[]);let i=xi(),o=setTimeout(()=>{let c=this.requests.get(i);c&&(n(new Error(`timeout reached: only ${c.current} responses received out of ${c.expected}`),c.responses),this.requests.delete(i))},ul),a={type:te.SERVER_SIDE_EMIT,resolve:n,timeout:o,current:0,expected:s,responses:[]};this.requests.set(i,a),this.publish({type:te.SERVER_SIDE_EMIT,data:{requestId:i,packet:e}})}publish(e){Te("[%s] sending message %s",this.uid,e.type),this.publishAndReturnOffset(e).catch(t=>{Te("[%s] error while publishing message: %s",this.uid,t)})}publishAndReturnOffset(e){return e.uid=this.uid,e.nsp=this.nsp.name,this.doPublish(e)}publishResponse(e,t){t.uid=this.uid,t.nsp=this.nsp.name,Te("[%s] sending response %s to %s",this.uid,t.type,e),this.doPublishResponse(e,t).catch(n=>{Te("[%s] error while publishing response: %s",this.uid,n)})}};qr.ClusterAdapter=pl;var Vd=class extends pl{constructor(e,t){super(e),this.nodesMap=new Map,this.customRequests=new Map,this._opts=Object.assign({heartbeatInterval:5e3,heartbeatTimeout:1e4},t),this.cleanupTimer=setInterval(()=>{let n=Date.now();this.nodesMap.forEach((s,i)=>{n-s>this._opts.heartbeatTimeout&&(Te("[%s] node %s seems down",this.uid,i),this.removeNode(i))})},1e3)}init(){this.publish({type:te.INITIAL_HEARTBEAT})}scheduleHeartbeat(){this.heartbeatTimer?this.heartbeatTimer.refresh():this.heartbeatTimer=setTimeout(()=>{this.publish({type:te.HEARTBEAT})},this._opts.heartbeatInterval)}close(){this.publish({type:te.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer&&clearInterval(this.cleanupTimer)}onMessage(e,t){if(e.uid===this.uid)return Te("[%s] ignore message from self",this.uid);switch(e.uid&&e.uid!==Q2&&this.nodesMap.set(e.uid,Date.now()),e.type){case te.INITIAL_HEARTBEAT:this.publish({type:te.HEARTBEAT});break;case te.HEARTBEAT:break;case te.ADAPTER_CLOSE:this.removeNode(e.uid);break;default:super.onMessage(e,t)}}serverCount(){return Promise.resolve(1+this.nodesMap.size)}publish(e){return this.scheduleHeartbeat(),super.publish(e)}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:te.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),s=this.nodesMap.size;if(Te('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,s),s<=0)return n(null,[]);let i=xi(),o=setTimeout(()=>{let c=this.customRequests.get(i);c&&(n(new Error(`timeout reached: missing ${c.missingUids.size} responses`),c.responses),this.customRequests.delete(i))},ul),a={type:te.SERVER_SIDE_EMIT,resolve:n,timeout:o,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(i,a),this.publish({type:te.SERVER_SIDE_EMIT,data:{requestId:i,packet:e}})}async fetchSockets(e){var t;let[n,s]=await Promise.all([super.fetchSockets({rooms:e.rooms,except:e.except,flags:{local:!0}}),this.serverCount()]),i=s-1;if(!((t=e.flags)===null||t===void 0)&&t.local||i<=0)return n;let o=xi();return new Promise((a,c)=>{let l=setTimeout(()=>{let f=this.customRequests.get(o);f&&(c(new Error(`timeout reached: missing ${f.missingUids.size} responses`)),this.customRequests.delete(o))},e.flags.timeout||ul),p={type:te.FETCH_SOCKETS,resolve:a,timeout:l,missingUids:new Set([...this.nodesMap.keys()]),responses:n};this.customRequests.set(o,p),this.publish({type:te.FETCH_SOCKETS,data:{opts:ds(e),requestId:o}})})}onResponse(e){let t=e.data.requestId;switch(Te("[%s] received response %s to request %s",this.uid,e.type,t),e.type){case te.FETCH_SOCKETS_RESPONSE:{let n=this.customRequests.get(t);if(!n)return;e.data.sockets.forEach(s=>n.responses.push(s)),n.missingUids.delete(e.uid),n.missingUids.size===0&&(clearTimeout(n.timeout),n.resolve(n.responses),this.customRequests.delete(t));break}case te.SERVER_SIDE_EMIT_RESPONSE:{let n=this.customRequests.get(t);if(!n)return;n.responses.push(e.data.packet),n.missingUids.delete(e.uid),n.missingUids.size===0&&(clearTimeout(n.timeout),n.resolve(null,n.responses),this.customRequests.delete(t));break}default:super.onResponse(e)}}removeNode(e){this.customRequests.forEach((t,n)=>{t.missingUids.delete(e),t.missingUids.size===0&&(clearTimeout(t.timeout),t.type===te.FETCH_SOCKETS?t.resolve(t.responses):t.type===te.SERVER_SIDE_EMIT&&t.resolve(null,t.responses),this.customRequests.delete(n))}),this.nodesMap.delete(e)}};qr.ClusterAdapterWithHeartbeat=Vd});var fl=O(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.MessageType=fr.ClusterAdapterWithHeartbeat=fr.ClusterAdapter=fr.SessionAwareAdapter=fr.Adapter=void 0;var Nb=zd();Object.defineProperty(fr,"Adapter",{enumerable:!0,get:function(){return Nb.Adapter}});Object.defineProperty(fr,"SessionAwareAdapter",{enumerable:!0,get:function(){return Nb.SessionAwareAdapter}});var Kd=Ib();Object.defineProperty(fr,"ClusterAdapter",{enumerable:!0,get:function(){return Kd.ClusterAdapter}});Object.defineProperty(fr,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return Kd.ClusterAdapterWithHeartbeat}});Object.defineProperty(fr,"MessageType",{enumerable:!0,get:function(){return Kd.MessageType}})});var Bb=O(_i=>{"use strict";var Z2=_i&&_i.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_i,"__esModule",{value:!0});_i.ParentNamespace=void 0;var Lb=bd(),eB=fl(),tB=Z2(ke()),Db=(0,tB.default)("socket.io:parent-namespace"),dl=class r extends Lb.Namespace{constructor(e){super(e,"/_"+r.count++),this.children=new Set}_initAdapter(){this.adapter=new Yd(this)}emit(e,...t){return this.children.forEach(n=>{n.emit(e,...t)}),!0}createChild(e){Db("creating child namespace %s",e);let t=new Lb.Namespace(this.server,e);if(this._fns.forEach(n=>t.use(n)),this.listeners("connect").forEach(n=>t.on("connect",n)),this.listeners("connection").forEach(n=>t.on("connection",n)),this.children.add(t),this.server._opts.cleanupEmptyChildNamespaces){let n=t._remove;t._remove=s=>{n.call(t,s),t.sockets.size===0&&(Db("closing child namespace %s",e),t.adapter.close(),this.server._nsps.delete(t.name),this.children.delete(t))}}return this.server._nsps.set(e,t),this.server.sockets.emitReserved("new_namespace",t),t}fetchSockets(){throw new Error("fetchSockets() is not supported on parent namespaces")}};_i.ParentNamespace=dl;dl.count=0;var Yd=class extends eB.Adapter{broadcast(e,t){this.nsp.children.forEach(n=>{n.adapter.broadcast(e,t)})}}});var qb=O(ms=>{"use strict";var rB=ms&&ms.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ms,"__esModule",{value:!0});ms.patchAdapter=sB;ms.restoreAdapter=iB;ms.serveFile=aB;var hs=fl(),jb=require("fs"),nB=rB(ke()),hl=(0,nB.default)("socket.io:adapter-uws"),Xd="",{addAll:Hb,del:$b,broadcast:Ub}=hs.Adapter.prototype;function sB(r){hs.Adapter.prototype.addAll=function(e,t){let n=!this.sids.has(e);Hb.call(this,e,t);let s=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(s){if(s.conn.transport.name==="websocket"){Fb(this.nsp.name,s,n,t);return}n&&s.conn.on("upgrade",()=>{let i=this.sids.get(e);i&&Fb(this.nsp.name,s,n,i)})}},hs.Adapter.prototype.del=function(e,t){$b.call(this,e,t);let n=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(n&&n.conn.transport.name==="websocket"){let s=n.conn.id,i=n.conn.transport.socket,o=`${this.nsp.name}${Xd}${t}`;hl("unsubscribe connection %s from topic %s",s,o),i.unsubscribe(o)}},hs.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){Ub.call(this,e,t);return}let s=t.flags||{},i={preEncoded:!0,volatile:s.volatile,compress:s.compress};e.nsp=this.nsp.name;let o=this.encoder.encode(e),a=t.rooms.size===0?this.nsp.name:`${this.nsp.name}${Xd}${t.rooms.keys().next().value}`;hl("fast publish to %s",a),o.forEach(c=>{let l=typeof c!="string";r.publish(a,l?c:"4"+c,l)}),this.apply(t,c=>{c.conn.transport.name!=="websocket"&&c.client.writeToEngine(o,i)})}}function Fb(r,e,t,n){let s=e.conn.id,i=e.conn.transport.socket;t&&(hl("subscribe connection %s to topic %s",s,r),i.subscribe(r)),n.forEach(o=>{let a=`${r}${Xd}${o}`;hl("subscribe connection %s to topic %s",s,a),i.subscribe(a)})}function iB(){hs.Adapter.prototype.addAll=Hb,hs.Adapter.prototype.del=$b,hs.Adapter.prototype.broadcast=Ub}var oB=r=>{let{buffer:e,byteOffset:t,byteLength:n}=r;return e.slice(t,t+n)};function aB(r,e){let{size:t}=(0,jb.statSync)(e),n=(0,jb.createReadStream)(e),s=()=>!n.destroyed&&n.destroy(),i=a=>{throw s(),a},o=a=>{let c=oB(a);r.cork(()=>{let l=r.getWriteOffset(),[p,f]=r.tryEnd(c,t);!f&&!p&&(n.pause(),r.onWritable(h=>{let[x,_]=r.tryEnd(c.slice(h-l),t);return!_&&x&&n.resume(),x}))})};r.onAborted(s),n.on("data",o).on("error",i).on("end",s)}});var Wb=O((P8,cB)=>{cB.exports={name:"socket.io",version:"4.8.3",description:"node.js realtime framework server",keywords:["realtime","framework","websocket","tcp","events","socket","io"],files:["dist/","client-dist/","wrapper.mjs","!**/*.tsbuildinfo"],directories:{doc:"docs/",example:"example/",lib:"lib/",test:"test/"},type:"commonjs",main:"./dist/index.js",exports:{".":{types:"./dist/index.d.ts",import:"./wrapper.mjs",require:"./dist/index.js"},"./package.json":"./package.json"},types:"./dist/index.d.ts",license:"MIT",homepage:"https://github.com/socketio/socket.io/tree/main/packages/socket.io#readme",repository:{type:"git",url:"git+https://github.com/socketio/socket.io.git"},bugs:{url:"https://github.com/socketio/socket.io/issues"},scripts:{compile:"rimraf ./dist && tsc",test:"npm run format:check && npm run compile && npm run test:types && npm run test:unit","test:types":"tsd","test:unit":"nyc mocha --import=tsx --reporter spec --slow 200 --bail --timeout 10000 test/index.ts","format:check":'prettier --check "lib/**/*.ts" "test/**/*.ts"',"format:fix":'prettier --write "lib/**/*.ts" "test/**/*.ts"',prepack:"npm run compile"},dependencies:{accepts:"~1.3.4",base64id:"~2.0.0",cors:"~2.8.5",debug:"~4.4.1","engine.io":"~6.6.0","socket.io-adapter":"~2.5.2","socket.io-parser":"~4.2.4"},contributors:[{name:"Guillermo Rauch",email:"rauchg@gmail.com"},{name:"Arnout Kazemier",email:"info@3rd-eden.com"},{name:"Vladimir Dronnikov",email:"dronnikov@gmail.com"},{name:"Einar Otto Stangvik",email:"einaros@gmail.com"}],engines:{node:">=10.2.0"},tsd:{directory:"test"}}});var Qb=O((Et,Fo)=>{"use strict";var lB=Et&&Et.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),uB=Et&&Et.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),pB=Et&&Et.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&lB(e,r,t);return uB(e,r),e},Zd=Et&&Et.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Et,"__esModule",{value:!0});Et.Namespace=Et.Socket=Et.Server=void 0;var fB=Zd(require("http")),dB=require("fs"),Jd=require("zlib"),hB=rc(),ml=require("stream"),Gb=require("path"),zb=a_(),mB=v_(),Vb=require("events"),eh=bd();Object.defineProperty(Et,"Namespace",{enumerable:!0,get:function(){return eh.Namespace}});var gB=Bb(),Kb=fl(),vB=pB(ko()),yB=Zd(ke()),Jb=xd();Object.defineProperty(Et,"Socket",{enumerable:!0,get:function(){return Jb.Socket}});var xB=Wc(),Qd=qb(),_B=Zd(Zf()),Mt=(0,yB.default)("socket.io:server"),Yb=Wb().version,Xb=/\.map/,bi=class r extends xB.StrictEventEmitter{constructor(e,t={}){super(),this._nsps=new Map,this.parentNsps=new Map,this.parentNamespacesFromRegExp=new Map,typeof e=="object"&&e instanceof Object&&!e.listen&&(t=e,e=void 0),this.path(t.path||"/socket.io"),this.connectTimeout(t.connectTimeout||45e3),this.serveClient(t.serveClient!==!1),this._parser=t.parser||vB,this.encoder=new this._parser.Encoder,this.opts=t,t.connectionStateRecovery?(t.connectionStateRecovery=Object.assign({maxDisconnectionDuration:120*1e3,skipMiddlewares:!0},t.connectionStateRecovery),this.adapter(t.adapter||Kb.SessionAwareAdapter)):this.adapter(t.adapter||Kb.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||typeof e=="number")&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,_B.default)(this.opts.cors))}get _opts(){return this.opts}serveClient(e){return arguments.length?(this._serveClient=e,this):this._serveClient}_checkNamespace(e,t,n){if(this.parentNsps.size===0)return n(!1);let s=this.parentNsps.keys(),i=()=>{let o=s.next();if(o.done)return n(!1);o.value(e,t,(a,c)=>{if(a||!c)return i();if(this._nsps.has(e))return Mt("dynamic namespace %s already exists",e),n(this._nsps.get(e));let l=this.parentNsps.get(o.value).createChild(e);Mt("dynamic namespace %s was created",e),n(l)})};i()}path(e){if(!arguments.length)return this._path;this._path=e.replace(/\/$/,"");let t=this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return this.clientPathRegex=new RegExp("^"+t+"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)"),this}connectTimeout(e){return e===void 0?this._connectTimeout:(this._connectTimeout=e,this)}adapter(e){if(!arguments.length)return this._adapter;this._adapter=e;for(let t of this._nsps.values())t._initAdapter();return this}listen(e,t={}){return this.attach(e,t)}attach(e,t={}){if(typeof e=="function"){let n="You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.";throw new Error(n)}if(Number(e)==e&&(e=Number(e)),typeof e=="number"){Mt("creating http server and binding to %d",e);let n=e;e=fB.default.createServer((s,i)=>{i.writeHead(404),i.end()}),e.listen(n)}return Object.assign(t,this.opts),t.path=t.path||this._path,this.initEngine(e,t),this}attachApp(e,t={}){Object.assign(t,this.opts),t.path=t.path||this._path,Mt("creating uWebSockets.js-based engine with opts %j",t);let n=new zb.uServer(t);n.attach(e,t),this.bind(n),this._serveClient&&e.get(`${this._path}/*`,(s,i)=>{if(!this.clientPathRegex.test(i.getUrl())){i.setYield(!0);return}let o=i.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),a=Xb.test(o),c=a?"map":"source",l='"'+Yb+'"',p="W/"+l,f=i.getHeader("if-none-match");if(f&&(l===f||p===f)){Mt("serve client %s 304",c),s.writeStatus("304 Not Modified"),s.end();return}Mt("serve client %s",c),s.writeHeader("cache-control","public, max-age=0"),s.writeHeader("content-type","application/"+(a?"json":"javascript")+"; charset=utf-8"),s.writeHeader("etag",l);let h=Gb.join(__dirname,"../client-dist/",o);(0,Qd.serveFile)(s,h)}),(0,Qd.patchAdapter)(e)}initEngine(e,t){Mt("creating engine.io instance with opts %j",t),this.eio=(0,zb.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){Mt("attaching client serving req handler");let t=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("request",(n,s)=>{if(this.clientPathRegex.test(n.url))this._corsMiddleware?this._corsMiddleware(n,s,()=>{this.serve(n,s)}):this.serve(n,s);else for(let i=0;i<t.length;i++)t[i].call(e,n,s)})}serve(e,t){let n=e.url.replace(this._path,"").replace(/\?.*$/,""),s=Xb.test(n),i=s?"map":"source",o='"'+Yb+'"',a="W/"+o,c=e.headers["if-none-match"];if(c&&(o===c||a===c)){Mt("serve client %s 304",i),t.writeHead(304),t.end();return}Mt("serve client %s",i),t.setHeader("Cache-Control","public, max-age=0"),t.setHeader("Content-Type","application/"+(s?"json":"javascript")+"; charset=utf-8"),t.setHeader("ETag",o),r.sendFile(n,e,t)}static sendFile(e,t,n){let s=(0,dB.createReadStream)(Gb.join(__dirname,"../client-dist/",e)),i=hB(t).encodings(["br","gzip","deflate"]),o=a=>{a&&n.end()};switch(i){case"br":n.writeHead(200,{"content-encoding":"br"}),(0,ml.pipeline)(s,(0,Jd.createBrotliCompress)(),n,o);break;case"gzip":n.writeHead(200,{"content-encoding":"gzip"}),(0,ml.pipeline)(s,(0,Jd.createGzip)(),n,o);break;case"deflate":n.writeHead(200,{"content-encoding":"deflate"}),(0,ml.pipeline)(s,(0,Jd.createDeflate)(),n,o);break;default:n.writeHead(200),(0,ml.pipeline)(s,n,o)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){Mt("incoming connection with id %s",e.id);let t=new mB.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let s=new gB.ParentNamespace(this);return Mt("initializing parent namespace %s",s.name),typeof e=="function"?this.parentNsps.set(e,s):(this.parentNsps.set((i,o,a)=>a(null,e.test(i)),s),this.parentNamespacesFromRegExp.set(e,s)),t&&s.on("connect",t),s}String(e)[0]!=="/"&&(e="/"+e);let n=this._nsps.get(e);if(!n){for(let[s,i]of this.parentNamespacesFromRegExp)if(s.test(e))return Mt("attaching namespace %s to parent namespace %s",e,s),i.createChild(e);Mt("initializing namespace %s",e),n=new eh.Namespace(this,e),this._nsps.set(e,n),e!=="/"&&this.sockets.emitReserved("new_namespace",n)}return t&&n.on("connect",t),n}async close(e){if(await Promise.allSettled([...this._nsps.values()].map(async t=>{t.sockets.forEach(n=>{n._onclose("server shutting down")}),await t.adapter.close()})),this.engine.close(),(0,Qd.restoreAdapter)(),this.httpServer)return new Promise(t=>{this.httpServer.close(n=>{e&&e(n),n&&Mt("server was not running"),t()})});e&&e()}use(e){return this.sockets.use(e),this}to(e){return this.sockets.to(e)}in(e){return this.sockets.in(e)}except(e){return this.sockets.except(e)}send(...e){return this.sockets.emit("message",...e),this}write(...e){return this.sockets.emit("message",...e),this}serverSideEmit(e,...t){return this.sockets.serverSideEmit(e,...t)}serverSideEmitWithAck(e,...t){return this.sockets.serverSideEmitWithAck(e,...t)}allSockets(){return this.sockets.allSockets()}compress(e){return this.sockets.compress(e)}get volatile(){return this.sockets.volatile}get local(){return this.sockets.local}timeout(e){return this.sockets.timeout(e)}fetchSockets(){return this.sockets.fetchSockets()}socketsJoin(e){return this.sockets.socketsJoin(e)}socketsLeave(e){return this.sockets.socketsLeave(e)}disconnectSockets(e=!1){return this.sockets.disconnectSockets(e)}};Et.Server=bi;var bB=Object.keys(Vb.EventEmitter.prototype).filter(function(r){return typeof Vb.EventEmitter.prototype[r]=="function"});bB.forEach(function(r){bi.prototype[r]=function(){return this.sockets[r].apply(this.sockets,arguments)}});Fo.exports=(r,e)=>new bi(r,e);Fo.exports.Server=bi;Fo.exports.Namespace=eh.Namespace;Fo.exports.Socket=Jb.Socket});function th(){return Ho=(0,tw.randomBytes)(32).toString("hex"),Ho}function rw(){return Ho||th(),Ho}function nw(r){return!!r&&typeof r=="string"&&r===Ho}var tw,Ho,gl=Re(()=>{tw=require("crypto"),Ho=null});var aw,yl,Y,ft=Re(()=>{aw={darwin:{capture:"nodeScreenshots",encoder:"sharp",tileSize:128,inputFormat:"rgba"},win32:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"},linux:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"}},yl=aw[process.platform]||aw.linux,Y={pipeline:{captureLib:yl.capture,encoder:yl.encoder,inputFormat:yl.inputFormat,tileSize:yl.tileSize,tileFormat:"webp",webpEffort:0,jpegQuality:50,tileConcurrency:6,outputScale:1,adaptiveTiers:[{minEffective:1,outputScale:1,jpegQuality:72},{minEffective:.7,outputScale:.95,jpegQuality:62},{minEffective:.4,outputScale:.8,jpegQuality:52},{minEffective:0,outputScale:.65,jpegQuality:45}],tierHysteresis:.05,checksumSampling:{rowStep:3,colStep:8}},webrtc:{enableWebRTC:!0,enableTurn:!1,turnApiUrl:"https://9remote.cc/api/webrtc/turn-credentials",turnRefreshInterval:1380*60*1e3,dcMaxMessageSize:65536,dcBufferThreshold:65536,iceDisconnectGraceMs:6e3,dcChunkSize:8,dcMaxTilesPerFrame:32,dcReliable:!0,dcOrdered:!1,answerTimeout:1e4,maxControlBuffer:500},robotSettings:{mouseDelay:2,keyboardDelay:2},throttling:{mouseThrottle:8,keyThrottle:25,typeTextThrottle:100,maxTextLength:1e3},resourceManagement:{inactiveTimeout:120*1e3,memoryCheckInterval:6e4,memoryWarningThreshold:1e3,maxTimersPerClient:100,maxChunkTimersPerClient:50,disconnectGraceMs:3e4},streaming:{activeInterval:60,idleInterval:400,idleThreshold:3,actionCaptureDelay:50,chunkSize:32,chunkDelay:5},focus:{paddingTiles:4},displayWake:{enabled:!0,throttleMs:3e4,macDurationSec:5},sleepInhibit:{defaultMode:"never",presets:{"30m":1800*1e3,"1h":3600*1e3,"2h":7200*1e3,"4h":14400*1e3,"24h":1440*60*1e3,never:null}},desktopSwitch:{darwin:{prev:{keyCode:123,mods:"control down"},next:{keyCode:124,mods:"control down"},new:{type:"missionControl"}},win32:{prev:["left",["control","command"]],next:["right",["control","command"]],new:["d",["control","command"]]},linux:{prev:null,next:null,new:null}},logging:{lifecycle:!1,errors:!0,dpiDetection:!1,focus:!1,focusEveryFrames:60,metrics:!1,metricsEveryFrames:30,webrtc:!1}}});var $o,Uo,ye,nh=Re(()=>{ft();$s();$o=()=>Y.logging,Uo=In("remote"),ye={lifecycle:r=>{$o().lifecycle&&Uo.info(r)},focus:r=>{$o().focus&&Uo.info(r)},dpi:r=>{$o().dpiDetection&&Uo.info(r)},error:(r,e)=>{$o().errors&&Uo.error(`${r} ${e?.message||e||""}`)},warn:r=>{$o().errors&&Uo.warn(r)}}});function Wo(){for(let r of[oe.ROOT,oe.STATE])Wr.default.existsSync(r)||Wr.default.mkdirSync(r,{recursive:!0})}function oh(){try{return Wo(),Wr.default.existsSync(ih)?JSON.parse(Wr.default.readFileSync(ih,"utf8"))||{}:{}}catch{return{}}}function hw(r){try{Wo();let e={...oh(),...r};return Wr.default.writeFileSync(ih,JSON.stringify(e,null,2),{mode:384}),e}catch(e){return console.error("Error saving settings:",e),null}}function mw(){try{return Wo(),Wr.default.existsSync(sh)?JSON.parse(Wr.default.readFileSync(sh,"utf8")):{machineId:null,key:null,name:"Default",createdAt:null}}catch{return{machineId:null,key:null,name:"Default",createdAt:null}}}function qn(r){try{Wo(),Wr.default.writeFileSync(OB,JSON.stringify({cmd:r,ts:Date.now()}))}catch{}}function gw(r,e,t="Default"){try{Wo();let n={machineId:r,key:e,name:t,createdAt:new Date().toISOString()};return Wr.default.writeFileSync(sh,JSON.stringify(n,null,2),{mode:384}),n}catch(n){return console.error("Error saving key:",n),null}}var Wr,qo,nG,sG,sh,OB,ih,Si=Re(()=>{Wr=J(require("fs"),1),qo=J(require("path"),1);_t();nG=oe.STATE,sG=qo.default.join(oe.STATE,"state.json"),sh=qo.default.join(oe.ROOT,"keys.json"),OB=qo.default.join(oe.STATE,"cmd.json"),ih=qo.default.join(oe.STATE,"settings.json")});function vw(){return new Promise(r=>{if(process.platform!=="darwin"){r({screenRecording:!0,accessibility:!0});return}let e=!1,t=!1,n=0,s=()=>{++n===2&&r({screenRecording:e,accessibility:t})};(0,Go.execFile)("osascript",["-e",'use framework "ApplicationServices"',"-e",`set checkOptions to current application's NSDictionary's dictionaryWithObject:(false) forKey:("AXTrustedCheckOptionPrompt" as string)`,"-e","return current application's AXIsProcessTrustedWithOptions(checkOptions) as boolean"],{timeout:3e3},(i,o)=>{t=!i&&o.trim()==="true",s()}),(0,Go.exec)(`osascript -e 'use framework "CoreGraphics"' -e "return (current application's CGPreflightScreenCaptureAccess()) as boolean"`,{timeout:3e3},(i,o)=>{e=!i&&o.trim()==="true",s()})})}function yw(r){let e=MB[r];e&&process.platform==="darwin"&&(0,Go.exec)(`open "${e}"`,()=>{})}var Go,MB,xw=Re(()=>{Go=require("child_process"),MB={screenRecording:"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture",accessibility:"x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"}});function PB(){return!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY}function Yo(){for(let r=_w,e=null;r!==e;e=r,r=Gr.default.dirname(r)){let t=Gr.default.join(r,"package.json");if((0,Ce.existsSync)(t)){try{let n=JSON.parse((0,Ce.readFileSync)(t,"utf8"));if(n.name!==Hs)continue;let s=typeof n.bin=="string"?n.bin:n.bin?.[Hs];if(s){let i=Gr.default.resolve(r,s);if((0,Ce.existsSync)(i))return i}}catch{}break}}return process.argv[1]||Gr.default.resolve(_w,"..","index.js")}function Ci(){return process.execPath}function Sw(){let r=Gr.default.dirname(Ci()),e=["/usr/local/bin","/usr/bin","/bin","/usr/sbin","/sbin","/opt/homebrew/bin"];return e.includes(r)||e.unshift(r),e.join(":")}function ah(r){return String(r).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function IB(r,e){let t=[r,e,...wl].map(n=>` <string>${ah(n)}</string>`).join(`
30
30
  `);return`<?xml version="1.0" encoding="UTF-8"?>
31
31
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
32
32
  <plist version="1.0">
33
33
  <dict>
34
34
  <key>Label</key>
35
- <string>${_s}</string>
35
+ <string>${Ei}</string>
36
36
  <key>ProgramArguments</key>
37
37
  <array>
38
38
  ${t}
@@ -44,116 +44,141 @@ ${t}
44
44
  <key>EnvironmentVariables</key>
45
45
  <dict>
46
46
  <key>PATH</key>
47
- <string>${rh(gw())}</string>
47
+ <string>${ah(Sw())}</string>
48
48
  <key>HOME</key>
49
- <string>${rh(qo)}</string>
49
+ <string>${ah(Vo)}</string>
50
50
  </dict>
51
51
  <key>StandardOutPath</key>
52
- <string>${gl}</string>
52
+ <string>${_l}</string>
53
53
  <key>StandardErrorPath</key>
54
- <string>${gl}</string>
54
+ <string>${_l}</string>
55
55
  </dict>
56
56
  </plist>
57
- `}function xB(){return(0,Te.mkdirSync)(Hr.default.dirname(Ot.darwin),{recursive:!0}),(0,Te.writeFileSync)(Ot.darwin,vB(ws(),Go())),!0}function yB(){if((0,Te.existsSync)(Ot.darwin))try{(0,Te.unlinkSync)(Ot.darwin)}catch{}return!0}function _B(){return(0,Te.existsSync)(Ot.darwin)}function bB(){return`"${ws()}" "${Go()}" ${xl.join(" ")}`}function nh(r){return new Promise(e=>{(0,Wo.execFile)("reg",r,{windowsHide:!0},(t,n)=>{e({ok:!t,stdout:n||""})})})}async function wB(){let r=bB(),{ok:e}=await nh(["ADD","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","/V",bs,"/t","REG_SZ","/D",r,"/F"]);return e}async function SB(){return await nh(["DELETE","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","/V",bs,"/F"]),!0}async function EB(){let{ok:r,stdout:e}=await nh(["QUERY","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","/V",bs]);return r&&e.includes(bs)}function TB(){let r=`${ws()} ${Go()} ${xl.join(" ")}`;return`[Desktop Entry]
57
+ `}function NB(){return(0,Ce.mkdirSync)(Gr.default.dirname(Pt.darwin),{recursive:!0}),(0,Ce.writeFileSync)(Pt.darwin,IB(Ci(),Yo())),!0}function LB(){if((0,Ce.existsSync)(Pt.darwin))try{(0,Ce.unlinkSync)(Pt.darwin)}catch{}return!0}function DB(){return(0,Ce.existsSync)(Pt.darwin)}function BB(){return`"${Ci()}" "${Yo()}" ${wl.join(" ")}`}function ch(r){return new Promise(e=>{(0,Ko.execFile)("reg",r,{windowsHide:!0},(t,n)=>{e({ok:!t,stdout:n||""})})})}async function jB(){let r=BB(),{ok:e}=await ch(["ADD","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","/V",Ti,"/t","REG_SZ","/D",r,"/F"]);return e}async function FB(){return await ch(["DELETE","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","/V",Ti,"/F"]),!0}async function HB(){let{ok:r,stdout:e}=await ch(["QUERY","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","/V",Ti]);return r&&e.includes(Ti)}function $B(){let r=`${Ci()} ${Yo()} ${wl.join(" ")}`;return`[Desktop Entry]
58
58
  Type=Application
59
- Name=${bs}
59
+ Name=${Ti}
60
60
  Exec=${r}
61
61
  X-GNOME-Autostart-enabled=true
62
62
  NoDisplay=false
63
63
  Terminal=false
64
- `}function CB(){let r=xl.map(e=>`'${e}'`).join(" ");return`[Unit]
65
- Description=${bs} Agent
64
+ `}function UB(){let r=wl.map(e=>`'${e}'`).join(" ");return`[Unit]
65
+ Description=${Ti} Agent
66
66
  After=network-online.target
67
67
  Wants=network-online.target
68
68
 
69
69
  [Service]
70
70
  Type=simple
71
- ExecStart=${ws()} ${Go()} ${r}
71
+ ExecStart=${Ci()} ${Yo()} ${r}
72
72
  Restart=always
73
73
  RestartSec=10
74
- Environment=PATH=${gw()}
75
- Environment=HOME=${qo}
76
- StandardOutput=append:${gl}
77
- StandardError=append:${gl}
74
+ Environment=PATH=${Sw()}
75
+ Environment=HOME=${Vo}
76
+ StandardOutput=append:${_l}
77
+ StandardError=append:${_l}
78
78
 
79
79
  [Install]
80
80
  WantedBy=default.target
81
- `}function vl(r){try{return(0,Wo.execFileSync)("systemctl",["--user",...r],{stdio:"ignore"}),!0}catch{return!1}}function AB(){return gB()?((0,Te.mkdirSync)(Hr.default.dirname(Ot.linuxSystemd),{recursive:!0}),(0,Te.writeFileSync)(Ot.linuxSystemd,CB()),vl(["daemon-reload"]),vl(["enable",`${_s}.service`]),!0):((0,Te.mkdirSync)(Hr.default.dirname(Ot.linux),{recursive:!0}),(0,Te.writeFileSync)(Ot.linux,TB()),!0)}function RB(){if((0,Te.existsSync)(Ot.linuxSystemd)){vl(["disable",`${_s}.service`]);try{(0,Te.unlinkSync)(Ot.linuxSystemd)}catch{}vl(["daemon-reload"])}if((0,Te.existsSync)(Ot.linux))try{(0,Te.unlinkSync)(Ot.linux)}catch{}return!0}function kB(){return(0,Te.existsSync)(Ot.linux)||(0,Te.existsSync)(Ot.linuxSystemd)}async function ih(){try{if(process.platform==="darwin")return _B();if(process.platform==="win32")return await EB();if(process.platform==="linux")return kB()}catch{}return!1}async function vw(r){try{if(process.platform==="darwin")return r?xB():yB();if(process.platform==="win32")return r?await wB():await SB();if(process.platform==="linux")return r?AB():RB()}catch{}return!1}var Wo,Te,Uo,hw,Hr,mw,gl,_s,bs,xl,qo,dw,Ot,sh=Ce(()=>{Wo=require("child_process"),Te=require("fs"),Uo=require("path"),hw=J(require("os"),1),Hr=J(require("path"),1),mw=require("url");xt();gl=(0,Uo.join)(oe.LOGS,"autostart.log"),_s="cc.9remote.agent",bs="9Remote",xl=["--tray","--skip-update","--start"],qo=hw.default.homedir(),dw=Hr.default.dirname((0,mw.fileURLToPath)(__importMetaUrl)),Ot={darwin:(0,Uo.join)(qo,"Library","LaunchAgents",`${_s}.plist`),linux:(0,Uo.join)(qo,".config","autostart",`${_s}.desktop`),linuxSystemd:(0,Uo.join)(qo,".config","systemd","user",`${_s}.service`)}});function OB(){zo.default.existsSync(oe.CONFIG)||zo.default.mkdirSync(oe.CONFIG,{recursive:!0})}function Vo(){try{return JSON.parse(zo.default.readFileSync(yw,"utf8"))||{}}catch{return{}}}function yl(r){try{OB();let e={...Vo(),...r};return zo.default.writeFileSync(yw,JSON.stringify(e,null,2)),e}catch{return null}}var zo,xw,yw,oh=Ce(()=>{zo=J(require("fs"),1),xw=J(require("path"),1);xt();yw=xw.default.join(oe.CONFIG,"settings.json")});var wl={};Jr(wl,{getMode:()=>ph,isActive:()=>uh,onConnectionChange:()=>DB,setMode:()=>Yo,start:()=>LB,stop:()=>lh});function PB(){_w||(_w=!0,process.on("exit",()=>{if(jt){try{jt.kill()}catch{}jt=null}}))}function _l(){if(jt)return;let r=MB[process.platform];if(r)try{jt=(0,bw.spawn)(r.cmd,r.args,{stdio:"ignore",windowsHide:!0}),jt.on("error",e=>{bl.warn(`inhibitor error: ${e.message}`),jt=null}),jt.on("exit",()=>{jt=null}),PB(),bl.info(`\u{1F4A4} Sleep inhibitor started (${r.cmd})`)}catch(e){bl.warn(`Failed to start sleep inhibitor: ${e.message}`),jt=null}}function ww(){if(jt){try{jt.kill()}catch{}jt=null,bl.info("\u{1F4A4} Sleep inhibitor stopped")}}function Sw(){Ko&&(clearTimeout(Ko),Ko=null)}function IB(r){return(Y.sleepInhibit?.presets||{})[r]??null}function NB(r){let e=Y.sleepInhibit?.presets||{};return Object.prototype.hasOwnProperty.call(e,r)}function ch(){if(Sw(),Ss==="never"){_l();return}let r=IB(Ss);if(r==null){_l();return}if(ah>0){_l();return}_l(),Ko=setTimeout(()=>{Ko=null,ah===0&&ww()},r)}function LB(){ch()}function lh(){Sw(),ww()}function uh(){return jt!==null}function ph(){return Ss}function Yo(r){return NB(r)&&(Ss=r,ch()),Ss}function DB(r){ah=r,ch()}var bw,bl,MB,jt,Ss,Ko,ah,_w,Sl=Ce(()=>{bw=require("child_process");lt();Bi();bl=On("sleep"),MB={darwin:{cmd:"caffeinate",args:["-imsd"]},linux:{cmd:"systemd-inhibit",args:["--what=idle:sleep:handle-lid-switch","--who=9remote","--why=remote-active","sleep","infinity"]},win32:{cmd:"powershell.exe",args:["-NonInteractive","-NoProfile","-WindowStyle","Hidden","-Command",`Add-Type -Name K -Namespace W -MemberDefinition '[System.Runtime.InteropServices.DllImport("kernel32")]public static extern uint SetThreadExecutionState(uint e);'; [void][W.K]::SetThreadExecutionState(0x80000041); while($true){Start-Sleep 3600}`]}},jt=null,Ss=Y.sleepInhibit?.defaultMode||"never",Ko=null,ah=0,_w=!1});function BB(){(0,Hn.mkdirSync)(oe.STATE,{recursive:!0})}function Tw(){try{if((0,Hn.existsSync)(fh)){let r=JSON.parse((0,Hn.readFileSync)(fh,"utf8"));r.step===Xn.READY&&r.permanentKey&&(dn={...dn,...r})}}catch{}}function jB(){try{BB(),(0,Hn.writeFileSync)(fh,JSON.stringify(dn),{mode:384})}catch{}}function Cw(){Ft=!!Vo().desktopEnabled}function dh(){yl({desktopEnabled:Ft})}function wt(r,e){let t=`data: ${JSON.stringify({type:r,...e})}
81
+ `}function bl(r){try{return(0,Ko.execFileSync)("systemctl",["--user",...r],{stdio:"ignore"}),!0}catch{return!1}}function qB(){return PB()?((0,Ce.mkdirSync)(Gr.default.dirname(Pt.linuxSystemd),{recursive:!0}),(0,Ce.writeFileSync)(Pt.linuxSystemd,UB()),bl(["daemon-reload"]),bl(["enable",`${Ei}.service`]),!0):((0,Ce.mkdirSync)(Gr.default.dirname(Pt.linux),{recursive:!0}),(0,Ce.writeFileSync)(Pt.linux,$B()),!0)}function WB(){if((0,Ce.existsSync)(Pt.linuxSystemd)){bl(["disable",`${Ei}.service`]);try{(0,Ce.unlinkSync)(Pt.linuxSystemd)}catch{}bl(["daemon-reload"])}if((0,Ce.existsSync)(Pt.linux))try{(0,Ce.unlinkSync)(Pt.linux)}catch{}return!0}function GB(){return(0,Ce.existsSync)(Pt.linux)||(0,Ce.existsSync)(Pt.linuxSystemd)}async function lh(){try{if(process.platform==="darwin")return DB();if(process.platform==="win32")return await HB();if(process.platform==="linux")return GB()}catch{}return!1}async function Ew(r){try{if(process.platform==="darwin")return r?NB():LB();if(process.platform==="win32")return r?await jB():await FB();if(process.platform==="linux")return r?qB():WB()}catch{}return!1}var Ko,Ce,zo,bw,Gr,ww,_l,Ei,Ti,wl,Vo,_w,Pt,uh=Re(()=>{Ko=require("child_process"),Ce=require("fs"),zo=require("path"),bw=J(require("os"),1),Gr=J(require("path"),1),ww=require("url");_t();_l=(0,zo.join)(oe.LOGS,"autostart.log"),Ei="cc.9remote.agent",Ti="9Remote",wl=["--tray","--skip-update","--start"],Vo=bw.default.homedir(),_w=Gr.default.dirname((0,ww.fileURLToPath)(__importMetaUrl)),Pt={darwin:(0,zo.join)(Vo,"Library","LaunchAgents",`${Ei}.plist`),linux:(0,zo.join)(Vo,".config","autostart",`${Ei}.desktop`),linuxSystemd:(0,zo.join)(Vo,".config","systemd","user",`${Ei}.service`)}});function zB(){Xo.default.existsSync(oe.CONFIG)||Xo.default.mkdirSync(oe.CONFIG,{recursive:!0})}function Jo(){try{return JSON.parse(Xo.default.readFileSync(Cw,"utf8"))||{}}catch{return{}}}function Sl(r){try{zB();let e={...Jo(),...r};return Xo.default.writeFileSync(Cw,JSON.stringify(e,null,2)),e}catch{return null}}var Xo,Tw,Cw,ph=Re(()=>{Xo=J(require("fs"),1),Tw=J(require("path"),1);_t();Cw=Tw.default.join(oe.CONFIG,"settings.json")});var Cl={};tn(Cl,{getMode:()=>gh,isActive:()=>mh,onConnectionChange:()=>QB,setMode:()=>Zo,start:()=>JB,stop:()=>hh});function KB(){Aw||(Aw=!0,process.on("exit",()=>{if(Ut){try{Ut.kill()}catch{}Ut=null}}))}function El(){if(Ut)return;let r=VB[process.platform];if(r)try{Ut=(0,Rw.spawn)(r.cmd,r.args,{stdio:"ignore",windowsHide:!0}),Ut.on("error",e=>{Tl.warn(`inhibitor error: ${e.message}`),Ut=null}),Ut.on("exit",()=>{Ut=null}),KB(),Tl.info(`\u{1F4A4} Sleep inhibitor started (${r.cmd})`)}catch(e){Tl.warn(`Failed to start sleep inhibitor: ${e.message}`),Ut=null}}function kw(){if(Ut){try{Ut.kill()}catch{}Ut=null,Tl.info("\u{1F4A4} Sleep inhibitor stopped")}}function Ow(){Qo&&(clearTimeout(Qo),Qo=null)}function YB(r){return(Y.sleepInhibit?.presets||{})[r]??null}function XB(r){let e=Y.sleepInhibit?.presets||{};return Object.prototype.hasOwnProperty.call(e,r)}function dh(){if(Ow(),Ai==="never"){El();return}let r=YB(Ai);if(r==null){El();return}if(fh>0){El();return}El(),Qo=setTimeout(()=>{Qo=null,fh===0&&kw()},r)}function JB(){dh()}function hh(){Ow(),kw()}function mh(){return Ut!==null}function gh(){return Ai}function Zo(r){return XB(r)&&(Ai=r,dh()),Ai}function QB(r){fh=r,dh()}var Rw,Tl,VB,Ut,Ai,Qo,fh,Aw,Al=Re(()=>{Rw=require("child_process");ft();$s();Tl=In("sleep"),VB={darwin:{cmd:"caffeinate",args:["-imsd"]},linux:{cmd:"systemd-inhibit",args:["--what=idle:sleep:handle-lid-switch","--who=9remote","--why=remote-active","sleep","infinity"]},win32:{cmd:"powershell.exe",args:["-NonInteractive","-NoProfile","-WindowStyle","Hidden","-Command",`Add-Type -Name K -Namespace W -MemberDefinition '[System.Runtime.InteropServices.DllImport("kernel32")]public static extern uint SetThreadExecutionState(uint e);'; [void][W.K]::SetThreadExecutionState(0x80000041); while($true){Start-Sleep 3600}`]}},Ut=null,Ai=Y.sleepInhibit?.defaultMode||"never",Qo=null,fh=0,Aw=!1});function ZB(){(0,Wn.mkdirSync)(oe.STATE,{recursive:!0})}function Pw(){try{if((0,Wn.existsSync)(vh)){let r=JSON.parse((0,Wn.readFileSync)(vh,"utf8"));r.step===Zn.READY&&r.permanentKey&&(vn={...vn,...r})}}catch{}}function ej(){try{ZB(),(0,Wn.writeFileSync)(vh,JSON.stringify(vn),{mode:384})}catch{}}function Iw(){qt=!!Jo().desktopEnabled}function yh(){Sl({desktopEnabled:qt})}function Tt(r,e){let t=`data: ${JSON.stringify({type:r,...e})}
82
82
 
83
- `;for(let n of El)try{n.write(t)}catch{El.delete(n)}}function ye(r){wt("log",{message:`[${new Date().toLocaleTimeString()}] ${r}`})}function Aw(){return dn}function hn(r){dn={...dn,...r},wt("state",dn),jB()}function Rw(){hn({oneTimeKey:"",oneTimeKeyExpiresAt:null,qrUrl:""})}function kw(){return Tl}function Ow(r){Tl=r||null}function Mw(r){hh=!!r}function Es(){return!!hh&&!!Ft&&!!Ar.screenRecording&&!!Ar.accessibility}function Pw(r){mh=r}async function Cl(){let r=await uw(),e=Ar,t=Es();Ar=r,Ft&&(!r.screenRecording||!r.accessibility)&&(Ft=!1,dh());let n=e.screenRecording&&e.accessibility,i=r.screenRecording&&r.accessibility;return!Ft&&!n&&i&&(Ft=!0,dh()),(e.screenRecording!==r.screenRecording||e.accessibility!==r.accessibility)&&wt("permissions",{...Ar,desktopEnabled:Ft}),Es()!==t&&mh?.(),r}function Iw(r,e){let t=r.headers.origin;if(t&&!Va.includes(t))return ce(e,403,"Forbidden origin");ee(e,{localToken:Yb()})}function Nw(r,e,t=null,n="ws"){di.set(r,{socketId:r,ip:e,deviceId:t,type:n,connectedAt:Date.now()}),wt("connections",{connections:[...di.values()]}),Dw()}function Lw(r){di.delete(r),wt("connections",{connections:[...di.values()]}),Dw()}async function Dw(){try{(await Promise.resolve().then(()=>(Sl(),wl))).onConnectionChange(di.size)}catch{}}function Bw(r,e){e.setHeader("Content-Type","text/event-stream"),e.setHeader("Cache-Control","no-cache"),e.setHeader("Connection","keep-alive"),e.writeHead(200),e.write(`data: ${JSON.stringify({type:"state",...dn})}
83
+ `;for(let n of Rl)try{n.write(t)}catch{Rl.delete(n)}}function _e(r){Tt("log",{message:`[${new Date().toLocaleTimeString()}] ${r}`})}function Nw(){return vn}function yn(r){vn={...vn,...r},Tt("state",vn),ej()}function Lw(){yn({oneTimeKey:"",oneTimeKeyExpiresAt:null,qrUrl:""})}function Dw(){return kl}function Bw(r){kl=r||null}function jw(r){xh=!!r}function Ri(){return!!xh&&!!qt&&!!Mr.screenRecording&&!!Mr.accessibility}function Fw(r){_h=r}async function Ol(){let r=await vw(),e=Mr,t=Ri();Mr=r,qt&&(!r.screenRecording||!r.accessibility)&&(qt=!1,yh());let n=e.screenRecording&&e.accessibility,s=r.screenRecording&&r.accessibility;return!qt&&!n&&s&&(qt=!0,yh()),(e.screenRecording!==r.screenRecording||e.accessibility!==r.accessibility)&&Tt("permissions",{...Mr,desktopEnabled:qt}),Ri()!==t&&_h?.(),r}function Hw(r,e){let t=r.headers.origin;if(t&&!Ja.includes(t))return le(e,403,"Forbidden origin");ee(e,{localToken:rw()})}function $w(r,e,t=null,n="ws"){gs.set(r,{socketId:r,ip:e,deviceId:t,type:n,connectedAt:Date.now()}),Tt("connections",{connections:[...gs.values()]}),qw()}function Uw(r){gs.delete(r),Tt("connections",{connections:[...gs.values()]}),qw()}async function qw(){try{(await Promise.resolve().then(()=>(Al(),Cl))).onConnectionChange(gs.size)}catch{}}function Ww(r,e){e.setHeader("Content-Type","text/event-stream"),e.setHeader("Cache-Control","no-cache"),e.setHeader("Connection","keep-alive"),e.writeHead(200),e.write(`data: ${JSON.stringify({type:"state",...vn})}
84
84
 
85
- `),e.write(`data: ${JSON.stringify({type:"connections",connections:[...di.values()]})}
85
+ `),e.write(`data: ${JSON.stringify({type:"connections",connections:[...gs.values()]})}
86
86
 
87
- `),e.write(`data: ${JSON.stringify({type:"permissions",...Ar,desktopEnabled:Ft})}
87
+ `),e.write(`data: ${JSON.stringify({type:"permissions",...Mr,desktopEnabled:qt})}
88
88
 
89
- `),Tl&&e.write(`data: ${JSON.stringify({type:"updateAvailable",...Tl})}
89
+ `),kl&&e.write(`data: ${JSON.stringify({type:"updateAvailable",...kl})}
90
90
 
91
- `),El.add(e),r.on("close",()=>El.delete(e))}function jw(r,e){ee(e,{...dn,...Ar,desktopEnabled:Ft,remoteAvailable:hh})}async function Fw(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Nt(),Li)),n=await t(r,e);n&&(hn(n),ee(e))}function $w(r,e){ee(e),hn({step:Xn.PREPARING,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),$n("restart-tunnel")}function Hw(r,e){ee(e),hn({step:Xn.PREPARING,stepDesc:""}),$n("start-tunnel")}function Uw(r,e){ee(e),hn({step:Xn.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),$n("stop-tunnel")}function qw(r,e){ee(e),hn({step:Xn.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),$n("shutdown")}function Ww(r,e){ee(e),$n("update")}function Gw(r,e){ee(e,{connections:[...di.values()]})}function zw(r,e){let t=new URL(r.url,"http://localhost"),n=parseInt(t.searchParams.get("lines")||Ip,10);ee(e,{logs:zv(Number.isFinite(n)?n:Ip)})}async function Vw(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Nt(),Li)),n=await t(r,e);if(!n)return;let i=!!n.enabled;if(i&&(!Ar.screenRecording||!Ar.accessibility)){ee(e,{ok:!1,enabled:Ft,reason:"permissions_required"});return}let s=Es();Ft=i,dh(),wt("permissions",{...Ar,desktopEnabled:Ft}),Es()!==s&&mh?.(),ee(e,{ok:!0,enabled:Ft})}function Kw(r,e){ee(e,Ar)}async function Yw(r,e){let t=await ih();ee(e,{enabled:t})}async function Xw(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Nt(),Li)),n=await t(r,e);if(!n)return;let i=await vw(!!n.enabled),s=await ih();wt("autostart",{enabled:s}),ee(e,{ok:i,enabled:s})}async function Jw(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Nt(),Li)),n=await t(r,e);if(!n)return;let{type:i}=n;if(process.platform==="darwin"){pw(i);let s=Date.now(),o=setInterval(async()=>{((await Cl())[i]||Date.now()-s>Fv)&&clearInterval(o)},jv)}ee(e)}var Hn,Ew,fh,dn,Ft,hh,Ar,El,di,Tl,mh,mn=Ce(()=>{xt();Bi();xt();ys();fw();sh();Nt();fl();xt();Hn=require("fs"),Ew=require("path");xt();oh();fh=(0,Ew.join)(oe.STATE,"ui-state.json");dn={step:Xn.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null,permanentKey:"",qrUrl:"",latency:null,uptime:null,healthCheck:{running:!1,timeoutMs:0,startedAt:null,logs:[]},tunnelHealth:{status:"unknown",checkedAt:null}},Ft=!1,hh=!1,Ar={screenRecording:!1,accessibility:!1},El=new Set,di=new Map;Gv(ye);Tl=null;mh=null});var Qw={};Jr(Qw,{ScreenHandler:()=>gh,encodeTilesBatch:()=>Ts});function FB(r){let e=Buffer.alloc(28);return e.writeUInt32LE(r.tileIndex,0),e.writeUInt32LE(r.x,4),e.writeUInt32LE(r.y,8),e.writeUInt32LE(r.width,12),e.writeUInt32LE(r.height,16),e.writeUInt32LE(r.imageBuffer.length,20),e.writeUInt32LE(r.hash>>>0,24),Buffer.concat([e,r.imageBuffer])}function Ts(r,e){let t=Buffer.alloc(12);return t.writeUInt32LE(r.length,0),t.writeDoubleBE(e,4),Buffer.concat([t,...r.map(FB)])}var gh,vh=Ce(()=>{Qd();lt();mn();gh=class{constructor(e,t){this.resourceManager=e,this.screenUpdateHelper=t}setupScreenHandlers(e,t,n){e.on("request-screen",t(async()=>{let i=this.resourceManager.getClient(e.id);if(i)try{let s=await i.tileManager.detectChangedTiles();s.length>0&&n.sendTiles({tiles:s,timestamp:Date.now()},Ts),this.resourceManager.updateClientActivity(e.id)}catch(s){ve.error("Tile capture error:",s),n.emit("screen-error",{error:s.message})}})),e.on("request-screen-with-hashes",t(async i=>{let s=this.resourceManager.getClient(e.id);if(s)try{let o=i.tileHashes||[],a=await s.tileManager.compareClientTileHashes(o);a?.tiles?.length>0&&n.sendTiles({tiles:a.tiles,timestamp:Date.now()},Ts),this.resourceManager.updateClientActivity(e.id)}catch(o){ve.error("Tile capture with hashes error:",o),n.emit("screen-error",{error:o.message})}})),e.on("start-streaming",t(async()=>{let i=this.resourceManager.getClient(e.id);if(!i)return;i.streamingTimeout&&(clearTimeout(i.streamingTimeout),i.streamingTimeout=null),ve.lifecycle("\u{1F680} Remote streaming started");let{tileFormat:s,webpEffort:o,jpegQuality:a}=Y.pipeline;ye(`\u{1F5BC}\uFE0F Remote stream codec: ${s.toUpperCase()}${s==="webp"?` (effort=${o})`:""} q=${a}`),i.idleFrameCount=0,i.isStreaming=!0,i.streamGen=(i.streamGen||0)+1;let c=i.streamGen;i.tileManager.lastTileChecksums.clear();try{let p=await i.tileManager.getScreenDimensions();n.emit("screen-dimensions",p)}catch(p){ve.error("Get dimensions error:",p)}let u=async()=>{if(!e.connected||!i.isStreaming||i.streamGen!==c){i.streamingTimeout=null;return}try{let p=performance.now(),f=await i.tileManager.detectChangedTilesWithHashes();if(f.tiles.length>0&&e.connected){let M=n.sendTiles({tiles:f.tiles,timestamp:Date.now(),currentHashes:f.currentHashes},Ts);i.tileManager.commitHashes(M||[]),i.idleFrameCount=0}else i.idleFrameCount++;let{activeInterval:m,idleInterval:y,idleThreshold:_}=this.resourceManager.getStreamingConfig(),S=i.idleFrameCount>=_?y:m,A=Math.max(0,S-(performance.now()-p));i.streamingTimeout=setTimeout(u,A)}catch(p){ve.error("Auto streaming error:",p),i.streamingTimeout=setTimeout(u,200)}};u()})),e.on("stop-streaming",()=>{let i=this.resourceManager.getClient(e.id);i&&(i.isStreaming=!1,i.streamingTimeout&&(clearTimeout(i.streamingTimeout),i.streamingTimeout=null),i.tileManager?.clearMemory?.(),ve.lifecycle("\u23F9\uFE0F Remote streaming stopped"))}),e.on("get-screen-dimensions",t(async()=>{let i=this.resourceManager.getClient(e.id);if(i)try{let s=await i.tileManager.getScreenDimensions();n.emit("screen-dimensions",s)}catch(s){ve.error("Get dimensions error:",s),n.emit("screen-error",{error:s.message})}})),e.on("boost-stream",t(()=>{let i=this.resourceManager.getClient(e.id);i&&(i.idleFrameCount=0)})),e.on("set-focus",t(i=>{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=i?.rect||null,a=typeof i?.zoom=="number"?i.zoom:1,c=typeof i?.viewerWidth=="number"?i.viewerWidth:0,u=typeof i?.dpr=="number"?i.dpr:1,p=s.tileManager.pickProfile({zoom:a,viewerWidth:c,dpr:u});if(s.tileManager.setProfile(p),s.tileManager.setFocusRect(o),o){let f=s.tileManager.activeTileSet?.size||0,m=s.tileManager.totalTiles,y=m?(f/m*100).toFixed(0):0;ve.focus(`\u{1F3AF} [Focus] rect=${o.x},${o.y} ${o.w}x${o.h} | tiles ${f}/${m} (${y}%)`)}else ve.focus("\u{1F3AF} [Focus] cleared \u2192 full screen")}))}}});function Zw(r){xh.add(r)}function Cs(r){xh.delete(r)}function St(r,e,t){for(let n of xh)if(n.hasReadyAdapter?.())try{n.emit(e,t)}catch{}}var xh,hi=Ce(()=>{xh=new Set});async function mS(){if(Jo)return Jo;let r=await import("node-screenshots");if(Jo=(r.Monitor||r.default?.Monitor).all()[0],!Jo)throw new Error("No monitor found via node-screenshots");return Jo}async function gS(r){Th=r,Y.pipeline.captureLib==="nodeScreenshots"&&await mS()}async function vS(){let{captureLib:r,inputFormat:e}=Y.pipeline;if(r==="robotjs"){let{width:s,height:o}=Th.getScreenSize(),a=Th.screen.capture(0,0,s,o),c=a.byteWidth/a.bytesPerPixel;return{buffer:Buffer.from(a.image),width:c,height:a.height,channels:a.bytesPerPixel,format:e}}let n=await(await mS()).captureImage();return{buffer:await n.toRaw(),width:n.width,height:n.height,channels:4,format:e}}var Th,Jo,xS=Ce(()=>{lt();Th=null,Jo=null});function ZB(r){return r==="bgra"?Ah.FORMAT_BGRA:Ah.FORMAT_RGBA}function Rh(r){let e=new Uint32Array(r.buffer,r.byteOffset,r.length>>2);for(let t=0;t<e.length;t++){let n=e[t];e[t]=n&4278255360|(n&16711680)>>16|(n&255)<<16}}async function yS(r,e,t,n=4,i,s){let{encoder:o,inputFormat:a,jpegQuality:c,tileFormat:u,webpEffort:p}=Y.pipeline,f=i??c,m=s??a;if(o==="jpegTurbo"&&u!=="webp")return Ah.compressSync(r,{width:e,height:t,format:ZB(m),quality:f});let y=r;m==="bgra"&&(y=Buffer.from(r),Rh(y));let _=(0,jl.default)(y,{raw:{width:e,height:t,channels:n}});return u==="webp"?_.webp({quality:f,effort:p}).toBuffer():_.jpeg({quality:f}).toBuffer()}var jl,Ch,Ah,_S=Ce(()=>{jl=J(require("sharp"),1),Ch=J(require("@julusian/jpeg-turbo"),1);lt();Ah=Ch.default.default||Ch.default;jl.default.cache(!1);jl.default.concurrency(1)});var Fl,bS=Ce(()=>{lt();mn();Fl=class{constructor(){this.cfg=Y.logging,this.samples=[],this.lastLogTime=Date.now()}now(){return this.cfg.metrics?performance.now():0}record({capture:e,checksum:t,encode:n,total:i,changedTiles:s,totalTiles:o,tileBytes:a,rawBytes:c}){this.cfg.metrics&&(this.samples.push({capture:e,checksum:t,encode:n,total:i,changedTiles:s,totalTiles:o,tileBytes:a,rawBytes:c}),this.samples.length>=this.cfg.metricsEveryFrames&&this._flush())}_flush(){let e=this.samples.length,t=N=>(this.samples.reduce((j,W)=>j+W[N],0)/e).toFixed(1),n=(Date.now()-this.lastLogTime)/1e3,i=(e/n).toFixed(1),s=[],o=0;for(let N of this.samples){for(let j of N.tileBytes)s.push(j);o+=N.tileBytes.reduce((j,W)=>j+W,0)}let a=(o/e/1024).toFixed(1),c=s.length?(s.reduce((N,j)=>N+j,0)/s.length/1024).toFixed(2):"0",u=s.length?(Math.min(...s)/1024).toFixed(2):"0",p=s.length?(Math.max(...s)/1024).toFixed(2):"0",f=this.samples.reduce((N,j)=>N+j.rawBytes,0)/e,m=o/e,y=m>0?(f/m).toFixed(0):"0",_=(this.samples.reduce((N,j)=>N+j.changedTiles,0)/e).toFixed(0),S=this.samples[0]?.totalTiles||0,A=S?(_/S*100).toFixed(1):"0",M=Y.pipeline,L=`[Metrics] ${M.captureLib}+${M.encoder} tile=${M.tileSize} q${M.jpegQuality} scale=${M.outputScale} | fps=${i} | capture=${t("capture")}ms enc=${t("encode")}ms total=${t("total")}ms | tiles=${_}/${S} (${A}%) | data=${a}KB/frame | tileAvg=${c}KB (min ${u}, max ${p}) | compress=${y}x`;ye(L),console.log(L),this.samples=[],this.lastLogTime=Date.now()}}});var ES={};Jr(ES,{TileManager:()=>kh,mapLimit:()=>gi});async function gi(r,e,t){let n=new Array(r.length),i=0,s=Math.min(e,r.length),o=Array.from({length:s},async(a,c)=>{for(;i<r.length;){let u=i++;n[u]=await t(r[u],u,c)}});return await Promise.all(o),n}var ks,Hl,wS,$l,SS,ej,tj,kh,TS=Ce(()=>{ks=J(require("fs"),1),Hl=J(require("path"),1),wS=J(require("sharp"),1),$l=require("child_process"),SS=require("url");lt();xS();_S();bS();Qd();ej=(0,SS.fileURLToPath)(__importMetaUrl),tj=Hl.default.dirname(ej);kh=class{constructor(e){this.robot=e,this.metrics=new Fl,this.tileSize=Y.pipeline.tileSize,this.lastTileChecksums=new Map,this.screenWidth=0,this.screenHeight=0,this.tilesPerRow=0,this.tilesPerColumn=0,this.totalTiles=0,this.frameCount=0,this.tempDir=Hl.default.join(tj,"../../temp"),this.changeThreshold=1,this.scaledWidth=0,this.scaledHeight=0,this.isProcessing=!1,this.sharedScreenCache=null,this.lastCaptureTime=0,this.CACHE_TTL=100,this.dpiScale=1,this.captureWidth=0,this.captureHeight=0,this.scaleFactor=Y.pipeline.outputScale||1,this.compressionQuality=Y.pipeline.jpegQuality,this.activeTileSet=null,this.focusStats={frames:0,scanned:0,changed:0,bytes:0},this._scratchExtract=[],this._scratchSwap=[],this._prefetchCapture=null,ks.default.existsSync(this.tempDir)||ks.default.mkdirSync(this.tempDir,{recursive:!0}),gS(e),this.initializeScreenDimensions()}initializeScreenDimensions(){try{let{width:e,height:t}=this.robot.getScreenSize();this.screenWidth=e,this.screenHeight=t,this.detectDpiScale(),this.scaledWidth=this.captureWidth,this.scaledHeight=this.captureHeight,this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn;let n=100;if(this.totalTiles>n){let i=Math.ceil(Math.sqrt(this.scaledWidth*this.scaledHeight/n));this.tileSize=Math.max(i,120),this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}}catch(e){ve.error("Screen dimensions error:",e),this.screenWidth=1920,this.screenHeight=1080,this.dpiScale=1,this.captureWidth=1920,this.captureHeight=1080,this.scaledWidth=1728,this.scaledHeight=972,this.tileSize=120,this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}}detectDpiScale(){if(process.platform==="darwin"){let e=this.robot.screen.capture(0,0,this.screenWidth,this.screenHeight),n=e.byteWidth/e.bytesPerPixel/this.screenWidth;n>=1.9&&n<=2.1?this.dpiScale=2:this.dpiScale=1}else process.platform==="win32"?this.dpiScale=this._detectDpiScaleWin32():this.dpiScale=1;this.captureWidth=Math.floor(this.screenWidth*this.dpiScale),this.captureHeight=Math.floor(this.screenHeight*this.dpiScale)}_detectDpiScaleWin32(){ve.dpi(`\u{1F50D} [DPI Detection] screenWidth from robot: ${this.screenWidth}x${this.screenHeight}`);try{let e=(0,$l.execSync)(`powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "try{Get-ItemPropertyValue 'HKCU:\\Control Panel\\Desktop\\WindowMetrics' -Name AppliedDPI}catch{0}"`,{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ve.dpi(`\u{1F50D} [DPI Detection] Strategy 1 (Registry AppliedDPI): ${t} DPI`),t>=96){let n=t/96;return ve.dpi(`\u2705 [DPI Detection] Using registry scale: ${n}x (${t}/96)`),n}}catch(e){ve.dpi(`\u274C [DPI Detection] Strategy 1 failed: ${e.message}`)}try{let e=(0,$l.execSync)('powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "(Get-WmiObject -Class Win32_VideoController | Select-Object -First 1).CurrentHorizontalResolution"',{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ve.dpi(`\u{1F50D} [DPI Detection] Strategy 2 (WMI): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return ve.dpi(`\u2705 [DPI Detection] Using WMI scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){ve.dpi(`\u274C [DPI Detection] Strategy 2 failed: ${e.message}`)}try{let e=(0,$l.execSync)(`powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "Add-Type -TypeDefinition 'using System;using System.Runtime.InteropServices;public class Disp{[DllImport(\\"user32\\")]public static extern bool EnumDisplaySettings(string d,int m,ref DEVMODE dm);[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi)]public struct DEVMODE{[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmDeviceName;public short dmSpecVersion,dmDriverVersion,dmSize,dmDriverExtra;public int dmFields;public int dmPositionX,dmPositionY,dmDisplayOrientation,dmDisplayFixedOutput;public short dmColor,dmDuplex,dmYResolution,dmTTOption,dmCollate;[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmFormName;public short dmLogPixels;public int dmBitsPerPel,dmPelsWidth,dmPelsHeight,dmDisplayFlags,dmDisplayFrequency;}}'; $dm=New-Object Disp+DEVMODE; $dm.dmSize=[System.Runtime.InteropServices.Marshal]::SizeOf($dm); [Disp]::EnumDisplaySettings($null,-1,[ref]$dm) | Out-Null; Write-Output $dm.dmPelsWidth"`,{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ve.dpi(`\u{1F50D} [DPI Detection] Strategy 3 (EnumDisplaySettings): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return ve.dpi(`\u2705 [DPI Detection] Using EnumDisplaySettings scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){ve.dpi(`\u274C [DPI Detection] Strategy 3 failed: ${e.message}`)}return ve.dpi("\u26A0\uFE0F [DPI Detection] All strategies failed, fallback to 1x"),1}async captureFullScreen(){let e=await vS();return{buffer:e.buffer,width:e.width,height:e.height,channels:e.channels}}async getSharedScreenCapture(){let e=Date.now();return this.sharedScreenCache&&e-this.lastCaptureTime<this.CACHE_TTL?this.sharedScreenCache:(this.sharedScreenCache=await this.captureFullScreen(),this.lastCaptureTime=e,this.sharedScreenCache)}async getCaptureForStreaming(){if(!this._prefetchCapture){let t=await this.captureFullScreen();return this._prefetchCapture=this.captureFullScreen(),t}let e=await this._prefetchCapture;return this._prefetchCapture=this.captureFullScreen(),e}clearScreenCache(){}async detectChangedTiles(){return(await this.detectChangedTilesWithHashes()).tiles}async detectChangedTilesWithHashes(){if(this.isProcessing)return{tiles:[],currentHashes:Array.from(this.lastTileChecksums.values())};this.isProcessing=!0;let e=this.metrics.now(),t=e,n=e;try{let i=await this.getCaptureForStreaming();t=this.metrics.now();let s=[],o=[],a=new Map;this.frameCount++;let c=this.activeTileSet;for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let m=this.calculateTileChecksumDirect(i,f);a.set(f,m)}n=this.metrics.now();let u=Array.from(a.values());if(this.lastTileChecksums.size===0){let f=[];for(let y=0;y<this.totalTiles;y++)c&&!c.has(y)||f.push(y);let m=await gi(f,Y.pipeline.tileConcurrency,(y,_,S)=>this.processTileAsync(i,y,null,a.get(y),S));return s.push(...m),this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:u}}for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let m=a.get(f),y=this.lastTileChecksums.get(f);m!==y&&o.push(f)}if(o.length/this.totalTiles>this.changeThreshold){let f=[];for(let y=0;y<this.totalTiles;y++)c&&!c.has(y)||f.push(y);let m=await gi(f,Y.pipeline.tileConcurrency,(y,_,S)=>this.processTileAsync(i,y,null,a.get(y),S));s.push(...m.map(y=>({...y,fullRefresh:!0})))}else if(o.length>0){let f=await gi(o,Y.pipeline.tileConcurrency,(m,y,_)=>this.processTileAsync(i,m,null,a.get(m),_));s.push(...f)}return this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:u}}finally{this.isProcessing=!1}}async processTileAsync(e,t,n=null,i=null,s=null){let o=n||this.extractTile(e,t,s),a=await this.compressTileImage(o.buffer,o.width,o.height,s),{row:c,col:u}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:u*this.tileSize,y:c*this.tileSize,width:o.width,height:o.height,imageBuffer:a,hash:i??this.lastTileChecksums.get(t)??0,timestamp:Date.now(),frameCount:this.frameCount}}commitHashes(e){for(let t of e)this.lastTileChecksums.set(t.tileIndex,t.hash)}calculateTileChecksumDirect(e,t){let{row:n,col:i}=this.getTilePosition(t),s=i*this.tileSize,o=n*this.tileSize,a=Math.min(s+this.tileSize,e.width),c=Math.min(o+this.tileSize,e.height),u=a-s,p=c-o,f=e.channels,m=e.width*f,y=0,{rowStep:_,colStep:S}=Y.pipeline.checksumSampling;for(let A=0;A<p;A+=_){let M=(o+A)*m+s*f;for(let L=0;L<u;L+=S){let N=M+L*f,j=L+1;y=y+e.buffer[N]*j>>>0,y^=e.buffer[N+1]<<1,y=y+e.buffer[N+2]*j>>>0,y^=e.buffer[N+3]<<2}}return y>>>0}setFocusRect(e){if(!e){this.activeTileSet=null;return}let t=Y.focus.paddingTiles,n=Math.max(0,Math.floor(e.x/this.tileSize)-t),i=Math.max(0,Math.floor(e.y/this.tileSize)-t),s=Math.min(this.tilesPerRow-1,Math.floor((e.x+e.w)/this.tileSize)+t),o=Math.min(this.tilesPerColumn-1,Math.floor((e.y+e.h)/this.tileSize)+t),a=new Set;for(let u=i;u<=o;u++)for(let p=n;p<=s;p++)a.add(u*this.tilesPerRow+p);let c=this.activeTileSet;if(c)for(let u of a)c.has(u)||this.lastTileChecksums.delete(u);this.activeTileSet=a}getTilePosition(e){return{row:Math.floor(e/this.tilesPerRow),col:e%this.tilesPerRow}}_getScratch(e,t,n){let i=e[t];return(!i||i.length<n)&&(i=Buffer.allocUnsafe(n),e[t]=i),i.subarray(0,n)}extractTile(e,t,n=null){let{row:i,col:s}=this.getTilePosition(t),o=s*this.tileSize,a=i*this.tileSize,c=Math.min(o+this.tileSize,e.width),u=Math.min(a+this.tileSize,e.height),p=c-o,f=u-a,m=e.channels,y=p*m,_=p*f*m,S=n===null?Buffer.allocUnsafe(_):this._getScratch(this._scratchExtract,n,_);for(let A=0;A<f;A++){let M=((a+A)*e.width+o)*m,L=A*y;e.buffer.copy(S,L,M,M+y)}return{buffer:S,width:p,height:f,channels:m,tileIndex:t,x:o,y:a}}async compressTileImage(e,t,n,i=null){let s=this.scaleFactor;if(s&&s>0&&s<1){let o=Math.max(1,Math.floor(t*s)),a=Math.max(1,Math.floor(n*s)),{inputFormat:c}=Y.pipeline,u=e,p=4;c==="bgra"&&(i===null?u=Buffer.from(e):(u=this._getScratch(this._scratchSwap,i,e.length),e.copy(u)),Rh(u));let{tileFormat:f,webpEffort:m}=Y.pipeline,y=(0,wS.default)(u,{raw:{width:t,height:n,channels:p}}).resize(o,a,{kernel:"lanczos3",fastShrinkOnLoad:!1});return f==="webp"?y.webp({quality:this.compressionQuality,effort:m}).toBuffer():y.jpeg({quality:this.compressionQuality}).toBuffer()}return yS(e,t,n,4,this.compressionQuality)}pickProfile({zoom:e=1,viewerWidth:t=0,dpr:n=1}={}){let i=Y.pipeline.adaptiveTiers||[];if(!i.length)return null;let s=this.captureWidth||this.screenWidth||1,o=t>0?t:s,a=e>0?e:1,c=n>0?n:1,u=o*a*c/s,p=Y.pipeline.tierHysteresis||0,f=this._currentTier;for(let y of i){let _=f&&y===f?y.minEffective-p:y.minEffective;if(u>=_)return this._currentTier=y,y}let m=i[i.length-1];return this._currentTier=m,m}setProfile(e){if(!e)return;let t=e.outputScale??this.scaleFactor,n=e.jpegQuality??this.compressionQuality;t===this.scaleFactor&&n===this.compressionQuality||(this.scaleFactor=t,this.compressionQuality=n,this.lastTileChecksums.clear())}_recordFrame(e,t,n,i,s){if(this._recordFocusFrame(i),!this.metrics.cfg.metrics)return;let o=this.metrics.now(),a=i.map(u=>u.imageBuffer?.length||0),c=s?s.width*s.height*s.channels:0;this.metrics.record({capture:t-e,checksum:n-t,encode:o-n,total:o-e,changedTiles:i.length,totalTiles:this.totalTiles,tileBytes:a,rawBytes:c})}_recordFocusFrame(e){let t=this.focusStats;t.frames++,t.scanned+=this.activeTileSet?this.activeTileSet.size:this.totalTiles,t.changed+=e.length;for(let c of e)t.bytes+=c.imageBuffer?.length||0;if(t.frames<Y.logging.focusEveryFrames)return;let n=(t.scanned/t.frames).toFixed(0),i=(t.changed/t.frames).toFixed(1),s=(t.bytes/t.frames/1024).toFixed(1),o=this.totalTiles?((1-n/this.totalTiles)*100).toFixed(0):0,a=this.activeTileSet?"focus":"full";ve.focus(`\u{1F3AF} [Focus/${a}] ${t.frames}f | scan ${n}/${this.totalTiles} tiles (saved ${o}%) | changed ${i}/f | data ${s}KB/f`),this.focusStats={frames:0,scanned:0,changed:0,bytes:0}}async getScreenDimensions(){try{let e=await this.captureFullScreen();this.scaledWidth=e.width,this.scaledHeight=e.height,this.tilesPerRow=Math.ceil(e.width/this.tileSize),this.tilesPerColumn=Math.ceil(e.height/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}catch(e){ve.error("Error getting dimensions:",e)}return{width:this.scaledWidth,height:this.scaledHeight,tileWidth:this.tileSize,tileHeight:this.tileSize,tileCount:this.totalTiles,scaleFactor:this.scaleFactor,originalWidth:this.screenWidth,originalHeight:this.screenHeight}}async compareClientTileHashes(e){if(this.isProcessing)return{tiles:[],currentHashes:[],changedIndices:[]};this.isProcessing=!0;try{let t=await this.getSharedScreenCapture(),n=[],i=[];this.frameCount++;let s=this.activeTileSet,o=new Map;for(let c=0;c<this.totalTiles;c++){if(s&&!s.has(c))continue;let u=this.calculateTileChecksumDirect(t,c);o.set(c,u),this.lastTileChecksums.set(c,u)}if(!e||e.length===0){let c=[];for(let p=0;p<this.totalTiles;p++)s&&!s.has(p)||c.push(p);let u=await gi(c,Y.pipeline.tileConcurrency,p=>this.processTileAsync(t,p));return n.push(...u),{tiles:n,currentHashes:Array.from(o.values())}}for(let c=0;c<this.totalTiles;c++)s&&!s.has(c)||e[c]!==o.get(c)&&i.push(c);if(i.length/this.totalTiles>this.changeThreshold){let c=[];for(let p=0;p<this.totalTiles;p++)s&&!s.has(p)||c.push(p);let u=await gi(c,Y.pipeline.tileConcurrency,p=>this.processTileAsync(t,p));n.push(...u.map(p=>({...p,fullRefresh:!0})))}else if(i.length>0){let c=await gi(i,Y.pipeline.tileConcurrency,u=>this.processTileAsync(t,u));n.push(...c)}return this._recordFocusFrame(n),{tiles:n,currentHashes:Array.from(o.values()),changedIndices:i}}finally{this.isProcessing=!1}}clearMemory(){this.sharedScreenCache=null,this.lastCaptureTime=0,this.lastTileChecksums.clear(),this._scratchExtract=[],this._scratchSwap=[],this._traceFrames=50,this._prefetchCapture=null}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{ks.default.existsSync(this.tempDir)&&ks.default.readdirSync(this.tempDir).forEach(t=>ks.default.unlinkSync(Hl.default.join(this.tempDir,t)))}catch(e){ve.warn(`Cleanup error: ${e.message}`)}}}});var CS={};Jr(CS,{ResourceManager:()=>Oh});var Oh,AS=Ce(()=>{lt();hi();Oh=class{constructor(){this.activeClients=new Map,this.activeTimers=new Map,this.chunkTimers=new Map,this.memoryCheckInterval=null}startResourceMonitoring(){this.memoryCheckInterval=setInterval(()=>{let e=process.memoryUsage(),t=Math.round(e.heapUsed/1024/1024);t>Y.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},Y.resourceManagement.memoryCheckInterval)}stopResourceMonitoring(){this.memoryCheckInterval&&(clearInterval(this.memoryCheckInterval),this.memoryCheckInterval=null)}addClient(e,t){this.activeClients.set(e,{...t,lastActivity:Date.now()})}getClient(e){return this.activeClients.get(e)}updateClientActivity(e){let t=this.activeClients.get(e);t&&(t.lastActivity=Date.now())}cleanupInactiveClients(){let e=Date.now(),t=Y.resourceManagement.inactiveTimeout;for(let[n,i]of this.activeClients.entries())e-i.lastActivity>t&&(console.log(`\u{1F9F9} Cleaning inactive client: ${n}`),this.cleanupClientResources(n,i),this.activeClients.delete(n))}cleanupClientResources(e,t){try{t.isStreaming=!1,t?.streamingTimeout&&(clearTimeout(t.streamingTimeout),t.streamingTimeout=null),t?.screenInterval&&(clearInterval(t.screenInterval),t.screenInterval=null);let n=this.activeTimers.get(e);n&&(n.forEach(s=>clearTimeout(s)),this.activeTimers.delete(e));let i=this.chunkTimers.get(e);i&&(i.forEach(s=>clearTimeout(s)),this.chunkTimers.delete(e)),t?.tileManager&&(t.tileManager.clearMemory(),t.tileManager.cleanup(),t.tileManager.reset()),t?.protocol&&(t.protocol.close(),Cs(t.protocol))}catch(n){console.error(`Error cleaning up ${e}:`,n.message)}}getStreamingConfig(){return Y.streaming}getWebRTCConfig(){return Y.webrtc}removeClient(e){let t=this.activeClients.get(e);t&&(this.cleanupClientResources(e,t),this.activeClients.delete(e))}getChunkTimers(e){return this.chunkTimers.has(e)||this.chunkTimers.set(e,new Set),this.chunkTimers.get(e)}cleanupAll(){this.stopResourceMonitoring();for(let[e,t]of this.activeClients.entries())this.cleanupClientResources(e,t);this.activeClients.clear(),this.activeTimers.clear(),this.chunkTimers.clear()}}});var RS={};Jr(RS,{ScreenUpdateHelper:()=>Mh});var Mh,kS=Ce(()=>{lt();Mh=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,n,i=!1){if(!t||t.length===0)return;let s=Y.streaming.chunkSize,o=[];for(let c=0;c<t.length;c+=s)o.push(t.slice(c,c+s));let a=this.resourceManager.getChunkTimers(e.id);for(let c=0;c<o.length;c++){let u=o[c],p=c===o.length-1,f=setTimeout(()=>{a.delete(f),e.connected&&e.emit("tiles-data",{tiles:u,timestamp:n,forceRefresh:!1,userAction:i,chunkInfo:{chunkIndex:c,totalChunks:o.length,isLastChunk:p}})},c*Y.streaming.chunkDelay);a.add(f)}}}});var OS={};Jr(OS,{MouseHandler:()=>Ph});var Ph,MS=Ce(()=>{lt();Ph=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastMouseMove=0}setupMouseHandlers(e,t){let n=this.robot;e.on("mouse-move",t(i=>{let s=Date.now();if(!(s-this.lastMouseMove<Y.throttling.mouseThrottle)){this.lastMouseMove=s;try{let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Mouse move error:",o.message)}}})),e.on("mouse-click",t(async i=>{try{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),n.mouseClick(i.button||"left",i.double||!1),s.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse click error:",s.message)}})),e.on("mouse-press",t(async i=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),n.mouseToggle("down",i.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse press error:",s.message)}})),e.on("mouse-release",t(async i=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),n.mouseToggle("up",i.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse release error:",s.message)}})),e.on("scroll",t(async i=>{try{let{direction:s,amount:o=60,horizontal:a=!1}=i,c=this.resourceManager.getClient(e.id);if(!c)return;let u=0,p=0;a||s==="left"||s==="right"?u=s==="right"?o:-o:p=s==="down"?-o:o,n.scrollMouse(u,p),c.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Scroll error:",s.message)}})),e.on("mouse-drag-select",t(i=>{try{let{startX:s,startY:o,endX:a,endY:c}=i,u=n.getScreenSize(),p=Math.round(s/100*u.width),f=Math.round(o/100*u.height),m=Math.round(a/100*u.width),y=Math.round(c/100*u.height),_=Math.max(0,Math.min(u.width-1,p)),S=Math.max(0,Math.min(u.height-1,f)),A=Math.max(0,Math.min(u.width-1,m)),M=Math.max(0,Math.min(u.height-1,y));n.moveMouse(_,S),n.mouseToggle("down","left"),n.dragMouse(A,M),n.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Drag selection error:",s.message)}}))}}});var IS={};Jr(IS,{KeyboardHandler:()=>Ih});function rj(r){let e;r.type==="missionControl"?e='tell application "System Events" to key code 160':e=`tell application "System Events" to key code ${r.keyCode} using ${r.mods}`,(0,PS.execFile)("osascript",["-e",e],t=>{t&&console.error("osascript error:",t.message)})}var PS,Ih,NS=Ce(()=>{PS=require("child_process");lt();Ih=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastKeyPress=0,this.lastTypeText=0}setupKeyboardHandlers(e,t){let n=this.robot;e.on("key-press",t(i=>{let s=Date.now();if(!(s-this.lastKeyPress<Y.throttling.keyThrottle)){this.lastKeyPress=s;try{if(!i.key||typeof i.key!="string")return;let o=this.resourceManager.getClient(e.id),a=i.key,c=i.modifier||[];if(a.length===1)if(c.filter(p=>p!=="shift").length>0){n.keyTap(a.toLowerCase(),c);for(let p of c)n.keyToggle(p,"up")}else n.typeString(a);else{let p={return:"enter"}[a.toLowerCase()]??a.toLowerCase();n.keyTap(p,c)}o&&(o.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Key press error:",o.message)}}})),e.on("desktop-switch",t(i=>{try{let s=i?.direction,o=Y.desktopSwitch[process.platform]?.[s];if(!o)return;process.platform==="darwin"?rj(o):n.keyTap(o[0],o[1]);let a=this.resourceManager.getClient(e.id);a&&(a.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Desktop switch error:",s.message)}})),e.on("type-text",t(i=>{let s=Date.now();if(!(s-this.lastTypeText<Y.throttling.typeTextThrottle)){this.lastTypeText=s;try{if(!i.text||typeof i.text!="string")return;let o=i.text;o.length>Y.throttling.maxTextLength&&(o=o.substring(0,Y.throttling.maxTextLength));let a=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),c=this.resourceManager.getClient(e.id);setTimeout(()=>{try{n.typeString(a),this.resourceManager.updateClientActivity(e.id),c&&(c.idleFrameCount=0,c.tileManager&&c.tileManager.clearScreenCache())}catch(u){console.error("Robot typeString error:",u.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var Wh=O((uE,qh)=>{(function(r,e){"use strict";function t(T,l){if(!T)throw new Error(l||"Assertion failed")}function n(T,l){T.super_=l;var h=function(){};h.prototype=l.prototype,T.prototype=new h,T.prototype.constructor=T}function i(T,l,h){if(i.isBN(T))return T;this.negative=0,this.words=null,this.length=0,this.red=null,T!==null&&((l==="le"||l==="be")&&(h=l,l=10),this._init(T||0,l||10,h||"be"))}typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=require("buffer").Buffer}catch{}i.isBN=function(l){return l instanceof i?!0:l!==null&&typeof l=="object"&&l.constructor.wordSize===i.wordSize&&Array.isArray(l.words)},i.max=function(l,h){return l.cmp(h)>0?l:h},i.min=function(l,h){return l.cmp(h)<0?l:h},i.prototype._init=function(l,h,x){if(typeof l=="number")return this._initNumber(l,h,x);if(typeof l=="object")return this._initArray(l,h,x);h==="hex"&&(h=16),t(h===(h|0)&&h>=2&&h<=36),l=l.toString().replace(/\s+/g,"");var w=0;l[0]==="-"&&(w++,this.negative=1),w<l.length&&(h===16?this._parseHex(l,w,x):(this._parseBase(l,h,w),x==="le"&&this._initArray(this.toArray(),h,x)))},i.prototype._initNumber=function(l,h,x){l<0&&(this.negative=1,l=-l),l<67108864?(this.words=[l&67108863],this.length=1):l<4503599627370496?(this.words=[l&67108863,l/67108864&67108863],this.length=2):(t(l<9007199254740992),this.words=[l&67108863,l/67108864&67108863,1],this.length=3),x==="le"&&this._initArray(this.toArray(),h,x)},i.prototype._initArray=function(l,h,x){if(t(typeof l.length=="number"),l.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(l.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var g,v,C=0;if(x==="be")for(w=l.length-1,g=0;w>=0;w-=3)v=l[w]|l[w-1]<<8|l[w-2]<<16,this.words[g]|=v<<C&67108863,this.words[g+1]=v>>>26-C&67108863,C+=24,C>=26&&(C-=26,g++);else if(x==="le")for(w=0,g=0;w<l.length;w+=3)v=l[w]|l[w+1]<<8|l[w+2]<<16,this.words[g]|=v<<C&67108863,this.words[g+1]=v>>>26-C&67108863,C+=24,C>=26&&(C-=26,g++);return this.strip()};function o(T,l){var h=T.charCodeAt(l);return h>=65&&h<=70?h-55:h>=97&&h<=102?h-87:h-48&15}function a(T,l,h){var x=o(T,h);return h-1>=l&&(x|=o(T,h-1)<<4),x}i.prototype._parseHex=function(l,h,x){this.length=Math.ceil((l.length-h)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var g=0,v=0,C;if(x==="be")for(w=l.length-1;w>=h;w-=2)C=a(l,h,w)<<g,this.words[v]|=C&67108863,g>=18?(g-=18,v+=1,this.words[v]|=C>>>26):g+=8;else{var b=l.length-h;for(w=b%2===0?h+1:h;w<l.length;w+=2)C=a(l,h,w)<<g,this.words[v]|=C&67108863,g>=18?(g-=18,v+=1,this.words[v]|=C>>>26):g+=8}this.strip()};function c(T,l,h,x){for(var w=0,g=Math.min(T.length,h),v=l;v<g;v++){var C=T.charCodeAt(v)-48;w*=x,C>=49?w+=C-49+10:C>=17?w+=C-17+10:w+=C}return w}i.prototype._parseBase=function(l,h,x){this.words=[0],this.length=1;for(var w=0,g=1;g<=67108863;g*=h)w++;w--,g=g/h|0;for(var v=l.length-x,C=v%w,b=Math.min(v,v-C)+x,d=0,E=x;E<b;E+=w)d=c(l,E,E+w,h),this.imuln(g),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(C!==0){var U=1;for(d=c(l,E,l.length,h),E=0;E<C;E++)U*=h;this.imuln(U),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this.strip()},i.prototype.copy=function(l){l.words=new Array(this.length);for(var h=0;h<this.length;h++)l.words[h]=this.words[h];l.length=this.length,l.negative=this.negative,l.red=this.red},i.prototype.clone=function(){var l=new i(null);return this.copy(l),l},i.prototype._expand=function(l){for(;this.length<l;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(l,h){l=l||10,h=h|0||1;var x;if(l===16||l==="hex"){x="";for(var w=0,g=0,v=0;v<this.length;v++){var C=this.words[v],b=((C<<w|g)&16777215).toString(16);g=C>>>24-w&16777215,w+=2,w>=26&&(w-=26,v--),g!==0||v!==this.length-1?x=u[6-b.length]+b+x:x=b+x}for(g!==0&&(x=g.toString(16)+x);x.length%h!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(l===(l|0)&&l>=2&&l<=36){var d=p[l],E=f[l];x="";var U=this.clone();for(U.negative=0;!U.isZero();){var I=U.modn(E).toString(l);U=U.idivn(E),U.isZero()?x=I+x:x=u[d-I.length]+I+x}for(this.isZero()&&(x="0"+x);x.length%h!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}t(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var l=this.words[0];return this.length===2?l+=this.words[1]*67108864:this.length===3&&this.words[2]===1?l+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(l,h){return t(typeof s<"u"),this.toArrayLike(s,l,h)},i.prototype.toArray=function(l,h){return this.toArrayLike(Array,l,h)},i.prototype.toArrayLike=function(l,h,x){var w=this.byteLength(),g=x||Math.max(1,w);t(w<=g,"byte array longer than desired length"),t(g>0,"Requested array length <= 0"),this.strip();var v=h==="le",C=new l(g),b,d,E=this.clone();if(v){for(d=0;!E.isZero();d++)b=E.andln(255),E.iushrn(8),C[d]=b;for(;d<g;d++)C[d]=0}else{for(d=0;d<g-w;d++)C[d]=0;for(d=0;!E.isZero();d++)b=E.andln(255),E.iushrn(8),C[g-d-1]=b}return C},Math.clz32?i.prototype._countBits=function(l){return 32-Math.clz32(l)}:i.prototype._countBits=function(l){var h=l,x=0;return h>=4096&&(x+=13,h>>>=13),h>=64&&(x+=7,h>>>=7),h>=8&&(x+=4,h>>>=4),h>=2&&(x+=2,h>>>=2),x+h},i.prototype._zeroBits=function(l){if(l===0)return 26;var h=l,x=0;return(h&8191)===0&&(x+=13,h>>>=13),(h&127)===0&&(x+=7,h>>>=7),(h&15)===0&&(x+=4,h>>>=4),(h&3)===0&&(x+=2,h>>>=2),(h&1)===0&&x++,x},i.prototype.bitLength=function(){var l=this.words[this.length-1],h=this._countBits(l);return(this.length-1)*26+h};function m(T){for(var l=new Array(T.bitLength()),h=0;h<l.length;h++){var x=h/26|0,w=h%26;l[h]=(T.words[x]&1<<w)>>>w}return l}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var l=0,h=0;h<this.length;h++){var x=this._zeroBits(this.words[h]);if(l+=x,x!==26)break}return l},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(l){return this.negative!==0?this.abs().inotn(l).iaddn(1):this.clone()},i.prototype.fromTwos=function(l){return this.testn(l-1)?this.notn(l).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(l){for(;this.length<l.length;)this.words[this.length++]=0;for(var h=0;h<l.length;h++)this.words[h]=this.words[h]|l.words[h];return this.strip()},i.prototype.ior=function(l){return t((this.negative|l.negative)===0),this.iuor(l)},i.prototype.or=function(l){return this.length>l.length?this.clone().ior(l):l.clone().ior(this)},i.prototype.uor=function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},i.prototype.iuand=function(l){var h;this.length>l.length?h=l:h=this;for(var x=0;x<h.length;x++)this.words[x]=this.words[x]&l.words[x];return this.length=h.length,this.strip()},i.prototype.iand=function(l){return t((this.negative|l.negative)===0),this.iuand(l)},i.prototype.and=function(l){return this.length>l.length?this.clone().iand(l):l.clone().iand(this)},i.prototype.uand=function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},i.prototype.iuxor=function(l){var h,x;this.length>l.length?(h=this,x=l):(h=l,x=this);for(var w=0;w<x.length;w++)this.words[w]=h.words[w]^x.words[w];if(this!==h)for(;w<h.length;w++)this.words[w]=h.words[w];return this.length=h.length,this.strip()},i.prototype.ixor=function(l){return t((this.negative|l.negative)===0),this.iuxor(l)},i.prototype.xor=function(l){return this.length>l.length?this.clone().ixor(l):l.clone().ixor(this)},i.prototype.uxor=function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},i.prototype.inotn=function(l){t(typeof l=="number"&&l>=0);var h=Math.ceil(l/26)|0,x=l%26;this._expand(h),x>0&&h--;for(var w=0;w<h;w++)this.words[w]=~this.words[w]&67108863;return x>0&&(this.words[w]=~this.words[w]&67108863>>26-x),this.strip()},i.prototype.notn=function(l){return this.clone().inotn(l)},i.prototype.setn=function(l,h){t(typeof l=="number"&&l>=0);var x=l/26|0,w=l%26;return this._expand(x+1),h?this.words[x]=this.words[x]|1<<w:this.words[x]=this.words[x]&~(1<<w),this.strip()},i.prototype.iadd=function(l){var h;if(this.negative!==0&&l.negative===0)return this.negative=0,h=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,h=this.isub(l),l.negative=1,h._normSign();var x,w;this.length>l.length?(x=this,w=l):(x=l,w=this);for(var g=0,v=0;v<w.length;v++)h=(x.words[v]|0)+(w.words[v]|0)+g,this.words[v]=h&67108863,g=h>>>26;for(;g!==0&&v<x.length;v++)h=(x.words[v]|0)+g,this.words[v]=h&67108863,g=h>>>26;if(this.length=x.length,g!==0)this.words[this.length]=g,this.length++;else if(x!==this)for(;v<x.length;v++)this.words[v]=x.words[v];return this},i.prototype.add=function(l){var h;return l.negative!==0&&this.negative===0?(l.negative=0,h=this.sub(l),l.negative^=1,h):l.negative===0&&this.negative!==0?(this.negative=0,h=l.sub(this),this.negative=1,h):this.length>l.length?this.clone().iadd(l):l.clone().iadd(this)},i.prototype.isub=function(l){if(l.negative!==0){l.negative=0;var h=this.iadd(l);return l.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var x=this.cmp(l);if(x===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,g;x>0?(w=this,g=l):(w=l,g=this);for(var v=0,C=0;C<g.length;C++)h=(w.words[C]|0)-(g.words[C]|0)+v,v=h>>26,this.words[C]=h&67108863;for(;v!==0&&C<w.length;C++)h=(w.words[C]|0)+v,v=h>>26,this.words[C]=h&67108863;if(v===0&&C<w.length&&w!==this)for(;C<w.length;C++)this.words[C]=w.words[C];return this.length=Math.max(this.length,C),w!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(l){return this.clone().isub(l)};function y(T,l,h){h.negative=l.negative^T.negative;var x=T.length+l.length|0;h.length=x,x=x-1|0;var w=T.words[0]|0,g=l.words[0]|0,v=w*g,C=v&67108863,b=v/67108864|0;h.words[0]=C;for(var d=1;d<x;d++){for(var E=b>>>26,U=b&67108863,I=Math.min(d,l.length-1),D=Math.max(0,d-T.length+1);D<=I;D++){var H=d-D|0;w=T.words[H]|0,g=l.words[D]|0,v=w*g+U,E+=v/67108864|0,U=v&67108863}h.words[d]=U|0,b=E|0}return b!==0?h.words[d]=b|0:h.length--,h.strip()}var _=function(l,h,x){var w=l.words,g=h.words,v=x.words,C=0,b,d,E,U=w[0]|0,I=U&8191,D=U>>>13,H=w[1]|0,V=H&8191,B=H>>>13,me=w[2]|0,ie=me&8191,R=me>>>13,X=w[3]|0,k=X&8191,F=X>>>13,Q=w[4]|0,K=Q&8191,z=Q>>>13,ge=w[5]|0,re=ge&8191,Pe=ge>>>13,av=w[6]|0,Ie=av&8191,Ne=av>>>13,cv=w[7]|0,Le=cv&8191,De=cv>>>13,lv=w[8]|0,Be=lv&8191,je=lv>>>13,uv=w[9]|0,Fe=uv&8191,$e=uv>>>13,pv=g[0]|0,He=pv&8191,Ue=pv>>>13,fv=g[1]|0,qe=fv&8191,We=fv>>>13,dv=g[2]|0,Ge=dv&8191,ze=dv>>>13,hv=g[3]|0,Ve=hv&8191,Ke=hv>>>13,mv=g[4]|0,Ye=mv&8191,Xe=mv>>>13,gv=g[5]|0,Je=gv&8191,Qe=gv>>>13,vv=g[6]|0,Ze=vv&8191,et=vv>>>13,xv=g[7]|0,tt=xv&8191,rt=xv>>>13,yv=g[8]|0,nt=yv&8191,it=yv>>>13,_v=g[9]|0,st=_v&8191,ot=_v>>>13;x.negative=l.negative^h.negative,x.length=19,b=Math.imul(I,He),d=Math.imul(I,Ue),d=d+Math.imul(D,He)|0,E=Math.imul(D,Ue);var ap=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(ap>>>26)|0,ap&=67108863,b=Math.imul(V,He),d=Math.imul(V,Ue),d=d+Math.imul(B,He)|0,E=Math.imul(B,Ue),b=b+Math.imul(I,qe)|0,d=d+Math.imul(I,We)|0,d=d+Math.imul(D,qe)|0,E=E+Math.imul(D,We)|0;var cp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(cp>>>26)|0,cp&=67108863,b=Math.imul(ie,He),d=Math.imul(ie,Ue),d=d+Math.imul(R,He)|0,E=Math.imul(R,Ue),b=b+Math.imul(V,qe)|0,d=d+Math.imul(V,We)|0,d=d+Math.imul(B,qe)|0,E=E+Math.imul(B,We)|0,b=b+Math.imul(I,Ge)|0,d=d+Math.imul(I,ze)|0,d=d+Math.imul(D,Ge)|0,E=E+Math.imul(D,ze)|0;var lp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(lp>>>26)|0,lp&=67108863,b=Math.imul(k,He),d=Math.imul(k,Ue),d=d+Math.imul(F,He)|0,E=Math.imul(F,Ue),b=b+Math.imul(ie,qe)|0,d=d+Math.imul(ie,We)|0,d=d+Math.imul(R,qe)|0,E=E+Math.imul(R,We)|0,b=b+Math.imul(V,Ge)|0,d=d+Math.imul(V,ze)|0,d=d+Math.imul(B,Ge)|0,E=E+Math.imul(B,ze)|0,b=b+Math.imul(I,Ve)|0,d=d+Math.imul(I,Ke)|0,d=d+Math.imul(D,Ve)|0,E=E+Math.imul(D,Ke)|0;var up=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(up>>>26)|0,up&=67108863,b=Math.imul(K,He),d=Math.imul(K,Ue),d=d+Math.imul(z,He)|0,E=Math.imul(z,Ue),b=b+Math.imul(k,qe)|0,d=d+Math.imul(k,We)|0,d=d+Math.imul(F,qe)|0,E=E+Math.imul(F,We)|0,b=b+Math.imul(ie,Ge)|0,d=d+Math.imul(ie,ze)|0,d=d+Math.imul(R,Ge)|0,E=E+Math.imul(R,ze)|0,b=b+Math.imul(V,Ve)|0,d=d+Math.imul(V,Ke)|0,d=d+Math.imul(B,Ve)|0,E=E+Math.imul(B,Ke)|0,b=b+Math.imul(I,Ye)|0,d=d+Math.imul(I,Xe)|0,d=d+Math.imul(D,Ye)|0,E=E+Math.imul(D,Xe)|0;var pp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(pp>>>26)|0,pp&=67108863,b=Math.imul(re,He),d=Math.imul(re,Ue),d=d+Math.imul(Pe,He)|0,E=Math.imul(Pe,Ue),b=b+Math.imul(K,qe)|0,d=d+Math.imul(K,We)|0,d=d+Math.imul(z,qe)|0,E=E+Math.imul(z,We)|0,b=b+Math.imul(k,Ge)|0,d=d+Math.imul(k,ze)|0,d=d+Math.imul(F,Ge)|0,E=E+Math.imul(F,ze)|0,b=b+Math.imul(ie,Ve)|0,d=d+Math.imul(ie,Ke)|0,d=d+Math.imul(R,Ve)|0,E=E+Math.imul(R,Ke)|0,b=b+Math.imul(V,Ye)|0,d=d+Math.imul(V,Xe)|0,d=d+Math.imul(B,Ye)|0,E=E+Math.imul(B,Xe)|0,b=b+Math.imul(I,Je)|0,d=d+Math.imul(I,Qe)|0,d=d+Math.imul(D,Je)|0,E=E+Math.imul(D,Qe)|0;var fp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(fp>>>26)|0,fp&=67108863,b=Math.imul(Ie,He),d=Math.imul(Ie,Ue),d=d+Math.imul(Ne,He)|0,E=Math.imul(Ne,Ue),b=b+Math.imul(re,qe)|0,d=d+Math.imul(re,We)|0,d=d+Math.imul(Pe,qe)|0,E=E+Math.imul(Pe,We)|0,b=b+Math.imul(K,Ge)|0,d=d+Math.imul(K,ze)|0,d=d+Math.imul(z,Ge)|0,E=E+Math.imul(z,ze)|0,b=b+Math.imul(k,Ve)|0,d=d+Math.imul(k,Ke)|0,d=d+Math.imul(F,Ve)|0,E=E+Math.imul(F,Ke)|0,b=b+Math.imul(ie,Ye)|0,d=d+Math.imul(ie,Xe)|0,d=d+Math.imul(R,Ye)|0,E=E+Math.imul(R,Xe)|0,b=b+Math.imul(V,Je)|0,d=d+Math.imul(V,Qe)|0,d=d+Math.imul(B,Je)|0,E=E+Math.imul(B,Qe)|0,b=b+Math.imul(I,Ze)|0,d=d+Math.imul(I,et)|0,d=d+Math.imul(D,Ze)|0,E=E+Math.imul(D,et)|0;var dp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(dp>>>26)|0,dp&=67108863,b=Math.imul(Le,He),d=Math.imul(Le,Ue),d=d+Math.imul(De,He)|0,E=Math.imul(De,Ue),b=b+Math.imul(Ie,qe)|0,d=d+Math.imul(Ie,We)|0,d=d+Math.imul(Ne,qe)|0,E=E+Math.imul(Ne,We)|0,b=b+Math.imul(re,Ge)|0,d=d+Math.imul(re,ze)|0,d=d+Math.imul(Pe,Ge)|0,E=E+Math.imul(Pe,ze)|0,b=b+Math.imul(K,Ve)|0,d=d+Math.imul(K,Ke)|0,d=d+Math.imul(z,Ve)|0,E=E+Math.imul(z,Ke)|0,b=b+Math.imul(k,Ye)|0,d=d+Math.imul(k,Xe)|0,d=d+Math.imul(F,Ye)|0,E=E+Math.imul(F,Xe)|0,b=b+Math.imul(ie,Je)|0,d=d+Math.imul(ie,Qe)|0,d=d+Math.imul(R,Je)|0,E=E+Math.imul(R,Qe)|0,b=b+Math.imul(V,Ze)|0,d=d+Math.imul(V,et)|0,d=d+Math.imul(B,Ze)|0,E=E+Math.imul(B,et)|0,b=b+Math.imul(I,tt)|0,d=d+Math.imul(I,rt)|0,d=d+Math.imul(D,tt)|0,E=E+Math.imul(D,rt)|0;var hp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(hp>>>26)|0,hp&=67108863,b=Math.imul(Be,He),d=Math.imul(Be,Ue),d=d+Math.imul(je,He)|0,E=Math.imul(je,Ue),b=b+Math.imul(Le,qe)|0,d=d+Math.imul(Le,We)|0,d=d+Math.imul(De,qe)|0,E=E+Math.imul(De,We)|0,b=b+Math.imul(Ie,Ge)|0,d=d+Math.imul(Ie,ze)|0,d=d+Math.imul(Ne,Ge)|0,E=E+Math.imul(Ne,ze)|0,b=b+Math.imul(re,Ve)|0,d=d+Math.imul(re,Ke)|0,d=d+Math.imul(Pe,Ve)|0,E=E+Math.imul(Pe,Ke)|0,b=b+Math.imul(K,Ye)|0,d=d+Math.imul(K,Xe)|0,d=d+Math.imul(z,Ye)|0,E=E+Math.imul(z,Xe)|0,b=b+Math.imul(k,Je)|0,d=d+Math.imul(k,Qe)|0,d=d+Math.imul(F,Je)|0,E=E+Math.imul(F,Qe)|0,b=b+Math.imul(ie,Ze)|0,d=d+Math.imul(ie,et)|0,d=d+Math.imul(R,Ze)|0,E=E+Math.imul(R,et)|0,b=b+Math.imul(V,tt)|0,d=d+Math.imul(V,rt)|0,d=d+Math.imul(B,tt)|0,E=E+Math.imul(B,rt)|0,b=b+Math.imul(I,nt)|0,d=d+Math.imul(I,it)|0,d=d+Math.imul(D,nt)|0,E=E+Math.imul(D,it)|0;var mp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(mp>>>26)|0,mp&=67108863,b=Math.imul(Fe,He),d=Math.imul(Fe,Ue),d=d+Math.imul($e,He)|0,E=Math.imul($e,Ue),b=b+Math.imul(Be,qe)|0,d=d+Math.imul(Be,We)|0,d=d+Math.imul(je,qe)|0,E=E+Math.imul(je,We)|0,b=b+Math.imul(Le,Ge)|0,d=d+Math.imul(Le,ze)|0,d=d+Math.imul(De,Ge)|0,E=E+Math.imul(De,ze)|0,b=b+Math.imul(Ie,Ve)|0,d=d+Math.imul(Ie,Ke)|0,d=d+Math.imul(Ne,Ve)|0,E=E+Math.imul(Ne,Ke)|0,b=b+Math.imul(re,Ye)|0,d=d+Math.imul(re,Xe)|0,d=d+Math.imul(Pe,Ye)|0,E=E+Math.imul(Pe,Xe)|0,b=b+Math.imul(K,Je)|0,d=d+Math.imul(K,Qe)|0,d=d+Math.imul(z,Je)|0,E=E+Math.imul(z,Qe)|0,b=b+Math.imul(k,Ze)|0,d=d+Math.imul(k,et)|0,d=d+Math.imul(F,Ze)|0,E=E+Math.imul(F,et)|0,b=b+Math.imul(ie,tt)|0,d=d+Math.imul(ie,rt)|0,d=d+Math.imul(R,tt)|0,E=E+Math.imul(R,rt)|0,b=b+Math.imul(V,nt)|0,d=d+Math.imul(V,it)|0,d=d+Math.imul(B,nt)|0,E=E+Math.imul(B,it)|0,b=b+Math.imul(I,st)|0,d=d+Math.imul(I,ot)|0,d=d+Math.imul(D,st)|0,E=E+Math.imul(D,ot)|0;var gp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(gp>>>26)|0,gp&=67108863,b=Math.imul(Fe,qe),d=Math.imul(Fe,We),d=d+Math.imul($e,qe)|0,E=Math.imul($e,We),b=b+Math.imul(Be,Ge)|0,d=d+Math.imul(Be,ze)|0,d=d+Math.imul(je,Ge)|0,E=E+Math.imul(je,ze)|0,b=b+Math.imul(Le,Ve)|0,d=d+Math.imul(Le,Ke)|0,d=d+Math.imul(De,Ve)|0,E=E+Math.imul(De,Ke)|0,b=b+Math.imul(Ie,Ye)|0,d=d+Math.imul(Ie,Xe)|0,d=d+Math.imul(Ne,Ye)|0,E=E+Math.imul(Ne,Xe)|0,b=b+Math.imul(re,Je)|0,d=d+Math.imul(re,Qe)|0,d=d+Math.imul(Pe,Je)|0,E=E+Math.imul(Pe,Qe)|0,b=b+Math.imul(K,Ze)|0,d=d+Math.imul(K,et)|0,d=d+Math.imul(z,Ze)|0,E=E+Math.imul(z,et)|0,b=b+Math.imul(k,tt)|0,d=d+Math.imul(k,rt)|0,d=d+Math.imul(F,tt)|0,E=E+Math.imul(F,rt)|0,b=b+Math.imul(ie,nt)|0,d=d+Math.imul(ie,it)|0,d=d+Math.imul(R,nt)|0,E=E+Math.imul(R,it)|0,b=b+Math.imul(V,st)|0,d=d+Math.imul(V,ot)|0,d=d+Math.imul(B,st)|0,E=E+Math.imul(B,ot)|0;var vp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(vp>>>26)|0,vp&=67108863,b=Math.imul(Fe,Ge),d=Math.imul(Fe,ze),d=d+Math.imul($e,Ge)|0,E=Math.imul($e,ze),b=b+Math.imul(Be,Ve)|0,d=d+Math.imul(Be,Ke)|0,d=d+Math.imul(je,Ve)|0,E=E+Math.imul(je,Ke)|0,b=b+Math.imul(Le,Ye)|0,d=d+Math.imul(Le,Xe)|0,d=d+Math.imul(De,Ye)|0,E=E+Math.imul(De,Xe)|0,b=b+Math.imul(Ie,Je)|0,d=d+Math.imul(Ie,Qe)|0,d=d+Math.imul(Ne,Je)|0,E=E+Math.imul(Ne,Qe)|0,b=b+Math.imul(re,Ze)|0,d=d+Math.imul(re,et)|0,d=d+Math.imul(Pe,Ze)|0,E=E+Math.imul(Pe,et)|0,b=b+Math.imul(K,tt)|0,d=d+Math.imul(K,rt)|0,d=d+Math.imul(z,tt)|0,E=E+Math.imul(z,rt)|0,b=b+Math.imul(k,nt)|0,d=d+Math.imul(k,it)|0,d=d+Math.imul(F,nt)|0,E=E+Math.imul(F,it)|0,b=b+Math.imul(ie,st)|0,d=d+Math.imul(ie,ot)|0,d=d+Math.imul(R,st)|0,E=E+Math.imul(R,ot)|0;var xp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(xp>>>26)|0,xp&=67108863,b=Math.imul(Fe,Ve),d=Math.imul(Fe,Ke),d=d+Math.imul($e,Ve)|0,E=Math.imul($e,Ke),b=b+Math.imul(Be,Ye)|0,d=d+Math.imul(Be,Xe)|0,d=d+Math.imul(je,Ye)|0,E=E+Math.imul(je,Xe)|0,b=b+Math.imul(Le,Je)|0,d=d+Math.imul(Le,Qe)|0,d=d+Math.imul(De,Je)|0,E=E+Math.imul(De,Qe)|0,b=b+Math.imul(Ie,Ze)|0,d=d+Math.imul(Ie,et)|0,d=d+Math.imul(Ne,Ze)|0,E=E+Math.imul(Ne,et)|0,b=b+Math.imul(re,tt)|0,d=d+Math.imul(re,rt)|0,d=d+Math.imul(Pe,tt)|0,E=E+Math.imul(Pe,rt)|0,b=b+Math.imul(K,nt)|0,d=d+Math.imul(K,it)|0,d=d+Math.imul(z,nt)|0,E=E+Math.imul(z,it)|0,b=b+Math.imul(k,st)|0,d=d+Math.imul(k,ot)|0,d=d+Math.imul(F,st)|0,E=E+Math.imul(F,ot)|0;var yp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(yp>>>26)|0,yp&=67108863,b=Math.imul(Fe,Ye),d=Math.imul(Fe,Xe),d=d+Math.imul($e,Ye)|0,E=Math.imul($e,Xe),b=b+Math.imul(Be,Je)|0,d=d+Math.imul(Be,Qe)|0,d=d+Math.imul(je,Je)|0,E=E+Math.imul(je,Qe)|0,b=b+Math.imul(Le,Ze)|0,d=d+Math.imul(Le,et)|0,d=d+Math.imul(De,Ze)|0,E=E+Math.imul(De,et)|0,b=b+Math.imul(Ie,tt)|0,d=d+Math.imul(Ie,rt)|0,d=d+Math.imul(Ne,tt)|0,E=E+Math.imul(Ne,rt)|0,b=b+Math.imul(re,nt)|0,d=d+Math.imul(re,it)|0,d=d+Math.imul(Pe,nt)|0,E=E+Math.imul(Pe,it)|0,b=b+Math.imul(K,st)|0,d=d+Math.imul(K,ot)|0,d=d+Math.imul(z,st)|0,E=E+Math.imul(z,ot)|0;var _p=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(_p>>>26)|0,_p&=67108863,b=Math.imul(Fe,Je),d=Math.imul(Fe,Qe),d=d+Math.imul($e,Je)|0,E=Math.imul($e,Qe),b=b+Math.imul(Be,Ze)|0,d=d+Math.imul(Be,et)|0,d=d+Math.imul(je,Ze)|0,E=E+Math.imul(je,et)|0,b=b+Math.imul(Le,tt)|0,d=d+Math.imul(Le,rt)|0,d=d+Math.imul(De,tt)|0,E=E+Math.imul(De,rt)|0,b=b+Math.imul(Ie,nt)|0,d=d+Math.imul(Ie,it)|0,d=d+Math.imul(Ne,nt)|0,E=E+Math.imul(Ne,it)|0,b=b+Math.imul(re,st)|0,d=d+Math.imul(re,ot)|0,d=d+Math.imul(Pe,st)|0,E=E+Math.imul(Pe,ot)|0;var bp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(bp>>>26)|0,bp&=67108863,b=Math.imul(Fe,Ze),d=Math.imul(Fe,et),d=d+Math.imul($e,Ze)|0,E=Math.imul($e,et),b=b+Math.imul(Be,tt)|0,d=d+Math.imul(Be,rt)|0,d=d+Math.imul(je,tt)|0,E=E+Math.imul(je,rt)|0,b=b+Math.imul(Le,nt)|0,d=d+Math.imul(Le,it)|0,d=d+Math.imul(De,nt)|0,E=E+Math.imul(De,it)|0,b=b+Math.imul(Ie,st)|0,d=d+Math.imul(Ie,ot)|0,d=d+Math.imul(Ne,st)|0,E=E+Math.imul(Ne,ot)|0;var wp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(wp>>>26)|0,wp&=67108863,b=Math.imul(Fe,tt),d=Math.imul(Fe,rt),d=d+Math.imul($e,tt)|0,E=Math.imul($e,rt),b=b+Math.imul(Be,nt)|0,d=d+Math.imul(Be,it)|0,d=d+Math.imul(je,nt)|0,E=E+Math.imul(je,it)|0,b=b+Math.imul(Le,st)|0,d=d+Math.imul(Le,ot)|0,d=d+Math.imul(De,st)|0,E=E+Math.imul(De,ot)|0;var Sp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Sp>>>26)|0,Sp&=67108863,b=Math.imul(Fe,nt),d=Math.imul(Fe,it),d=d+Math.imul($e,nt)|0,E=Math.imul($e,it),b=b+Math.imul(Be,st)|0,d=d+Math.imul(Be,ot)|0,d=d+Math.imul(je,st)|0,E=E+Math.imul(je,ot)|0;var Ep=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Ep>>>26)|0,Ep&=67108863,b=Math.imul(Fe,st),d=Math.imul(Fe,ot),d=d+Math.imul($e,st)|0,E=Math.imul($e,ot);var Tp=(C+b|0)+((d&8191)<<13)|0;return C=(E+(d>>>13)|0)+(Tp>>>26)|0,Tp&=67108863,v[0]=ap,v[1]=cp,v[2]=lp,v[3]=up,v[4]=pp,v[5]=fp,v[6]=dp,v[7]=hp,v[8]=mp,v[9]=gp,v[10]=vp,v[11]=xp,v[12]=yp,v[13]=_p,v[14]=bp,v[15]=wp,v[16]=Sp,v[17]=Ep,v[18]=Tp,C!==0&&(v[19]=C,x.length++),x};Math.imul||(_=y);function S(T,l,h){h.negative=l.negative^T.negative,h.length=T.length+l.length;for(var x=0,w=0,g=0;g<h.length-1;g++){var v=w;w=0;for(var C=x&67108863,b=Math.min(g,l.length-1),d=Math.max(0,g-T.length+1);d<=b;d++){var E=g-d,U=T.words[E]|0,I=l.words[d]|0,D=U*I,H=D&67108863;v=v+(D/67108864|0)|0,H=H+C|0,C=H&67108863,v=v+(H>>>26)|0,w+=v>>>26,v&=67108863}h.words[g]=C,x=v,v=w}return x!==0?h.words[g]=x:h.length--,h.strip()}function A(T,l,h){var x=new M;return x.mulp(T,l,h)}i.prototype.mulTo=function(l,h){var x,w=this.length+l.length;return this.length===10&&l.length===10?x=_(this,l,h):w<63?x=y(this,l,h):w<1024?x=S(this,l,h):x=A(this,l,h),x};function M(T,l){this.x=T,this.y=l}M.prototype.makeRBT=function(l){for(var h=new Array(l),x=i.prototype._countBits(l)-1,w=0;w<l;w++)h[w]=this.revBin(w,x,l);return h},M.prototype.revBin=function(l,h,x){if(l===0||l===x-1)return l;for(var w=0,g=0;g<h;g++)w|=(l&1)<<h-g-1,l>>=1;return w},M.prototype.permute=function(l,h,x,w,g,v){for(var C=0;C<v;C++)w[C]=h[l[C]],g[C]=x[l[C]]},M.prototype.transform=function(l,h,x,w,g,v){this.permute(v,l,h,x,w,g);for(var C=1;C<g;C<<=1)for(var b=C<<1,d=Math.cos(2*Math.PI/b),E=Math.sin(2*Math.PI/b),U=0;U<g;U+=b)for(var I=d,D=E,H=0;H<C;H++){var V=x[U+H],B=w[U+H],me=x[U+H+C],ie=w[U+H+C],R=I*me-D*ie;ie=I*ie+D*me,me=R,x[U+H]=V+me,w[U+H]=B+ie,x[U+H+C]=V-me,w[U+H+C]=B-ie,H!==b&&(R=d*I-E*D,D=d*D+E*I,I=R)}},M.prototype.guessLen13b=function(l,h){var x=Math.max(h,l)|1,w=x&1,g=0;for(x=x/2|0;x;x=x>>>1)g++;return 1<<g+1+w},M.prototype.conjugate=function(l,h,x){if(!(x<=1))for(var w=0;w<x/2;w++){var g=l[w];l[w]=l[x-w-1],l[x-w-1]=g,g=h[w],h[w]=-h[x-w-1],h[x-w-1]=-g}},M.prototype.normalize13b=function(l,h){for(var x=0,w=0;w<h/2;w++){var g=Math.round(l[2*w+1]/h)*8192+Math.round(l[2*w]/h)+x;l[w]=g&67108863,g<67108864?x=0:x=g/67108864|0}return l},M.prototype.convert13b=function(l,h,x,w){for(var g=0,v=0;v<h;v++)g=g+(l[v]|0),x[2*v]=g&8191,g=g>>>13,x[2*v+1]=g&8191,g=g>>>13;for(v=2*h;v<w;++v)x[v]=0;t(g===0),t((g&-8192)===0)},M.prototype.stub=function(l){for(var h=new Array(l),x=0;x<l;x++)h[x]=0;return h},M.prototype.mulp=function(l,h,x){var w=2*this.guessLen13b(l.length,h.length),g=this.makeRBT(w),v=this.stub(w),C=new Array(w),b=new Array(w),d=new Array(w),E=new Array(w),U=new Array(w),I=new Array(w),D=x.words;D.length=w,this.convert13b(l.words,l.length,C,w),this.convert13b(h.words,h.length,E,w),this.transform(C,v,b,d,w,g),this.transform(E,v,U,I,w,g);for(var H=0;H<w;H++){var V=b[H]*U[H]-d[H]*I[H];d[H]=b[H]*I[H]+d[H]*U[H],b[H]=V}return this.conjugate(b,d,w),this.transform(b,d,D,v,w,g),this.conjugate(D,v,w),this.normalize13b(D,w),x.negative=l.negative^h.negative,x.length=l.length+h.length,x.strip()},i.prototype.mul=function(l){var h=new i(null);return h.words=new Array(this.length+l.length),this.mulTo(l,h)},i.prototype.mulf=function(l){var h=new i(null);return h.words=new Array(this.length+l.length),A(this,l,h)},i.prototype.imul=function(l){return this.clone().mulTo(l,this)},i.prototype.imuln=function(l){t(typeof l=="number"),t(l<67108864);for(var h=0,x=0;x<this.length;x++){var w=(this.words[x]|0)*l,g=(w&67108863)+(h&67108863);h>>=26,h+=w/67108864|0,h+=g>>>26,this.words[x]=g&67108863}return h!==0&&(this.words[x]=h,this.length++),this.length=l===0?1:this.length,this},i.prototype.muln=function(l){return this.clone().imuln(l)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(l){var h=m(l);if(h.length===0)return new i(1);for(var x=this,w=0;w<h.length&&h[w]===0;w++,x=x.sqr());if(++w<h.length)for(var g=x.sqr();w<h.length;w++,g=g.sqr())h[w]!==0&&(x=x.mul(g));return x},i.prototype.iushln=function(l){t(typeof l=="number"&&l>=0);var h=l%26,x=(l-h)/26,w=67108863>>>26-h<<26-h,g;if(h!==0){var v=0;for(g=0;g<this.length;g++){var C=this.words[g]&w,b=(this.words[g]|0)-C<<h;this.words[g]=b|v,v=C>>>26-h}v&&(this.words[g]=v,this.length++)}if(x!==0){for(g=this.length-1;g>=0;g--)this.words[g+x]=this.words[g];for(g=0;g<x;g++)this.words[g]=0;this.length+=x}return this.strip()},i.prototype.ishln=function(l){return t(this.negative===0),this.iushln(l)},i.prototype.iushrn=function(l,h,x){t(typeof l=="number"&&l>=0);var w;h?w=(h-h%26)/26:w=0;var g=l%26,v=Math.min((l-g)/26,this.length),C=67108863^67108863>>>g<<g,b=x;if(w-=v,w=Math.max(0,w),b){for(var d=0;d<v;d++)b.words[d]=this.words[d];b.length=v}if(v!==0)if(this.length>v)for(this.length-=v,d=0;d<this.length;d++)this.words[d]=this.words[d+v];else this.words[0]=0,this.length=1;var E=0;for(d=this.length-1;d>=0&&(E!==0||d>=w);d--){var U=this.words[d]|0;this.words[d]=E<<26-g|U>>>g,E=U&C}return b&&E!==0&&(b.words[b.length++]=E),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(l,h,x){return t(this.negative===0),this.iushrn(l,h,x)},i.prototype.shln=function(l){return this.clone().ishln(l)},i.prototype.ushln=function(l){return this.clone().iushln(l)},i.prototype.shrn=function(l){return this.clone().ishrn(l)},i.prototype.ushrn=function(l){return this.clone().iushrn(l)},i.prototype.testn=function(l){t(typeof l=="number"&&l>=0);var h=l%26,x=(l-h)/26,w=1<<h;if(this.length<=x)return!1;var g=this.words[x];return!!(g&w)},i.prototype.imaskn=function(l){t(typeof l=="number"&&l>=0);var h=l%26,x=(l-h)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(h!==0&&x++,this.length=Math.min(x,this.length),h!==0){var w=67108863^67108863>>>h<<h;this.words[this.length-1]&=w}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.maskn=function(l){return this.clone().imaskn(l)},i.prototype.iaddn=function(l){return t(typeof l=="number"),t(l<67108864),l<0?this.isubn(-l):this.negative!==0?this.length===1&&(this.words[0]|0)<l?(this.words[0]=l-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(l),this.negative=1,this):this._iaddn(l)},i.prototype._iaddn=function(l){this.words[0]+=l;for(var h=0;h<this.length&&this.words[h]>=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},i.prototype.isubn=function(l){if(t(typeof l=="number"),t(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h<this.length&&this.words[h]<0;h++)this.words[h]+=67108864,this.words[h+1]-=1;return this.strip()},i.prototype.addn=function(l){return this.clone().iaddn(l)},i.prototype.subn=function(l){return this.clone().isubn(l)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(l,h,x){var w=l.length+x,g;this._expand(w);var v,C=0;for(g=0;g<l.length;g++){v=(this.words[g+x]|0)+C;var b=(l.words[g]|0)*h;v-=b&67108863,C=(v>>26)-(b/67108864|0),this.words[g+x]=v&67108863}for(;g<this.length-x;g++)v=(this.words[g+x]|0)+C,C=v>>26,this.words[g+x]=v&67108863;if(C===0)return this.strip();for(t(C===-1),C=0,g=0;g<this.length;g++)v=-(this.words[g]|0)+C,C=v>>26,this.words[g]=v&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(l,h){var x=this.length-l.length,w=this.clone(),g=l,v=g.words[g.length-1]|0,C=this._countBits(v);x=26-C,x!==0&&(g=g.ushln(x),w.iushln(x),v=g.words[g.length-1]|0);var b=w.length-g.length,d;if(h!=="mod"){d=new i(null),d.length=b+1,d.words=new Array(d.length);for(var E=0;E<d.length;E++)d.words[E]=0}var U=w.clone()._ishlnsubmul(g,1,b);U.negative===0&&(w=U,d&&(d.words[b]=1));for(var I=b-1;I>=0;I--){var D=(w.words[g.length+I]|0)*67108864+(w.words[g.length+I-1]|0);for(D=Math.min(D/v|0,67108863),w._ishlnsubmul(g,D,I);w.negative!==0;)D--,w.negative=0,w._ishlnsubmul(g,1,I),w.isZero()||(w.negative^=1);d&&(d.words[I]=D)}return d&&d.strip(),w.strip(),h!=="div"&&x!==0&&w.iushrn(x),{div:d||null,mod:w}},i.prototype.divmod=function(l,h,x){if(t(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var w,g,v;return this.negative!==0&&l.negative===0?(v=this.neg().divmod(l,h),h!=="mod"&&(w=v.div.neg()),h!=="div"&&(g=v.mod.neg(),x&&g.negative!==0&&g.iadd(l)),{div:w,mod:g}):this.negative===0&&l.negative!==0?(v=this.divmod(l.neg(),h),h!=="mod"&&(w=v.div.neg()),{div:w,mod:v.mod}):(this.negative&l.negative)!==0?(v=this.neg().divmod(l.neg(),h),h!=="div"&&(g=v.mod.neg(),x&&g.negative!==0&&g.isub(l)),{div:v.div,mod:g}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?h==="div"?{div:this.divn(l.words[0]),mod:null}:h==="mod"?{div:null,mod:new i(this.modn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new i(this.modn(l.words[0]))}:this._wordDiv(l,h)},i.prototype.div=function(l){return this.divmod(l,"div",!1).div},i.prototype.mod=function(l){return this.divmod(l,"mod",!1).mod},i.prototype.umod=function(l){return this.divmod(l,"mod",!0).mod},i.prototype.divRound=function(l){var h=this.divmod(l);if(h.mod.isZero())return h.div;var x=h.div.negative!==0?h.mod.isub(l):h.mod,w=l.ushrn(1),g=l.andln(1),v=x.cmp(w);return v<0||g===1&&v===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},i.prototype.modn=function(l){t(l<=67108863);for(var h=(1<<26)%l,x=0,w=this.length-1;w>=0;w--)x=(h*x+(this.words[w]|0))%l;return x},i.prototype.idivn=function(l){t(l<=67108863);for(var h=0,x=this.length-1;x>=0;x--){var w=(this.words[x]|0)+h*67108864;this.words[x]=w/l|0,h=w%l}return this.strip()},i.prototype.divn=function(l){return this.clone().idivn(l)},i.prototype.egcd=function(l){t(l.negative===0),t(!l.isZero());var h=this,x=l.clone();h.negative!==0?h=h.umod(l):h=h.clone();for(var w=new i(1),g=new i(0),v=new i(0),C=new i(1),b=0;h.isEven()&&x.isEven();)h.iushrn(1),x.iushrn(1),++b;for(var d=x.clone(),E=h.clone();!h.isZero();){for(var U=0,I=1;(h.words[0]&I)===0&&U<26;++U,I<<=1);if(U>0)for(h.iushrn(U);U-- >0;)(w.isOdd()||g.isOdd())&&(w.iadd(d),g.isub(E)),w.iushrn(1),g.iushrn(1);for(var D=0,H=1;(x.words[0]&H)===0&&D<26;++D,H<<=1);if(D>0)for(x.iushrn(D);D-- >0;)(v.isOdd()||C.isOdd())&&(v.iadd(d),C.isub(E)),v.iushrn(1),C.iushrn(1);h.cmp(x)>=0?(h.isub(x),w.isub(v),g.isub(C)):(x.isub(h),v.isub(w),C.isub(g))}return{a:v,b:C,gcd:x.iushln(b)}},i.prototype._invmp=function(l){t(l.negative===0),t(!l.isZero());var h=this,x=l.clone();h.negative!==0?h=h.umod(l):h=h.clone();for(var w=new i(1),g=new i(0),v=x.clone();h.cmpn(1)>0&&x.cmpn(1)>0;){for(var C=0,b=1;(h.words[0]&b)===0&&C<26;++C,b<<=1);if(C>0)for(h.iushrn(C);C-- >0;)w.isOdd()&&w.iadd(v),w.iushrn(1);for(var d=0,E=1;(x.words[0]&E)===0&&d<26;++d,E<<=1);if(d>0)for(x.iushrn(d);d-- >0;)g.isOdd()&&g.iadd(v),g.iushrn(1);h.cmp(x)>=0?(h.isub(x),w.isub(g)):(x.isub(h),g.isub(w))}var U;return h.cmpn(1)===0?U=w:U=g,U.cmpn(0)<0&&U.iadd(l),U},i.prototype.gcd=function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var h=this.clone(),x=l.clone();h.negative=0,x.negative=0;for(var w=0;h.isEven()&&x.isEven();w++)h.iushrn(1),x.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;x.isEven();)x.iushrn(1);var g=h.cmp(x);if(g<0){var v=h;h=x,x=v}else if(g===0||x.cmpn(1)===0)break;h.isub(x)}while(!0);return x.iushln(w)},i.prototype.invm=function(l){return this.egcd(l).a.umod(l)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(l){return this.words[0]&l},i.prototype.bincn=function(l){t(typeof l=="number");var h=l%26,x=(l-h)/26,w=1<<h;if(this.length<=x)return this._expand(x+1),this.words[x]|=w,this;for(var g=w,v=x;g!==0&&v<this.length;v++){var C=this.words[v]|0;C+=g,g=C>>>26,C&=67108863,this.words[v]=C}return g!==0&&(this.words[v]=g,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(l){var h=l<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this.strip();var x;if(this.length>1)x=1;else{h&&(l=-l),t(l<=67108863,"Number is too big");var w=this.words[0]|0;x=w===l?0:w<l?-1:1}return this.negative!==0?-x|0:x},i.prototype.cmp=function(l){if(this.negative!==0&&l.negative===0)return-1;if(this.negative===0&&l.negative!==0)return 1;var h=this.ucmp(l);return this.negative!==0?-h|0:h},i.prototype.ucmp=function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var h=0,x=this.length-1;x>=0;x--){var w=this.words[x]|0,g=l.words[x]|0;if(w!==g){w<g?h=-1:w>g&&(h=1);break}}return h},i.prototype.gtn=function(l){return this.cmpn(l)===1},i.prototype.gt=function(l){return this.cmp(l)===1},i.prototype.gten=function(l){return this.cmpn(l)>=0},i.prototype.gte=function(l){return this.cmp(l)>=0},i.prototype.ltn=function(l){return this.cmpn(l)===-1},i.prototype.lt=function(l){return this.cmp(l)===-1},i.prototype.lten=function(l){return this.cmpn(l)<=0},i.prototype.lte=function(l){return this.cmp(l)<=0},i.prototype.eqn=function(l){return this.cmpn(l)===0},i.prototype.eq=function(l){return this.cmp(l)===0},i.red=function(l){return new P(l)},i.prototype.toRed=function(l){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},i.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(l){return this.red=l,this},i.prototype.forceRed=function(l){return t(!this.red,"Already a number in reduction context"),this._forceRed(l)},i.prototype.redAdd=function(l){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},i.prototype.redIAdd=function(l){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},i.prototype.redSub=function(l){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},i.prototype.redISub=function(l){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},i.prototype.redShl=function(l){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},i.prototype.redMul=function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},i.prototype.redIMul=function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},i.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(l){return t(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)};var L={k256:null,p224:null,p192:null,p25519:null};function N(T,l){this.name=T,this.p=new i(l,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}N.prototype._tmp=function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},N.prototype.ireduce=function(l){var h=l,x;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),x=h.bitLength();while(x>this.n);var w=x<this.n?-1:h.ucmp(this.p);return w===0?(h.words[0]=0,h.length=1):w>0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},N.prototype.split=function(l,h){l.iushrn(this.n,0,h)},N.prototype.imulK=function(l){return l.imul(this.k)};function j(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(j,N),j.prototype.split=function(l,h){for(var x=4194303,w=Math.min(l.length,9),g=0;g<w;g++)h.words[g]=l.words[g];if(h.length=w,l.length<=9){l.words[0]=0,l.length=1;return}var v=l.words[9];for(h.words[h.length++]=v&x,g=10;g<l.length;g++){var C=l.words[g]|0;l.words[g-10]=(C&x)<<4|v>>>22,v=C}v>>>=22,l.words[g-10]=v,v===0&&l.length>10?l.length-=10:l.length-=9},j.prototype.imulK=function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var h=0,x=0;x<l.length;x++){var w=l.words[x]|0;h+=w*977,l.words[x]=h&67108863,h=w*64+(h/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l};function W(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(W,N);function q(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(q,N);function G(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(G,N),G.prototype.imulK=function(l){for(var h=0,x=0;x<l.length;x++){var w=(l.words[x]|0)*19+h,g=w&67108863;w>>>=26,l.words[x]=g,h=w}return h!==0&&(l.words[l.length++]=h),l},i._prime=function(l){if(L[l])return L[l];var h;if(l==="k256")h=new j;else if(l==="p224")h=new W;else if(l==="p192")h=new q;else if(l==="p25519")h=new G;else throw new Error("Unknown prime "+l);return L[l]=h,h};function P(T){if(typeof T=="string"){var l=i._prime(T);this.m=l.p,this.prime=l}else t(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}P.prototype._verify1=function(l){t(l.negative===0,"red works only with positives"),t(l.red,"red works only with red numbers")},P.prototype._verify2=function(l,h){t((l.negative|h.negative)===0,"red works only with positives"),t(l.red&&l.red===h.red,"red works only with red numbers")},P.prototype.imod=function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):l.umod(this.m)._forceRed(this)},P.prototype.neg=function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},P.prototype.add=function(l,h){this._verify2(l,h);var x=l.add(h);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},P.prototype.iadd=function(l,h){this._verify2(l,h);var x=l.iadd(h);return x.cmp(this.m)>=0&&x.isub(this.m),x},P.prototype.sub=function(l,h){this._verify2(l,h);var x=l.sub(h);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},P.prototype.isub=function(l,h){this._verify2(l,h);var x=l.isub(h);return x.cmpn(0)<0&&x.iadd(this.m),x},P.prototype.shl=function(l,h){return this._verify1(l),this.imod(l.ushln(h))},P.prototype.imul=function(l,h){return this._verify2(l,h),this.imod(l.imul(h))},P.prototype.mul=function(l,h){return this._verify2(l,h),this.imod(l.mul(h))},P.prototype.isqr=function(l){return this.imul(l,l.clone())},P.prototype.sqr=function(l){return this.mul(l,l)},P.prototype.sqrt=function(l){if(l.isZero())return l.clone();var h=this.m.andln(3);if(t(h%2===1),h===3){var x=this.m.add(new i(1)).iushrn(2);return this.pow(l,x)}for(var w=this.m.subn(1),g=0;!w.isZero()&&w.andln(1)===0;)g++,w.iushrn(1);t(!w.isZero());var v=new i(1).toRed(this),C=v.redNeg(),b=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new i(2*d*d).toRed(this);this.pow(d,b).cmp(C)!==0;)d.redIAdd(C);for(var E=this.pow(d,w),U=this.pow(l,w.addn(1).iushrn(1)),I=this.pow(l,w),D=g;I.cmp(v)!==0;){for(var H=I,V=0;H.cmp(v)!==0;V++)H=H.redSqr();t(V<D);var B=this.pow(E,new i(1).iushln(D-V-1));U=U.redMul(B),E=B.redSqr(),I=I.redMul(E),D=V}return U},P.prototype.invm=function(l){var h=l._invmp(this.m);return h.negative!==0?(h.negative=0,this.imod(h).redNeg()):this.imod(h)},P.prototype.pow=function(l,h){if(h.isZero())return new i(1).toRed(this);if(h.cmpn(1)===0)return l.clone();var x=4,w=new Array(1<<x);w[0]=new i(1).toRed(this),w[1]=l;for(var g=2;g<w.length;g++)w[g]=this.mul(w[g-1],l);var v=w[0],C=0,b=0,d=h.bitLength()%26;for(d===0&&(d=26),g=h.length-1;g>=0;g--){for(var E=h.words[g],U=d-1;U>=0;U--){var I=E>>U&1;if(v!==w[0]&&(v=this.sqr(v)),I===0&&C===0){b=0;continue}C<<=1,C|=I,b++,!(b!==x&&(g!==0||U!==0))&&(v=this.mul(v,w[C]),b=0,C=0)}d=26}return v},P.prototype.convertTo=function(l){var h=l.umod(this.m);return h===l?h.clone():h},P.prototype.convertFrom=function(l){var h=l.clone();return h.red=null,h},i.mont=function(l){return new $(l)};function $(T){P.call(this,T),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n($,P),$.prototype.convertTo=function(l){return this.imod(l.ushln(this.shift))},$.prototype.convertFrom=function(l){var h=this.imod(l.mul(this.rinv));return h.red=null,h},$.prototype.imul=function(l,h){if(l.isZero()||h.isZero())return l.words[0]=0,l.length=1,l;var x=l.imul(h),w=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=x.isub(w).iushrn(this.shift),v=g;return g.cmp(this.m)>=0?v=g.isub(this.m):g.cmpn(0)<0&&(v=g.iadd(this.m)),v._forceRed(this)},$.prototype.mul=function(l,h){if(l.isZero()||h.isZero())return new i(0)._forceRed(this);var x=l.mul(h),w=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=x.isub(w).iushrn(this.shift),v=g;return g.cmp(this.m)>=0?v=g.isub(this.m):g.cmpn(0)<0&&(v=g.iadd(this.m)),v._forceRed(this)},$.prototype.invm=function(l){var h=this.imod(l._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(typeof qh>"u"||qh,uE)});var pE=O((PG,Gh)=>{typeof Object.create=="function"?Gh.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Gh.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}});var Gn=O((IG,Vh)=>{try{if(zh=require("util"),typeof zh.inherits!="function")throw"";Vh.exports=zh.inherits}catch{Vh.exports=pE()}var zh});var Xl=O((NG,fE)=>{"use strict";var Yl=require("buffer"),Ms=Yl.Buffer,ur={},pr;for(pr in Yl)Yl.hasOwnProperty(pr)&&(pr==="SlowBuffer"||pr==="Buffer"||(ur[pr]=Yl[pr]));var Ps=ur.Buffer={};for(pr in Ms)Ms.hasOwnProperty(pr)&&(pr==="allocUnsafe"||pr==="allocUnsafeSlow"||(Ps[pr]=Ms[pr]));ur.Buffer.prototype=Ms.prototype;(!Ps.from||Ps.from===Uint8Array.from)&&(Ps.from=function(r,e,t){if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof r);if(r&&typeof r.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);return Ms(r,e,t)});Ps.alloc||(Ps.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof r);if(r<0||r>=2*(1<<30))throw new RangeError('The value "'+r+'" is invalid for option "size"');var n=Ms(r);return!e||e.length===0?n.fill(0):typeof t=="string"?n.fill(e,t):n.fill(e),n});if(!ur.kStringMaxLength)try{ur.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}ur.constants||(ur.constants={MAX_LENGTH:ur.kMaxLength},ur.kStringMaxLength&&(ur.constants.MAX_STRING_LENGTH=ur.kStringMaxLength));fE.exports=ur});var Jl=O(dE=>{"use strict";var uj=Gn();function fr(r){this._reporterState={obj:null,path:[],options:r||{},errors:[]}}dE.Reporter=fr;fr.prototype.isError=function(e){return e instanceof Is};fr.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};fr.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};fr.prototype.enterKey=function(e){return this._reporterState.path.push(e)};fr.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};fr.prototype.leaveKey=function(e,t,n){let i=this._reporterState;this.exitKey(e),i.obj!==null&&(i.obj[t]=n)};fr.prototype.path=function(){return this._reporterState.path.join("/")};fr.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};fr.prototype.leaveObject=function(e){let t=this._reporterState,n=t.obj;return t.obj=e,n};fr.prototype.error=function(e){let t,n=this._reporterState,i=e instanceof Is;if(i?t=e:t=new Is(n.path.map(function(s){return"["+JSON.stringify(s)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw t;return i||n.errors.push(t),t};fr.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function Is(r,e){this.path=r,this.rethrow(e)}uj(Is,Error);Is.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Is),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var Ds=O(Kh=>{"use strict";var pj=Gn(),Ql=Jl().Reporter,Ns=Xl().Buffer;function dr(r,e){if(Ql.call(this,e),!Ns.isBuffer(r)){this.error("Input not Buffer");return}this.base=r,this.offset=0,this.length=r.length}pj(dr,Ql);Kh.DecoderBuffer=dr;dr.isDecoderBuffer=function(e){return e instanceof dr?!0:typeof e=="object"&&Ns.isBuffer(e.base)&&e.constructor.name==="DecoderBuffer"&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.save=="function"&&typeof e.restore=="function"&&typeof e.isEmpty=="function"&&typeof e.readUInt8=="function"&&typeof e.skip=="function"&&typeof e.raw=="function"};dr.prototype.save=function(){return{offset:this.offset,reporter:Ql.prototype.save.call(this)}};dr.prototype.restore=function(e){let t=new dr(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,Ql.prototype.restore.call(this,e.reporter),t};dr.prototype.isEmpty=function(){return this.offset===this.length};dr.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};dr.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");let n=new dr(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};dr.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function Ls(r,e){if(Array.isArray(r))this.length=0,this.value=r.map(function(t){return Ls.isEncoderBuffer(t)||(t=new Ls(t,e)),this.length+=t.length,t},this);else if(typeof r=="number"){if(!(0<=r&&r<=255))return e.error("non-byte EncoderBuffer value");this.value=r,this.length=1}else if(typeof r=="string")this.value=r,this.length=Ns.byteLength(r);else if(Ns.isBuffer(r))this.value=r,this.length=r.length;else return e.error("Unsupported type: "+typeof r)}Kh.EncoderBuffer=Ls;Ls.isEncoderBuffer=function(e){return e instanceof Ls?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};Ls.prototype.join=function(e,t){return e||(e=Ns.alloc(this.length)),t||(t=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(n){n.join(e,t),t+=n.length}):(typeof this.value=="number"?e[t]=this.value:typeof this.value=="string"?e.write(this.value,t):Ns.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var gE=O((BG,mE)=>{mE.exports=hE;function hE(r,e){if(!r)throw new Error(e||"Assertion failed")}hE.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}});var Zl=O((jG,xE)=>{"use strict";var fj=Jl().Reporter,dj=Ds().EncoderBuffer,hj=Ds().DecoderBuffer,Mt=gE(),vE=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],mj=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(vE),gj=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function de(r,e,t){let n={};this._baseState=n,n.name=t,n.enc=r,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}xE.exports=de;var vj=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];de.prototype.clone=function(){let e=this._baseState,t={};vj.forEach(function(i){t[i]=e[i]});let n=new this.constructor(t.parent);return n._baseState=t,n};de.prototype._wrap=function(){let e=this._baseState;mj.forEach(function(t){this[t]=function(){let i=new this.constructor(this);return e.children.push(i),i[t].apply(i,arguments)}},this)};de.prototype._init=function(e){let t=this._baseState;Mt(t.parent===null),e.call(this),t.children=t.children.filter(function(n){return n._baseState.parent===this},this),Mt.equal(t.children.length,1,"Root node can have only one child")};de.prototype._useArgs=function(e){let t=this._baseState,n=e.filter(function(i){return i instanceof this.constructor},this);e=e.filter(function(i){return!(i instanceof this.constructor)},this),n.length!==0&&(Mt(t.children===null),t.children=n,n.forEach(function(i){i._baseState.parent=this},this)),e.length!==0&&(Mt(t.args===null),t.args=e,t.reverseArgs=e.map(function(i){if(typeof i!="object"||i.constructor!==Object)return i;let s={};return Object.keys(i).forEach(function(o){o==(o|0)&&(o|=0);let a=i[o];s[a]=o}),s}))};gj.forEach(function(r){de.prototype[r]=function(){let t=this._baseState;throw new Error(r+" not implemented for encoding: "+t.enc)}});vE.forEach(function(r){de.prototype[r]=function(){let t=this._baseState,n=Array.prototype.slice.call(arguments);return Mt(t.tag===null),t.tag=r,this._useArgs(n),this}});de.prototype.use=function(e){Mt(e);let t=this._baseState;return Mt(t.use===null),t.use=e,this};de.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};de.prototype.def=function(e){let t=this._baseState;return Mt(t.default===null),t.default=e,t.optional=!0,this};de.prototype.explicit=function(e){let t=this._baseState;return Mt(t.explicit===null&&t.implicit===null),t.explicit=e,this};de.prototype.implicit=function(e){let t=this._baseState;return Mt(t.explicit===null&&t.implicit===null),t.implicit=e,this};de.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};de.prototype.key=function(e){let t=this._baseState;return Mt(t.key===null),t.key=e,this};de.prototype.any=function(){let e=this._baseState;return e.any=!0,this};de.prototype.choice=function(e){let t=this._baseState;return Mt(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map(function(n){return e[n]})),this};de.prototype.contains=function(e){let t=this._baseState;return Mt(t.use===null),t.contains=e,this};de.prototype._decode=function(e,t){let n=this._baseState;if(n.parent===null)return e.wrapResult(n.children[0]._decode(e,t));let i=n.default,s=!0,o=null;if(n.key!==null&&(o=e.enterKey(n.key)),n.optional){let c=null;if(n.explicit!==null?c=n.explicit:n.implicit!==null?c=n.implicit:n.tag!==null&&(c=n.tag),c===null&&!n.any){let u=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),s=!0}catch{s=!1}e.restore(u)}else if(s=this._peekTag(e,c,n.any),e.isError(s))return s}let a;if(n.obj&&s&&(a=e.enterObject()),s){if(n.explicit!==null){let u=this._decodeTag(e,n.explicit);if(e.isError(u))return u;e=u}let c=e.offset;if(n.use===null&&n.choice===null){let u;n.any&&(u=e.save());let p=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(p))return p;n.any?i=e.raw(u):e=p}if(t&&t.track&&n.tag!==null&&t.track(e.path(),c,e.length,"tagged"),t&&t.track&&n.tag!==null&&t.track(e.path(),e.offset,e.length,"content"),n.any||(n.choice===null?i=this._decodeGeneric(n.tag,e,t):i=this._decodeChoice(e,t)),e.isError(i))return i;if(!n.any&&n.choice===null&&n.children!==null&&n.children.forEach(function(p){p._decode(e,t)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){let u=new hj(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(u,t)}}return n.obj&&s&&(i=e.leaveObject(a)),n.key!==null&&(i!==null||s===!0)?e.leaveKey(o,n.key,i):o!==null&&e.exitKey(o),i};de.prototype._decodeGeneric=function(e,t,n){let i=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(t,e,i.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):e==="objid"&&i.args?this._decodeObjid(t,i.args[0],i.args[1],n):e==="objid"?this._decodeObjid(t,null,null,n):e==="gentime"||e==="utctime"?this._decodeTime(t,e,n):e==="null_"?this._decodeNull(t,n):e==="bool"?this._decodeBool(t,n):e==="objDesc"?this._decodeStr(t,e,n):e==="int"||e==="enum"?this._decodeInt(t,i.args&&i.args[0],n):i.use!==null?this._getUse(i.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)};de.prototype._getUse=function(e,t){let n=this._baseState;return n.useDecoder=this._use(e,t),Mt(n.useDecoder._baseState.parent===null),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder};de.prototype._decodeChoice=function(e,t){let n=this._baseState,i=null,s=!1;return Object.keys(n.choice).some(function(o){let a=e.save(),c=n.choice[o];try{let u=c._decode(e,t);if(e.isError(u))return!1;i={type:o,value:u},s=!0}catch{return e.restore(a),!1}return!0},this),s?i:e.error("Choice not matched")};de.prototype._createEncoderBuffer=function(e){return new dj(e,this.reporter)};de.prototype._encode=function(e,t,n){let i=this._baseState;if(i.default!==null&&i.default===e)return;let s=this._encodeValue(e,t,n);if(s!==void 0&&!this._skipDefault(s,t,n))return s};de.prototype._encodeValue=function(e,t,n){let i=this._baseState;if(i.parent===null)return i.children[0]._encode(e,t||new fj);let s=null;if(this.reporter=t,i.optional&&e===void 0)if(i.default!==null)e=i.default;else return;let o=null,a=!1;if(i.any)s=this._createEncoderBuffer(e);else if(i.choice)s=this._encodeChoice(e,t);else if(i.contains)o=this._getUse(i.contains,n)._encode(e,t),a=!0;else if(i.children)o=i.children.map(function(c){if(c._baseState.tag==="null_")return c._encode(null,t,e);if(c._baseState.key===null)return t.error("Child should have a key");let u=t.enterKey(c._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let p=c._encode(e[c._baseState.key],t,e);return t.leaveKey(u),p},this).filter(function(c){return c}),o=this._createEncoderBuffer(o);else if(i.tag==="seqof"||i.tag==="setof"){if(!(i.args&&i.args.length===1))return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");let c=this.clone();c._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(u){let p=this._baseState;return this._getUse(p.args[0],e)._encode(u,t)},c))}else i.use!==null?s=this._getUse(i.use,n)._encode(e,t):(o=this._encodePrimitive(i.tag,e),a=!0);if(!i.any&&i.choice===null){let c=i.implicit!==null?i.implicit:i.tag,u=i.implicit===null?"universal":"context";c===null?i.use===null&&t.error("Tag could be omitted only for .use()"):i.use===null&&(s=this._encodeComposite(c,a,u,o))}return i.explicit!==null&&(s=this._encodeComposite(i.explicit,!1,"context",s)),s};de.prototype._encodeChoice=function(e,t){let n=this._baseState,i=n.choice[e.type];return i||Mt(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),i._encode(e.value,t)};de.prototype._encodePrimitive=function(e,t){let n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if(e==="objid"&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if(e==="objid")return this._encodeObjid(t,null,null);if(e==="gentime"||e==="utctime")return this._encodeTime(t,e);if(e==="null_")return this._encodeNull();if(e==="int"||e==="enum")return this._encodeInt(t,n.args&&n.reverseArgs[0]);if(e==="bool")return this._encodeBool(t);if(e==="objDesc")return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)};de.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};de.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var eu=O(yi=>{"use strict";function yE(r){let e={};return Object.keys(r).forEach(function(t){(t|0)==t&&(t=t|0);let n=r[t];e[n]=t}),e}yi.tagClass={0:"universal",1:"application",2:"context",3:"private"};yi.tagClassByName=yE(yi.tagClass);yi.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"};yi.tagByName=yE(yi.tag)});var Xh=O(($G,wE)=>{"use strict";var xj=Gn(),_n=Xl().Buffer,_E=Zl(),Yh=eu();function bE(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new kr,this.tree._init(r.body)}wE.exports=bE;bE.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function kr(r){_E.call(this,"der",r)}xj(kr,_E);kr.prototype._encodeComposite=function(e,t,n,i){let s=yj(e,t,n,this.reporter);if(i.length<128){let c=_n.alloc(2);return c[0]=s,c[1]=i.length,this._createEncoderBuffer([c,i])}let o=1;for(let c=i.length;c>=256;c>>=8)o++;let a=_n.alloc(2+o);a[0]=s,a[1]=128|o;for(let c=1+o,u=i.length;u>0;c--,u>>=8)a[c]=u&255;return this._createEncoderBuffer([a,i])};kr.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let n=_n.alloc(e.length*2);for(let i=0;i<e.length;i++)n.writeUInt16BE(e.charCodeAt(i),i*2);return this._createEncoderBuffer(n)}else return t==="numstr"?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):t==="printstr"?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):t==="objDesc"?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")};kr.prototype._encodeObjid=function(e,t,n){if(typeof e=="string"){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(let a=0;a<e.length;a++)e[a]|=0}else if(Array.isArray(e)){e=e.slice();for(let a=0;a<e.length;a++)e[a]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!n){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}let i=0;for(let a=0;a<e.length;a++){let c=e[a];for(i++;c>=128;c>>=7)i++}let s=_n.alloc(i),o=s.length-1;for(let a=e.length-1;a>=0;a--){let c=e[a];for(s[o--]=c&127;(c>>=7)>0;)s[o--]=128|c&127}return this._createEncoderBuffer(s)};function hr(r){return r<10?"0"+r:r}kr.prototype._encodeTime=function(e,t){let n,i=new Date(e);return t==="gentime"?n=[hr(i.getUTCFullYear()),hr(i.getUTCMonth()+1),hr(i.getUTCDate()),hr(i.getUTCHours()),hr(i.getUTCMinutes()),hr(i.getUTCSeconds()),"Z"].join(""):t==="utctime"?n=[hr(i.getUTCFullYear()%100),hr(i.getUTCMonth()+1),hr(i.getUTCDate()),hr(i.getUTCHours()),hr(i.getUTCMinutes()),hr(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")};kr.prototype._encodeNull=function(){return this._createEncoderBuffer("")};kr.prototype._encodeInt=function(e,t){if(typeof e=="string"){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if(typeof e!="number"&&!_n.isBuffer(e)){let s=e.toArray();!e.sign&&s[0]&128&&s.unshift(0),e=_n.from(s)}if(_n.isBuffer(e)){let s=e.length;e.length===0&&s++;let o=_n.alloc(s);return e.copy(o),e.length===0&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let n=1;for(let s=e;s>=256;s>>=8)n++;let i=new Array(n);for(let s=i.length-1;s>=0;s--)i[s]=e&255,e>>=8;return i[0]&128&&i.unshift(0),this._createEncoderBuffer(_n.from(i))};kr.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};kr.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getEncoder("der").tree};kr.prototype._skipDefault=function(e,t,n){let i=this._baseState,s;if(i.default===null)return!1;let o=e.join();if(i.defaultBuffer===void 0&&(i.defaultBuffer=this._encodeValue(i.default,t,n).join()),o.length!==i.defaultBuffer.length)return!1;for(s=0;s<o.length;s++)if(o[s]!==i.defaultBuffer[s])return!1;return!0};function yj(r,e,t,n){let i;if(r==="seqof"?r="seq":r==="setof"&&(r="set"),Yh.tagByName.hasOwnProperty(r))i=Yh.tagByName[r];else if(typeof r=="number"&&(r|0)===r)i=r;else return n.error("Unknown tag: "+r);return i>=31?n.error("Multi-octet tag encoding unsupported"):(e||(i|=32),i|=Yh.tagClassByName[t||"universal"]<<6,i)}});var EE=O((HG,SE)=>{"use strict";var _j=Gn(),Jh=Xh();function Qh(r){Jh.call(this,r),this.enc="pem"}_j(Qh,Jh);SE.exports=Qh;Qh.prototype.encode=function(e,t){let i=Jh.prototype.encode.call(this,e).toString("base64"),s=["-----BEGIN "+t.label+"-----"];for(let o=0;o<i.length;o+=64)s.push(i.slice(o,o+64));return s.push("-----END "+t.label+"-----"),s.join(`
92
- `)}});var Zh=O(CE=>{"use strict";var TE=CE;TE.der=Xh();TE.pem=EE()});var tm=O((qG,PE)=>{"use strict";var bj=Gn(),wj=Wh(),AE=Ds().DecoderBuffer,kE=Zl(),RE=eu();function OE(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new Jt,this.tree._init(r.body)}PE.exports=OE;OE.prototype.decode=function(e,t){return AE.isDecoderBuffer(e)||(e=new AE(e,t)),this.tree._decode(e,t)};function Jt(r){kE.call(this,"der",r)}bj(Jt,kE);Jt.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;let i=e.save(),s=em(e,'Failed to peek tag: "'+t+'"');return e.isError(s)?s:(e.restore(i),s.tag===t||s.tagStr===t||s.tagStr+"of"===t||n)};Jt.prototype._decodeTag=function(e,t,n){let i=em(e,'Failed to decode tag of "'+t+'"');if(e.isError(i))return i;let s=ME(e,i.primitive,'Failed to get length of "'+t+'"');if(e.isError(s))return s;if(!n&&i.tag!==t&&i.tagStr!==t&&i.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(i.primitive||s!==null)return e.skip(s,'Failed to match body of: "'+t+'"');let o=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(s=e.offset-o.offset,e.restore(o),e.skip(s,'Failed to match body of: "'+t+'"'))};Jt.prototype._skipUntilEnd=function(e,t){for(;;){let n=em(e,t);if(e.isError(n))return n;let i=ME(e,n.primitive,t);if(e.isError(i))return i;let s;if(n.primitive||i!==null?s=e.skip(i):s=this._skipUntilEnd(e,t),e.isError(s))return s;if(n.tagStr==="end")break}};Jt.prototype._decodeList=function(e,t,n,i){let s=[];for(;!e.isEmpty();){let o=this._peekTag(e,"end");if(e.isError(o))return o;let a=n.decode(e,"der",i);if(e.isError(a)&&o)break;s.push(a)}return s};Jt.prototype._decodeStr=function(e,t){if(t==="bitstr"){let n=e.readUInt8();return e.isError(n)?n:{unused:n,data:e.raw()}}else if(t==="bmpstr"){let n=e.raw();if(n.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");let i="";for(let s=0;s<n.length/2;s++)i+=String.fromCharCode(n.readUInt16BE(s*2));return i}else if(t==="numstr"){let n=e.raw().toString("ascii");return this._isNumstr(n)?n:e.error("Decoding of string type: numstr unsupported characters")}else{if(t==="octstr")return e.raw();if(t==="objDesc")return e.raw();if(t==="printstr"){let n=e.raw().toString("ascii");return this._isPrintstr(n)?n:e.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")}};Jt.prototype._decodeObjid=function(e,t,n){let i,s=[],o=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),o<<=7,o|=a&127,(a&128)===0&&(s.push(o),o=0);a&128&&s.push(o);let c=s[0]/40|0,u=s[0]%40;if(n?i=s:i=[c,u].concat(s.slice(1)),t){let p=t[i.join(" ")];p===void 0&&(p=t[i.join(".")]),p!==void 0&&(i=p)}return i};Jt.prototype._decodeTime=function(e,t){let n=e.raw().toString(),i,s,o,a,c,u;if(t==="gentime")i=n.slice(0,4)|0,s=n.slice(4,6)|0,o=n.slice(6,8)|0,a=n.slice(8,10)|0,c=n.slice(10,12)|0,u=n.slice(12,14)|0;else if(t==="utctime")i=n.slice(0,2)|0,s=n.slice(2,4)|0,o=n.slice(4,6)|0,a=n.slice(6,8)|0,c=n.slice(8,10)|0,u=n.slice(10,12)|0,i<70?i=2e3+i:i=1900+i;else return e.error("Decoding "+t+" time is not supported yet");return Date.UTC(i,s-1,o,a,c,u,0)};Jt.prototype._decodeNull=function(){return null};Jt.prototype._decodeBool=function(e){let t=e.readUInt8();return e.isError(t)?t:t!==0};Jt.prototype._decodeInt=function(e,t){let n=e.raw(),i=new wj(n);return t&&(i=t[i.toString(10)]||i),i};Jt.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function em(r,e){let t=r.readUInt8(e);if(r.isError(t))return t;let n=RE.tagClass[t>>6],i=(t&32)===0;if((t&31)===31){let o=t;for(t=0;(o&128)===128;){if(o=r.readUInt8(e),r.isError(o))return o;t<<=7,t|=o&127}}else t&=31;let s=RE.tag[t];return{cls:n,primitive:i,tag:t,tagStr:s}}function ME(r,e,t){let n=r.readUInt8(t);if(r.isError(n))return n;if(!e&&n===128)return null;if((n&128)===0)return n;let i=n&127;if(i>4)return r.error("length octect is too long");n=0;for(let s=0;s<i;s++){n<<=8;let o=r.readUInt8(t);if(r.isError(o))return o;n|=o}return n}});var NE=O((WG,IE)=>{"use strict";var Sj=Gn(),Ej=Xl().Buffer,rm=tm();function nm(r){rm.call(this,r),this.enc="pem"}Sj(nm,rm);IE.exports=nm;nm.prototype.decode=function(e,t){let n=e.toString().split(/[\r\n]+/g),i=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,a=-1;for(let p=0;p<n.length;p++){let f=n[p].match(s);if(f!==null&&f[2]===i)if(o===-1){if(f[1]!=="BEGIN")break;o=p}else{if(f[1]!=="END")break;a=p;break}}if(o===-1||a===-1)throw new Error("PEM section not found for: "+i);let c=n.slice(o+1,a).join("");c.replace(/[^a-z0-9+/=]+/gi,"");let u=Ej.from(c,"base64");return rm.prototype.decode.call(this,u,t)}});var im=O(DE=>{"use strict";var LE=DE;LE.der=tm();LE.pem=NE()});var jE=O(BE=>{"use strict";var Tj=Zh(),Cj=im(),Aj=Gn(),Rj=BE;Rj.define=function(e,t){return new Bs(e,t)};function Bs(r,e){this.name=r,this.body=e,this.decoders={},this.encoders={}}Bs.prototype._createNamed=function(e){let t=this.name;function n(i){this._initNamed(i,t)}return Aj(n,e),n.prototype._initNamed=function(s,o){e.call(this,s,o)},new n(this)};Bs.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(Cj[e])),this.decoders[e]};Bs.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)};Bs.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(Tj[e])),this.encoders[e]};Bs.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}});var $E=O(FE=>{"use strict";var tu=FE;tu.Reporter=Jl().Reporter;tu.DecoderBuffer=Ds().DecoderBuffer;tu.EncoderBuffer=Ds().EncoderBuffer;tu.Node=Zl()});var qE=O(UE=>{"use strict";var HE=UE;HE._reverse=function(e){let t={};return Object.keys(e).forEach(function(n){(n|0)==n&&(n=n|0);let i=e[n];t[i]=n}),t};HE.der=eu()});var GE=O(WE=>{"use strict";var js=WE;js.bignum=Wh();js.define=jE().define;js.base=$E();js.constants=qE();js.decoders=im();js.encoders=Zh()});var Fs=O((sm,VE)=>{var ru=require("buffer"),Wr=ru.Buffer;function zE(r,e){for(var t in r)e[t]=r[t]}Wr.from&&Wr.alloc&&Wr.allocUnsafe&&Wr.allocUnsafeSlow?VE.exports=ru:(zE(ru,sm),sm.Buffer=_i);function _i(r,e,t){return Wr(r,e,t)}_i.prototype=Object.create(Wr.prototype);zE(Wr,_i);_i.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return Wr(r,e,t)};_i.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=Wr(r);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};_i.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Wr(r)};_i.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return ru.SlowBuffer(r)}});var om=O((XG,KE)=>{var nu=Fs().Buffer,kj=require("stream"),Oj=require("util");function iu(r){if(this.buffer=null,this.writable=!0,this.readable=!0,!r)return this.buffer=nu.alloc(0),this;if(typeof r.pipe=="function")return this.buffer=nu.alloc(0),r.pipe(this),this;if(r.length||typeof r=="object")return this.buffer=r,this.writable=!1,process.nextTick(function(){this.emit("end",r),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof r+")")}Oj.inherits(iu,kj);iu.prototype.write=function(e){this.buffer=nu.concat([this.buffer,nu.from(e)]),this.emit("data",e)};iu.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};KE.exports=iu});var XE=O((JG,YE)=>{"use strict";function am(r){var e=(r/8|0)+(r%8===0?0:1);return e}var Mj={ES256:am(256),ES384:am(384),ES512:am(521)};function Pj(r){var e=Mj[r];if(e)return e;throw new Error('Unknown algorithm "'+r+'"')}YE.exports=Pj});var n1=O((QG,r1)=>{"use strict";var su=Fs().Buffer,QE=XE(),ou=128,ZE=0,Ij=32,Nj=16,Lj=2,e1=Nj|Ij|ZE<<6,au=Lj|ZE<<6;function Dj(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function t1(r){if(su.isBuffer(r))return r;if(typeof r=="string")return su.from(r,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function Bj(r,e){r=t1(r);var t=QE(e),n=t+1,i=r.length,s=0;if(r[s++]!==e1)throw new Error('Could not find expected "seq"');var o=r[s++];if(o===(ou|1)&&(o=r[s++]),i-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(i-s)+'" remaining');if(r[s++]!==au)throw new Error('Could not find expected "int" for "r"');var a=r[s++];if(i-s-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(i-s-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var c=s;if(s+=a,r[s++]!==au)throw new Error('Could not find expected "int" for "s"');var u=r[s++];if(i-s!==u)throw new Error('"s" specified length of "'+u+'", expected "'+(i-s)+'"');if(n<u)throw new Error('"s" specified length of "'+u+'", max of "'+n+'" is acceptable');var p=s;if(s+=u,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var f=t-a,m=t-u,y=su.allocUnsafe(f+a+m+u);for(s=0;s<f;++s)y[s]=0;r.copy(y,s,c+Math.max(-f,0),c+a),s=t;for(var _=s;s<_+m;++s)y[s]=0;return r.copy(y,s,p+Math.max(-m,0),p+u),y=y.toString("base64"),y=Dj(y),y}function JE(r,e,t){for(var n=0;e+n<t&&r[e+n]===0;)++n;var i=r[e+n]>=ou;return i&&--n,n}function jj(r,e){r=t1(r);var t=QE(e),n=r.length;if(n!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+n+'"');var i=JE(r,0,t),s=JE(r,t,r.length),o=t-i,a=t-s,c=2+o+1+1+a,u=c<ou,p=su.allocUnsafe((u?2:3)+c),f=0;return p[f++]=e1,u?p[f++]=c:(p[f++]=ou|1,p[f++]=c&255),p[f++]=au,p[f++]=o,i<0?(p[f++]=0,f+=r.copy(p,f,0,t)):f+=r.copy(p,f,i,t),p[f++]=au,p[f++]=a,s<0?(p[f++]=0,r.copy(p,f,t)):r.copy(p,f,t+s),p}r1.exports={derToJose:Bj,joseToDer:jj}});var s1=O((ZG,i1)=>{"use strict";var Zo=require("buffer").Buffer,cm=require("buffer").SlowBuffer;i1.exports=cu;function cu(r,e){if(!Zo.isBuffer(r)||!Zo.isBuffer(e)||r.length!==e.length)return!1;for(var t=0,n=0;n<r.length;n++)t|=r[n]^e[n];return t===0}cu.install=function(){Zo.prototype.equal=cm.prototype.equal=function(e){return cu(this,e)}};var Fj=Zo.prototype.equal,$j=cm.prototype.equal;cu.restore=function(){Zo.prototype.equal=Fj,cm.prototype.equal=$j}});var fm=O((ez,h1)=>{var Hs=Fs().Buffer,mr=require("crypto"),a1=n1(),o1=require("util"),Hj=`"%s" is not a valid algorithm.
91
+ `),Rl.add(e),r.on("close",()=>Rl.delete(e))}function Gw(r,e){ee(e,{...vn,...Mr,desktopEnabled:qt,remoteAvailable:xh})}async function zw(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(jt(),Fs)),n=await t(r,e);n&&(yn(n),ee(e))}function Vw(r,e){ee(e),yn({step:Zn.PREPARING,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),qn("restart-tunnel")}function Kw(r,e){ee(e),yn({step:Zn.PREPARING,stepDesc:""}),qn("start-tunnel")}function Yw(r,e){ee(e),yn({step:Zn.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),qn("stop-tunnel")}function Xw(r,e){ee(e),yn({step:Zn.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),qn("shutdown")}function Jw(r,e){ee(e),qn("update")}function Qw(r,e){ee(e,{connections:[...gs.values()]})}function Zw(r,e){let t=new URL(r.url,"http://localhost"),n=parseInt(t.searchParams.get("lines")||jp,10);ee(e,{logs:Zv(Number.isFinite(n)?n:jp)})}async function eS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(jt(),Fs)),n=await t(r,e);if(!n)return;let s=!!n.enabled;if(s&&(!Mr.screenRecording||!Mr.accessibility)){ee(e,{ok:!1,enabled:qt,reason:"permissions_required"});return}let i=Ri();qt=s,yh(),Tt("permissions",{...Mr,desktopEnabled:qt}),Ri()!==i&&_h?.(),ee(e,{ok:!0,enabled:qt})}function tS(r,e){ee(e,Mr)}async function rS(r,e){let t=await lh();ee(e,{enabled:t})}async function nS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(jt(),Fs)),n=await t(r,e);if(!n)return;let s=await Ew(!!n.enabled),i=await lh();Tt("autostart",{enabled:i}),ee(e,{ok:s,enabled:i})}async function sS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(jt(),Fs)),n=await t(r,e);if(!n)return;let{type:s}=n;if(process.platform==="darwin"){yw(s);let i=Date.now(),o=setInterval(async()=>{((await Ol())[s]||Date.now()-i>zv)&&clearInterval(o)},Gv)}ee(e)}var Wn,Mw,vh,vn,qt,xh,Mr,Rl,gs,kl,_h,xn=Re(()=>{_t();$s();_t();Si();xw();uh();jt();gl();_t();Wn=require("fs"),Mw=require("path");_t();ph();vh=(0,Mw.join)(oe.STATE,"ui-state.json");vn={step:Zn.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null,permanentKey:"",qrUrl:"",latency:null,uptime:null,healthCheck:{running:!1,timeoutMs:0,startedAt:null,logs:[]},tunnelHealth:{status:"unknown",checkedAt:null}},qt=!1,xh=!1,Mr={screenRecording:!1,accessibility:!1},Rl=new Set,gs=new Map;Qv(_e);kl=null;_h=null});var iS={};tn(iS,{ScreenHandler:()=>bh,encodeTilesBatch:()=>ki});function tj(r){let e=Buffer.alloc(28);return e.writeUInt32LE(r.tileIndex,0),e.writeUInt32LE(r.x,4),e.writeUInt32LE(r.y,8),e.writeUInt32LE(r.width,12),e.writeUInt32LE(r.height,16),e.writeUInt32LE(r.imageBuffer.length,20),e.writeUInt32LE(r.hash>>>0,24),Buffer.concat([e,r.imageBuffer])}function ki(r,e){let t=Buffer.alloc(12);return t.writeUInt32LE(r.length,0),t.writeDoubleBE(e,4),Buffer.concat([t,...r.map(tj)])}var bh,wh=Re(()=>{nh();ft();xn();bh=class{constructor(e,t){this.resourceManager=e,this.screenUpdateHelper=t}setupScreenHandlers(e,t,n){e.on("request-screen",t(async()=>{let s=this.resourceManager.getClient(e.id);if(s)try{let i=await s.tileManager.detectChangedTiles();i.length>0&&n.sendTiles({tiles:i,timestamp:Date.now()},ki),this.resourceManager.updateClientActivity(e.id)}catch(i){ye.error("Tile capture error:",i),n.emit("screen-error",{error:i.message})}})),e.on("request-screen-with-hashes",t(async s=>{let i=this.resourceManager.getClient(e.id);if(i)try{let o=s.tileHashes||[],a=await i.tileManager.compareClientTileHashes(o);a?.tiles?.length>0&&n.sendTiles({tiles:a.tiles,timestamp:Date.now()},ki),this.resourceManager.updateClientActivity(e.id)}catch(o){ye.error("Tile capture with hashes error:",o),n.emit("screen-error",{error:o.message})}})),e.on("start-streaming",t(async()=>{let s=this.resourceManager.getClient(e.id);if(!s)return;s.streamingTimeout&&(clearTimeout(s.streamingTimeout),s.streamingTimeout=null),ye.lifecycle("\u{1F680} Remote streaming started");let{tileFormat:i,webpEffort:o,jpegQuality:a}=Y.pipeline;_e(`\u{1F5BC}\uFE0F Remote stream codec: ${i.toUpperCase()}${i==="webp"?` (effort=${o})`:""} q=${a}`),s.idleFrameCount=0,s.isStreaming=!0,s.streamGen=(s.streamGen||0)+1;let c=s.streamGen;s.tileManager.lastTileChecksums.clear();try{let p=await s.tileManager.getScreenDimensions();n.emit("screen-dimensions",p)}catch(p){ye.error("Get dimensions error:",p)}let l=async()=>{if(!e.connected||!s.isStreaming||s.streamGen!==c){s.streamingTimeout=null;return}try{let p=performance.now(),f=await s.tileManager.detectChangedTilesWithHashes();if(f.tiles.length>0&&e.connected){let M=n.sendTiles({tiles:f.tiles,timestamp:Date.now(),currentHashes:f.currentHashes},ki);s.tileManager.commitHashes(M||[]),s.idleFrameCount=0}else s.idleFrameCount++;let{activeInterval:h,idleInterval:x,idleThreshold:_}=this.resourceManager.getStreamingConfig(),S=s.idleFrameCount>=_?x:h,A=Math.max(0,S-(performance.now()-p));s.streamingTimeout=setTimeout(l,A)}catch(p){ye.error("Auto streaming error:",p),s.streamingTimeout=setTimeout(l,200)}};l()})),e.on("stop-streaming",()=>{let s=this.resourceManager.getClient(e.id);s&&(s.isStreaming=!1,s.streamingTimeout&&(clearTimeout(s.streamingTimeout),s.streamingTimeout=null),s.tileManager?.clearMemory?.(),ye.lifecycle("\u23F9\uFE0F Remote streaming stopped"))}),e.on("get-screen-dimensions",t(async()=>{let s=this.resourceManager.getClient(e.id);if(s)try{let i=await s.tileManager.getScreenDimensions();n.emit("screen-dimensions",i)}catch(i){ye.error("Get dimensions error:",i),n.emit("screen-error",{error:i.message})}})),e.on("boost-stream",t(()=>{let s=this.resourceManager.getClient(e.id);s&&(s.idleFrameCount=0)})),e.on("set-focus",t(s=>{let i=this.resourceManager.getClient(e.id);if(!i)return;let o=s?.rect||null,a=typeof s?.zoom=="number"?s.zoom:1,c=typeof s?.viewerWidth=="number"?s.viewerWidth:0,l=typeof s?.dpr=="number"?s.dpr:1,p=i.tileManager.pickProfile({zoom:a,viewerWidth:c,dpr:l});if(i.tileManager.setProfile(p),i.tileManager.setFocusRect(o),o){let f=i.tileManager.activeTileSet?.size||0,h=i.tileManager.totalTiles,x=h?(f/h*100).toFixed(0):0;ye.focus(`\u{1F3AF} [Focus] rect=${o.x},${o.y} ${o.w}x${o.h} | tiles ${f}/${h} (${x}%)`)}else ye.focus("\u{1F3AF} [Focus] cleared \u2192 full screen")}))}}});function oS(r){Sh.add(r)}function Oi(r){Sh.delete(r)}function bt(r,e,t){for(let n of Sh)if(n.hasReadyAdapter?.())try{n.emit(e,t)}catch{}}var Sh,vs=Re(()=>{Sh=new Set});async function wS(){if(ta)return ta;let r=await import("node-screenshots");if(ta=(r.Monitor||r.default?.Monitor).all()[0],!ta)throw new Error("No monitor found via node-screenshots");return ta}async function SS(r){Oh=r,Y.pipeline.captureLib==="nodeScreenshots"&&await wS()}async function ES(){let{captureLib:r,inputFormat:e}=Y.pipeline;if(r==="robotjs"){let{width:i,height:o}=Oh.getScreenSize(),a=Oh.screen.capture(0,0,i,o),c=a.byteWidth/a.bytesPerPixel;return{buffer:Buffer.from(a.image),width:c,height:a.height,channels:a.bytesPerPixel,format:e}}let n=await(await wS()).captureImage();return{buffer:await n.toRaw(),width:n.width,height:n.height,channels:4,format:e}}var Oh,ta,TS=Re(()=>{ft();Oh=null,ta=null});function mj(r){return r==="bgra"?Ph.FORMAT_BGRA:Ph.FORMAT_RGBA}function Ih(r){let e=new Uint32Array(r.buffer,r.byteOffset,r.length>>2);for(let t=0;t<e.length;t++){let n=e[t];e[t]=n&4278255360|(n&16711680)>>16|(n&255)<<16}}async function CS(r,e,t,n=4,s,i){let{encoder:o,inputFormat:a,jpegQuality:c,tileFormat:l,webpEffort:p}=Y.pipeline,f=s??c,h=i??a;if(o==="jpegTurbo"&&l!=="webp")return Ph.compressSync(r,{width:e,height:t,format:mj(h),quality:f});let x=r;h==="bgra"&&(x=Buffer.from(r),Ih(x));let _=(0,Ul.default)(x,{raw:{width:e,height:t,channels:n}});return l==="webp"?_.webp({quality:f,effort:p}).toBuffer():_.jpeg({quality:f}).toBuffer()}var Ul,Mh,Ph,AS=Re(()=>{Ul=J(require("sharp"),1),Mh=J(require("@julusian/jpeg-turbo"),1);ft();Ph=Mh.default.default||Mh.default;Ul.default.cache(!1);Ul.default.concurrency(1)});var ql,RS=Re(()=>{ft();xn();ql=class{constructor(){this.cfg=Y.logging,this.samples=[],this.lastLogTime=Date.now()}now(){return this.cfg.metrics?performance.now():0}record({capture:e,checksum:t,encode:n,total:s,changedTiles:i,totalTiles:o,tileBytes:a,rawBytes:c}){this.cfg.metrics&&(this.samples.push({capture:e,checksum:t,encode:n,total:s,changedTiles:i,totalTiles:o,tileBytes:a,rawBytes:c}),this.samples.length>=this.cfg.metricsEveryFrames&&this._flush())}_flush(){let e=this.samples.length,t=L=>(this.samples.reduce((j,W)=>j+W[L],0)/e).toFixed(1),n=(Date.now()-this.lastLogTime)/1e3,s=(e/n).toFixed(1),i=[],o=0;for(let L of this.samples){for(let j of L.tileBytes)i.push(j);o+=L.tileBytes.reduce((j,W)=>j+W,0)}let a=(o/e/1024).toFixed(1),c=i.length?(i.reduce((L,j)=>L+j,0)/i.length/1024).toFixed(2):"0",l=i.length?(Math.min(...i)/1024).toFixed(2):"0",p=i.length?(Math.max(...i)/1024).toFixed(2):"0",f=this.samples.reduce((L,j)=>L+j.rawBytes,0)/e,h=o/e,x=h>0?(f/h).toFixed(0):"0",_=(this.samples.reduce((L,j)=>L+j.changedTiles,0)/e).toFixed(0),S=this.samples[0]?.totalTiles||0,A=S?(_/S*100).toFixed(1):"0",M=Y.pipeline,N=`[Metrics] ${M.captureLib}+${M.encoder} tile=${M.tileSize} q${M.jpegQuality} scale=${M.outputScale} | fps=${s} | capture=${t("capture")}ms enc=${t("encode")}ms total=${t("total")}ms | tiles=${_}/${S} (${A}%) | data=${a}KB/frame | tileAvg=${c}KB (min ${l}, max ${p}) | compress=${x}x`;_e(N),console.log(N),this.samples=[],this.lastLogTime=Date.now()}}});var MS={};tn(MS,{TileManager:()=>Nh,mapLimit:()=>xs});async function xs(r,e,t){let n=new Array(r.length),s=0,i=Math.min(e,r.length),o=Array.from({length:i},async(a,c)=>{for(;s<r.length;){let l=s++;n[l]=await t(r[l],l,c)}});return await Promise.all(o),n}var Ii,Gl,kS,Wl,OS,gj,vj,Nh,PS=Re(()=>{Ii=J(require("fs"),1),Gl=J(require("path"),1),kS=J(require("sharp"),1),Wl=require("child_process"),OS=require("url");ft();TS();AS();RS();nh();gj=(0,OS.fileURLToPath)(__importMetaUrl),vj=Gl.default.dirname(gj);Nh=class{constructor(e){this.robot=e,this.metrics=new ql,this.tileSize=Y.pipeline.tileSize,this.lastTileChecksums=new Map,this.screenWidth=0,this.screenHeight=0,this.tilesPerRow=0,this.tilesPerColumn=0,this.totalTiles=0,this.frameCount=0,this.tempDir=Gl.default.join(vj,"../../temp"),this.changeThreshold=1,this.scaledWidth=0,this.scaledHeight=0,this.isProcessing=!1,this.sharedScreenCache=null,this.lastCaptureTime=0,this.CACHE_TTL=100,this.dpiScale=1,this.captureWidth=0,this.captureHeight=0,this.scaleFactor=Y.pipeline.outputScale||1,this.compressionQuality=Y.pipeline.jpegQuality,this.activeTileSet=null,this.focusStats={frames:0,scanned:0,changed:0,bytes:0},this._scratchExtract=[],this._scratchSwap=[],this._prefetchCapture=null,Ii.default.existsSync(this.tempDir)||Ii.default.mkdirSync(this.tempDir,{recursive:!0}),SS(e),this.initializeScreenDimensions()}initializeScreenDimensions(){try{let{width:e,height:t}=this.robot.getScreenSize();this.screenWidth=e,this.screenHeight=t,this.detectDpiScale(),this.scaledWidth=this.captureWidth,this.scaledHeight=this.captureHeight,this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn;let n=100;if(this.totalTiles>n){let s=Math.ceil(Math.sqrt(this.scaledWidth*this.scaledHeight/n));this.tileSize=Math.max(s,120),this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}}catch(e){ye.error("Screen dimensions error:",e),this.screenWidth=1920,this.screenHeight=1080,this.dpiScale=1,this.captureWidth=1920,this.captureHeight=1080,this.scaledWidth=1728,this.scaledHeight=972,this.tileSize=120,this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}}detectDpiScale(){if(process.platform==="darwin"){let e=this.robot.screen.capture(0,0,this.screenWidth,this.screenHeight),n=e.byteWidth/e.bytesPerPixel/this.screenWidth;n>=1.9&&n<=2.1?this.dpiScale=2:this.dpiScale=1}else process.platform==="win32"?this.dpiScale=this._detectDpiScaleWin32():this.dpiScale=1;this.captureWidth=Math.floor(this.screenWidth*this.dpiScale),this.captureHeight=Math.floor(this.screenHeight*this.dpiScale)}_detectDpiScaleWin32(){ye.dpi(`\u{1F50D} [DPI Detection] screenWidth from robot: ${this.screenWidth}x${this.screenHeight}`);try{let e=(0,Wl.execSync)(`powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "try{Get-ItemPropertyValue 'HKCU:\\Control Panel\\Desktop\\WindowMetrics' -Name AppliedDPI}catch{0}"`,{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ye.dpi(`\u{1F50D} [DPI Detection] Strategy 1 (Registry AppliedDPI): ${t} DPI`),t>=96){let n=t/96;return ye.dpi(`\u2705 [DPI Detection] Using registry scale: ${n}x (${t}/96)`),n}}catch(e){ye.dpi(`\u274C [DPI Detection] Strategy 1 failed: ${e.message}`)}try{let e=(0,Wl.execSync)('powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "(Get-WmiObject -Class Win32_VideoController | Select-Object -First 1).CurrentHorizontalResolution"',{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ye.dpi(`\u{1F50D} [DPI Detection] Strategy 2 (WMI): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return ye.dpi(`\u2705 [DPI Detection] Using WMI scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){ye.dpi(`\u274C [DPI Detection] Strategy 2 failed: ${e.message}`)}try{let e=(0,Wl.execSync)(`powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "Add-Type -TypeDefinition 'using System;using System.Runtime.InteropServices;public class Disp{[DllImport(\\"user32\\")]public static extern bool EnumDisplaySettings(string d,int m,ref DEVMODE dm);[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi)]public struct DEVMODE{[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmDeviceName;public short dmSpecVersion,dmDriverVersion,dmSize,dmDriverExtra;public int dmFields;public int dmPositionX,dmPositionY,dmDisplayOrientation,dmDisplayFixedOutput;public short dmColor,dmDuplex,dmYResolution,dmTTOption,dmCollate;[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmFormName;public short dmLogPixels;public int dmBitsPerPel,dmPelsWidth,dmPelsHeight,dmDisplayFlags,dmDisplayFrequency;}}'; $dm=New-Object Disp+DEVMODE; $dm.dmSize=[System.Runtime.InteropServices.Marshal]::SizeOf($dm); [Disp]::EnumDisplaySettings($null,-1,[ref]$dm) | Out-Null; Write-Output $dm.dmPelsWidth"`,{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ye.dpi(`\u{1F50D} [DPI Detection] Strategy 3 (EnumDisplaySettings): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return ye.dpi(`\u2705 [DPI Detection] Using EnumDisplaySettings scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){ye.dpi(`\u274C [DPI Detection] Strategy 3 failed: ${e.message}`)}return ye.dpi("\u26A0\uFE0F [DPI Detection] All strategies failed, fallback to 1x"),1}async captureFullScreen(){let e=await ES();return{buffer:e.buffer,width:e.width,height:e.height,channels:e.channels}}async getSharedScreenCapture(){let e=Date.now();return this.sharedScreenCache&&e-this.lastCaptureTime<this.CACHE_TTL?this.sharedScreenCache:(this.sharedScreenCache=await this.captureFullScreen(),this.lastCaptureTime=e,this.sharedScreenCache)}async getCaptureForStreaming(){if(!this._prefetchCapture){let t=await this.captureFullScreen();return this._prefetchCapture=this.captureFullScreen(),t}let e=await this._prefetchCapture;return this._prefetchCapture=this.captureFullScreen(),e}clearScreenCache(){}async detectChangedTiles(){return(await this.detectChangedTilesWithHashes()).tiles}async detectChangedTilesWithHashes(){if(this.isProcessing)return{tiles:[],currentHashes:Array.from(this.lastTileChecksums.values())};this.isProcessing=!0;let e=this.metrics.now(),t=e,n=e;try{let s=await this.getCaptureForStreaming();t=this.metrics.now();let i=[],o=[],a=new Map;this.frameCount++;let c=this.activeTileSet;for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let h=this.calculateTileChecksumDirect(s,f);a.set(f,h)}n=this.metrics.now();let l=Array.from(a.values());if(this.lastTileChecksums.size===0){let f=[];for(let x=0;x<this.totalTiles;x++)c&&!c.has(x)||f.push(x);let h=await xs(f,Y.pipeline.tileConcurrency,(x,_,S)=>this.processTileAsync(s,x,null,a.get(x),S));return i.push(...h),this._recordFrame(e,t,n,i,s),{tiles:i,currentHashes:l}}for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let h=a.get(f),x=this.lastTileChecksums.get(f);h!==x&&o.push(f)}if(o.length/this.totalTiles>this.changeThreshold){let f=[];for(let x=0;x<this.totalTiles;x++)c&&!c.has(x)||f.push(x);let h=await xs(f,Y.pipeline.tileConcurrency,(x,_,S)=>this.processTileAsync(s,x,null,a.get(x),S));i.push(...h.map(x=>({...x,fullRefresh:!0})))}else if(o.length>0){let f=await xs(o,Y.pipeline.tileConcurrency,(h,x,_)=>this.processTileAsync(s,h,null,a.get(h),_));i.push(...f)}return this._recordFrame(e,t,n,i,s),{tiles:i,currentHashes:l}}finally{this.isProcessing=!1}}async processTileAsync(e,t,n=null,s=null,i=null){let o=n||this.extractTile(e,t,i),a=await this.compressTileImage(o.buffer,o.width,o.height,i),{row:c,col:l}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:l*this.tileSize,y:c*this.tileSize,width:o.width,height:o.height,imageBuffer:a,hash:s??this.lastTileChecksums.get(t)??0,timestamp:Date.now(),frameCount:this.frameCount}}commitHashes(e){for(let t of e)this.lastTileChecksums.set(t.tileIndex,t.hash)}calculateTileChecksumDirect(e,t){let{row:n,col:s}=this.getTilePosition(t),i=s*this.tileSize,o=n*this.tileSize,a=Math.min(i+this.tileSize,e.width),c=Math.min(o+this.tileSize,e.height),l=a-i,p=c-o,f=e.channels,h=e.width*f,x=0,{rowStep:_,colStep:S}=Y.pipeline.checksumSampling;for(let A=0;A<p;A+=_){let M=(o+A)*h+i*f;for(let N=0;N<l;N+=S){let L=M+N*f,j=N+1;x=x+e.buffer[L]*j>>>0,x^=e.buffer[L+1]<<1,x=x+e.buffer[L+2]*j>>>0,x^=e.buffer[L+3]<<2}}return x>>>0}setFocusRect(e){if(!e){this.activeTileSet=null;return}let t=Y.focus.paddingTiles,n=Math.max(0,Math.floor(e.x/this.tileSize)-t),s=Math.max(0,Math.floor(e.y/this.tileSize)-t),i=Math.min(this.tilesPerRow-1,Math.floor((e.x+e.w)/this.tileSize)+t),o=Math.min(this.tilesPerColumn-1,Math.floor((e.y+e.h)/this.tileSize)+t),a=new Set;for(let l=s;l<=o;l++)for(let p=n;p<=i;p++)a.add(l*this.tilesPerRow+p);let c=this.activeTileSet;if(c)for(let l of a)c.has(l)||this.lastTileChecksums.delete(l);this.activeTileSet=a}getTilePosition(e){return{row:Math.floor(e/this.tilesPerRow),col:e%this.tilesPerRow}}_getScratch(e,t,n){let s=e[t];return(!s||s.length<n)&&(s=Buffer.allocUnsafe(n),e[t]=s),s.subarray(0,n)}extractTile(e,t,n=null){let{row:s,col:i}=this.getTilePosition(t),o=i*this.tileSize,a=s*this.tileSize,c=Math.min(o+this.tileSize,e.width),l=Math.min(a+this.tileSize,e.height),p=c-o,f=l-a,h=e.channels,x=p*h,_=p*f*h,S=n===null?Buffer.allocUnsafe(_):this._getScratch(this._scratchExtract,n,_);for(let A=0;A<f;A++){let M=((a+A)*e.width+o)*h,N=A*x;e.buffer.copy(S,N,M,M+x)}return{buffer:S,width:p,height:f,channels:h,tileIndex:t,x:o,y:a}}async compressTileImage(e,t,n,s=null){let i=this.scaleFactor;if(i&&i>0&&i<1){let o=Math.max(1,Math.floor(t*i)),a=Math.max(1,Math.floor(n*i)),{inputFormat:c}=Y.pipeline,l=e,p=4;c==="bgra"&&(s===null?l=Buffer.from(e):(l=this._getScratch(this._scratchSwap,s,e.length),e.copy(l)),Ih(l));let{tileFormat:f,webpEffort:h}=Y.pipeline,x=(0,kS.default)(l,{raw:{width:t,height:n,channels:p}}).resize(o,a,{kernel:"lanczos3",fastShrinkOnLoad:!1});return f==="webp"?x.webp({quality:this.compressionQuality,effort:h}).toBuffer():x.jpeg({quality:this.compressionQuality}).toBuffer()}return CS(e,t,n,4,this.compressionQuality)}pickProfile({zoom:e=1,viewerWidth:t=0,dpr:n=1}={}){let s=Y.pipeline.adaptiveTiers||[];if(!s.length)return null;let i=this.captureWidth||this.screenWidth||1,o=t>0?t:i,a=e>0?e:1,c=n>0?n:1,l=o*a*c/i,p=Y.pipeline.tierHysteresis||0,f=this._currentTier;for(let x of s){let _=f&&x===f?x.minEffective-p:x.minEffective;if(l>=_)return this._currentTier=x,x}let h=s[s.length-1];return this._currentTier=h,h}setProfile(e){if(!e)return;let t=e.outputScale??this.scaleFactor,n=e.jpegQuality??this.compressionQuality;t===this.scaleFactor&&n===this.compressionQuality||(this.scaleFactor=t,this.compressionQuality=n,this.lastTileChecksums.clear())}_recordFrame(e,t,n,s,i){if(this._recordFocusFrame(s),!this.metrics.cfg.metrics)return;let o=this.metrics.now(),a=s.map(l=>l.imageBuffer?.length||0),c=i?i.width*i.height*i.channels:0;this.metrics.record({capture:t-e,checksum:n-t,encode:o-n,total:o-e,changedTiles:s.length,totalTiles:this.totalTiles,tileBytes:a,rawBytes:c})}_recordFocusFrame(e){let t=this.focusStats;t.frames++,t.scanned+=this.activeTileSet?this.activeTileSet.size:this.totalTiles,t.changed+=e.length;for(let c of e)t.bytes+=c.imageBuffer?.length||0;if(t.frames<Y.logging.focusEveryFrames)return;let n=(t.scanned/t.frames).toFixed(0),s=(t.changed/t.frames).toFixed(1),i=(t.bytes/t.frames/1024).toFixed(1),o=this.totalTiles?((1-n/this.totalTiles)*100).toFixed(0):0,a=this.activeTileSet?"focus":"full";ye.focus(`\u{1F3AF} [Focus/${a}] ${t.frames}f | scan ${n}/${this.totalTiles} tiles (saved ${o}%) | changed ${s}/f | data ${i}KB/f`),this.focusStats={frames:0,scanned:0,changed:0,bytes:0}}async getScreenDimensions(){try{let e=await this.captureFullScreen();this.scaledWidth=e.width,this.scaledHeight=e.height,this.tilesPerRow=Math.ceil(e.width/this.tileSize),this.tilesPerColumn=Math.ceil(e.height/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}catch(e){ye.error("Error getting dimensions:",e)}return{width:this.scaledWidth,height:this.scaledHeight,tileWidth:this.tileSize,tileHeight:this.tileSize,tileCount:this.totalTiles,scaleFactor:this.scaleFactor,originalWidth:this.screenWidth,originalHeight:this.screenHeight}}async compareClientTileHashes(e){if(this.isProcessing)return{tiles:[],currentHashes:[],changedIndices:[]};this.isProcessing=!0;try{let t=await this.getSharedScreenCapture(),n=[],s=[];this.frameCount++;let i=this.activeTileSet,o=new Map;for(let c=0;c<this.totalTiles;c++){if(i&&!i.has(c))continue;let l=this.calculateTileChecksumDirect(t,c);o.set(c,l),this.lastTileChecksums.set(c,l)}if(!e||e.length===0){let c=[];for(let p=0;p<this.totalTiles;p++)i&&!i.has(p)||c.push(p);let l=await xs(c,Y.pipeline.tileConcurrency,p=>this.processTileAsync(t,p));return n.push(...l),{tiles:n,currentHashes:Array.from(o.values())}}for(let c=0;c<this.totalTiles;c++)i&&!i.has(c)||e[c]!==o.get(c)&&s.push(c);if(s.length/this.totalTiles>this.changeThreshold){let c=[];for(let p=0;p<this.totalTiles;p++)i&&!i.has(p)||c.push(p);let l=await xs(c,Y.pipeline.tileConcurrency,p=>this.processTileAsync(t,p));n.push(...l.map(p=>({...p,fullRefresh:!0})))}else if(s.length>0){let c=await xs(s,Y.pipeline.tileConcurrency,l=>this.processTileAsync(t,l));n.push(...c)}return this._recordFocusFrame(n),{tiles:n,currentHashes:Array.from(o.values()),changedIndices:s}}finally{this.isProcessing=!1}}clearMemory(){this.sharedScreenCache=null,this.lastCaptureTime=0,this.lastTileChecksums.clear(),this._scratchExtract=[],this._scratchSwap=[],this._traceFrames=50,this._prefetchCapture=null}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{Ii.default.existsSync(this.tempDir)&&Ii.default.readdirSync(this.tempDir).forEach(t=>Ii.default.unlinkSync(Gl.default.join(this.tempDir,t)))}catch(e){ye.warn(`Cleanup error: ${e.message}`)}}}});var IS={};tn(IS,{ResourceManager:()=>Lh});var Lh,NS=Re(()=>{ft();vs();Lh=class{constructor(){this.activeClients=new Map,this.activeTimers=new Map,this.chunkTimers=new Map,this.memoryCheckInterval=null}startResourceMonitoring(){this.memoryCheckInterval=setInterval(()=>{let e=process.memoryUsage(),t=Math.round(e.heapUsed/1024/1024);t>Y.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},Y.resourceManagement.memoryCheckInterval)}stopResourceMonitoring(){this.memoryCheckInterval&&(clearInterval(this.memoryCheckInterval),this.memoryCheckInterval=null)}addClient(e,t){this.activeClients.set(e,{...t,lastActivity:Date.now()})}getClient(e){return this.activeClients.get(e)}updateClientActivity(e){let t=this.activeClients.get(e);t&&(t.lastActivity=Date.now())}cleanupInactiveClients(){let e=Date.now(),t=Y.resourceManagement.inactiveTimeout;for(let[n,s]of this.activeClients.entries())e-s.lastActivity>t&&(console.log(`\u{1F9F9} Cleaning inactive client: ${n}`),this.cleanupClientResources(n,s),this.activeClients.delete(n))}cleanupClientResources(e,t){try{t.isStreaming=!1,t?.streamingTimeout&&(clearTimeout(t.streamingTimeout),t.streamingTimeout=null),t?.screenInterval&&(clearInterval(t.screenInterval),t.screenInterval=null);let n=this.activeTimers.get(e);n&&(n.forEach(i=>clearTimeout(i)),this.activeTimers.delete(e));let s=this.chunkTimers.get(e);s&&(s.forEach(i=>clearTimeout(i)),this.chunkTimers.delete(e)),t?.tileManager&&(t.tileManager.clearMemory(),t.tileManager.cleanup(),t.tileManager.reset()),t?.protocol&&(t.protocol.close(),Oi(t.protocol))}catch(n){console.error(`Error cleaning up ${e}:`,n.message)}}getStreamingConfig(){return Y.streaming}getWebRTCConfig(){return Y.webrtc}removeClient(e){let t=this.activeClients.get(e);t&&(this.cleanupClientResources(e,t),this.activeClients.delete(e))}getChunkTimers(e){return this.chunkTimers.has(e)||this.chunkTimers.set(e,new Set),this.chunkTimers.get(e)}cleanupAll(){this.stopResourceMonitoring();for(let[e,t]of this.activeClients.entries())this.cleanupClientResources(e,t);this.activeClients.clear(),this.activeTimers.clear(),this.chunkTimers.clear()}}});var LS={};tn(LS,{ScreenUpdateHelper:()=>Dh});var Dh,DS=Re(()=>{ft();Dh=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,n,s=!1){if(!t||t.length===0)return;let i=Y.streaming.chunkSize,o=[];for(let c=0;c<t.length;c+=i)o.push(t.slice(c,c+i));let a=this.resourceManager.getChunkTimers(e.id);for(let c=0;c<o.length;c++){let l=o[c],p=c===o.length-1,f=setTimeout(()=>{a.delete(f),e.connected&&e.emit("tiles-data",{tiles:l,timestamp:n,forceRefresh:!1,userAction:s,chunkInfo:{chunkIndex:c,totalChunks:o.length,isLastChunk:p}})},c*Y.streaming.chunkDelay);a.add(f)}}}});var BS={};tn(BS,{MouseHandler:()=>Bh});var Bh,jS=Re(()=>{ft();Bh=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastMouseMove=0}setupMouseHandlers(e,t){let n=this.robot;e.on("mouse-move",t(s=>{let i=Date.now();if(!(i-this.lastMouseMove<Y.throttling.mouseThrottle)){this.lastMouseMove=i;try{let o=n.getScreenSize(),a=Math.round(s.x/100*o.width),c=Math.round(s.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,p),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Mouse move error:",o.message)}}})),e.on("mouse-click",t(async s=>{try{let i=this.resourceManager.getClient(e.id);if(!i)return;let o=n.getScreenSize(),a=Math.round(s.x/100*o.width),c=Math.round(s.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,p),n.mouseClick(s.button||"left",s.double||!1),i.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(i){console.error("Mouse click error:",i.message)}})),e.on("mouse-press",t(async s=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(s.x/100*o.width),c=Math.round(s.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,p),n.mouseToggle("down",s.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(i){console.error("Mouse press error:",i.message)}})),e.on("mouse-release",t(async s=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(s.x/100*o.width),c=Math.round(s.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,p),n.mouseToggle("up",s.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(i){console.error("Mouse release error:",i.message)}})),e.on("scroll",t(async s=>{try{let{direction:i,amount:o=60,horizontal:a=!1}=s,c=this.resourceManager.getClient(e.id);if(!c)return;let l=0,p=0;a||i==="left"||i==="right"?l=i==="right"?o:-o:p=i==="down"?-o:o,n.scrollMouse(l,p),c.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(i){console.error("Scroll error:",i.message)}})),e.on("mouse-drag-select",t(s=>{try{let{startX:i,startY:o,endX:a,endY:c}=s,l=n.getScreenSize(),p=Math.round(i/100*l.width),f=Math.round(o/100*l.height),h=Math.round(a/100*l.width),x=Math.round(c/100*l.height),_=Math.max(0,Math.min(l.width-1,p)),S=Math.max(0,Math.min(l.height-1,f)),A=Math.max(0,Math.min(l.width-1,h)),M=Math.max(0,Math.min(l.height-1,x));n.moveMouse(_,S),n.mouseToggle("down","left"),n.dragMouse(A,M),n.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(i){console.error("Drag selection error:",i.message)}}))}}});var HS={};tn(HS,{KeyboardHandler:()=>jh});function yj(r){let e;r.type==="missionControl"?e='tell application "System Events" to key code 160':e=`tell application "System Events" to key code ${r.keyCode} using ${r.mods}`,(0,FS.execFile)("osascript",["-e",e],t=>{t&&console.error("osascript error:",t.message)})}var FS,jh,$S=Re(()=>{FS=require("child_process");ft();jh=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastKeyPress=0,this.lastTypeText=0}setupKeyboardHandlers(e,t){let n=this.robot;e.on("key-press",t(s=>{let i=Date.now();if(!(i-this.lastKeyPress<Y.throttling.keyThrottle)){this.lastKeyPress=i;try{if(!s.key||typeof s.key!="string")return;let o=this.resourceManager.getClient(e.id),a=s.key,c=s.modifier||[];if(a.length===1)if(c.filter(p=>p!=="shift").length>0){n.keyTap(a.toLowerCase(),c);for(let p of c)n.keyToggle(p,"up")}else n.typeString(a);else{let p={return:"enter"}[a.toLowerCase()]??a.toLowerCase();n.keyTap(p,c)}o&&(o.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Key press error:",o.message)}}})),e.on("desktop-switch",t(s=>{try{let i=s?.direction,o=Y.desktopSwitch[process.platform]?.[i];if(!o)return;process.platform==="darwin"?yj(o):n.keyTap(o[0],o[1]);let a=this.resourceManager.getClient(e.id);a&&(a.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(i){console.error("Desktop switch error:",i.message)}})),e.on("type-text",t(s=>{let i=Date.now();if(!(i-this.lastTypeText<Y.throttling.typeTextThrottle)){this.lastTypeText=i;try{if(!s.text||typeof s.text!="string")return;let o=s.text;o.length>Y.throttling.maxTextLength&&(o=o.substring(0,Y.throttling.maxTextLength));let a=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),c=this.resourceManager.getClient(e.id);setTimeout(()=>{try{n.typeString(a),this.resourceManager.updateClientActivity(e.id),c&&(c.idleFrameCount=0,c.tileManager&&c.tileManager.clearScreenCache())}catch(l){console.error("Robot typeString error:",l.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var Yh=O((vE,Kh)=>{(function(r,e){"use strict";function t(T,u){if(!T)throw new Error(u||"Assertion failed")}function n(T,u){T.super_=u;var m=function(){};m.prototype=u.prototype,T.prototype=new m,T.prototype.constructor=T}function s(T,u,m){if(s.isBN(T))return T;this.negative=0,this.words=null,this.length=0,this.red=null,T!==null&&((u==="le"||u==="be")&&(m=u,u=10),this._init(T||0,u||10,m||"be"))}typeof r=="object"?r.exports=s:e.BN=s,s.BN=s,s.wordSize=26;var i;try{typeof window<"u"&&typeof window.Buffer<"u"?i=window.Buffer:i=require("buffer").Buffer}catch{}s.isBN=function(u){return u instanceof s?!0:u!==null&&typeof u=="object"&&u.constructor.wordSize===s.wordSize&&Array.isArray(u.words)},s.max=function(u,m){return u.cmp(m)>0?u:m},s.min=function(u,m){return u.cmp(m)<0?u:m},s.prototype._init=function(u,m,y){if(typeof u=="number")return this._initNumber(u,m,y);if(typeof u=="object")return this._initArray(u,m,y);m==="hex"&&(m=16),t(m===(m|0)&&m>=2&&m<=36),u=u.toString().replace(/\s+/g,"");var w=0;u[0]==="-"&&(w++,this.negative=1),w<u.length&&(m===16?this._parseHex(u,w,y):(this._parseBase(u,m,w),y==="le"&&this._initArray(this.toArray(),m,y)))},s.prototype._initNumber=function(u,m,y){u<0&&(this.negative=1,u=-u),u<67108864?(this.words=[u&67108863],this.length=1):u<4503599627370496?(this.words=[u&67108863,u/67108864&67108863],this.length=2):(t(u<9007199254740992),this.words=[u&67108863,u/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),m,y)},s.prototype._initArray=function(u,m,y){if(t(typeof u.length=="number"),u.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(u.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var g,v,C=0;if(y==="be")for(w=u.length-1,g=0;w>=0;w-=3)v=u[w]|u[w-1]<<8|u[w-2]<<16,this.words[g]|=v<<C&67108863,this.words[g+1]=v>>>26-C&67108863,C+=24,C>=26&&(C-=26,g++);else if(y==="le")for(w=0,g=0;w<u.length;w+=3)v=u[w]|u[w+1]<<8|u[w+2]<<16,this.words[g]|=v<<C&67108863,this.words[g+1]=v>>>26-C&67108863,C+=24,C>=26&&(C-=26,g++);return this.strip()};function o(T,u){var m=T.charCodeAt(u);return m>=65&&m<=70?m-55:m>=97&&m<=102?m-87:m-48&15}function a(T,u,m){var y=o(T,m);return m-1>=u&&(y|=o(T,m-1)<<4),y}s.prototype._parseHex=function(u,m,y){this.length=Math.ceil((u.length-m)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var g=0,v=0,C;if(y==="be")for(w=u.length-1;w>=m;w-=2)C=a(u,m,w)<<g,this.words[v]|=C&67108863,g>=18?(g-=18,v+=1,this.words[v]|=C>>>26):g+=8;else{var b=u.length-m;for(w=b%2===0?m+1:m;w<u.length;w+=2)C=a(u,m,w)<<g,this.words[v]|=C&67108863,g>=18?(g-=18,v+=1,this.words[v]|=C>>>26):g+=8}this.strip()};function c(T,u,m,y){for(var w=0,g=Math.min(T.length,m),v=u;v<g;v++){var C=T.charCodeAt(v)-48;w*=y,C>=49?w+=C-49+10:C>=17?w+=C-17+10:w+=C}return w}s.prototype._parseBase=function(u,m,y){this.words=[0],this.length=1;for(var w=0,g=1;g<=67108863;g*=m)w++;w--,g=g/m|0;for(var v=u.length-y,C=v%w,b=Math.min(v,v-C)+y,d=0,E=y;E<b;E+=w)d=c(u,E,E+w,m),this.imuln(g),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(C!==0){var U=1;for(d=c(u,E,u.length,m),E=0;E<C;E++)U*=m;this.imuln(U),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this.strip()},s.prototype.copy=function(u){u.words=new Array(this.length);for(var m=0;m<this.length;m++)u.words[m]=this.words[m];u.length=this.length,u.negative=this.negative,u.red=this.red},s.prototype.clone=function(){var u=new s(null);return this.copy(u),u},s.prototype._expand=function(u){for(;this.length<u;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(u,m){u=u||10,m=m|0||1;var y;if(u===16||u==="hex"){y="";for(var w=0,g=0,v=0;v<this.length;v++){var C=this.words[v],b=((C<<w|g)&16777215).toString(16);g=C>>>24-w&16777215,w+=2,w>=26&&(w-=26,v--),g!==0||v!==this.length-1?y=l[6-b.length]+b+y:y=b+y}for(g!==0&&(y=g.toString(16)+y);y.length%m!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(u===(u|0)&&u>=2&&u<=36){var d=p[u],E=f[u];y="";var U=this.clone();for(U.negative=0;!U.isZero();){var I=U.modn(E).toString(u);U=U.idivn(E),U.isZero()?y=I+y:y=l[d-I.length]+I+y}for(this.isZero()&&(y="0"+y);y.length%m!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}t(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var u=this.words[0];return this.length===2?u+=this.words[1]*67108864:this.length===3&&this.words[2]===1?u+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-u:u},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(u,m){return t(typeof i<"u"),this.toArrayLike(i,u,m)},s.prototype.toArray=function(u,m){return this.toArrayLike(Array,u,m)},s.prototype.toArrayLike=function(u,m,y){var w=this.byteLength(),g=y||Math.max(1,w);t(w<=g,"byte array longer than desired length"),t(g>0,"Requested array length <= 0"),this.strip();var v=m==="le",C=new u(g),b,d,E=this.clone();if(v){for(d=0;!E.isZero();d++)b=E.andln(255),E.iushrn(8),C[d]=b;for(;d<g;d++)C[d]=0}else{for(d=0;d<g-w;d++)C[d]=0;for(d=0;!E.isZero();d++)b=E.andln(255),E.iushrn(8),C[g-d-1]=b}return C},Math.clz32?s.prototype._countBits=function(u){return 32-Math.clz32(u)}:s.prototype._countBits=function(u){var m=u,y=0;return m>=4096&&(y+=13,m>>>=13),m>=64&&(y+=7,m>>>=7),m>=8&&(y+=4,m>>>=4),m>=2&&(y+=2,m>>>=2),y+m},s.prototype._zeroBits=function(u){if(u===0)return 26;var m=u,y=0;return(m&8191)===0&&(y+=13,m>>>=13),(m&127)===0&&(y+=7,m>>>=7),(m&15)===0&&(y+=4,m>>>=4),(m&3)===0&&(y+=2,m>>>=2),(m&1)===0&&y++,y},s.prototype.bitLength=function(){var u=this.words[this.length-1],m=this._countBits(u);return(this.length-1)*26+m};function h(T){for(var u=new Array(T.bitLength()),m=0;m<u.length;m++){var y=m/26|0,w=m%26;u[m]=(T.words[y]&1<<w)>>>w}return u}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var u=0,m=0;m<this.length;m++){var y=this._zeroBits(this.words[m]);if(u+=y,y!==26)break}return u},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(u){return this.negative!==0?this.abs().inotn(u).iaddn(1):this.clone()},s.prototype.fromTwos=function(u){return this.testn(u-1)?this.notn(u).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(u){for(;this.length<u.length;)this.words[this.length++]=0;for(var m=0;m<u.length;m++)this.words[m]=this.words[m]|u.words[m];return this.strip()},s.prototype.ior=function(u){return t((this.negative|u.negative)===0),this.iuor(u)},s.prototype.or=function(u){return this.length>u.length?this.clone().ior(u):u.clone().ior(this)},s.prototype.uor=function(u){return this.length>u.length?this.clone().iuor(u):u.clone().iuor(this)},s.prototype.iuand=function(u){var m;this.length>u.length?m=u:m=this;for(var y=0;y<m.length;y++)this.words[y]=this.words[y]&u.words[y];return this.length=m.length,this.strip()},s.prototype.iand=function(u){return t((this.negative|u.negative)===0),this.iuand(u)},s.prototype.and=function(u){return this.length>u.length?this.clone().iand(u):u.clone().iand(this)},s.prototype.uand=function(u){return this.length>u.length?this.clone().iuand(u):u.clone().iuand(this)},s.prototype.iuxor=function(u){var m,y;this.length>u.length?(m=this,y=u):(m=u,y=this);for(var w=0;w<y.length;w++)this.words[w]=m.words[w]^y.words[w];if(this!==m)for(;w<m.length;w++)this.words[w]=m.words[w];return this.length=m.length,this.strip()},s.prototype.ixor=function(u){return t((this.negative|u.negative)===0),this.iuxor(u)},s.prototype.xor=function(u){return this.length>u.length?this.clone().ixor(u):u.clone().ixor(this)},s.prototype.uxor=function(u){return this.length>u.length?this.clone().iuxor(u):u.clone().iuxor(this)},s.prototype.inotn=function(u){t(typeof u=="number"&&u>=0);var m=Math.ceil(u/26)|0,y=u%26;this._expand(m),y>0&&m--;for(var w=0;w<m;w++)this.words[w]=~this.words[w]&67108863;return y>0&&(this.words[w]=~this.words[w]&67108863>>26-y),this.strip()},s.prototype.notn=function(u){return this.clone().inotn(u)},s.prototype.setn=function(u,m){t(typeof u=="number"&&u>=0);var y=u/26|0,w=u%26;return this._expand(y+1),m?this.words[y]=this.words[y]|1<<w:this.words[y]=this.words[y]&~(1<<w),this.strip()},s.prototype.iadd=function(u){var m;if(this.negative!==0&&u.negative===0)return this.negative=0,m=this.isub(u),this.negative^=1,this._normSign();if(this.negative===0&&u.negative!==0)return u.negative=0,m=this.isub(u),u.negative=1,m._normSign();var y,w;this.length>u.length?(y=this,w=u):(y=u,w=this);for(var g=0,v=0;v<w.length;v++)m=(y.words[v]|0)+(w.words[v]|0)+g,this.words[v]=m&67108863,g=m>>>26;for(;g!==0&&v<y.length;v++)m=(y.words[v]|0)+g,this.words[v]=m&67108863,g=m>>>26;if(this.length=y.length,g!==0)this.words[this.length]=g,this.length++;else if(y!==this)for(;v<y.length;v++)this.words[v]=y.words[v];return this},s.prototype.add=function(u){var m;return u.negative!==0&&this.negative===0?(u.negative=0,m=this.sub(u),u.negative^=1,m):u.negative===0&&this.negative!==0?(this.negative=0,m=u.sub(this),this.negative=1,m):this.length>u.length?this.clone().iadd(u):u.clone().iadd(this)},s.prototype.isub=function(u){if(u.negative!==0){u.negative=0;var m=this.iadd(u);return u.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(u),this.negative=1,this._normSign();var y=this.cmp(u);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,g;y>0?(w=this,g=u):(w=u,g=this);for(var v=0,C=0;C<g.length;C++)m=(w.words[C]|0)-(g.words[C]|0)+v,v=m>>26,this.words[C]=m&67108863;for(;v!==0&&C<w.length;C++)m=(w.words[C]|0)+v,v=m>>26,this.words[C]=m&67108863;if(v===0&&C<w.length&&w!==this)for(;C<w.length;C++)this.words[C]=w.words[C];return this.length=Math.max(this.length,C),w!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(u){return this.clone().isub(u)};function x(T,u,m){m.negative=u.negative^T.negative;var y=T.length+u.length|0;m.length=y,y=y-1|0;var w=T.words[0]|0,g=u.words[0]|0,v=w*g,C=v&67108863,b=v/67108864|0;m.words[0]=C;for(var d=1;d<y;d++){for(var E=b>>>26,U=b&67108863,I=Math.min(d,u.length-1),D=Math.max(0,d-T.length+1);D<=I;D++){var $=d-D|0;w=T.words[$]|0,g=u.words[D]|0,v=w*g+U,E+=v/67108864|0,U=v&67108863}m.words[d]=U|0,b=E|0}return b!==0?m.words[d]=b|0:m.length--,m.strip()}var _=function(u,m,y){var w=u.words,g=m.words,v=y.words,C=0,b,d,E,U=w[0]|0,I=U&8191,D=U>>>13,$=w[1]|0,V=$&8191,B=$>>>13,ge=w[2]|0,se=ge&8191,R=ge>>>13,X=w[3]|0,k=X&8191,F=X>>>13,Q=w[4]|0,K=Q&8191,z=Q>>>13,ve=w[5]|0,re=ve&8191,Le=ve>>>13,hv=w[6]|0,De=hv&8191,Be=hv>>>13,mv=w[7]|0,je=mv&8191,Fe=mv>>>13,gv=w[8]|0,He=gv&8191,$e=gv>>>13,vv=w[9]|0,Ue=vv&8191,qe=vv>>>13,yv=g[0]|0,We=yv&8191,Ge=yv>>>13,xv=g[1]|0,ze=xv&8191,Ve=xv>>>13,_v=g[2]|0,Ke=_v&8191,Ye=_v>>>13,bv=g[3]|0,Xe=bv&8191,Je=bv>>>13,wv=g[4]|0,Qe=wv&8191,Ze=wv>>>13,Sv=g[5]|0,et=Sv&8191,tt=Sv>>>13,Ev=g[6]|0,rt=Ev&8191,nt=Ev>>>13,Tv=g[7]|0,st=Tv&8191,it=Tv>>>13,Cv=g[8]|0,ot=Cv&8191,at=Cv>>>13,Av=g[9]|0,ct=Av&8191,lt=Av>>>13;y.negative=u.negative^m.negative,y.length=19,b=Math.imul(I,We),d=Math.imul(I,Ge),d=d+Math.imul(D,We)|0,E=Math.imul(D,Ge);var fp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(fp>>>26)|0,fp&=67108863,b=Math.imul(V,We),d=Math.imul(V,Ge),d=d+Math.imul(B,We)|0,E=Math.imul(B,Ge),b=b+Math.imul(I,ze)|0,d=d+Math.imul(I,Ve)|0,d=d+Math.imul(D,ze)|0,E=E+Math.imul(D,Ve)|0;var dp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(dp>>>26)|0,dp&=67108863,b=Math.imul(se,We),d=Math.imul(se,Ge),d=d+Math.imul(R,We)|0,E=Math.imul(R,Ge),b=b+Math.imul(V,ze)|0,d=d+Math.imul(V,Ve)|0,d=d+Math.imul(B,ze)|0,E=E+Math.imul(B,Ve)|0,b=b+Math.imul(I,Ke)|0,d=d+Math.imul(I,Ye)|0,d=d+Math.imul(D,Ke)|0,E=E+Math.imul(D,Ye)|0;var hp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(hp>>>26)|0,hp&=67108863,b=Math.imul(k,We),d=Math.imul(k,Ge),d=d+Math.imul(F,We)|0,E=Math.imul(F,Ge),b=b+Math.imul(se,ze)|0,d=d+Math.imul(se,Ve)|0,d=d+Math.imul(R,ze)|0,E=E+Math.imul(R,Ve)|0,b=b+Math.imul(V,Ke)|0,d=d+Math.imul(V,Ye)|0,d=d+Math.imul(B,Ke)|0,E=E+Math.imul(B,Ye)|0,b=b+Math.imul(I,Xe)|0,d=d+Math.imul(I,Je)|0,d=d+Math.imul(D,Xe)|0,E=E+Math.imul(D,Je)|0;var mp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(mp>>>26)|0,mp&=67108863,b=Math.imul(K,We),d=Math.imul(K,Ge),d=d+Math.imul(z,We)|0,E=Math.imul(z,Ge),b=b+Math.imul(k,ze)|0,d=d+Math.imul(k,Ve)|0,d=d+Math.imul(F,ze)|0,E=E+Math.imul(F,Ve)|0,b=b+Math.imul(se,Ke)|0,d=d+Math.imul(se,Ye)|0,d=d+Math.imul(R,Ke)|0,E=E+Math.imul(R,Ye)|0,b=b+Math.imul(V,Xe)|0,d=d+Math.imul(V,Je)|0,d=d+Math.imul(B,Xe)|0,E=E+Math.imul(B,Je)|0,b=b+Math.imul(I,Qe)|0,d=d+Math.imul(I,Ze)|0,d=d+Math.imul(D,Qe)|0,E=E+Math.imul(D,Ze)|0;var gp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(gp>>>26)|0,gp&=67108863,b=Math.imul(re,We),d=Math.imul(re,Ge),d=d+Math.imul(Le,We)|0,E=Math.imul(Le,Ge),b=b+Math.imul(K,ze)|0,d=d+Math.imul(K,Ve)|0,d=d+Math.imul(z,ze)|0,E=E+Math.imul(z,Ve)|0,b=b+Math.imul(k,Ke)|0,d=d+Math.imul(k,Ye)|0,d=d+Math.imul(F,Ke)|0,E=E+Math.imul(F,Ye)|0,b=b+Math.imul(se,Xe)|0,d=d+Math.imul(se,Je)|0,d=d+Math.imul(R,Xe)|0,E=E+Math.imul(R,Je)|0,b=b+Math.imul(V,Qe)|0,d=d+Math.imul(V,Ze)|0,d=d+Math.imul(B,Qe)|0,E=E+Math.imul(B,Ze)|0,b=b+Math.imul(I,et)|0,d=d+Math.imul(I,tt)|0,d=d+Math.imul(D,et)|0,E=E+Math.imul(D,tt)|0;var vp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(vp>>>26)|0,vp&=67108863,b=Math.imul(De,We),d=Math.imul(De,Ge),d=d+Math.imul(Be,We)|0,E=Math.imul(Be,Ge),b=b+Math.imul(re,ze)|0,d=d+Math.imul(re,Ve)|0,d=d+Math.imul(Le,ze)|0,E=E+Math.imul(Le,Ve)|0,b=b+Math.imul(K,Ke)|0,d=d+Math.imul(K,Ye)|0,d=d+Math.imul(z,Ke)|0,E=E+Math.imul(z,Ye)|0,b=b+Math.imul(k,Xe)|0,d=d+Math.imul(k,Je)|0,d=d+Math.imul(F,Xe)|0,E=E+Math.imul(F,Je)|0,b=b+Math.imul(se,Qe)|0,d=d+Math.imul(se,Ze)|0,d=d+Math.imul(R,Qe)|0,E=E+Math.imul(R,Ze)|0,b=b+Math.imul(V,et)|0,d=d+Math.imul(V,tt)|0,d=d+Math.imul(B,et)|0,E=E+Math.imul(B,tt)|0,b=b+Math.imul(I,rt)|0,d=d+Math.imul(I,nt)|0,d=d+Math.imul(D,rt)|0,E=E+Math.imul(D,nt)|0;var yp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(yp>>>26)|0,yp&=67108863,b=Math.imul(je,We),d=Math.imul(je,Ge),d=d+Math.imul(Fe,We)|0,E=Math.imul(Fe,Ge),b=b+Math.imul(De,ze)|0,d=d+Math.imul(De,Ve)|0,d=d+Math.imul(Be,ze)|0,E=E+Math.imul(Be,Ve)|0,b=b+Math.imul(re,Ke)|0,d=d+Math.imul(re,Ye)|0,d=d+Math.imul(Le,Ke)|0,E=E+Math.imul(Le,Ye)|0,b=b+Math.imul(K,Xe)|0,d=d+Math.imul(K,Je)|0,d=d+Math.imul(z,Xe)|0,E=E+Math.imul(z,Je)|0,b=b+Math.imul(k,Qe)|0,d=d+Math.imul(k,Ze)|0,d=d+Math.imul(F,Qe)|0,E=E+Math.imul(F,Ze)|0,b=b+Math.imul(se,et)|0,d=d+Math.imul(se,tt)|0,d=d+Math.imul(R,et)|0,E=E+Math.imul(R,tt)|0,b=b+Math.imul(V,rt)|0,d=d+Math.imul(V,nt)|0,d=d+Math.imul(B,rt)|0,E=E+Math.imul(B,nt)|0,b=b+Math.imul(I,st)|0,d=d+Math.imul(I,it)|0,d=d+Math.imul(D,st)|0,E=E+Math.imul(D,it)|0;var xp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(xp>>>26)|0,xp&=67108863,b=Math.imul(He,We),d=Math.imul(He,Ge),d=d+Math.imul($e,We)|0,E=Math.imul($e,Ge),b=b+Math.imul(je,ze)|0,d=d+Math.imul(je,Ve)|0,d=d+Math.imul(Fe,ze)|0,E=E+Math.imul(Fe,Ve)|0,b=b+Math.imul(De,Ke)|0,d=d+Math.imul(De,Ye)|0,d=d+Math.imul(Be,Ke)|0,E=E+Math.imul(Be,Ye)|0,b=b+Math.imul(re,Xe)|0,d=d+Math.imul(re,Je)|0,d=d+Math.imul(Le,Xe)|0,E=E+Math.imul(Le,Je)|0,b=b+Math.imul(K,Qe)|0,d=d+Math.imul(K,Ze)|0,d=d+Math.imul(z,Qe)|0,E=E+Math.imul(z,Ze)|0,b=b+Math.imul(k,et)|0,d=d+Math.imul(k,tt)|0,d=d+Math.imul(F,et)|0,E=E+Math.imul(F,tt)|0,b=b+Math.imul(se,rt)|0,d=d+Math.imul(se,nt)|0,d=d+Math.imul(R,rt)|0,E=E+Math.imul(R,nt)|0,b=b+Math.imul(V,st)|0,d=d+Math.imul(V,it)|0,d=d+Math.imul(B,st)|0,E=E+Math.imul(B,it)|0,b=b+Math.imul(I,ot)|0,d=d+Math.imul(I,at)|0,d=d+Math.imul(D,ot)|0,E=E+Math.imul(D,at)|0;var _p=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(_p>>>26)|0,_p&=67108863,b=Math.imul(Ue,We),d=Math.imul(Ue,Ge),d=d+Math.imul(qe,We)|0,E=Math.imul(qe,Ge),b=b+Math.imul(He,ze)|0,d=d+Math.imul(He,Ve)|0,d=d+Math.imul($e,ze)|0,E=E+Math.imul($e,Ve)|0,b=b+Math.imul(je,Ke)|0,d=d+Math.imul(je,Ye)|0,d=d+Math.imul(Fe,Ke)|0,E=E+Math.imul(Fe,Ye)|0,b=b+Math.imul(De,Xe)|0,d=d+Math.imul(De,Je)|0,d=d+Math.imul(Be,Xe)|0,E=E+Math.imul(Be,Je)|0,b=b+Math.imul(re,Qe)|0,d=d+Math.imul(re,Ze)|0,d=d+Math.imul(Le,Qe)|0,E=E+Math.imul(Le,Ze)|0,b=b+Math.imul(K,et)|0,d=d+Math.imul(K,tt)|0,d=d+Math.imul(z,et)|0,E=E+Math.imul(z,tt)|0,b=b+Math.imul(k,rt)|0,d=d+Math.imul(k,nt)|0,d=d+Math.imul(F,rt)|0,E=E+Math.imul(F,nt)|0,b=b+Math.imul(se,st)|0,d=d+Math.imul(se,it)|0,d=d+Math.imul(R,st)|0,E=E+Math.imul(R,it)|0,b=b+Math.imul(V,ot)|0,d=d+Math.imul(V,at)|0,d=d+Math.imul(B,ot)|0,E=E+Math.imul(B,at)|0,b=b+Math.imul(I,ct)|0,d=d+Math.imul(I,lt)|0,d=d+Math.imul(D,ct)|0,E=E+Math.imul(D,lt)|0;var bp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(bp>>>26)|0,bp&=67108863,b=Math.imul(Ue,ze),d=Math.imul(Ue,Ve),d=d+Math.imul(qe,ze)|0,E=Math.imul(qe,Ve),b=b+Math.imul(He,Ke)|0,d=d+Math.imul(He,Ye)|0,d=d+Math.imul($e,Ke)|0,E=E+Math.imul($e,Ye)|0,b=b+Math.imul(je,Xe)|0,d=d+Math.imul(je,Je)|0,d=d+Math.imul(Fe,Xe)|0,E=E+Math.imul(Fe,Je)|0,b=b+Math.imul(De,Qe)|0,d=d+Math.imul(De,Ze)|0,d=d+Math.imul(Be,Qe)|0,E=E+Math.imul(Be,Ze)|0,b=b+Math.imul(re,et)|0,d=d+Math.imul(re,tt)|0,d=d+Math.imul(Le,et)|0,E=E+Math.imul(Le,tt)|0,b=b+Math.imul(K,rt)|0,d=d+Math.imul(K,nt)|0,d=d+Math.imul(z,rt)|0,E=E+Math.imul(z,nt)|0,b=b+Math.imul(k,st)|0,d=d+Math.imul(k,it)|0,d=d+Math.imul(F,st)|0,E=E+Math.imul(F,it)|0,b=b+Math.imul(se,ot)|0,d=d+Math.imul(se,at)|0,d=d+Math.imul(R,ot)|0,E=E+Math.imul(R,at)|0,b=b+Math.imul(V,ct)|0,d=d+Math.imul(V,lt)|0,d=d+Math.imul(B,ct)|0,E=E+Math.imul(B,lt)|0;var wp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(wp>>>26)|0,wp&=67108863,b=Math.imul(Ue,Ke),d=Math.imul(Ue,Ye),d=d+Math.imul(qe,Ke)|0,E=Math.imul(qe,Ye),b=b+Math.imul(He,Xe)|0,d=d+Math.imul(He,Je)|0,d=d+Math.imul($e,Xe)|0,E=E+Math.imul($e,Je)|0,b=b+Math.imul(je,Qe)|0,d=d+Math.imul(je,Ze)|0,d=d+Math.imul(Fe,Qe)|0,E=E+Math.imul(Fe,Ze)|0,b=b+Math.imul(De,et)|0,d=d+Math.imul(De,tt)|0,d=d+Math.imul(Be,et)|0,E=E+Math.imul(Be,tt)|0,b=b+Math.imul(re,rt)|0,d=d+Math.imul(re,nt)|0,d=d+Math.imul(Le,rt)|0,E=E+Math.imul(Le,nt)|0,b=b+Math.imul(K,st)|0,d=d+Math.imul(K,it)|0,d=d+Math.imul(z,st)|0,E=E+Math.imul(z,it)|0,b=b+Math.imul(k,ot)|0,d=d+Math.imul(k,at)|0,d=d+Math.imul(F,ot)|0,E=E+Math.imul(F,at)|0,b=b+Math.imul(se,ct)|0,d=d+Math.imul(se,lt)|0,d=d+Math.imul(R,ct)|0,E=E+Math.imul(R,lt)|0;var Sp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Sp>>>26)|0,Sp&=67108863,b=Math.imul(Ue,Xe),d=Math.imul(Ue,Je),d=d+Math.imul(qe,Xe)|0,E=Math.imul(qe,Je),b=b+Math.imul(He,Qe)|0,d=d+Math.imul(He,Ze)|0,d=d+Math.imul($e,Qe)|0,E=E+Math.imul($e,Ze)|0,b=b+Math.imul(je,et)|0,d=d+Math.imul(je,tt)|0,d=d+Math.imul(Fe,et)|0,E=E+Math.imul(Fe,tt)|0,b=b+Math.imul(De,rt)|0,d=d+Math.imul(De,nt)|0,d=d+Math.imul(Be,rt)|0,E=E+Math.imul(Be,nt)|0,b=b+Math.imul(re,st)|0,d=d+Math.imul(re,it)|0,d=d+Math.imul(Le,st)|0,E=E+Math.imul(Le,it)|0,b=b+Math.imul(K,ot)|0,d=d+Math.imul(K,at)|0,d=d+Math.imul(z,ot)|0,E=E+Math.imul(z,at)|0,b=b+Math.imul(k,ct)|0,d=d+Math.imul(k,lt)|0,d=d+Math.imul(F,ct)|0,E=E+Math.imul(F,lt)|0;var Ep=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Ep>>>26)|0,Ep&=67108863,b=Math.imul(Ue,Qe),d=Math.imul(Ue,Ze),d=d+Math.imul(qe,Qe)|0,E=Math.imul(qe,Ze),b=b+Math.imul(He,et)|0,d=d+Math.imul(He,tt)|0,d=d+Math.imul($e,et)|0,E=E+Math.imul($e,tt)|0,b=b+Math.imul(je,rt)|0,d=d+Math.imul(je,nt)|0,d=d+Math.imul(Fe,rt)|0,E=E+Math.imul(Fe,nt)|0,b=b+Math.imul(De,st)|0,d=d+Math.imul(De,it)|0,d=d+Math.imul(Be,st)|0,E=E+Math.imul(Be,it)|0,b=b+Math.imul(re,ot)|0,d=d+Math.imul(re,at)|0,d=d+Math.imul(Le,ot)|0,E=E+Math.imul(Le,at)|0,b=b+Math.imul(K,ct)|0,d=d+Math.imul(K,lt)|0,d=d+Math.imul(z,ct)|0,E=E+Math.imul(z,lt)|0;var Tp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Tp>>>26)|0,Tp&=67108863,b=Math.imul(Ue,et),d=Math.imul(Ue,tt),d=d+Math.imul(qe,et)|0,E=Math.imul(qe,tt),b=b+Math.imul(He,rt)|0,d=d+Math.imul(He,nt)|0,d=d+Math.imul($e,rt)|0,E=E+Math.imul($e,nt)|0,b=b+Math.imul(je,st)|0,d=d+Math.imul(je,it)|0,d=d+Math.imul(Fe,st)|0,E=E+Math.imul(Fe,it)|0,b=b+Math.imul(De,ot)|0,d=d+Math.imul(De,at)|0,d=d+Math.imul(Be,ot)|0,E=E+Math.imul(Be,at)|0,b=b+Math.imul(re,ct)|0,d=d+Math.imul(re,lt)|0,d=d+Math.imul(Le,ct)|0,E=E+Math.imul(Le,lt)|0;var Cp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Cp>>>26)|0,Cp&=67108863,b=Math.imul(Ue,rt),d=Math.imul(Ue,nt),d=d+Math.imul(qe,rt)|0,E=Math.imul(qe,nt),b=b+Math.imul(He,st)|0,d=d+Math.imul(He,it)|0,d=d+Math.imul($e,st)|0,E=E+Math.imul($e,it)|0,b=b+Math.imul(je,ot)|0,d=d+Math.imul(je,at)|0,d=d+Math.imul(Fe,ot)|0,E=E+Math.imul(Fe,at)|0,b=b+Math.imul(De,ct)|0,d=d+Math.imul(De,lt)|0,d=d+Math.imul(Be,ct)|0,E=E+Math.imul(Be,lt)|0;var Ap=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Ap>>>26)|0,Ap&=67108863,b=Math.imul(Ue,st),d=Math.imul(Ue,it),d=d+Math.imul(qe,st)|0,E=Math.imul(qe,it),b=b+Math.imul(He,ot)|0,d=d+Math.imul(He,at)|0,d=d+Math.imul($e,ot)|0,E=E+Math.imul($e,at)|0,b=b+Math.imul(je,ct)|0,d=d+Math.imul(je,lt)|0,d=d+Math.imul(Fe,ct)|0,E=E+Math.imul(Fe,lt)|0;var Rp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Rp>>>26)|0,Rp&=67108863,b=Math.imul(Ue,ot),d=Math.imul(Ue,at),d=d+Math.imul(qe,ot)|0,E=Math.imul(qe,at),b=b+Math.imul(He,ct)|0,d=d+Math.imul(He,lt)|0,d=d+Math.imul($e,ct)|0,E=E+Math.imul($e,lt)|0;var kp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(kp>>>26)|0,kp&=67108863,b=Math.imul(Ue,ct),d=Math.imul(Ue,lt),d=d+Math.imul(qe,ct)|0,E=Math.imul(qe,lt);var Op=(C+b|0)+((d&8191)<<13)|0;return C=(E+(d>>>13)|0)+(Op>>>26)|0,Op&=67108863,v[0]=fp,v[1]=dp,v[2]=hp,v[3]=mp,v[4]=gp,v[5]=vp,v[6]=yp,v[7]=xp,v[8]=_p,v[9]=bp,v[10]=wp,v[11]=Sp,v[12]=Ep,v[13]=Tp,v[14]=Cp,v[15]=Ap,v[16]=Rp,v[17]=kp,v[18]=Op,C!==0&&(v[19]=C,y.length++),y};Math.imul||(_=x);function S(T,u,m){m.negative=u.negative^T.negative,m.length=T.length+u.length;for(var y=0,w=0,g=0;g<m.length-1;g++){var v=w;w=0;for(var C=y&67108863,b=Math.min(g,u.length-1),d=Math.max(0,g-T.length+1);d<=b;d++){var E=g-d,U=T.words[E]|0,I=u.words[d]|0,D=U*I,$=D&67108863;v=v+(D/67108864|0)|0,$=$+C|0,C=$&67108863,v=v+($>>>26)|0,w+=v>>>26,v&=67108863}m.words[g]=C,y=v,v=w}return y!==0?m.words[g]=y:m.length--,m.strip()}function A(T,u,m){var y=new M;return y.mulp(T,u,m)}s.prototype.mulTo=function(u,m){var y,w=this.length+u.length;return this.length===10&&u.length===10?y=_(this,u,m):w<63?y=x(this,u,m):w<1024?y=S(this,u,m):y=A(this,u,m),y};function M(T,u){this.x=T,this.y=u}M.prototype.makeRBT=function(u){for(var m=new Array(u),y=s.prototype._countBits(u)-1,w=0;w<u;w++)m[w]=this.revBin(w,y,u);return m},M.prototype.revBin=function(u,m,y){if(u===0||u===y-1)return u;for(var w=0,g=0;g<m;g++)w|=(u&1)<<m-g-1,u>>=1;return w},M.prototype.permute=function(u,m,y,w,g,v){for(var C=0;C<v;C++)w[C]=m[u[C]],g[C]=y[u[C]]},M.prototype.transform=function(u,m,y,w,g,v){this.permute(v,u,m,y,w,g);for(var C=1;C<g;C<<=1)for(var b=C<<1,d=Math.cos(2*Math.PI/b),E=Math.sin(2*Math.PI/b),U=0;U<g;U+=b)for(var I=d,D=E,$=0;$<C;$++){var V=y[U+$],B=w[U+$],ge=y[U+$+C],se=w[U+$+C],R=I*ge-D*se;se=I*se+D*ge,ge=R,y[U+$]=V+ge,w[U+$]=B+se,y[U+$+C]=V-ge,w[U+$+C]=B-se,$!==b&&(R=d*I-E*D,D=d*D+E*I,I=R)}},M.prototype.guessLen13b=function(u,m){var y=Math.max(m,u)|1,w=y&1,g=0;for(y=y/2|0;y;y=y>>>1)g++;return 1<<g+1+w},M.prototype.conjugate=function(u,m,y){if(!(y<=1))for(var w=0;w<y/2;w++){var g=u[w];u[w]=u[y-w-1],u[y-w-1]=g,g=m[w],m[w]=-m[y-w-1],m[y-w-1]=-g}},M.prototype.normalize13b=function(u,m){for(var y=0,w=0;w<m/2;w++){var g=Math.round(u[2*w+1]/m)*8192+Math.round(u[2*w]/m)+y;u[w]=g&67108863,g<67108864?y=0:y=g/67108864|0}return u},M.prototype.convert13b=function(u,m,y,w){for(var g=0,v=0;v<m;v++)g=g+(u[v]|0),y[2*v]=g&8191,g=g>>>13,y[2*v+1]=g&8191,g=g>>>13;for(v=2*m;v<w;++v)y[v]=0;t(g===0),t((g&-8192)===0)},M.prototype.stub=function(u){for(var m=new Array(u),y=0;y<u;y++)m[y]=0;return m},M.prototype.mulp=function(u,m,y){var w=2*this.guessLen13b(u.length,m.length),g=this.makeRBT(w),v=this.stub(w),C=new Array(w),b=new Array(w),d=new Array(w),E=new Array(w),U=new Array(w),I=new Array(w),D=y.words;D.length=w,this.convert13b(u.words,u.length,C,w),this.convert13b(m.words,m.length,E,w),this.transform(C,v,b,d,w,g),this.transform(E,v,U,I,w,g);for(var $=0;$<w;$++){var V=b[$]*U[$]-d[$]*I[$];d[$]=b[$]*I[$]+d[$]*U[$],b[$]=V}return this.conjugate(b,d,w),this.transform(b,d,D,v,w,g),this.conjugate(D,v,w),this.normalize13b(D,w),y.negative=u.negative^m.negative,y.length=u.length+m.length,y.strip()},s.prototype.mul=function(u){var m=new s(null);return m.words=new Array(this.length+u.length),this.mulTo(u,m)},s.prototype.mulf=function(u){var m=new s(null);return m.words=new Array(this.length+u.length),A(this,u,m)},s.prototype.imul=function(u){return this.clone().mulTo(u,this)},s.prototype.imuln=function(u){t(typeof u=="number"),t(u<67108864);for(var m=0,y=0;y<this.length;y++){var w=(this.words[y]|0)*u,g=(w&67108863)+(m&67108863);m>>=26,m+=w/67108864|0,m+=g>>>26,this.words[y]=g&67108863}return m!==0&&(this.words[y]=m,this.length++),this.length=u===0?1:this.length,this},s.prototype.muln=function(u){return this.clone().imuln(u)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(u){var m=h(u);if(m.length===0)return new s(1);for(var y=this,w=0;w<m.length&&m[w]===0;w++,y=y.sqr());if(++w<m.length)for(var g=y.sqr();w<m.length;w++,g=g.sqr())m[w]!==0&&(y=y.mul(g));return y},s.prototype.iushln=function(u){t(typeof u=="number"&&u>=0);var m=u%26,y=(u-m)/26,w=67108863>>>26-m<<26-m,g;if(m!==0){var v=0;for(g=0;g<this.length;g++){var C=this.words[g]&w,b=(this.words[g]|0)-C<<m;this.words[g]=b|v,v=C>>>26-m}v&&(this.words[g]=v,this.length++)}if(y!==0){for(g=this.length-1;g>=0;g--)this.words[g+y]=this.words[g];for(g=0;g<y;g++)this.words[g]=0;this.length+=y}return this.strip()},s.prototype.ishln=function(u){return t(this.negative===0),this.iushln(u)},s.prototype.iushrn=function(u,m,y){t(typeof u=="number"&&u>=0);var w;m?w=(m-m%26)/26:w=0;var g=u%26,v=Math.min((u-g)/26,this.length),C=67108863^67108863>>>g<<g,b=y;if(w-=v,w=Math.max(0,w),b){for(var d=0;d<v;d++)b.words[d]=this.words[d];b.length=v}if(v!==0)if(this.length>v)for(this.length-=v,d=0;d<this.length;d++)this.words[d]=this.words[d+v];else this.words[0]=0,this.length=1;var E=0;for(d=this.length-1;d>=0&&(E!==0||d>=w);d--){var U=this.words[d]|0;this.words[d]=E<<26-g|U>>>g,E=U&C}return b&&E!==0&&(b.words[b.length++]=E),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(u,m,y){return t(this.negative===0),this.iushrn(u,m,y)},s.prototype.shln=function(u){return this.clone().ishln(u)},s.prototype.ushln=function(u){return this.clone().iushln(u)},s.prototype.shrn=function(u){return this.clone().ishrn(u)},s.prototype.ushrn=function(u){return this.clone().iushrn(u)},s.prototype.testn=function(u){t(typeof u=="number"&&u>=0);var m=u%26,y=(u-m)/26,w=1<<m;if(this.length<=y)return!1;var g=this.words[y];return!!(g&w)},s.prototype.imaskn=function(u){t(typeof u=="number"&&u>=0);var m=u%26,y=(u-m)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(m!==0&&y++,this.length=Math.min(y,this.length),m!==0){var w=67108863^67108863>>>m<<m;this.words[this.length-1]&=w}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.maskn=function(u){return this.clone().imaskn(u)},s.prototype.iaddn=function(u){return t(typeof u=="number"),t(u<67108864),u<0?this.isubn(-u):this.negative!==0?this.length===1&&(this.words[0]|0)<u?(this.words[0]=u-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(u),this.negative=1,this):this._iaddn(u)},s.prototype._iaddn=function(u){this.words[0]+=u;for(var m=0;m<this.length&&this.words[m]>=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},s.prototype.isubn=function(u){if(t(typeof u=="number"),t(u<67108864),u<0)return this.iaddn(-u);if(this.negative!==0)return this.negative=0,this.iaddn(u),this.negative=1,this;if(this.words[0]-=u,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m<this.length&&this.words[m]<0;m++)this.words[m]+=67108864,this.words[m+1]-=1;return this.strip()},s.prototype.addn=function(u){return this.clone().iaddn(u)},s.prototype.subn=function(u){return this.clone().isubn(u)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(u,m,y){var w=u.length+y,g;this._expand(w);var v,C=0;for(g=0;g<u.length;g++){v=(this.words[g+y]|0)+C;var b=(u.words[g]|0)*m;v-=b&67108863,C=(v>>26)-(b/67108864|0),this.words[g+y]=v&67108863}for(;g<this.length-y;g++)v=(this.words[g+y]|0)+C,C=v>>26,this.words[g+y]=v&67108863;if(C===0)return this.strip();for(t(C===-1),C=0,g=0;g<this.length;g++)v=-(this.words[g]|0)+C,C=v>>26,this.words[g]=v&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(u,m){var y=this.length-u.length,w=this.clone(),g=u,v=g.words[g.length-1]|0,C=this._countBits(v);y=26-C,y!==0&&(g=g.ushln(y),w.iushln(y),v=g.words[g.length-1]|0);var b=w.length-g.length,d;if(m!=="mod"){d=new s(null),d.length=b+1,d.words=new Array(d.length);for(var E=0;E<d.length;E++)d.words[E]=0}var U=w.clone()._ishlnsubmul(g,1,b);U.negative===0&&(w=U,d&&(d.words[b]=1));for(var I=b-1;I>=0;I--){var D=(w.words[g.length+I]|0)*67108864+(w.words[g.length+I-1]|0);for(D=Math.min(D/v|0,67108863),w._ishlnsubmul(g,D,I);w.negative!==0;)D--,w.negative=0,w._ishlnsubmul(g,1,I),w.isZero()||(w.negative^=1);d&&(d.words[I]=D)}return d&&d.strip(),w.strip(),m!=="div"&&y!==0&&w.iushrn(y),{div:d||null,mod:w}},s.prototype.divmod=function(u,m,y){if(t(!u.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var w,g,v;return this.negative!==0&&u.negative===0?(v=this.neg().divmod(u,m),m!=="mod"&&(w=v.div.neg()),m!=="div"&&(g=v.mod.neg(),y&&g.negative!==0&&g.iadd(u)),{div:w,mod:g}):this.negative===0&&u.negative!==0?(v=this.divmod(u.neg(),m),m!=="mod"&&(w=v.div.neg()),{div:w,mod:v.mod}):(this.negative&u.negative)!==0?(v=this.neg().divmod(u.neg(),m),m!=="div"&&(g=v.mod.neg(),y&&g.negative!==0&&g.isub(u)),{div:v.div,mod:g}):u.length>this.length||this.cmp(u)<0?{div:new s(0),mod:this}:u.length===1?m==="div"?{div:this.divn(u.words[0]),mod:null}:m==="mod"?{div:null,mod:new s(this.modn(u.words[0]))}:{div:this.divn(u.words[0]),mod:new s(this.modn(u.words[0]))}:this._wordDiv(u,m)},s.prototype.div=function(u){return this.divmod(u,"div",!1).div},s.prototype.mod=function(u){return this.divmod(u,"mod",!1).mod},s.prototype.umod=function(u){return this.divmod(u,"mod",!0).mod},s.prototype.divRound=function(u){var m=this.divmod(u);if(m.mod.isZero())return m.div;var y=m.div.negative!==0?m.mod.isub(u):m.mod,w=u.ushrn(1),g=u.andln(1),v=y.cmp(w);return v<0||g===1&&v===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},s.prototype.modn=function(u){t(u<=67108863);for(var m=(1<<26)%u,y=0,w=this.length-1;w>=0;w--)y=(m*y+(this.words[w]|0))%u;return y},s.prototype.idivn=function(u){t(u<=67108863);for(var m=0,y=this.length-1;y>=0;y--){var w=(this.words[y]|0)+m*67108864;this.words[y]=w/u|0,m=w%u}return this.strip()},s.prototype.divn=function(u){return this.clone().idivn(u)},s.prototype.egcd=function(u){t(u.negative===0),t(!u.isZero());var m=this,y=u.clone();m.negative!==0?m=m.umod(u):m=m.clone();for(var w=new s(1),g=new s(0),v=new s(0),C=new s(1),b=0;m.isEven()&&y.isEven();)m.iushrn(1),y.iushrn(1),++b;for(var d=y.clone(),E=m.clone();!m.isZero();){for(var U=0,I=1;(m.words[0]&I)===0&&U<26;++U,I<<=1);if(U>0)for(m.iushrn(U);U-- >0;)(w.isOdd()||g.isOdd())&&(w.iadd(d),g.isub(E)),w.iushrn(1),g.iushrn(1);for(var D=0,$=1;(y.words[0]&$)===0&&D<26;++D,$<<=1);if(D>0)for(y.iushrn(D);D-- >0;)(v.isOdd()||C.isOdd())&&(v.iadd(d),C.isub(E)),v.iushrn(1),C.iushrn(1);m.cmp(y)>=0?(m.isub(y),w.isub(v),g.isub(C)):(y.isub(m),v.isub(w),C.isub(g))}return{a:v,b:C,gcd:y.iushln(b)}},s.prototype._invmp=function(u){t(u.negative===0),t(!u.isZero());var m=this,y=u.clone();m.negative!==0?m=m.umod(u):m=m.clone();for(var w=new s(1),g=new s(0),v=y.clone();m.cmpn(1)>0&&y.cmpn(1)>0;){for(var C=0,b=1;(m.words[0]&b)===0&&C<26;++C,b<<=1);if(C>0)for(m.iushrn(C);C-- >0;)w.isOdd()&&w.iadd(v),w.iushrn(1);for(var d=0,E=1;(y.words[0]&E)===0&&d<26;++d,E<<=1);if(d>0)for(y.iushrn(d);d-- >0;)g.isOdd()&&g.iadd(v),g.iushrn(1);m.cmp(y)>=0?(m.isub(y),w.isub(g)):(y.isub(m),g.isub(w))}var U;return m.cmpn(1)===0?U=w:U=g,U.cmpn(0)<0&&U.iadd(u),U},s.prototype.gcd=function(u){if(this.isZero())return u.abs();if(u.isZero())return this.abs();var m=this.clone(),y=u.clone();m.negative=0,y.negative=0;for(var w=0;m.isEven()&&y.isEven();w++)m.iushrn(1),y.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;y.isEven();)y.iushrn(1);var g=m.cmp(y);if(g<0){var v=m;m=y,y=v}else if(g===0||y.cmpn(1)===0)break;m.isub(y)}while(!0);return y.iushln(w)},s.prototype.invm=function(u){return this.egcd(u).a.umod(u)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(u){return this.words[0]&u},s.prototype.bincn=function(u){t(typeof u=="number");var m=u%26,y=(u-m)/26,w=1<<m;if(this.length<=y)return this._expand(y+1),this.words[y]|=w,this;for(var g=w,v=y;g!==0&&v<this.length;v++){var C=this.words[v]|0;C+=g,g=C>>>26,C&=67108863,this.words[v]=C}return g!==0&&(this.words[v]=g,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(u){var m=u<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this.strip();var y;if(this.length>1)y=1;else{m&&(u=-u),t(u<=67108863,"Number is too big");var w=this.words[0]|0;y=w===u?0:w<u?-1:1}return this.negative!==0?-y|0:y},s.prototype.cmp=function(u){if(this.negative!==0&&u.negative===0)return-1;if(this.negative===0&&u.negative!==0)return 1;var m=this.ucmp(u);return this.negative!==0?-m|0:m},s.prototype.ucmp=function(u){if(this.length>u.length)return 1;if(this.length<u.length)return-1;for(var m=0,y=this.length-1;y>=0;y--){var w=this.words[y]|0,g=u.words[y]|0;if(w!==g){w<g?m=-1:w>g&&(m=1);break}}return m},s.prototype.gtn=function(u){return this.cmpn(u)===1},s.prototype.gt=function(u){return this.cmp(u)===1},s.prototype.gten=function(u){return this.cmpn(u)>=0},s.prototype.gte=function(u){return this.cmp(u)>=0},s.prototype.ltn=function(u){return this.cmpn(u)===-1},s.prototype.lt=function(u){return this.cmp(u)===-1},s.prototype.lten=function(u){return this.cmpn(u)<=0},s.prototype.lte=function(u){return this.cmp(u)<=0},s.prototype.eqn=function(u){return this.cmpn(u)===0},s.prototype.eq=function(u){return this.cmp(u)===0},s.red=function(u){return new P(u)},s.prototype.toRed=function(u){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),u.convertTo(this)._forceRed(u)},s.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(u){return this.red=u,this},s.prototype.forceRed=function(u){return t(!this.red,"Already a number in reduction context"),this._forceRed(u)},s.prototype.redAdd=function(u){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,u)},s.prototype.redIAdd=function(u){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,u)},s.prototype.redSub=function(u){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,u)},s.prototype.redISub=function(u){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,u)},s.prototype.redShl=function(u){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,u)},s.prototype.redMul=function(u){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.mul(this,u)},s.prototype.redIMul=function(u){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.imul(this,u)},s.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(u){return t(this.red&&!u.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,u)};var N={k256:null,p224:null,p192:null,p25519:null};function L(T,u){this.name=T,this.p=new s(u,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}L.prototype._tmp=function(){var u=new s(null);return u.words=new Array(Math.ceil(this.n/13)),u},L.prototype.ireduce=function(u){var m=u,y;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),y=m.bitLength();while(y>this.n);var w=y<this.n?-1:m.ucmp(this.p);return w===0?(m.words[0]=0,m.length=1):w>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},L.prototype.split=function(u,m){u.iushrn(this.n,0,m)},L.prototype.imulK=function(u){return u.imul(this.k)};function j(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(j,L),j.prototype.split=function(u,m){for(var y=4194303,w=Math.min(u.length,9),g=0;g<w;g++)m.words[g]=u.words[g];if(m.length=w,u.length<=9){u.words[0]=0,u.length=1;return}var v=u.words[9];for(m.words[m.length++]=v&y,g=10;g<u.length;g++){var C=u.words[g]|0;u.words[g-10]=(C&y)<<4|v>>>22,v=C}v>>>=22,u.words[g-10]=v,v===0&&u.length>10?u.length-=10:u.length-=9},j.prototype.imulK=function(u){u.words[u.length]=0,u.words[u.length+1]=0,u.length+=2;for(var m=0,y=0;y<u.length;y++){var w=u.words[y]|0;m+=w*977,u.words[y]=m&67108863,m=w*64+(m/67108864|0)}return u.words[u.length-1]===0&&(u.length--,u.words[u.length-1]===0&&u.length--),u};function W(){L.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(W,L);function q(){L.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(q,L);function G(){L.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(G,L),G.prototype.imulK=function(u){for(var m=0,y=0;y<u.length;y++){var w=(u.words[y]|0)*19+m,g=w&67108863;w>>>=26,u.words[y]=g,m=w}return m!==0&&(u.words[u.length++]=m),u},s._prime=function(u){if(N[u])return N[u];var m;if(u==="k256")m=new j;else if(u==="p224")m=new W;else if(u==="p192")m=new q;else if(u==="p25519")m=new G;else throw new Error("Unknown prime "+u);return N[u]=m,m};function P(T){if(typeof T=="string"){var u=s._prime(T);this.m=u.p,this.prime=u}else t(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}P.prototype._verify1=function(u){t(u.negative===0,"red works only with positives"),t(u.red,"red works only with red numbers")},P.prototype._verify2=function(u,m){t((u.negative|m.negative)===0,"red works only with positives"),t(u.red&&u.red===m.red,"red works only with red numbers")},P.prototype.imod=function(u){return this.prime?this.prime.ireduce(u)._forceRed(this):u.umod(this.m)._forceRed(this)},P.prototype.neg=function(u){return u.isZero()?u.clone():this.m.sub(u)._forceRed(this)},P.prototype.add=function(u,m){this._verify2(u,m);var y=u.add(m);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},P.prototype.iadd=function(u,m){this._verify2(u,m);var y=u.iadd(m);return y.cmp(this.m)>=0&&y.isub(this.m),y},P.prototype.sub=function(u,m){this._verify2(u,m);var y=u.sub(m);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},P.prototype.isub=function(u,m){this._verify2(u,m);var y=u.isub(m);return y.cmpn(0)<0&&y.iadd(this.m),y},P.prototype.shl=function(u,m){return this._verify1(u),this.imod(u.ushln(m))},P.prototype.imul=function(u,m){return this._verify2(u,m),this.imod(u.imul(m))},P.prototype.mul=function(u,m){return this._verify2(u,m),this.imod(u.mul(m))},P.prototype.isqr=function(u){return this.imul(u,u.clone())},P.prototype.sqr=function(u){return this.mul(u,u)},P.prototype.sqrt=function(u){if(u.isZero())return u.clone();var m=this.m.andln(3);if(t(m%2===1),m===3){var y=this.m.add(new s(1)).iushrn(2);return this.pow(u,y)}for(var w=this.m.subn(1),g=0;!w.isZero()&&w.andln(1)===0;)g++,w.iushrn(1);t(!w.isZero());var v=new s(1).toRed(this),C=v.redNeg(),b=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new s(2*d*d).toRed(this);this.pow(d,b).cmp(C)!==0;)d.redIAdd(C);for(var E=this.pow(d,w),U=this.pow(u,w.addn(1).iushrn(1)),I=this.pow(u,w),D=g;I.cmp(v)!==0;){for(var $=I,V=0;$.cmp(v)!==0;V++)$=$.redSqr();t(V<D);var B=this.pow(E,new s(1).iushln(D-V-1));U=U.redMul(B),E=B.redSqr(),I=I.redMul(E),D=V}return U},P.prototype.invm=function(u){var m=u._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},P.prototype.pow=function(u,m){if(m.isZero())return new s(1).toRed(this);if(m.cmpn(1)===0)return u.clone();var y=4,w=new Array(1<<y);w[0]=new s(1).toRed(this),w[1]=u;for(var g=2;g<w.length;g++)w[g]=this.mul(w[g-1],u);var v=w[0],C=0,b=0,d=m.bitLength()%26;for(d===0&&(d=26),g=m.length-1;g>=0;g--){for(var E=m.words[g],U=d-1;U>=0;U--){var I=E>>U&1;if(v!==w[0]&&(v=this.sqr(v)),I===0&&C===0){b=0;continue}C<<=1,C|=I,b++,!(b!==y&&(g!==0||U!==0))&&(v=this.mul(v,w[C]),b=0,C=0)}d=26}return v},P.prototype.convertTo=function(u){var m=u.umod(this.m);return m===u?m.clone():m},P.prototype.convertFrom=function(u){var m=u.clone();return m.red=null,m},s.mont=function(u){return new H(u)};function H(T){P.call(this,T),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(H,P),H.prototype.convertTo=function(u){return this.imod(u.ushln(this.shift))},H.prototype.convertFrom=function(u){var m=this.imod(u.mul(this.rinv));return m.red=null,m},H.prototype.imul=function(u,m){if(u.isZero()||m.isZero())return u.words[0]=0,u.length=1,u;var y=u.imul(m),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=y.isub(w).iushrn(this.shift),v=g;return g.cmp(this.m)>=0?v=g.isub(this.m):g.cmpn(0)<0&&(v=g.iadd(this.m)),v._forceRed(this)},H.prototype.mul=function(u,m){if(u.isZero()||m.isZero())return new s(0)._forceRed(this);var y=u.mul(m),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=y.isub(w).iushrn(this.shift),v=g;return g.cmp(this.m)>=0?v=g.isub(this.m):g.cmpn(0)<0&&(v=g.iadd(this.m)),v._forceRed(this)},H.prototype.invm=function(u){var m=this.imod(u._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(typeof Kh>"u"||Kh,vE)});var yE=O((vz,Xh)=>{typeof Object.create=="function"?Xh.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Xh.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}});var Kn=O((yz,Qh)=>{try{if(Jh=require("util"),typeof Jh.inherits!="function")throw"";Qh.exports=Jh.inherits}catch{Qh.exports=yE()}var Jh});var eu=O((xz,xE)=>{"use strict";var Zl=require("buffer"),Li=Zl.Buffer,dr={},hr;for(hr in Zl)Zl.hasOwnProperty(hr)&&(hr==="SlowBuffer"||hr==="Buffer"||(dr[hr]=Zl[hr]));var Di=dr.Buffer={};for(hr in Li)Li.hasOwnProperty(hr)&&(hr==="allocUnsafe"||hr==="allocUnsafeSlow"||(Di[hr]=Li[hr]));dr.Buffer.prototype=Li.prototype;(!Di.from||Di.from===Uint8Array.from)&&(Di.from=function(r,e,t){if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof r);if(r&&typeof r.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);return Li(r,e,t)});Di.alloc||(Di.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof r);if(r<0||r>=2*(1<<30))throw new RangeError('The value "'+r+'" is invalid for option "size"');var n=Li(r);return!e||e.length===0?n.fill(0):typeof t=="string"?n.fill(e,t):n.fill(e),n});if(!dr.kStringMaxLength)try{dr.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}dr.constants||(dr.constants={MAX_LENGTH:dr.kMaxLength},dr.kStringMaxLength&&(dr.constants.MAX_STRING_LENGTH=dr.kStringMaxLength));xE.exports=dr});var tu=O(_E=>{"use strict";var Cj=Kn();function mr(r){this._reporterState={obj:null,path:[],options:r||{},errors:[]}}_E.Reporter=mr;mr.prototype.isError=function(e){return e instanceof Bi};mr.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};mr.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};mr.prototype.enterKey=function(e){return this._reporterState.path.push(e)};mr.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};mr.prototype.leaveKey=function(e,t,n){let s=this._reporterState;this.exitKey(e),s.obj!==null&&(s.obj[t]=n)};mr.prototype.path=function(){return this._reporterState.path.join("/")};mr.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};mr.prototype.leaveObject=function(e){let t=this._reporterState,n=t.obj;return t.obj=e,n};mr.prototype.error=function(e){let t,n=this._reporterState,s=e instanceof Bi;if(s?t=e:t=new Bi(n.path.map(function(i){return"["+JSON.stringify(i)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw t;return s||n.errors.push(t),t};mr.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function Bi(r,e){this.path=r,this.rethrow(e)}Cj(Bi,Error);Bi.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Bi),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var Hi=O(Zh=>{"use strict";var Aj=Kn(),ru=tu().Reporter,ji=eu().Buffer;function gr(r,e){if(ru.call(this,e),!ji.isBuffer(r)){this.error("Input not Buffer");return}this.base=r,this.offset=0,this.length=r.length}Aj(gr,ru);Zh.DecoderBuffer=gr;gr.isDecoderBuffer=function(e){return e instanceof gr?!0:typeof e=="object"&&ji.isBuffer(e.base)&&e.constructor.name==="DecoderBuffer"&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.save=="function"&&typeof e.restore=="function"&&typeof e.isEmpty=="function"&&typeof e.readUInt8=="function"&&typeof e.skip=="function"&&typeof e.raw=="function"};gr.prototype.save=function(){return{offset:this.offset,reporter:ru.prototype.save.call(this)}};gr.prototype.restore=function(e){let t=new gr(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,ru.prototype.restore.call(this,e.reporter),t};gr.prototype.isEmpty=function(){return this.offset===this.length};gr.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};gr.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");let n=new gr(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};gr.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function Fi(r,e){if(Array.isArray(r))this.length=0,this.value=r.map(function(t){return Fi.isEncoderBuffer(t)||(t=new Fi(t,e)),this.length+=t.length,t},this);else if(typeof r=="number"){if(!(0<=r&&r<=255))return e.error("non-byte EncoderBuffer value");this.value=r,this.length=1}else if(typeof r=="string")this.value=r,this.length=ji.byteLength(r);else if(ji.isBuffer(r))this.value=r,this.length=r.length;else return e.error("Unsupported type: "+typeof r)}Zh.EncoderBuffer=Fi;Fi.isEncoderBuffer=function(e){return e instanceof Fi?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};Fi.prototype.join=function(e,t){return e||(e=ji.alloc(this.length)),t||(t=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(n){n.join(e,t),t+=n.length}):(typeof this.value=="number"?e[t]=this.value:typeof this.value=="string"?e.write(this.value,t):ji.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var SE=O((wz,wE)=>{wE.exports=bE;function bE(r,e){if(!r)throw new Error(e||"Assertion failed")}bE.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}});var nu=O((Sz,TE)=>{"use strict";var Rj=tu().Reporter,kj=Hi().EncoderBuffer,Oj=Hi().DecoderBuffer,It=SE(),EE=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],Mj=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(EE),Pj=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function he(r,e,t){let n={};this._baseState=n,n.name=t,n.enc=r,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}TE.exports=he;var Ij=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];he.prototype.clone=function(){let e=this._baseState,t={};Ij.forEach(function(s){t[s]=e[s]});let n=new this.constructor(t.parent);return n._baseState=t,n};he.prototype._wrap=function(){let e=this._baseState;Mj.forEach(function(t){this[t]=function(){let s=new this.constructor(this);return e.children.push(s),s[t].apply(s,arguments)}},this)};he.prototype._init=function(e){let t=this._baseState;It(t.parent===null),e.call(this),t.children=t.children.filter(function(n){return n._baseState.parent===this},this),It.equal(t.children.length,1,"Root node can have only one child")};he.prototype._useArgs=function(e){let t=this._baseState,n=e.filter(function(s){return s instanceof this.constructor},this);e=e.filter(function(s){return!(s instanceof this.constructor)},this),n.length!==0&&(It(t.children===null),t.children=n,n.forEach(function(s){s._baseState.parent=this},this)),e.length!==0&&(It(t.args===null),t.args=e,t.reverseArgs=e.map(function(s){if(typeof s!="object"||s.constructor!==Object)return s;let i={};return Object.keys(s).forEach(function(o){o==(o|0)&&(o|=0);let a=s[o];i[a]=o}),i}))};Pj.forEach(function(r){he.prototype[r]=function(){let t=this._baseState;throw new Error(r+" not implemented for encoding: "+t.enc)}});EE.forEach(function(r){he.prototype[r]=function(){let t=this._baseState,n=Array.prototype.slice.call(arguments);return It(t.tag===null),t.tag=r,this._useArgs(n),this}});he.prototype.use=function(e){It(e);let t=this._baseState;return It(t.use===null),t.use=e,this};he.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};he.prototype.def=function(e){let t=this._baseState;return It(t.default===null),t.default=e,t.optional=!0,this};he.prototype.explicit=function(e){let t=this._baseState;return It(t.explicit===null&&t.implicit===null),t.explicit=e,this};he.prototype.implicit=function(e){let t=this._baseState;return It(t.explicit===null&&t.implicit===null),t.implicit=e,this};he.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};he.prototype.key=function(e){let t=this._baseState;return It(t.key===null),t.key=e,this};he.prototype.any=function(){let e=this._baseState;return e.any=!0,this};he.prototype.choice=function(e){let t=this._baseState;return It(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map(function(n){return e[n]})),this};he.prototype.contains=function(e){let t=this._baseState;return It(t.use===null),t.contains=e,this};he.prototype._decode=function(e,t){let n=this._baseState;if(n.parent===null)return e.wrapResult(n.children[0]._decode(e,t));let s=n.default,i=!0,o=null;if(n.key!==null&&(o=e.enterKey(n.key)),n.optional){let c=null;if(n.explicit!==null?c=n.explicit:n.implicit!==null?c=n.implicit:n.tag!==null&&(c=n.tag),c===null&&!n.any){let l=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),i=!0}catch{i=!1}e.restore(l)}else if(i=this._peekTag(e,c,n.any),e.isError(i))return i}let a;if(n.obj&&i&&(a=e.enterObject()),i){if(n.explicit!==null){let l=this._decodeTag(e,n.explicit);if(e.isError(l))return l;e=l}let c=e.offset;if(n.use===null&&n.choice===null){let l;n.any&&(l=e.save());let p=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(p))return p;n.any?s=e.raw(l):e=p}if(t&&t.track&&n.tag!==null&&t.track(e.path(),c,e.length,"tagged"),t&&t.track&&n.tag!==null&&t.track(e.path(),e.offset,e.length,"content"),n.any||(n.choice===null?s=this._decodeGeneric(n.tag,e,t):s=this._decodeChoice(e,t)),e.isError(s))return s;if(!n.any&&n.choice===null&&n.children!==null&&n.children.forEach(function(p){p._decode(e,t)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){let l=new Oj(s);s=this._getUse(n.contains,e._reporterState.obj)._decode(l,t)}}return n.obj&&i&&(s=e.leaveObject(a)),n.key!==null&&(s!==null||i===!0)?e.leaveKey(o,n.key,s):o!==null&&e.exitKey(o),s};he.prototype._decodeGeneric=function(e,t,n){let s=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(t,e,s.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):e==="objid"&&s.args?this._decodeObjid(t,s.args[0],s.args[1],n):e==="objid"?this._decodeObjid(t,null,null,n):e==="gentime"||e==="utctime"?this._decodeTime(t,e,n):e==="null_"?this._decodeNull(t,n):e==="bool"?this._decodeBool(t,n):e==="objDesc"?this._decodeStr(t,e,n):e==="int"||e==="enum"?this._decodeInt(t,s.args&&s.args[0],n):s.use!==null?this._getUse(s.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)};he.prototype._getUse=function(e,t){let n=this._baseState;return n.useDecoder=this._use(e,t),It(n.useDecoder._baseState.parent===null),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder};he.prototype._decodeChoice=function(e,t){let n=this._baseState,s=null,i=!1;return Object.keys(n.choice).some(function(o){let a=e.save(),c=n.choice[o];try{let l=c._decode(e,t);if(e.isError(l))return!1;s={type:o,value:l},i=!0}catch{return e.restore(a),!1}return!0},this),i?s:e.error("Choice not matched")};he.prototype._createEncoderBuffer=function(e){return new kj(e,this.reporter)};he.prototype._encode=function(e,t,n){let s=this._baseState;if(s.default!==null&&s.default===e)return;let i=this._encodeValue(e,t,n);if(i!==void 0&&!this._skipDefault(i,t,n))return i};he.prototype._encodeValue=function(e,t,n){let s=this._baseState;if(s.parent===null)return s.children[0]._encode(e,t||new Rj);let i=null;if(this.reporter=t,s.optional&&e===void 0)if(s.default!==null)e=s.default;else return;let o=null,a=!1;if(s.any)i=this._createEncoderBuffer(e);else if(s.choice)i=this._encodeChoice(e,t);else if(s.contains)o=this._getUse(s.contains,n)._encode(e,t),a=!0;else if(s.children)o=s.children.map(function(c){if(c._baseState.tag==="null_")return c._encode(null,t,e);if(c._baseState.key===null)return t.error("Child should have a key");let l=t.enterKey(c._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let p=c._encode(e[c._baseState.key],t,e);return t.leaveKey(l),p},this).filter(function(c){return c}),o=this._createEncoderBuffer(o);else if(s.tag==="seqof"||s.tag==="setof"){if(!(s.args&&s.args.length===1))return t.error("Too many args for : "+s.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");let c=this.clone();c._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(l){let p=this._baseState;return this._getUse(p.args[0],e)._encode(l,t)},c))}else s.use!==null?i=this._getUse(s.use,n)._encode(e,t):(o=this._encodePrimitive(s.tag,e),a=!0);if(!s.any&&s.choice===null){let c=s.implicit!==null?s.implicit:s.tag,l=s.implicit===null?"universal":"context";c===null?s.use===null&&t.error("Tag could be omitted only for .use()"):s.use===null&&(i=this._encodeComposite(c,a,l,o))}return s.explicit!==null&&(i=this._encodeComposite(s.explicit,!1,"context",i)),i};he.prototype._encodeChoice=function(e,t){let n=this._baseState,s=n.choice[e.type];return s||It(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),s._encode(e.value,t)};he.prototype._encodePrimitive=function(e,t){let n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if(e==="objid"&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if(e==="objid")return this._encodeObjid(t,null,null);if(e==="gentime"||e==="utctime")return this._encodeTime(t,e);if(e==="null_")return this._encodeNull();if(e==="int"||e==="enum")return this._encodeInt(t,n.args&&n.reverseArgs[0]);if(e==="bool")return this._encodeBool(t);if(e==="objDesc")return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)};he.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};he.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var su=O(ws=>{"use strict";function CE(r){let e={};return Object.keys(r).forEach(function(t){(t|0)==t&&(t=t|0);let n=r[t];e[n]=t}),e}ws.tagClass={0:"universal",1:"application",2:"context",3:"private"};ws.tagClassByName=CE(ws.tagClass);ws.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"};ws.tagByName=CE(ws.tag)});var tm=O((Tz,kE)=>{"use strict";var Nj=Kn(),En=eu().Buffer,AE=nu(),em=su();function RE(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new Ir,this.tree._init(r.body)}kE.exports=RE;RE.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function Ir(r){AE.call(this,"der",r)}Nj(Ir,AE);Ir.prototype._encodeComposite=function(e,t,n,s){let i=Lj(e,t,n,this.reporter);if(s.length<128){let c=En.alloc(2);return c[0]=i,c[1]=s.length,this._createEncoderBuffer([c,s])}let o=1;for(let c=s.length;c>=256;c>>=8)o++;let a=En.alloc(2+o);a[0]=i,a[1]=128|o;for(let c=1+o,l=s.length;l>0;c--,l>>=8)a[c]=l&255;return this._createEncoderBuffer([a,s])};Ir.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let n=En.alloc(e.length*2);for(let s=0;s<e.length;s++)n.writeUInt16BE(e.charCodeAt(s),s*2);return this._createEncoderBuffer(n)}else return t==="numstr"?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):t==="printstr"?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):t==="objDesc"?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")};Ir.prototype._encodeObjid=function(e,t,n){if(typeof e=="string"){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(let a=0;a<e.length;a++)e[a]|=0}else if(Array.isArray(e)){e=e.slice();for(let a=0;a<e.length;a++)e[a]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!n){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}let s=0;for(let a=0;a<e.length;a++){let c=e[a];for(s++;c>=128;c>>=7)s++}let i=En.alloc(s),o=i.length-1;for(let a=e.length-1;a>=0;a--){let c=e[a];for(i[o--]=c&127;(c>>=7)>0;)i[o--]=128|c&127}return this._createEncoderBuffer(i)};function vr(r){return r<10?"0"+r:r}Ir.prototype._encodeTime=function(e,t){let n,s=new Date(e);return t==="gentime"?n=[vr(s.getUTCFullYear()),vr(s.getUTCMonth()+1),vr(s.getUTCDate()),vr(s.getUTCHours()),vr(s.getUTCMinutes()),vr(s.getUTCSeconds()),"Z"].join(""):t==="utctime"?n=[vr(s.getUTCFullYear()%100),vr(s.getUTCMonth()+1),vr(s.getUTCDate()),vr(s.getUTCHours()),vr(s.getUTCMinutes()),vr(s.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")};Ir.prototype._encodeNull=function(){return this._createEncoderBuffer("")};Ir.prototype._encodeInt=function(e,t){if(typeof e=="string"){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if(typeof e!="number"&&!En.isBuffer(e)){let i=e.toArray();!e.sign&&i[0]&128&&i.unshift(0),e=En.from(i)}if(En.isBuffer(e)){let i=e.length;e.length===0&&i++;let o=En.alloc(i);return e.copy(o),e.length===0&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let n=1;for(let i=e;i>=256;i>>=8)n++;let s=new Array(n);for(let i=s.length-1;i>=0;i--)s[i]=e&255,e>>=8;return s[0]&128&&s.unshift(0),this._createEncoderBuffer(En.from(s))};Ir.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};Ir.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getEncoder("der").tree};Ir.prototype._skipDefault=function(e,t,n){let s=this._baseState,i;if(s.default===null)return!1;let o=e.join();if(s.defaultBuffer===void 0&&(s.defaultBuffer=this._encodeValue(s.default,t,n).join()),o.length!==s.defaultBuffer.length)return!1;for(i=0;i<o.length;i++)if(o[i]!==s.defaultBuffer[i])return!1;return!0};function Lj(r,e,t,n){let s;if(r==="seqof"?r="seq":r==="setof"&&(r="set"),em.tagByName.hasOwnProperty(r))s=em.tagByName[r];else if(typeof r=="number"&&(r|0)===r)s=r;else return n.error("Unknown tag: "+r);return s>=31?n.error("Multi-octet tag encoding unsupported"):(e||(s|=32),s|=em.tagClassByName[t||"universal"]<<6,s)}});var ME=O((Cz,OE)=>{"use strict";var Dj=Kn(),rm=tm();function nm(r){rm.call(this,r),this.enc="pem"}Dj(nm,rm);OE.exports=nm;nm.prototype.encode=function(e,t){let s=rm.prototype.encode.call(this,e).toString("base64"),i=["-----BEGIN "+t.label+"-----"];for(let o=0;o<s.length;o+=64)i.push(s.slice(o,o+64));return i.push("-----END "+t.label+"-----"),i.join(`
92
+ `)}});var sm=O(IE=>{"use strict";var PE=IE;PE.der=tm();PE.pem=ME()});var om=O((Rz,FE)=>{"use strict";var Bj=Kn(),jj=Yh(),NE=Hi().DecoderBuffer,DE=nu(),LE=su();function BE(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new er,this.tree._init(r.body)}FE.exports=BE;BE.prototype.decode=function(e,t){return NE.isDecoderBuffer(e)||(e=new NE(e,t)),this.tree._decode(e,t)};function er(r){DE.call(this,"der",r)}Bj(er,DE);er.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;let s=e.save(),i=im(e,'Failed to peek tag: "'+t+'"');return e.isError(i)?i:(e.restore(s),i.tag===t||i.tagStr===t||i.tagStr+"of"===t||n)};er.prototype._decodeTag=function(e,t,n){let s=im(e,'Failed to decode tag of "'+t+'"');if(e.isError(s))return s;let i=jE(e,s.primitive,'Failed to get length of "'+t+'"');if(e.isError(i))return i;if(!n&&s.tag!==t&&s.tagStr!==t&&s.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(s.primitive||i!==null)return e.skip(i,'Failed to match body of: "'+t+'"');let o=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(i=e.offset-o.offset,e.restore(o),e.skip(i,'Failed to match body of: "'+t+'"'))};er.prototype._skipUntilEnd=function(e,t){for(;;){let n=im(e,t);if(e.isError(n))return n;let s=jE(e,n.primitive,t);if(e.isError(s))return s;let i;if(n.primitive||s!==null?i=e.skip(s):i=this._skipUntilEnd(e,t),e.isError(i))return i;if(n.tagStr==="end")break}};er.prototype._decodeList=function(e,t,n,s){let i=[];for(;!e.isEmpty();){let o=this._peekTag(e,"end");if(e.isError(o))return o;let a=n.decode(e,"der",s);if(e.isError(a)&&o)break;i.push(a)}return i};er.prototype._decodeStr=function(e,t){if(t==="bitstr"){let n=e.readUInt8();return e.isError(n)?n:{unused:n,data:e.raw()}}else if(t==="bmpstr"){let n=e.raw();if(n.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");let s="";for(let i=0;i<n.length/2;i++)s+=String.fromCharCode(n.readUInt16BE(i*2));return s}else if(t==="numstr"){let n=e.raw().toString("ascii");return this._isNumstr(n)?n:e.error("Decoding of string type: numstr unsupported characters")}else{if(t==="octstr")return e.raw();if(t==="objDesc")return e.raw();if(t==="printstr"){let n=e.raw().toString("ascii");return this._isPrintstr(n)?n:e.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")}};er.prototype._decodeObjid=function(e,t,n){let s,i=[],o=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),o<<=7,o|=a&127,(a&128)===0&&(i.push(o),o=0);a&128&&i.push(o);let c=i[0]/40|0,l=i[0]%40;if(n?s=i:s=[c,l].concat(i.slice(1)),t){let p=t[s.join(" ")];p===void 0&&(p=t[s.join(".")]),p!==void 0&&(s=p)}return s};er.prototype._decodeTime=function(e,t){let n=e.raw().toString(),s,i,o,a,c,l;if(t==="gentime")s=n.slice(0,4)|0,i=n.slice(4,6)|0,o=n.slice(6,8)|0,a=n.slice(8,10)|0,c=n.slice(10,12)|0,l=n.slice(12,14)|0;else if(t==="utctime")s=n.slice(0,2)|0,i=n.slice(2,4)|0,o=n.slice(4,6)|0,a=n.slice(6,8)|0,c=n.slice(8,10)|0,l=n.slice(10,12)|0,s<70?s=2e3+s:s=1900+s;else return e.error("Decoding "+t+" time is not supported yet");return Date.UTC(s,i-1,o,a,c,l,0)};er.prototype._decodeNull=function(){return null};er.prototype._decodeBool=function(e){let t=e.readUInt8();return e.isError(t)?t:t!==0};er.prototype._decodeInt=function(e,t){let n=e.raw(),s=new jj(n);return t&&(s=t[s.toString(10)]||s),s};er.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function im(r,e){let t=r.readUInt8(e);if(r.isError(t))return t;let n=LE.tagClass[t>>6],s=(t&32)===0;if((t&31)===31){let o=t;for(t=0;(o&128)===128;){if(o=r.readUInt8(e),r.isError(o))return o;t<<=7,t|=o&127}}else t&=31;let i=LE.tag[t];return{cls:n,primitive:s,tag:t,tagStr:i}}function jE(r,e,t){let n=r.readUInt8(t);if(r.isError(n))return n;if(!e&&n===128)return null;if((n&128)===0)return n;let s=n&127;if(s>4)return r.error("length octect is too long");n=0;for(let i=0;i<s;i++){n<<=8;let o=r.readUInt8(t);if(r.isError(o))return o;n|=o}return n}});var $E=O((kz,HE)=>{"use strict";var Fj=Kn(),Hj=eu().Buffer,am=om();function cm(r){am.call(this,r),this.enc="pem"}Fj(cm,am);HE.exports=cm;cm.prototype.decode=function(e,t){let n=e.toString().split(/[\r\n]+/g),s=t.label.toUpperCase(),i=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,a=-1;for(let p=0;p<n.length;p++){let f=n[p].match(i);if(f!==null&&f[2]===s)if(o===-1){if(f[1]!=="BEGIN")break;o=p}else{if(f[1]!=="END")break;a=p;break}}if(o===-1||a===-1)throw new Error("PEM section not found for: "+s);let c=n.slice(o+1,a).join("");c.replace(/[^a-z0-9+/=]+/gi,"");let l=Hj.from(c,"base64");return am.prototype.decode.call(this,l,t)}});var lm=O(qE=>{"use strict";var UE=qE;UE.der=om();UE.pem=$E()});var GE=O(WE=>{"use strict";var $j=sm(),Uj=lm(),qj=Kn(),Wj=WE;Wj.define=function(e,t){return new $i(e,t)};function $i(r,e){this.name=r,this.body=e,this.decoders={},this.encoders={}}$i.prototype._createNamed=function(e){let t=this.name;function n(s){this._initNamed(s,t)}return qj(n,e),n.prototype._initNamed=function(i,o){e.call(this,i,o)},new n(this)};$i.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(Uj[e])),this.decoders[e]};$i.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)};$i.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed($j[e])),this.encoders[e]};$i.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}});var VE=O(zE=>{"use strict";var iu=zE;iu.Reporter=tu().Reporter;iu.DecoderBuffer=Hi().DecoderBuffer;iu.EncoderBuffer=Hi().EncoderBuffer;iu.Node=nu()});var XE=O(YE=>{"use strict";var KE=YE;KE._reverse=function(e){let t={};return Object.keys(e).forEach(function(n){(n|0)==n&&(n=n|0);let s=e[n];t[s]=n}),t};KE.der=su()});var QE=O(JE=>{"use strict";var Ui=JE;Ui.bignum=Yh();Ui.define=GE().define;Ui.base=VE();Ui.constants=XE();Ui.decoders=lm();Ui.encoders=sm()});var qi=O((um,e1)=>{var ou=require("buffer"),Kr=ou.Buffer;function ZE(r,e){for(var t in r)e[t]=r[t]}Kr.from&&Kr.alloc&&Kr.allocUnsafe&&Kr.allocUnsafeSlow?e1.exports=ou:(ZE(ou,um),um.Buffer=Ss);function Ss(r,e,t){return Kr(r,e,t)}Ss.prototype=Object.create(Kr.prototype);ZE(Kr,Ss);Ss.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return Kr(r,e,t)};Ss.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=Kr(r);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};Ss.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Kr(r)};Ss.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return ou.SlowBuffer(r)}});var pm=O((Lz,t1)=>{var au=qi().Buffer,Gj=require("stream"),zj=require("util");function cu(r){if(this.buffer=null,this.writable=!0,this.readable=!0,!r)return this.buffer=au.alloc(0),this;if(typeof r.pipe=="function")return this.buffer=au.alloc(0),r.pipe(this),this;if(r.length||typeof r=="object")return this.buffer=r,this.writable=!1,process.nextTick(function(){this.emit("end",r),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof r+")")}zj.inherits(cu,Gj);cu.prototype.write=function(e){this.buffer=au.concat([this.buffer,au.from(e)]),this.emit("data",e)};cu.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};t1.exports=cu});var n1=O((Dz,r1)=>{"use strict";function fm(r){var e=(r/8|0)+(r%8===0?0:1);return e}var Vj={ES256:fm(256),ES384:fm(384),ES512:fm(521)};function Kj(r){var e=Vj[r];if(e)return e;throw new Error('Unknown algorithm "'+r+'"')}r1.exports=Kj});var u1=O((Bz,l1)=>{"use strict";var lu=qi().Buffer,i1=n1(),uu=128,o1=0,Yj=32,Xj=16,Jj=2,a1=Xj|Yj|o1<<6,pu=Jj|o1<<6;function Qj(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c1(r){if(lu.isBuffer(r))return r;if(typeof r=="string")return lu.from(r,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function Zj(r,e){r=c1(r);var t=i1(e),n=t+1,s=r.length,i=0;if(r[i++]!==a1)throw new Error('Could not find expected "seq"');var o=r[i++];if(o===(uu|1)&&(o=r[i++]),s-i<o)throw new Error('"seq" specified length of "'+o+'", only "'+(s-i)+'" remaining');if(r[i++]!==pu)throw new Error('Could not find expected "int" for "r"');var a=r[i++];if(s-i-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(s-i-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var c=i;if(i+=a,r[i++]!==pu)throw new Error('Could not find expected "int" for "s"');var l=r[i++];if(s-i!==l)throw new Error('"s" specified length of "'+l+'", expected "'+(s-i)+'"');if(n<l)throw new Error('"s" specified length of "'+l+'", max of "'+n+'" is acceptable');var p=i;if(i+=l,i!==s)throw new Error('Expected to consume entire buffer, but "'+(s-i)+'" bytes remain');var f=t-a,h=t-l,x=lu.allocUnsafe(f+a+h+l);for(i=0;i<f;++i)x[i]=0;r.copy(x,i,c+Math.max(-f,0),c+a),i=t;for(var _=i;i<_+h;++i)x[i]=0;return r.copy(x,i,p+Math.max(-h,0),p+l),x=x.toString("base64"),x=Qj(x),x}function s1(r,e,t){for(var n=0;e+n<t&&r[e+n]===0;)++n;var s=r[e+n]>=uu;return s&&--n,n}function eF(r,e){r=c1(r);var t=i1(e),n=r.length;if(n!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+n+'"');var s=s1(r,0,t),i=s1(r,t,r.length),o=t-s,a=t-i,c=2+o+1+1+a,l=c<uu,p=lu.allocUnsafe((l?2:3)+c),f=0;return p[f++]=a1,l?p[f++]=c:(p[f++]=uu|1,p[f++]=c&255),p[f++]=pu,p[f++]=o,s<0?(p[f++]=0,f+=r.copy(p,f,0,t)):f+=r.copy(p,f,s,t),p[f++]=pu,p[f++]=a,i<0?(p[f++]=0,r.copy(p,f,t)):r.copy(p,f,t+i),p}l1.exports={derToJose:Zj,joseToDer:eF}});var f1=O((jz,p1)=>{"use strict";var na=require("buffer").Buffer,dm=require("buffer").SlowBuffer;p1.exports=fu;function fu(r,e){if(!na.isBuffer(r)||!na.isBuffer(e)||r.length!==e.length)return!1;for(var t=0,n=0;n<r.length;n++)t|=r[n]^e[n];return t===0}fu.install=function(){na.prototype.equal=dm.prototype.equal=function(e){return fu(this,e)}};var tF=na.prototype.equal,rF=dm.prototype.equal;fu.restore=function(){na.prototype.equal=tF,dm.prototype.equal=rF}});var vm=O((Fz,b1)=>{var Gi=qi().Buffer,yr=require("crypto"),h1=u1(),d1=require("util"),nF=`"%s" is not a valid algorithm.
93
93
  Supported algorithms are:
94
- "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,ea="secret must be a string or buffer",$s="key must be a string or a buffer",Uj="key must be a string, a buffer or an object",um=typeof mr.createPublicKey=="function";um&&($s+=" or a KeyObject",ea+="or a KeyObject");function c1(r){if(!Hs.isBuffer(r)&&typeof r!="string"&&(!um||typeof r!="object"||typeof r.type!="string"||typeof r.asymmetricKeyType!="string"||typeof r.export!="function"))throw Or($s)}function l1(r){if(!Hs.isBuffer(r)&&typeof r!="string"&&typeof r!="object")throw Or(Uj)}function qj(r){if(!Hs.isBuffer(r)){if(typeof r=="string")return r;if(!um||typeof r!="object"||r.type!=="secret"||typeof r.export!="function")throw Or(ea)}}function pm(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function u1(r){r=r.toString();var e=4-r.length%4;if(e!==4)for(var t=0;t<e;++t)r+="=";return r.replace(/\-/g,"+").replace(/_/g,"/")}function Or(r){var e=[].slice.call(arguments,1),t=o1.format.bind(o1,r).apply(null,e);return new TypeError(t)}function Wj(r){return Hs.isBuffer(r)||typeof r=="string"}function ta(r){return Wj(r)||(r=JSON.stringify(r)),r}function p1(r){return function(t,n){qj(n),t=ta(t);var i=mr.createHmac("sha"+r,n),s=(i.update(t),i.digest("base64"));return pm(s)}}var lm,Gj="timingSafeEqual"in mr?function(e,t){return e.byteLength!==t.byteLength?!1:mr.timingSafeEqual(e,t)}:function(e,t){return lm||(lm=s1()),lm(e,t)};function zj(r){return function(t,n,i){var s=p1(r)(t,i);return Gj(Hs.from(n),Hs.from(s))}}function f1(r){return function(t,n){l1(n),t=ta(t);var i=mr.createSign("RSA-SHA"+r),s=(i.update(t),i.sign(n,"base64"));return pm(s)}}function d1(r){return function(t,n,i){c1(i),t=ta(t),n=u1(n);var s=mr.createVerify("RSA-SHA"+r);return s.update(t),s.verify(i,n,"base64")}}function Vj(r){return function(t,n){l1(n),t=ta(t);var i=mr.createSign("RSA-SHA"+r),s=(i.update(t),i.sign({key:n,padding:mr.constants.RSA_PKCS1_PSS_PADDING,saltLength:mr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return pm(s)}}function Kj(r){return function(t,n,i){c1(i),t=ta(t),n=u1(n);var s=mr.createVerify("RSA-SHA"+r);return s.update(t),s.verify({key:i,padding:mr.constants.RSA_PKCS1_PSS_PADDING,saltLength:mr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function Yj(r){var e=f1(r);return function(){var n=e.apply(null,arguments);return n=a1.derToJose(n,"ES"+r),n}}function Xj(r){var e=d1(r);return function(n,i,s){i=a1.joseToDer(i,"ES"+r).toString("base64");var o=e(n,i,s);return o}}function Jj(){return function(){return""}}function Qj(){return function(e,t){return t===""}}h1.exports=function(e){var t={hs:p1,rs:f1,ps:Vj,es:Yj,none:Jj},n={hs:zj,rs:d1,ps:Kj,es:Xj,none:Qj},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Or(Hj,e);var s=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:t[s](o),verify:n[s](o)}}});var dm=O((tz,m1)=>{var Zj=require("buffer").Buffer;m1.exports=function(e){return typeof e=="string"?e:typeof e=="number"||Zj.isBuffer(e)?e.toString():JSON.stringify(e)}});var b1=O((rz,_1)=>{var eF=Fs().Buffer,g1=om(),tF=fm(),rF=require("stream"),v1=dm(),hm=require("util");function x1(r,e){return eF.from(r,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function nF(r,e,t){t=t||"utf8";var n=x1(v1(r),"binary"),i=x1(v1(e),t);return hm.format("%s.%s",n,i)}function y1(r){var e=r.header,t=r.payload,n=r.secret||r.privateKey,i=r.encoding,s=tF(e.alg),o=nF(e,t,i),a=s.sign(o,n);return hm.format("%s.%s",o,a)}function lu(r){var e=r.secret;if(e=e??r.privateKey,e=e??r.key,/^hs/i.test(r.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new g1(e);this.readable=!0,this.header=r.header,this.encoding=r.encoding,this.secret=this.privateKey=this.key=t,this.payload=new g1(r.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}hm.inherits(lu,rF);lu.prototype.sign=function(){try{var e=y1({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(t){this.readable=!1,this.emit("error",t),this.emit("close")}};lu.sign=y1;_1.exports=lu});var M1=O((nz,O1)=>{var S1=Fs().Buffer,w1=om(),iF=fm(),sF=require("stream"),E1=dm(),oF=require("util"),aF=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function cF(r){return Object.prototype.toString.call(r)==="[object Object]"}function lF(r){if(cF(r))return r;try{return JSON.parse(r)}catch{return}}function T1(r){var e=r.split(".",1)[0];return lF(S1.from(e,"base64").toString("binary"))}function uF(r){return r.split(".",2).join(".")}function C1(r){return r.split(".")[2]}function pF(r,e){e=e||"utf8";var t=r.split(".")[1];return S1.from(t,"base64").toString(e)}function A1(r){return aF.test(r)&&!!T1(r)}function R1(r,e,t){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}r=E1(r);var i=C1(r),s=uF(r),o=iF(e);return o.verify(s,i,t)}function k1(r,e){if(e=e||{},r=E1(r),!A1(r))return null;var t=T1(r);if(!t)return null;var n=pF(r);return(t.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:t,payload:n,signature:C1(r)}}function Us(r){r=r||{};var e=r.secret;if(e=e??r.publicKey,e=e??r.key,/^hs/i.test(r.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new w1(e);this.readable=!0,this.algorithm=r.algorithm,this.encoding=r.encoding,this.secret=this.publicKey=this.key=t,this.signature=new w1(r.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}oF.inherits(Us,sF);Us.prototype.verify=function(){try{var e=R1(this.signature.buffer,this.algorithm,this.key.buffer),t=k1(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};Us.decode=k1;Us.isValid=A1;Us.verify=R1;O1.exports=Us});var I1=O(zn=>{var P1=b1(),uu=M1(),fF=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];zn.ALGORITHMS=fF;zn.sign=P1.sign;zn.verify=uu.verify;zn.decode=uu.decode;zn.isValid=uu.isValid;zn.createSign=function(e){return new P1(e)};zn.createVerify=function(e){return new uu(e)}});var pu=O((sz,N1)=>{"use strict";var mm={};mm.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};mm.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};N1.exports=mm});var gm=O((oz,L1)=>{"use strict";function dF(r){return/^[A-Za-z0-9\-_]+$/.test(r)}L1.exports={validate:dF}});var xm=O((az,q1)=>{"use strict";var hF=require("crypto"),mF=GE(),gF=I1(),{URL:B1}=require("url"),D1=pu(),j1=gm(),vF=720*60,xF=1440*60,yF=mF.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).objid().optional(),this.key("publicKey").explicit(1).bitstr().optional())});function _F(r){return yF.encode({version:1,privateKey:r,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function bF(){let r=hF.createECDH("prime256v1");r.generateKeys();let e=r.getPublicKey(),t=r.getPrivateKey();if(t.length<32){let n=Buffer.alloc(32-t.length);n.fill(0),t=Buffer.concat([n,t])}if(e.length<65){let n=Buffer.alloc(65-e.length);n.fill(0),e=Buffer.concat([n,e])}return{publicKey:e.toString("base64url"),privateKey:t.toString("base64url")}}function F1(r){if(!r)throw new Error("No subject set in vapidDetails.subject.");if(typeof r!="string"||r.length===0)throw new Error("The subject value must be a string containing an https: URL or mailto: address. "+r);let e=null;try{e=new B1(r)}catch{throw new Error("Vapid subject is not a valid URL. "+r)}if(!["https:","mailto:"].includes(e.protocol))throw new Error("Vapid subject is not an https: or mailto: URL. "+r);e.hostname==="localhost"&&console.warn("Vapid subject points to a localhost web URI, which is unsupported by Apple's push notification server and will result in a BadJwtToken error when sending notifications.")}function $1(r){if(!r)throw new Error("No key set vapidDetails.publicKey");if(typeof r!="string")throw new Error("Vapid public key is must be a URL safe Base 64 encoded string.");if(!j1.validate(r))throw new Error('Vapid public key must be a URL safe Base 64 (without "=")');if(r=Buffer.from(r,"base64url"),r.length!==65)throw new Error("Vapid public key should be 65 bytes long when decoded.")}function H1(r){if(!r)throw new Error("No key set in vapidDetails.privateKey");if(typeof r!="string")throw new Error("Vapid private key must be a URL safe Base 64 encoded string.");if(!j1.validate(r))throw new Error('Vapid private key must be a URL safe Base 64 (without "=")');if(r=Buffer.from(r,"base64url"),r.length!==32)throw new Error("Vapid private key should be 32 bytes long when decoded.")}function vm(r){let e=new Date;return e.setSeconds(e.getSeconds()+r),Math.floor(e.getTime()/1e3)}function U1(r){if(!Number.isInteger(r))throw new Error("`expiration` value must be a number");if(r<0)throw new Error("`expiration` must be a positive integer");let e=vm(xF);if(r>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function wF(r,e,t,n,i,s){if(!r)throw new Error("No audience could be generated for VAPID.");if(typeof r!="string"||r.length===0)throw new Error("The audience value must be a string containing the origin of a push service. "+r);try{new B1(r)}catch{throw new Error("VAPID audience is not a url. "+r)}F1(e),$1(t),H1(n),n=Buffer.from(n,"base64url"),s?U1(s):s=vm(vF);let o={typ:"JWT",alg:"ES256"},a={aud:r,exp:s,sub:e},c=gF.sign({header:o,payload:a,privateKey:_F(n)});if(i===D1.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+c+", k="+t};if(i===D1.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+c,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}q1.exports={generateVAPIDKeys:bF,getFutureExpirationTimestamp:vm,getVapidHeaders:wF,validateSubject:F1,validatePublicKey:$1,validatePrivateKey:H1,validateExpiration:U1}});var eT=O((cz,Z1)=>{"use strict";var du=require("crypto"),G1="aes-128-gcm",hu={aes128gcm:1,aesgcm:2},bi=16,Gr=16,SF=12,z1=32,ra="encrypt",na="decrypt",he;process.env.ECE_KEYLOG==="1"?he=function(r,e){return console.warn(r+" ["+e.length+"]: "+e.toString("base64url")),e}:he=function(r,e){return e};function fu(r){return typeof r=="string"?Buffer.from(r,"base64url"):r}function V1(r,e){var t=du.createHmac("sha256",r);return t.update(e),t.digest()}function K1(r,e){return he("salt",r),he("ikm",e),he("extract",V1(r,e))}function ym(r,e,t){he("prk",r),he("info",e);var n=Buffer.alloc(0),i=Buffer.alloc(0);e=Buffer.from(e,"ascii");for(var s=0,o=Buffer.alloc(1);n.length<t;)o.writeUIntBE(++s,0,1),i=V1(r,Buffer.concat([i,e,o])),n=Buffer.concat([n,i]);return he("expand",n.slice(0,t))}function Y1(r,e,t,n){return ym(K1(r,e),t,n)}function _m(r,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+r+"\0","ascii"),e]);return he("info "+r,t),t}function W1(r){var e=Buffer.concat([Buffer.alloc(2),r]);return e.writeUIntBE(r.length,0,2),e}function EF(r,e){var t=r.privateKey,n,i;if(e===ra)n=t.getPublicKey(),i=r.dh;else if(e===na)n=r.dh,i=t.getPublicKey();else throw new Error("Unknown mode only "+ra+" and "+na+" supported");return{secret:t.computeSecret(r.dh),context:Buffer.concat([Buffer.from(r.keylabel,"ascii"),Buffer.from([0]),W1(i),W1(n)])}}function TF(r,e){var t={secret:null,context:Buffer.alloc(0)};if(r.key){if(t.secret=r.key,t.secret.length!==Gr)throw new Error("An explicit key must be "+Gr+" bytes")}else r.dh?t=EF(r,e):typeof r.keyid!==void 0&&(t.secret=r.keymap[r.keyid]);if(!t.secret)throw new Error("Unable to determine key");return he("secret",t.secret),he("context",t.context),r.authSecret&&(t.secret=Y1(r.authSecret,t.secret,_m("auth",Buffer.alloc(0)),z1),he("authsecret",t.secret)),t}function CF(r,e){if(!r.authSecret)throw new Error("No authentication secret for webpush");he("authsecret",r.authSecret);var t,n,i;if(e===ra)n=r.privateKey.getPublicKey(),t=i=r.dh;else if(e===na)t=n=r.keyid,i=r.privateKey.getPublicKey();else throw new Error("Unknown mode only "+ra+" and "+na+" supported");return he("remote pubkey",t),he("sender pubkey",n),he("receiver pubkey",i),he("secret dh",Y1(r.authSecret,r.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),i,n]),z1))}function AF(r,e,t){if(t&&!DF(t))throw new Error("Callback is not a function");if(r.key){if(r.key.length!==Gr)throw new Error("An explicit key must be "+Gr+" bytes");return he("secret key",r.key)}if(!r.privateKey){if(t)var n=t(r.keyid);else var n=r.keymap&&r.keymap[r.keyid];if(!n)throw new Error('No saved key (keyid: "'+r.keyid+'")');return n}return CF(r,e)}function X1(r,e,t){if(!r.salt)throw new Error("must include a salt parameter for "+r.version);var n,i,s;if(r.version==="aesgcm"){var o=TF(r,e,t);n=_m("aesgcm",o.context),i=_m("nonce",o.context),s=o.secret}else if(r.version==="aes128gcm")n=Buffer.from("Content-Encoding: aes128gcm\0"),i=Buffer.from("Content-Encoding: nonce\0"),s=AF(r,e,t);else throw new Error("Unable to set context for mode "+r.version);var a=K1(r.salt,s),c={key:ym(a,n,Gr),nonce:ym(a,i,SF)};return he("key",c.key),he("nonce base",c.nonce),c}function J1(r){var e={};e.version=r.version||"aes128gcm",e.rs=parseInt(r.rs,10),isNaN(e.rs)&&(e.rs=4096);var t=hu[e.version];if(e.version==="aes128gcm"&&(t+=bi),e.rs<=t)throw new Error("The rs parameter has to be greater than "+t);if(r.salt&&(e.salt=fu(r.salt),e.salt.length!==Gr))throw new Error("The salt parameter must be "+Gr+" bytes");return e.keyid=r.keyid,r.key?e.key=fu(r.key):(e.privateKey=r.privateKey,e.privateKey||(e.keymap=r.keymap),e.version!=="aes128gcm"&&(e.keylabel=r.keylabel||"P-256"),r.dh&&(e.dh=fu(r.dh))),r.authSecret&&(e.authSecret=fu(r.authSecret)),e}function Q1(r,e){var t=Buffer.from(r),n=t.readUIntBE(t.length-6,6),i=((n^e)&16777215)+((n/16777216^e/16777216)&16777215)*16777216;return t.writeUIntBE(i,t.length-6,6),he("nonce"+e,t),t}function RF(r,e){var t=r.readUIntBE(20,1);return e.salt=r.slice(0,Gr),e.rs=r.readUIntBE(Gr,4),e.keyid=r.slice(21,21+t),21+t}function kF(r,e){var t=hu[e],n=r.readUIntBE(0,t);if(n+t>r.length)throw new Error("padding exceeds block size");he("padding",r.slice(0,t+n));var i=Buffer.alloc(n);if(i.fill(0),i.compare(r.slice(t,t+n))!==0)throw new Error("invalid padding");return r.slice(t+n)}function OF(r,e){for(var t=r.length-1;t>=0;){if(r[t]){if(e){if(r[t]!==2)throw new Error("last record needs to start padding with a 2")}else if(r[t]!==1)throw new Error("last record needs to start padding with a 2");return r.slice(0,t)}--t}throw new Error("all zero plaintext")}function MF(r,e,t,n,i){he("decrypt",t);var s=Q1(r.nonce,e),o=du.createDecipheriv(G1,r.key,s);o.setAuthTag(t.slice(t.length-bi));var a=o.update(t.slice(0,t.length-bi));return a=Buffer.concat([a,o.final()]),he("decrypted",a),n.version!=="aes128gcm"?kF(a,n.version):OF(a,i)}function PF(r,e,t){var n=J1(e);if(n.version==="aes128gcm"){var i=RF(r,n);r=r.slice(i)}var s=X1(n,na,t),o=0,a=Buffer.alloc(0),c=n.rs;n.version!=="aes128gcm"&&(c+=bi);for(var u=0;o<r.length;++u){var p=o+c;if(n.version!=="aes128gcm"&&p===r.length)throw new Error("Truncated payload");if(p=Math.min(p,r.length),p-o<=bi)throw new Error("Invalid block: too small at "+u);var f=MF(s,u,r.slice(o,p),n,p>=r.length);a=Buffer.concat([a,f]),o=p}return a}function IF(r,e,t,n,i,s){he("encrypt",t),n=n||0;var o=Q1(r.nonce,e),a=du.createCipheriv(G1,r.key,o),c=[],u=hu[i.version],p=Buffer.alloc(n+u);if(p.fill(0),i.version!=="aes128gcm"){if(p.writeUIntBE(n,0,u),he("padding",p),c.push(a.update(p)),c.push(a.update(t)),!s&&p.length+t.length<i.rs)throw new Error("Unable to pad to record size")}else c.push(a.update(t)),p.writeUIntBE(s?2:1,0,1),he("padding",p),c.push(a.update(p));a.final();var f=a.getAuthTag();if(f.length!==bi)throw new Error("invalid tag generated");return c.push(f),he("encrypted",Buffer.concat(c))}function NF(r){var e=Buffer.alloc(5),t=Buffer.from(r.keyid||[]);if(t.length>255)throw new Error("keyid is too large");return e.writeUIntBE(r.rs,0,4),e.writeUIntBE(t.length,4,1),Buffer.concat([r.salt,e,t])}function LF(r,e,t){if(!Buffer.isBuffer(r))throw new Error("buffer argument must be a Buffer");var n=J1(e);n.salt||(n.salt=du.randomBytes(Gr));var i;n.version==="aes128gcm"?(n.privateKey&&!n.keyid&&(n.keyid=n.privateKey.getPublicKey()),i=NF(n)):i=Buffer.alloc(0);var s=X1(n,ra,t),o=0,a=hu[n.version],c=a;n.version==="aes128gcm"&&(c+=bi);for(var u=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),p=0,f=!1;!f;){var m=Math.min(n.rs-c-1,u);n.version!=="aes128gcm"&&(m=Math.min((1<<a*8)-1,m)),u>0&&m===0&&++m,u-=m;var y=o+n.rs-c-m;n.version!=="aes128gcm"?f=y>r.length:f=y>=r.length,f=f&&u<=0;var _=IF(s,p,r.slice(o,y),m,n,f);i=Buffer.concat([i,_]),o=y,++p}return i}function DF(r){return typeof r=="function"}Z1.exports={decrypt:PF,encrypt:LF}});var bm=O((lz,rT)=>{"use strict";var tT=require("crypto"),BF=eT(),jF=function(r,e,t,n){if(!r)throw new Error("No user public key provided for encryption.");if(typeof r!="string")throw new Error("The subscription p256dh value must be a string.");if(Buffer.from(r,"base64url").length!==65)throw new Error("The subscription p256dh value should be 65 bytes long.");if(!e)throw new Error("No user auth provided for encryption.");if(typeof e!="string")throw new Error("The subscription auth key must be a string.");if(Buffer.from(e,"base64url").length<16)throw new Error("The subscription auth key should be at least 16 bytes long");if(typeof t!="string"&&!Buffer.isBuffer(t))throw new Error("Payload must be either a string or a Node Buffer.");(typeof t=="string"||t instanceof String)&&(t=Buffer.from(t));let i=tT.createECDH("prime256v1"),s=i.generateKeys(),o=tT.randomBytes(16).toString("base64url"),a=BF.encrypt(t,{version:n,dh:r,privateKey:i,salt:o,authSecret:e});return{localPublicKey:s,salt:o,cipherText:a}};rT.exports={encrypt:jF}});var wm=O((uz,iT)=>{"use strict";function nT(r,e,t,n,i){Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=r,this.statusCode=e,this.headers=t,this.body=n,this.endpoint=i}require("util").inherits(nT,Error);iT.exports=nT});var aT=O($t=>{"use strict";var FF=$t&&$t.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),$F=$t&&$t.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),sT=$t&&$t.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&FF(e,r,t);return $F(e,r),e};Object.defineProperty($t,"__esModule",{value:!0});$t.req=$t.json=$t.toBuffer=void 0;var HF=sT(require("http")),UF=sT(require("https"));async function oT(r){let e=0,t=[];for await(let n of r)e+=n.length,t.push(n);return Buffer.concat(t,e)}$t.toBuffer=oT;async function qF(r){let t=(await oT(r)).toString("utf8");try{return JSON.parse(t)}catch(n){let i=n;throw i.message+=` (input: ${t})`,i}}$t.json=qF;function WF(r,e={}){let n=((typeof r=="string"?r:r.href).startsWith("https:")?UF:HF).request(r,e),i=new Promise((s,o)=>{n.once("response",s).once("error",o).end()});return n.then=i.then.bind(i),n}$t.req=WF});var pT=O(Qt=>{"use strict";var lT=Qt&&Qt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),GF=Qt&&Qt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),uT=Qt&&Qt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&lT(e,r,t);return GF(e,r),e},zF=Qt&&Qt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&lT(e,r,t)};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.Agent=void 0;var VF=uT(require("net")),cT=uT(require("http")),KF=require("https");zF(aT(),Qt);var zr=Symbol("AgentBaseInternalState"),Sm=class extends cT.Agent{constructor(e){super(e),this[zr]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
95
- `).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new VF.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let n=this.sockets[e],i=n.indexOf(t);i!==-1&&(n.splice(i,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?KF.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,n){let i={...t,secureEndpoint:this.isSecureEndpoint(t)},s=this.getName(i),o=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,i)).then(a=>{if(this.decrementSockets(s,o),a instanceof cT.Agent)try{return a.addRequest(e,i)}catch(c){return n(c)}this[zr].currentSocket=a,super.createSocket(e,t,n)},a=>{this.decrementSockets(s,o),n(a)})}createConnection(){let e=this[zr].currentSocket;if(this[zr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[zr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[zr]&&(this[zr].defaultPort=e)}get protocol(){return this[zr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[zr]&&(this[zr].protocol=e)}};Qt.Agent=Sm});var fT=O(qs=>{"use strict";var YF=qs&&qs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qs,"__esModule",{value:!0});qs.parseProxyResponse=void 0;var XF=YF(Ae()),mu=(0,XF.default)("https-proxy-agent:parse-proxy-response");function JF(r){return new Promise((e,t)=>{let n=0,i=[];function s(){let p=r.read();p?u(p):r.once("readable",s)}function o(){r.removeListener("end",a),r.removeListener("error",c),r.removeListener("readable",s)}function a(){o(),mu("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}function c(p){o(),mu("onerror %o",p),t(p)}function u(p){i.push(p),n+=p.length;let f=Buffer.concat(i,n),m=f.indexOf(`\r
94
+ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,sa="secret must be a string or buffer",Wi="key must be a string or a buffer",sF="key must be a string, a buffer or an object",mm=typeof yr.createPublicKey=="function";mm&&(Wi+=" or a KeyObject",sa+="or a KeyObject");function m1(r){if(!Gi.isBuffer(r)&&typeof r!="string"&&(!mm||typeof r!="object"||typeof r.type!="string"||typeof r.asymmetricKeyType!="string"||typeof r.export!="function"))throw Nr(Wi)}function g1(r){if(!Gi.isBuffer(r)&&typeof r!="string"&&typeof r!="object")throw Nr(sF)}function iF(r){if(!Gi.isBuffer(r)){if(typeof r=="string")return r;if(!mm||typeof r!="object"||r.type!=="secret"||typeof r.export!="function")throw Nr(sa)}}function gm(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function v1(r){r=r.toString();var e=4-r.length%4;if(e!==4)for(var t=0;t<e;++t)r+="=";return r.replace(/\-/g,"+").replace(/_/g,"/")}function Nr(r){var e=[].slice.call(arguments,1),t=d1.format.bind(d1,r).apply(null,e);return new TypeError(t)}function oF(r){return Gi.isBuffer(r)||typeof r=="string"}function ia(r){return oF(r)||(r=JSON.stringify(r)),r}function y1(r){return function(t,n){iF(n),t=ia(t);var s=yr.createHmac("sha"+r,n),i=(s.update(t),s.digest("base64"));return gm(i)}}var hm,aF="timingSafeEqual"in yr?function(e,t){return e.byteLength!==t.byteLength?!1:yr.timingSafeEqual(e,t)}:function(e,t){return hm||(hm=f1()),hm(e,t)};function cF(r){return function(t,n,s){var i=y1(r)(t,s);return aF(Gi.from(n),Gi.from(i))}}function x1(r){return function(t,n){g1(n),t=ia(t);var s=yr.createSign("RSA-SHA"+r),i=(s.update(t),s.sign(n,"base64"));return gm(i)}}function _1(r){return function(t,n,s){m1(s),t=ia(t),n=v1(n);var i=yr.createVerify("RSA-SHA"+r);return i.update(t),i.verify(s,n,"base64")}}function lF(r){return function(t,n){g1(n),t=ia(t);var s=yr.createSign("RSA-SHA"+r),i=(s.update(t),s.sign({key:n,padding:yr.constants.RSA_PKCS1_PSS_PADDING,saltLength:yr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return gm(i)}}function uF(r){return function(t,n,s){m1(s),t=ia(t),n=v1(n);var i=yr.createVerify("RSA-SHA"+r);return i.update(t),i.verify({key:s,padding:yr.constants.RSA_PKCS1_PSS_PADDING,saltLength:yr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function pF(r){var e=x1(r);return function(){var n=e.apply(null,arguments);return n=h1.derToJose(n,"ES"+r),n}}function fF(r){var e=_1(r);return function(n,s,i){s=h1.joseToDer(s,"ES"+r).toString("base64");var o=e(n,s,i);return o}}function dF(){return function(){return""}}function hF(){return function(e,t){return t===""}}b1.exports=function(e){var t={hs:y1,rs:x1,ps:lF,es:pF,none:dF},n={hs:cF,rs:_1,ps:uF,es:fF,none:hF},s=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!s)throw Nr(nF,e);var i=(s[1]||s[3]).toLowerCase(),o=s[2];return{sign:t[i](o),verify:n[i](o)}}});var ym=O((Hz,w1)=>{var mF=require("buffer").Buffer;w1.exports=function(e){return typeof e=="string"?e:typeof e=="number"||mF.isBuffer(e)?e.toString():JSON.stringify(e)}});var R1=O(($z,A1)=>{var gF=qi().Buffer,S1=pm(),vF=vm(),yF=require("stream"),E1=ym(),xm=require("util");function T1(r,e){return gF.from(r,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function xF(r,e,t){t=t||"utf8";var n=T1(E1(r),"binary"),s=T1(E1(e),t);return xm.format("%s.%s",n,s)}function C1(r){var e=r.header,t=r.payload,n=r.secret||r.privateKey,s=r.encoding,i=vF(e.alg),o=xF(e,t,s),a=i.sign(o,n);return xm.format("%s.%s",o,a)}function du(r){var e=r.secret;if(e=e??r.privateKey,e=e??r.key,/^hs/i.test(r.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new S1(e);this.readable=!0,this.header=r.header,this.encoding=r.encoding,this.secret=this.privateKey=this.key=t,this.payload=new S1(r.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}xm.inherits(du,yF);du.prototype.sign=function(){try{var e=C1({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(t){this.readable=!1,this.emit("error",t),this.emit("close")}};du.sign=C1;A1.exports=du});var j1=O((Uz,B1)=>{var O1=qi().Buffer,k1=pm(),_F=vm(),bF=require("stream"),M1=ym(),wF=require("util"),SF=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function EF(r){return Object.prototype.toString.call(r)==="[object Object]"}function TF(r){if(EF(r))return r;try{return JSON.parse(r)}catch{return}}function P1(r){var e=r.split(".",1)[0];return TF(O1.from(e,"base64").toString("binary"))}function CF(r){return r.split(".",2).join(".")}function I1(r){return r.split(".")[2]}function AF(r,e){e=e||"utf8";var t=r.split(".")[1];return O1.from(t,"base64").toString(e)}function N1(r){return SF.test(r)&&!!P1(r)}function L1(r,e,t){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}r=M1(r);var s=I1(r),i=CF(r),o=_F(e);return o.verify(i,s,t)}function D1(r,e){if(e=e||{},r=M1(r),!N1(r))return null;var t=P1(r);if(!t)return null;var n=AF(r);return(t.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:t,payload:n,signature:I1(r)}}function zi(r){r=r||{};var e=r.secret;if(e=e??r.publicKey,e=e??r.key,/^hs/i.test(r.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new k1(e);this.readable=!0,this.algorithm=r.algorithm,this.encoding=r.encoding,this.secret=this.publicKey=this.key=t,this.signature=new k1(r.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}wF.inherits(zi,bF);zi.prototype.verify=function(){try{var e=L1(this.signature.buffer,this.algorithm,this.key.buffer),t=D1(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};zi.decode=D1;zi.isValid=N1;zi.verify=L1;B1.exports=zi});var H1=O(Yn=>{var F1=R1(),hu=j1(),RF=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Yn.ALGORITHMS=RF;Yn.sign=F1.sign;Yn.verify=hu.verify;Yn.decode=hu.decode;Yn.isValid=hu.isValid;Yn.createSign=function(e){return new F1(e)};Yn.createVerify=function(e){return new hu(e)}});var mu=O((Wz,$1)=>{"use strict";var _m={};_m.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};_m.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};$1.exports=_m});var bm=O((Gz,U1)=>{"use strict";function kF(r){return/^[A-Za-z0-9\-_]+$/.test(r)}U1.exports={validate:kF}});var Sm=O((zz,X1)=>{"use strict";var OF=require("crypto"),MF=QE(),PF=H1(),{URL:W1}=require("url"),q1=mu(),G1=bm(),IF=720*60,NF=1440*60,LF=MF.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).objid().optional(),this.key("publicKey").explicit(1).bitstr().optional())});function DF(r){return LF.encode({version:1,privateKey:r,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function BF(){let r=OF.createECDH("prime256v1");r.generateKeys();let e=r.getPublicKey(),t=r.getPrivateKey();if(t.length<32){let n=Buffer.alloc(32-t.length);n.fill(0),t=Buffer.concat([n,t])}if(e.length<65){let n=Buffer.alloc(65-e.length);n.fill(0),e=Buffer.concat([n,e])}return{publicKey:e.toString("base64url"),privateKey:t.toString("base64url")}}function z1(r){if(!r)throw new Error("No subject set in vapidDetails.subject.");if(typeof r!="string"||r.length===0)throw new Error("The subject value must be a string containing an https: URL or mailto: address. "+r);let e=null;try{e=new W1(r)}catch{throw new Error("Vapid subject is not a valid URL. "+r)}if(!["https:","mailto:"].includes(e.protocol))throw new Error("Vapid subject is not an https: or mailto: URL. "+r);e.hostname==="localhost"&&console.warn("Vapid subject points to a localhost web URI, which is unsupported by Apple's push notification server and will result in a BadJwtToken error when sending notifications.")}function V1(r){if(!r)throw new Error("No key set vapidDetails.publicKey");if(typeof r!="string")throw new Error("Vapid public key is must be a URL safe Base 64 encoded string.");if(!G1.validate(r))throw new Error('Vapid public key must be a URL safe Base 64 (without "=")');if(r=Buffer.from(r,"base64url"),r.length!==65)throw new Error("Vapid public key should be 65 bytes long when decoded.")}function K1(r){if(!r)throw new Error("No key set in vapidDetails.privateKey");if(typeof r!="string")throw new Error("Vapid private key must be a URL safe Base 64 encoded string.");if(!G1.validate(r))throw new Error('Vapid private key must be a URL safe Base 64 (without "=")');if(r=Buffer.from(r,"base64url"),r.length!==32)throw new Error("Vapid private key should be 32 bytes long when decoded.")}function wm(r){let e=new Date;return e.setSeconds(e.getSeconds()+r),Math.floor(e.getTime()/1e3)}function Y1(r){if(!Number.isInteger(r))throw new Error("`expiration` value must be a number");if(r<0)throw new Error("`expiration` must be a positive integer");let e=wm(NF);if(r>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function jF(r,e,t,n,s,i){if(!r)throw new Error("No audience could be generated for VAPID.");if(typeof r!="string"||r.length===0)throw new Error("The audience value must be a string containing the origin of a push service. "+r);try{new W1(r)}catch{throw new Error("VAPID audience is not a url. "+r)}z1(e),V1(t),K1(n),n=Buffer.from(n,"base64url"),i?Y1(i):i=wm(IF);let o={typ:"JWT",alg:"ES256"},a={aud:r,exp:i,sub:e},c=PF.sign({header:o,payload:a,privateKey:DF(n)});if(s===q1.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+c+", k="+t};if(s===q1.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+c,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}X1.exports={generateVAPIDKeys:BF,getFutureExpirationTimestamp:wm,getVapidHeaders:jF,validateSubject:z1,validatePublicKey:V1,validatePrivateKey:K1,validateExpiration:Y1}});var aT=O((Vz,oT)=>{"use strict";var vu=require("crypto"),Q1="aes-128-gcm",yu={aes128gcm:1,aesgcm:2},Es=16,Yr=16,FF=12,Z1=32,oa="encrypt",aa="decrypt",me;process.env.ECE_KEYLOG==="1"?me=function(r,e){return console.warn(r+" ["+e.length+"]: "+e.toString("base64url")),e}:me=function(r,e){return e};function gu(r){return typeof r=="string"?Buffer.from(r,"base64url"):r}function eT(r,e){var t=vu.createHmac("sha256",r);return t.update(e),t.digest()}function tT(r,e){return me("salt",r),me("ikm",e),me("extract",eT(r,e))}function Em(r,e,t){me("prk",r),me("info",e);var n=Buffer.alloc(0),s=Buffer.alloc(0);e=Buffer.from(e,"ascii");for(var i=0,o=Buffer.alloc(1);n.length<t;)o.writeUIntBE(++i,0,1),s=eT(r,Buffer.concat([s,e,o])),n=Buffer.concat([n,s]);return me("expand",n.slice(0,t))}function rT(r,e,t,n){return Em(tT(r,e),t,n)}function Tm(r,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+r+"\0","ascii"),e]);return me("info "+r,t),t}function J1(r){var e=Buffer.concat([Buffer.alloc(2),r]);return e.writeUIntBE(r.length,0,2),e}function HF(r,e){var t=r.privateKey,n,s;if(e===oa)n=t.getPublicKey(),s=r.dh;else if(e===aa)n=r.dh,s=t.getPublicKey();else throw new Error("Unknown mode only "+oa+" and "+aa+" supported");return{secret:t.computeSecret(r.dh),context:Buffer.concat([Buffer.from(r.keylabel,"ascii"),Buffer.from([0]),J1(s),J1(n)])}}function $F(r,e){var t={secret:null,context:Buffer.alloc(0)};if(r.key){if(t.secret=r.key,t.secret.length!==Yr)throw new Error("An explicit key must be "+Yr+" bytes")}else r.dh?t=HF(r,e):typeof r.keyid!==void 0&&(t.secret=r.keymap[r.keyid]);if(!t.secret)throw new Error("Unable to determine key");return me("secret",t.secret),me("context",t.context),r.authSecret&&(t.secret=rT(r.authSecret,t.secret,Tm("auth",Buffer.alloc(0)),Z1),me("authsecret",t.secret)),t}function UF(r,e){if(!r.authSecret)throw new Error("No authentication secret for webpush");me("authsecret",r.authSecret);var t,n,s;if(e===oa)n=r.privateKey.getPublicKey(),t=s=r.dh;else if(e===aa)t=n=r.keyid,s=r.privateKey.getPublicKey();else throw new Error("Unknown mode only "+oa+" and "+aa+" supported");return me("remote pubkey",t),me("sender pubkey",n),me("receiver pubkey",s),me("secret dh",rT(r.authSecret,r.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),s,n]),Z1))}function qF(r,e,t){if(t&&!QF(t))throw new Error("Callback is not a function");if(r.key){if(r.key.length!==Yr)throw new Error("An explicit key must be "+Yr+" bytes");return me("secret key",r.key)}if(!r.privateKey){if(t)var n=t(r.keyid);else var n=r.keymap&&r.keymap[r.keyid];if(!n)throw new Error('No saved key (keyid: "'+r.keyid+'")');return n}return UF(r,e)}function nT(r,e,t){if(!r.salt)throw new Error("must include a salt parameter for "+r.version);var n,s,i;if(r.version==="aesgcm"){var o=$F(r,e,t);n=Tm("aesgcm",o.context),s=Tm("nonce",o.context),i=o.secret}else if(r.version==="aes128gcm")n=Buffer.from("Content-Encoding: aes128gcm\0"),s=Buffer.from("Content-Encoding: nonce\0"),i=qF(r,e,t);else throw new Error("Unable to set context for mode "+r.version);var a=tT(r.salt,i),c={key:Em(a,n,Yr),nonce:Em(a,s,FF)};return me("key",c.key),me("nonce base",c.nonce),c}function sT(r){var e={};e.version=r.version||"aes128gcm",e.rs=parseInt(r.rs,10),isNaN(e.rs)&&(e.rs=4096);var t=yu[e.version];if(e.version==="aes128gcm"&&(t+=Es),e.rs<=t)throw new Error("The rs parameter has to be greater than "+t);if(r.salt&&(e.salt=gu(r.salt),e.salt.length!==Yr))throw new Error("The salt parameter must be "+Yr+" bytes");return e.keyid=r.keyid,r.key?e.key=gu(r.key):(e.privateKey=r.privateKey,e.privateKey||(e.keymap=r.keymap),e.version!=="aes128gcm"&&(e.keylabel=r.keylabel||"P-256"),r.dh&&(e.dh=gu(r.dh))),r.authSecret&&(e.authSecret=gu(r.authSecret)),e}function iT(r,e){var t=Buffer.from(r),n=t.readUIntBE(t.length-6,6),s=((n^e)&16777215)+((n/16777216^e/16777216)&16777215)*16777216;return t.writeUIntBE(s,t.length-6,6),me("nonce"+e,t),t}function WF(r,e){var t=r.readUIntBE(20,1);return e.salt=r.slice(0,Yr),e.rs=r.readUIntBE(Yr,4),e.keyid=r.slice(21,21+t),21+t}function GF(r,e){var t=yu[e],n=r.readUIntBE(0,t);if(n+t>r.length)throw new Error("padding exceeds block size");me("padding",r.slice(0,t+n));var s=Buffer.alloc(n);if(s.fill(0),s.compare(r.slice(t,t+n))!==0)throw new Error("invalid padding");return r.slice(t+n)}function zF(r,e){for(var t=r.length-1;t>=0;){if(r[t]){if(e){if(r[t]!==2)throw new Error("last record needs to start padding with a 2")}else if(r[t]!==1)throw new Error("last record needs to start padding with a 2");return r.slice(0,t)}--t}throw new Error("all zero plaintext")}function VF(r,e,t,n,s){me("decrypt",t);var i=iT(r.nonce,e),o=vu.createDecipheriv(Q1,r.key,i);o.setAuthTag(t.slice(t.length-Es));var a=o.update(t.slice(0,t.length-Es));return a=Buffer.concat([a,o.final()]),me("decrypted",a),n.version!=="aes128gcm"?GF(a,n.version):zF(a,s)}function KF(r,e,t){var n=sT(e);if(n.version==="aes128gcm"){var s=WF(r,n);r=r.slice(s)}var i=nT(n,aa,t),o=0,a=Buffer.alloc(0),c=n.rs;n.version!=="aes128gcm"&&(c+=Es);for(var l=0;o<r.length;++l){var p=o+c;if(n.version!=="aes128gcm"&&p===r.length)throw new Error("Truncated payload");if(p=Math.min(p,r.length),p-o<=Es)throw new Error("Invalid block: too small at "+l);var f=VF(i,l,r.slice(o,p),n,p>=r.length);a=Buffer.concat([a,f]),o=p}return a}function YF(r,e,t,n,s,i){me("encrypt",t),n=n||0;var o=iT(r.nonce,e),a=vu.createCipheriv(Q1,r.key,o),c=[],l=yu[s.version],p=Buffer.alloc(n+l);if(p.fill(0),s.version!=="aes128gcm"){if(p.writeUIntBE(n,0,l),me("padding",p),c.push(a.update(p)),c.push(a.update(t)),!i&&p.length+t.length<s.rs)throw new Error("Unable to pad to record size")}else c.push(a.update(t)),p.writeUIntBE(i?2:1,0,1),me("padding",p),c.push(a.update(p));a.final();var f=a.getAuthTag();if(f.length!==Es)throw new Error("invalid tag generated");return c.push(f),me("encrypted",Buffer.concat(c))}function XF(r){var e=Buffer.alloc(5),t=Buffer.from(r.keyid||[]);if(t.length>255)throw new Error("keyid is too large");return e.writeUIntBE(r.rs,0,4),e.writeUIntBE(t.length,4,1),Buffer.concat([r.salt,e,t])}function JF(r,e,t){if(!Buffer.isBuffer(r))throw new Error("buffer argument must be a Buffer");var n=sT(e);n.salt||(n.salt=vu.randomBytes(Yr));var s;n.version==="aes128gcm"?(n.privateKey&&!n.keyid&&(n.keyid=n.privateKey.getPublicKey()),s=XF(n)):s=Buffer.alloc(0);var i=nT(n,oa,t),o=0,a=yu[n.version],c=a;n.version==="aes128gcm"&&(c+=Es);for(var l=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),p=0,f=!1;!f;){var h=Math.min(n.rs-c-1,l);n.version!=="aes128gcm"&&(h=Math.min((1<<a*8)-1,h)),l>0&&h===0&&++h,l-=h;var x=o+n.rs-c-h;n.version!=="aes128gcm"?f=x>r.length:f=x>=r.length,f=f&&l<=0;var _=YF(i,p,r.slice(o,x),h,n,f);s=Buffer.concat([s,_]),o=x,++p}return s}function QF(r){return typeof r=="function"}oT.exports={decrypt:KF,encrypt:JF}});var Cm=O((Kz,lT)=>{"use strict";var cT=require("crypto"),ZF=aT(),eH=function(r,e,t,n){if(!r)throw new Error("No user public key provided for encryption.");if(typeof r!="string")throw new Error("The subscription p256dh value must be a string.");if(Buffer.from(r,"base64url").length!==65)throw new Error("The subscription p256dh value should be 65 bytes long.");if(!e)throw new Error("No user auth provided for encryption.");if(typeof e!="string")throw new Error("The subscription auth key must be a string.");if(Buffer.from(e,"base64url").length<16)throw new Error("The subscription auth key should be at least 16 bytes long");if(typeof t!="string"&&!Buffer.isBuffer(t))throw new Error("Payload must be either a string or a Node Buffer.");(typeof t=="string"||t instanceof String)&&(t=Buffer.from(t));let s=cT.createECDH("prime256v1"),i=s.generateKeys(),o=cT.randomBytes(16).toString("base64url"),a=ZF.encrypt(t,{version:n,dh:r,privateKey:s,salt:o,authSecret:e});return{localPublicKey:i,salt:o,cipherText:a}};lT.exports={encrypt:eH}});var Am=O((Yz,pT)=>{"use strict";function uT(r,e,t,n,s){Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=r,this.statusCode=e,this.headers=t,this.body=n,this.endpoint=s}require("util").inherits(uT,Error);pT.exports=uT});var hT=O(Wt=>{"use strict";var tH=Wt&&Wt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),rH=Wt&&Wt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),fT=Wt&&Wt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&tH(e,r,t);return rH(e,r),e};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.req=Wt.json=Wt.toBuffer=void 0;var nH=fT(require("http")),sH=fT(require("https"));async function dT(r){let e=0,t=[];for await(let n of r)e+=n.length,t.push(n);return Buffer.concat(t,e)}Wt.toBuffer=dT;async function iH(r){let t=(await dT(r)).toString("utf8");try{return JSON.parse(t)}catch(n){let s=n;throw s.message+=` (input: ${t})`,s}}Wt.json=iH;function oH(r,e={}){let n=((typeof r=="string"?r:r.href).startsWith("https:")?sH:nH).request(r,e),s=new Promise((i,o)=>{n.once("response",i).once("error",o).end()});return n.then=s.then.bind(s),n}Wt.req=oH});var yT=O(tr=>{"use strict";var gT=tr&&tr.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),aH=tr&&tr.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),vT=tr&&tr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&gT(e,r,t);return aH(e,r),e},cH=tr&&tr.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&gT(e,r,t)};Object.defineProperty(tr,"__esModule",{value:!0});tr.Agent=void 0;var lH=vT(require("net")),mT=vT(require("http")),uH=require("https");cH(hT(),tr);var Xr=Symbol("AgentBaseInternalState"),Rm=class extends mT.Agent{constructor(e){super(e),this[Xr]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
95
+ `).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new lH.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let n=this.sockets[e],s=n.indexOf(t);s!==-1&&(n.splice(s,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?uH.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,n){let s={...t,secureEndpoint:this.isSecureEndpoint(t)},i=this.getName(s),o=this.incrementSockets(i);Promise.resolve().then(()=>this.connect(e,s)).then(a=>{if(this.decrementSockets(i,o),a instanceof mT.Agent)try{return a.addRequest(e,s)}catch(c){return n(c)}this[Xr].currentSocket=a,super.createSocket(e,t,n)},a=>{this.decrementSockets(i,o),n(a)})}createConnection(){let e=this[Xr].currentSocket;if(this[Xr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Xr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Xr]&&(this[Xr].defaultPort=e)}get protocol(){return this[Xr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Xr]&&(this[Xr].protocol=e)}};tr.Agent=Rm});var xT=O(Vi=>{"use strict";var pH=Vi&&Vi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.parseProxyResponse=void 0;var fH=pH(ke()),xu=(0,fH.default)("https-proxy-agent:parse-proxy-response");function dH(r){return new Promise((e,t)=>{let n=0,s=[];function i(){let p=r.read();p?l(p):r.once("readable",i)}function o(){r.removeListener("end",a),r.removeListener("error",c),r.removeListener("readable",i)}function a(){o(),xu("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}function c(p){o(),xu("onerror %o",p),t(p)}function l(p){s.push(p),n+=p.length;let f=Buffer.concat(s,n),h=f.indexOf(`\r
96
96
  \r
97
- `);if(m===-1){mu("have not received end of HTTP headers yet..."),s();return}let y=f.slice(0,m).toString("ascii").split(`\r
98
- `),_=y.shift();if(!_)return r.destroy(),t(new Error("No header received from proxy CONNECT response"));let S=_.split(" "),A=+S[1],M=S.slice(2).join(" "),L={};for(let N of y){if(!N)continue;let j=N.indexOf(":");if(j===-1)return r.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${N}"`));let W=N.slice(0,j).toLowerCase(),q=N.slice(j+1).trimStart(),G=L[W];typeof G=="string"?L[W]=[G,q]:Array.isArray(G)?G.push(q):L[W]=q}mu("got proxy server response: %o %o",_,L),o(),e({connect:{statusCode:A,statusText:M,headers:L},buffered:f})}r.on("error",c),r.on("end",a),s()})}qs.parseProxyResponse=JF});var xT=O(gr=>{"use strict";var QF=gr&&gr.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),ZF=gr&&gr.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),gT=gr&&gr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&QF(e,r,t);return ZF(e,r),e},vT=gr&&gr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(gr,"__esModule",{value:!0});gr.HttpsProxyAgent=void 0;var gu=gT(require("net")),dT=gT(require("tls")),e3=vT(require("assert")),t3=vT(Ae()),r3=pT(),n3=require("url"),i3=fT(),ia=(0,t3.default)("https-proxy-agent"),hT=r=>r.servername===void 0&&r.host&&!gu.isIP(r.host)?{...r,servername:r.host}:r,vu=class extends r3.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new n3.URL(e):e,this.proxyHeaders=t?.headers??{},ia("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?mT(t,"headers"):null,host:n,port:i}}async connect(e,t){let{proxy:n}=this;if(!t.host)throw new TypeError('No "host" provided');let i;n.protocol==="https:"?(ia("Creating `tls.Socket`: %o",this.connectOpts),i=dT.connect(hT(this.connectOpts))):(ia("Creating `net.Socket`: %o",this.connectOpts),i=gu.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=gu.isIPv6(t.host)?`[${t.host}]`:t.host,a=`CONNECT ${o}:${t.port} HTTP/1.1\r
99
- `;if(n.username||n.password){let m=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(m).toString("base64")}`}s.Host=`${o}:${t.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let m of Object.keys(s))a+=`${m}: ${s[m]}\r
100
- `;let c=(0,i3.parseProxyResponse)(i);i.write(`${a}\r
101
- `);let{connect:u,buffered:p}=await c;if(e.emit("proxyConnect",u),this.emit("proxyConnect",u,e),u.statusCode===200)return e.once("socket",s3),t.secureEndpoint?(ia("Upgrading socket connection to TLS"),dT.connect({...mT(hT(t),"host","path","port"),socket:i})):i;i.destroy();let f=new gu.Socket({writable:!1});return f.readable=!0,e.once("socket",m=>{ia("Replaying proxy buffer for failed request"),(0,e3.default)(m.listenerCount("data")>0),m.push(p),m.push(null)}),f}};vu.protocols=["http","https"];gr.HttpsProxyAgent=vu;function s3(r){r.resume()}function mT(r,...e){let t={},n;for(n in r)e.includes(n)||(t[n]=r[n]);return t}});var ST=O((mz,wT)=>{"use strict";var _T=require("url"),bT=require("https"),o3=wm(),xu=xm(),a3=bm(),Zt=pu(),c3=gm(),yT=2419200,Em="",Tm;function sa(){}sa.prototype.setGCMAPIKey=function(r){if(r===null){Em=null;return}if(typeof r>"u"||typeof r!="string"||r.length===0)throw new Error("The GCM API Key should be a non-empty string or null.");Em=r};sa.prototype.setVapidDetails=function(r,e,t){if(arguments.length===1&&arguments[0]===null){Tm=null;return}xu.validateSubject(r),xu.validatePublicKey(e),xu.validatePrivateKey(t),Tm={subject:r,publicKey:e,privateKey:t}};sa.prototype.generateRequestDetails=function(r,e,t){if(!r||!r.endpoint)throw new Error("You must pass in a subscription with at least an endpoint.");if(typeof r.endpoint!="string"||r.endpoint.length===0)throw new Error("The subscription endpoint must be a string with a valid URL.");if(e&&(typeof r!="object"||!r.keys||!r.keys.p256dh||!r.keys.auth))throw new Error("To send a message with a payload, the subscription must have 'auth' and 'p256dh' keys.");let n=Em,i=Tm,s=yT,o={},a=Zt.supportedContentEncodings.AES_128_GCM,c=Zt.supportedUrgency.NORMAL,u,p,f,m;if(t){let M=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],L=Object.keys(t);for(let N=0;N<L.length;N+=1){let j=L[N];if(!M.includes(j))throw new Error("'"+j+"' is an invalid option. The valid options are ['"+M.join("', '")+"'].")}if(t.headers){o=t.headers;let N=Object.keys(o).filter(function(j){return typeof t[j]<"u"});if(N.length>0)throw new Error("Duplicated headers defined ["+N.join(",")+"]. Please either define the header in thetop level options OR in the 'headers' key.")}if(t.gcmAPIKey&&(n=t.gcmAPIKey),t.vapidDetails!==void 0&&(i=t.vapidDetails),t.TTL!==void 0&&(s=Number(t.TTL),s<0))throw new Error("TTL should be a number and should be at least 0");if(t.contentEncoding)if(t.contentEncoding===Zt.supportedContentEncodings.AES_128_GCM||t.contentEncoding===Zt.supportedContentEncodings.AES_GCM)a=t.contentEncoding;else throw new Error("Unsupported content encoding specified.");if(t.urgency)if(t.urgency===Zt.supportedUrgency.VERY_LOW||t.urgency===Zt.supportedUrgency.LOW||t.urgency===Zt.supportedUrgency.NORMAL||t.urgency===Zt.supportedUrgency.HIGH)c=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!c3.validate(t.topic))throw new Error("Unsupported characters set use the URL or filename-safe Base64 characters set");if(t.topic.length>32)throw new Error("use maximum of 32 characters from the URL or filename-safe Base64 characters set");u=t.topic}t.proxy&&(typeof t.proxy=="string"||typeof t.proxy.host=="string"?p=t.proxy:console.warn("Attempt to use proxy option, but invalid type it should be a string or proxy options object.")),t.agent&&(t.agent instanceof bT.Agent?(p&&console.warn("Agent option will be ignored because proxy option is defined."),f=t.agent):console.warn("Wrong type for the agent option, it should be an instance of https.Agent.")),typeof t.timeout=="number"&&(m=t.timeout)}typeof s>"u"&&(s=yT);let y={method:"POST",headers:{TTL:s}};Object.keys(o).forEach(function(M){y.headers[M]=o[M]});let _=null;if(e){let M=a3.encrypt(r.keys.p256dh,r.keys.auth,e,a);y.headers["Content-Length"]=M.cipherText.length,y.headers["Content-Type"]="application/octet-stream",a===Zt.supportedContentEncodings.AES_128_GCM?y.headers["Content-Encoding"]=Zt.supportedContentEncodings.AES_128_GCM:a===Zt.supportedContentEncodings.AES_GCM&&(y.headers["Content-Encoding"]=Zt.supportedContentEncodings.AES_GCM,y.headers.Encryption="salt="+M.salt,y.headers["Crypto-Key"]="dh="+M.localPublicKey.toString("base64url")),_=M.cipherText}else y.headers["Content-Length"]=0;let S=r.endpoint.startsWith("https://android.googleapis.com/gcm/send"),A=r.endpoint.startsWith("https://fcm.googleapis.com/fcm/send");if(S)n?y.headers.Authorization="key="+n:console.warn("Attempt to send push notification to GCM endpoint, but no GCM key is defined. Please use setGCMApiKey() or add 'gcmAPIKey' as an option.");else if(i){let M=_T.parse(r.endpoint),L=M.protocol+"//"+M.host,N=xu.getVapidHeaders(L,i.subject,i.publicKey,i.privateKey,a);y.headers.Authorization=N.Authorization,a===Zt.supportedContentEncodings.AES_GCM&&(y.headers["Crypto-Key"]?y.headers["Crypto-Key"]+=";"+N["Crypto-Key"]:y.headers["Crypto-Key"]=N["Crypto-Key"])}else A&&n&&(y.headers.Authorization="key="+n);return y.headers.Urgency=c,u&&(y.headers.Topic=u),y.body=_,y.endpoint=r.endpoint,p&&(y.proxy=p),f&&(y.agent=f),m&&(y.timeout=m),y};sa.prototype.sendNotification=function(r,e,t){let n;try{n=this.generateRequestDetails(r,e,t)}catch(i){return Promise.reject(i)}return new Promise(function(i,s){let o={},a=_T.parse(n.endpoint);if(o.hostname=a.hostname,o.port=a.port,o.path=a.path,o.headers=n.headers,o.method=n.method,n.timeout&&(o.timeout=n.timeout),n.agent&&(o.agent=n.agent),n.proxy){let{HttpsProxyAgent:u}=xT();o.agent=new u(n.proxy)}let c=bT.request(o,function(u){let p="";u.on("data",function(f){p+=f}),u.on("end",function(){u.statusCode<200||u.statusCode>299?s(new o3("Received unexpected response code",u.statusCode,u.headers,p,n.endpoint)):i({statusCode:u.statusCode,body:p,headers:u.headers})})});n.timeout&&c.on("timeout",function(){c.destroy(new Error("Socket timeout"))}),c.on("error",function(u){s(u)}),n.body&&c.write(n.body),c.end()})};wT.exports=sa});var CT=O((gz,TT)=>{"use strict";var ET=xm(),l3=bm(),u3=ST(),p3=wm(),f3=pu(),oa=new u3;TT.exports={WebPushError:p3,supportedContentEncodings:f3.supportedContentEncodings,encrypt:l3.encrypt,getVapidHeaders:ET.getVapidHeaders,generateVAPIDKeys:ET.generateVAPIDKeys,setGCMAPIKey:oa.setGCMAPIKey,setVapidDetails:oa.setVapidDetails,generateRequestDetails:oa.generateRequestDetails,sendNotification:oa.sendNotification.bind(oa)}});var pa=O((Vz,iC)=>{"use strict";var L3=require("path"),Kr="\\\\/",eC=`[^${Kr}]`,D3=0,wn="\\.",B3="\\+",j3="\\?",Eu="\\/",F3="(?=.)",tC="[^/]",Rm=`(?:${Eu}|$)`,rC=`(?:^|${Eu})`,km=`${wn}{1,2}${Rm}`,$3=`(?!${wn})`,H3=`(?!${rC}${km})`,U3=`(?!${wn}{0,1}${Rm})`,q3=`(?!${km})`,W3=`[^.${Eu}]`,G3=`${tC}*?`,nC={DOT_LITERAL:wn,PLUS_LITERAL:B3,QMARK_LITERAL:j3,SLASH_LITERAL:Eu,ONE_CHAR:F3,QMARK:tC,END_ANCHOR:Rm,DOTS_SLASH:km,NO_DOT:$3,NO_DOTS:H3,NO_DOT_SLASH:U3,NO_DOTS_SLASH:q3,QMARK_NO_DOT:W3,STAR:G3,START_ANCHOR:rC},z3={...nC,SLASH_LITERAL:`[${Kr}]`,QMARK:eC,STAR:`${eC}*?`,DOTS_SLASH:`${wn}{1,2}(?:[${Kr}]|$)`,NO_DOT:`(?!${wn})`,NO_DOTS:`(?!(?:^|[${Kr}])${wn}{1,2}(?:[${Kr}]|$))`,NO_DOT_SLASH:`(?!${wn}{0,1}(?:[${Kr}]|$))`,NO_DOTS_SLASH:`(?!${wn}{1,2}(?:[${Kr}]|$))`,QMARK_NO_DOT:`[^.${Kr}]`,START_ANCHOR:`(?:^|[${Kr}])`,END_ANCHOR:`(?:[${Kr}]|$)`},V3={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};iC.exports={DEFAULT_MAX_EXTGLOB_RECURSION:D3,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:V3,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:L3.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?z3:nC}}});var Tu=O(Ut=>{"use strict";var K3=require("path"),Y3=process.platform==="win32",{REGEX_BACKSLASH:X3,REGEX_REMOVE_BACKSLASH:J3,REGEX_SPECIAL_CHARS:Q3,REGEX_SPECIAL_CHARS_GLOBAL:Z3}=pa();Ut.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);Ut.hasRegexChars=r=>Q3.test(r);Ut.isRegexChar=r=>r.length===1&&Ut.hasRegexChars(r);Ut.escapeRegex=r=>r.replace(Z3,"\\$1");Ut.toPosixSlashes=r=>r.replace(X3,"/");Ut.removeBackslashes=r=>r.replace(J3,e=>e==="\\"?"":e);Ut.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};Ut.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:Y3===!0||K3.sep==="\\";Ut.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?Ut.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};Ut.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};Ut.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",i=t.contains?"":"$",s=`${n}(?:${r})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var fC=O((Yz,pC)=>{"use strict";var sC=Tu(),{CHAR_ASTERISK:Om,CHAR_AT:e$,CHAR_BACKWARD_SLASH:fa,CHAR_COMMA:t$,CHAR_DOT:Mm,CHAR_EXCLAMATION_MARK:Pm,CHAR_FORWARD_SLASH:uC,CHAR_LEFT_CURLY_BRACE:Im,CHAR_LEFT_PARENTHESES:Nm,CHAR_LEFT_SQUARE_BRACKET:r$,CHAR_PLUS:n$,CHAR_QUESTION_MARK:oC,CHAR_RIGHT_CURLY_BRACE:i$,CHAR_RIGHT_PARENTHESES:aC,CHAR_RIGHT_SQUARE_BRACKET:s$}=pa(),cC=r=>r===uC||r===fa,lC=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},o$=(r,e)=>{let t=e||{},n=r.length-1,i=t.parts===!0||t.scanToEnd===!0,s=[],o=[],a=[],c=r,u=-1,p=0,f=0,m=!1,y=!1,_=!1,S=!1,A=!1,M=!1,L=!1,N=!1,j=!1,W=!1,q=0,G,P,$={value:"",depth:0,isGlob:!1},T=()=>u>=n,l=()=>c.charCodeAt(u+1),h=()=>(G=P,c.charCodeAt(++u));for(;u<n;){P=h();let C;if(P===fa){L=$.backslashes=!0,P=h(),P===Im&&(M=!0);continue}if(M===!0||P===Im){for(q++;T()!==!0&&(P=h());){if(P===fa){L=$.backslashes=!0,h();continue}if(P===Im){q++;continue}if(M!==!0&&P===Mm&&(P=h())===Mm){if(m=$.isBrace=!0,_=$.isGlob=!0,W=!0,i===!0)continue;break}if(M!==!0&&P===t$){if(m=$.isBrace=!0,_=$.isGlob=!0,W=!0,i===!0)continue;break}if(P===i$&&(q--,q===0)){M=!1,m=$.isBrace=!0,W=!0;break}}if(i===!0)continue;break}if(P===uC){if(s.push(u),o.push($),$={value:"",depth:0,isGlob:!1},W===!0)continue;if(G===Mm&&u===p+1){p+=2;continue}f=u+1;continue}if(t.noext!==!0&&(P===n$||P===e$||P===Om||P===oC||P===Pm)===!0&&l()===Nm){if(_=$.isGlob=!0,S=$.isExtglob=!0,W=!0,P===Pm&&u===p&&(j=!0),i===!0){for(;T()!==!0&&(P=h());){if(P===fa){L=$.backslashes=!0,P=h();continue}if(P===aC){_=$.isGlob=!0,W=!0;break}}continue}break}if(P===Om){if(G===Om&&(A=$.isGlobstar=!0),_=$.isGlob=!0,W=!0,i===!0)continue;break}if(P===oC){if(_=$.isGlob=!0,W=!0,i===!0)continue;break}if(P===r$){for(;T()!==!0&&(C=h());){if(C===fa){L=$.backslashes=!0,h();continue}if(C===s$){y=$.isBracket=!0,_=$.isGlob=!0,W=!0;break}}if(i===!0)continue;break}if(t.nonegate!==!0&&P===Pm&&u===p){N=$.negated=!0,p++;continue}if(t.noparen!==!0&&P===Nm){if(_=$.isGlob=!0,i===!0){for(;T()!==!0&&(P=h());){if(P===Nm){L=$.backslashes=!0,P=h();continue}if(P===aC){W=!0;break}}continue}break}if(_===!0){if(W=!0,i===!0)continue;break}}t.noext===!0&&(S=!1,_=!1);let x=c,w="",g="";p>0&&(w=c.slice(0,p),c=c.slice(p),f-=p),x&&_===!0&&f>0?(x=c.slice(0,f),g=c.slice(f)):_===!0?(x="",g=c):x=c,x&&x!==""&&x!=="/"&&x!==c&&cC(x.charCodeAt(x.length-1))&&(x=x.slice(0,-1)),t.unescape===!0&&(g&&(g=sC.removeBackslashes(g)),x&&L===!0&&(x=sC.removeBackslashes(x)));let v={prefix:w,input:r,start:p,base:x,glob:g,isBrace:m,isBracket:y,isGlob:_,isExtglob:S,isGlobstar:A,negated:N,negatedExtglob:j};if(t.tokens===!0&&(v.maxDepth=0,cC(P)||o.push($),v.tokens=o),t.parts===!0||t.tokens===!0){let C;for(let b=0;b<s.length;b++){let d=C?C+1:p,E=s[b],U=r.slice(d,E);t.tokens&&(b===0&&p!==0?(o[b].isPrefix=!0,o[b].value=w):o[b].value=U,lC(o[b]),v.maxDepth+=o[b].depth),(b!==0||U!=="")&&a.push(U),C=E}if(C&&C+1<r.length){let b=r.slice(C+1);a.push(b),t.tokens&&(o[o.length-1].value=b,lC(o[o.length-1]),v.maxDepth+=o[o.length-1].depth)}v.slashes=s,v.parts=a}return v};pC.exports=o$});var vC=O((Xz,gC)=>{"use strict";var da=pa(),Tt=Tu(),{MAX_LENGTH:Cu,POSIX_REGEX_SOURCE:a$,REGEX_NON_SPECIAL_CHARS:c$,REGEX_SPECIAL_CHARS_BACKREF:l$,REPLACEMENTS:dC}=da,u$=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch{return r.map(i=>Tt.escapeRegex(i)).join("..")}return t},Gs=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,hC=r=>{let e=[],t=0,n=0,i=0,s="",o=!1;for(let a of r){if(o===!0){s+=a,o=!1;continue}if(a==="\\"){s+=a,o=!0;continue}if(a==='"'){i=i===1?0:1,s+=a;continue}if(i===0){if(a==="[")t++;else if(a==="]"&&t>0)t--;else if(t===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(s),s="";continue}}}s+=a}return e.push(s),e},p$=r=>{let e=!1;for(let t of r){if(e===!0){e=!1;continue}if(t==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(t))return!1}return!0},mC=r=>{let e=r.trim(),t=!0;for(;t===!0;)t=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),t=!0);if(p$(e))return e.replace(/\\(.)/g,"$1")},f$=r=>{let e=r.map(mC).filter(Boolean);for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let i=e[t],s=e[n],o=i[0];if(!(!o||i!==o.repeat(i.length)||s!==o.repeat(s.length))&&(i===s||i.startsWith(s)||s.startsWith(i)))return!0}return!1},Lm=(r,e=!0)=>{if(r[0]!=="+"&&r[0]!=="*"||r[1]!=="(")return;let t=0,n=0,i=0,s=!1;for(let o=1;o<r.length;o++){let a=r[o];if(s===!0){s=!1;continue}if(a==="\\"){s=!0;continue}if(a==='"'){i=i===1?0:1;continue}if(i!==1){if(a==="["){t++;continue}if(a==="]"&&t>0){t--;continue}if(!(t>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&o!==r.length-1?void 0:{type:r[0],body:r.slice(2,o),end:o}}}}},d$=r=>{let e=0,t=[];for(;e<r.length;){let i=Lm(r.slice(e),!1);if(!i||i.type!=="*")return;let s=hC(i.body).map(a=>a.trim());if(s.length!==1)return;let o=mC(s[0]);if(!o||o.length!==1)return;t.push(o),e+=i.end+1}return t.length<1?void 0:`${t.length===1?Tt.escapeRegex(t[0]):`[${t.map(i=>Tt.escapeRegex(i)).join("")}]`}*`},h$=r=>{let e=0,t=r.trim(),n=Lm(t);for(;n;)e++,t=n.body.trim(),n=Lm(t);return e},m$=(r,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let t=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:da.DEFAULT_MAX_EXTGLOB_RECURSION,n=hC(r).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||f$(n)))return{risky:!0};for(let i of n){let s=d$(i);if(s)return{risky:!0,safeOutput:s};if(h$(i)>t)return{risky:!0}}return{risky:!1}},Dm=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=dC[r]||r;let t={...e},n=typeof t.maxLength=="number"?Math.min(Cu,t.maxLength):Cu,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:t.prepend||""},o=[s],a=t.capture?"":"?:",c=Tt.isWindows(e),u=da.globChars(c),p=da.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:m,SLASH_LITERAL:y,ONE_CHAR:_,DOTS_SLASH:S,NO_DOT:A,NO_DOT_SLASH:M,NO_DOTS_SLASH:L,QMARK:N,QMARK_NO_DOT:j,STAR:W,START_ANCHOR:q}=u,G=R=>`(${a}(?:(?!${q}${R.dot?S:f}).)*?)`,P=t.dot?"":A,$=t.dot?N:j,T=t.bash===!0?G(t):W;t.capture&&(T=`(${T})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let l={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};r=Tt.removePrefix(r,l),i=r.length;let h=[],x=[],w=[],g=s,v,C=()=>l.index===i-1,b=l.peek=(R=1)=>r[l.index+R],d=l.advance=()=>r[++l.index]||"",E=()=>r.slice(l.index+1),U=(R="",X=0)=>{l.consumed+=R,l.index+=X},I=R=>{l.output+=R.output!=null?R.output:R.value,U(R.value)},D=()=>{let R=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)d(),l.start++,R++;return R%2===0?!1:(l.negated=!0,l.start++,!0)},H=R=>{l[R]++,w.push(R)},V=R=>{l[R]--,w.pop()},B=R=>{if(g.type==="globstar"){let X=l.braces>0&&(R.type==="comma"||R.type==="brace"),k=R.extglob===!0||h.length&&(R.type==="pipe"||R.type==="paren");R.type!=="slash"&&R.type!=="paren"&&!X&&!k&&(l.output=l.output.slice(0,-g.output.length),g.type="star",g.value="*",g.output=T,l.output+=g.output)}if(h.length&&R.type!=="paren"&&(h[h.length-1].inner+=R.value),(R.value||R.output)&&I(R),g&&g.type==="text"&&R.type==="text"){g.value+=R.value,g.output=(g.output||"")+R.value;return}R.prev=g,o.push(R),g=R},me=(R,X)=>{let k={...p[X],conditions:1,inner:""};k.prev=g,k.parens=l.parens,k.output=l.output,k.startIndex=l.index,k.tokensIndex=o.length;let F=(t.capture?"(":"")+k.open;H("parens"),B({type:R,value:X,output:l.output?"":_}),B({type:"paren",extglob:!0,value:d(),output:F}),h.push(k)},ie=R=>{let X=r.slice(R.startIndex,l.index+1),k=r.slice(R.startIndex+2,l.index),F=m$(k,t);if((R.type==="plus"||R.type==="star")&&F.risky){let z=F.safeOutput?(R.output?"":_)+(t.capture?`(${F.safeOutput})`:F.safeOutput):void 0,ge=o[R.tokensIndex];ge.type="text",ge.value=X,ge.output=z||Tt.escapeRegex(X);for(let re=R.tokensIndex+1;re<o.length;re++)o[re].value="",o[re].output="",delete o[re].suffix;l.output=R.output+ge.output,l.backtrack=!0,B({type:"paren",extglob:!0,value:v,output:""}),V("parens");return}let Q=R.close+(t.capture?")":""),K;if(R.type==="negate"){let z=T;if(R.inner&&R.inner.length>1&&R.inner.includes("/")&&(z=G(t)),(z!==T||C()||/^\)+$/.test(E()))&&(Q=R.close=`)$))${z}`),R.inner.includes("*")&&(K=E())&&/^\.[^\\/.]+$/.test(K)){let ge=Dm(K,{...e,fastpaths:!1}).output;Q=R.close=`)${ge})${z})`}R.prev.type==="bos"&&(l.negatedExtglob=!0)}B({type:"paren",extglob:!0,value:v,output:Q}),V("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let R=!1,X=r.replace(l$,(k,F,Q,K,z,ge)=>K==="\\"?(R=!0,k):K==="?"?F?F+K+(z?N.repeat(z.length):""):ge===0?$+(z?N.repeat(z.length):""):N.repeat(Q.length):K==="."?f.repeat(Q.length):K==="*"?F?F+K+(z?T:""):T:F?k:`\\${k}`);return R===!0&&(t.unescape===!0?X=X.replace(/\\/g,""):X=X.replace(/\\+/g,k=>k.length%2===0?"\\\\":k?"\\":"")),X===r&&t.contains===!0?(l.output=r,l):(l.output=Tt.wrapOutput(X,l,e),l)}for(;!C();){if(v=d(),v==="\0")continue;if(v==="\\"){let k=b();if(k==="/"&&t.bash!==!0||k==="."||k===";")continue;if(!k){v+="\\",B({type:"text",value:v});continue}let F=/^\\+/.exec(E()),Q=0;if(F&&F[0].length>2&&(Q=F[0].length,l.index+=Q,Q%2!==0&&(v+="\\")),t.unescape===!0?v=d():v+=d(),l.brackets===0){B({type:"text",value:v});continue}}if(l.brackets>0&&(v!=="]"||g.value==="["||g.value==="[^")){if(t.posix!==!1&&v===":"){let k=g.value.slice(1);if(k.includes("[")&&(g.posix=!0,k.includes(":"))){let F=g.value.lastIndexOf("["),Q=g.value.slice(0,F),K=g.value.slice(F+2),z=a$[K];if(z){g.value=Q+z,l.backtrack=!0,d(),!s.output&&o.indexOf(g)===1&&(s.output=_);continue}}}(v==="["&&b()!==":"||v==="-"&&b()==="]")&&(v=`\\${v}`),v==="]"&&(g.value==="["||g.value==="[^")&&(v=`\\${v}`),t.posix===!0&&v==="!"&&g.value==="["&&(v="^"),g.value+=v,I({value:v});continue}if(l.quotes===1&&v!=='"'){v=Tt.escapeRegex(v),g.value+=v,I({value:v});continue}if(v==='"'){l.quotes=l.quotes===1?0:1,t.keepQuotes===!0&&B({type:"text",value:v});continue}if(v==="("){H("parens"),B({type:"paren",value:v});continue}if(v===")"){if(l.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Gs("opening","("));let k=h[h.length-1];if(k&&l.parens===k.parens+1){ie(h.pop());continue}B({type:"paren",value:v,output:l.parens?")":"\\)"}),V("parens");continue}if(v==="["){if(t.nobracket===!0||!E().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Gs("closing","]"));v=`\\${v}`}else H("brackets");B({type:"bracket",value:v});continue}if(v==="]"){if(t.nobracket===!0||g&&g.type==="bracket"&&g.value.length===1){B({type:"text",value:v,output:`\\${v}`});continue}if(l.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Gs("opening","["));B({type:"text",value:v,output:`\\${v}`});continue}V("brackets");let k=g.value.slice(1);if(g.posix!==!0&&k[0]==="^"&&!k.includes("/")&&(v=`/${v}`),g.value+=v,I({value:v}),t.literalBrackets===!1||Tt.hasRegexChars(k))continue;let F=Tt.escapeRegex(g.value);if(l.output=l.output.slice(0,-g.value.length),t.literalBrackets===!0){l.output+=F,g.value=F;continue}g.value=`(${a}${F}|${g.value})`,l.output+=g.value;continue}if(v==="{"&&t.nobrace!==!0){H("braces");let k={type:"brace",value:v,output:"(",outputIndex:l.output.length,tokensIndex:l.tokens.length};x.push(k),B(k);continue}if(v==="}"){let k=x[x.length-1];if(t.nobrace===!0||!k){B({type:"text",value:v,output:v});continue}let F=")";if(k.dots===!0){let Q=o.slice(),K=[];for(let z=Q.length-1;z>=0&&(o.pop(),Q[z].type!=="brace");z--)Q[z].type!=="dots"&&K.unshift(Q[z].value);F=u$(K,t),l.backtrack=!0}if(k.comma!==!0&&k.dots!==!0){let Q=l.output.slice(0,k.outputIndex),K=l.tokens.slice(k.tokensIndex);k.value=k.output="\\{",v=F="\\}",l.output=Q;for(let z of K)l.output+=z.output||z.value}B({type:"brace",value:v,output:F}),V("braces"),x.pop();continue}if(v==="|"){h.length>0&&h[h.length-1].conditions++,B({type:"text",value:v});continue}if(v===","){let k=v,F=x[x.length-1];F&&w[w.length-1]==="braces"&&(F.comma=!0,k="|"),B({type:"comma",value:v,output:k});continue}if(v==="/"){if(g.type==="dot"&&l.index===l.start+1){l.start=l.index+1,l.consumed="",l.output="",o.pop(),g=s;continue}B({type:"slash",value:v,output:y});continue}if(v==="."){if(l.braces>0&&g.type==="dot"){g.value==="."&&(g.output=f);let k=x[x.length-1];g.type="dots",g.output+=v,g.value+=v,k.dots=!0;continue}if(l.braces+l.parens===0&&g.type!=="bos"&&g.type!=="slash"){B({type:"text",value:v,output:f});continue}B({type:"dot",value:v,output:f});continue}if(v==="?"){if(!(g&&g.value==="(")&&t.noextglob!==!0&&b()==="("&&b(2)!=="?"){me("qmark",v);continue}if(g&&g.type==="paren"){let F=b(),Q=v;if(F==="<"&&!Tt.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(g.value==="("&&!/[!=<:]/.test(F)||F==="<"&&!/<([!=]|\w+>)/.test(E()))&&(Q=`\\${v}`),B({type:"text",value:v,output:Q});continue}if(t.dot!==!0&&(g.type==="slash"||g.type==="bos")){B({type:"qmark",value:v,output:j});continue}B({type:"qmark",value:v,output:N});continue}if(v==="!"){if(t.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){me("negate",v);continue}if(t.nonegate!==!0&&l.index===0){D();continue}}if(v==="+"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){me("plus",v);continue}if(g&&g.value==="("||t.regex===!1){B({type:"plus",value:v,output:m});continue}if(g&&(g.type==="bracket"||g.type==="paren"||g.type==="brace")||l.parens>0){B({type:"plus",value:v});continue}B({type:"plus",value:m});continue}if(v==="@"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){B({type:"at",extglob:!0,value:v,output:""});continue}B({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let k=c$.exec(E());k&&(v+=k[0],l.index+=k[0].length),B({type:"text",value:v});continue}if(g&&(g.type==="globstar"||g.star===!0)){g.type="star",g.star=!0,g.value+=v,g.output=T,l.backtrack=!0,l.globstar=!0,U(v);continue}let R=E();if(t.noextglob!==!0&&/^\([^?]/.test(R)){me("star",v);continue}if(g.type==="star"){if(t.noglobstar===!0){U(v);continue}let k=g.prev,F=k.prev,Q=k.type==="slash"||k.type==="bos",K=F&&(F.type==="star"||F.type==="globstar");if(t.bash===!0&&(!Q||R[0]&&R[0]!=="/")){B({type:"star",value:v,output:""});continue}let z=l.braces>0&&(k.type==="comma"||k.type==="brace"),ge=h.length&&(k.type==="pipe"||k.type==="paren");if(!Q&&k.type!=="paren"&&!z&&!ge){B({type:"star",value:v,output:""});continue}for(;R.slice(0,3)==="/**";){let re=r[l.index+4];if(re&&re!=="/")break;R=R.slice(3),U("/**",3)}if(k.type==="bos"&&C()){g.type="globstar",g.value+=v,g.output=G(t),l.output=g.output,l.globstar=!0,U(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&!K&&C()){l.output=l.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=G(t)+(t.strictSlashes?")":"|$)"),g.value+=v,l.globstar=!0,l.output+=k.output+g.output,U(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&R[0]==="/"){let re=R[1]!==void 0?"|$":"";l.output=l.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=`${G(t)}${y}|${y}${re})`,g.value+=v,l.output+=k.output+g.output,l.globstar=!0,U(v+d()),B({type:"slash",value:"/",output:""});continue}if(k.type==="bos"&&R[0]==="/"){g.type="globstar",g.value+=v,g.output=`(?:^|${y}|${G(t)}${y})`,l.output=g.output,l.globstar=!0,U(v+d()),B({type:"slash",value:"/",output:""});continue}l.output=l.output.slice(0,-g.output.length),g.type="globstar",g.output=G(t),g.value+=v,l.output+=g.output,l.globstar=!0,U(v);continue}let X={type:"star",value:v,output:T};if(t.bash===!0){X.output=".*?",(g.type==="bos"||g.type==="slash")&&(X.output=P+X.output),B(X);continue}if(g&&(g.type==="bracket"||g.type==="paren")&&t.regex===!0){X.output=v,B(X);continue}(l.index===l.start||g.type==="slash"||g.type==="dot")&&(g.type==="dot"?(l.output+=M,g.output+=M):t.dot===!0?(l.output+=L,g.output+=L):(l.output+=P,g.output+=P),b()!=="*"&&(l.output+=_,g.output+=_)),B(X)}for(;l.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Gs("closing","]"));l.output=Tt.escapeLast(l.output,"["),V("brackets")}for(;l.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Gs("closing",")"));l.output=Tt.escapeLast(l.output,"("),V("parens")}for(;l.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Gs("closing","}"));l.output=Tt.escapeLast(l.output,"{"),V("braces")}if(t.strictSlashes!==!0&&(g.type==="star"||g.type==="bracket")&&B({type:"maybe_slash",value:"",output:`${y}?`}),l.backtrack===!0){l.output="";for(let R of l.tokens)l.output+=R.output!=null?R.output:R.value,R.suffix&&(l.output+=R.suffix)}return l};Dm.fastpaths=(r,e)=>{let t={...e},n=typeof t.maxLength=="number"?Math.min(Cu,t.maxLength):Cu,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);r=dC[r]||r;let s=Tt.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:p,NO_DOTS:f,NO_DOTS_SLASH:m,STAR:y,START_ANCHOR:_}=da.globChars(s),S=t.dot?f:p,A=t.dot?m:p,M=t.capture?"":"?:",L={negated:!1,prefix:""},N=t.bash===!0?".*?":y;t.capture&&(N=`(${N})`);let j=P=>P.noglobstar===!0?N:`(${M}(?:(?!${_}${P.dot?u:o}).)*?)`,W=P=>{switch(P){case"*":return`${S}${c}${N}`;case".*":return`${o}${c}${N}`;case"*.*":return`${S}${N}${o}${c}${N}`;case"*/*":return`${S}${N}${a}${c}${A}${N}`;case"**":return S+j(t);case"**/*":return`(?:${S}${j(t)}${a})?${A}${c}${N}`;case"**/*.*":return`(?:${S}${j(t)}${a})?${A}${N}${o}${c}${N}`;case"**/.*":return`(?:${S}${j(t)}${a})?${o}${c}${N}`;default:{let $=/^(.*?)\.(\w+)$/.exec(P);if(!$)return;let T=W($[1]);return T?T+o+$[2]:void 0}}},q=Tt.removePrefix(r,L),G=W(q);return G&&t.strictSlashes!==!0&&(G+=`${a}?`),G};gC.exports=Dm});var yC=O((Jz,xC)=>{"use strict";var g$=require("path"),v$=fC(),Bm=vC(),jm=Tu(),x$=pa(),y$=r=>r&&typeof r=="object"&&!Array.isArray(r),Oe=(r,e,t=!1)=>{if(Array.isArray(r)){let p=r.map(m=>Oe(m,e,t));return m=>{for(let y of p){let _=y(m);if(_)return _}return!1}}let n=y$(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},s=jm.isWindows(e),o=n?Oe.compileRe(r,e):Oe.makeRe(r,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(i.ignore){let p={...e,ignore:null,onMatch:null,onResult:null};c=Oe(i.ignore,p,t)}let u=(p,f=!1)=>{let{isMatch:m,match:y,output:_}=Oe.test(p,o,e,{glob:r,posix:s}),S={glob:r,state:a,regex:o,posix:s,input:p,output:_,match:y,isMatch:m};return typeof i.onResult=="function"&&i.onResult(S),m===!1?(S.isMatch=!1,f?S:!1):c(p)?(typeof i.onIgnore=="function"&&i.onIgnore(S),S.isMatch=!1,f?S:!1):(typeof i.onMatch=="function"&&i.onMatch(S),f?S:!0)};return t&&(u.state=a),u};Oe.test=(r,e,t,{glob:n,posix:i}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};let s=t||{},o=s.format||(i?jm.toPosixSlashes:null),a=r===n,c=a&&o?o(r):r;return a===!1&&(c=o?o(r):r,a=c===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=Oe.matchBase(r,e,t,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Oe.matchBase=(r,e,t,n=jm.isWindows(t))=>(e instanceof RegExp?e:Oe.makeRe(e,t)).test(g$.basename(r));Oe.isMatch=(r,e,t)=>Oe(e,t)(r);Oe.parse=(r,e)=>Array.isArray(r)?r.map(t=>Oe.parse(t,e)):Bm(r,{...e,fastpaths:!1});Oe.scan=(r,e)=>v$(r,e);Oe.compileRe=(r,e,t=!1,n=!1)=>{if(t===!0)return r.output;let i=e||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${r.output})${o}`;r&&r.negated===!0&&(a=`^(?!${a}).*$`);let c=Oe.toRegex(a,e);return n===!0&&(c.state=r),c};Oe.makeRe=(r,e={},t=!1,n=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(i.output=Bm.fastpaths(r,e)),i.output||(i=Bm(r,e)),Oe.compileRe(i,e,t,n)};Oe.toRegex=(r,e)=>{try{let t=e||{};return new RegExp(r,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};Oe.constants=x$;xC.exports=Oe});var bC=O((Qz,_C)=>{"use strict";_C.exports=yC()});var kC=O((Zz,RC)=>{"use strict";var ma=require("fs"),{Readable:_$}=require("stream"),ha=require("path"),{promisify:Ou}=require("util"),Fm=bC(),b$=Ou(ma.readdir),w$=Ou(ma.stat),wC=Ou(ma.lstat),S$=Ou(ma.realpath),E$="!",CC="READDIRP_RECURSIVE_ERROR",T$=new Set(["ENOENT","EPERM","EACCES","ELOOP",CC]),$m="files",AC="directories",Ru="files_directories",Au="all",SC=[$m,AC,Ru,Au],C$=r=>T$.has(r.code),[EC,A$]=process.versions.node.split(".").slice(0,2).map(r=>Number.parseInt(r,10)),R$=process.platform==="win32"&&(EC>10||EC===10&&A$>=5),TC=r=>{if(r!==void 0){if(typeof r=="function")return r;if(typeof r=="string"){let e=Fm(r.trim());return t=>e(t.basename)}if(Array.isArray(r)){let e=[],t=[];for(let n of r){let i=n.trim();i.charAt(0)===E$?t.push(Fm(i.slice(1))):e.push(Fm(i))}return t.length>0?e.length>0?n=>e.some(i=>i(n.basename))&&!t.some(i=>i(n.basename)):n=>!t.some(i=>i(n.basename)):n=>e.some(i=>i(n.basename))}}},ku=class r extends _${static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:$m,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let t={...r.defaultOptions,...e},{root:n,type:i}=t;this._fileFilter=TC(t.fileFilter),this._directoryFilter=TC(t.directoryFilter);let s=t.lstat?wC:w$;R$?this._stat=o=>s(o,{bigint:!0}):this._stat=s,this._maxDepth=t.depth,this._wantsDir=[AC,Ru,Au].includes(i),this._wantsFile=[$m,Ru,Au].includes(i),this._wantsEverything=i===Au,this._root=ha.resolve(n),this._isDirent="Dirent"in ma&&!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:t,depth:n,files:i=[]}=this.parent||{};if(i.length>0){let s=i.splice(0,e).map(o=>this._formatEntry(o,t));for(let o of await Promise.all(s)){if(this.destroyed)return;let a=await this._getEntryType(o);a==="directory"&&this._directoryFilter(o)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(o.fullPath,n+1)),this._wantsDir&&(this.push(o),e--)):(a==="file"||this._includeAsFile(o))&&this._fileFilter(o)&&this._wantsFile&&(this.push(o),e--)}}else{let s=this.parents.pop();if(!s){this.push(null);break}if(this.parent=await s,this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await b$(e,this._rdOptions)}catch(i){this._onError(i)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let n;try{let i=this._isDirent?e.name:e,s=ha.resolve(ha.join(t,i));n={path:ha.relative(this._root,s),fullPath:s,basename:i},n[this._statsProp]=this._isDirent?e:await this._stat(s)}catch(i){this._onError(i)}return n}_onError(e){C$(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){let t=e&&e[this._statsProp];if(t){if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){let n=e.fullPath;try{let i=await S$(n),s=await wC(i);if(s.isFile())return"file";if(s.isDirectory()){let o=i.length;if(n.startsWith(i)&&n.substr(o,1)===ha.sep){let a=new Error(`Circular symlink detected: "${n}" points to "${i}"`);return a.code=CC,this._onError(a)}return"directory"}}catch(i){this._onError(i)}}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}},zs=(r,e={})=>{let t=e.entryType||e.type;if(t==="both"&&(t=Ru),t&&(e.type=t),r){if(typeof r!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(t&&!SC.includes(t))throw new Error(`readdirp: Invalid type passed. Use one of ${SC.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=r,new ku(e)},k$=(r,e={})=>new Promise((t,n)=>{let i=[];zs(r,e).on("data",s=>i.push(s)).on("end",()=>t(i)).on("error",s=>n(s))});zs.promise=k$;zs.ReaddirpStream=ku;zs.default=zs;RC.exports=zs});var ga=O((eV,NC)=>{"use strict";var O$=require("path"),Yr="\\\\/",OC=`[^${Yr}]`,M$=0,Sn="\\.",P$="\\+",I$="\\?",Mu="\\/",N$="(?=.)",MC="[^/]",Hm=`(?:${Mu}|$)`,PC=`(?:^|${Mu})`,Um=`${Sn}{1,2}${Hm}`,L$=`(?!${Sn})`,D$=`(?!${PC}${Um})`,B$=`(?!${Sn}{0,1}${Hm})`,j$=`(?!${Um})`,F$=`[^.${Mu}]`,$$=`${MC}*?`,IC={DOT_LITERAL:Sn,PLUS_LITERAL:P$,QMARK_LITERAL:I$,SLASH_LITERAL:Mu,ONE_CHAR:N$,QMARK:MC,END_ANCHOR:Hm,DOTS_SLASH:Um,NO_DOT:L$,NO_DOTS:D$,NO_DOT_SLASH:B$,NO_DOTS_SLASH:j$,QMARK_NO_DOT:F$,STAR:$$,START_ANCHOR:PC},H$={...IC,SLASH_LITERAL:`[${Yr}]`,QMARK:OC,STAR:`${OC}*?`,DOTS_SLASH:`${Sn}{1,2}(?:[${Yr}]|$)`,NO_DOT:`(?!${Sn})`,NO_DOTS:`(?!(?:^|[${Yr}])${Sn}{1,2}(?:[${Yr}]|$))`,NO_DOT_SLASH:`(?!${Sn}{0,1}(?:[${Yr}]|$))`,NO_DOTS_SLASH:`(?!${Sn}{1,2}(?:[${Yr}]|$))`,QMARK_NO_DOT:`[^.${Yr}]`,START_ANCHOR:`(?:^|[${Yr}])`,END_ANCHOR:`(?:[${Yr}]|$)`},U$={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};NC.exports={DEFAULT_MAX_EXTGLOB_RECURSION:M$,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:U$,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:O$.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?H$:IC}}});var Pu=O(qt=>{"use strict";var q$=require("path"),W$=process.platform==="win32",{REGEX_BACKSLASH:G$,REGEX_REMOVE_BACKSLASH:z$,REGEX_SPECIAL_CHARS:V$,REGEX_SPECIAL_CHARS_GLOBAL:K$}=ga();qt.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);qt.hasRegexChars=r=>V$.test(r);qt.isRegexChar=r=>r.length===1&&qt.hasRegexChars(r);qt.escapeRegex=r=>r.replace(K$,"\\$1");qt.toPosixSlashes=r=>r.replace(G$,"/");qt.removeBackslashes=r=>r.replace(z$,e=>e==="\\"?"":e);qt.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};qt.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:W$===!0||q$.sep==="\\";qt.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?qt.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};qt.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};qt.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",i=t.contains?"":"$",s=`${n}(?:${r})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var UC=O((rV,HC)=>{"use strict";var LC=Pu(),{CHAR_ASTERISK:qm,CHAR_AT:Y$,CHAR_BACKWARD_SLASH:va,CHAR_COMMA:X$,CHAR_DOT:Wm,CHAR_EXCLAMATION_MARK:Gm,CHAR_FORWARD_SLASH:$C,CHAR_LEFT_CURLY_BRACE:zm,CHAR_LEFT_PARENTHESES:Vm,CHAR_LEFT_SQUARE_BRACKET:J$,CHAR_PLUS:Q$,CHAR_QUESTION_MARK:DC,CHAR_RIGHT_CURLY_BRACE:Z$,CHAR_RIGHT_PARENTHESES:BC,CHAR_RIGHT_SQUARE_BRACKET:eH}=ga(),jC=r=>r===$C||r===va,FC=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},tH=(r,e)=>{let t=e||{},n=r.length-1,i=t.parts===!0||t.scanToEnd===!0,s=[],o=[],a=[],c=r,u=-1,p=0,f=0,m=!1,y=!1,_=!1,S=!1,A=!1,M=!1,L=!1,N=!1,j=!1,W=!1,q=0,G,P,$={value:"",depth:0,isGlob:!1},T=()=>u>=n,l=()=>c.charCodeAt(u+1),h=()=>(G=P,c.charCodeAt(++u));for(;u<n;){P=h();let C;if(P===va){L=$.backslashes=!0,P=h(),P===zm&&(M=!0);continue}if(M===!0||P===zm){for(q++;T()!==!0&&(P=h());){if(P===va){L=$.backslashes=!0,h();continue}if(P===zm){q++;continue}if(M!==!0&&P===Wm&&(P=h())===Wm){if(m=$.isBrace=!0,_=$.isGlob=!0,W=!0,i===!0)continue;break}if(M!==!0&&P===X$){if(m=$.isBrace=!0,_=$.isGlob=!0,W=!0,i===!0)continue;break}if(P===Z$&&(q--,q===0)){M=!1,m=$.isBrace=!0,W=!0;break}}if(i===!0)continue;break}if(P===$C){if(s.push(u),o.push($),$={value:"",depth:0,isGlob:!1},W===!0)continue;if(G===Wm&&u===p+1){p+=2;continue}f=u+1;continue}if(t.noext!==!0&&(P===Q$||P===Y$||P===qm||P===DC||P===Gm)===!0&&l()===Vm){if(_=$.isGlob=!0,S=$.isExtglob=!0,W=!0,P===Gm&&u===p&&(j=!0),i===!0){for(;T()!==!0&&(P=h());){if(P===va){L=$.backslashes=!0,P=h();continue}if(P===BC){_=$.isGlob=!0,W=!0;break}}continue}break}if(P===qm){if(G===qm&&(A=$.isGlobstar=!0),_=$.isGlob=!0,W=!0,i===!0)continue;break}if(P===DC){if(_=$.isGlob=!0,W=!0,i===!0)continue;break}if(P===J$){for(;T()!==!0&&(C=h());){if(C===va){L=$.backslashes=!0,h();continue}if(C===eH){y=$.isBracket=!0,_=$.isGlob=!0,W=!0;break}}if(i===!0)continue;break}if(t.nonegate!==!0&&P===Gm&&u===p){N=$.negated=!0,p++;continue}if(t.noparen!==!0&&P===Vm){if(_=$.isGlob=!0,i===!0){for(;T()!==!0&&(P=h());){if(P===Vm){L=$.backslashes=!0,P=h();continue}if(P===BC){W=!0;break}}continue}break}if(_===!0){if(W=!0,i===!0)continue;break}}t.noext===!0&&(S=!1,_=!1);let x=c,w="",g="";p>0&&(w=c.slice(0,p),c=c.slice(p),f-=p),x&&_===!0&&f>0?(x=c.slice(0,f),g=c.slice(f)):_===!0?(x="",g=c):x=c,x&&x!==""&&x!=="/"&&x!==c&&jC(x.charCodeAt(x.length-1))&&(x=x.slice(0,-1)),t.unescape===!0&&(g&&(g=LC.removeBackslashes(g)),x&&L===!0&&(x=LC.removeBackslashes(x)));let v={prefix:w,input:r,start:p,base:x,glob:g,isBrace:m,isBracket:y,isGlob:_,isExtglob:S,isGlobstar:A,negated:N,negatedExtglob:j};if(t.tokens===!0&&(v.maxDepth=0,jC(P)||o.push($),v.tokens=o),t.parts===!0||t.tokens===!0){let C;for(let b=0;b<s.length;b++){let d=C?C+1:p,E=s[b],U=r.slice(d,E);t.tokens&&(b===0&&p!==0?(o[b].isPrefix=!0,o[b].value=w):o[b].value=U,FC(o[b]),v.maxDepth+=o[b].depth),(b!==0||U!=="")&&a.push(U),C=E}if(C&&C+1<r.length){let b=r.slice(C+1);a.push(b),t.tokens&&(o[o.length-1].value=b,FC(o[o.length-1]),v.maxDepth+=o[o.length-1].depth)}v.slashes=s,v.parts=a}return v};HC.exports=tH});var VC=O((nV,zC)=>{"use strict";var xa=ga(),Ct=Pu(),{MAX_LENGTH:Iu,POSIX_REGEX_SOURCE:rH,REGEX_NON_SPECIAL_CHARS:nH,REGEX_SPECIAL_CHARS_BACKREF:iH,REPLACEMENTS:qC}=xa,sH=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch{return r.map(i=>Ct.escapeRegex(i)).join("..")}return t},Vs=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,WC=r=>{let e=[],t=0,n=0,i=0,s="",o=!1;for(let a of r){if(o===!0){s+=a,o=!1;continue}if(a==="\\"){s+=a,o=!0;continue}if(a==='"'){i=i===1?0:1,s+=a;continue}if(i===0){if(a==="[")t++;else if(a==="]"&&t>0)t--;else if(t===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(s),s="";continue}}}s+=a}return e.push(s),e},oH=r=>{let e=!1;for(let t of r){if(e===!0){e=!1;continue}if(t==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(t))return!1}return!0},GC=r=>{let e=r.trim(),t=!0;for(;t===!0;)t=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),t=!0);if(oH(e))return e.replace(/\\(.)/g,"$1")},aH=r=>{let e=r.map(GC).filter(Boolean);for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let i=e[t],s=e[n],o=i[0];if(!(!o||i!==o.repeat(i.length)||s!==o.repeat(s.length))&&(i===s||i.startsWith(s)||s.startsWith(i)))return!0}return!1},Km=(r,e=!0)=>{if(r[0]!=="+"&&r[0]!=="*"||r[1]!=="(")return;let t=0,n=0,i=0,s=!1;for(let o=1;o<r.length;o++){let a=r[o];if(s===!0){s=!1;continue}if(a==="\\"){s=!0;continue}if(a==='"'){i=i===1?0:1;continue}if(i!==1){if(a==="["){t++;continue}if(a==="]"&&t>0){t--;continue}if(!(t>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&o!==r.length-1?void 0:{type:r[0],body:r.slice(2,o),end:o}}}}},cH=r=>{let e=0,t=[];for(;e<r.length;){let i=Km(r.slice(e),!1);if(!i||i.type!=="*")return;let s=WC(i.body).map(a=>a.trim());if(s.length!==1)return;let o=GC(s[0]);if(!o||o.length!==1)return;t.push(o),e+=i.end+1}return t.length<1?void 0:`${t.length===1?Ct.escapeRegex(t[0]):`[${t.map(i=>Ct.escapeRegex(i)).join("")}]`}*`},lH=r=>{let e=0,t=r.trim(),n=Km(t);for(;n;)e++,t=n.body.trim(),n=Km(t);return e},uH=(r,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let t=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:xa.DEFAULT_MAX_EXTGLOB_RECURSION,n=WC(r).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||aH(n)))return{risky:!0};for(let i of n){let s=cH(i);if(s)return{risky:!0,safeOutput:s};if(lH(i)>t)return{risky:!0}}return{risky:!1}},Ym=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=qC[r]||r;let t={...e},n=typeof t.maxLength=="number"?Math.min(Iu,t.maxLength):Iu,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:t.prepend||""},o=[s],a=t.capture?"":"?:",c=Ct.isWindows(e),u=xa.globChars(c),p=xa.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:m,SLASH_LITERAL:y,ONE_CHAR:_,DOTS_SLASH:S,NO_DOT:A,NO_DOT_SLASH:M,NO_DOTS_SLASH:L,QMARK:N,QMARK_NO_DOT:j,STAR:W,START_ANCHOR:q}=u,G=R=>`(${a}(?:(?!${q}${R.dot?S:f}).)*?)`,P=t.dot?"":A,$=t.dot?N:j,T=t.bash===!0?G(t):W;t.capture&&(T=`(${T})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let l={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};r=Ct.removePrefix(r,l),i=r.length;let h=[],x=[],w=[],g=s,v,C=()=>l.index===i-1,b=l.peek=(R=1)=>r[l.index+R],d=l.advance=()=>r[++l.index]||"",E=()=>r.slice(l.index+1),U=(R="",X=0)=>{l.consumed+=R,l.index+=X},I=R=>{l.output+=R.output!=null?R.output:R.value,U(R.value)},D=()=>{let R=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)d(),l.start++,R++;return R%2===0?!1:(l.negated=!0,l.start++,!0)},H=R=>{l[R]++,w.push(R)},V=R=>{l[R]--,w.pop()},B=R=>{if(g.type==="globstar"){let X=l.braces>0&&(R.type==="comma"||R.type==="brace"),k=R.extglob===!0||h.length&&(R.type==="pipe"||R.type==="paren");R.type!=="slash"&&R.type!=="paren"&&!X&&!k&&(l.output=l.output.slice(0,-g.output.length),g.type="star",g.value="*",g.output=T,l.output+=g.output)}if(h.length&&R.type!=="paren"&&(h[h.length-1].inner+=R.value),(R.value||R.output)&&I(R),g&&g.type==="text"&&R.type==="text"){g.value+=R.value,g.output=(g.output||"")+R.value;return}R.prev=g,o.push(R),g=R},me=(R,X)=>{let k={...p[X],conditions:1,inner:""};k.prev=g,k.parens=l.parens,k.output=l.output,k.startIndex=l.index,k.tokensIndex=o.length;let F=(t.capture?"(":"")+k.open;H("parens"),B({type:R,value:X,output:l.output?"":_}),B({type:"paren",extglob:!0,value:d(),output:F}),h.push(k)},ie=R=>{let X=r.slice(R.startIndex,l.index+1),k=r.slice(R.startIndex+2,l.index),F=uH(k,t);if((R.type==="plus"||R.type==="star")&&F.risky){let z=F.safeOutput?(R.output?"":_)+(t.capture?`(${F.safeOutput})`:F.safeOutput):void 0,ge=o[R.tokensIndex];ge.type="text",ge.value=X,ge.output=z||Ct.escapeRegex(X);for(let re=R.tokensIndex+1;re<o.length;re++)o[re].value="",o[re].output="",delete o[re].suffix;l.output=R.output+ge.output,l.backtrack=!0,B({type:"paren",extglob:!0,value:v,output:""}),V("parens");return}let Q=R.close+(t.capture?")":""),K;if(R.type==="negate"){let z=T;if(R.inner&&R.inner.length>1&&R.inner.includes("/")&&(z=G(t)),(z!==T||C()||/^\)+$/.test(E()))&&(Q=R.close=`)$))${z}`),R.inner.includes("*")&&(K=E())&&/^\.[^\\/.]+$/.test(K)){let ge=Ym(K,{...e,fastpaths:!1}).output;Q=R.close=`)${ge})${z})`}R.prev.type==="bos"&&(l.negatedExtglob=!0)}B({type:"paren",extglob:!0,value:v,output:Q}),V("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let R=!1,X=r.replace(iH,(k,F,Q,K,z,ge)=>K==="\\"?(R=!0,k):K==="?"?F?F+K+(z?N.repeat(z.length):""):ge===0?$+(z?N.repeat(z.length):""):N.repeat(Q.length):K==="."?f.repeat(Q.length):K==="*"?F?F+K+(z?T:""):T:F?k:`\\${k}`);return R===!0&&(t.unescape===!0?X=X.replace(/\\/g,""):X=X.replace(/\\+/g,k=>k.length%2===0?"\\\\":k?"\\":"")),X===r&&t.contains===!0?(l.output=r,l):(l.output=Ct.wrapOutput(X,l,e),l)}for(;!C();){if(v=d(),v==="\0")continue;if(v==="\\"){let k=b();if(k==="/"&&t.bash!==!0||k==="."||k===";")continue;if(!k){v+="\\",B({type:"text",value:v});continue}let F=/^\\+/.exec(E()),Q=0;if(F&&F[0].length>2&&(Q=F[0].length,l.index+=Q,Q%2!==0&&(v+="\\")),t.unescape===!0?v=d():v+=d(),l.brackets===0){B({type:"text",value:v});continue}}if(l.brackets>0&&(v!=="]"||g.value==="["||g.value==="[^")){if(t.posix!==!1&&v===":"){let k=g.value.slice(1);if(k.includes("[")&&(g.posix=!0,k.includes(":"))){let F=g.value.lastIndexOf("["),Q=g.value.slice(0,F),K=g.value.slice(F+2),z=rH[K];if(z){g.value=Q+z,l.backtrack=!0,d(),!s.output&&o.indexOf(g)===1&&(s.output=_);continue}}}(v==="["&&b()!==":"||v==="-"&&b()==="]")&&(v=`\\${v}`),v==="]"&&(g.value==="["||g.value==="[^")&&(v=`\\${v}`),t.posix===!0&&v==="!"&&g.value==="["&&(v="^"),g.value+=v,I({value:v});continue}if(l.quotes===1&&v!=='"'){v=Ct.escapeRegex(v),g.value+=v,I({value:v});continue}if(v==='"'){l.quotes=l.quotes===1?0:1,t.keepQuotes===!0&&B({type:"text",value:v});continue}if(v==="("){H("parens"),B({type:"paren",value:v});continue}if(v===")"){if(l.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Vs("opening","("));let k=h[h.length-1];if(k&&l.parens===k.parens+1){ie(h.pop());continue}B({type:"paren",value:v,output:l.parens?")":"\\)"}),V("parens");continue}if(v==="["){if(t.nobracket===!0||!E().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Vs("closing","]"));v=`\\${v}`}else H("brackets");B({type:"bracket",value:v});continue}if(v==="]"){if(t.nobracket===!0||g&&g.type==="bracket"&&g.value.length===1){B({type:"text",value:v,output:`\\${v}`});continue}if(l.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Vs("opening","["));B({type:"text",value:v,output:`\\${v}`});continue}V("brackets");let k=g.value.slice(1);if(g.posix!==!0&&k[0]==="^"&&!k.includes("/")&&(v=`/${v}`),g.value+=v,I({value:v}),t.literalBrackets===!1||Ct.hasRegexChars(k))continue;let F=Ct.escapeRegex(g.value);if(l.output=l.output.slice(0,-g.value.length),t.literalBrackets===!0){l.output+=F,g.value=F;continue}g.value=`(${a}${F}|${g.value})`,l.output+=g.value;continue}if(v==="{"&&t.nobrace!==!0){H("braces");let k={type:"brace",value:v,output:"(",outputIndex:l.output.length,tokensIndex:l.tokens.length};x.push(k),B(k);continue}if(v==="}"){let k=x[x.length-1];if(t.nobrace===!0||!k){B({type:"text",value:v,output:v});continue}let F=")";if(k.dots===!0){let Q=o.slice(),K=[];for(let z=Q.length-1;z>=0&&(o.pop(),Q[z].type!=="brace");z--)Q[z].type!=="dots"&&K.unshift(Q[z].value);F=sH(K,t),l.backtrack=!0}if(k.comma!==!0&&k.dots!==!0){let Q=l.output.slice(0,k.outputIndex),K=l.tokens.slice(k.tokensIndex);k.value=k.output="\\{",v=F="\\}",l.output=Q;for(let z of K)l.output+=z.output||z.value}B({type:"brace",value:v,output:F}),V("braces"),x.pop();continue}if(v==="|"){h.length>0&&h[h.length-1].conditions++,B({type:"text",value:v});continue}if(v===","){let k=v,F=x[x.length-1];F&&w[w.length-1]==="braces"&&(F.comma=!0,k="|"),B({type:"comma",value:v,output:k});continue}if(v==="/"){if(g.type==="dot"&&l.index===l.start+1){l.start=l.index+1,l.consumed="",l.output="",o.pop(),g=s;continue}B({type:"slash",value:v,output:y});continue}if(v==="."){if(l.braces>0&&g.type==="dot"){g.value==="."&&(g.output=f);let k=x[x.length-1];g.type="dots",g.output+=v,g.value+=v,k.dots=!0;continue}if(l.braces+l.parens===0&&g.type!=="bos"&&g.type!=="slash"){B({type:"text",value:v,output:f});continue}B({type:"dot",value:v,output:f});continue}if(v==="?"){if(!(g&&g.value==="(")&&t.noextglob!==!0&&b()==="("&&b(2)!=="?"){me("qmark",v);continue}if(g&&g.type==="paren"){let F=b(),Q=v;if(F==="<"&&!Ct.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(g.value==="("&&!/[!=<:]/.test(F)||F==="<"&&!/<([!=]|\w+>)/.test(E()))&&(Q=`\\${v}`),B({type:"text",value:v,output:Q});continue}if(t.dot!==!0&&(g.type==="slash"||g.type==="bos")){B({type:"qmark",value:v,output:j});continue}B({type:"qmark",value:v,output:N});continue}if(v==="!"){if(t.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){me("negate",v);continue}if(t.nonegate!==!0&&l.index===0){D();continue}}if(v==="+"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){me("plus",v);continue}if(g&&g.value==="("||t.regex===!1){B({type:"plus",value:v,output:m});continue}if(g&&(g.type==="bracket"||g.type==="paren"||g.type==="brace")||l.parens>0){B({type:"plus",value:v});continue}B({type:"plus",value:m});continue}if(v==="@"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){B({type:"at",extglob:!0,value:v,output:""});continue}B({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let k=nH.exec(E());k&&(v+=k[0],l.index+=k[0].length),B({type:"text",value:v});continue}if(g&&(g.type==="globstar"||g.star===!0)){g.type="star",g.star=!0,g.value+=v,g.output=T,l.backtrack=!0,l.globstar=!0,U(v);continue}let R=E();if(t.noextglob!==!0&&/^\([^?]/.test(R)){me("star",v);continue}if(g.type==="star"){if(t.noglobstar===!0){U(v);continue}let k=g.prev,F=k.prev,Q=k.type==="slash"||k.type==="bos",K=F&&(F.type==="star"||F.type==="globstar");if(t.bash===!0&&(!Q||R[0]&&R[0]!=="/")){B({type:"star",value:v,output:""});continue}let z=l.braces>0&&(k.type==="comma"||k.type==="brace"),ge=h.length&&(k.type==="pipe"||k.type==="paren");if(!Q&&k.type!=="paren"&&!z&&!ge){B({type:"star",value:v,output:""});continue}for(;R.slice(0,3)==="/**";){let re=r[l.index+4];if(re&&re!=="/")break;R=R.slice(3),U("/**",3)}if(k.type==="bos"&&C()){g.type="globstar",g.value+=v,g.output=G(t),l.output=g.output,l.globstar=!0,U(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&!K&&C()){l.output=l.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=G(t)+(t.strictSlashes?")":"|$)"),g.value+=v,l.globstar=!0,l.output+=k.output+g.output,U(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&R[0]==="/"){let re=R[1]!==void 0?"|$":"";l.output=l.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=`${G(t)}${y}|${y}${re})`,g.value+=v,l.output+=k.output+g.output,l.globstar=!0,U(v+d()),B({type:"slash",value:"/",output:""});continue}if(k.type==="bos"&&R[0]==="/"){g.type="globstar",g.value+=v,g.output=`(?:^|${y}|${G(t)}${y})`,l.output=g.output,l.globstar=!0,U(v+d()),B({type:"slash",value:"/",output:""});continue}l.output=l.output.slice(0,-g.output.length),g.type="globstar",g.output=G(t),g.value+=v,l.output+=g.output,l.globstar=!0,U(v);continue}let X={type:"star",value:v,output:T};if(t.bash===!0){X.output=".*?",(g.type==="bos"||g.type==="slash")&&(X.output=P+X.output),B(X);continue}if(g&&(g.type==="bracket"||g.type==="paren")&&t.regex===!0){X.output=v,B(X);continue}(l.index===l.start||g.type==="slash"||g.type==="dot")&&(g.type==="dot"?(l.output+=M,g.output+=M):t.dot===!0?(l.output+=L,g.output+=L):(l.output+=P,g.output+=P),b()!=="*"&&(l.output+=_,g.output+=_)),B(X)}for(;l.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Vs("closing","]"));l.output=Ct.escapeLast(l.output,"["),V("brackets")}for(;l.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Vs("closing",")"));l.output=Ct.escapeLast(l.output,"("),V("parens")}for(;l.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Vs("closing","}"));l.output=Ct.escapeLast(l.output,"{"),V("braces")}if(t.strictSlashes!==!0&&(g.type==="star"||g.type==="bracket")&&B({type:"maybe_slash",value:"",output:`${y}?`}),l.backtrack===!0){l.output="";for(let R of l.tokens)l.output+=R.output!=null?R.output:R.value,R.suffix&&(l.output+=R.suffix)}return l};Ym.fastpaths=(r,e)=>{let t={...e},n=typeof t.maxLength=="number"?Math.min(Iu,t.maxLength):Iu,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);r=qC[r]||r;let s=Ct.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:p,NO_DOTS:f,NO_DOTS_SLASH:m,STAR:y,START_ANCHOR:_}=xa.globChars(s),S=t.dot?f:p,A=t.dot?m:p,M=t.capture?"":"?:",L={negated:!1,prefix:""},N=t.bash===!0?".*?":y;t.capture&&(N=`(${N})`);let j=P=>P.noglobstar===!0?N:`(${M}(?:(?!${_}${P.dot?u:o}).)*?)`,W=P=>{switch(P){case"*":return`${S}${c}${N}`;case".*":return`${o}${c}${N}`;case"*.*":return`${S}${N}${o}${c}${N}`;case"*/*":return`${S}${N}${a}${c}${A}${N}`;case"**":return S+j(t);case"**/*":return`(?:${S}${j(t)}${a})?${A}${c}${N}`;case"**/*.*":return`(?:${S}${j(t)}${a})?${A}${N}${o}${c}${N}`;case"**/.*":return`(?:${S}${j(t)}${a})?${o}${c}${N}`;default:{let $=/^(.*?)\.(\w+)$/.exec(P);if(!$)return;let T=W($[1]);return T?T+o+$[2]:void 0}}},q=Ct.removePrefix(r,L),G=W(q);return G&&t.strictSlashes!==!0&&(G+=`${a}?`),G};zC.exports=Ym});var YC=O((iV,KC)=>{"use strict";var pH=require("path"),fH=UC(),Xm=VC(),Jm=Pu(),dH=ga(),hH=r=>r&&typeof r=="object"&&!Array.isArray(r),Me=(r,e,t=!1)=>{if(Array.isArray(r)){let p=r.map(m=>Me(m,e,t));return m=>{for(let y of p){let _=y(m);if(_)return _}return!1}}let n=hH(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},s=Jm.isWindows(e),o=n?Me.compileRe(r,e):Me.makeRe(r,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(i.ignore){let p={...e,ignore:null,onMatch:null,onResult:null};c=Me(i.ignore,p,t)}let u=(p,f=!1)=>{let{isMatch:m,match:y,output:_}=Me.test(p,o,e,{glob:r,posix:s}),S={glob:r,state:a,regex:o,posix:s,input:p,output:_,match:y,isMatch:m};return typeof i.onResult=="function"&&i.onResult(S),m===!1?(S.isMatch=!1,f?S:!1):c(p)?(typeof i.onIgnore=="function"&&i.onIgnore(S),S.isMatch=!1,f?S:!1):(typeof i.onMatch=="function"&&i.onMatch(S),f?S:!0)};return t&&(u.state=a),u};Me.test=(r,e,t,{glob:n,posix:i}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};let s=t||{},o=s.format||(i?Jm.toPosixSlashes:null),a=r===n,c=a&&o?o(r):r;return a===!1&&(c=o?o(r):r,a=c===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=Me.matchBase(r,e,t,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Me.matchBase=(r,e,t,n=Jm.isWindows(t))=>(e instanceof RegExp?e:Me.makeRe(e,t)).test(pH.basename(r));Me.isMatch=(r,e,t)=>Me(e,t)(r);Me.parse=(r,e)=>Array.isArray(r)?r.map(t=>Me.parse(t,e)):Xm(r,{...e,fastpaths:!1});Me.scan=(r,e)=>fH(r,e);Me.compileRe=(r,e,t=!1,n=!1)=>{if(t===!0)return r.output;let i=e||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${r.output})${o}`;r&&r.negated===!0&&(a=`^(?!${a}).*$`);let c=Me.toRegex(a,e);return n===!0&&(c.state=r),c};Me.makeRe=(r,e={},t=!1,n=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(i.output=Xm.fastpaths(r,e)),i.output||(i=Xm(r,e)),Me.compileRe(i,e,t,n)};Me.toRegex=(r,e)=>{try{let t=e||{};return new RegExp(r,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};Me.constants=dH;KC.exports=Me});var JC=O((sV,XC)=>{"use strict";XC.exports=YC()});var Qm=O((oV,QC)=>{QC.exports=function(r,e){if(typeof r!="string")throw new TypeError("expected path to be a string");if(r==="\\"||r==="/")return"/";var t=r.length;if(t<=1)return r;var n="";if(t>4&&r[3]==="\\"){var i=r[2];(i==="?"||i===".")&&r.slice(0,2)==="\\\\"&&(r=r.slice(2),n="//")}var s=r.split(/[/\\]+/);return e!==!1&&s[s.length-1]===""&&s.pop(),n+s.join("/")}});var iA=O((rA,nA)=>{"use strict";Object.defineProperty(rA,"__esModule",{value:!0});var tA=JC(),mH=Qm(),ZC="!",gH={returnIndex:!1},vH=r=>Array.isArray(r)?r:[r],xH=(r,e)=>{if(typeof r=="function")return r;if(typeof r=="string"){let t=tA(r,e);return n=>r===n||t(n)}return r instanceof RegExp?t=>r.test(t):t=>!1},eA=(r,e,t,n)=>{let i=Array.isArray(t),s=i?t[0]:t;if(!i&&typeof s!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(s));let o=mH(s,!1);for(let c=0;c<e.length;c++){let u=e[c];if(u(o))return n?-1:!1}let a=i&&[o].concat(t.slice(1));for(let c=0;c<r.length;c++){let u=r[c];if(i?u(...a):u(o))return n?c:!0}return n?-1:!1},Zm=(r,e,t=gH)=>{if(r==null)throw new TypeError("anymatch: specify first argument");let n=typeof t=="boolean"?{returnIndex:t}:t,i=n.returnIndex||!1,s=vH(r),o=s.filter(c=>typeof c=="string"&&c.charAt(0)===ZC).map(c=>c.slice(1)).map(c=>tA(c,n)),a=s.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==ZC).map(c=>xH(c,n));return e==null?(c,u=!1)=>eA(a,o,c,typeof u=="boolean"?u:!1):eA(a,o,e,i)};Zm.default=Zm;nA.exports=Zm});var oA=O((aV,sA)=>{sA.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}});var eg=O((cV,cA)=>{var yH=oA(),aA={"{":"}","(":")","[":"]"},_H=function(r){if(r[0]==="!")return!0;for(var e=0,t=-2,n=-2,i=-2,s=-2,o=-2;e<r.length;){if(r[e]==="*"||r[e+1]==="?"&&/[\].+)]/.test(r[e])||n!==-1&&r[e]==="["&&r[e+1]!=="]"&&(n<e&&(n=r.indexOf("]",e)),n>e&&(o===-1||o>n||(o=r.indexOf("\\",e),o===-1||o>n)))||i!==-1&&r[e]==="{"&&r[e+1]!=="}"&&(i=r.indexOf("}",e),i>e&&(o=r.indexOf("\\",e),o===-1||o>i))||s!==-1&&r[e]==="("&&r[e+1]==="?"&&/[:!=]/.test(r[e+2])&&r[e+3]!==")"&&(s=r.indexOf(")",e),s>e&&(o=r.indexOf("\\",e),o===-1||o>s))||t!==-1&&r[e]==="("&&r[e+1]!=="|"&&(t<e&&(t=r.indexOf("|",e)),t!==-1&&r[t+1]!==")"&&(s=r.indexOf(")",t),s>t&&(o=r.indexOf("\\",t),o===-1||o>s))))return!0;if(r[e]==="\\"){var a=r[e+1];e+=2;var c=aA[a];if(c){var u=r.indexOf(c,e);u!==-1&&(e=u+1)}if(r[e]==="!")return!0}else e++}return!1},bH=function(r){if(r[0]==="!")return!0;for(var e=0;e<r.length;){if(/[*?{}()[\]]/.test(r[e]))return!0;if(r[e]==="\\"){var t=r[e+1];e+=2;var n=aA[t];if(n){var i=r.indexOf(n,e);i!==-1&&(e=i+1)}if(r[e]==="!")return!0}else e++}return!1};cA.exports=function(e,t){if(typeof e!="string"||e==="")return!1;if(yH(e))return!0;var n=_H;return t&&t.strict===!1&&(n=bH),n(e)}});var uA=O((lV,lA)=>{"use strict";var wH=eg(),SH=require("path").posix.dirname,EH=require("os").platform()==="win32",tg="/",TH=/\\/g,CH=/[\{\[].*[\}\]]$/,AH=/(^|[^\\])([\{\[]|\([^\)]+$)/,RH=/\\([\!\*\?\|\[\]\(\)\{\}])/g;lA.exports=function(e,t){var n=Object.assign({flipBackslashes:!0},t);n.flipBackslashes&&EH&&e.indexOf(tg)<0&&(e=e.replace(TH,tg)),CH.test(e)&&(e+=tg),e+="a";do e=SH(e);while(wH(e)||AH.test(e));return e.replace(RH,"$1")}});var Nu=O(vr=>{"use strict";vr.isInteger=r=>typeof r=="number"?Number.isInteger(r):typeof r=="string"&&r.trim()!==""?Number.isInteger(Number(r)):!1;vr.find=(r,e)=>r.nodes.find(t=>t.type===e);vr.exceedsLimit=(r,e,t=1,n)=>n===!1||!vr.isInteger(r)||!vr.isInteger(e)?!1:(Number(e)-Number(r))/Number(t)>=n;vr.escapeNode=(r,e=0,t)=>{let n=r.nodes[e];n&&(t&&n.type===t||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};vr.encloseBrace=r=>r.type!=="brace"?!1:r.commas>>0+r.ranges>>0===0?(r.invalid=!0,!0):!1;vr.isInvalidBrace=r=>r.type!=="brace"?!1:r.invalid===!0||r.dollar?!0:r.commas>>0+r.ranges>>0===0||r.open!==!0||r.close!==!0?(r.invalid=!0,!0):!1;vr.isOpenOrClose=r=>r.type==="open"||r.type==="close"?!0:r.open===!0||r.close===!0;vr.reduce=r=>r.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);vr.flatten=(...r)=>{let e=[],t=n=>{for(let i=0;i<n.length;i++){let s=n[i];if(Array.isArray(s)){t(s);continue}s!==void 0&&e.push(s)}return e};return t(r),e}});var Lu=O((pV,fA)=>{"use strict";var pA=Nu();fA.exports=(r,e={})=>{let t=(n,i={})=>{let s=e.escapeInvalid&&pA.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(s||o)&&pA.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=t(c);return a};return t(r)}});var hA=O((fV,dA)=>{"use strict";dA.exports=function(r){return typeof r=="number"?r-r===0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}});var SA=O((dV,wA)=>{"use strict";var mA=hA(),Si=(r,e,t)=>{if(mA(r)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||r===e)return String(r);if(mA(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...t};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let i=String(n.relaxZeros),s=String(n.shorthand),o=String(n.capture),a=String(n.wrap),c=r+":"+e+"="+i+s+o+a;if(Si.cache.hasOwnProperty(c))return Si.cache[c].result;let u=Math.min(r,e),p=Math.max(r,e);if(Math.abs(u-p)===1){let S=r+"|"+e;return n.capture?`(${S})`:n.wrap===!1?S:`(?:${S})`}let f=bA(r)||bA(e),m={min:r,max:e,a:u,b:p},y=[],_=[];if(f&&(m.isPadded=f,m.maxLen=String(m.max).length),u<0){let S=p<0?Math.abs(p):1;_=gA(S,Math.abs(u),m,n),u=m.a=0}return p>=0&&(y=gA(u,p,m,n)),m.negatives=_,m.positives=y,m.result=kH(_,y,n),n.capture===!0?m.result=`(${m.result})`:n.wrap!==!1&&y.length+_.length>1&&(m.result=`(?:${m.result})`),Si.cache[c]=m,m.result};function kH(r,e,t){let n=rg(r,e,"-",!1,t)||[],i=rg(e,r,"",!1,t)||[],s=rg(r,e,"-?",!0,t)||[];return n.concat(s).concat(i).join("|")}function OH(r,e){let t=1,n=1,i=xA(r,t),s=new Set([e]);for(;r<=i&&i<=e;)s.add(i),t+=1,i=xA(r,t);for(i=yA(e+1,n)-1;r<i&&i<=e;)s.add(i),n+=1,i=yA(e+1,n)-1;return s=[...s],s.sort(IH),s}function MH(r,e,t){if(r===e)return{pattern:r,count:[],digits:0};let n=PH(r,e),i=n.length,s="",o=0;for(let a=0;a<i;a++){let[c,u]=n[a];c===u?s+=c:c!=="0"||u!=="9"?s+=NH(c,u,t):o++}return o&&(s+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function gA(r,e,t,n){let i=OH(r,e),s=[],o=r,a;for(let c=0;c<i.length;c++){let u=i[c],p=MH(String(o),String(u),n),f="";if(!t.isPadded&&a&&a.pattern===p.pattern){a.count.length>1&&a.count.pop(),a.count.push(p.count[0]),a.string=a.pattern+_A(a.count),o=u+1;continue}t.isPadded&&(f=LH(u,t,n)),p.string=f+p.pattern+_A(p.count),s.push(p),o=u+1,a=p}return s}function rg(r,e,t,n,i){let s=[];for(let o of r){let{string:a}=o;!n&&!vA(e,"string",a)&&s.push(t+a),n&&vA(e,"string",a)&&s.push(t+a)}return s}function PH(r,e){let t=[];for(let n=0;n<r.length;n++)t.push([r[n],e[n]]);return t}function IH(r,e){return r>e?1:e>r?-1:0}function vA(r,e,t){return r.some(n=>n[e]===t)}function xA(r,e){return Number(String(r).slice(0,-e)+"9".repeat(e))}function yA(r,e){return r-r%Math.pow(10,e)}function _A(r){let[e=0,t=""]=r;return t||e>1?`{${e+(t?","+t:"")}}`:""}function NH(r,e,t){return`[${r}${e-r===1?"":"-"}${e}]`}function bA(r){return/^-?(0+)\d/.test(r)}function LH(r,e,t){if(!e.isPadded)return r;let n=Math.abs(e.maxLen-String(r).length),i=t.relaxZeros!==!1;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}Si.cache={};Si.clearCache=()=>Si.cache={};wA.exports=Si});var sg=O((hV,OA)=>{"use strict";var DH=require("util"),TA=SA(),EA=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),BH=r=>e=>r===!0?Number(e):String(e),ng=r=>typeof r=="number"||typeof r=="string"&&r!=="",ya=r=>Number.isInteger(+r),ig=r=>{let e=`${r}`,t=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++t]==="0";);return t>0},jH=(r,e,t)=>typeof r=="string"||typeof e=="string"?!0:t.stringify===!0,FH=(r,e,t)=>{if(e>0){let n=r[0]==="-"?"-":"";n&&(r=r.slice(1)),r=n+r.padStart(n?e-1:e,"0")}return t===!1?String(r):r},Bu=(r,e)=>{let t=r[0]==="-"?"-":"";for(t&&(r=r.slice(1),e--);r.length<e;)r="0"+r;return t?"-"+r:r},$H=(r,e,t)=>{r.negatives.sort((a,c)=>a<c?-1:a>c?1:0),r.positives.sort((a,c)=>a<c?-1:a>c?1:0);let n=e.capture?"":"?:",i="",s="",o;return r.positives.length&&(i=r.positives.map(a=>Bu(String(a),t)).join("|")),r.negatives.length&&(s=`-(${n}${r.negatives.map(a=>Bu(String(a),t)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,e.wrap?`(${n}${o})`:o},CA=(r,e,t,n)=>{if(t)return TA(r,e,{wrap:!1,...n});let i=String.fromCharCode(r);if(r===e)return i;let s=String.fromCharCode(e);return`[${i}-${s}]`},AA=(r,e,t)=>{if(Array.isArray(r)){let n=t.wrap===!0,i=t.capture?"":"?:";return n?`(${i}${r.join("|")})`:r.join("|")}return TA(r,e,t)},RA=(...r)=>new RangeError("Invalid range arguments: "+DH.inspect(...r)),kA=(r,e,t)=>{if(t.strictRanges===!0)throw RA([r,e]);return[]},HH=(r,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${r}" to be a number`);return[]},UH=(r,e,t=1,n={})=>{let i=Number(r),s=Number(e);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw RA([r,e]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(r),c=String(e),u=String(t);t=Math.max(Math.abs(t),1);let p=ig(a)||ig(c)||ig(u),f=p?Math.max(a.length,c.length,u.length):0,m=p===!1&&jH(r,e,n)===!1,y=n.transform||BH(m);if(n.toRegex&&t===1)return CA(Bu(r,f),Bu(e,f),!0,n);let _={negatives:[],positives:[]},S=L=>_[L<0?"negatives":"positives"].push(Math.abs(L)),A=[],M=0;for(;o?i>=s:i<=s;)n.toRegex===!0&&t>1?S(i):A.push(FH(y(i,M),f,m)),i=o?i-t:i+t,M++;return n.toRegex===!0?t>1?$H(_,n,f):AA(A,null,{wrap:!1,...n}):A},qH=(r,e,t=1,n={})=>{if(!ya(r)&&r.length>1||!ya(e)&&e.length>1)return kA(r,e,n);let i=n.transform||(m=>String.fromCharCode(m)),s=`${r}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=s>o,c=Math.min(s,o),u=Math.max(s,o);if(n.toRegex&&t===1)return CA(c,u,!1,n);let p=[],f=0;for(;a?s>=o:s<=o;)p.push(i(s,f)),s=a?s-t:s+t,f++;return n.toRegex===!0?AA(p,null,{wrap:!1,options:n}):p},Du=(r,e,t,n={})=>{if(e==null&&ng(r))return[r];if(!ng(r)||!ng(e))return kA(r,e,n);if(typeof t=="function")return Du(r,e,1,{transform:t});if(EA(t))return Du(r,e,0,t);let i={...n};return i.capture===!0&&(i.wrap=!0),t=t||i.step||1,ya(t)?ya(r)&&ya(e)?UH(r,e,t,i):qH(r,e,Math.max(Math.abs(t),1),i):t!=null&&!EA(t)?HH(t,i):Du(r,e,1,t)};OA.exports=Du});var IA=O((mV,PA)=>{"use strict";var WH=sg(),MA=Nu(),GH=(r,e={})=>{let t=(n,i={})=>{let s=MA.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a=s===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",u="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let p=MA.reduce(n.nodes),f=WH(...p,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(f.length!==0)return p.length>1&&f.length>1?`(${f})`:f}if(n.nodes)for(let p of n.nodes)u+=t(p,n);return u};return t(r)};PA.exports=GH});var DA=O((gV,LA)=>{"use strict";var zH=sg(),NA=Lu(),Ks=Nu(),Ei=(r="",e="",t=!1)=>{let n=[];if(r=[].concat(r),e=[].concat(e),!e.length)return r;if(!r.length)return t?Ks.flatten(e).map(i=>`{${i}}`):e;for(let i of r)if(Array.isArray(i))for(let s of i)n.push(Ei(s,e,t));else for(let s of e)t===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?Ei(i,s,t):i+s);return Ks.flatten(n)},VH=(r,e={})=>{let t=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(i,s={})=>{i.queue=[];let o=s,a=s.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(i.invalid||i.dollar){a.push(Ei(a.pop(),NA(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(Ei(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let f=Ks.reduce(i.nodes);if(Ks.exceedsLimit(...f,e.step,t))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let m=zH(...f,e);m.length===0&&(m=NA(i,e)),a.push(Ei(a.pop(),m)),i.nodes=[];return}let c=Ks.encloseBrace(i),u=i.queue,p=i;for(;p.type!=="brace"&&p.type!=="root"&&p.parent;)p=p.parent,u=p.queue;for(let f=0;f<i.nodes.length;f++){let m=i.nodes[f];if(m.type==="comma"&&i.type==="brace"){f===1&&u.push(""),u.push("");continue}if(m.type==="close"){a.push(Ei(a.pop(),u,c));continue}if(m.value&&m.type!=="open"){u.push(Ei(u.pop(),m.value));continue}m.nodes&&n(m,i)}return u};return Ks.flatten(n(r))};LA.exports=VH});var jA=O((vV,BA)=>{"use strict";BA.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
102
- `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var qA=O((xV,UA)=>{"use strict";var KH=Lu(),{MAX_LENGTH:FA,CHAR_BACKSLASH:og,CHAR_BACKTICK:YH,CHAR_COMMA:XH,CHAR_DOT:JH,CHAR_LEFT_PARENTHESES:QH,CHAR_RIGHT_PARENTHESES:ZH,CHAR_LEFT_CURLY_BRACE:eU,CHAR_RIGHT_CURLY_BRACE:tU,CHAR_LEFT_SQUARE_BRACKET:$A,CHAR_RIGHT_SQUARE_BRACKET:HA,CHAR_DOUBLE_QUOTE:rU,CHAR_SINGLE_QUOTE:nU,CHAR_NO_BREAK_SPACE:iU,CHAR_ZERO_WIDTH_NOBREAK_SPACE:sU}=jA(),oU=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},n=typeof t.maxLength=="number"?Math.min(FA,t.maxLength):FA;if(r.length>n)throw new SyntaxError(`Input length (${r.length}), exceeds max characters (${n})`);let i={type:"root",input:r,nodes:[]},s=[i],o=i,a=i,c=0,u=r.length,p=0,f=0,m,y=()=>r[p++],_=S=>{if(S.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&S.type==="text"){a.value+=S.value;return}return o.nodes.push(S),S.parent=o,S.prev=a,a=S,S};for(_({type:"bos"});p<u;)if(o=s[s.length-1],m=y(),!(m===sU||m===iU)){if(m===og){_({type:"text",value:(e.keepEscaping?m:"")+y()});continue}if(m===HA){_({type:"text",value:"\\"+m});continue}if(m===$A){c++;let S;for(;p<u&&(S=y());){if(m+=S,S===$A){c++;continue}if(S===og){m+=y();continue}if(S===HA&&(c--,c===0))break}_({type:"text",value:m});continue}if(m===QH){o=_({type:"paren",nodes:[]}),s.push(o),_({type:"text",value:m});continue}if(m===ZH){if(o.type!=="paren"){_({type:"text",value:m});continue}o=s.pop(),_({type:"text",value:m}),o=s[s.length-1];continue}if(m===rU||m===nU||m===YH){let S=m,A;for(e.keepQuotes!==!0&&(m="");p<u&&(A=y());){if(A===og){m+=A+y();continue}if(A===S){e.keepQuotes===!0&&(m+=A);break}m+=A}_({type:"text",value:m});continue}if(m===eU){f++;let A={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};o=_(A),s.push(o),_({type:"open",value:m});continue}if(m===tU){if(o.type!=="brace"){_({type:"text",value:m});continue}let S="close";o=s.pop(),o.close=!0,_({type:S,value:m}),f--,o=s[s.length-1];continue}if(m===XH&&f>0){if(o.ranges>0){o.ranges=0;let S=o.nodes.shift();o.nodes=[S,{type:"text",value:KH(o)}]}_({type:"comma",value:m}),o.commas++;continue}if(m===JH&&f>0&&o.commas===0){let S=o.nodes;if(f===0||S.length===0){_({type:"text",value:m});continue}if(a.type==="dot"){if(o.range=[],a.value+=m,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){S.pop();let A=S[S.length-1];A.value+=a.value+m,a=A,o.ranges--;continue}_({type:"dot",value:m});continue}_({type:"text",value:m})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(M=>{M.nodes||(M.type==="open"&&(M.isOpen=!0),M.type==="close"&&(M.isClose=!0),M.nodes||(M.type="text"),M.invalid=!0)});let S=s[s.length-1],A=S.nodes.indexOf(o);S.nodes.splice(A,1,...o.nodes)}while(s.length>0);return _({type:"eos"}),i};UA.exports=oU});var zA=O((yV,GA)=>{"use strict";var WA=Lu(),aU=IA(),cU=DA(),lU=qA(),er=(r,e={})=>{let t=[];if(Array.isArray(r))for(let n of r){let i=er.create(n,e);Array.isArray(i)?t.push(...i):t.push(i)}else t=[].concat(er.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};er.parse=(r,e={})=>lU(r,e);er.stringify=(r,e={})=>WA(typeof r=="string"?er.parse(r,e):r,e);er.compile=(r,e={})=>(typeof r=="string"&&(r=er.parse(r,e)),aU(r,e));er.expand=(r,e={})=>{typeof r=="string"&&(r=er.parse(r,e));let t=cU(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};er.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?er.compile(r,e):er.expand(r,e);GA.exports=er});var VA=O((_V,uU)=>{uU.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]});var YA=O((bV,KA)=>{KA.exports=VA()});var JA=O((wV,XA)=>{"use strict";var pU=require("path"),fU=YA(),dU=new Set(fU);XA.exports=r=>dU.has(pU.extname(r).slice(1).toLowerCase())});var ju=O(Z=>{"use strict";var{sep:hU}=require("path"),{platform:ag}=process,mU=require("os");Z.EV_ALL="all";Z.EV_READY="ready";Z.EV_ADD="add";Z.EV_CHANGE="change";Z.EV_ADD_DIR="addDir";Z.EV_UNLINK="unlink";Z.EV_UNLINK_DIR="unlinkDir";Z.EV_RAW="raw";Z.EV_ERROR="error";Z.STR_DATA="data";Z.STR_END="end";Z.STR_CLOSE="close";Z.FSEVENT_CREATED="created";Z.FSEVENT_MODIFIED="modified";Z.FSEVENT_DELETED="deleted";Z.FSEVENT_MOVED="moved";Z.FSEVENT_CLONED="cloned";Z.FSEVENT_UNKNOWN="unknown";Z.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1;Z.FSEVENT_TYPE_FILE="file";Z.FSEVENT_TYPE_DIRECTORY="directory";Z.FSEVENT_TYPE_SYMLINK="symlink";Z.KEY_LISTENERS="listeners";Z.KEY_ERR="errHandlers";Z.KEY_RAW="rawEmitters";Z.HANDLER_KEYS=[Z.KEY_LISTENERS,Z.KEY_ERR,Z.KEY_RAW];Z.DOT_SLASH=`.${hU}`;Z.BACK_SLASH_RE=/\\/g;Z.DOUBLE_SLASH_RE=/\/\//;Z.SLASH_OR_BACK_SLASH_RE=/[/\\]/;Z.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;Z.REPLACER_RE=/^\.[/\\]/;Z.SLASH="/";Z.SLASH_SLASH="//";Z.BRACE_START="{";Z.BANG="!";Z.ONE_DOT=".";Z.TWO_DOTS="..";Z.STAR="*";Z.GLOBSTAR="**";Z.ROOT_GLOBSTAR="/**/*";Z.SLASH_GLOBSTAR="/**";Z.DIR_SUFFIX="Dir";Z.ANYMATCH_OPTS={dot:!0};Z.STRING_TYPE="string";Z.FUNCTION_TYPE="function";Z.EMPTY_STR="";Z.EMPTY_FN=()=>{};Z.IDENTITY_FN=r=>r;Z.isWindows=ag==="win32";Z.isMacos=ag==="darwin";Z.isLinux=ag==="linux";Z.isIBMi=mU.type()==="OS400"});var nR=O((EV,rR)=>{"use strict";var En=require("fs"),gt=require("path"),{promisify:Sa}=require("util"),gU=JA(),{isWindows:vU,isLinux:xU,EMPTY_FN:yU,EMPTY_STR:_U,KEY_LISTENERS:Ys,KEY_ERR:cg,KEY_RAW:_a,HANDLER_KEYS:bU,EV_CHANGE:$u,EV_ADD:Fu,EV_ADD_DIR:wU,EV_ERROR:ZA,STR_DATA:SU,STR_END:EU,BRACE_START:TU,STAR:CU}=ju(),AU="watch",RU=Sa(En.open),eR=Sa(En.stat),kU=Sa(En.lstat),OU=Sa(En.close),lg=Sa(En.realpath),MU={lstat:kU,stat:eR},pg=(r,e)=>{r instanceof Set?r.forEach(e):e(r)},ba=(r,e,t)=>{let n=r[e];n instanceof Set||(r[e]=n=new Set([n])),n.add(t)},PU=r=>e=>{let t=r[e];t instanceof Set?t.clear():delete r[e]},wa=(r,e,t)=>{let n=r[e];n instanceof Set?n.delete(t):n===t&&delete r[e]},tR=r=>r instanceof Set?r.size===0:!r,Hu=new Map;function QA(r,e,t,n,i){let s=(o,a)=>{t(r),i(o,a,{watchedPath:r}),a&&r!==a&&Uu(gt.resolve(r,a),Ys,gt.join(r,a))};try{return En.watch(r,e,s)}catch(o){n(o)}}var Uu=(r,e,t,n,i)=>{let s=Hu.get(r);s&&pg(s[e],o=>{o(t,n,i)})},IU=(r,e,t,n)=>{let{listener:i,errHandler:s,rawEmitter:o}=n,a=Hu.get(e),c;if(!t.persistent)return c=QA(r,t,i,s,o),c.close.bind(c);if(a)ba(a,Ys,i),ba(a,cg,s),ba(a,_a,o);else{if(c=QA(r,t,Uu.bind(null,e,Ys),s,Uu.bind(null,e,_a)),!c)return;c.on(ZA,async u=>{let p=Uu.bind(null,e,cg);if(a.watcherUnusable=!0,vU&&u.code==="EPERM")try{let f=await RU(r,"r");await OU(f),p(u)}catch{}else p(u)}),a={listeners:i,errHandlers:s,rawEmitters:o,watcher:c},Hu.set(e,a)}return()=>{wa(a,Ys,i),wa(a,cg,s),wa(a,_a,o),tR(a.listeners)&&(a.watcher.close(),Hu.delete(e),bU.forEach(PU(a)),a.watcher=void 0,Object.freeze(a))}},ug=new Map,NU=(r,e,t,n)=>{let{listener:i,rawEmitter:s}=n,o=ug.get(e),a=new Set,c=new Set,u=o&&o.options;return u&&(u.persistent<t.persistent||u.interval>t.interval)&&(a=o.listeners,c=o.rawEmitters,En.unwatchFile(e),o=void 0),o?(ba(o,Ys,i),ba(o,_a,s)):(o={listeners:i,rawEmitters:s,options:t,watcher:En.watchFile(e,t,(p,f)=>{pg(o.rawEmitters,y=>{y($u,e,{curr:p,prev:f})});let m=p.mtimeMs;(p.size!==f.size||m>f.mtimeMs||m===0)&&pg(o.listeners,y=>y(r,p))})},ug.set(e,o)),()=>{wa(o,Ys,i),wa(o,_a,s),tR(o.listeners)&&(ug.delete(e),En.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o))}},fg=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,i=gt.dirname(e),s=gt.basename(e);this.fsw._getWatchedDir(i).add(s);let a=gt.resolve(e),c={persistent:n.persistent};t||(t=yU);let u;return n.usePolling?(c.interval=n.enableBinaryInterval&&gU(s)?n.binaryInterval:n.interval,u=NU(e,a,c,{listener:t,rawEmitter:this.fsw._emitRaw})):u=IU(e,a,c,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),u}_handleFile(e,t,n){if(this.fsw.closed)return;let i=gt.dirname(e),s=gt.basename(e),o=this.fsw._getWatchedDir(i),a=t;if(o.has(s))return;let c=async(p,f)=>{if(this.fsw._throttle(AU,e,5)){if(!f||f.mtimeMs===0)try{let m=await eR(e);if(this.fsw.closed)return;let y=m.atimeMs,_=m.mtimeMs;(!y||y<=_||_!==a.mtimeMs)&&this.fsw._emit($u,e,m),xU&&a.ino!==m.ino?(this.fsw._closeFile(p),a=m,this.fsw._addPathCloser(p,this._watchWithNodeFs(e,c))):a=m}catch{this.fsw._remove(i,s)}else if(o.has(s)){let m=f.atimeMs,y=f.mtimeMs;(!m||m<=y||y!==a.mtimeMs)&&this.fsw._emit($u,e,f),a=f}}},u=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(Fu,e,0))return;this.fsw._emit(Fu,e,t)}return u}async _handleSymlink(e,t,n,i){if(this.fsw.closed)return;let s=e.fullPath,o=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await lg(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(o.has(i)?this.fsw._symlinkPaths.get(s)!==a&&(this.fsw._symlinkPaths.set(s,a),this.fsw._emit($u,n,e.stats)):(o.add(i),this.fsw._symlinkPaths.set(s,a),this.fsw._emit(Fu,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(s))return!0;this.fsw._symlinkPaths.set(s,!0)}_handleRead(e,t,n,i,s,o,a){if(e=gt.join(e,_U),!n.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(n.path),u=new Set,p=this.fsw._readdirp(e,{fileFilter:f=>n.filterPath(f),directoryFilter:f=>n.filterDir(f),depth:0}).on(SU,async f=>{if(this.fsw.closed){p=void 0;return}let m=f.path,y=gt.join(e,m);if(u.add(m),!(f.stats.isSymbolicLink()&&await this._handleSymlink(f,e,y,m))){if(this.fsw.closed){p=void 0;return}(m===i||!i&&!c.has(m))&&(this.fsw._incrReadyCount(),y=gt.join(s,gt.relative(s,y)),this._addToNodeFs(y,t,n,o+1))}}).on(ZA,this._boundHandleError);return new Promise(f=>p.once(EU,()=>{if(this.fsw.closed){p=void 0;return}let m=a?a.clear():!1;f(),c.getChildren().filter(y=>y!==e&&!u.has(y)&&(!n.hasGlob||n.filterPath({fullPath:gt.resolve(e,y)}))).forEach(y=>{this.fsw._remove(e,y)}),p=void 0,m&&this._handleRead(e,!1,n,i,s,o,a)}))}async _handleDir(e,t,n,i,s,o,a){let c=this.fsw._getWatchedDir(gt.dirname(e)),u=c.has(gt.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!s&&!u&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(wU,e,t),c.add(gt.basename(e)),this.fsw._getWatchedDir(e);let p,f,m=this.fsw.options.depth;if((m==null||i<=m)&&!this.fsw._symlinkPaths.has(a)){if(!s&&(await this._handleRead(e,n,o,s,e,i,p),this.fsw.closed))return;f=this._watchWithNodeFs(e,(y,_)=>{_&&_.mtimeMs===0||this._handleRead(y,!1,o,s,e,i,p)})}return f}async _addToNodeFs(e,t,n,i,s){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let a=this.fsw._getWatchHelpers(e,i);!a.hasGlob&&n&&(a.hasGlob=n.hasGlob,a.globFilter=n.globFilter,a.filterPath=c=>n.filterPath(c),a.filterDir=c=>n.filterDir(c));try{let c=await MU[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return o(),!1;let u=this.fsw.options.followSymlinks&&!e.includes(CU)&&!e.includes(TU),p;if(c.isDirectory()){let f=gt.resolve(e),m=u?await lg(e):e;if(this.fsw.closed||(p=await this._handleDir(a.watchPath,c,t,i,s,a,m),this.fsw.closed))return;f!==m&&m!==void 0&&this.fsw._symlinkPaths.set(f,m)}else if(c.isSymbolicLink()){let f=u?await lg(e):e;if(this.fsw.closed)return;let m=gt.dirname(a.watchPath);if(this.fsw._getWatchedDir(m).add(a.watchPath),this.fsw._emit(Fu,a.watchPath,c),p=await this._handleDir(m,c,t,i,e,a,f),this.fsw.closed)return;f!==void 0&&this.fsw._symlinkPaths.set(gt.resolve(e),f)}else p=this._handleFile(a.watchPath,c,t);return o(),this.fsw._addPathCloser(e,p),!1}catch(c){if(this.fsw._handleError(c))return o(),e}}};rR.exports=fg});var uR=O((TV,_g)=>{"use strict";var xg=require("fs"),vt=require("path"),{promisify:yg}=require("util"),Xs;try{Xs=require("fsevents")}catch(r){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(r)}if(Xs){let r=process.version.match(/v(\d+)\.(\d+)/);if(r&&r[1]&&r[2]){let e=Number.parseInt(r[1],10),t=Number.parseInt(r[2],10);e===8&&t<16&&(Xs=void 0)}}var{EV_ADD:dg,EV_CHANGE:LU,EV_ADD_DIR:iR,EV_UNLINK:qu,EV_ERROR:DU,STR_DATA:BU,STR_END:jU,FSEVENT_CREATED:FU,FSEVENT_MODIFIED:$U,FSEVENT_DELETED:HU,FSEVENT_MOVED:UU,FSEVENT_UNKNOWN:qU,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:WU,FSEVENT_TYPE_FILE:GU,FSEVENT_TYPE_DIRECTORY:Ea,FSEVENT_TYPE_SYMLINK:lR,ROOT_GLOBSTAR:sR,DIR_SUFFIX:zU,DOT_SLASH:oR,FUNCTION_TYPE:hg,EMPTY_FN:VU,IDENTITY_FN:KU}=ju(),YU=r=>isNaN(r)?{}:{depth:r},gg=yg(xg.stat),XU=yg(xg.lstat),aR=yg(xg.realpath),JU={stat:gg,lstat:XU},Ti=new Map,QU=10,ZU=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),eq=(r,e)=>({stop:Xs.watch(r,e)});function tq(r,e,t,n){let i=vt.extname(e)?vt.dirname(e):e,s=vt.dirname(i),o=Ti.get(i);rq(s)&&(i=s);let a=vt.resolve(r),c=a!==e,u=(f,m,y)=>{c&&(f=f.replace(e,a)),(f===a||!f.indexOf(a+vt.sep))&&t(f,m,y)},p=!1;for(let f of Ti.keys())if(e.indexOf(vt.resolve(f)+vt.sep)===0){i=f,o=Ti.get(i),p=!0;break}return o||p?o.listeners.add(u):(o={listeners:new Set([u]),rawEmitter:n,watcher:eq(i,(f,m)=>{if(!o.listeners.size||m&WU)return;let y=Xs.getInfo(f,m);o.listeners.forEach(_=>{_(f,m,y)}),o.rawEmitter(y.event,f,y)})},Ti.set(i,o)),()=>{let f=o.listeners;if(f.delete(u),!f.size&&(Ti.delete(i),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o)})}}var rq=r=>{let e=0;for(let t of Ti.keys())if(t.indexOf(r)===0&&(e++,e>=QU))return!0;return!1},nq=()=>Xs&&Ti.size<128,mg=(r,e)=>{let t=0;for(;!r.indexOf(e)&&(r=vt.dirname(r))!==e;)t++;return t},cR=(r,e)=>r.type===Ea&&e.isDirectory()||r.type===lR&&e.isSymbolicLink()||r.type===GU&&e.isFile(),vg=class{constructor(e){this.fsw=e}checkIgnored(e,t){let n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,t))return n.add(e),t&&t.isDirectory()&&n.add(e+sR),!0;n.delete(e),n.delete(e+sR)}addOrChange(e,t,n,i,s,o,a,c){let u=s.has(o)?LU:dg;this.handleEvent(u,e,t,n,i,s,o,a,c)}async checkExists(e,t,n,i,s,o,a,c){try{let u=await gg(e);if(this.fsw.closed)return;cR(a,u)?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent(qu,e,t,n,i,s,o,a,c)}catch(u){u.code==="EACCES"?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent(qu,e,t,n,i,s,o,a,c)}}handleEvent(e,t,n,i,s,o,a,c,u){if(!(this.fsw.closed||this.checkIgnored(t)))if(e===qu){let p=c.type===Ea;(p||o.has(a))&&this.fsw._remove(s,a,p)}else{if(e===dg){if(c.type===Ea&&this.fsw._getWatchedDir(t),c.type===lR&&u.followSymlinks){let f=u.depth===void 0?void 0:mg(n,i)+1;return this._addToFsEvents(t,!1,!0,f)}this.fsw._getWatchedDir(s).add(a)}let p=c.type===Ea?e+zU:e;this.fsw._emit(p,t),p===iR&&this._addToFsEvents(t,!1,!0)}}_watchWithFsEvents(e,t,n,i){if(this.fsw.closed||this.fsw._isIgnored(e))return;let s=this.fsw.options,a=tq(e,t,async(c,u,p)=>{if(this.fsw.closed||s.depth!==void 0&&mg(c,t)>s.depth)return;let f=n(vt.join(e,vt.relative(e,c)));if(i&&!i(f))return;let m=vt.dirname(f),y=vt.basename(f),_=this.fsw._getWatchedDir(p.type===Ea?f:m);if(ZU.has(u)||p.event===qU)if(typeof s.ignored===hg){let S;try{S=await gg(f)}catch{}if(this.fsw.closed||this.checkIgnored(f,S))return;cR(p,S)?this.addOrChange(f,c,t,m,_,y,p,s):this.handleEvent(qu,f,c,t,m,_,y,p,s)}else this.checkExists(f,c,t,m,_,y,p,s);else switch(p.event){case FU:case $U:return this.addOrChange(f,c,t,m,_,y,p,s);case HU:case UU:return this.checkExists(f,c,t,m,_,y,p,s)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}async _handleFsEventsSymlink(e,t,n,i){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(t))){this.fsw._symlinkPaths.set(t,!0),this.fsw._incrReadyCount();try{let s=await aR(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(s))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(s||e,o=>{let a=e;return s&&s!==oR?a=o.replace(s,e):o!==oR&&(a=vt.join(e,o)),n(a)},!1,i)}catch(s){if(this.fsw._handleError(s))return this.fsw._emitReady()}}}emitAdd(e,t,n,i,s){let o=n(e),a=t.isDirectory(),c=this.fsw._getWatchedDir(vt.dirname(o)),u=vt.basename(o);a&&this.fsw._getWatchedDir(o),!c.has(u)&&(c.add(u),(!i.ignoreInitial||s===!0)&&this.fsw._emit(a?iR:dg,o,t))}initWatch(e,t,n,i){if(this.fsw.closed)return;let s=this._watchWithFsEvents(n.watchPath,vt.resolve(e||n.watchPath),i,n.globFilter);this.fsw._addPathCloser(t,s)}async _addToFsEvents(e,t,n,i){if(this.fsw.closed)return;let s=this.fsw.options,o=typeof t===hg?t:KU,a=this.fsw._getWatchHelpers(e);try{let c=await JU[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))throw null;if(c.isDirectory()){if(a.globFilter||this.emitAdd(o(e),c,o,s,n),i&&i>s.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:u=>a.filterPath(u),directoryFilter:u=>a.filterDir(u),...YU(s.depth-(i||0))}).on(BU,u=>{if(this.fsw.closed||u.stats.isDirectory()&&!a.filterPath(u))return;let p=vt.join(a.watchPath,u.path),{fullPath:f}=u;if(a.followSymlinks&&u.stats.isSymbolicLink()){let m=s.depth===void 0?void 0:mg(p,vt.resolve(a.watchPath))+1;this._handleFsEventsSymlink(p,f,o,m)}else this.emitAdd(p,u.stats,o,s,n)}).on(DU,VU).on(jU,()=>{this.fsw._emitReady()})}else this.emitAdd(a.watchPath,c,o,s,n),this.fsw._emitReady()}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(s.persistent&&n!==!0)if(typeof t===hg)this.initWatch(void 0,e,a,o);else{let c;try{c=await aR(a.watchPath)}catch{}this.initWatch(c,e,a,o)}}};_g.exports=vg;_g.exports.canUse=nq});var bR=O(Lg=>{"use strict";var{EventEmitter:iq}=require("events"),Ig=require("fs"),le=require("path"),{promisify:vR}=require("util"),sq=kC(),Cg=iA().default,oq=uA(),bg=eg(),aq=zA(),cq=Qm(),lq=nR(),pR=uR(),{EV_ALL:wg,EV_READY:uq,EV_ADD:Wu,EV_CHANGE:Ta,EV_UNLINK:fR,EV_ADD_DIR:pq,EV_UNLINK_DIR:fq,EV_RAW:dq,EV_ERROR:Sg,STR_CLOSE:hq,STR_END:mq,BACK_SLASH_RE:gq,DOUBLE_SLASH_RE:dR,SLASH_OR_BACK_SLASH_RE:vq,DOT_RE:xq,REPLACER_RE:yq,SLASH:Eg,SLASH_SLASH:_q,BRACE_START:bq,BANG:Ag,ONE_DOT:xR,TWO_DOTS:wq,GLOBSTAR:Sq,SLASH_GLOBSTAR:Tg,ANYMATCH_OPTS:Rg,STRING_TYPE:Ng,FUNCTION_TYPE:Eq,EMPTY_STR:kg,EMPTY_FN:Tq,isWindows:Cq,isMacos:Aq,isIBMi:Rq}=ju(),kq=vR(Ig.stat),Oq=vR(Ig.readdir),Og=(r=[])=>Array.isArray(r)?r:[r],yR=(r,e=[])=>(r.forEach(t=>{Array.isArray(t)?yR(t,e):e.push(t)}),e),hR=r=>{let e=yR(Og(r));if(!e.every(t=>typeof t===Ng))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(_R)},mR=r=>{let e=r.replace(gq,Eg),t=!1;for(e.startsWith(_q)&&(t=!0);e.match(dR);)e=e.replace(dR,Eg);return t&&(e=Eg+e),e},_R=r=>mR(le.normalize(mR(r))),gR=(r=kg)=>e=>typeof e!==Ng?e:_R(le.isAbsolute(e)?e:le.join(r,e)),Mq=(r,e)=>le.isAbsolute(r)?r:r.startsWith(Ag)?Ag+le.join(e,r.slice(1)):le.join(e,r),Pr=(r,e)=>r[e]===void 0,Mg=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==xR&&e!==wq&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let n=this.path;try{await Oq(n)}catch{this._removeWatcher&&this._removeWatcher(le.dirname(n),le.basename(n))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}},Pq="stat",Iq="lstat",Pg=class{constructor(e,t,n,i){this.fsw=i,this.path=e=e.replace(yq,kg),this.watchPath=t,this.fullWatchPath=le.resolve(t),this.hasGlob=t!==e,e===kg&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?Cg(e,void 0,Rg):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(s=>{s.length>1&&s.pop()}),this.followSymlinks=n,this.statMethod=n?Pq:Iq}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return le.join(this.watchPath,le.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===Eq?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];let t=[];return(e.includes(bq)?aq.expand(e):[e]).forEach(i=>{t.push(le.relative(this.watchPath,i).split(vq))}),t}filterDir(e){if(this.hasGlob){let t=this.getDirParts(this.checkGlobSymlink(e)),n=!1;this.unmatchedGlob=!this.dirParts.some(i=>i.every((s,o)=>(s===Sq&&(n=!0),n||!t[0][o]||Cg(s,t[0][o],Rg))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Gu=class extends iq{constructor(e){super();let t={};e&&Object.assign(t,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,Pr(t,"persistent")&&(t.persistent=!0),Pr(t,"ignoreInitial")&&(t.ignoreInitial=!1),Pr(t,"ignorePermissionErrors")&&(t.ignorePermissionErrors=!1),Pr(t,"interval")&&(t.interval=100),Pr(t,"binaryInterval")&&(t.binaryInterval=300),Pr(t,"disableGlobbing")&&(t.disableGlobbing=!1),t.enableBinaryInterval=t.binaryInterval!==t.interval,Pr(t,"useFsEvents")&&(t.useFsEvents=!t.usePolling),pR.canUse()||(t.useFsEvents=!1),Pr(t,"usePolling")&&!t.useFsEvents&&(t.usePolling=Aq),Rq&&(t.usePolling=!0);let i=process.env.CHOKIDAR_USEPOLLING;if(i!==void 0){let c=i.toLowerCase();c==="false"||c==="0"?t.usePolling=!1:c==="true"||c==="1"?t.usePolling=!0:t.usePolling=!!c}let s=process.env.CHOKIDAR_INTERVAL;s&&(t.interval=Number.parseInt(s,10)),Pr(t,"atomic")&&(t.atomic=!t.usePolling&&!t.useFsEvents),t.atomic&&(this._pendingUnlinks=new Map),Pr(t,"followSymlinks")&&(t.followSymlinks=!0),Pr(t,"awaitWriteFinish")&&(t.awaitWriteFinish=!1),t.awaitWriteFinish===!0&&(t.awaitWriteFinish={});let o=t.awaitWriteFinish;o&&(o.stabilityThreshold||(o.stabilityThreshold=2e3),o.pollInterval||(o.pollInterval=100),this._pendingWrites=new Map),t.ignored&&(t.ignored=Og(t.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=Tq,this._readyEmitted=!0,process.nextTick(()=>this.emit(uq)))},this._emitRaw=(...c)=>this.emit(dq,...c),this._readyEmitted=!1,this.options=t,t.useFsEvents?this._fsEventsHandler=new pR(this):this._nodeFsHandler=new lq(this),Object.freeze(t)}add(e,t,n){let{cwd:i,disableGlobbing:s}=this.options;this.closed=!1;let o=hR(e);return i&&(o=o.map(a=>{let c=Mq(a,i);return s||!bg(a)?c:cq(c)})),o=o.filter(a=>a.startsWith(Ag)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+Tg),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=o.length),this.options.persistent&&(this._readyCount+=o.length),o.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async a=>{let c=await this._nodeFsHandler._addToNodeFs(a,!n,0,0,t);return c&&this._emitReady(),c})).then(a=>{this.closed||a.filter(c=>c).forEach(c=>{this.add(le.dirname(c),le.basename(t||c))})})),this}unwatch(e){if(this.closed)return this;let t=hR(e),{cwd:n}=this.options;return t.forEach(i=>{!le.isAbsolute(i)&&!this._closers.has(i)&&(n&&(i=le.join(n,i)),i=le.resolve(i)),this._closePath(i),this._ignoredPaths.add(i),this._watched.has(i)&&this._ignoredPaths.add(i+Tg),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(n=>{let i=n();i instanceof Promise&&e.push(i)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(t=>{this[`_${t}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,n)=>{let i=this.options.cwd?le.relative(this.options.cwd,n):n;e[i||xR]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(...t),e!==Sg&&this.emit(wg,...t)}async _emit(e,t,n,i,s){if(this.closed)return;let o=this.options;Cq&&(t=le.normalize(t)),o.cwd&&(t=le.relative(o.cwd,t));let a=[e,t];s!==void 0?a.push(n,i,s):i!==void 0?a.push(n,i):n!==void 0&&a.push(n);let c=o.awaitWriteFinish,u;if(c&&(u=this._pendingWrites.get(t)))return u.lastChange=new Date,this;if(o.atomic){if(e===fR)return this._pendingUnlinks.set(t,a),setTimeout(()=>{this._pendingUnlinks.forEach((p,f)=>{this.emit(...p),this.emit(wg,...p),this._pendingUnlinks.delete(f)})},typeof o.atomic=="number"?o.atomic:100),this;e===Wu&&this._pendingUnlinks.has(t)&&(e=a[0]=Ta,this._pendingUnlinks.delete(t))}if(c&&(e===Wu||e===Ta)&&this._readyEmitted){let p=(f,m)=>{f?(e=a[0]=Sg,a[1]=f,this.emitWithAll(e,a)):m&&(a.length>2?a[2]=m:a.push(m),this.emitWithAll(e,a))};return this._awaitWriteFinish(t,c.stabilityThreshold,e,p),this}if(e===Ta&&!this._throttle(Ta,t,50))return this;if(o.alwaysStat&&n===void 0&&(e===Wu||e===pq||e===Ta)){let p=o.cwd?le.join(o.cwd,t):t,f;try{f=await kq(p)}catch{}if(!f||this.closed)return;a.push(f)}return this.emitWithAll(e,a),this}_handleError(e){let t=e&&e.code;return e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES")&&this.emit(Sg,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);let i=this._throttled.get(e),s=i.get(t);if(s)return s.count++,!1;let o,a=()=>{let u=i.get(t),p=u?u.count:0;return i.delete(t),clearTimeout(o),u&&clearTimeout(u.timeoutObject),p};o=setTimeout(a,n);let c={timeoutObject:o,clear:a,count:0};return i.set(t,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,i){let s,o=e;this.options.cwd&&!le.isAbsolute(e)&&(o=le.join(this.options.cwd,e));let a=new Date,c=u=>{Ig.stat(o,(p,f)=>{if(p||!this._pendingWrites.has(e)){p&&p.code!=="ENOENT"&&i(p);return}let m=Number(new Date);u&&f.size!==u.size&&(this._pendingWrites.get(e).lastChange=m);let y=this._pendingWrites.get(e);m-y.lastChange>=t?(this._pendingWrites.delete(e),i(void 0,f)):s=setTimeout(c,this.options.awaitWriteFinish.pollInterval,f)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(s),n)}),s=setTimeout(c,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,t){if(this.options.atomic&&xq.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,i=this.options.ignored,s=i&&i.map(gR(n)),o=Og(s).filter(c=>typeof c===Ng&&!bg(c)).map(c=>c+Tg),a=this._getGlobIgnored().map(gR(n)).concat(s,o);this._userIgnored=Cg(a,void 0,Rg)}return this._userIgnored([e,t])}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e,t){let n=t||this.options.disableGlobbing||!bg(e)?e:oq(e),i=this.options.followSymlinks;return new Pg(e,n,i,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let t=le.resolve(e);return this._watched.has(t)||this._watched.set(t,new Mg(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;let n=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(n.toString(8)[0],10))}_remove(e,t,n){let i=le.join(e,t),s=le.resolve(i);if(n=n??(this._watched.has(i)||this._watched.has(s)),!this._throttle("remove",i,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(i).getChildren().forEach(m=>this._remove(i,m));let c=this._getWatchedDir(e),u=c.has(t);c.remove(t),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let p=i;if(this.options.cwd&&(p=le.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(p)&&this._pendingWrites.get(p).cancelWait()===Wu)return;this._watched.delete(i),this._watched.delete(s);let f=n?fq:fR;u&&!this._isIgnored(i)&&this._emit(f,i),this.options.useFsEvents||this._closePath(i)}_closePath(e){this._closeFile(e);let t=le.dirname(e);this._getWatchedDir(t).remove(le.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(n=>n()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;let n={type:wg,alwaysStat:!0,lstat:!0,...t},i=sq(e,n);return this._streams.add(i),i.once(hq,()=>{i=void 0}),i.once(mq,()=>{i&&(this._streams.delete(i),i=void 0)}),i}};Lg.FSWatcher=Gu;var Nq=(r,e)=>{let t=new Gu(e);return t.add(r),t};Lg.watch=Nq});var uk=O((eK,$g)=>{"use strict";var Hq=Object.prototype.hasOwnProperty,Pt="~";function Ma(){}Object.create&&(Ma.prototype=Object.create(null),new Ma().__proto__||(Pt=!1));function Uq(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function lk(r,e,t,n,i){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new Uq(t,n||r,i),o=Pt?Pt+e:e;return r._events[o]?r._events[o].fn?r._events[o]=[r._events[o],s]:r._events[o].push(s):(r._events[o]=s,r._eventsCount++),r}function Zu(r,e){--r._eventsCount===0?r._events=new Ma:delete r._events[e]}function At(){this._events=new Ma,this._eventsCount=0}At.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)Hq.call(t,n)&&e.push(Pt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};At.prototype.listeners=function(e){var t=Pt?Pt+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=new Array(s);i<s;i++)o[i]=n[i].fn;return o};At.prototype.listenerCount=function(e){var t=Pt?Pt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};At.prototype.emit=function(e,t,n,i,s,o){var a=Pt?Pt+e:e;if(!this._events[a])return!1;var c=this._events[a],u=arguments.length,p,f;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,s),!0;case 6:return c.fn.call(c.context,t,n,i,s,o),!0}for(f=1,p=new Array(u-1);f<u;f++)p[f-1]=arguments[f];c.fn.apply(c.context,p)}else{var m=c.length,y;for(f=0;f<m;f++)switch(c[f].once&&this.removeListener(e,c[f].fn,void 0,!0),u){case 1:c[f].fn.call(c[f].context);break;case 2:c[f].fn.call(c[f].context,t);break;case 3:c[f].fn.call(c[f].context,t,n);break;case 4:c[f].fn.call(c[f].context,t,n,i);break;default:if(!p)for(y=1,p=new Array(u-1);y<u;y++)p[y-1]=arguments[y];c[f].fn.apply(c[f].context,p)}}return!0};At.prototype.on=function(e,t,n){return lk(this,e,t,n,!1)};At.prototype.once=function(e,t,n){return lk(this,e,t,n,!0)};At.prototype.removeListener=function(e,t,n,i){var s=Pt?Pt+e:e;if(!this._events[s])return this;if(!t)return Zu(this,s),this;var o=this._events[s];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&Zu(this,s);else{for(var a=0,c=[],u=o.length;a<u;a++)(o[a].fn!==t||i&&!o[a].once||n&&o[a].context!==n)&&c.push(o[a]);c.length?this._events[s]=c.length===1?c[0]:c:Zu(this,s)}return this};At.prototype.removeAllListeners=function(e){var t;return e?(t=Pt?Pt+e:e,this._events[t]&&Zu(this,t)):(this._events=new Ma,this._eventsCount=0),this};At.prototype.off=At.prototype.removeListener;At.prototype.addListener=At.prototype.on;At.prefixed=Pt;At.EventEmitter=At;typeof $g<"u"&&($g.exports=At)});var fk=O((tK,pk)=>{"use strict";pk.exports=function(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var ep=O(hk=>{var An=hk,qq=require("url"),dk=require("util")._extend,Wq=fk(),Gq=/(^|,)\s*upgrade\s*($|,)/i,Hg=/^https|wss/;An.isSSL=Hg;An.setupOutgoing=function(r,e,t,n){r.port=e[n||"target"].port||(Hg.test(e[n||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(a){r[a]=e[n||"target"][a]}),r.method=e.method||t.method,r.headers=dk({},t.headers),e.headers&&dk(r.headers,e.headers),e.auth&&(r.auth=e.auth),e.ca&&(r.ca=e.ca),Hg.test(e[n||"target"].protocol)&&(r.rejectUnauthorized=typeof e.secure>"u"?!0:e.secure),r.agent=e.agent||!1,r.localAddress=e.localAddress,r.agent||(r.headers=r.headers||{},(typeof r.headers.connection!="string"||!Gq.test(r.headers.connection))&&(r.headers.connection="close"));var i=e[n||"target"],s=i&&e.prependPath!==!1&&i.path||"",o=e.toProxy?t.url:qq.parse(t.url).path||"";return o=e.ignorePath?"":o,r.path=An.urlJoin(s,o),e.changeOrigin&&(r.headers.host=Wq(r.port,e[n||"target"].protocol)&&!zq(r.host)?r.host+":"+r.port:r.host),r};An.setupSocket=function(r){return r.setTimeout(0),r.setNoDelay(!0),r.setKeepAlive(!0,0),r};An.getPort=function(r){var e=r.headers.host?r.headers.host.match(/:(\d+)/):"";return e?e[1]:An.hasEncryptedConnection(r)?"443":"80"};An.hasEncryptedConnection=function(r){return!!(r.connection.encrypted||r.connection.pair)};An.urlJoin=function(){var r=Array.prototype.slice.call(arguments),e=r.length-1,t=r[e],n=t.split("?"),i;return r[e]=n.shift(),i=[r.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")],i.push.apply(i,n),i.join("?")};An.rewriteCookieProperty=function r(e,t,n){return Array.isArray(e)?e.map(function(i){return r(i,t,n)}):e.replace(new RegExp("(;\\s*"+n+"=)([^;]+)","i"),function(i,s,o){var a;if(o in t)a=t[o];else if("*"in t)a=t["*"];else return i;return a?s+a:""})};function zq(r){return!!~r.indexOf(":")}});var xk=O((nK,vk)=>{var mk=require("url"),gk=ep(),Vq=/^201|30(1|2|7|8)$/;vk.exports={removeChunked:function(e,t,n){e.httpVersion==="1.0"&&delete n.headers["transfer-encoding"]},setConnection:function(e,t,n){e.httpVersion==="1.0"?n.headers.connection=e.headers.connection||"close":e.httpVersion!=="2.0"&&!n.headers.connection&&(n.headers.connection=e.headers.connection||"keep-alive")},setRedirectHostRewrite:function(e,t,n,i){if((i.hostRewrite||i.autoRewrite||i.protocolRewrite)&&n.headers.location&&Vq.test(n.statusCode)){var s=mk.parse(i.target),o=mk.parse(n.headers.location);if(s.host!=o.host)return;i.hostRewrite?o.host=i.hostRewrite:i.autoRewrite&&(o.host=e.headers.host),i.protocolRewrite&&(o.protocol=i.protocolRewrite),n.headers.location=o.format()}},writeHeaders:function(e,t,n,i){var s=i.cookieDomainRewrite,o=i.cookiePathRewrite,a=i.preserveHeaderKeyCase,c,u=function(m,y){y!=null&&(s&&m.toLowerCase()==="set-cookie"&&(y=gk.rewriteCookieProperty(y,s,"domain")),o&&m.toLowerCase()==="set-cookie"&&(y=gk.rewriteCookieProperty(y,o,"path")),t.setHeader(String(m).trim(),y))};if(typeof s=="string"&&(s={"*":s}),typeof o=="string"&&(o={"*":o}),a&&n.rawHeaders!=null){c={};for(var p=0;p<n.rawHeaders.length;p+=2){var f=n.rawHeaders[p];c[f.toLowerCase()]=f}}Object.keys(n.headers).forEach(function(m){var y=n.headers[m];a&&c&&(m=c[m]||m),u(m,y)})},writeStatusCode:function(e,t,n){n.statusMessage?(t.statusCode=n.statusCode,t.statusMessage=n.statusMessage):t.statusCode=n.statusCode}}});var _k=O((iK,yk)=>{var Pa;yk.exports=function(){if(!Pa){try{Pa=Ae()("follow-redirects")}catch{}typeof Pa!="function"&&(Pa=function(){})}Pa.apply(null,arguments)}});var Tk=O((sK,Zg)=>{var Na=require("url"),Ia=Na.URL,Kq=require("http"),Yq=require("https"),zg=require("stream").Writable,Vg=require("assert"),bk=_k();(function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",n=Oi(Error.captureStackTrace);!e&&(t||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var Kg=!1;try{Vg(new Ia(""))}catch(r){Kg=r.code==="ERR_INVALID_URL"}var Xq=["Authorization","Proxy-Authorization","Cookie"],Jq=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],Yg=["abort","aborted","connect","error","socket","timeout"],Xg=Object.create(null);Yg.forEach(function(r){Xg[r]=function(e,t,n){this._redirectable.emit(r,e,t,n)}});var qg=La("ERR_INVALID_URL","Invalid URL",TypeError),Wg=La("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Qq=La("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Wg),Zq=La("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),e4=La("ERR_STREAM_WRITE_AFTER_END","write after end"),t4=zg.prototype.destroy||Sk;function Gt(r,e){zg.call(this),this._sanitizeOptions(r),this._options=r,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var t=this;this._onNativeResponse=function(n){try{t._processResponse(n)}catch(i){t.emit("error",i instanceof Wg?i:new Wg({cause:i}))}},this._headerFilter=new RegExp("^(?:"+Xq.concat(r.sensitiveHeaders).map(a4).join("|")+")$","i"),this._performRequest()}Gt.prototype=Object.create(zg.prototype);Gt.prototype.abort=function(){Qg(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Gt.prototype.destroy=function(r){return Qg(this._currentRequest,r),t4.call(this,r),this};Gt.prototype.write=function(r,e,t){if(this._ending)throw new e4;if(!ki(r)&&!s4(r))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Oi(e)&&(t=e,e=null),r.length===0){t&&t();return}this._requestBodyLength+r.length<=this._options.maxBodyLength?(this._requestBodyLength+=r.length,this._requestBodyBuffers.push({data:r,encoding:e}),this._currentRequest.write(r,e,t)):(this.emit("error",new Zq),this.abort())};Gt.prototype.end=function(r,e,t){if(Oi(r)?(t=r,r=e=null):Oi(e)&&(t=e,e=null),!r)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var n=this,i=this._currentRequest;this.write(r,e,function(){n._ended=!0,i.end(null,null,t)}),this._ending=!0}};Gt.prototype.setHeader=function(r,e){this._options.headers[r]=e,this._currentRequest.setHeader(r,e)};Gt.prototype.removeHeader=function(r){delete this._options.headers[r],this._currentRequest.removeHeader(r)};Gt.prototype.setTimeout=function(r,e){var t=this;function n(o){o.setTimeout(r),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function i(o){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),s()},r),n(o)}function s(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",s),t.removeListener("error",s),t.removeListener("response",s),t.removeListener("close",s),e&&t.removeListener("timeout",e),t.socket||t._currentRequest.removeListener("socket",i)}return e&&this.on("timeout",e),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",n),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(r){Gt.prototype[r]=function(e,t){return this._currentRequest[r](e,t)}});["aborted","connection","socket"].forEach(function(r){Object.defineProperty(Gt.prototype,r,{get:function(){return this._currentRequest[r]}})});Gt.prototype._sanitizeOptions=function(r){if(r.headers||(r.headers={}),i4(r.sensitiveHeaders)||(r.sensitiveHeaders=[]),r.host&&(r.hostname||(r.hostname=r.host),delete r.host),!r.pathname&&r.path){var e=r.path.indexOf("?");e<0?r.pathname=r.path:(r.pathname=r.path.substring(0,e),r.search=r.path.substring(e))}};Gt.prototype._performRequest=function(){var r=this._options.protocol,e=this._options.nativeProtocols[r];if(!e)throw new TypeError("Unsupported protocol "+r);if(this._options.agents){var t=r.slice(0,-1);this._options.agent=this._options.agents[t]}var n=this._currentRequest=e.request(this._options,this._onNativeResponse);n._redirectable=this;for(var i of Yg)n.on(i,Xg[i]);if(this._currentUrl=/^\//.test(this._options.path)?Na.format(this._options):this._options.path,this._isRedirect){var s=0,o=this,a=this._requestBodyBuffers;(function c(u){if(n===o._currentRequest)if(u)o.emit("error",u);else if(s<a.length){var p=a[s++];n.finished||n.write(p.data,p.encoding,c)}else o._ended&&n.end()})()}};Gt.prototype._processResponse=function(r){var e=r.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:r.headers,statusCode:e});var t=r.headers.location;if(!t||this._options.followRedirects===!1||e<300||e>=400){r.responseUrl=this._currentUrl,r.redirects=this._redirects,this.emit("response",r),this._requestBodyBuffers=[];return}if(Qg(this._currentRequest),r.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Qq;var n,i=this._options.beforeRedirect;i&&(n=Object.assign({Host:r.req.getHeader("host")},this._options.headers));var s=this._options.method;((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Ug(/^content-/i,this._options.headers));var o=Ug(/^host$/i,this._options.headers),a=Jg(this._currentUrl),c=o||a.host,u=/^\w+:/.test(t)?this._currentUrl:Na.format(Object.assign(a,{host:c})),p=r4(t,u);if(bk("redirecting to",p.href),this._isRedirect=!0,Gg(p,this._options),(p.protocol!==a.protocol&&p.protocol!=="https:"||p.host!==c&&!n4(p.host,c))&&Ug(this._headerFilter,this._options.headers),Oi(i)){var f={headers:r.headers,statusCode:e},m={url:u,method:s,headers:n};i(this._options,f,m),this._sanitizeOptions(this._options)}this._performRequest()};function wk(r){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(r).forEach(function(n){var i=n+":",s=t[i]=r[n],o=e[n]=Object.create(s);function a(u,p,f){return o4(u)?u=Gg(u):ki(u)?u=Gg(Jg(u)):(f=p,p=Ek(u),u={protocol:i}),Oi(p)&&(f=p,p=null),p=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},u,p),p.nativeProtocols=t,!ki(p.host)&&!ki(p.hostname)&&(p.hostname="::1"),Vg.equal(p.protocol,i,"protocol mismatch"),bk("options",p),new Gt(p,f)}function c(u,p,f){var m=o.request(u,p,f);return m.end(),m}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),e}function Sk(){}function Jg(r){var e;if(Kg)e=new Ia(r);else if(e=Ek(Na.parse(r)),!ki(e.protocol))throw new qg({input:r});return e}function r4(r,e){return Kg?new Ia(r,e):Jg(Na.resolve(e,r))}function Ek(r){if(/^\[/.test(r.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(r.hostname))throw new qg({input:r.href||r});if(/^\[/.test(r.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(r.host))throw new qg({input:r.href||r});return r}function Gg(r,e){var t=e||{};for(var n of Jq)t[n]=r[n];return t.hostname.startsWith("[")&&(t.hostname=t.hostname.slice(1,-1)),t.port!==""&&(t.port=Number(t.port)),t.path=t.search?t.pathname+t.search:t.pathname,t}function Ug(r,e){var t;for(var n in e)r.test(n)&&(t=e[n],delete e[n]);return t===null||typeof t>"u"?void 0:String(t).trim()}function La(r,e,t){function n(i){Oi(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=r,this.message=this.cause?e+": "+this.cause.message:e}return n.prototype=new(t||Error),Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:!1},name:{value:"Error ["+r+"]",enumerable:!1}}),n}function Qg(r,e){for(var t of Yg)r.removeListener(t,Xg[t]);r.on("error",Sk),r.destroy(e)}function n4(r,e){Vg(ki(r)&&ki(e));var t=r.length-e.length-1;return t>0&&r[t]==="."&&r.endsWith(e)}function i4(r){return r instanceof Array}function ki(r){return typeof r=="string"||r instanceof String}function Oi(r){return typeof r=="function"}function s4(r){return typeof r=="object"&&"length"in r}function o4(r){return Ia&&r instanceof Ia}function a4(r){return r.replace(/[\]\\/()*+?.$]/g,"\\$&")}Zg.exports=wk({http:Kq,https:Yq});Zg.exports.wrap=wk});var Ak=O((oK,Ck)=>{var c4=require("http"),l4=require("https"),Da=xk(),tp=ep(),u4=Tk();Da=Object.keys(Da).map(function(r){return Da[r]});var p4={http:c4,https:l4};Ck.exports={deleteLength:function(e,t,n){(e.method==="DELETE"||e.method==="OPTIONS")&&!e.headers["content-length"]&&(e.headers["content-length"]="0",delete e.headers["transfer-encoding"])},timeout:function(e,t,n){n.timeout&&e.socket.setTimeout(n.timeout)},XHeaders:function(e,t,n){if(n.xfwd){var i=e.isSpdy||tp.hasEncryptedConnection(e),s={for:e.connection.remoteAddress||e.socket.remoteAddress,port:tp.getPort(e),proto:i?"https":"http"};["for","port","proto"].forEach(function(o){e.headers["x-forwarded-"+o]=(e.headers["x-forwarded-"+o]||"")+(e.headers["x-forwarded-"+o]?",":"")+s[o]}),e.headers["x-forwarded-host"]=e.headers["x-forwarded-host"]||e.headers.host||""}},stream:function(e,t,n,i,s,o){s.emit("start",e,t,n.target||n.forward);var a=n.followRedirects?u4:p4,c=a.http,u=a.https;if(n.forward){var p=(n.forward.protocol==="https:"?u:c).request(tp.setupOutgoing(n.ssl||{},n,e,"forward")),f=_(p,n.forward);if(e.on("error",f),p.on("error",f),(n.buffer||e).pipe(p),!n.target)return t.end()}var m=(n.target.protocol==="https:"?u:c).request(tp.setupOutgoing(n.ssl||{},n,e));m.on("socket",function(S){s&&!m.getHeader("expect")&&s.emit("proxyReq",m,e,t,n)}),n.proxyTimeout&&m.setTimeout(n.proxyTimeout,function(){m.abort()}),e.on("aborted",function(){m.abort()});var y=_(m,n.target);e.on("error",y),m.on("error",y);function _(S,A){return function(L){if(e.socket.destroyed&&L.code==="ECONNRESET")return s.emit("econnreset",L,e,t,A),S.abort();o?o(L,e,t,A):s.emit("error",L,e,t,A)}}(n.buffer||e).pipe(m),m.on("response",function(S){if(s&&s.emit("proxyRes",S,e,t),!t.headersSent&&!n.selfHandleResponse)for(var A=0;A<Da.length&&!Da[A](e,t,S,n);A++);t.finished?s&&s.emit("end",e,t,S):(S.on("end",function(){s&&s.emit("end",e,t,S)}),n.selfHandleResponse||S.pipe(t))})}}});var kk=O((aK,Rk)=>{var f4=require("http"),d4=require("https"),no=ep();Rk.exports={checkMethodAndHeader:function(e,t){if(e.method!=="GET"||!e.headers.upgrade||e.headers.upgrade.toLowerCase()!=="websocket")return t.destroy(),!0},XHeaders:function(e,t,n){if(n.xfwd){var i={for:e.connection.remoteAddress||e.socket.remoteAddress,port:no.getPort(e),proto:no.hasEncryptedConnection(e)?"wss":"ws"};["for","port","proto"].forEach(function(s){e.headers["x-forwarded-"+s]=(e.headers["x-forwarded-"+s]||"")+(e.headers["x-forwarded-"+s]?",":"")+i[s]})}},stream:function(e,t,n,i,s,o){var a=function(p,f){return Object.keys(f).reduce(function(m,y){var _=f[y];if(!Array.isArray(_))return m.push(y+": "+_),m;for(var S=0;S<_.length;S++)m.push(y+": "+_[S]);return m},[p]).join(`\r
97
+ `);if(h===-1){xu("have not received end of HTTP headers yet..."),i();return}let x=f.slice(0,h).toString("ascii").split(`\r
98
+ `),_=x.shift();if(!_)return r.destroy(),t(new Error("No header received from proxy CONNECT response"));let S=_.split(" "),A=+S[1],M=S.slice(2).join(" "),N={};for(let L of x){if(!L)continue;let j=L.indexOf(":");if(j===-1)return r.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${L}"`));let W=L.slice(0,j).toLowerCase(),q=L.slice(j+1).trimStart(),G=N[W];typeof G=="string"?N[W]=[G,q]:Array.isArray(G)?G.push(q):N[W]=q}xu("got proxy server response: %o %o",_,N),o(),e({connect:{statusCode:A,statusText:M,headers:N},buffered:f})}r.on("error",c),r.on("end",a),i()})}Vi.parseProxyResponse=dH});var TT=O(xr=>{"use strict";var hH=xr&&xr.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),mH=xr&&xr.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),ST=xr&&xr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&hH(e,r,t);return mH(e,r),e},ET=xr&&xr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xr,"__esModule",{value:!0});xr.HttpsProxyAgent=void 0;var _u=ST(require("net")),_T=ST(require("tls")),gH=ET(require("assert")),vH=ET(ke()),yH=yT(),xH=require("url"),_H=xT(),ca=(0,vH.default)("https-proxy-agent"),bT=r=>r.servername===void 0&&r.host&&!_u.isIP(r.host)?{...r,servername:r.host}:r,bu=class extends yH.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new xH.URL(e):e,this.proxyHeaders=t?.headers??{},ca("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),s=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?wT(t,"headers"):null,host:n,port:s}}async connect(e,t){let{proxy:n}=this;if(!t.host)throw new TypeError('No "host" provided');let s;n.protocol==="https:"?(ca("Creating `tls.Socket`: %o",this.connectOpts),s=_T.connect(bT(this.connectOpts))):(ca("Creating `net.Socket`: %o",this.connectOpts),s=_u.connect(this.connectOpts));let i=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=_u.isIPv6(t.host)?`[${t.host}]`:t.host,a=`CONNECT ${o}:${t.port} HTTP/1.1\r
99
+ `;if(n.username||n.password){let h=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;i["Proxy-Authorization"]=`Basic ${Buffer.from(h).toString("base64")}`}i.Host=`${o}:${t.port}`,i["Proxy-Connection"]||(i["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let h of Object.keys(i))a+=`${h}: ${i[h]}\r
100
+ `;let c=(0,_H.parseProxyResponse)(s);s.write(`${a}\r
101
+ `);let{connect:l,buffered:p}=await c;if(e.emit("proxyConnect",l),this.emit("proxyConnect",l,e),l.statusCode===200)return e.once("socket",bH),t.secureEndpoint?(ca("Upgrading socket connection to TLS"),_T.connect({...wT(bT(t),"host","path","port"),socket:s})):s;s.destroy();let f=new _u.Socket({writable:!1});return f.readable=!0,e.once("socket",h=>{ca("Replaying proxy buffer for failed request"),(0,gH.default)(h.listenerCount("data")>0),h.push(p),h.push(null)}),f}};bu.protocols=["http","https"];xr.HttpsProxyAgent=bu;function bH(r){r.resume()}function wT(r,...e){let t={},n;for(n in r)e.includes(n)||(t[n]=r[n]);return t}});var OT=O((eV,kT)=>{"use strict";var AT=require("url"),RT=require("https"),wH=Am(),wu=Sm(),SH=Cm(),rr=mu(),EH=bm(),CT=2419200,km="",Om;function la(){}la.prototype.setGCMAPIKey=function(r){if(r===null){km=null;return}if(typeof r>"u"||typeof r!="string"||r.length===0)throw new Error("The GCM API Key should be a non-empty string or null.");km=r};la.prototype.setVapidDetails=function(r,e,t){if(arguments.length===1&&arguments[0]===null){Om=null;return}wu.validateSubject(r),wu.validatePublicKey(e),wu.validatePrivateKey(t),Om={subject:r,publicKey:e,privateKey:t}};la.prototype.generateRequestDetails=function(r,e,t){if(!r||!r.endpoint)throw new Error("You must pass in a subscription with at least an endpoint.");if(typeof r.endpoint!="string"||r.endpoint.length===0)throw new Error("The subscription endpoint must be a string with a valid URL.");if(e&&(typeof r!="object"||!r.keys||!r.keys.p256dh||!r.keys.auth))throw new Error("To send a message with a payload, the subscription must have 'auth' and 'p256dh' keys.");let n=km,s=Om,i=CT,o={},a=rr.supportedContentEncodings.AES_128_GCM,c=rr.supportedUrgency.NORMAL,l,p,f,h;if(t){let M=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],N=Object.keys(t);for(let L=0;L<N.length;L+=1){let j=N[L];if(!M.includes(j))throw new Error("'"+j+"' is an invalid option. The valid options are ['"+M.join("', '")+"'].")}if(t.headers){o=t.headers;let L=Object.keys(o).filter(function(j){return typeof t[j]<"u"});if(L.length>0)throw new Error("Duplicated headers defined ["+L.join(",")+"]. Please either define the header in thetop level options OR in the 'headers' key.")}if(t.gcmAPIKey&&(n=t.gcmAPIKey),t.vapidDetails!==void 0&&(s=t.vapidDetails),t.TTL!==void 0&&(i=Number(t.TTL),i<0))throw new Error("TTL should be a number and should be at least 0");if(t.contentEncoding)if(t.contentEncoding===rr.supportedContentEncodings.AES_128_GCM||t.contentEncoding===rr.supportedContentEncodings.AES_GCM)a=t.contentEncoding;else throw new Error("Unsupported content encoding specified.");if(t.urgency)if(t.urgency===rr.supportedUrgency.VERY_LOW||t.urgency===rr.supportedUrgency.LOW||t.urgency===rr.supportedUrgency.NORMAL||t.urgency===rr.supportedUrgency.HIGH)c=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!EH.validate(t.topic))throw new Error("Unsupported characters set use the URL or filename-safe Base64 characters set");if(t.topic.length>32)throw new Error("use maximum of 32 characters from the URL or filename-safe Base64 characters set");l=t.topic}t.proxy&&(typeof t.proxy=="string"||typeof t.proxy.host=="string"?p=t.proxy:console.warn("Attempt to use proxy option, but invalid type it should be a string or proxy options object.")),t.agent&&(t.agent instanceof RT.Agent?(p&&console.warn("Agent option will be ignored because proxy option is defined."),f=t.agent):console.warn("Wrong type for the agent option, it should be an instance of https.Agent.")),typeof t.timeout=="number"&&(h=t.timeout)}typeof i>"u"&&(i=CT);let x={method:"POST",headers:{TTL:i}};Object.keys(o).forEach(function(M){x.headers[M]=o[M]});let _=null;if(e){let M=SH.encrypt(r.keys.p256dh,r.keys.auth,e,a);x.headers["Content-Length"]=M.cipherText.length,x.headers["Content-Type"]="application/octet-stream",a===rr.supportedContentEncodings.AES_128_GCM?x.headers["Content-Encoding"]=rr.supportedContentEncodings.AES_128_GCM:a===rr.supportedContentEncodings.AES_GCM&&(x.headers["Content-Encoding"]=rr.supportedContentEncodings.AES_GCM,x.headers.Encryption="salt="+M.salt,x.headers["Crypto-Key"]="dh="+M.localPublicKey.toString("base64url")),_=M.cipherText}else x.headers["Content-Length"]=0;let S=r.endpoint.startsWith("https://android.googleapis.com/gcm/send"),A=r.endpoint.startsWith("https://fcm.googleapis.com/fcm/send");if(S)n?x.headers.Authorization="key="+n:console.warn("Attempt to send push notification to GCM endpoint, but no GCM key is defined. Please use setGCMApiKey() or add 'gcmAPIKey' as an option.");else if(s){let M=AT.parse(r.endpoint),N=M.protocol+"//"+M.host,L=wu.getVapidHeaders(N,s.subject,s.publicKey,s.privateKey,a);x.headers.Authorization=L.Authorization,a===rr.supportedContentEncodings.AES_GCM&&(x.headers["Crypto-Key"]?x.headers["Crypto-Key"]+=";"+L["Crypto-Key"]:x.headers["Crypto-Key"]=L["Crypto-Key"])}else A&&n&&(x.headers.Authorization="key="+n);return x.headers.Urgency=c,l&&(x.headers.Topic=l),x.body=_,x.endpoint=r.endpoint,p&&(x.proxy=p),f&&(x.agent=f),h&&(x.timeout=h),x};la.prototype.sendNotification=function(r,e,t){let n;try{n=this.generateRequestDetails(r,e,t)}catch(s){return Promise.reject(s)}return new Promise(function(s,i){let o={},a=AT.parse(n.endpoint);if(o.hostname=a.hostname,o.port=a.port,o.path=a.path,o.headers=n.headers,o.method=n.method,n.timeout&&(o.timeout=n.timeout),n.agent&&(o.agent=n.agent),n.proxy){let{HttpsProxyAgent:l}=TT();o.agent=new l(n.proxy)}let c=RT.request(o,function(l){let p="";l.on("data",function(f){p+=f}),l.on("end",function(){l.statusCode<200||l.statusCode>299?i(new wH("Received unexpected response code",l.statusCode,l.headers,p,n.endpoint)):s({statusCode:l.statusCode,body:p,headers:l.headers})})});n.timeout&&c.on("timeout",function(){c.destroy(new Error("Socket timeout"))}),c.on("error",function(l){i(l)}),n.body&&c.write(n.body),c.end()})};kT.exports=la});var IT=O((tV,PT)=>{"use strict";var MT=Sm(),TH=Cm(),CH=OT(),AH=Am(),RH=mu(),ua=new CH;PT.exports={WebPushError:AH,supportedContentEncodings:RH.supportedContentEncodings,encrypt:TH.encrypt,getVapidHeaders:MT.getVapidHeaders,generateVAPIDKeys:MT.generateVAPIDKeys,setGCMAPIKey:ua.setGCMAPIKey,setVapidDetails:ua.setVapidDetails,generateRequestDetails:ua.generateRequestDetails,sendNotification:ua.sendNotification.bind(ua)}});var ma=O((PV,_C)=>{"use strict";var _3=require("path"),Qr="\\\\/",gC=`[^${Qr}]`,b3=0,Tn="\\.",w3="\\+",S3="\\?",ku="\\/",E3="(?=.)",vC="[^/]",Lm=`(?:${ku}|$)`,yC=`(?:^|${ku})`,Dm=`${Tn}{1,2}${Lm}`,T3=`(?!${Tn})`,C3=`(?!${yC}${Dm})`,A3=`(?!${Tn}{0,1}${Lm})`,R3=`(?!${Dm})`,k3=`[^.${ku}]`,O3=`${vC}*?`,xC={DOT_LITERAL:Tn,PLUS_LITERAL:w3,QMARK_LITERAL:S3,SLASH_LITERAL:ku,ONE_CHAR:E3,QMARK:vC,END_ANCHOR:Lm,DOTS_SLASH:Dm,NO_DOT:T3,NO_DOTS:C3,NO_DOT_SLASH:A3,NO_DOTS_SLASH:R3,QMARK_NO_DOT:k3,STAR:O3,START_ANCHOR:yC},M3={...xC,SLASH_LITERAL:`[${Qr}]`,QMARK:gC,STAR:`${gC}*?`,DOTS_SLASH:`${Tn}{1,2}(?:[${Qr}]|$)`,NO_DOT:`(?!${Tn})`,NO_DOTS:`(?!(?:^|[${Qr}])${Tn}{1,2}(?:[${Qr}]|$))`,NO_DOT_SLASH:`(?!${Tn}{0,1}(?:[${Qr}]|$))`,NO_DOTS_SLASH:`(?!${Tn}{1,2}(?:[${Qr}]|$))`,QMARK_NO_DOT:`[^.${Qr}]`,START_ANCHOR:`(?:^|[${Qr}])`,END_ANCHOR:`(?:[${Qr}]|$)`},P3={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};_C.exports={DEFAULT_MAX_EXTGLOB_RECURSION:b3,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:P3,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:_3.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?M3:xC}}});var Ou=O(Gt=>{"use strict";var I3=require("path"),N3=process.platform==="win32",{REGEX_BACKSLASH:L3,REGEX_REMOVE_BACKSLASH:D3,REGEX_SPECIAL_CHARS:B3,REGEX_SPECIAL_CHARS_GLOBAL:j3}=ma();Gt.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);Gt.hasRegexChars=r=>B3.test(r);Gt.isRegexChar=r=>r.length===1&&Gt.hasRegexChars(r);Gt.escapeRegex=r=>r.replace(j3,"\\$1");Gt.toPosixSlashes=r=>r.replace(L3,"/");Gt.removeBackslashes=r=>r.replace(D3,e=>e==="\\"?"":e);Gt.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};Gt.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:N3===!0||I3.sep==="\\";Gt.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?Gt.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};Gt.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};Gt.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",s=t.contains?"":"$",i=`${n}(?:${r})${s}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var RC=O((NV,AC)=>{"use strict";var bC=Ou(),{CHAR_ASTERISK:Bm,CHAR_AT:F3,CHAR_BACKWARD_SLASH:ga,CHAR_COMMA:H3,CHAR_DOT:jm,CHAR_EXCLAMATION_MARK:Fm,CHAR_FORWARD_SLASH:CC,CHAR_LEFT_CURLY_BRACE:Hm,CHAR_LEFT_PARENTHESES:$m,CHAR_LEFT_SQUARE_BRACKET:$3,CHAR_PLUS:U3,CHAR_QUESTION_MARK:wC,CHAR_RIGHT_CURLY_BRACE:q3,CHAR_RIGHT_PARENTHESES:SC,CHAR_RIGHT_SQUARE_BRACKET:W3}=ma(),EC=r=>r===CC||r===ga,TC=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},G3=(r,e)=>{let t=e||{},n=r.length-1,s=t.parts===!0||t.scanToEnd===!0,i=[],o=[],a=[],c=r,l=-1,p=0,f=0,h=!1,x=!1,_=!1,S=!1,A=!1,M=!1,N=!1,L=!1,j=!1,W=!1,q=0,G,P,H={value:"",depth:0,isGlob:!1},T=()=>l>=n,u=()=>c.charCodeAt(l+1),m=()=>(G=P,c.charCodeAt(++l));for(;l<n;){P=m();let C;if(P===ga){N=H.backslashes=!0,P=m(),P===Hm&&(M=!0);continue}if(M===!0||P===Hm){for(q++;T()!==!0&&(P=m());){if(P===ga){N=H.backslashes=!0,m();continue}if(P===Hm){q++;continue}if(M!==!0&&P===jm&&(P=m())===jm){if(h=H.isBrace=!0,_=H.isGlob=!0,W=!0,s===!0)continue;break}if(M!==!0&&P===H3){if(h=H.isBrace=!0,_=H.isGlob=!0,W=!0,s===!0)continue;break}if(P===q3&&(q--,q===0)){M=!1,h=H.isBrace=!0,W=!0;break}}if(s===!0)continue;break}if(P===CC){if(i.push(l),o.push(H),H={value:"",depth:0,isGlob:!1},W===!0)continue;if(G===jm&&l===p+1){p+=2;continue}f=l+1;continue}if(t.noext!==!0&&(P===U3||P===F3||P===Bm||P===wC||P===Fm)===!0&&u()===$m){if(_=H.isGlob=!0,S=H.isExtglob=!0,W=!0,P===Fm&&l===p&&(j=!0),s===!0){for(;T()!==!0&&(P=m());){if(P===ga){N=H.backslashes=!0,P=m();continue}if(P===SC){_=H.isGlob=!0,W=!0;break}}continue}break}if(P===Bm){if(G===Bm&&(A=H.isGlobstar=!0),_=H.isGlob=!0,W=!0,s===!0)continue;break}if(P===wC){if(_=H.isGlob=!0,W=!0,s===!0)continue;break}if(P===$3){for(;T()!==!0&&(C=m());){if(C===ga){N=H.backslashes=!0,m();continue}if(C===W3){x=H.isBracket=!0,_=H.isGlob=!0,W=!0;break}}if(s===!0)continue;break}if(t.nonegate!==!0&&P===Fm&&l===p){L=H.negated=!0,p++;continue}if(t.noparen!==!0&&P===$m){if(_=H.isGlob=!0,s===!0){for(;T()!==!0&&(P=m());){if(P===$m){N=H.backslashes=!0,P=m();continue}if(P===SC){W=!0;break}}continue}break}if(_===!0){if(W=!0,s===!0)continue;break}}t.noext===!0&&(S=!1,_=!1);let y=c,w="",g="";p>0&&(w=c.slice(0,p),c=c.slice(p),f-=p),y&&_===!0&&f>0?(y=c.slice(0,f),g=c.slice(f)):_===!0?(y="",g=c):y=c,y&&y!==""&&y!=="/"&&y!==c&&EC(y.charCodeAt(y.length-1))&&(y=y.slice(0,-1)),t.unescape===!0&&(g&&(g=bC.removeBackslashes(g)),y&&N===!0&&(y=bC.removeBackslashes(y)));let v={prefix:w,input:r,start:p,base:y,glob:g,isBrace:h,isBracket:x,isGlob:_,isExtglob:S,isGlobstar:A,negated:L,negatedExtglob:j};if(t.tokens===!0&&(v.maxDepth=0,EC(P)||o.push(H),v.tokens=o),t.parts===!0||t.tokens===!0){let C;for(let b=0;b<i.length;b++){let d=C?C+1:p,E=i[b],U=r.slice(d,E);t.tokens&&(b===0&&p!==0?(o[b].isPrefix=!0,o[b].value=w):o[b].value=U,TC(o[b]),v.maxDepth+=o[b].depth),(b!==0||U!=="")&&a.push(U),C=E}if(C&&C+1<r.length){let b=r.slice(C+1);a.push(b),t.tokens&&(o[o.length-1].value=b,TC(o[o.length-1]),v.maxDepth+=o[o.length-1].depth)}v.slashes=i,v.parts=a}return v};AC.exports=G3});var IC=O((LV,PC)=>{"use strict";var va=ma(),At=Ou(),{MAX_LENGTH:Mu,POSIX_REGEX_SOURCE:z3,REGEX_NON_SPECIAL_CHARS:V3,REGEX_SPECIAL_CHARS_BACKREF:K3,REPLACEMENTS:kC}=va,Y3=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch{return r.map(s=>At.escapeRegex(s)).join("..")}return t},Yi=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,OC=r=>{let e=[],t=0,n=0,s=0,i="",o=!1;for(let a of r){if(o===!0){i+=a,o=!1;continue}if(a==="\\"){i+=a,o=!0;continue}if(a==='"'){s=s===1?0:1,i+=a;continue}if(s===0){if(a==="[")t++;else if(a==="]"&&t>0)t--;else if(t===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(i),i="";continue}}}i+=a}return e.push(i),e},X3=r=>{let e=!1;for(let t of r){if(e===!0){e=!1;continue}if(t==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(t))return!1}return!0},MC=r=>{let e=r.trim(),t=!0;for(;t===!0;)t=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),t=!0);if(X3(e))return e.replace(/\\(.)/g,"$1")},J3=r=>{let e=r.map(MC).filter(Boolean);for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let s=e[t],i=e[n],o=s[0];if(!(!o||s!==o.repeat(s.length)||i!==o.repeat(i.length))&&(s===i||s.startsWith(i)||i.startsWith(s)))return!0}return!1},Um=(r,e=!0)=>{if(r[0]!=="+"&&r[0]!=="*"||r[1]!=="(")return;let t=0,n=0,s=0,i=!1;for(let o=1;o<r.length;o++){let a=r[o];if(i===!0){i=!1;continue}if(a==="\\"){i=!0;continue}if(a==='"'){s=s===1?0:1;continue}if(s!==1){if(a==="["){t++;continue}if(a==="]"&&t>0){t--;continue}if(!(t>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&o!==r.length-1?void 0:{type:r[0],body:r.slice(2,o),end:o}}}}},Q3=r=>{let e=0,t=[];for(;e<r.length;){let s=Um(r.slice(e),!1);if(!s||s.type!=="*")return;let i=OC(s.body).map(a=>a.trim());if(i.length!==1)return;let o=MC(i[0]);if(!o||o.length!==1)return;t.push(o),e+=s.end+1}return t.length<1?void 0:`${t.length===1?At.escapeRegex(t[0]):`[${t.map(s=>At.escapeRegex(s)).join("")}]`}*`},Z3=r=>{let e=0,t=r.trim(),n=Um(t);for(;n;)e++,t=n.body.trim(),n=Um(t);return e},e$=(r,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let t=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:va.DEFAULT_MAX_EXTGLOB_RECURSION,n=OC(r).map(s=>s.trim());if(n.length>1&&(n.some(s=>s==="")||n.some(s=>/^[*?]+$/.test(s))||J3(n)))return{risky:!0};for(let s of n){let i=Q3(s);if(i)return{risky:!0,safeOutput:i};if(Z3(s)>t)return{risky:!0}}return{risky:!1}},qm=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=kC[r]||r;let t={...e},n=typeof t.maxLength=="number"?Math.min(Mu,t.maxLength):Mu,s=r.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:t.prepend||""},o=[i],a=t.capture?"":"?:",c=At.isWindows(e),l=va.globChars(c),p=va.extglobChars(l),{DOT_LITERAL:f,PLUS_LITERAL:h,SLASH_LITERAL:x,ONE_CHAR:_,DOTS_SLASH:S,NO_DOT:A,NO_DOT_SLASH:M,NO_DOTS_SLASH:N,QMARK:L,QMARK_NO_DOT:j,STAR:W,START_ANCHOR:q}=l,G=R=>`(${a}(?:(?!${q}${R.dot?S:f}).)*?)`,P=t.dot?"":A,H=t.dot?L:j,T=t.bash===!0?G(t):W;t.capture&&(T=`(${T})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let u={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};r=At.removePrefix(r,u),s=r.length;let m=[],y=[],w=[],g=i,v,C=()=>u.index===s-1,b=u.peek=(R=1)=>r[u.index+R],d=u.advance=()=>r[++u.index]||"",E=()=>r.slice(u.index+1),U=(R="",X=0)=>{u.consumed+=R,u.index+=X},I=R=>{u.output+=R.output!=null?R.output:R.value,U(R.value)},D=()=>{let R=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)d(),u.start++,R++;return R%2===0?!1:(u.negated=!0,u.start++,!0)},$=R=>{u[R]++,w.push(R)},V=R=>{u[R]--,w.pop()},B=R=>{if(g.type==="globstar"){let X=u.braces>0&&(R.type==="comma"||R.type==="brace"),k=R.extglob===!0||m.length&&(R.type==="pipe"||R.type==="paren");R.type!=="slash"&&R.type!=="paren"&&!X&&!k&&(u.output=u.output.slice(0,-g.output.length),g.type="star",g.value="*",g.output=T,u.output+=g.output)}if(m.length&&R.type!=="paren"&&(m[m.length-1].inner+=R.value),(R.value||R.output)&&I(R),g&&g.type==="text"&&R.type==="text"){g.value+=R.value,g.output=(g.output||"")+R.value;return}R.prev=g,o.push(R),g=R},ge=(R,X)=>{let k={...p[X],conditions:1,inner:""};k.prev=g,k.parens=u.parens,k.output=u.output,k.startIndex=u.index,k.tokensIndex=o.length;let F=(t.capture?"(":"")+k.open;$("parens"),B({type:R,value:X,output:u.output?"":_}),B({type:"paren",extglob:!0,value:d(),output:F}),m.push(k)},se=R=>{let X=r.slice(R.startIndex,u.index+1),k=r.slice(R.startIndex+2,u.index),F=e$(k,t);if((R.type==="plus"||R.type==="star")&&F.risky){let z=F.safeOutput?(R.output?"":_)+(t.capture?`(${F.safeOutput})`:F.safeOutput):void 0,ve=o[R.tokensIndex];ve.type="text",ve.value=X,ve.output=z||At.escapeRegex(X);for(let re=R.tokensIndex+1;re<o.length;re++)o[re].value="",o[re].output="",delete o[re].suffix;u.output=R.output+ve.output,u.backtrack=!0,B({type:"paren",extglob:!0,value:v,output:""}),V("parens");return}let Q=R.close+(t.capture?")":""),K;if(R.type==="negate"){let z=T;if(R.inner&&R.inner.length>1&&R.inner.includes("/")&&(z=G(t)),(z!==T||C()||/^\)+$/.test(E()))&&(Q=R.close=`)$))${z}`),R.inner.includes("*")&&(K=E())&&/^\.[^\\/.]+$/.test(K)){let ve=qm(K,{...e,fastpaths:!1}).output;Q=R.close=`)${ve})${z})`}R.prev.type==="bos"&&(u.negatedExtglob=!0)}B({type:"paren",extglob:!0,value:v,output:Q}),V("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let R=!1,X=r.replace(K3,(k,F,Q,K,z,ve)=>K==="\\"?(R=!0,k):K==="?"?F?F+K+(z?L.repeat(z.length):""):ve===0?H+(z?L.repeat(z.length):""):L.repeat(Q.length):K==="."?f.repeat(Q.length):K==="*"?F?F+K+(z?T:""):T:F?k:`\\${k}`);return R===!0&&(t.unescape===!0?X=X.replace(/\\/g,""):X=X.replace(/\\+/g,k=>k.length%2===0?"\\\\":k?"\\":"")),X===r&&t.contains===!0?(u.output=r,u):(u.output=At.wrapOutput(X,u,e),u)}for(;!C();){if(v=d(),v==="\0")continue;if(v==="\\"){let k=b();if(k==="/"&&t.bash!==!0||k==="."||k===";")continue;if(!k){v+="\\",B({type:"text",value:v});continue}let F=/^\\+/.exec(E()),Q=0;if(F&&F[0].length>2&&(Q=F[0].length,u.index+=Q,Q%2!==0&&(v+="\\")),t.unescape===!0?v=d():v+=d(),u.brackets===0){B({type:"text",value:v});continue}}if(u.brackets>0&&(v!=="]"||g.value==="["||g.value==="[^")){if(t.posix!==!1&&v===":"){let k=g.value.slice(1);if(k.includes("[")&&(g.posix=!0,k.includes(":"))){let F=g.value.lastIndexOf("["),Q=g.value.slice(0,F),K=g.value.slice(F+2),z=z3[K];if(z){g.value=Q+z,u.backtrack=!0,d(),!i.output&&o.indexOf(g)===1&&(i.output=_);continue}}}(v==="["&&b()!==":"||v==="-"&&b()==="]")&&(v=`\\${v}`),v==="]"&&(g.value==="["||g.value==="[^")&&(v=`\\${v}`),t.posix===!0&&v==="!"&&g.value==="["&&(v="^"),g.value+=v,I({value:v});continue}if(u.quotes===1&&v!=='"'){v=At.escapeRegex(v),g.value+=v,I({value:v});continue}if(v==='"'){u.quotes=u.quotes===1?0:1,t.keepQuotes===!0&&B({type:"text",value:v});continue}if(v==="("){$("parens"),B({type:"paren",value:v});continue}if(v===")"){if(u.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Yi("opening","("));let k=m[m.length-1];if(k&&u.parens===k.parens+1){se(m.pop());continue}B({type:"paren",value:v,output:u.parens?")":"\\)"}),V("parens");continue}if(v==="["){if(t.nobracket===!0||!E().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Yi("closing","]"));v=`\\${v}`}else $("brackets");B({type:"bracket",value:v});continue}if(v==="]"){if(t.nobracket===!0||g&&g.type==="bracket"&&g.value.length===1){B({type:"text",value:v,output:`\\${v}`});continue}if(u.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Yi("opening","["));B({type:"text",value:v,output:`\\${v}`});continue}V("brackets");let k=g.value.slice(1);if(g.posix!==!0&&k[0]==="^"&&!k.includes("/")&&(v=`/${v}`),g.value+=v,I({value:v}),t.literalBrackets===!1||At.hasRegexChars(k))continue;let F=At.escapeRegex(g.value);if(u.output=u.output.slice(0,-g.value.length),t.literalBrackets===!0){u.output+=F,g.value=F;continue}g.value=`(${a}${F}|${g.value})`,u.output+=g.value;continue}if(v==="{"&&t.nobrace!==!0){$("braces");let k={type:"brace",value:v,output:"(",outputIndex:u.output.length,tokensIndex:u.tokens.length};y.push(k),B(k);continue}if(v==="}"){let k=y[y.length-1];if(t.nobrace===!0||!k){B({type:"text",value:v,output:v});continue}let F=")";if(k.dots===!0){let Q=o.slice(),K=[];for(let z=Q.length-1;z>=0&&(o.pop(),Q[z].type!=="brace");z--)Q[z].type!=="dots"&&K.unshift(Q[z].value);F=Y3(K,t),u.backtrack=!0}if(k.comma!==!0&&k.dots!==!0){let Q=u.output.slice(0,k.outputIndex),K=u.tokens.slice(k.tokensIndex);k.value=k.output="\\{",v=F="\\}",u.output=Q;for(let z of K)u.output+=z.output||z.value}B({type:"brace",value:v,output:F}),V("braces"),y.pop();continue}if(v==="|"){m.length>0&&m[m.length-1].conditions++,B({type:"text",value:v});continue}if(v===","){let k=v,F=y[y.length-1];F&&w[w.length-1]==="braces"&&(F.comma=!0,k="|"),B({type:"comma",value:v,output:k});continue}if(v==="/"){if(g.type==="dot"&&u.index===u.start+1){u.start=u.index+1,u.consumed="",u.output="",o.pop(),g=i;continue}B({type:"slash",value:v,output:x});continue}if(v==="."){if(u.braces>0&&g.type==="dot"){g.value==="."&&(g.output=f);let k=y[y.length-1];g.type="dots",g.output+=v,g.value+=v,k.dots=!0;continue}if(u.braces+u.parens===0&&g.type!=="bos"&&g.type!=="slash"){B({type:"text",value:v,output:f});continue}B({type:"dot",value:v,output:f});continue}if(v==="?"){if(!(g&&g.value==="(")&&t.noextglob!==!0&&b()==="("&&b(2)!=="?"){ge("qmark",v);continue}if(g&&g.type==="paren"){let F=b(),Q=v;if(F==="<"&&!At.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(g.value==="("&&!/[!=<:]/.test(F)||F==="<"&&!/<([!=]|\w+>)/.test(E()))&&(Q=`\\${v}`),B({type:"text",value:v,output:Q});continue}if(t.dot!==!0&&(g.type==="slash"||g.type==="bos")){B({type:"qmark",value:v,output:j});continue}B({type:"qmark",value:v,output:L});continue}if(v==="!"){if(t.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){ge("negate",v);continue}if(t.nonegate!==!0&&u.index===0){D();continue}}if(v==="+"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){ge("plus",v);continue}if(g&&g.value==="("||t.regex===!1){B({type:"plus",value:v,output:h});continue}if(g&&(g.type==="bracket"||g.type==="paren"||g.type==="brace")||u.parens>0){B({type:"plus",value:v});continue}B({type:"plus",value:h});continue}if(v==="@"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){B({type:"at",extglob:!0,value:v,output:""});continue}B({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let k=V3.exec(E());k&&(v+=k[0],u.index+=k[0].length),B({type:"text",value:v});continue}if(g&&(g.type==="globstar"||g.star===!0)){g.type="star",g.star=!0,g.value+=v,g.output=T,u.backtrack=!0,u.globstar=!0,U(v);continue}let R=E();if(t.noextglob!==!0&&/^\([^?]/.test(R)){ge("star",v);continue}if(g.type==="star"){if(t.noglobstar===!0){U(v);continue}let k=g.prev,F=k.prev,Q=k.type==="slash"||k.type==="bos",K=F&&(F.type==="star"||F.type==="globstar");if(t.bash===!0&&(!Q||R[0]&&R[0]!=="/")){B({type:"star",value:v,output:""});continue}let z=u.braces>0&&(k.type==="comma"||k.type==="brace"),ve=m.length&&(k.type==="pipe"||k.type==="paren");if(!Q&&k.type!=="paren"&&!z&&!ve){B({type:"star",value:v,output:""});continue}for(;R.slice(0,3)==="/**";){let re=r[u.index+4];if(re&&re!=="/")break;R=R.slice(3),U("/**",3)}if(k.type==="bos"&&C()){g.type="globstar",g.value+=v,g.output=G(t),u.output=g.output,u.globstar=!0,U(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&!K&&C()){u.output=u.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=G(t)+(t.strictSlashes?")":"|$)"),g.value+=v,u.globstar=!0,u.output+=k.output+g.output,U(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&R[0]==="/"){let re=R[1]!==void 0?"|$":"";u.output=u.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=`${G(t)}${x}|${x}${re})`,g.value+=v,u.output+=k.output+g.output,u.globstar=!0,U(v+d()),B({type:"slash",value:"/",output:""});continue}if(k.type==="bos"&&R[0]==="/"){g.type="globstar",g.value+=v,g.output=`(?:^|${x}|${G(t)}${x})`,u.output=g.output,u.globstar=!0,U(v+d()),B({type:"slash",value:"/",output:""});continue}u.output=u.output.slice(0,-g.output.length),g.type="globstar",g.output=G(t),g.value+=v,u.output+=g.output,u.globstar=!0,U(v);continue}let X={type:"star",value:v,output:T};if(t.bash===!0){X.output=".*?",(g.type==="bos"||g.type==="slash")&&(X.output=P+X.output),B(X);continue}if(g&&(g.type==="bracket"||g.type==="paren")&&t.regex===!0){X.output=v,B(X);continue}(u.index===u.start||g.type==="slash"||g.type==="dot")&&(g.type==="dot"?(u.output+=M,g.output+=M):t.dot===!0?(u.output+=N,g.output+=N):(u.output+=P,g.output+=P),b()!=="*"&&(u.output+=_,g.output+=_)),B(X)}for(;u.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Yi("closing","]"));u.output=At.escapeLast(u.output,"["),V("brackets")}for(;u.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Yi("closing",")"));u.output=At.escapeLast(u.output,"("),V("parens")}for(;u.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Yi("closing","}"));u.output=At.escapeLast(u.output,"{"),V("braces")}if(t.strictSlashes!==!0&&(g.type==="star"||g.type==="bracket")&&B({type:"maybe_slash",value:"",output:`${x}?`}),u.backtrack===!0){u.output="";for(let R of u.tokens)u.output+=R.output!=null?R.output:R.value,R.suffix&&(u.output+=R.suffix)}return u};qm.fastpaths=(r,e)=>{let t={...e},n=typeof t.maxLength=="number"?Math.min(Mu,t.maxLength):Mu,s=r.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);r=kC[r]||r;let i=At.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:p,NO_DOTS:f,NO_DOTS_SLASH:h,STAR:x,START_ANCHOR:_}=va.globChars(i),S=t.dot?f:p,A=t.dot?h:p,M=t.capture?"":"?:",N={negated:!1,prefix:""},L=t.bash===!0?".*?":x;t.capture&&(L=`(${L})`);let j=P=>P.noglobstar===!0?L:`(${M}(?:(?!${_}${P.dot?l:o}).)*?)`,W=P=>{switch(P){case"*":return`${S}${c}${L}`;case".*":return`${o}${c}${L}`;case"*.*":return`${S}${L}${o}${c}${L}`;case"*/*":return`${S}${L}${a}${c}${A}${L}`;case"**":return S+j(t);case"**/*":return`(?:${S}${j(t)}${a})?${A}${c}${L}`;case"**/*.*":return`(?:${S}${j(t)}${a})?${A}${L}${o}${c}${L}`;case"**/.*":return`(?:${S}${j(t)}${a})?${o}${c}${L}`;default:{let H=/^(.*?)\.(\w+)$/.exec(P);if(!H)return;let T=W(H[1]);return T?T+o+H[2]:void 0}}},q=At.removePrefix(r,N),G=W(q);return G&&t.strictSlashes!==!0&&(G+=`${a}?`),G};PC.exports=qm});var LC=O((DV,NC)=>{"use strict";var t$=require("path"),r$=RC(),Wm=IC(),Gm=Ou(),n$=ma(),s$=r=>r&&typeof r=="object"&&!Array.isArray(r),Ie=(r,e,t=!1)=>{if(Array.isArray(r)){let p=r.map(h=>Ie(h,e,t));return h=>{for(let x of p){let _=x(h);if(_)return _}return!1}}let n=s$(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let s=e||{},i=Gm.isWindows(e),o=n?Ie.compileRe(r,e):Ie.makeRe(r,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(s.ignore){let p={...e,ignore:null,onMatch:null,onResult:null};c=Ie(s.ignore,p,t)}let l=(p,f=!1)=>{let{isMatch:h,match:x,output:_}=Ie.test(p,o,e,{glob:r,posix:i}),S={glob:r,state:a,regex:o,posix:i,input:p,output:_,match:x,isMatch:h};return typeof s.onResult=="function"&&s.onResult(S),h===!1?(S.isMatch=!1,f?S:!1):c(p)?(typeof s.onIgnore=="function"&&s.onIgnore(S),S.isMatch=!1,f?S:!1):(typeof s.onMatch=="function"&&s.onMatch(S),f?S:!0)};return t&&(l.state=a),l};Ie.test=(r,e,t,{glob:n,posix:s}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};let i=t||{},o=i.format||(s?Gm.toPosixSlashes:null),a=r===n,c=a&&o?o(r):r;return a===!1&&(c=o?o(r):r,a=c===n),(a===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?a=Ie.matchBase(r,e,t,s):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Ie.matchBase=(r,e,t,n=Gm.isWindows(t))=>(e instanceof RegExp?e:Ie.makeRe(e,t)).test(t$.basename(r));Ie.isMatch=(r,e,t)=>Ie(e,t)(r);Ie.parse=(r,e)=>Array.isArray(r)?r.map(t=>Ie.parse(t,e)):Wm(r,{...e,fastpaths:!1});Ie.scan=(r,e)=>r$(r,e);Ie.compileRe=(r,e,t=!1,n=!1)=>{if(t===!0)return r.output;let s=e||{},i=s.contains?"":"^",o=s.contains?"":"$",a=`${i}(?:${r.output})${o}`;r&&r.negated===!0&&(a=`^(?!${a}).*$`);let c=Ie.toRegex(a,e);return n===!0&&(c.state=r),c};Ie.makeRe=(r,e={},t=!1,n=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(s.output=Wm.fastpaths(r,e)),s.output||(s=Wm(r,e)),Ie.compileRe(s,e,t,n)};Ie.toRegex=(r,e)=>{try{let t=e||{};return new RegExp(r,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};Ie.constants=n$;NC.exports=Ie});var BC=O((BV,DC)=>{"use strict";DC.exports=LC()});var GC=O((jV,WC)=>{"use strict";var xa=require("fs"),{Readable:i$}=require("stream"),ya=require("path"),{promisify:Lu}=require("util"),zm=BC(),o$=Lu(xa.readdir),a$=Lu(xa.stat),jC=Lu(xa.lstat),c$=Lu(xa.realpath),l$="!",UC="READDIRP_RECURSIVE_ERROR",u$=new Set(["ENOENT","EPERM","EACCES","ELOOP",UC]),Vm="files",qC="directories",Iu="files_directories",Pu="all",FC=[Vm,qC,Iu,Pu],p$=r=>u$.has(r.code),[HC,f$]=process.versions.node.split(".").slice(0,2).map(r=>Number.parseInt(r,10)),d$=process.platform==="win32"&&(HC>10||HC===10&&f$>=5),$C=r=>{if(r!==void 0){if(typeof r=="function")return r;if(typeof r=="string"){let e=zm(r.trim());return t=>e(t.basename)}if(Array.isArray(r)){let e=[],t=[];for(let n of r){let s=n.trim();s.charAt(0)===l$?t.push(zm(s.slice(1))):e.push(zm(s))}return t.length>0?e.length>0?n=>e.some(s=>s(n.basename))&&!t.some(s=>s(n.basename)):n=>!t.some(s=>s(n.basename)):n=>e.some(s=>s(n.basename))}}},Nu=class r extends i${static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Vm,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let t={...r.defaultOptions,...e},{root:n,type:s}=t;this._fileFilter=$C(t.fileFilter),this._directoryFilter=$C(t.directoryFilter);let i=t.lstat?jC:a$;d$?this._stat=o=>i(o,{bigint:!0}):this._stat=i,this._maxDepth=t.depth,this._wantsDir=[qC,Iu,Pu].includes(s),this._wantsFile=[Vm,Iu,Pu].includes(s),this._wantsEverything=s===Pu,this._root=ya.resolve(n),this._isDirent="Dirent"in xa&&!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:t,depth:n,files:s=[]}=this.parent||{};if(s.length>0){let i=s.splice(0,e).map(o=>this._formatEntry(o,t));for(let o of await Promise.all(i)){if(this.destroyed)return;let a=await this._getEntryType(o);a==="directory"&&this._directoryFilter(o)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(o.fullPath,n+1)),this._wantsDir&&(this.push(o),e--)):(a==="file"||this._includeAsFile(o))&&this._fileFilter(o)&&this._wantsFile&&(this.push(o),e--)}}else{let i=this.parents.pop();if(!i){this.push(null);break}if(this.parent=await i,this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await o$(e,this._rdOptions)}catch(s){this._onError(s)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let n;try{let s=this._isDirent?e.name:e,i=ya.resolve(ya.join(t,s));n={path:ya.relative(this._root,i),fullPath:i,basename:s},n[this._statsProp]=this._isDirent?e:await this._stat(i)}catch(s){this._onError(s)}return n}_onError(e){p$(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){let t=e&&e[this._statsProp];if(t){if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){let n=e.fullPath;try{let s=await c$(n),i=await jC(s);if(i.isFile())return"file";if(i.isDirectory()){let o=s.length;if(n.startsWith(s)&&n.substr(o,1)===ya.sep){let a=new Error(`Circular symlink detected: "${n}" points to "${s}"`);return a.code=UC,this._onError(a)}return"directory"}}catch(s){this._onError(s)}}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}},Xi=(r,e={})=>{let t=e.entryType||e.type;if(t==="both"&&(t=Iu),t&&(e.type=t),r){if(typeof r!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(t&&!FC.includes(t))throw new Error(`readdirp: Invalid type passed. Use one of ${FC.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=r,new Nu(e)},h$=(r,e={})=>new Promise((t,n)=>{let s=[];Xi(r,e).on("data",i=>s.push(i)).on("end",()=>t(s)).on("error",i=>n(i))});Xi.promise=h$;Xi.ReaddirpStream=Nu;Xi.default=Xi;WC.exports=Xi});var _a=O((FV,XC)=>{"use strict";var m$=require("path"),Zr="\\\\/",zC=`[^${Zr}]`,g$=0,Cn="\\.",v$="\\+",y$="\\?",Du="\\/",x$="(?=.)",VC="[^/]",Km=`(?:${Du}|$)`,KC=`(?:^|${Du})`,Ym=`${Cn}{1,2}${Km}`,_$=`(?!${Cn})`,b$=`(?!${KC}${Ym})`,w$=`(?!${Cn}{0,1}${Km})`,S$=`(?!${Ym})`,E$=`[^.${Du}]`,T$=`${VC}*?`,YC={DOT_LITERAL:Cn,PLUS_LITERAL:v$,QMARK_LITERAL:y$,SLASH_LITERAL:Du,ONE_CHAR:x$,QMARK:VC,END_ANCHOR:Km,DOTS_SLASH:Ym,NO_DOT:_$,NO_DOTS:b$,NO_DOT_SLASH:w$,NO_DOTS_SLASH:S$,QMARK_NO_DOT:E$,STAR:T$,START_ANCHOR:KC},C$={...YC,SLASH_LITERAL:`[${Zr}]`,QMARK:zC,STAR:`${zC}*?`,DOTS_SLASH:`${Cn}{1,2}(?:[${Zr}]|$)`,NO_DOT:`(?!${Cn})`,NO_DOTS:`(?!(?:^|[${Zr}])${Cn}{1,2}(?:[${Zr}]|$))`,NO_DOT_SLASH:`(?!${Cn}{0,1}(?:[${Zr}]|$))`,NO_DOTS_SLASH:`(?!${Cn}{1,2}(?:[${Zr}]|$))`,QMARK_NO_DOT:`[^.${Zr}]`,START_ANCHOR:`(?:^|[${Zr}])`,END_ANCHOR:`(?:[${Zr}]|$)`},A$={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};XC.exports={DEFAULT_MAX_EXTGLOB_RECURSION:g$,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:A$,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:m$.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?C$:YC}}});var Bu=O(zt=>{"use strict";var R$=require("path"),k$=process.platform==="win32",{REGEX_BACKSLASH:O$,REGEX_REMOVE_BACKSLASH:M$,REGEX_SPECIAL_CHARS:P$,REGEX_SPECIAL_CHARS_GLOBAL:I$}=_a();zt.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);zt.hasRegexChars=r=>P$.test(r);zt.isRegexChar=r=>r.length===1&&zt.hasRegexChars(r);zt.escapeRegex=r=>r.replace(I$,"\\$1");zt.toPosixSlashes=r=>r.replace(O$,"/");zt.removeBackslashes=r=>r.replace(M$,e=>e==="\\"?"":e);zt.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};zt.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:k$===!0||R$.sep==="\\";zt.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?zt.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};zt.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};zt.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",s=t.contains?"":"$",i=`${n}(?:${r})${s}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var sA=O(($V,nA)=>{"use strict";var JC=Bu(),{CHAR_ASTERISK:Xm,CHAR_AT:N$,CHAR_BACKWARD_SLASH:ba,CHAR_COMMA:L$,CHAR_DOT:Jm,CHAR_EXCLAMATION_MARK:Qm,CHAR_FORWARD_SLASH:rA,CHAR_LEFT_CURLY_BRACE:Zm,CHAR_LEFT_PARENTHESES:eg,CHAR_LEFT_SQUARE_BRACKET:D$,CHAR_PLUS:B$,CHAR_QUESTION_MARK:QC,CHAR_RIGHT_CURLY_BRACE:j$,CHAR_RIGHT_PARENTHESES:ZC,CHAR_RIGHT_SQUARE_BRACKET:F$}=_a(),eA=r=>r===rA||r===ba,tA=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},H$=(r,e)=>{let t=e||{},n=r.length-1,s=t.parts===!0||t.scanToEnd===!0,i=[],o=[],a=[],c=r,l=-1,p=0,f=0,h=!1,x=!1,_=!1,S=!1,A=!1,M=!1,N=!1,L=!1,j=!1,W=!1,q=0,G,P,H={value:"",depth:0,isGlob:!1},T=()=>l>=n,u=()=>c.charCodeAt(l+1),m=()=>(G=P,c.charCodeAt(++l));for(;l<n;){P=m();let C;if(P===ba){N=H.backslashes=!0,P=m(),P===Zm&&(M=!0);continue}if(M===!0||P===Zm){for(q++;T()!==!0&&(P=m());){if(P===ba){N=H.backslashes=!0,m();continue}if(P===Zm){q++;continue}if(M!==!0&&P===Jm&&(P=m())===Jm){if(h=H.isBrace=!0,_=H.isGlob=!0,W=!0,s===!0)continue;break}if(M!==!0&&P===L$){if(h=H.isBrace=!0,_=H.isGlob=!0,W=!0,s===!0)continue;break}if(P===j$&&(q--,q===0)){M=!1,h=H.isBrace=!0,W=!0;break}}if(s===!0)continue;break}if(P===rA){if(i.push(l),o.push(H),H={value:"",depth:0,isGlob:!1},W===!0)continue;if(G===Jm&&l===p+1){p+=2;continue}f=l+1;continue}if(t.noext!==!0&&(P===B$||P===N$||P===Xm||P===QC||P===Qm)===!0&&u()===eg){if(_=H.isGlob=!0,S=H.isExtglob=!0,W=!0,P===Qm&&l===p&&(j=!0),s===!0){for(;T()!==!0&&(P=m());){if(P===ba){N=H.backslashes=!0,P=m();continue}if(P===ZC){_=H.isGlob=!0,W=!0;break}}continue}break}if(P===Xm){if(G===Xm&&(A=H.isGlobstar=!0),_=H.isGlob=!0,W=!0,s===!0)continue;break}if(P===QC){if(_=H.isGlob=!0,W=!0,s===!0)continue;break}if(P===D$){for(;T()!==!0&&(C=m());){if(C===ba){N=H.backslashes=!0,m();continue}if(C===F$){x=H.isBracket=!0,_=H.isGlob=!0,W=!0;break}}if(s===!0)continue;break}if(t.nonegate!==!0&&P===Qm&&l===p){L=H.negated=!0,p++;continue}if(t.noparen!==!0&&P===eg){if(_=H.isGlob=!0,s===!0){for(;T()!==!0&&(P=m());){if(P===eg){N=H.backslashes=!0,P=m();continue}if(P===ZC){W=!0;break}}continue}break}if(_===!0){if(W=!0,s===!0)continue;break}}t.noext===!0&&(S=!1,_=!1);let y=c,w="",g="";p>0&&(w=c.slice(0,p),c=c.slice(p),f-=p),y&&_===!0&&f>0?(y=c.slice(0,f),g=c.slice(f)):_===!0?(y="",g=c):y=c,y&&y!==""&&y!=="/"&&y!==c&&eA(y.charCodeAt(y.length-1))&&(y=y.slice(0,-1)),t.unescape===!0&&(g&&(g=JC.removeBackslashes(g)),y&&N===!0&&(y=JC.removeBackslashes(y)));let v={prefix:w,input:r,start:p,base:y,glob:g,isBrace:h,isBracket:x,isGlob:_,isExtglob:S,isGlobstar:A,negated:L,negatedExtglob:j};if(t.tokens===!0&&(v.maxDepth=0,eA(P)||o.push(H),v.tokens=o),t.parts===!0||t.tokens===!0){let C;for(let b=0;b<i.length;b++){let d=C?C+1:p,E=i[b],U=r.slice(d,E);t.tokens&&(b===0&&p!==0?(o[b].isPrefix=!0,o[b].value=w):o[b].value=U,tA(o[b]),v.maxDepth+=o[b].depth),(b!==0||U!=="")&&a.push(U),C=E}if(C&&C+1<r.length){let b=r.slice(C+1);a.push(b),t.tokens&&(o[o.length-1].value=b,tA(o[o.length-1]),v.maxDepth+=o[o.length-1].depth)}v.slashes=i,v.parts=a}return v};nA.exports=H$});var lA=O((UV,cA)=>{"use strict";var wa=_a(),Rt=Bu(),{MAX_LENGTH:ju,POSIX_REGEX_SOURCE:$$,REGEX_NON_SPECIAL_CHARS:U$,REGEX_SPECIAL_CHARS_BACKREF:q$,REPLACEMENTS:iA}=wa,W$=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch{return r.map(s=>Rt.escapeRegex(s)).join("..")}return t},Ji=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,oA=r=>{let e=[],t=0,n=0,s=0,i="",o=!1;for(let a of r){if(o===!0){i+=a,o=!1;continue}if(a==="\\"){i+=a,o=!0;continue}if(a==='"'){s=s===1?0:1,i+=a;continue}if(s===0){if(a==="[")t++;else if(a==="]"&&t>0)t--;else if(t===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(i),i="";continue}}}i+=a}return e.push(i),e},G$=r=>{let e=!1;for(let t of r){if(e===!0){e=!1;continue}if(t==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(t))return!1}return!0},aA=r=>{let e=r.trim(),t=!0;for(;t===!0;)t=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),t=!0);if(G$(e))return e.replace(/\\(.)/g,"$1")},z$=r=>{let e=r.map(aA).filter(Boolean);for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let s=e[t],i=e[n],o=s[0];if(!(!o||s!==o.repeat(s.length)||i!==o.repeat(i.length))&&(s===i||s.startsWith(i)||i.startsWith(s)))return!0}return!1},tg=(r,e=!0)=>{if(r[0]!=="+"&&r[0]!=="*"||r[1]!=="(")return;let t=0,n=0,s=0,i=!1;for(let o=1;o<r.length;o++){let a=r[o];if(i===!0){i=!1;continue}if(a==="\\"){i=!0;continue}if(a==='"'){s=s===1?0:1;continue}if(s!==1){if(a==="["){t++;continue}if(a==="]"&&t>0){t--;continue}if(!(t>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&o!==r.length-1?void 0:{type:r[0],body:r.slice(2,o),end:o}}}}},V$=r=>{let e=0,t=[];for(;e<r.length;){let s=tg(r.slice(e),!1);if(!s||s.type!=="*")return;let i=oA(s.body).map(a=>a.trim());if(i.length!==1)return;let o=aA(i[0]);if(!o||o.length!==1)return;t.push(o),e+=s.end+1}return t.length<1?void 0:`${t.length===1?Rt.escapeRegex(t[0]):`[${t.map(s=>Rt.escapeRegex(s)).join("")}]`}*`},K$=r=>{let e=0,t=r.trim(),n=tg(t);for(;n;)e++,t=n.body.trim(),n=tg(t);return e},Y$=(r,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let t=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:wa.DEFAULT_MAX_EXTGLOB_RECURSION,n=oA(r).map(s=>s.trim());if(n.length>1&&(n.some(s=>s==="")||n.some(s=>/^[*?]+$/.test(s))||z$(n)))return{risky:!0};for(let s of n){let i=V$(s);if(i)return{risky:!0,safeOutput:i};if(K$(s)>t)return{risky:!0}}return{risky:!1}},rg=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=iA[r]||r;let t={...e},n=typeof t.maxLength=="number"?Math.min(ju,t.maxLength):ju,s=r.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:t.prepend||""},o=[i],a=t.capture?"":"?:",c=Rt.isWindows(e),l=wa.globChars(c),p=wa.extglobChars(l),{DOT_LITERAL:f,PLUS_LITERAL:h,SLASH_LITERAL:x,ONE_CHAR:_,DOTS_SLASH:S,NO_DOT:A,NO_DOT_SLASH:M,NO_DOTS_SLASH:N,QMARK:L,QMARK_NO_DOT:j,STAR:W,START_ANCHOR:q}=l,G=R=>`(${a}(?:(?!${q}${R.dot?S:f}).)*?)`,P=t.dot?"":A,H=t.dot?L:j,T=t.bash===!0?G(t):W;t.capture&&(T=`(${T})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let u={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};r=Rt.removePrefix(r,u),s=r.length;let m=[],y=[],w=[],g=i,v,C=()=>u.index===s-1,b=u.peek=(R=1)=>r[u.index+R],d=u.advance=()=>r[++u.index]||"",E=()=>r.slice(u.index+1),U=(R="",X=0)=>{u.consumed+=R,u.index+=X},I=R=>{u.output+=R.output!=null?R.output:R.value,U(R.value)},D=()=>{let R=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)d(),u.start++,R++;return R%2===0?!1:(u.negated=!0,u.start++,!0)},$=R=>{u[R]++,w.push(R)},V=R=>{u[R]--,w.pop()},B=R=>{if(g.type==="globstar"){let X=u.braces>0&&(R.type==="comma"||R.type==="brace"),k=R.extglob===!0||m.length&&(R.type==="pipe"||R.type==="paren");R.type!=="slash"&&R.type!=="paren"&&!X&&!k&&(u.output=u.output.slice(0,-g.output.length),g.type="star",g.value="*",g.output=T,u.output+=g.output)}if(m.length&&R.type!=="paren"&&(m[m.length-1].inner+=R.value),(R.value||R.output)&&I(R),g&&g.type==="text"&&R.type==="text"){g.value+=R.value,g.output=(g.output||"")+R.value;return}R.prev=g,o.push(R),g=R},ge=(R,X)=>{let k={...p[X],conditions:1,inner:""};k.prev=g,k.parens=u.parens,k.output=u.output,k.startIndex=u.index,k.tokensIndex=o.length;let F=(t.capture?"(":"")+k.open;$("parens"),B({type:R,value:X,output:u.output?"":_}),B({type:"paren",extglob:!0,value:d(),output:F}),m.push(k)},se=R=>{let X=r.slice(R.startIndex,u.index+1),k=r.slice(R.startIndex+2,u.index),F=Y$(k,t);if((R.type==="plus"||R.type==="star")&&F.risky){let z=F.safeOutput?(R.output?"":_)+(t.capture?`(${F.safeOutput})`:F.safeOutput):void 0,ve=o[R.tokensIndex];ve.type="text",ve.value=X,ve.output=z||Rt.escapeRegex(X);for(let re=R.tokensIndex+1;re<o.length;re++)o[re].value="",o[re].output="",delete o[re].suffix;u.output=R.output+ve.output,u.backtrack=!0,B({type:"paren",extglob:!0,value:v,output:""}),V("parens");return}let Q=R.close+(t.capture?")":""),K;if(R.type==="negate"){let z=T;if(R.inner&&R.inner.length>1&&R.inner.includes("/")&&(z=G(t)),(z!==T||C()||/^\)+$/.test(E()))&&(Q=R.close=`)$))${z}`),R.inner.includes("*")&&(K=E())&&/^\.[^\\/.]+$/.test(K)){let ve=rg(K,{...e,fastpaths:!1}).output;Q=R.close=`)${ve})${z})`}R.prev.type==="bos"&&(u.negatedExtglob=!0)}B({type:"paren",extglob:!0,value:v,output:Q}),V("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let R=!1,X=r.replace(q$,(k,F,Q,K,z,ve)=>K==="\\"?(R=!0,k):K==="?"?F?F+K+(z?L.repeat(z.length):""):ve===0?H+(z?L.repeat(z.length):""):L.repeat(Q.length):K==="."?f.repeat(Q.length):K==="*"?F?F+K+(z?T:""):T:F?k:`\\${k}`);return R===!0&&(t.unescape===!0?X=X.replace(/\\/g,""):X=X.replace(/\\+/g,k=>k.length%2===0?"\\\\":k?"\\":"")),X===r&&t.contains===!0?(u.output=r,u):(u.output=Rt.wrapOutput(X,u,e),u)}for(;!C();){if(v=d(),v==="\0")continue;if(v==="\\"){let k=b();if(k==="/"&&t.bash!==!0||k==="."||k===";")continue;if(!k){v+="\\",B({type:"text",value:v});continue}let F=/^\\+/.exec(E()),Q=0;if(F&&F[0].length>2&&(Q=F[0].length,u.index+=Q,Q%2!==0&&(v+="\\")),t.unescape===!0?v=d():v+=d(),u.brackets===0){B({type:"text",value:v});continue}}if(u.brackets>0&&(v!=="]"||g.value==="["||g.value==="[^")){if(t.posix!==!1&&v===":"){let k=g.value.slice(1);if(k.includes("[")&&(g.posix=!0,k.includes(":"))){let F=g.value.lastIndexOf("["),Q=g.value.slice(0,F),K=g.value.slice(F+2),z=$$[K];if(z){g.value=Q+z,u.backtrack=!0,d(),!i.output&&o.indexOf(g)===1&&(i.output=_);continue}}}(v==="["&&b()!==":"||v==="-"&&b()==="]")&&(v=`\\${v}`),v==="]"&&(g.value==="["||g.value==="[^")&&(v=`\\${v}`),t.posix===!0&&v==="!"&&g.value==="["&&(v="^"),g.value+=v,I({value:v});continue}if(u.quotes===1&&v!=='"'){v=Rt.escapeRegex(v),g.value+=v,I({value:v});continue}if(v==='"'){u.quotes=u.quotes===1?0:1,t.keepQuotes===!0&&B({type:"text",value:v});continue}if(v==="("){$("parens"),B({type:"paren",value:v});continue}if(v===")"){if(u.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Ji("opening","("));let k=m[m.length-1];if(k&&u.parens===k.parens+1){se(m.pop());continue}B({type:"paren",value:v,output:u.parens?")":"\\)"}),V("parens");continue}if(v==="["){if(t.nobracket===!0||!E().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Ji("closing","]"));v=`\\${v}`}else $("brackets");B({type:"bracket",value:v});continue}if(v==="]"){if(t.nobracket===!0||g&&g.type==="bracket"&&g.value.length===1){B({type:"text",value:v,output:`\\${v}`});continue}if(u.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Ji("opening","["));B({type:"text",value:v,output:`\\${v}`});continue}V("brackets");let k=g.value.slice(1);if(g.posix!==!0&&k[0]==="^"&&!k.includes("/")&&(v=`/${v}`),g.value+=v,I({value:v}),t.literalBrackets===!1||Rt.hasRegexChars(k))continue;let F=Rt.escapeRegex(g.value);if(u.output=u.output.slice(0,-g.value.length),t.literalBrackets===!0){u.output+=F,g.value=F;continue}g.value=`(${a}${F}|${g.value})`,u.output+=g.value;continue}if(v==="{"&&t.nobrace!==!0){$("braces");let k={type:"brace",value:v,output:"(",outputIndex:u.output.length,tokensIndex:u.tokens.length};y.push(k),B(k);continue}if(v==="}"){let k=y[y.length-1];if(t.nobrace===!0||!k){B({type:"text",value:v,output:v});continue}let F=")";if(k.dots===!0){let Q=o.slice(),K=[];for(let z=Q.length-1;z>=0&&(o.pop(),Q[z].type!=="brace");z--)Q[z].type!=="dots"&&K.unshift(Q[z].value);F=W$(K,t),u.backtrack=!0}if(k.comma!==!0&&k.dots!==!0){let Q=u.output.slice(0,k.outputIndex),K=u.tokens.slice(k.tokensIndex);k.value=k.output="\\{",v=F="\\}",u.output=Q;for(let z of K)u.output+=z.output||z.value}B({type:"brace",value:v,output:F}),V("braces"),y.pop();continue}if(v==="|"){m.length>0&&m[m.length-1].conditions++,B({type:"text",value:v});continue}if(v===","){let k=v,F=y[y.length-1];F&&w[w.length-1]==="braces"&&(F.comma=!0,k="|"),B({type:"comma",value:v,output:k});continue}if(v==="/"){if(g.type==="dot"&&u.index===u.start+1){u.start=u.index+1,u.consumed="",u.output="",o.pop(),g=i;continue}B({type:"slash",value:v,output:x});continue}if(v==="."){if(u.braces>0&&g.type==="dot"){g.value==="."&&(g.output=f);let k=y[y.length-1];g.type="dots",g.output+=v,g.value+=v,k.dots=!0;continue}if(u.braces+u.parens===0&&g.type!=="bos"&&g.type!=="slash"){B({type:"text",value:v,output:f});continue}B({type:"dot",value:v,output:f});continue}if(v==="?"){if(!(g&&g.value==="(")&&t.noextglob!==!0&&b()==="("&&b(2)!=="?"){ge("qmark",v);continue}if(g&&g.type==="paren"){let F=b(),Q=v;if(F==="<"&&!Rt.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(g.value==="("&&!/[!=<:]/.test(F)||F==="<"&&!/<([!=]|\w+>)/.test(E()))&&(Q=`\\${v}`),B({type:"text",value:v,output:Q});continue}if(t.dot!==!0&&(g.type==="slash"||g.type==="bos")){B({type:"qmark",value:v,output:j});continue}B({type:"qmark",value:v,output:L});continue}if(v==="!"){if(t.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){ge("negate",v);continue}if(t.nonegate!==!0&&u.index===0){D();continue}}if(v==="+"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){ge("plus",v);continue}if(g&&g.value==="("||t.regex===!1){B({type:"plus",value:v,output:h});continue}if(g&&(g.type==="bracket"||g.type==="paren"||g.type==="brace")||u.parens>0){B({type:"plus",value:v});continue}B({type:"plus",value:h});continue}if(v==="@"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){B({type:"at",extglob:!0,value:v,output:""});continue}B({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let k=U$.exec(E());k&&(v+=k[0],u.index+=k[0].length),B({type:"text",value:v});continue}if(g&&(g.type==="globstar"||g.star===!0)){g.type="star",g.star=!0,g.value+=v,g.output=T,u.backtrack=!0,u.globstar=!0,U(v);continue}let R=E();if(t.noextglob!==!0&&/^\([^?]/.test(R)){ge("star",v);continue}if(g.type==="star"){if(t.noglobstar===!0){U(v);continue}let k=g.prev,F=k.prev,Q=k.type==="slash"||k.type==="bos",K=F&&(F.type==="star"||F.type==="globstar");if(t.bash===!0&&(!Q||R[0]&&R[0]!=="/")){B({type:"star",value:v,output:""});continue}let z=u.braces>0&&(k.type==="comma"||k.type==="brace"),ve=m.length&&(k.type==="pipe"||k.type==="paren");if(!Q&&k.type!=="paren"&&!z&&!ve){B({type:"star",value:v,output:""});continue}for(;R.slice(0,3)==="/**";){let re=r[u.index+4];if(re&&re!=="/")break;R=R.slice(3),U("/**",3)}if(k.type==="bos"&&C()){g.type="globstar",g.value+=v,g.output=G(t),u.output=g.output,u.globstar=!0,U(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&!K&&C()){u.output=u.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=G(t)+(t.strictSlashes?")":"|$)"),g.value+=v,u.globstar=!0,u.output+=k.output+g.output,U(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&R[0]==="/"){let re=R[1]!==void 0?"|$":"";u.output=u.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=`${G(t)}${x}|${x}${re})`,g.value+=v,u.output+=k.output+g.output,u.globstar=!0,U(v+d()),B({type:"slash",value:"/",output:""});continue}if(k.type==="bos"&&R[0]==="/"){g.type="globstar",g.value+=v,g.output=`(?:^|${x}|${G(t)}${x})`,u.output=g.output,u.globstar=!0,U(v+d()),B({type:"slash",value:"/",output:""});continue}u.output=u.output.slice(0,-g.output.length),g.type="globstar",g.output=G(t),g.value+=v,u.output+=g.output,u.globstar=!0,U(v);continue}let X={type:"star",value:v,output:T};if(t.bash===!0){X.output=".*?",(g.type==="bos"||g.type==="slash")&&(X.output=P+X.output),B(X);continue}if(g&&(g.type==="bracket"||g.type==="paren")&&t.regex===!0){X.output=v,B(X);continue}(u.index===u.start||g.type==="slash"||g.type==="dot")&&(g.type==="dot"?(u.output+=M,g.output+=M):t.dot===!0?(u.output+=N,g.output+=N):(u.output+=P,g.output+=P),b()!=="*"&&(u.output+=_,g.output+=_)),B(X)}for(;u.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ji("closing","]"));u.output=Rt.escapeLast(u.output,"["),V("brackets")}for(;u.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ji("closing",")"));u.output=Rt.escapeLast(u.output,"("),V("parens")}for(;u.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ji("closing","}"));u.output=Rt.escapeLast(u.output,"{"),V("braces")}if(t.strictSlashes!==!0&&(g.type==="star"||g.type==="bracket")&&B({type:"maybe_slash",value:"",output:`${x}?`}),u.backtrack===!0){u.output="";for(let R of u.tokens)u.output+=R.output!=null?R.output:R.value,R.suffix&&(u.output+=R.suffix)}return u};rg.fastpaths=(r,e)=>{let t={...e},n=typeof t.maxLength=="number"?Math.min(ju,t.maxLength):ju,s=r.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);r=iA[r]||r;let i=Rt.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:p,NO_DOTS:f,NO_DOTS_SLASH:h,STAR:x,START_ANCHOR:_}=wa.globChars(i),S=t.dot?f:p,A=t.dot?h:p,M=t.capture?"":"?:",N={negated:!1,prefix:""},L=t.bash===!0?".*?":x;t.capture&&(L=`(${L})`);let j=P=>P.noglobstar===!0?L:`(${M}(?:(?!${_}${P.dot?l:o}).)*?)`,W=P=>{switch(P){case"*":return`${S}${c}${L}`;case".*":return`${o}${c}${L}`;case"*.*":return`${S}${L}${o}${c}${L}`;case"*/*":return`${S}${L}${a}${c}${A}${L}`;case"**":return S+j(t);case"**/*":return`(?:${S}${j(t)}${a})?${A}${c}${L}`;case"**/*.*":return`(?:${S}${j(t)}${a})?${A}${L}${o}${c}${L}`;case"**/.*":return`(?:${S}${j(t)}${a})?${o}${c}${L}`;default:{let H=/^(.*?)\.(\w+)$/.exec(P);if(!H)return;let T=W(H[1]);return T?T+o+H[2]:void 0}}},q=Rt.removePrefix(r,N),G=W(q);return G&&t.strictSlashes!==!0&&(G+=`${a}?`),G};cA.exports=rg});var pA=O((qV,uA)=>{"use strict";var X$=require("path"),J$=sA(),ng=lA(),sg=Bu(),Q$=_a(),Z$=r=>r&&typeof r=="object"&&!Array.isArray(r),Ne=(r,e,t=!1)=>{if(Array.isArray(r)){let p=r.map(h=>Ne(h,e,t));return h=>{for(let x of p){let _=x(h);if(_)return _}return!1}}let n=Z$(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let s=e||{},i=sg.isWindows(e),o=n?Ne.compileRe(r,e):Ne.makeRe(r,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(s.ignore){let p={...e,ignore:null,onMatch:null,onResult:null};c=Ne(s.ignore,p,t)}let l=(p,f=!1)=>{let{isMatch:h,match:x,output:_}=Ne.test(p,o,e,{glob:r,posix:i}),S={glob:r,state:a,regex:o,posix:i,input:p,output:_,match:x,isMatch:h};return typeof s.onResult=="function"&&s.onResult(S),h===!1?(S.isMatch=!1,f?S:!1):c(p)?(typeof s.onIgnore=="function"&&s.onIgnore(S),S.isMatch=!1,f?S:!1):(typeof s.onMatch=="function"&&s.onMatch(S),f?S:!0)};return t&&(l.state=a),l};Ne.test=(r,e,t,{glob:n,posix:s}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};let i=t||{},o=i.format||(s?sg.toPosixSlashes:null),a=r===n,c=a&&o?o(r):r;return a===!1&&(c=o?o(r):r,a=c===n),(a===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?a=Ne.matchBase(r,e,t,s):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Ne.matchBase=(r,e,t,n=sg.isWindows(t))=>(e instanceof RegExp?e:Ne.makeRe(e,t)).test(X$.basename(r));Ne.isMatch=(r,e,t)=>Ne(e,t)(r);Ne.parse=(r,e)=>Array.isArray(r)?r.map(t=>Ne.parse(t,e)):ng(r,{...e,fastpaths:!1});Ne.scan=(r,e)=>J$(r,e);Ne.compileRe=(r,e,t=!1,n=!1)=>{if(t===!0)return r.output;let s=e||{},i=s.contains?"":"^",o=s.contains?"":"$",a=`${i}(?:${r.output})${o}`;r&&r.negated===!0&&(a=`^(?!${a}).*$`);let c=Ne.toRegex(a,e);return n===!0&&(c.state=r),c};Ne.makeRe=(r,e={},t=!1,n=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(s.output=ng.fastpaths(r,e)),s.output||(s=ng(r,e)),Ne.compileRe(s,e,t,n)};Ne.toRegex=(r,e)=>{try{let t=e||{};return new RegExp(r,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};Ne.constants=Q$;uA.exports=Ne});var dA=O((WV,fA)=>{"use strict";fA.exports=pA()});var ig=O((GV,hA)=>{hA.exports=function(r,e){if(typeof r!="string")throw new TypeError("expected path to be a string");if(r==="\\"||r==="/")return"/";var t=r.length;if(t<=1)return r;var n="";if(t>4&&r[3]==="\\"){var s=r[2];(s==="?"||s===".")&&r.slice(0,2)==="\\\\"&&(r=r.slice(2),n="//")}var i=r.split(/[/\\]+/);return e!==!1&&i[i.length-1]===""&&i.pop(),n+i.join("/")}});var _A=O((yA,xA)=>{"use strict";Object.defineProperty(yA,"__esModule",{value:!0});var vA=dA(),eU=ig(),mA="!",tU={returnIndex:!1},rU=r=>Array.isArray(r)?r:[r],nU=(r,e)=>{if(typeof r=="function")return r;if(typeof r=="string"){let t=vA(r,e);return n=>r===n||t(n)}return r instanceof RegExp?t=>r.test(t):t=>!1},gA=(r,e,t,n)=>{let s=Array.isArray(t),i=s?t[0]:t;if(!s&&typeof i!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(i));let o=eU(i,!1);for(let c=0;c<e.length;c++){let l=e[c];if(l(o))return n?-1:!1}let a=s&&[o].concat(t.slice(1));for(let c=0;c<r.length;c++){let l=r[c];if(s?l(...a):l(o))return n?c:!0}return n?-1:!1},og=(r,e,t=tU)=>{if(r==null)throw new TypeError("anymatch: specify first argument");let n=typeof t=="boolean"?{returnIndex:t}:t,s=n.returnIndex||!1,i=rU(r),o=i.filter(c=>typeof c=="string"&&c.charAt(0)===mA).map(c=>c.slice(1)).map(c=>vA(c,n)),a=i.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==mA).map(c=>nU(c,n));return e==null?(c,l=!1)=>gA(a,o,c,typeof l=="boolean"?l:!1):gA(a,o,e,s)};og.default=og;xA.exports=og});var wA=O((zV,bA)=>{bA.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}});var ag=O((VV,EA)=>{var sU=wA(),SA={"{":"}","(":")","[":"]"},iU=function(r){if(r[0]==="!")return!0;for(var e=0,t=-2,n=-2,s=-2,i=-2,o=-2;e<r.length;){if(r[e]==="*"||r[e+1]==="?"&&/[\].+)]/.test(r[e])||n!==-1&&r[e]==="["&&r[e+1]!=="]"&&(n<e&&(n=r.indexOf("]",e)),n>e&&(o===-1||o>n||(o=r.indexOf("\\",e),o===-1||o>n)))||s!==-1&&r[e]==="{"&&r[e+1]!=="}"&&(s=r.indexOf("}",e),s>e&&(o=r.indexOf("\\",e),o===-1||o>s))||i!==-1&&r[e]==="("&&r[e+1]==="?"&&/[:!=]/.test(r[e+2])&&r[e+3]!==")"&&(i=r.indexOf(")",e),i>e&&(o=r.indexOf("\\",e),o===-1||o>i))||t!==-1&&r[e]==="("&&r[e+1]!=="|"&&(t<e&&(t=r.indexOf("|",e)),t!==-1&&r[t+1]!==")"&&(i=r.indexOf(")",t),i>t&&(o=r.indexOf("\\",t),o===-1||o>i))))return!0;if(r[e]==="\\"){var a=r[e+1];e+=2;var c=SA[a];if(c){var l=r.indexOf(c,e);l!==-1&&(e=l+1)}if(r[e]==="!")return!0}else e++}return!1},oU=function(r){if(r[0]==="!")return!0;for(var e=0;e<r.length;){if(/[*?{}()[\]]/.test(r[e]))return!0;if(r[e]==="\\"){var t=r[e+1];e+=2;var n=SA[t];if(n){var s=r.indexOf(n,e);s!==-1&&(e=s+1)}if(r[e]==="!")return!0}else e++}return!1};EA.exports=function(e,t){if(typeof e!="string"||e==="")return!1;if(sU(e))return!0;var n=iU;return t&&t.strict===!1&&(n=oU),n(e)}});var CA=O((KV,TA)=>{"use strict";var aU=ag(),cU=require("path").posix.dirname,lU=require("os").platform()==="win32",cg="/",uU=/\\/g,pU=/[\{\[].*[\}\]]$/,fU=/(^|[^\\])([\{\[]|\([^\)]+$)/,dU=/\\([\!\*\?\|\[\]\(\)\{\}])/g;TA.exports=function(e,t){var n=Object.assign({flipBackslashes:!0},t);n.flipBackslashes&&lU&&e.indexOf(cg)<0&&(e=e.replace(uU,cg)),pU.test(e)&&(e+=cg),e+="a";do e=cU(e);while(aU(e)||fU.test(e));return e.replace(dU,"$1")}});var Fu=O(br=>{"use strict";br.isInteger=r=>typeof r=="number"?Number.isInteger(r):typeof r=="string"&&r.trim()!==""?Number.isInteger(Number(r)):!1;br.find=(r,e)=>r.nodes.find(t=>t.type===e);br.exceedsLimit=(r,e,t=1,n)=>n===!1||!br.isInteger(r)||!br.isInteger(e)?!1:(Number(e)-Number(r))/Number(t)>=n;br.escapeNode=(r,e=0,t)=>{let n=r.nodes[e];n&&(t&&n.type===t||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};br.encloseBrace=r=>r.type!=="brace"?!1:r.commas>>0+r.ranges>>0===0?(r.invalid=!0,!0):!1;br.isInvalidBrace=r=>r.type!=="brace"?!1:r.invalid===!0||r.dollar?!0:r.commas>>0+r.ranges>>0===0||r.open!==!0||r.close!==!0?(r.invalid=!0,!0):!1;br.isOpenOrClose=r=>r.type==="open"||r.type==="close"?!0:r.open===!0||r.close===!0;br.reduce=r=>r.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);br.flatten=(...r)=>{let e=[],t=n=>{for(let s=0;s<n.length;s++){let i=n[s];if(Array.isArray(i)){t(i);continue}i!==void 0&&e.push(i)}return e};return t(r),e}});var Hu=O((XV,RA)=>{"use strict";var AA=Fu();RA.exports=(r,e={})=>{let t=(n,s={})=>{let i=e.escapeInvalid&&AA.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(i||o)&&AA.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=t(c);return a};return t(r)}});var OA=O((JV,kA)=>{"use strict";kA.exports=function(r){return typeof r=="number"?r-r===0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}});var FA=O((QV,jA)=>{"use strict";var MA=OA(),As=(r,e,t)=>{if(MA(r)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||r===e)return String(r);if(MA(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...t};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let s=String(n.relaxZeros),i=String(n.shorthand),o=String(n.capture),a=String(n.wrap),c=r+":"+e+"="+s+i+o+a;if(As.cache.hasOwnProperty(c))return As.cache[c].result;let l=Math.min(r,e),p=Math.max(r,e);if(Math.abs(l-p)===1){let S=r+"|"+e;return n.capture?`(${S})`:n.wrap===!1?S:`(?:${S})`}let f=BA(r)||BA(e),h={min:r,max:e,a:l,b:p},x=[],_=[];if(f&&(h.isPadded=f,h.maxLen=String(h.max).length),l<0){let S=p<0?Math.abs(p):1;_=PA(S,Math.abs(l),h,n),l=h.a=0}return p>=0&&(x=PA(l,p,h,n)),h.negatives=_,h.positives=x,h.result=hU(_,x,n),n.capture===!0?h.result=`(${h.result})`:n.wrap!==!1&&x.length+_.length>1&&(h.result=`(?:${h.result})`),As.cache[c]=h,h.result};function hU(r,e,t){let n=lg(r,e,"-",!1,t)||[],s=lg(e,r,"",!1,t)||[],i=lg(r,e,"-?",!0,t)||[];return n.concat(i).concat(s).join("|")}function mU(r,e){let t=1,n=1,s=NA(r,t),i=new Set([e]);for(;r<=s&&s<=e;)i.add(s),t+=1,s=NA(r,t);for(s=LA(e+1,n)-1;r<s&&s<=e;)i.add(s),n+=1,s=LA(e+1,n)-1;return i=[...i],i.sort(yU),i}function gU(r,e,t){if(r===e)return{pattern:r,count:[],digits:0};let n=vU(r,e),s=n.length,i="",o=0;for(let a=0;a<s;a++){let[c,l]=n[a];c===l?i+=c:c!=="0"||l!=="9"?i+=xU(c,l,t):o++}return o&&(i+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[o],digits:s}}function PA(r,e,t,n){let s=mU(r,e),i=[],o=r,a;for(let c=0;c<s.length;c++){let l=s[c],p=gU(String(o),String(l),n),f="";if(!t.isPadded&&a&&a.pattern===p.pattern){a.count.length>1&&a.count.pop(),a.count.push(p.count[0]),a.string=a.pattern+DA(a.count),o=l+1;continue}t.isPadded&&(f=_U(l,t,n)),p.string=f+p.pattern+DA(p.count),i.push(p),o=l+1,a=p}return i}function lg(r,e,t,n,s){let i=[];for(let o of r){let{string:a}=o;!n&&!IA(e,"string",a)&&i.push(t+a),n&&IA(e,"string",a)&&i.push(t+a)}return i}function vU(r,e){let t=[];for(let n=0;n<r.length;n++)t.push([r[n],e[n]]);return t}function yU(r,e){return r>e?1:e>r?-1:0}function IA(r,e,t){return r.some(n=>n[e]===t)}function NA(r,e){return Number(String(r).slice(0,-e)+"9".repeat(e))}function LA(r,e){return r-r%Math.pow(10,e)}function DA(r){let[e=0,t=""]=r;return t||e>1?`{${e+(t?","+t:"")}}`:""}function xU(r,e,t){return`[${r}${e-r===1?"":"-"}${e}]`}function BA(r){return/^-?(0+)\d/.test(r)}function _U(r,e,t){if(!e.isPadded)return r;let n=Math.abs(e.maxLen-String(r).length),s=t.relaxZeros!==!1;switch(n){case 0:return"";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${n}}`:`0{${n}}`}}As.cache={};As.clearCache=()=>As.cache={};jA.exports=As});var fg=O((ZV,zA)=>{"use strict";var bU=require("util"),$A=FA(),HA=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),wU=r=>e=>r===!0?Number(e):String(e),ug=r=>typeof r=="number"||typeof r=="string"&&r!=="",Sa=r=>Number.isInteger(+r),pg=r=>{let e=`${r}`,t=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++t]==="0";);return t>0},SU=(r,e,t)=>typeof r=="string"||typeof e=="string"?!0:t.stringify===!0,EU=(r,e,t)=>{if(e>0){let n=r[0]==="-"?"-":"";n&&(r=r.slice(1)),r=n+r.padStart(n?e-1:e,"0")}return t===!1?String(r):r},Uu=(r,e)=>{let t=r[0]==="-"?"-":"";for(t&&(r=r.slice(1),e--);r.length<e;)r="0"+r;return t?"-"+r:r},TU=(r,e,t)=>{r.negatives.sort((a,c)=>a<c?-1:a>c?1:0),r.positives.sort((a,c)=>a<c?-1:a>c?1:0);let n=e.capture?"":"?:",s="",i="",o;return r.positives.length&&(s=r.positives.map(a=>Uu(String(a),t)).join("|")),r.negatives.length&&(i=`-(${n}${r.negatives.map(a=>Uu(String(a),t)).join("|")})`),s&&i?o=`${s}|${i}`:o=s||i,e.wrap?`(${n}${o})`:o},UA=(r,e,t,n)=>{if(t)return $A(r,e,{wrap:!1,...n});let s=String.fromCharCode(r);if(r===e)return s;let i=String.fromCharCode(e);return`[${s}-${i}]`},qA=(r,e,t)=>{if(Array.isArray(r)){let n=t.wrap===!0,s=t.capture?"":"?:";return n?`(${s}${r.join("|")})`:r.join("|")}return $A(r,e,t)},WA=(...r)=>new RangeError("Invalid range arguments: "+bU.inspect(...r)),GA=(r,e,t)=>{if(t.strictRanges===!0)throw WA([r,e]);return[]},CU=(r,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${r}" to be a number`);return[]},AU=(r,e,t=1,n={})=>{let s=Number(r),i=Number(e);if(!Number.isInteger(s)||!Number.isInteger(i)){if(n.strictRanges===!0)throw WA([r,e]);return[]}s===0&&(s=0),i===0&&(i=0);let o=s>i,a=String(r),c=String(e),l=String(t);t=Math.max(Math.abs(t),1);let p=pg(a)||pg(c)||pg(l),f=p?Math.max(a.length,c.length,l.length):0,h=p===!1&&SU(r,e,n)===!1,x=n.transform||wU(h);if(n.toRegex&&t===1)return UA(Uu(r,f),Uu(e,f),!0,n);let _={negatives:[],positives:[]},S=N=>_[N<0?"negatives":"positives"].push(Math.abs(N)),A=[],M=0;for(;o?s>=i:s<=i;)n.toRegex===!0&&t>1?S(s):A.push(EU(x(s,M),f,h)),s=o?s-t:s+t,M++;return n.toRegex===!0?t>1?TU(_,n,f):qA(A,null,{wrap:!1,...n}):A},RU=(r,e,t=1,n={})=>{if(!Sa(r)&&r.length>1||!Sa(e)&&e.length>1)return GA(r,e,n);let s=n.transform||(h=>String.fromCharCode(h)),i=`${r}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=i>o,c=Math.min(i,o),l=Math.max(i,o);if(n.toRegex&&t===1)return UA(c,l,!1,n);let p=[],f=0;for(;a?i>=o:i<=o;)p.push(s(i,f)),i=a?i-t:i+t,f++;return n.toRegex===!0?qA(p,null,{wrap:!1,options:n}):p},$u=(r,e,t,n={})=>{if(e==null&&ug(r))return[r];if(!ug(r)||!ug(e))return GA(r,e,n);if(typeof t=="function")return $u(r,e,1,{transform:t});if(HA(t))return $u(r,e,0,t);let s={...n};return s.capture===!0&&(s.wrap=!0),t=t||s.step||1,Sa(t)?Sa(r)&&Sa(e)?AU(r,e,t,s):RU(r,e,Math.max(Math.abs(t),1),s):t!=null&&!HA(t)?CU(t,s):$u(r,e,1,t)};zA.exports=$u});var YA=O((eK,KA)=>{"use strict";var kU=fg(),VA=Fu(),OU=(r,e={})=>{let t=(n,s={})=>{let i=VA.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,a=i===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",l="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let p=VA.reduce(n.nodes),f=kU(...p,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(f.length!==0)return p.length>1&&f.length>1?`(${f})`:f}if(n.nodes)for(let p of n.nodes)l+=t(p,n);return l};return t(r)};KA.exports=OU});var QA=O((tK,JA)=>{"use strict";var MU=fg(),XA=Hu(),Qi=Fu(),Rs=(r="",e="",t=!1)=>{let n=[];if(r=[].concat(r),e=[].concat(e),!e.length)return r;if(!r.length)return t?Qi.flatten(e).map(s=>`{${s}}`):e;for(let s of r)if(Array.isArray(s))for(let i of s)n.push(Rs(i,e,t));else for(let i of e)t===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?Rs(s,i,t):s+i);return Qi.flatten(n)},PU=(r,e={})=>{let t=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(s,i={})=>{s.queue=[];let o=i,a=i.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(s.invalid||s.dollar){a.push(Rs(a.pop(),XA(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){a.push(Rs(a.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let f=Qi.reduce(s.nodes);if(Qi.exceedsLimit(...f,e.step,t))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let h=MU(...f,e);h.length===0&&(h=XA(s,e)),a.push(Rs(a.pop(),h)),s.nodes=[];return}let c=Qi.encloseBrace(s),l=s.queue,p=s;for(;p.type!=="brace"&&p.type!=="root"&&p.parent;)p=p.parent,l=p.queue;for(let f=0;f<s.nodes.length;f++){let h=s.nodes[f];if(h.type==="comma"&&s.type==="brace"){f===1&&l.push(""),l.push("");continue}if(h.type==="close"){a.push(Rs(a.pop(),l,c));continue}if(h.value&&h.type!=="open"){l.push(Rs(l.pop(),h.value));continue}h.nodes&&n(h,s)}return l};return Qi.flatten(n(r))};JA.exports=PU});var eR=O((rK,ZA)=>{"use strict";ZA.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
102
+ `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var iR=O((nK,sR)=>{"use strict";var IU=Hu(),{MAX_LENGTH:tR,CHAR_BACKSLASH:dg,CHAR_BACKTICK:NU,CHAR_COMMA:LU,CHAR_DOT:DU,CHAR_LEFT_PARENTHESES:BU,CHAR_RIGHT_PARENTHESES:jU,CHAR_LEFT_CURLY_BRACE:FU,CHAR_RIGHT_CURLY_BRACE:HU,CHAR_LEFT_SQUARE_BRACKET:rR,CHAR_RIGHT_SQUARE_BRACKET:nR,CHAR_DOUBLE_QUOTE:$U,CHAR_SINGLE_QUOTE:UU,CHAR_NO_BREAK_SPACE:qU,CHAR_ZERO_WIDTH_NOBREAK_SPACE:WU}=eR(),GU=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},n=typeof t.maxLength=="number"?Math.min(tR,t.maxLength):tR;if(r.length>n)throw new SyntaxError(`Input length (${r.length}), exceeds max characters (${n})`);let s={type:"root",input:r,nodes:[]},i=[s],o=s,a=s,c=0,l=r.length,p=0,f=0,h,x=()=>r[p++],_=S=>{if(S.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&S.type==="text"){a.value+=S.value;return}return o.nodes.push(S),S.parent=o,S.prev=a,a=S,S};for(_({type:"bos"});p<l;)if(o=i[i.length-1],h=x(),!(h===WU||h===qU)){if(h===dg){_({type:"text",value:(e.keepEscaping?h:"")+x()});continue}if(h===nR){_({type:"text",value:"\\"+h});continue}if(h===rR){c++;let S;for(;p<l&&(S=x());){if(h+=S,S===rR){c++;continue}if(S===dg){h+=x();continue}if(S===nR&&(c--,c===0))break}_({type:"text",value:h});continue}if(h===BU){o=_({type:"paren",nodes:[]}),i.push(o),_({type:"text",value:h});continue}if(h===jU){if(o.type!=="paren"){_({type:"text",value:h});continue}o=i.pop(),_({type:"text",value:h}),o=i[i.length-1];continue}if(h===$U||h===UU||h===NU){let S=h,A;for(e.keepQuotes!==!0&&(h="");p<l&&(A=x());){if(A===dg){h+=A+x();continue}if(A===S){e.keepQuotes===!0&&(h+=A);break}h+=A}_({type:"text",value:h});continue}if(h===FU){f++;let A={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};o=_(A),i.push(o),_({type:"open",value:h});continue}if(h===HU){if(o.type!=="brace"){_({type:"text",value:h});continue}let S="close";o=i.pop(),o.close=!0,_({type:S,value:h}),f--,o=i[i.length-1];continue}if(h===LU&&f>0){if(o.ranges>0){o.ranges=0;let S=o.nodes.shift();o.nodes=[S,{type:"text",value:IU(o)}]}_({type:"comma",value:h}),o.commas++;continue}if(h===DU&&f>0&&o.commas===0){let S=o.nodes;if(f===0||S.length===0){_({type:"text",value:h});continue}if(a.type==="dot"){if(o.range=[],a.value+=h,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){S.pop();let A=S[S.length-1];A.value+=a.value+h,a=A,o.ranges--;continue}_({type:"dot",value:h});continue}_({type:"text",value:h})}do if(o=i.pop(),o.type!=="root"){o.nodes.forEach(M=>{M.nodes||(M.type==="open"&&(M.isOpen=!0),M.type==="close"&&(M.isClose=!0),M.nodes||(M.type="text"),M.invalid=!0)});let S=i[i.length-1],A=S.nodes.indexOf(o);S.nodes.splice(A,1,...o.nodes)}while(i.length>0);return _({type:"eos"}),s};sR.exports=GU});var cR=O((sK,aR)=>{"use strict";var oR=Hu(),zU=YA(),VU=QA(),KU=iR(),nr=(r,e={})=>{let t=[];if(Array.isArray(r))for(let n of r){let s=nr.create(n,e);Array.isArray(s)?t.push(...s):t.push(s)}else t=[].concat(nr.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};nr.parse=(r,e={})=>KU(r,e);nr.stringify=(r,e={})=>oR(typeof r=="string"?nr.parse(r,e):r,e);nr.compile=(r,e={})=>(typeof r=="string"&&(r=nr.parse(r,e)),zU(r,e));nr.expand=(r,e={})=>{typeof r=="string"&&(r=nr.parse(r,e));let t=VU(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};nr.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?nr.compile(r,e):nr.expand(r,e);aR.exports=nr});var lR=O((iK,YU)=>{YU.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]});var pR=O((oK,uR)=>{uR.exports=lR()});var dR=O((aK,fR)=>{"use strict";var XU=require("path"),JU=pR(),QU=new Set(JU);fR.exports=r=>QU.has(XU.extname(r).slice(1).toLowerCase())});var qu=O(Z=>{"use strict";var{sep:ZU}=require("path"),{platform:hg}=process,eq=require("os");Z.EV_ALL="all";Z.EV_READY="ready";Z.EV_ADD="add";Z.EV_CHANGE="change";Z.EV_ADD_DIR="addDir";Z.EV_UNLINK="unlink";Z.EV_UNLINK_DIR="unlinkDir";Z.EV_RAW="raw";Z.EV_ERROR="error";Z.STR_DATA="data";Z.STR_END="end";Z.STR_CLOSE="close";Z.FSEVENT_CREATED="created";Z.FSEVENT_MODIFIED="modified";Z.FSEVENT_DELETED="deleted";Z.FSEVENT_MOVED="moved";Z.FSEVENT_CLONED="cloned";Z.FSEVENT_UNKNOWN="unknown";Z.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1;Z.FSEVENT_TYPE_FILE="file";Z.FSEVENT_TYPE_DIRECTORY="directory";Z.FSEVENT_TYPE_SYMLINK="symlink";Z.KEY_LISTENERS="listeners";Z.KEY_ERR="errHandlers";Z.KEY_RAW="rawEmitters";Z.HANDLER_KEYS=[Z.KEY_LISTENERS,Z.KEY_ERR,Z.KEY_RAW];Z.DOT_SLASH=`.${ZU}`;Z.BACK_SLASH_RE=/\\/g;Z.DOUBLE_SLASH_RE=/\/\//;Z.SLASH_OR_BACK_SLASH_RE=/[/\\]/;Z.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;Z.REPLACER_RE=/^\.[/\\]/;Z.SLASH="/";Z.SLASH_SLASH="//";Z.BRACE_START="{";Z.BANG="!";Z.ONE_DOT=".";Z.TWO_DOTS="..";Z.STAR="*";Z.GLOBSTAR="**";Z.ROOT_GLOBSTAR="/**/*";Z.SLASH_GLOBSTAR="/**";Z.DIR_SUFFIX="Dir";Z.ANYMATCH_OPTS={dot:!0};Z.STRING_TYPE="string";Z.FUNCTION_TYPE="function";Z.EMPTY_STR="";Z.EMPTY_FN=()=>{};Z.IDENTITY_FN=r=>r;Z.isWindows=hg==="win32";Z.isMacos=hg==="darwin";Z.isLinux=hg==="linux";Z.isIBMi=eq.type()==="OS400"});var xR=O((lK,yR)=>{"use strict";var An=require("fs"),yt=require("path"),{promisify:Aa}=require("util"),tq=dR(),{isWindows:rq,isLinux:nq,EMPTY_FN:sq,EMPTY_STR:iq,KEY_LISTENERS:Zi,KEY_ERR:mg,KEY_RAW:Ea,HANDLER_KEYS:oq,EV_CHANGE:Gu,EV_ADD:Wu,EV_ADD_DIR:aq,EV_ERROR:mR,STR_DATA:cq,STR_END:lq,BRACE_START:uq,STAR:pq}=qu(),fq="watch",dq=Aa(An.open),gR=Aa(An.stat),hq=Aa(An.lstat),mq=Aa(An.close),gg=Aa(An.realpath),gq={lstat:hq,stat:gR},yg=(r,e)=>{r instanceof Set?r.forEach(e):e(r)},Ta=(r,e,t)=>{let n=r[e];n instanceof Set||(r[e]=n=new Set([n])),n.add(t)},vq=r=>e=>{let t=r[e];t instanceof Set?t.clear():delete r[e]},Ca=(r,e,t)=>{let n=r[e];n instanceof Set?n.delete(t):n===t&&delete r[e]},vR=r=>r instanceof Set?r.size===0:!r,zu=new Map;function hR(r,e,t,n,s){let i=(o,a)=>{t(r),s(o,a,{watchedPath:r}),a&&r!==a&&Vu(yt.resolve(r,a),Zi,yt.join(r,a))};try{return An.watch(r,e,i)}catch(o){n(o)}}var Vu=(r,e,t,n,s)=>{let i=zu.get(r);i&&yg(i[e],o=>{o(t,n,s)})},yq=(r,e,t,n)=>{let{listener:s,errHandler:i,rawEmitter:o}=n,a=zu.get(e),c;if(!t.persistent)return c=hR(r,t,s,i,o),c.close.bind(c);if(a)Ta(a,Zi,s),Ta(a,mg,i),Ta(a,Ea,o);else{if(c=hR(r,t,Vu.bind(null,e,Zi),i,Vu.bind(null,e,Ea)),!c)return;c.on(mR,async l=>{let p=Vu.bind(null,e,mg);if(a.watcherUnusable=!0,rq&&l.code==="EPERM")try{let f=await dq(r,"r");await mq(f),p(l)}catch{}else p(l)}),a={listeners:s,errHandlers:i,rawEmitters:o,watcher:c},zu.set(e,a)}return()=>{Ca(a,Zi,s),Ca(a,mg,i),Ca(a,Ea,o),vR(a.listeners)&&(a.watcher.close(),zu.delete(e),oq.forEach(vq(a)),a.watcher=void 0,Object.freeze(a))}},vg=new Map,xq=(r,e,t,n)=>{let{listener:s,rawEmitter:i}=n,o=vg.get(e),a=new Set,c=new Set,l=o&&o.options;return l&&(l.persistent<t.persistent||l.interval>t.interval)&&(a=o.listeners,c=o.rawEmitters,An.unwatchFile(e),o=void 0),o?(Ta(o,Zi,s),Ta(o,Ea,i)):(o={listeners:s,rawEmitters:i,options:t,watcher:An.watchFile(e,t,(p,f)=>{yg(o.rawEmitters,x=>{x(Gu,e,{curr:p,prev:f})});let h=p.mtimeMs;(p.size!==f.size||h>f.mtimeMs||h===0)&&yg(o.listeners,x=>x(r,p))})},vg.set(e,o)),()=>{Ca(o,Zi,s),Ca(o,Ea,i),vR(o.listeners)&&(vg.delete(e),An.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o))}},xg=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,s=yt.dirname(e),i=yt.basename(e);this.fsw._getWatchedDir(s).add(i);let a=yt.resolve(e),c={persistent:n.persistent};t||(t=sq);let l;return n.usePolling?(c.interval=n.enableBinaryInterval&&tq(i)?n.binaryInterval:n.interval,l=xq(e,a,c,{listener:t,rawEmitter:this.fsw._emitRaw})):l=yq(e,a,c,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),l}_handleFile(e,t,n){if(this.fsw.closed)return;let s=yt.dirname(e),i=yt.basename(e),o=this.fsw._getWatchedDir(s),a=t;if(o.has(i))return;let c=async(p,f)=>{if(this.fsw._throttle(fq,e,5)){if(!f||f.mtimeMs===0)try{let h=await gR(e);if(this.fsw.closed)return;let x=h.atimeMs,_=h.mtimeMs;(!x||x<=_||_!==a.mtimeMs)&&this.fsw._emit(Gu,e,h),nq&&a.ino!==h.ino?(this.fsw._closeFile(p),a=h,this.fsw._addPathCloser(p,this._watchWithNodeFs(e,c))):a=h}catch{this.fsw._remove(s,i)}else if(o.has(i)){let h=f.atimeMs,x=f.mtimeMs;(!h||h<=x||x!==a.mtimeMs)&&this.fsw._emit(Gu,e,f),a=f}}},l=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(Wu,e,0))return;this.fsw._emit(Wu,e,t)}return l}async _handleSymlink(e,t,n,s){if(this.fsw.closed)return;let i=e.fullPath,o=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await gg(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(o.has(s)?this.fsw._symlinkPaths.get(i)!==a&&(this.fsw._symlinkPaths.set(i,a),this.fsw._emit(Gu,n,e.stats)):(o.add(s),this.fsw._symlinkPaths.set(i,a),this.fsw._emit(Wu,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return!0;this.fsw._symlinkPaths.set(i,!0)}_handleRead(e,t,n,s,i,o,a){if(e=yt.join(e,iq),!n.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(n.path),l=new Set,p=this.fsw._readdirp(e,{fileFilter:f=>n.filterPath(f),directoryFilter:f=>n.filterDir(f),depth:0}).on(cq,async f=>{if(this.fsw.closed){p=void 0;return}let h=f.path,x=yt.join(e,h);if(l.add(h),!(f.stats.isSymbolicLink()&&await this._handleSymlink(f,e,x,h))){if(this.fsw.closed){p=void 0;return}(h===s||!s&&!c.has(h))&&(this.fsw._incrReadyCount(),x=yt.join(i,yt.relative(i,x)),this._addToNodeFs(x,t,n,o+1))}}).on(mR,this._boundHandleError);return new Promise(f=>p.once(lq,()=>{if(this.fsw.closed){p=void 0;return}let h=a?a.clear():!1;f(),c.getChildren().filter(x=>x!==e&&!l.has(x)&&(!n.hasGlob||n.filterPath({fullPath:yt.resolve(e,x)}))).forEach(x=>{this.fsw._remove(e,x)}),p=void 0,h&&this._handleRead(e,!1,n,s,i,o,a)}))}async _handleDir(e,t,n,s,i,o,a){let c=this.fsw._getWatchedDir(yt.dirname(e)),l=c.has(yt.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!i&&!l&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(aq,e,t),c.add(yt.basename(e)),this.fsw._getWatchedDir(e);let p,f,h=this.fsw.options.depth;if((h==null||s<=h)&&!this.fsw._symlinkPaths.has(a)){if(!i&&(await this._handleRead(e,n,o,i,e,s,p),this.fsw.closed))return;f=this._watchWithNodeFs(e,(x,_)=>{_&&_.mtimeMs===0||this._handleRead(x,!1,o,i,e,s,p)})}return f}async _addToNodeFs(e,t,n,s,i){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let a=this.fsw._getWatchHelpers(e,s);!a.hasGlob&&n&&(a.hasGlob=n.hasGlob,a.globFilter=n.globFilter,a.filterPath=c=>n.filterPath(c),a.filterDir=c=>n.filterDir(c));try{let c=await gq[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return o(),!1;let l=this.fsw.options.followSymlinks&&!e.includes(pq)&&!e.includes(uq),p;if(c.isDirectory()){let f=yt.resolve(e),h=l?await gg(e):e;if(this.fsw.closed||(p=await this._handleDir(a.watchPath,c,t,s,i,a,h),this.fsw.closed))return;f!==h&&h!==void 0&&this.fsw._symlinkPaths.set(f,h)}else if(c.isSymbolicLink()){let f=l?await gg(e):e;if(this.fsw.closed)return;let h=yt.dirname(a.watchPath);if(this.fsw._getWatchedDir(h).add(a.watchPath),this.fsw._emit(Wu,a.watchPath,c),p=await this._handleDir(h,c,t,s,e,a,f),this.fsw.closed)return;f!==void 0&&this.fsw._symlinkPaths.set(yt.resolve(e),f)}else p=this._handleFile(a.watchPath,c,t);return o(),this.fsw._addPathCloser(e,p),!1}catch(c){if(this.fsw._handleError(c))return o(),e}}};yR.exports=xg});var CR=O((uK,Ag)=>{"use strict";var Tg=require("fs"),xt=require("path"),{promisify:Cg}=require("util"),eo;try{eo=require("fsevents")}catch(r){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(r)}if(eo){let r=process.version.match(/v(\d+)\.(\d+)/);if(r&&r[1]&&r[2]){let e=Number.parseInt(r[1],10),t=Number.parseInt(r[2],10);e===8&&t<16&&(eo=void 0)}}var{EV_ADD:_g,EV_CHANGE:_q,EV_ADD_DIR:_R,EV_UNLINK:Ku,EV_ERROR:bq,STR_DATA:wq,STR_END:Sq,FSEVENT_CREATED:Eq,FSEVENT_MODIFIED:Tq,FSEVENT_DELETED:Cq,FSEVENT_MOVED:Aq,FSEVENT_UNKNOWN:Rq,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:kq,FSEVENT_TYPE_FILE:Oq,FSEVENT_TYPE_DIRECTORY:Ra,FSEVENT_TYPE_SYMLINK:TR,ROOT_GLOBSTAR:bR,DIR_SUFFIX:Mq,DOT_SLASH:wR,FUNCTION_TYPE:bg,EMPTY_FN:Pq,IDENTITY_FN:Iq}=qu(),Nq=r=>isNaN(r)?{}:{depth:r},Sg=Cg(Tg.stat),Lq=Cg(Tg.lstat),SR=Cg(Tg.realpath),Dq={stat:Sg,lstat:Lq},ks=new Map,Bq=10,jq=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),Fq=(r,e)=>({stop:eo.watch(r,e)});function Hq(r,e,t,n){let s=xt.extname(e)?xt.dirname(e):e,i=xt.dirname(s),o=ks.get(s);$q(i)&&(s=i);let a=xt.resolve(r),c=a!==e,l=(f,h,x)=>{c&&(f=f.replace(e,a)),(f===a||!f.indexOf(a+xt.sep))&&t(f,h,x)},p=!1;for(let f of ks.keys())if(e.indexOf(xt.resolve(f)+xt.sep)===0){s=f,o=ks.get(s),p=!0;break}return o||p?o.listeners.add(l):(o={listeners:new Set([l]),rawEmitter:n,watcher:Fq(s,(f,h)=>{if(!o.listeners.size||h&kq)return;let x=eo.getInfo(f,h);o.listeners.forEach(_=>{_(f,h,x)}),o.rawEmitter(x.event,f,x)})},ks.set(s,o)),()=>{let f=o.listeners;if(f.delete(l),!f.size&&(ks.delete(s),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o)})}}var $q=r=>{let e=0;for(let t of ks.keys())if(t.indexOf(r)===0&&(e++,e>=Bq))return!0;return!1},Uq=()=>eo&&ks.size<128,wg=(r,e)=>{let t=0;for(;!r.indexOf(e)&&(r=xt.dirname(r))!==e;)t++;return t},ER=(r,e)=>r.type===Ra&&e.isDirectory()||r.type===TR&&e.isSymbolicLink()||r.type===Oq&&e.isFile(),Eg=class{constructor(e){this.fsw=e}checkIgnored(e,t){let n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,t))return n.add(e),t&&t.isDirectory()&&n.add(e+bR),!0;n.delete(e),n.delete(e+bR)}addOrChange(e,t,n,s,i,o,a,c){let l=i.has(o)?_q:_g;this.handleEvent(l,e,t,n,s,i,o,a,c)}async checkExists(e,t,n,s,i,o,a,c){try{let l=await Sg(e);if(this.fsw.closed)return;ER(a,l)?this.addOrChange(e,t,n,s,i,o,a,c):this.handleEvent(Ku,e,t,n,s,i,o,a,c)}catch(l){l.code==="EACCES"?this.addOrChange(e,t,n,s,i,o,a,c):this.handleEvent(Ku,e,t,n,s,i,o,a,c)}}handleEvent(e,t,n,s,i,o,a,c,l){if(!(this.fsw.closed||this.checkIgnored(t)))if(e===Ku){let p=c.type===Ra;(p||o.has(a))&&this.fsw._remove(i,a,p)}else{if(e===_g){if(c.type===Ra&&this.fsw._getWatchedDir(t),c.type===TR&&l.followSymlinks){let f=l.depth===void 0?void 0:wg(n,s)+1;return this._addToFsEvents(t,!1,!0,f)}this.fsw._getWatchedDir(i).add(a)}let p=c.type===Ra?e+Mq:e;this.fsw._emit(p,t),p===_R&&this._addToFsEvents(t,!1,!0)}}_watchWithFsEvents(e,t,n,s){if(this.fsw.closed||this.fsw._isIgnored(e))return;let i=this.fsw.options,a=Hq(e,t,async(c,l,p)=>{if(this.fsw.closed||i.depth!==void 0&&wg(c,t)>i.depth)return;let f=n(xt.join(e,xt.relative(e,c)));if(s&&!s(f))return;let h=xt.dirname(f),x=xt.basename(f),_=this.fsw._getWatchedDir(p.type===Ra?f:h);if(jq.has(l)||p.event===Rq)if(typeof i.ignored===bg){let S;try{S=await Sg(f)}catch{}if(this.fsw.closed||this.checkIgnored(f,S))return;ER(p,S)?this.addOrChange(f,c,t,h,_,x,p,i):this.handleEvent(Ku,f,c,t,h,_,x,p,i)}else this.checkExists(f,c,t,h,_,x,p,i);else switch(p.event){case Eq:case Tq:return this.addOrChange(f,c,t,h,_,x,p,i);case Cq:case Aq:return this.checkExists(f,c,t,h,_,x,p,i)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}async _handleFsEventsSymlink(e,t,n,s){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(t))){this.fsw._symlinkPaths.set(t,!0),this.fsw._incrReadyCount();try{let i=await SR(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(i))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(i||e,o=>{let a=e;return i&&i!==wR?a=o.replace(i,e):o!==wR&&(a=xt.join(e,o)),n(a)},!1,s)}catch(i){if(this.fsw._handleError(i))return this.fsw._emitReady()}}}emitAdd(e,t,n,s,i){let o=n(e),a=t.isDirectory(),c=this.fsw._getWatchedDir(xt.dirname(o)),l=xt.basename(o);a&&this.fsw._getWatchedDir(o),!c.has(l)&&(c.add(l),(!s.ignoreInitial||i===!0)&&this.fsw._emit(a?_R:_g,o,t))}initWatch(e,t,n,s){if(this.fsw.closed)return;let i=this._watchWithFsEvents(n.watchPath,xt.resolve(e||n.watchPath),s,n.globFilter);this.fsw._addPathCloser(t,i)}async _addToFsEvents(e,t,n,s){if(this.fsw.closed)return;let i=this.fsw.options,o=typeof t===bg?t:Iq,a=this.fsw._getWatchHelpers(e);try{let c=await Dq[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))throw null;if(c.isDirectory()){if(a.globFilter||this.emitAdd(o(e),c,o,i,n),s&&s>i.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:l=>a.filterPath(l),directoryFilter:l=>a.filterDir(l),...Nq(i.depth-(s||0))}).on(wq,l=>{if(this.fsw.closed||l.stats.isDirectory()&&!a.filterPath(l))return;let p=xt.join(a.watchPath,l.path),{fullPath:f}=l;if(a.followSymlinks&&l.stats.isSymbolicLink()){let h=i.depth===void 0?void 0:wg(p,xt.resolve(a.watchPath))+1;this._handleFsEventsSymlink(p,f,o,h)}else this.emitAdd(p,l.stats,o,i,n)}).on(bq,Pq).on(Sq,()=>{this.fsw._emitReady()})}else this.emitAdd(a.watchPath,c,o,i,n),this.fsw._emitReady()}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(i.persistent&&n!==!0)if(typeof t===bg)this.initWatch(void 0,e,a,o);else{let c;try{c=await SR(a.watchPath)}catch{}this.initWatch(c,e,a,o)}}};Ag.exports=Eg;Ag.exports.canUse=Uq});var BR=O(Ug=>{"use strict";var{EventEmitter:qq}=require("events"),Hg=require("fs"),ue=require("path"),{promisify:IR}=require("util"),Wq=GC(),Ig=_A().default,Gq=CA(),Rg=ag(),zq=cR(),Vq=ig(),Kq=xR(),AR=CR(),{EV_ALL:kg,EV_READY:Yq,EV_ADD:Yu,EV_CHANGE:ka,EV_UNLINK:RR,EV_ADD_DIR:Xq,EV_UNLINK_DIR:Jq,EV_RAW:Qq,EV_ERROR:Og,STR_CLOSE:Zq,STR_END:e4,BACK_SLASH_RE:t4,DOUBLE_SLASH_RE:kR,SLASH_OR_BACK_SLASH_RE:r4,DOT_RE:n4,REPLACER_RE:s4,SLASH:Mg,SLASH_SLASH:i4,BRACE_START:o4,BANG:Ng,ONE_DOT:NR,TWO_DOTS:a4,GLOBSTAR:c4,SLASH_GLOBSTAR:Pg,ANYMATCH_OPTS:Lg,STRING_TYPE:$g,FUNCTION_TYPE:l4,EMPTY_STR:Dg,EMPTY_FN:u4,isWindows:p4,isMacos:f4,isIBMi:d4}=qu(),h4=IR(Hg.stat),m4=IR(Hg.readdir),Bg=(r=[])=>Array.isArray(r)?r:[r],LR=(r,e=[])=>(r.forEach(t=>{Array.isArray(t)?LR(t,e):e.push(t)}),e),OR=r=>{let e=LR(Bg(r));if(!e.every(t=>typeof t===$g))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(DR)},MR=r=>{let e=r.replace(t4,Mg),t=!1;for(e.startsWith(i4)&&(t=!0);e.match(kR);)e=e.replace(kR,Mg);return t&&(e=Mg+e),e},DR=r=>MR(ue.normalize(MR(r))),PR=(r=Dg)=>e=>typeof e!==$g?e:DR(ue.isAbsolute(e)?e:ue.join(r,e)),g4=(r,e)=>ue.isAbsolute(r)?r:r.startsWith(Ng)?Ng+ue.join(e,r.slice(1)):ue.join(e,r),Dr=(r,e)=>r[e]===void 0,jg=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==NR&&e!==a4&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let n=this.path;try{await m4(n)}catch{this._removeWatcher&&this._removeWatcher(ue.dirname(n),ue.basename(n))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}},v4="stat",y4="lstat",Fg=class{constructor(e,t,n,s){this.fsw=s,this.path=e=e.replace(s4,Dg),this.watchPath=t,this.fullWatchPath=ue.resolve(t),this.hasGlob=t!==e,e===Dg&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?Ig(e,void 0,Lg):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(i=>{i.length>1&&i.pop()}),this.followSymlinks=n,this.statMethod=n?v4:y4}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return ue.join(this.watchPath,ue.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===l4?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];let t=[];return(e.includes(o4)?zq.expand(e):[e]).forEach(s=>{t.push(ue.relative(this.watchPath,s).split(r4))}),t}filterDir(e){if(this.hasGlob){let t=this.getDirParts(this.checkGlobSymlink(e)),n=!1;this.unmatchedGlob=!this.dirParts.some(s=>s.every((i,o)=>(i===c4&&(n=!0),n||!t[0][o]||Ig(i,t[0][o],Lg))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Xu=class extends qq{constructor(e){super();let t={};e&&Object.assign(t,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,Dr(t,"persistent")&&(t.persistent=!0),Dr(t,"ignoreInitial")&&(t.ignoreInitial=!1),Dr(t,"ignorePermissionErrors")&&(t.ignorePermissionErrors=!1),Dr(t,"interval")&&(t.interval=100),Dr(t,"binaryInterval")&&(t.binaryInterval=300),Dr(t,"disableGlobbing")&&(t.disableGlobbing=!1),t.enableBinaryInterval=t.binaryInterval!==t.interval,Dr(t,"useFsEvents")&&(t.useFsEvents=!t.usePolling),AR.canUse()||(t.useFsEvents=!1),Dr(t,"usePolling")&&!t.useFsEvents&&(t.usePolling=f4),d4&&(t.usePolling=!0);let s=process.env.CHOKIDAR_USEPOLLING;if(s!==void 0){let c=s.toLowerCase();c==="false"||c==="0"?t.usePolling=!1:c==="true"||c==="1"?t.usePolling=!0:t.usePolling=!!c}let i=process.env.CHOKIDAR_INTERVAL;i&&(t.interval=Number.parseInt(i,10)),Dr(t,"atomic")&&(t.atomic=!t.usePolling&&!t.useFsEvents),t.atomic&&(this._pendingUnlinks=new Map),Dr(t,"followSymlinks")&&(t.followSymlinks=!0),Dr(t,"awaitWriteFinish")&&(t.awaitWriteFinish=!1),t.awaitWriteFinish===!0&&(t.awaitWriteFinish={});let o=t.awaitWriteFinish;o&&(o.stabilityThreshold||(o.stabilityThreshold=2e3),o.pollInterval||(o.pollInterval=100),this._pendingWrites=new Map),t.ignored&&(t.ignored=Bg(t.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=u4,this._readyEmitted=!0,process.nextTick(()=>this.emit(Yq)))},this._emitRaw=(...c)=>this.emit(Qq,...c),this._readyEmitted=!1,this.options=t,t.useFsEvents?this._fsEventsHandler=new AR(this):this._nodeFsHandler=new Kq(this),Object.freeze(t)}add(e,t,n){let{cwd:s,disableGlobbing:i}=this.options;this.closed=!1;let o=OR(e);return s&&(o=o.map(a=>{let c=g4(a,s);return i||!Rg(a)?c:Vq(c)})),o=o.filter(a=>a.startsWith(Ng)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+Pg),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=o.length),this.options.persistent&&(this._readyCount+=o.length),o.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async a=>{let c=await this._nodeFsHandler._addToNodeFs(a,!n,0,0,t);return c&&this._emitReady(),c})).then(a=>{this.closed||a.filter(c=>c).forEach(c=>{this.add(ue.dirname(c),ue.basename(t||c))})})),this}unwatch(e){if(this.closed)return this;let t=OR(e),{cwd:n}=this.options;return t.forEach(s=>{!ue.isAbsolute(s)&&!this._closers.has(s)&&(n&&(s=ue.join(n,s)),s=ue.resolve(s)),this._closePath(s),this._ignoredPaths.add(s),this._watched.has(s)&&this._ignoredPaths.add(s+Pg),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(n=>{let s=n();s instanceof Promise&&e.push(s)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(t=>{this[`_${t}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,n)=>{let s=this.options.cwd?ue.relative(this.options.cwd,n):n;e[s||NR]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(...t),e!==Og&&this.emit(kg,...t)}async _emit(e,t,n,s,i){if(this.closed)return;let o=this.options;p4&&(t=ue.normalize(t)),o.cwd&&(t=ue.relative(o.cwd,t));let a=[e,t];i!==void 0?a.push(n,s,i):s!==void 0?a.push(n,s):n!==void 0&&a.push(n);let c=o.awaitWriteFinish,l;if(c&&(l=this._pendingWrites.get(t)))return l.lastChange=new Date,this;if(o.atomic){if(e===RR)return this._pendingUnlinks.set(t,a),setTimeout(()=>{this._pendingUnlinks.forEach((p,f)=>{this.emit(...p),this.emit(kg,...p),this._pendingUnlinks.delete(f)})},typeof o.atomic=="number"?o.atomic:100),this;e===Yu&&this._pendingUnlinks.has(t)&&(e=a[0]=ka,this._pendingUnlinks.delete(t))}if(c&&(e===Yu||e===ka)&&this._readyEmitted){let p=(f,h)=>{f?(e=a[0]=Og,a[1]=f,this.emitWithAll(e,a)):h&&(a.length>2?a[2]=h:a.push(h),this.emitWithAll(e,a))};return this._awaitWriteFinish(t,c.stabilityThreshold,e,p),this}if(e===ka&&!this._throttle(ka,t,50))return this;if(o.alwaysStat&&n===void 0&&(e===Yu||e===Xq||e===ka)){let p=o.cwd?ue.join(o.cwd,t):t,f;try{f=await h4(p)}catch{}if(!f||this.closed)return;a.push(f)}return this.emitWithAll(e,a),this}_handleError(e){let t=e&&e.code;return e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES")&&this.emit(Og,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);let s=this._throttled.get(e),i=s.get(t);if(i)return i.count++,!1;let o,a=()=>{let l=s.get(t),p=l?l.count:0;return s.delete(t),clearTimeout(o),l&&clearTimeout(l.timeoutObject),p};o=setTimeout(a,n);let c={timeoutObject:o,clear:a,count:0};return s.set(t,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,s){let i,o=e;this.options.cwd&&!ue.isAbsolute(e)&&(o=ue.join(this.options.cwd,e));let a=new Date,c=l=>{Hg.stat(o,(p,f)=>{if(p||!this._pendingWrites.has(e)){p&&p.code!=="ENOENT"&&s(p);return}let h=Number(new Date);l&&f.size!==l.size&&(this._pendingWrites.get(e).lastChange=h);let x=this._pendingWrites.get(e);h-x.lastChange>=t?(this._pendingWrites.delete(e),s(void 0,f)):i=setTimeout(c,this.options.awaitWriteFinish.pollInterval,f)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(i),n)}),i=setTimeout(c,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,t){if(this.options.atomic&&n4.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,s=this.options.ignored,i=s&&s.map(PR(n)),o=Bg(i).filter(c=>typeof c===$g&&!Rg(c)).map(c=>c+Pg),a=this._getGlobIgnored().map(PR(n)).concat(i,o);this._userIgnored=Ig(a,void 0,Lg)}return this._userIgnored([e,t])}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e,t){let n=t||this.options.disableGlobbing||!Rg(e)?e:Gq(e),s=this.options.followSymlinks;return new Fg(e,n,s,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let t=ue.resolve(e);return this._watched.has(t)||this._watched.set(t,new jg(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;let n=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(n.toString(8)[0],10))}_remove(e,t,n){let s=ue.join(e,t),i=ue.resolve(s);if(n=n??(this._watched.has(s)||this._watched.has(i)),!this._throttle("remove",s,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(s).getChildren().forEach(h=>this._remove(s,h));let c=this._getWatchedDir(e),l=c.has(t);c.remove(t),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let p=s;if(this.options.cwd&&(p=ue.relative(this.options.cwd,s)),this.options.awaitWriteFinish&&this._pendingWrites.has(p)&&this._pendingWrites.get(p).cancelWait()===Yu)return;this._watched.delete(s),this._watched.delete(i);let f=n?Jq:RR;l&&!this._isIgnored(s)&&this._emit(f,s),this.options.useFsEvents||this._closePath(s)}_closePath(e){this._closeFile(e);let t=ue.dirname(e);this._getWatchedDir(t).remove(ue.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(n=>n()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;let n={type:kg,alwaysStat:!0,lstat:!0,...t},s=Wq(e,n);return this._streams.add(s),s.once(Zq,()=>{s=void 0}),s.once(e4,()=>{s&&(this._streams.delete(s),s=void 0)}),s}};Ug.FSWatcher=Xu;var x4=(r,e)=>{let t=new Xu(e);return t.add(r),t};Ug.watch=x4});var Ck=O((FK,Vg)=>{"use strict";var C4=Object.prototype.hasOwnProperty,Dt="~";function La(){}Object.create&&(La.prototype=Object.create(null),new La().__proto__||(Dt=!1));function A4(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function Tk(r,e,t,n,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var i=new A4(t,n||r,s),o=Dt?Dt+e:e;return r._events[o]?r._events[o].fn?r._events[o]=[r._events[o],i]:r._events[o].push(i):(r._events[o]=i,r._eventsCount++),r}function sp(r,e){--r._eventsCount===0?r._events=new La:delete r._events[e]}function kt(){this._events=new La,this._eventsCount=0}kt.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)C4.call(t,n)&&e.push(Dt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};kt.prototype.listeners=function(e){var t=Dt?Dt+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,i=n.length,o=new Array(i);s<i;s++)o[s]=n[s].fn;return o};kt.prototype.listenerCount=function(e){var t=Dt?Dt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};kt.prototype.emit=function(e,t,n,s,i,o){var a=Dt?Dt+e:e;if(!this._events[a])return!1;var c=this._events[a],l=arguments.length,p,f;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,s),!0;case 5:return c.fn.call(c.context,t,n,s,i),!0;case 6:return c.fn.call(c.context,t,n,s,i,o),!0}for(f=1,p=new Array(l-1);f<l;f++)p[f-1]=arguments[f];c.fn.apply(c.context,p)}else{var h=c.length,x;for(f=0;f<h;f++)switch(c[f].once&&this.removeListener(e,c[f].fn,void 0,!0),l){case 1:c[f].fn.call(c[f].context);break;case 2:c[f].fn.call(c[f].context,t);break;case 3:c[f].fn.call(c[f].context,t,n);break;case 4:c[f].fn.call(c[f].context,t,n,s);break;default:if(!p)for(x=1,p=new Array(l-1);x<l;x++)p[x-1]=arguments[x];c[f].fn.apply(c[f].context,p)}}return!0};kt.prototype.on=function(e,t,n){return Tk(this,e,t,n,!1)};kt.prototype.once=function(e,t,n){return Tk(this,e,t,n,!0)};kt.prototype.removeListener=function(e,t,n,s){var i=Dt?Dt+e:e;if(!this._events[i])return this;if(!t)return sp(this,i),this;var o=this._events[i];if(o.fn)o.fn===t&&(!s||o.once)&&(!n||o.context===n)&&sp(this,i);else{for(var a=0,c=[],l=o.length;a<l;a++)(o[a].fn!==t||s&&!o[a].once||n&&o[a].context!==n)&&c.push(o[a]);c.length?this._events[i]=c.length===1?c[0]:c:sp(this,i)}return this};kt.prototype.removeAllListeners=function(e){var t;return e?(t=Dt?Dt+e:e,this._events[t]&&sp(this,t)):(this._events=new La,this._eventsCount=0),this};kt.prototype.off=kt.prototype.removeListener;kt.prototype.addListener=kt.prototype.on;kt.prefixed=Dt;kt.EventEmitter=kt;typeof Vg<"u"&&(Vg.exports=kt)});var Rk=O((HK,Ak)=>{"use strict";Ak.exports=function(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var ip=O(Ok=>{var On=Ok,R4=require("url"),kk=require("util")._extend,k4=Rk(),O4=/(^|,)\s*upgrade\s*($|,)/i,Kg=/^https|wss/;On.isSSL=Kg;On.setupOutgoing=function(r,e,t,n){r.port=e[n||"target"].port||(Kg.test(e[n||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(a){r[a]=e[n||"target"][a]}),r.method=e.method||t.method,r.headers=kk({},t.headers),e.headers&&kk(r.headers,e.headers),e.auth&&(r.auth=e.auth),e.ca&&(r.ca=e.ca),Kg.test(e[n||"target"].protocol)&&(r.rejectUnauthorized=typeof e.secure>"u"?!0:e.secure),r.agent=e.agent||!1,r.localAddress=e.localAddress,r.agent||(r.headers=r.headers||{},(typeof r.headers.connection!="string"||!O4.test(r.headers.connection))&&(r.headers.connection="close"));var s=e[n||"target"],i=s&&e.prependPath!==!1&&s.path||"",o=e.toProxy?t.url:R4.parse(t.url).path||"";return o=e.ignorePath?"":o,r.path=On.urlJoin(i,o),e.changeOrigin&&(r.headers.host=k4(r.port,e[n||"target"].protocol)&&!M4(r.host)?r.host+":"+r.port:r.host),r};On.setupSocket=function(r){return r.setTimeout(0),r.setNoDelay(!0),r.setKeepAlive(!0,0),r};On.getPort=function(r){var e=r.headers.host?r.headers.host.match(/:(\d+)/):"";return e?e[1]:On.hasEncryptedConnection(r)?"443":"80"};On.hasEncryptedConnection=function(r){return!!(r.connection.encrypted||r.connection.pair)};On.urlJoin=function(){var r=Array.prototype.slice.call(arguments),e=r.length-1,t=r[e],n=t.split("?"),s;return r[e]=n.shift(),s=[r.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")],s.push.apply(s,n),s.join("?")};On.rewriteCookieProperty=function r(e,t,n){return Array.isArray(e)?e.map(function(s){return r(s,t,n)}):e.replace(new RegExp("(;\\s*"+n+"=)([^;]+)","i"),function(s,i,o){var a;if(o in t)a=t[o];else if("*"in t)a=t["*"];else return s;return a?i+a:""})};function M4(r){return!!~r.indexOf(":")}});var Nk=O((UK,Ik)=>{var Mk=require("url"),Pk=ip(),P4=/^201|30(1|2|7|8)$/;Ik.exports={removeChunked:function(e,t,n){e.httpVersion==="1.0"&&delete n.headers["transfer-encoding"]},setConnection:function(e,t,n){e.httpVersion==="1.0"?n.headers.connection=e.headers.connection||"close":e.httpVersion!=="2.0"&&!n.headers.connection&&(n.headers.connection=e.headers.connection||"keep-alive")},setRedirectHostRewrite:function(e,t,n,s){if((s.hostRewrite||s.autoRewrite||s.protocolRewrite)&&n.headers.location&&P4.test(n.statusCode)){var i=Mk.parse(s.target),o=Mk.parse(n.headers.location);if(i.host!=o.host)return;s.hostRewrite?o.host=s.hostRewrite:s.autoRewrite&&(o.host=e.headers.host),s.protocolRewrite&&(o.protocol=s.protocolRewrite),n.headers.location=o.format()}},writeHeaders:function(e,t,n,s){var i=s.cookieDomainRewrite,o=s.cookiePathRewrite,a=s.preserveHeaderKeyCase,c,l=function(h,x){x!=null&&(i&&h.toLowerCase()==="set-cookie"&&(x=Pk.rewriteCookieProperty(x,i,"domain")),o&&h.toLowerCase()==="set-cookie"&&(x=Pk.rewriteCookieProperty(x,o,"path")),t.setHeader(String(h).trim(),x))};if(typeof i=="string"&&(i={"*":i}),typeof o=="string"&&(o={"*":o}),a&&n.rawHeaders!=null){c={};for(var p=0;p<n.rawHeaders.length;p+=2){var f=n.rawHeaders[p];c[f.toLowerCase()]=f}}Object.keys(n.headers).forEach(function(h){var x=n.headers[h];a&&c&&(h=c[h]||h),l(h,x)})},writeStatusCode:function(e,t,n){n.statusMessage?(t.statusCode=n.statusCode,t.statusMessage=n.statusMessage):t.statusCode=n.statusCode}}});var Dk=O((qK,Lk)=>{var Da;Lk.exports=function(){if(!Da){try{Da=ke()("follow-redirects")}catch{}typeof Da!="function"&&(Da=function(){})}Da.apply(null,arguments)}});var $k=O((WK,ov)=>{var ja=require("url"),Ba=ja.URL,I4=require("http"),N4=require("https"),Zg=require("stream").Writable,ev=require("assert"),Bk=Dk();(function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",n=Ns(Error.captureStackTrace);!e&&(t||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var tv=!1;try{ev(new Ba(""))}catch(r){tv=r.code==="ERR_INVALID_URL"}var L4=["Authorization","Proxy-Authorization","Cookie"],D4=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],rv=["abort","aborted","connect","error","socket","timeout"],nv=Object.create(null);rv.forEach(function(r){nv[r]=function(e,t,n){this._redirectable.emit(r,e,t,n)}});var Xg=Fa("ERR_INVALID_URL","Invalid URL",TypeError),Jg=Fa("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),B4=Fa("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Jg),j4=Fa("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),F4=Fa("ERR_STREAM_WRITE_AFTER_END","write after end"),H4=Zg.prototype.destroy||Fk;function Kt(r,e){Zg.call(this),this._sanitizeOptions(r),this._options=r,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var t=this;this._onNativeResponse=function(n){try{t._processResponse(n)}catch(s){t.emit("error",s instanceof Jg?s:new Jg({cause:s}))}},this._headerFilter=new RegExp("^(?:"+L4.concat(r.sensitiveHeaders).map(z4).join("|")+")$","i"),this._performRequest()}Kt.prototype=Object.create(Zg.prototype);Kt.prototype.abort=function(){iv(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Kt.prototype.destroy=function(r){return iv(this._currentRequest,r),H4.call(this,r),this};Kt.prototype.write=function(r,e,t){if(this._ending)throw new F4;if(!Is(r)&&!W4(r))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Ns(e)&&(t=e,e=null),r.length===0){t&&t();return}this._requestBodyLength+r.length<=this._options.maxBodyLength?(this._requestBodyLength+=r.length,this._requestBodyBuffers.push({data:r,encoding:e}),this._currentRequest.write(r,e,t)):(this.emit("error",new j4),this.abort())};Kt.prototype.end=function(r,e,t){if(Ns(r)?(t=r,r=e=null):Ns(e)&&(t=e,e=null),!r)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var n=this,s=this._currentRequest;this.write(r,e,function(){n._ended=!0,s.end(null,null,t)}),this._ending=!0}};Kt.prototype.setHeader=function(r,e){this._options.headers[r]=e,this._currentRequest.setHeader(r,e)};Kt.prototype.removeHeader=function(r){delete this._options.headers[r],this._currentRequest.removeHeader(r)};Kt.prototype.setTimeout=function(r,e){var t=this;function n(o){o.setTimeout(r),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function s(o){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),i()},r),n(o)}function i(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",i),t.removeListener("error",i),t.removeListener("response",i),t.removeListener("close",i),e&&t.removeListener("timeout",e),t.socket||t._currentRequest.removeListener("socket",s)}return e&&this.on("timeout",e),this.socket?s(this.socket):this._currentRequest.once("socket",s),this.on("socket",n),this.on("abort",i),this.on("error",i),this.on("response",i),this.on("close",i),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(r){Kt.prototype[r]=function(e,t){return this._currentRequest[r](e,t)}});["aborted","connection","socket"].forEach(function(r){Object.defineProperty(Kt.prototype,r,{get:function(){return this._currentRequest[r]}})});Kt.prototype._sanitizeOptions=function(r){if(r.headers||(r.headers={}),q4(r.sensitiveHeaders)||(r.sensitiveHeaders=[]),r.host&&(r.hostname||(r.hostname=r.host),delete r.host),!r.pathname&&r.path){var e=r.path.indexOf("?");e<0?r.pathname=r.path:(r.pathname=r.path.substring(0,e),r.search=r.path.substring(e))}};Kt.prototype._performRequest=function(){var r=this._options.protocol,e=this._options.nativeProtocols[r];if(!e)throw new TypeError("Unsupported protocol "+r);if(this._options.agents){var t=r.slice(0,-1);this._options.agent=this._options.agents[t]}var n=this._currentRequest=e.request(this._options,this._onNativeResponse);n._redirectable=this;for(var s of rv)n.on(s,nv[s]);if(this._currentUrl=/^\//.test(this._options.path)?ja.format(this._options):this._options.path,this._isRedirect){var i=0,o=this,a=this._requestBodyBuffers;(function c(l){if(n===o._currentRequest)if(l)o.emit("error",l);else if(i<a.length){var p=a[i++];n.finished||n.write(p.data,p.encoding,c)}else o._ended&&n.end()})()}};Kt.prototype._processResponse=function(r){var e=r.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:r.headers,statusCode:e});var t=r.headers.location;if(!t||this._options.followRedirects===!1||e<300||e>=400){r.responseUrl=this._currentUrl,r.redirects=this._redirects,this.emit("response",r),this._requestBodyBuffers=[];return}if(iv(this._currentRequest),r.destroy(),++this._redirectCount>this._options.maxRedirects)throw new B4;var n,s=this._options.beforeRedirect;s&&(n=Object.assign({Host:r.req.getHeader("host")},this._options.headers));var i=this._options.method;((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Yg(/^content-/i,this._options.headers));var o=Yg(/^host$/i,this._options.headers),a=sv(this._currentUrl),c=o||a.host,l=/^\w+:/.test(t)?this._currentUrl:ja.format(Object.assign(a,{host:c})),p=$4(t,l);if(Bk("redirecting to",p.href),this._isRedirect=!0,Qg(p,this._options),(p.protocol!==a.protocol&&p.protocol!=="https:"||p.host!==c&&!U4(p.host,c))&&Yg(this._headerFilter,this._options.headers),Ns(s)){var f={headers:r.headers,statusCode:e},h={url:l,method:i,headers:n};s(this._options,f,h),this._sanitizeOptions(this._options)}this._performRequest()};function jk(r){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(r).forEach(function(n){var s=n+":",i=t[s]=r[n],o=e[n]=Object.create(i);function a(l,p,f){return G4(l)?l=Qg(l):Is(l)?l=Qg(sv(l)):(f=p,p=Hk(l),l={protocol:s}),Ns(p)&&(f=p,p=null),p=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},l,p),p.nativeProtocols=t,!Is(p.host)&&!Is(p.hostname)&&(p.hostname="::1"),ev.equal(p.protocol,s,"protocol mismatch"),Bk("options",p),new Kt(p,f)}function c(l,p,f){var h=o.request(l,p,f);return h.end(),h}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),e}function Fk(){}function sv(r){var e;if(tv)e=new Ba(r);else if(e=Hk(ja.parse(r)),!Is(e.protocol))throw new Xg({input:r});return e}function $4(r,e){return tv?new Ba(r,e):sv(ja.resolve(e,r))}function Hk(r){if(/^\[/.test(r.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(r.hostname))throw new Xg({input:r.href||r});if(/^\[/.test(r.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(r.host))throw new Xg({input:r.href||r});return r}function Qg(r,e){var t=e||{};for(var n of D4)t[n]=r[n];return t.hostname.startsWith("[")&&(t.hostname=t.hostname.slice(1,-1)),t.port!==""&&(t.port=Number(t.port)),t.path=t.search?t.pathname+t.search:t.pathname,t}function Yg(r,e){var t;for(var n in e)r.test(n)&&(t=e[n],delete e[n]);return t===null||typeof t>"u"?void 0:String(t).trim()}function Fa(r,e,t){function n(s){Ns(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,s||{}),this.code=r,this.message=this.cause?e+": "+this.cause.message:e}return n.prototype=new(t||Error),Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:!1},name:{value:"Error ["+r+"]",enumerable:!1}}),n}function iv(r,e){for(var t of rv)r.removeListener(t,nv[t]);r.on("error",Fk),r.destroy(e)}function U4(r,e){ev(Is(r)&&Is(e));var t=r.length-e.length-1;return t>0&&r[t]==="."&&r.endsWith(e)}function q4(r){return r instanceof Array}function Is(r){return typeof r=="string"||r instanceof String}function Ns(r){return typeof r=="function"}function W4(r){return typeof r=="object"&&"length"in r}function G4(r){return Ba&&r instanceof Ba}function z4(r){return r.replace(/[\]\\/()*+?.$]/g,"\\$&")}ov.exports=jk({http:I4,https:N4});ov.exports.wrap=jk});var qk=O((GK,Uk)=>{var V4=require("http"),K4=require("https"),Ha=Nk(),op=ip(),Y4=$k();Ha=Object.keys(Ha).map(function(r){return Ha[r]});var X4={http:V4,https:K4};Uk.exports={deleteLength:function(e,t,n){(e.method==="DELETE"||e.method==="OPTIONS")&&!e.headers["content-length"]&&(e.headers["content-length"]="0",delete e.headers["transfer-encoding"])},timeout:function(e,t,n){n.timeout&&e.socket.setTimeout(n.timeout)},XHeaders:function(e,t,n){if(n.xfwd){var s=e.isSpdy||op.hasEncryptedConnection(e),i={for:e.connection.remoteAddress||e.socket.remoteAddress,port:op.getPort(e),proto:s?"https":"http"};["for","port","proto"].forEach(function(o){e.headers["x-forwarded-"+o]=(e.headers["x-forwarded-"+o]||"")+(e.headers["x-forwarded-"+o]?",":"")+i[o]}),e.headers["x-forwarded-host"]=e.headers["x-forwarded-host"]||e.headers.host||""}},stream:function(e,t,n,s,i,o){i.emit("start",e,t,n.target||n.forward);var a=n.followRedirects?Y4:X4,c=a.http,l=a.https;if(n.forward){var p=(n.forward.protocol==="https:"?l:c).request(op.setupOutgoing(n.ssl||{},n,e,"forward")),f=_(p,n.forward);if(e.on("error",f),p.on("error",f),(n.buffer||e).pipe(p),!n.target)return t.end()}var h=(n.target.protocol==="https:"?l:c).request(op.setupOutgoing(n.ssl||{},n,e));h.on("socket",function(S){i&&!h.getHeader("expect")&&i.emit("proxyReq",h,e,t,n)}),n.proxyTimeout&&h.setTimeout(n.proxyTimeout,function(){h.abort()}),e.on("aborted",function(){h.abort()});var x=_(h,n.target);e.on("error",x),h.on("error",x);function _(S,A){return function(N){if(e.socket.destroyed&&N.code==="ECONNRESET")return i.emit("econnreset",N,e,t,A),S.abort();o?o(N,e,t,A):i.emit("error",N,e,t,A)}}(n.buffer||e).pipe(h),h.on("response",function(S){if(i&&i.emit("proxyRes",S,e,t),!t.headersSent&&!n.selfHandleResponse)for(var A=0;A<Ha.length&&!Ha[A](e,t,S,n);A++);t.finished?i&&i.emit("end",e,t,S):(S.on("end",function(){i&&i.emit("end",e,t,S)}),n.selfHandleResponse||S.pipe(t))})}}});var Gk=O((zK,Wk)=>{var J4=require("http"),Q4=require("https"),ao=ip();Wk.exports={checkMethodAndHeader:function(e,t){if(e.method!=="GET"||!e.headers.upgrade||e.headers.upgrade.toLowerCase()!=="websocket")return t.destroy(),!0},XHeaders:function(e,t,n){if(n.xfwd){var s={for:e.connection.remoteAddress||e.socket.remoteAddress,port:ao.getPort(e),proto:ao.hasEncryptedConnection(e)?"wss":"ws"};["for","port","proto"].forEach(function(i){e.headers["x-forwarded-"+i]=(e.headers["x-forwarded-"+i]||"")+(e.headers["x-forwarded-"+i]?",":"")+s[i]})}},stream:function(e,t,n,s,i,o){var a=function(p,f){return Object.keys(f).reduce(function(h,x){var _=f[x];if(!Array.isArray(_))return h.push(x+": "+_),h;for(var S=0;S<_.length;S++)h.push(x+": "+_[S]);return h},[p]).join(`\r
103
103
  `)+`\r
104
104
  \r
105
- `};no.setupSocket(t),i&&i.length&&t.unshift(i);var c=(no.isSSL.test(n.target.protocol)?d4:f4).request(no.setupOutgoing(n.ssl||{},n,e));return s&&s.emit("proxyReqWs",c,e,t,n,i),c.on("error",u),c.on("response",function(p){p.upgrade||(t.write(a("HTTP/"+p.httpVersion+" "+p.statusCode+" "+p.statusMessage,p.headers)),p.pipe(t))}),c.on("upgrade",function(p,f,m){f.on("error",u),f.on("end",function(){s.emit("close",p,f,m)}),t.on("error",function(){f.end()}),no.setupSocket(f),m&&m.length&&f.unshift(m),t.write(a("HTTP/1.1 101 Switching Protocols",p.headers)),f.pipe(t).pipe(f),s.emit("open",f),s.emit("proxySocket",f)}),c.end();function u(p){o?o(p,e,t):s.emit("error",p,e,t),t.end()}}}});var Dk=O((cK,Lk)=>{var Ik=Lk.exports,Ok=require("util")._extend,h4=require("url").parse,Nk=uk(),m4=require("http"),g4=require("https"),Mk=Ak(),Pk=kk();Ik.Server=Mi;function ev(r){return function(e){return function(t,n){var i=r==="ws"?this.wsPasses:this.webPasses,s=[].slice.call(arguments),o=s.length-1,a,c;typeof s[o]=="function"&&(c=s[o],o--);var u=e;if(!(s[o]instanceof Buffer)&&s[o]!==n&&(u=Ok({},e),Ok(u,s[o]),o--),s[o]instanceof Buffer&&(a=s[o]),["target","forward"].forEach(function(f){typeof u[f]=="string"&&(u[f]=h4(u[f]))}),!u.target&&!u.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var p=0;p<i.length&&!i[p](t,n,u,a,this,c);p++);}}}Ik.createRightProxy=ev;function Mi(r){Nk.call(this),r=r||{},r.prependPath=r.prependPath!==!1,this.web=this.proxyRequest=ev("web")(r),this.ws=this.proxyWebsocketRequest=ev("ws")(r),this.options=r,this.webPasses=Object.keys(Mk).map(function(e){return Mk[e]}),this.wsPasses=Object.keys(Pk).map(function(e){return Pk[e]}),this.on("error",this.onError,this)}require("util").inherits(Mi,Nk);Mi.prototype.onError=function(r){if(this.listeners("error").length===1)throw r};Mi.prototype.listen=function(r,e){var t=this,n=function(i,s){t.web(i,s)};return this._server=this.options.ssl?g4.createServer(this.options.ssl,n):m4.createServer(n),this.options.ws&&this._server.on("upgrade",function(i,s,o){t.ws(i,s,o)}),this._server.listen(r,e),this};Mi.prototype.close=function(r){var e=this;this._server&&this._server.close(t);function t(){e._server=null,r&&r.apply(null,arguments)}};Mi.prototype.before=function(r,e,t){if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");var n=r==="ws"?this.wsPasses:this.webPasses,i=!1;if(n.forEach(function(s,o){s.name===e&&(i=o)}),i===!1)throw new Error("No such pass");n.splice(i,0,t)};Mi.prototype.after=function(r,e,t){if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");var n=r==="ws"?this.wsPasses:this.webPasses,i=!1;if(n.forEach(function(s,o){s.name===e&&(i=o)}),i===!1)throw new Error("No such pass");n.splice(i++,0,t)}});var jk=O((lK,Bk)=>{var Ba=Dk().Server;function tv(r){return new Ba(r)}Ba.createProxyServer=tv;Ba.createServer=tv;Ba.createProxy=tv;Bk.exports=Ba});var $k=O((uK,Fk)=>{Fk.exports=jk()});var lO=O((Fa,nv)=>{(function(r,e){typeof Fa=="object"&&typeof nv=="object"?nv.exports=e(require("child_process"),require("crypto")):typeof define=="function"&&define.amd?define(["child_process","crypto"],e):typeof Fa=="object"?Fa["electron-machine-id"]=e(require("child_process"),require("crypto")):r["electron-machine-id"]=e(r.child_process,r.crypto)})(Fa,function(r,e){return(function(t){function n(s){if(i[s])return i[s].exports;var o=i[s]={exports:{},id:s,loaded:!1};return t[s].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var i={};return n.m=t,n.c=i,n.p="",n(0)})([function(t,n,i){t.exports=i(34)},function(t,n,i){var s=i(29)("wks"),o=i(33),a=i(2).Symbol,c=typeof a=="function",u=t.exports=function(p){return s[p]||(s[p]=c&&a[p]||(c?a:o)("Symbol."+p))};u.store=s},function(t,n){var i=t.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=i)},function(t,n,i){var s=i(9);t.exports=function(o){if(!s(o))throw TypeError(o+" is not an object!");return o}},function(t,n,i){t.exports=!i(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(t,n,i){var s=i(12),o=i(17);t.exports=i(4)?function(a,c,u){return s.f(a,c,o(1,u))}:function(a,c,u){return a[c]=u,a}},function(t,n){var i=t.exports={version:"2.4.0"};typeof __e=="number"&&(__e=i)},function(t,n,i){var s=i(14);t.exports=function(o,a,c){if(s(o),a===void 0)return o;switch(c){case 1:return function(u){return o.call(a,u)};case 2:return function(u,p){return o.call(a,u,p)};case 3:return function(u,p,f){return o.call(a,u,p,f)}}return function(){return o.apply(a,arguments)}}},function(t,n){var i={}.hasOwnProperty;t.exports=function(s,o){return i.call(s,o)}},function(t,n){t.exports=function(i){return typeof i=="object"?i!==null:typeof i=="function"}},function(t,n){t.exports={}},function(t,n){var i={}.toString;t.exports=function(s){return i.call(s).slice(8,-1)}},function(t,n,i){var s=i(3),o=i(26),a=i(32),c=Object.defineProperty;n.f=i(4)?Object.defineProperty:function(u,p,f){if(s(u),p=a(p,!0),s(f),o)try{return c(u,p,f)}catch{}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(u[p]=f.value),u}},function(t,n,i){var s=i(42),o=i(15);t.exports=function(a){return s(o(a))}},function(t,n){t.exports=function(i){if(typeof i!="function")throw TypeError(i+" is not a function!");return i}},function(t,n){t.exports=function(i){if(i==null)throw TypeError("Can't call method on "+i);return i}},function(t,n,i){var s=i(9),o=i(2).document,a=s(o)&&s(o.createElement);t.exports=function(c){return a?o.createElement(c):{}}},function(t,n){t.exports=function(i,s){return{enumerable:!(1&i),configurable:!(2&i),writable:!(4&i),value:s}}},function(t,n,i){var s=i(12).f,o=i(8),a=i(1)("toStringTag");t.exports=function(c,u,p){c&&!o(c=p?c:c.prototype,a)&&s(c,a,{configurable:!0,value:u})}},function(t,n,i){var s=i(29)("keys"),o=i(33);t.exports=function(a){return s[a]||(s[a]=o(a))}},function(t,n){var i=Math.ceil,s=Math.floor;t.exports=function(o){return isNaN(o=+o)?0:(o>0?s:i)(o)}},function(t,n,i){var s=i(11),o=i(1)("toStringTag"),a=s((function(){return arguments})())=="Arguments",c=function(u,p){try{return u[p]}catch{}};t.exports=function(u){var p,f,m;return u===void 0?"Undefined":u===null?"Null":typeof(f=c(p=Object(u),o))=="string"?f:a?s(p):(m=s(p))=="Object"&&typeof p.callee=="function"?"Arguments":m}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,i){var s=i(2),o=i(6),a=i(7),c=i(5),u="prototype",p=function(f,m,y){var _,S,A,M=f&p.F,L=f&p.G,N=f&p.S,j=f&p.P,W=f&p.B,q=f&p.W,G=L?o:o[m]||(o[m]={}),P=G[u],$=L?s:N?s[m]:(s[m]||{})[u];L&&(y=m);for(_ in y)S=!M&&$&&$[_]!==void 0,S&&_ in G||(A=S?$[_]:y[_],G[_]=L&&typeof $[_]!="function"?y[_]:W&&S?a(A,s):q&&$[_]==A?(function(T){var l=function(h,x,w){if(this instanceof T){switch(arguments.length){case 0:return new T;case 1:return new T(h);case 2:return new T(h,x)}return new T(h,x,w)}return T.apply(this,arguments)};return l[u]=T[u],l})(A):j&&typeof A=="function"?a(Function.call,A):A,j&&((G.virtual||(G.virtual={}))[_]=A,f&p.R&&P&&!P[_]&&c(P,_,A)))};p.F=1,p.G=2,p.S=4,p.P=8,p.B=16,p.W=32,p.U=64,p.R=128,t.exports=p},function(t,n){t.exports=function(i){try{return!!i()}catch{return!0}}},function(t,n,i){t.exports=i(2).document&&document.documentElement},function(t,n,i){t.exports=!i(4)&&!i(24)(function(){return Object.defineProperty(i(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(t,n,i){"use strict";var s=i(28),o=i(23),a=i(57),c=i(5),u=i(8),p=i(10),f=i(45),m=i(18),y=i(52),_=i(1)("iterator"),S=!([].keys&&"next"in[].keys()),A="@@iterator",M="keys",L="values",N=function(){return this};t.exports=function(j,W,q,G,P,$,T){f(q,W,G);var l,h,x,w=function(D){if(!S&&D in b)return b[D];switch(D){case M:return function(){return new q(this,D)};case L:return function(){return new q(this,D)}}return function(){return new q(this,D)}},g=W+" Iterator",v=P==L,C=!1,b=j.prototype,d=b[_]||b[A]||P&&b[P],E=d||w(P),U=P?v?w("entries"):E:void 0,I=W=="Array"&&b.entries||d;if(I&&(x=y(I.call(new j)),x!==Object.prototype&&(m(x,g,!0),s||u(x,_)||c(x,_,N))),v&&d&&d.name!==L&&(C=!0,E=function(){return d.call(this)}),s&&!T||!S&&!C&&b[_]||c(b,_,E),p[W]=E,p[g]=N,P)if(l={values:v?E:w(L),keys:$?E:w(M),entries:U},T)for(h in l)h in b||a(b,h,l[h]);else o(o.P+o.F*(S||C),W,l);return l}},function(t,n){t.exports=!0},function(t,n,i){var s=i(2),o="__core-js_shared__",a=s[o]||(s[o]={});t.exports=function(c){return a[c]||(a[c]={})}},function(t,n,i){var s,o,a,c=i(7),u=i(41),p=i(25),f=i(16),m=i(2),y=m.process,_=m.setImmediate,S=m.clearImmediate,A=m.MessageChannel,M=0,L={},N="onreadystatechange",j=function(){var q=+this;if(L.hasOwnProperty(q)){var G=L[q];delete L[q],G()}},W=function(q){j.call(q.data)};_&&S||(_=function(q){for(var G=[],P=1;arguments.length>P;)G.push(arguments[P++]);return L[++M]=function(){u(typeof q=="function"?q:Function(q),G)},s(M),M},S=function(q){delete L[q]},i(11)(y)=="process"?s=function(q){y.nextTick(c(j,q,1))}:A?(o=new A,a=o.port2,o.port1.onmessage=W,s=c(a.postMessage,a,1)):m.addEventListener&&typeof postMessage=="function"&&!m.importScripts?(s=function(q){m.postMessage(q+"","*")},m.addEventListener("message",W,!1)):s=N in f("script")?function(q){p.appendChild(f("script"))[N]=function(){p.removeChild(this),j.call(q)}}:function(q){setTimeout(c(j,q,1),0)}),t.exports={set:_,clear:S}},function(t,n,i){var s=i(20),o=Math.min;t.exports=function(a){return a>0?o(s(a),9007199254740991):0}},function(t,n,i){var s=i(9);t.exports=function(o,a){if(!s(o))return o;var c,u;if(a&&typeof(c=o.toString)=="function"&&!s(u=c.call(o))||typeof(c=o.valueOf)=="function"&&!s(u=c.call(o))||!a&&typeof(c=o.toString)=="function"&&!s(u=c.call(o)))return u;throw TypeError("Can't convert object to primitive value")}},function(t,n){var i=0,s=Math.random();t.exports=function(o){return"Symbol(".concat(o===void 0?"":o,")_",(++i+s).toString(36))}},function(t,n,i){"use strict";function s(N){return N&&N.__esModule?N:{default:N}}function o(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function a(N){return(0,_.createHash)("sha256").update(N).digest("hex")}function c(N){switch(A){case"darwin":return N.split("IOPlatformUUID")[1].split(`
106
- `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return N.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return N.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return N.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function u(N){var j=c((0,y.execSync)(L[A]).toString());return N?j:a(j)}function p(N){return new m.default(function(j,W){return(0,y.exec)(L[A],{},function(q,G,P){if(q)return W(new Error("Error while obtaining machine id: "+q.stack));var $=c(G.toString());return j(N?$:a($))})})}Object.defineProperty(n,"__esModule",{value:!0});var f=i(35),m=s(f);n.machineIdSync=u,n.machineId=p;var y=i(70),_=i(71),S=process,A=S.platform,M={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},L={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:M[o()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(t,n,i){t.exports={default:i(36),__esModule:!0}},function(t,n,i){i(66),i(68),i(69),i(67),t.exports=i(6).Promise},function(t,n){t.exports=function(){}},function(t,n){t.exports=function(i,s,o,a){if(!(i instanceof s)||a!==void 0&&a in i)throw TypeError(o+": incorrect invocation!");return i}},function(t,n,i){var s=i(13),o=i(31),a=i(62);t.exports=function(c){return function(u,p,f){var m,y=s(u),_=o(y.length),S=a(f,_);if(c&&p!=p){for(;_>S;)if(m=y[S++],m!=m)return!0}else for(;_>S;S++)if((c||S in y)&&y[S]===p)return c||S||0;return!c&&-1}}},function(t,y,i){var s=i(7),o=i(44),a=i(43),c=i(3),u=i(31),p=i(64),f={},m={},y=t.exports=function(_,S,A,M,L){var N,j,W,q,G=L?function(){return _}:p(_),P=s(A,M,S?2:1),$=0;if(typeof G!="function")throw TypeError(_+" is not iterable!");if(a(G)){for(N=u(_.length);N>$;$++)if(q=S?P(c(j=_[$])[0],j[1]):P(_[$]),q===f||q===m)return q}else for(W=G.call(_);!(j=W.next()).done;)if(q=o(W,P,j.value,S),q===f||q===m)return q};y.BREAK=f,y.RETURN=m},function(t,n){t.exports=function(i,s,o){var a=o===void 0;switch(s.length){case 0:return a?i():i.call(o);case 1:return a?i(s[0]):i.call(o,s[0]);case 2:return a?i(s[0],s[1]):i.call(o,s[0],s[1]);case 3:return a?i(s[0],s[1],s[2]):i.call(o,s[0],s[1],s[2]);case 4:return a?i(s[0],s[1],s[2],s[3]):i.call(o,s[0],s[1],s[2],s[3])}return i.apply(o,s)}},function(t,n,i){var s=i(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(o){return s(o)=="String"?o.split(""):Object(o)}},function(t,n,i){var s=i(10),o=i(1)("iterator"),a=Array.prototype;t.exports=function(c){return c!==void 0&&(s.Array===c||a[o]===c)}},function(t,n,i){var s=i(3);t.exports=function(o,a,c,u){try{return u?a(s(c)[0],c[1]):a(c)}catch(f){var p=o.return;throw p!==void 0&&s(p.call(o)),f}}},function(t,n,i){"use strict";var s=i(49),o=i(17),a=i(18),c={};i(5)(c,i(1)("iterator"),function(){return this}),t.exports=function(u,p,f){u.prototype=s(c,{next:o(1,f)}),a(u,p+" Iterator")}},function(t,n,i){var s=i(1)("iterator"),o=!1;try{var a=[7][s]();a.return=function(){o=!0},Array.from(a,function(){throw 2})}catch{}t.exports=function(c,u){if(!u&&!o)return!1;var p=!1;try{var f=[7],m=f[s]();m.next=function(){return{done:p=!0}},f[s]=function(){return m},c(f)}catch{}return p}},function(t,n){t.exports=function(i,s){return{value:s,done:!!i}}},function(t,n,i){var s=i(2),o=i(30).set,a=s.MutationObserver||s.WebKitMutationObserver,c=s.process,u=s.Promise,p=i(11)(c)=="process";t.exports=function(){var f,m,y,_=function(){var L,N;for(p&&(L=c.domain)&&L.exit();f;){N=f.fn,f=f.next;try{N()}catch(j){throw f?y():m=void 0,j}}m=void 0,L&&L.enter()};if(p)y=function(){c.nextTick(_)};else if(a){var S=!0,A=document.createTextNode("");new a(_).observe(A,{characterData:!0}),y=function(){A.data=S=!S}}else if(u&&u.resolve){var M=u.resolve();y=function(){M.then(_)}}else y=function(){o.call(s,_)};return function(L){var N={fn:L,next:void 0};m&&(m.next=N),f||(f=N,y()),m=N}}},function(t,n,i){var s=i(3),o=i(50),a=i(22),c=i(19)("IE_PROTO"),u=function(){},p="prototype",f=function(){var m,y=i(16)("iframe"),_=a.length,S=">";for(y.style.display="none",i(25).appendChild(y),y.src="javascript:",m=y.contentWindow.document,m.open(),m.write("<script>document.F=Object</script"+S),m.close(),f=m.F;_--;)delete f[p][a[_]];return f()};t.exports=Object.create||function(m,y){var _;return m!==null?(u[p]=s(m),_=new u,u[p]=null,_[c]=m):_=f(),y===void 0?_:o(_,y)}},function(t,n,i){var s=i(12),o=i(3),a=i(54);t.exports=i(4)?Object.defineProperties:function(c,u){o(c);for(var p,f=a(u),m=f.length,y=0;m>y;)s.f(c,p=f[y++],u[p]);return c}},function(t,n,i){var s=i(55),o=i(17),a=i(13),c=i(32),u=i(8),p=i(26),f=Object.getOwnPropertyDescriptor;n.f=i(4)?f:function(m,y){if(m=a(m),y=c(y,!0),p)try{return f(m,y)}catch{}if(u(m,y))return o(!s.f.call(m,y),m[y])}},function(t,n,i){var s=i(8),o=i(63),a=i(19)("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(u){return u=o(u),s(u,a)?u[a]:typeof u.constructor=="function"&&u instanceof u.constructor?u.constructor.prototype:u instanceof Object?c:null}},function(t,n,i){var s=i(8),o=i(13),a=i(39)(!1),c=i(19)("IE_PROTO");t.exports=function(u,p){var f,m=o(u),y=0,_=[];for(f in m)f!=c&&s(m,f)&&_.push(f);for(;p.length>y;)s(m,f=p[y++])&&(~a(_,f)||_.push(f));return _}},function(t,n,i){var s=i(53),o=i(22);t.exports=Object.keys||function(a){return s(a,o)}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,i){var s=i(5);t.exports=function(o,a,c){for(var u in a)c&&o[u]?o[u]=a[u]:s(o,u,a[u]);return o}},function(t,n,i){t.exports=i(5)},function(t,n,i){var s=i(9),o=i(3),a=function(c,u){if(o(c),!s(u)&&u!==null)throw TypeError(u+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?(function(c,u,p){try{p=i(7)(Function.call,i(51).f(Object.prototype,"__proto__").set,2),p(c,[]),u=!(c instanceof Array)}catch{u=!0}return function(f,m){return a(f,m),u?f.__proto__=m:p(f,m),f}})({},!1):void 0),check:a}},function(t,n,i){"use strict";var s=i(2),o=i(6),a=i(12),c=i(4),u=i(1)("species");t.exports=function(p){var f=typeof o[p]=="function"?o[p]:s[p];c&&f&&!f[u]&&a.f(f,u,{configurable:!0,get:function(){return this}})}},function(t,n,i){var s=i(3),o=i(14),a=i(1)("species");t.exports=function(c,u){var p,f=s(c).constructor;return f===void 0||(p=s(f)[a])==null?u:o(p)}},function(t,n,i){var s=i(20),o=i(15);t.exports=function(a){return function(c,u){var p,f,m=String(o(c)),y=s(u),_=m.length;return y<0||y>=_?a?"":void 0:(p=m.charCodeAt(y),p<55296||p>56319||y+1===_||(f=m.charCodeAt(y+1))<56320||f>57343?a?m.charAt(y):p:a?m.slice(y,y+2):(p-55296<<10)+(f-56320)+65536)}}},function(t,n,i){var s=i(20),o=Math.max,a=Math.min;t.exports=function(c,u){return c=s(c),c<0?o(c+u,0):a(c,u)}},function(t,n,i){var s=i(15);t.exports=function(o){return Object(s(o))}},function(t,n,i){var s=i(21),o=i(1)("iterator"),a=i(10);t.exports=i(6).getIteratorMethod=function(c){if(c!=null)return c[o]||c["@@iterator"]||a[s(c)]}},function(t,n,i){"use strict";var s=i(37),o=i(47),a=i(10),c=i(13);t.exports=i(27)(Array,"Array",function(u,p){this._t=c(u),this._i=0,this._k=p},function(){var u=this._t,p=this._k,f=this._i++;return!u||f>=u.length?(this._t=void 0,o(1)):p=="keys"?o(0,f):p=="values"?o(0,u[f]):o(0,[f,u[f]])},"values"),a.Arguments=a.Array,s("keys"),s("values"),s("entries")},function(t,n){},function(t,n,i){"use strict";var s,o,a,c=i(28),u=i(2),p=i(7),f=i(21),m=i(23),y=i(9),_=(i(3),i(14)),S=i(38),A=i(40),M=(i(58).set,i(60)),L=i(30).set,N=i(48)(),j="Promise",W=u.TypeError,G=u.process,q=u[j],G=u.process,P=f(G)=="process",$=function(){},T=!!(function(){try{var I=q.resolve(1),D=(I.constructor={})[i(1)("species")]=function(H){H($,$)};return(P||typeof PromiseRejectionEvent=="function")&&I.then($)instanceof D}catch{}})(),l=function(I,D){return I===D||I===q&&D===a},h=function(I){var D;return!(!y(I)||typeof(D=I.then)!="function")&&D},x=function(I){return l(q,I)?new w(I):new o(I)},w=o=function(I){var D,H;this.promise=new I(function(V,B){if(D!==void 0||H!==void 0)throw W("Bad Promise constructor");D=V,H=B}),this.resolve=_(D),this.reject=_(H)},g=function(I){try{I()}catch(D){return{error:D}}},v=function(I,D){if(!I._n){I._n=!0;var H=I._c;N(function(){for(var V=I._v,B=I._s==1,me=0,ie=function(R){var X,k,F=B?R.ok:R.fail,Q=R.resolve,K=R.reject,z=R.domain;try{F?(B||(I._h==2&&d(I),I._h=1),F===!0?X=V:(z&&z.enter(),X=F(V),z&&z.exit()),X===R.promise?K(W("Promise-chain cycle")):(k=h(X))?k.call(X,Q,K):Q(X)):K(V)}catch(ge){K(ge)}};H.length>me;)ie(H[me++]);I._c=[],I._n=!1,D&&!I._h&&C(I)})}},C=function(I){L.call(u,function(){var D,H,V,B=I._v;if(b(I)&&(D=g(function(){P?G.emit("unhandledRejection",B,I):(H=u.onunhandledrejection)?H({promise:I,reason:B}):(V=u.console)&&V.error&&V.error("Unhandled promise rejection",B)}),I._h=P||b(I)?2:1),I._a=void 0,D)throw D.error})},b=function(I){if(I._h==1)return!1;for(var D,H=I._a||I._c,V=0;H.length>V;)if(D=H[V++],D.fail||!b(D.promise))return!1;return!0},d=function(I){L.call(u,function(){var D;P?G.emit("rejectionHandled",I):(D=u.onrejectionhandled)&&D({promise:I,reason:I._v})})},E=function(I){var D=this;D._d||(D._d=!0,D=D._w||D,D._v=I,D._s=2,D._a||(D._a=D._c.slice()),v(D,!0))},U=function(I){var D,H=this;if(!H._d){H._d=!0,H=H._w||H;try{if(H===I)throw W("Promise can't be resolved itself");(D=h(I))?N(function(){var V={_w:H,_d:!1};try{D.call(I,p(U,V,1),p(E,V,1))}catch(B){E.call(V,B)}}):(H._v=I,H._s=1,v(H,!1))}catch(V){E.call({_w:H,_d:!1},V)}}};T||(q=function(I){S(this,q,j,"_h"),_(I),s.call(this);try{I(p(U,this,1),p(E,this,1))}catch(D){E.call(this,D)}},s=function(I){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},s.prototype=i(56)(q.prototype,{then:function(I,D){var H=x(M(this,q));return H.ok=typeof I!="function"||I,H.fail=typeof D=="function"&&D,H.domain=P?G.domain:void 0,this._c.push(H),this._a&&this._a.push(H),this._s&&v(this,!1),H.promise},catch:function(I){return this.then(void 0,I)}}),w=function(){var I=new s;this.promise=I,this.resolve=p(U,I,1),this.reject=p(E,I,1)}),m(m.G+m.W+m.F*!T,{Promise:q}),i(18)(q,j),i(59)(j),a=i(6)[j],m(m.S+m.F*!T,j,{reject:function(I){var D=x(this),H=D.reject;return H(I),D.promise}}),m(m.S+m.F*(c||!T),j,{resolve:function(I){if(I instanceof q&&l(I.constructor,this))return I;var D=x(this),H=D.resolve;return H(I),D.promise}}),m(m.S+m.F*!(T&&i(46)(function(I){q.all(I).catch($)})),j,{all:function(I){var D=this,H=x(D),V=H.resolve,B=H.reject,me=g(function(){var ie=[],R=0,X=1;A(I,!1,function(k){var F=R++,Q=!1;ie.push(void 0),X++,D.resolve(k).then(function(K){Q||(Q=!0,ie[F]=K,--X||V(ie))},B)}),--X||V(ie)});return me&&B(me.error),H.promise},race:function(I){var D=this,H=x(D),V=H.reject,B=g(function(){A(I,!1,function(me){D.resolve(me).then(H.resolve,V)})});return B&&V(B.error),H.promise}})},function(t,n,i){"use strict";var s=i(61)(!0);i(27)(String,"String",function(o){this._t=String(o),this._i=0},function(){var o,a=this._t,c=this._i;return c>=a.length?{value:void 0,done:!0}:(o=s(a,c),this._i+=o.length,{value:o,done:!1})})},function(t,n,i){i(65);for(var s=i(2),o=i(5),a=i(10),c=i(1)("toStringTag"),u=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],p=0;p<5;p++){var f=u[p],m=s[f],y=m&&m.prototype;y&&!y[c]&&o(y,c,f),a[f]=a.Array}},function(t,n){t.exports=require("child_process")},function(t,n){t.exports=require("crypto")}])})});var q4={};Jr(q4,{startServer:()=>qO});module.exports=YO(q4);var sp=require("http"),op=require("child_process"),Pi=require("fs"),tr=require("path"),$O=require("url");var wv=(r=0)=>e=>`\x1B[${e+r}m`,Sv=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,Ev=(r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`,_e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},G4=Object.keys(_e.modifier),XO=Object.keys(_e.color),JO=Object.keys(_e.bgColor),z4=[...XO,...JO];function QO(){let r=new Map;for(let[e,t]of Object.entries(_e)){for(let[n,i]of Object.entries(t))_e[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[n]=_e[n],r.set(i[0],i[1]);Object.defineProperty(_e,e,{value:t,enumerable:!1})}return Object.defineProperty(_e,"codes",{value:r,enumerable:!1}),_e.color.close="\x1B[39m",_e.bgColor.close="\x1B[49m",_e.color.ansi=wv(),_e.color.ansi256=Sv(),_e.color.ansi16m=Ev(),_e.bgColor.ansi=wv(10),_e.bgColor.ansi256=Sv(10),_e.bgColor.ansi16m=Ev(10),Object.defineProperties(_e,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>_e.rgbToAnsi256(..._e.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,i;if(e>=232)t=((e-232)*10+8)/255,n=t,i=t;else{e-=16;let a=e%36;t=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(t,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>_e.ansi256ToAnsi(_e.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>_e.ansi256ToAnsi(_e.hexToAnsi256(e)),enumerable:!1}}),_e}var ZO=QO(),_r=ZO;var qa=J(require("node:process"),1),Cv=J(require("node:os"),1),Cp=J(require("node:tty"),1);function rr(r,e=globalThis.Deno?globalThis.Deno.args:qa.default.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:be}=qa.default,Ua;rr("no-color")||rr("no-colors")||rr("color=false")||rr("color=never")?Ua=0:(rr("color")||rr("colors")||rr("color=true")||rr("color=always"))&&(Ua=1);function eM(){if("FORCE_COLOR"in be)return be.FORCE_COLOR==="true"?1:be.FORCE_COLOR==="false"?0:be.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(be.FORCE_COLOR,10),3)}function tM(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function rM(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let n=eM();n!==void 0&&(Ua=n);let i=t?Ua:n;if(i===0)return 0;if(t){if(rr("color=16m")||rr("color=full")||rr("color=truecolor"))return 3;if(rr("color=256"))return 2}if("TF_BUILD"in be&&"AGENT_NAME"in be)return 1;if(r&&!e&&i===void 0)return 0;let s=i||0;if(be.TERM==="dumb")return s;if(qa.default.platform==="win32"){let o=Cv.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in be)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in be)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in be)||be.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in be)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(be.TEAMCITY_VERSION)?1:0;if(be.COLORTERM==="truecolor"||be.TERM==="xterm-kitty"||be.TERM==="xterm-ghostty"||be.TERM==="wezterm")return 3;if("TERM_PROGRAM"in be){let o=Number.parseInt((be.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(be.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(be.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(be.TERM)||"COLORTERM"in be?1:s}function Tv(r,e={}){let t=rM(r,{streamIsTTY:r&&r.isTTY,...e});return tM(t)}var nM={stdout:Tv({isTTY:Cp.default.isatty(1)}),stderr:Tv({isTTY:Cp.default.isatty(2)})},Av=nM;function Rv(r,e,t){let n=r.indexOf(e);if(n===-1)return r;let i=e.length,s=0,o="";do o+=r.slice(s,n)+e+t,s=n+i,n=r.indexOf(e,s);while(n!==-1);return o+=r.slice(s),o}function kv(r,e,t,n){let i=0,s="";do{let o=r[n-1]==="\r";s+=r.slice(i,o?n-1:n)+e+(o?`\r
105
+ `};ao.setupSocket(t),s&&s.length&&t.unshift(s);var c=(ao.isSSL.test(n.target.protocol)?Q4:J4).request(ao.setupOutgoing(n.ssl||{},n,e));return i&&i.emit("proxyReqWs",c,e,t,n,s),c.on("error",l),c.on("response",function(p){p.upgrade||(t.write(a("HTTP/"+p.httpVersion+" "+p.statusCode+" "+p.statusMessage,p.headers)),p.pipe(t))}),c.on("upgrade",function(p,f,h){f.on("error",l),f.on("end",function(){i.emit("close",p,f,h)}),t.on("error",function(){f.end()}),ao.setupSocket(f),h&&h.length&&f.unshift(h),t.write(a("HTTP/1.1 101 Switching Protocols",p.headers)),f.pipe(t).pipe(f),i.emit("open",f),i.emit("proxySocket",f)}),c.end();function l(p){o?o(p,e,t):i.emit("error",p,e,t),t.end()}}}});var Qk=O((VK,Jk)=>{var Yk=Jk.exports,zk=require("util")._extend,Z4=require("url").parse,Xk=Ck(),e6=require("http"),t6=require("https"),Vk=qk(),Kk=Gk();Yk.Server=Ls;function av(r){return function(e){return function(t,n){var s=r==="ws"?this.wsPasses:this.webPasses,i=[].slice.call(arguments),o=i.length-1,a,c;typeof i[o]=="function"&&(c=i[o],o--);var l=e;if(!(i[o]instanceof Buffer)&&i[o]!==n&&(l=zk({},e),zk(l,i[o]),o--),i[o]instanceof Buffer&&(a=i[o]),["target","forward"].forEach(function(f){typeof l[f]=="string"&&(l[f]=Z4(l[f]))}),!l.target&&!l.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var p=0;p<s.length&&!s[p](t,n,l,a,this,c);p++);}}}Yk.createRightProxy=av;function Ls(r){Xk.call(this),r=r||{},r.prependPath=r.prependPath!==!1,this.web=this.proxyRequest=av("web")(r),this.ws=this.proxyWebsocketRequest=av("ws")(r),this.options=r,this.webPasses=Object.keys(Vk).map(function(e){return Vk[e]}),this.wsPasses=Object.keys(Kk).map(function(e){return Kk[e]}),this.on("error",this.onError,this)}require("util").inherits(Ls,Xk);Ls.prototype.onError=function(r){if(this.listeners("error").length===1)throw r};Ls.prototype.listen=function(r,e){var t=this,n=function(s,i){t.web(s,i)};return this._server=this.options.ssl?t6.createServer(this.options.ssl,n):e6.createServer(n),this.options.ws&&this._server.on("upgrade",function(s,i,o){t.ws(s,i,o)}),this._server.listen(r,e),this};Ls.prototype.close=function(r){var e=this;this._server&&this._server.close(t);function t(){e._server=null,r&&r.apply(null,arguments)}};Ls.prototype.before=function(r,e,t){if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");var n=r==="ws"?this.wsPasses:this.webPasses,s=!1;if(n.forEach(function(i,o){i.name===e&&(s=o)}),s===!1)throw new Error("No such pass");n.splice(s,0,t)};Ls.prototype.after=function(r,e,t){if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");var n=r==="ws"?this.wsPasses:this.webPasses,s=!1;if(n.forEach(function(i,o){i.name===e&&(s=o)}),s===!1)throw new Error("No such pass");n.splice(s++,0,t)}});var eO=O((KK,Zk)=>{var $a=Qk().Server;function cv(r){return new $a(r)}$a.createProxyServer=cv;$a.createServer=cv;$a.createProxy=cv;Zk.exports=$a});var rO=O((YK,tO)=>{tO.exports=eO()});var TO=O((qa,uv)=>{(function(r,e){typeof qa=="object"&&typeof uv=="object"?uv.exports=e(require("child_process"),require("crypto")):typeof define=="function"&&define.amd?define(["child_process","crypto"],e):typeof qa=="object"?qa["electron-machine-id"]=e(require("child_process"),require("crypto")):r["electron-machine-id"]=e(r.child_process,r.crypto)})(qa,function(r,e){return(function(t){function n(i){if(s[i])return s[i].exports;var o=s[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var s={};return n.m=t,n.c=s,n.p="",n(0)})([function(t,n,s){t.exports=s(34)},function(t,n,s){var i=s(29)("wks"),o=s(33),a=s(2).Symbol,c=typeof a=="function",l=t.exports=function(p){return i[p]||(i[p]=c&&a[p]||(c?a:o)("Symbol."+p))};l.store=i},function(t,n){var s=t.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=s)},function(t,n,s){var i=s(9);t.exports=function(o){if(!i(o))throw TypeError(o+" is not an object!");return o}},function(t,n,s){t.exports=!s(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(t,n,s){var i=s(12),o=s(17);t.exports=s(4)?function(a,c,l){return i.f(a,c,o(1,l))}:function(a,c,l){return a[c]=l,a}},function(t,n){var s=t.exports={version:"2.4.0"};typeof __e=="number"&&(__e=s)},function(t,n,s){var i=s(14);t.exports=function(o,a,c){if(i(o),a===void 0)return o;switch(c){case 1:return function(l){return o.call(a,l)};case 2:return function(l,p){return o.call(a,l,p)};case 3:return function(l,p,f){return o.call(a,l,p,f)}}return function(){return o.apply(a,arguments)}}},function(t,n){var s={}.hasOwnProperty;t.exports=function(i,o){return s.call(i,o)}},function(t,n){t.exports=function(s){return typeof s=="object"?s!==null:typeof s=="function"}},function(t,n){t.exports={}},function(t,n){var s={}.toString;t.exports=function(i){return s.call(i).slice(8,-1)}},function(t,n,s){var i=s(3),o=s(26),a=s(32),c=Object.defineProperty;n.f=s(4)?Object.defineProperty:function(l,p,f){if(i(l),p=a(p,!0),i(f),o)try{return c(l,p,f)}catch{}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(l[p]=f.value),l}},function(t,n,s){var i=s(42),o=s(15);t.exports=function(a){return i(o(a))}},function(t,n){t.exports=function(s){if(typeof s!="function")throw TypeError(s+" is not a function!");return s}},function(t,n){t.exports=function(s){if(s==null)throw TypeError("Can't call method on "+s);return s}},function(t,n,s){var i=s(9),o=s(2).document,a=i(o)&&i(o.createElement);t.exports=function(c){return a?o.createElement(c):{}}},function(t,n){t.exports=function(s,i){return{enumerable:!(1&s),configurable:!(2&s),writable:!(4&s),value:i}}},function(t,n,s){var i=s(12).f,o=s(8),a=s(1)("toStringTag");t.exports=function(c,l,p){c&&!o(c=p?c:c.prototype,a)&&i(c,a,{configurable:!0,value:l})}},function(t,n,s){var i=s(29)("keys"),o=s(33);t.exports=function(a){return i[a]||(i[a]=o(a))}},function(t,n){var s=Math.ceil,i=Math.floor;t.exports=function(o){return isNaN(o=+o)?0:(o>0?i:s)(o)}},function(t,n,s){var i=s(11),o=s(1)("toStringTag"),a=i((function(){return arguments})())=="Arguments",c=function(l,p){try{return l[p]}catch{}};t.exports=function(l){var p,f,h;return l===void 0?"Undefined":l===null?"Null":typeof(f=c(p=Object(l),o))=="string"?f:a?i(p):(h=i(p))=="Object"&&typeof p.callee=="function"?"Arguments":h}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,s){var i=s(2),o=s(6),a=s(7),c=s(5),l="prototype",p=function(f,h,x){var _,S,A,M=f&p.F,N=f&p.G,L=f&p.S,j=f&p.P,W=f&p.B,q=f&p.W,G=N?o:o[h]||(o[h]={}),P=G[l],H=N?i:L?i[h]:(i[h]||{})[l];N&&(x=h);for(_ in x)S=!M&&H&&H[_]!==void 0,S&&_ in G||(A=S?H[_]:x[_],G[_]=N&&typeof H[_]!="function"?x[_]:W&&S?a(A,i):q&&H[_]==A?(function(T){var u=function(m,y,w){if(this instanceof T){switch(arguments.length){case 0:return new T;case 1:return new T(m);case 2:return new T(m,y)}return new T(m,y,w)}return T.apply(this,arguments)};return u[l]=T[l],u})(A):j&&typeof A=="function"?a(Function.call,A):A,j&&((G.virtual||(G.virtual={}))[_]=A,f&p.R&&P&&!P[_]&&c(P,_,A)))};p.F=1,p.G=2,p.S=4,p.P=8,p.B=16,p.W=32,p.U=64,p.R=128,t.exports=p},function(t,n){t.exports=function(s){try{return!!s()}catch{return!0}}},function(t,n,s){t.exports=s(2).document&&document.documentElement},function(t,n,s){t.exports=!s(4)&&!s(24)(function(){return Object.defineProperty(s(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(t,n,s){"use strict";var i=s(28),o=s(23),a=s(57),c=s(5),l=s(8),p=s(10),f=s(45),h=s(18),x=s(52),_=s(1)("iterator"),S=!([].keys&&"next"in[].keys()),A="@@iterator",M="keys",N="values",L=function(){return this};t.exports=function(j,W,q,G,P,H,T){f(q,W,G);var u,m,y,w=function(D){if(!S&&D in b)return b[D];switch(D){case M:return function(){return new q(this,D)};case N:return function(){return new q(this,D)}}return function(){return new q(this,D)}},g=W+" Iterator",v=P==N,C=!1,b=j.prototype,d=b[_]||b[A]||P&&b[P],E=d||w(P),U=P?v?w("entries"):E:void 0,I=W=="Array"&&b.entries||d;if(I&&(y=x(I.call(new j)),y!==Object.prototype&&(h(y,g,!0),i||l(y,_)||c(y,_,L))),v&&d&&d.name!==N&&(C=!0,E=function(){return d.call(this)}),i&&!T||!S&&!C&&b[_]||c(b,_,E),p[W]=E,p[g]=L,P)if(u={values:v?E:w(N),keys:H?E:w(M),entries:U},T)for(m in u)m in b||a(b,m,u[m]);else o(o.P+o.F*(S||C),W,u);return u}},function(t,n){t.exports=!0},function(t,n,s){var i=s(2),o="__core-js_shared__",a=i[o]||(i[o]={});t.exports=function(c){return a[c]||(a[c]={})}},function(t,n,s){var i,o,a,c=s(7),l=s(41),p=s(25),f=s(16),h=s(2),x=h.process,_=h.setImmediate,S=h.clearImmediate,A=h.MessageChannel,M=0,N={},L="onreadystatechange",j=function(){var q=+this;if(N.hasOwnProperty(q)){var G=N[q];delete N[q],G()}},W=function(q){j.call(q.data)};_&&S||(_=function(q){for(var G=[],P=1;arguments.length>P;)G.push(arguments[P++]);return N[++M]=function(){l(typeof q=="function"?q:Function(q),G)},i(M),M},S=function(q){delete N[q]},s(11)(x)=="process"?i=function(q){x.nextTick(c(j,q,1))}:A?(o=new A,a=o.port2,o.port1.onmessage=W,i=c(a.postMessage,a,1)):h.addEventListener&&typeof postMessage=="function"&&!h.importScripts?(i=function(q){h.postMessage(q+"","*")},h.addEventListener("message",W,!1)):i=L in f("script")?function(q){p.appendChild(f("script"))[L]=function(){p.removeChild(this),j.call(q)}}:function(q){setTimeout(c(j,q,1),0)}),t.exports={set:_,clear:S}},function(t,n,s){var i=s(20),o=Math.min;t.exports=function(a){return a>0?o(i(a),9007199254740991):0}},function(t,n,s){var i=s(9);t.exports=function(o,a){if(!i(o))return o;var c,l;if(a&&typeof(c=o.toString)=="function"&&!i(l=c.call(o))||typeof(c=o.valueOf)=="function"&&!i(l=c.call(o))||!a&&typeof(c=o.toString)=="function"&&!i(l=c.call(o)))return l;throw TypeError("Can't convert object to primitive value")}},function(t,n){var s=0,i=Math.random();t.exports=function(o){return"Symbol(".concat(o===void 0?"":o,")_",(++s+i).toString(36))}},function(t,n,s){"use strict";function i(L){return L&&L.__esModule?L:{default:L}}function o(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function a(L){return(0,_.createHash)("sha256").update(L).digest("hex")}function c(L){switch(A){case"darwin":return L.split("IOPlatformUUID")[1].split(`
106
+ `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return L.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return L.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return L.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function l(L){var j=c((0,x.execSync)(N[A]).toString());return L?j:a(j)}function p(L){return new h.default(function(j,W){return(0,x.exec)(N[A],{},function(q,G,P){if(q)return W(new Error("Error while obtaining machine id: "+q.stack));var H=c(G.toString());return j(L?H:a(H))})})}Object.defineProperty(n,"__esModule",{value:!0});var f=s(35),h=i(f);n.machineIdSync=l,n.machineId=p;var x=s(70),_=s(71),S=process,A=S.platform,M={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},N={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:M[o()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(t,n,s){t.exports={default:s(36),__esModule:!0}},function(t,n,s){s(66),s(68),s(69),s(67),t.exports=s(6).Promise},function(t,n){t.exports=function(){}},function(t,n){t.exports=function(s,i,o,a){if(!(s instanceof i)||a!==void 0&&a in s)throw TypeError(o+": incorrect invocation!");return s}},function(t,n,s){var i=s(13),o=s(31),a=s(62);t.exports=function(c){return function(l,p,f){var h,x=i(l),_=o(x.length),S=a(f,_);if(c&&p!=p){for(;_>S;)if(h=x[S++],h!=h)return!0}else for(;_>S;S++)if((c||S in x)&&x[S]===p)return c||S||0;return!c&&-1}}},function(t,x,s){var i=s(7),o=s(44),a=s(43),c=s(3),l=s(31),p=s(64),f={},h={},x=t.exports=function(_,S,A,M,N){var L,j,W,q,G=N?function(){return _}:p(_),P=i(A,M,S?2:1),H=0;if(typeof G!="function")throw TypeError(_+" is not iterable!");if(a(G)){for(L=l(_.length);L>H;H++)if(q=S?P(c(j=_[H])[0],j[1]):P(_[H]),q===f||q===h)return q}else for(W=G.call(_);!(j=W.next()).done;)if(q=o(W,P,j.value,S),q===f||q===h)return q};x.BREAK=f,x.RETURN=h},function(t,n){t.exports=function(s,i,o){var a=o===void 0;switch(i.length){case 0:return a?s():s.call(o);case 1:return a?s(i[0]):s.call(o,i[0]);case 2:return a?s(i[0],i[1]):s.call(o,i[0],i[1]);case 3:return a?s(i[0],i[1],i[2]):s.call(o,i[0],i[1],i[2]);case 4:return a?s(i[0],i[1],i[2],i[3]):s.call(o,i[0],i[1],i[2],i[3])}return s.apply(o,i)}},function(t,n,s){var i=s(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(o){return i(o)=="String"?o.split(""):Object(o)}},function(t,n,s){var i=s(10),o=s(1)("iterator"),a=Array.prototype;t.exports=function(c){return c!==void 0&&(i.Array===c||a[o]===c)}},function(t,n,s){var i=s(3);t.exports=function(o,a,c,l){try{return l?a(i(c)[0],c[1]):a(c)}catch(f){var p=o.return;throw p!==void 0&&i(p.call(o)),f}}},function(t,n,s){"use strict";var i=s(49),o=s(17),a=s(18),c={};s(5)(c,s(1)("iterator"),function(){return this}),t.exports=function(l,p,f){l.prototype=i(c,{next:o(1,f)}),a(l,p+" Iterator")}},function(t,n,s){var i=s(1)("iterator"),o=!1;try{var a=[7][i]();a.return=function(){o=!0},Array.from(a,function(){throw 2})}catch{}t.exports=function(c,l){if(!l&&!o)return!1;var p=!1;try{var f=[7],h=f[i]();h.next=function(){return{done:p=!0}},f[i]=function(){return h},c(f)}catch{}return p}},function(t,n){t.exports=function(s,i){return{value:i,done:!!s}}},function(t,n,s){var i=s(2),o=s(30).set,a=i.MutationObserver||i.WebKitMutationObserver,c=i.process,l=i.Promise,p=s(11)(c)=="process";t.exports=function(){var f,h,x,_=function(){var N,L;for(p&&(N=c.domain)&&N.exit();f;){L=f.fn,f=f.next;try{L()}catch(j){throw f?x():h=void 0,j}}h=void 0,N&&N.enter()};if(p)x=function(){c.nextTick(_)};else if(a){var S=!0,A=document.createTextNode("");new a(_).observe(A,{characterData:!0}),x=function(){A.data=S=!S}}else if(l&&l.resolve){var M=l.resolve();x=function(){M.then(_)}}else x=function(){o.call(i,_)};return function(N){var L={fn:N,next:void 0};h&&(h.next=L),f||(f=L,x()),h=L}}},function(t,n,s){var i=s(3),o=s(50),a=s(22),c=s(19)("IE_PROTO"),l=function(){},p="prototype",f=function(){var h,x=s(16)("iframe"),_=a.length,S=">";for(x.style.display="none",s(25).appendChild(x),x.src="javascript:",h=x.contentWindow.document,h.open(),h.write("<script>document.F=Object</script"+S),h.close(),f=h.F;_--;)delete f[p][a[_]];return f()};t.exports=Object.create||function(h,x){var _;return h!==null?(l[p]=i(h),_=new l,l[p]=null,_[c]=h):_=f(),x===void 0?_:o(_,x)}},function(t,n,s){var i=s(12),o=s(3),a=s(54);t.exports=s(4)?Object.defineProperties:function(c,l){o(c);for(var p,f=a(l),h=f.length,x=0;h>x;)i.f(c,p=f[x++],l[p]);return c}},function(t,n,s){var i=s(55),o=s(17),a=s(13),c=s(32),l=s(8),p=s(26),f=Object.getOwnPropertyDescriptor;n.f=s(4)?f:function(h,x){if(h=a(h),x=c(x,!0),p)try{return f(h,x)}catch{}if(l(h,x))return o(!i.f.call(h,x),h[x])}},function(t,n,s){var i=s(8),o=s(63),a=s(19)("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(l){return l=o(l),i(l,a)?l[a]:typeof l.constructor=="function"&&l instanceof l.constructor?l.constructor.prototype:l instanceof Object?c:null}},function(t,n,s){var i=s(8),o=s(13),a=s(39)(!1),c=s(19)("IE_PROTO");t.exports=function(l,p){var f,h=o(l),x=0,_=[];for(f in h)f!=c&&i(h,f)&&_.push(f);for(;p.length>x;)i(h,f=p[x++])&&(~a(_,f)||_.push(f));return _}},function(t,n,s){var i=s(53),o=s(22);t.exports=Object.keys||function(a){return i(a,o)}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,s){var i=s(5);t.exports=function(o,a,c){for(var l in a)c&&o[l]?o[l]=a[l]:i(o,l,a[l]);return o}},function(t,n,s){t.exports=s(5)},function(t,n,s){var i=s(9),o=s(3),a=function(c,l){if(o(c),!i(l)&&l!==null)throw TypeError(l+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?(function(c,l,p){try{p=s(7)(Function.call,s(51).f(Object.prototype,"__proto__").set,2),p(c,[]),l=!(c instanceof Array)}catch{l=!0}return function(f,h){return a(f,h),l?f.__proto__=h:p(f,h),f}})({},!1):void 0),check:a}},function(t,n,s){"use strict";var i=s(2),o=s(6),a=s(12),c=s(4),l=s(1)("species");t.exports=function(p){var f=typeof o[p]=="function"?o[p]:i[p];c&&f&&!f[l]&&a.f(f,l,{configurable:!0,get:function(){return this}})}},function(t,n,s){var i=s(3),o=s(14),a=s(1)("species");t.exports=function(c,l){var p,f=i(c).constructor;return f===void 0||(p=i(f)[a])==null?l:o(p)}},function(t,n,s){var i=s(20),o=s(15);t.exports=function(a){return function(c,l){var p,f,h=String(o(c)),x=i(l),_=h.length;return x<0||x>=_?a?"":void 0:(p=h.charCodeAt(x),p<55296||p>56319||x+1===_||(f=h.charCodeAt(x+1))<56320||f>57343?a?h.charAt(x):p:a?h.slice(x,x+2):(p-55296<<10)+(f-56320)+65536)}}},function(t,n,s){var i=s(20),o=Math.max,a=Math.min;t.exports=function(c,l){return c=i(c),c<0?o(c+l,0):a(c,l)}},function(t,n,s){var i=s(15);t.exports=function(o){return Object(i(o))}},function(t,n,s){var i=s(21),o=s(1)("iterator"),a=s(10);t.exports=s(6).getIteratorMethod=function(c){if(c!=null)return c[o]||c["@@iterator"]||a[i(c)]}},function(t,n,s){"use strict";var i=s(37),o=s(47),a=s(10),c=s(13);t.exports=s(27)(Array,"Array",function(l,p){this._t=c(l),this._i=0,this._k=p},function(){var l=this._t,p=this._k,f=this._i++;return!l||f>=l.length?(this._t=void 0,o(1)):p=="keys"?o(0,f):p=="values"?o(0,l[f]):o(0,[f,l[f]])},"values"),a.Arguments=a.Array,i("keys"),i("values"),i("entries")},function(t,n){},function(t,n,s){"use strict";var i,o,a,c=s(28),l=s(2),p=s(7),f=s(21),h=s(23),x=s(9),_=(s(3),s(14)),S=s(38),A=s(40),M=(s(58).set,s(60)),N=s(30).set,L=s(48)(),j="Promise",W=l.TypeError,G=l.process,q=l[j],G=l.process,P=f(G)=="process",H=function(){},T=!!(function(){try{var I=q.resolve(1),D=(I.constructor={})[s(1)("species")]=function($){$(H,H)};return(P||typeof PromiseRejectionEvent=="function")&&I.then(H)instanceof D}catch{}})(),u=function(I,D){return I===D||I===q&&D===a},m=function(I){var D;return!(!x(I)||typeof(D=I.then)!="function")&&D},y=function(I){return u(q,I)?new w(I):new o(I)},w=o=function(I){var D,$;this.promise=new I(function(V,B){if(D!==void 0||$!==void 0)throw W("Bad Promise constructor");D=V,$=B}),this.resolve=_(D),this.reject=_($)},g=function(I){try{I()}catch(D){return{error:D}}},v=function(I,D){if(!I._n){I._n=!0;var $=I._c;L(function(){for(var V=I._v,B=I._s==1,ge=0,se=function(R){var X,k,F=B?R.ok:R.fail,Q=R.resolve,K=R.reject,z=R.domain;try{F?(B||(I._h==2&&d(I),I._h=1),F===!0?X=V:(z&&z.enter(),X=F(V),z&&z.exit()),X===R.promise?K(W("Promise-chain cycle")):(k=m(X))?k.call(X,Q,K):Q(X)):K(V)}catch(ve){K(ve)}};$.length>ge;)se($[ge++]);I._c=[],I._n=!1,D&&!I._h&&C(I)})}},C=function(I){N.call(l,function(){var D,$,V,B=I._v;if(b(I)&&(D=g(function(){P?G.emit("unhandledRejection",B,I):($=l.onunhandledrejection)?$({promise:I,reason:B}):(V=l.console)&&V.error&&V.error("Unhandled promise rejection",B)}),I._h=P||b(I)?2:1),I._a=void 0,D)throw D.error})},b=function(I){if(I._h==1)return!1;for(var D,$=I._a||I._c,V=0;$.length>V;)if(D=$[V++],D.fail||!b(D.promise))return!1;return!0},d=function(I){N.call(l,function(){var D;P?G.emit("rejectionHandled",I):(D=l.onrejectionhandled)&&D({promise:I,reason:I._v})})},E=function(I){var D=this;D._d||(D._d=!0,D=D._w||D,D._v=I,D._s=2,D._a||(D._a=D._c.slice()),v(D,!0))},U=function(I){var D,$=this;if(!$._d){$._d=!0,$=$._w||$;try{if($===I)throw W("Promise can't be resolved itself");(D=m(I))?L(function(){var V={_w:$,_d:!1};try{D.call(I,p(U,V,1),p(E,V,1))}catch(B){E.call(V,B)}}):($._v=I,$._s=1,v($,!1))}catch(V){E.call({_w:$,_d:!1},V)}}};T||(q=function(I){S(this,q,j,"_h"),_(I),i.call(this);try{I(p(U,this,1),p(E,this,1))}catch(D){E.call(this,D)}},i=function(I){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},i.prototype=s(56)(q.prototype,{then:function(I,D){var $=y(M(this,q));return $.ok=typeof I!="function"||I,$.fail=typeof D=="function"&&D,$.domain=P?G.domain:void 0,this._c.push($),this._a&&this._a.push($),this._s&&v(this,!1),$.promise},catch:function(I){return this.then(void 0,I)}}),w=function(){var I=new i;this.promise=I,this.resolve=p(U,I,1),this.reject=p(E,I,1)}),h(h.G+h.W+h.F*!T,{Promise:q}),s(18)(q,j),s(59)(j),a=s(6)[j],h(h.S+h.F*!T,j,{reject:function(I){var D=y(this),$=D.reject;return $(I),D.promise}}),h(h.S+h.F*(c||!T),j,{resolve:function(I){if(I instanceof q&&u(I.constructor,this))return I;var D=y(this),$=D.resolve;return $(I),D.promise}}),h(h.S+h.F*!(T&&s(46)(function(I){q.all(I).catch(H)})),j,{all:function(I){var D=this,$=y(D),V=$.resolve,B=$.reject,ge=g(function(){var se=[],R=0,X=1;A(I,!1,function(k){var F=R++,Q=!1;se.push(void 0),X++,D.resolve(k).then(function(K){Q||(Q=!0,se[F]=K,--X||V(se))},B)}),--X||V(se)});return ge&&B(ge.error),$.promise},race:function(I){var D=this,$=y(D),V=$.reject,B=g(function(){A(I,!1,function(ge){D.resolve(ge).then($.resolve,V)})});return B&&V(B.error),$.promise}})},function(t,n,s){"use strict";var i=s(61)(!0);s(27)(String,"String",function(o){this._t=String(o),this._i=0},function(){var o,a=this._t,c=this._i;return c>=a.length?{value:void 0,done:!0}:(o=i(a,c),this._i+=o.length,{value:o,done:!1})})},function(t,n,s){s(65);for(var i=s(2),o=s(5),a=s(10),c=s(1)("toStringTag"),l=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],p=0;p<5;p++){var f=l[p],h=i[f],x=h&&h.prototype;x&&!x[c]&&o(x,c,f),a[f]=a.Array}},function(t,n){t.exports=require("child_process")},function(t,n){t.exports=require("crypto")}])})});var R6={};tn(R6,{startServer:()=>iM});module.exports=pM(R6);var up=require("http"),pp=require("child_process"),Ds=require("fs"),sr=require("path"),rM=require("url");var kv=(r=0)=>e=>`\x1B[${e+r}m`,Ov=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,Mv=(r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`,be={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},O6=Object.keys(be.modifier),fM=Object.keys(be.color),dM=Object.keys(be.bgColor),M6=[...fM,...dM];function hM(){let r=new Map;for(let[e,t]of Object.entries(be)){for(let[n,s]of Object.entries(t))be[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},t[n]=be[n],r.set(s[0],s[1]);Object.defineProperty(be,e,{value:t,enumerable:!1})}return Object.defineProperty(be,"codes",{value:r,enumerable:!1}),be.color.close="\x1B[39m",be.bgColor.close="\x1B[49m",be.color.ansi=kv(),be.color.ansi256=Ov(),be.color.ansi16m=Mv(),be.bgColor.ansi=kv(10),be.bgColor.ansi256=Ov(10),be.bgColor.ansi16m=Mv(10),Object.defineProperties(be,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(i=>i+i).join(""));let s=Number.parseInt(n,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>be.rgbToAnsi256(...be.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,s;if(e>=232)t=((e-232)*10+8)/255,n=t,s=t;else{e-=16;let a=e%36;t=Math.floor(e/36)/5,n=Math.floor(a/6)/5,s=a%6/5}let i=Math.max(t,n,s)*2;if(i===0)return 30;let o=30+(Math.round(s)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>be.ansi256ToAnsi(be.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>be.ansi256ToAnsi(be.hexToAnsi256(e)),enumerable:!1}}),be}var mM=hM(),Er=mM;var Va=J(require("node:process"),1),Iv=J(require("node:os"),1),Mp=J(require("node:tty"),1);function ir(r,e=globalThis.Deno?globalThis.Deno.args:Va.default.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),s=e.indexOf("--");return n!==-1&&(s===-1||n<s)}var{env:we}=Va.default,za;ir("no-color")||ir("no-colors")||ir("color=false")||ir("color=never")?za=0:(ir("color")||ir("colors")||ir("color=true")||ir("color=always"))&&(za=1);function gM(){if("FORCE_COLOR"in we)return we.FORCE_COLOR==="true"?1:we.FORCE_COLOR==="false"?0:we.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(we.FORCE_COLOR,10),3)}function vM(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function yM(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let n=gM();n!==void 0&&(za=n);let s=t?za:n;if(s===0)return 0;if(t){if(ir("color=16m")||ir("color=full")||ir("color=truecolor"))return 3;if(ir("color=256"))return 2}if("TF_BUILD"in we&&"AGENT_NAME"in we)return 1;if(r&&!e&&s===void 0)return 0;let i=s||0;if(we.TERM==="dumb")return i;if(Va.default.platform==="win32"){let o=Iv.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in we)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in we)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in we)||we.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in we)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(we.TEAMCITY_VERSION)?1:0;if(we.COLORTERM==="truecolor"||we.TERM==="xterm-kitty"||we.TERM==="xterm-ghostty"||we.TERM==="wezterm")return 3;if("TERM_PROGRAM"in we){let o=Number.parseInt((we.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(we.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(we.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(we.TERM)||"COLORTERM"in we?1:i}function Pv(r,e={}){let t=yM(r,{streamIsTTY:r&&r.isTTY,...e});return vM(t)}var xM={stdout:Pv({isTTY:Mp.default.isatty(1)}),stderr:Pv({isTTY:Mp.default.isatty(2)})},Nv=xM;function Lv(r,e,t){let n=r.indexOf(e);if(n===-1)return r;let s=e.length,i=0,o="";do o+=r.slice(i,n)+e+t,i=n+s,n=r.indexOf(e,i);while(n!==-1);return o+=r.slice(i),o}function Dv(r,e,t,n){let s=0,i="";do{let o=r[n-1]==="\r";i+=r.slice(s,o?n-1:n)+e+(o?`\r
107
107
  `:`
108
- `)+t,i=n+1,n=r.indexOf(`
109
- `,i)}while(n!==-1);return s+=r.slice(i),s}var{stdout:Ov,stderr:Mv}=Av,Ap=Symbol("GENERATOR"),Ii=Symbol("STYLER"),so=Symbol("IS_EMPTY"),Pv=["ansi","ansi","ansi256","ansi16m"],Ni=Object.create(null),iM=(r,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=Ov?Ov.level:0;r.level=e.level===void 0?t:e.level};var sM=r=>{let e=(...t)=>t.join(" ");return iM(e,r),Object.setPrototypeOf(e,oo.prototype),e};function oo(r){return sM(r)}Object.setPrototypeOf(oo.prototype,Function.prototype);for(let[r,e]of Object.entries(_r))Ni[r]={get(){let t=Wa(this,kp(e.open,e.close,this[Ii]),this[so]);return Object.defineProperty(this,r,{value:t}),t}};Ni.visible={get(){let r=Wa(this,this[Ii],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var Rp=(r,e,t,...n)=>r==="rgb"?e==="ansi16m"?_r[t].ansi16m(...n):e==="ansi256"?_r[t].ansi256(_r.rgbToAnsi256(...n)):_r[t].ansi(_r.rgbToAnsi(...n)):r==="hex"?Rp("rgb",e,t,..._r.hexToRgb(...n)):_r[t][r](...n),oM=["rgb","hex","ansi256"];for(let r of oM){Ni[r]={get(){let{level:t}=this;return function(...n){let i=kp(Rp(r,Pv[t],"color",...n),_r.color.close,this[Ii]);return Wa(this,i,this[so])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);Ni[e]={get(){let{level:t}=this;return function(...n){let i=kp(Rp(r,Pv[t],"bgColor",...n),_r.bgColor.close,this[Ii]);return Wa(this,i,this[so])}}}}var aM=Object.defineProperties(()=>{},{...Ni,level:{enumerable:!0,get(){return this[Ap].level},set(r){this[Ap].level=r}}}),kp=(r,e,t)=>{let n,i;return t===void 0?(n=r,i=e):(n=t.openAll+r,i=e+t.closeAll),{open:r,close:e,openAll:n,closeAll:i,parent:t}},Wa=(r,e,t)=>{let n=(...i)=>cM(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,aM),n[Ap]=r,n[Ii]=e,n[so]=t,n},cM=(r,e)=>{if(r.level<=0||!e)return r[so]?"":e;let t=r[Ii];if(t===void 0)return e;let{openAll:n,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=Rv(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
110
- `);return s!==-1&&(e=kv(e,i,n,s)),n+e+i};Object.defineProperties(oo.prototype,Ni);var lM=oo(),Z4=oo({level:Mv?Mv.level:0});var ao=lM;Nt();xt();Bi();var zb=J(Gb(),1),{Server:Vb,Namespace:KW,Socket:YW}=zb.default;var tk=require("fs"),rk=require("path");xt();fl();var ct={control:"control",binary:"binary"},at={idle:"idle",connecting:"connecting",open:"open",degraded:"degraded",closed:"closed"},Jb={clientApp:{enabled:["ws","rtc"],channels:{control:{strategy:"priority",prefer:"rtc"},binary:{strategy:"priority",prefer:"rtc"}}},remoteDesktop:{enabled:["ws","rtc"],channels:{control:{strategy:"priority",prefer:"rtc"},binary:{strategy:"priority",prefer:"rtc"}}}};var xs=class{static id="base";static capabilities={control:!1,binary:!1,signaling:"none"};static priority={control:0,binary:0};constructor(){this._listeners=new Map,this._state=at.idle}get state(){return this._state}get ready(){return this._state===at.open}supports(e){return!!this.constructor.capabilities[e]}on(e,t){this._listeners.has(e)||this._listeners.set(e,new Set),this._listeners.get(e).add(t)}off(e,t){this._listeners.get(e)?.delete(t)}_emit(e,...t){let n=this._listeners.get(e);if(n)for(let i of n)i(...t)}_setState(e){this._state!==e&&(this._state=e,this._emit("stateChange",e))}connect(e){throw new Error("Not implemented: connect")}disconnect(){throw new Error("Not implemented: disconnect")}send(e,t){throw new Error("Not implemented: send")}};var dl=class extends xs{static id="ws";static capabilities={control:!0,binary:!0,signaling:"ws"};static priority={control:100,binary:10};constructor(){super(),this._socket=null}get socket(){return this._socket}connect(e){this._socket=e.socket,this._setState(e.socket.connected?at.open:at.connecting),e.socket.on("connect",()=>this._setState(at.open)),e.socket.on("disconnect",()=>this._setState(at.closed)),e.socket.onAny?.((t,n)=>this._emit("message",{event:t,data:n,source:"ws"}))}disconnect(){this._socket=null,this._setState(at.closed)}send(e,t){if(!this._socket?.connected)return!1;let n=this._socket._rawEmit||this._socket.emit.bind(this._socket);if(e===ct.control){let{event:i,args:s=[]}=t;return n(i,...s),!0}if(e===ct.binary){let i=this._socket.conn?.transport;return i&&i.writable===!1?!1:(n("tiles-bin-v2",t),!0)}return!1}};var iw=J(require("node-datachannel"),1);function oB(r,e){return e&&typeof e=="object"&&e.type==="Buffer"&&Array.isArray(e.data)?{__b:Buffer.from(e.data).toString("base64")}:e}function aB(r,e){return e&&typeof e=="object"&&typeof e.__b=="string"?Buffer.from(e.__b,"base64"):e}function Qb(r){return JSON.stringify(r,oB)}function Zb(r){return JSON.parse(typeof r=="string"?r:Buffer.from(r).toString("utf8"),aB)}lt();var rw=J(require("node:dns/promises"),1),cB=3e4,lB=/\s([0-9a-f-]{8,}\.local)\s/i,tw=new Map;async function uB(r){let e=tw.get(r);if(e&&Date.now()-e.ts<cB)return e.ip;try{let{address:t}=await rw.default.lookup(r);return tw.set(r,{ip:t,ts:Date.now()}),t}catch{return null}}async function nw(r){let e=r.match(lB);if(!e)return r;let t=await uB(e[1]);return t?r.replace(e[1],t):null}var{PeerConnection:pB}=iw.default,fB=[{hostname:"stun.l.google.com",port:19302,type:"Stun"},{hostname:"stun1.l.google.com",port:19302,type:"Stun"},{hostname:"stun2.l.google.com",port:19302,type:"Stun"},{hostname:"stun3.l.google.com",port:19302,type:"Stun"},{hostname:"stun4.l.google.com",port:19302,type:"Stun"},{hostname:"global.stun.twilio.com",port:3478,type:"Stun"},{hostname:"stun.cloudflare.com",port:3478,type:"Stun"}];async function dB(r,e){try{let t=await fetch(r,{headers:{"X-API-Key":e}});if(!t.ok)throw new Error(`HTTP ${t.status}`);let{iceServers:n}=await t.json(),i=[];for(let s of n)for(let o of s.urls)if(o.startsWith("stun:")){let a=o.replace("stun:","").split(":")[0],c=parseInt(o.split(":")[2]||"3478");i.push({hostname:a,port:c,type:"Stun"})}else if(o.startsWith("turn:")||o.startsWith("turns:")){let a=o.startsWith("turns:"),u=o.replace(/^turns?:/,"").split("?")[0],p=u.split(":")[0],f=parseInt(u.split(":")[1]||(a?"5349":"3478")),m=o.includes("transport=tcp")?"Tcp":"Udp";i.push({hostname:p,port:f,type:a?"Tls":"Turn",relayType:m,username:s.username,password:s.credential})}return i}catch(t){return console.error("[WebRtcProtocol] TURN fetch failed:",t.message),null}}var ml=class extends xs{static id="rtc";static capabilities={control:!0,binary:!0,signaling:"external"};static priority={control:50,binary:100};constructor(){super(),this._pc=null,this._dcControl=null,this._dcBinary=null,this._iceServers=fB,this._refreshTimer=null,this._remoteSet=!1,this._pendingCandidates=[],this._signaling=null,this._iceGraceTimer=null}async connect(e){this._ctx=e,this._setState(at.connecting);let t=e.profile?.rtc||{};t.enableTurn&&e.auth?.apiKey&&t.turnApiUrl&&await this._refreshTurn(t),this._signaling=e.signaling,this._signaling?.on?.(n=>this._handleSignal(n,t))}disconnect(){clearTimeout(this._refreshTimer),this._signaling?.off?.(),this._signaling=null,this._cleanupPeer(),this._setState(at.closed)}send(e,t){if(e===ct.control){if(!this._dcControl)return!1;try{return this._dcControl.sendMessage(Qb({event:t.event,args:t.args||[],ackId:t.ackId||null})),!0}catch(n){return console.error("[WebRtcProtocol] send control:",n.message),!1}}if(e===ct.binary){if(!this._dcBinary)return!1;try{let n=Array.isArray(t)?t:[t],i=this._ctx.profile?.rtc?.dcMaxMessageSize??65536,s=Y.webrtc.dcBufferThreshold;for(let o of n){if(this._dcBinary.bufferedAmount()>s)return!0;o.length<=i&&this._dcBinary.sendMessageBinary(o)}return!0}catch(n){return console.error("[WebRtcProtocol] send binary:",n.message),!1}}return!1}_handleSignal(e,t){if(e.type==="offer")this._processOffer(e.sdp,t);else if(e.type==="ice"){if(!this._remoteSet||!this._pc){this._pendingCandidates.push({candidate:e.candidate,mid:e.mid||"0"});return}this._addRemoteCandidate(e.candidate,e.mid||"0")}}async _addRemoteCandidate(e,t){try{let n=await nw(e);if(!n||!this._pc)return;this._pc.addRemoteCandidate(n,t)}catch(n){console.error("[WebRtcProtocol] addRemoteCandidate:",n.message)}}_createPeer(e){try{this._pc?.close()}catch{}this._pc=null,this._dcControl=null,this._dcBinary=null,this._remoteSet=!1,this._pendingCandidates=[],this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null);let t=this._ctx?.auth?.socketId||"anon",n=new pB(`peer-${t}`,{iceServers:this._iceServers});this._pcState="new",n.onStateChange(i=>{if(this._pcState=i,i==="failed"||i==="closed")this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null),this._setState(at.closed);else if(i==="disconnected"){if(this._iceGraceTimer)return;this._iceGraceTimer=setTimeout(()=>{this._iceGraceTimer=null,this._pcState!=="connected"&&this._setState(at.closed)},Y.webrtc.iceDisconnectGraceMs)}else i==="connected"&&this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null)}),n.onDataChannel(i=>{let s=i.getLabel?.()||"",o=()=>{s==="control"?this._dcControl=i:s==="binary"&&(this._dcBinary=i),this._dcControl&&this._dcBinary&&this._setState(at.open)};i.onOpen(o),i.onClosed(()=>{s==="control"&&(this._dcControl=null),s==="binary"&&(this._dcBinary=null),!this._dcControl&&!this._dcBinary&&this._setState(at.closed)}),i.onError(a=>console.error(`[WebRtcProtocol] DC[${s}] error:`,a)),i.onMessage(a=>{if(s!=="control")return;let c;try{c=Zb(a)}catch(u){console.error("[WebRtcProtocol] control parse:",u.message);return}try{this._emit("message",{event:c.event,data:c,source:"rtc"})}catch(u){console.error(`[WebRtcProtocol] handler error event=${c.event}:`,u.message)}})}),this._pc=n}_processOffer(e,t){return this._createPeer(t),new Promise((n,i)=>{this._pc.onLocalDescription((o,a)=>{a==="answer"&&(this._signaling?.send?.({type:"answer",sdp:o}),n())}),this._pc.onLocalCandidate((o,a)=>{o&&this._signaling?.send?.({type:"ice",candidate:o,mid:a})});try{this._pc.setRemoteDescription(e,"offer"),this._remoteSet=!0;for(let{candidate:o,mid:a}of this._pendingCandidates)this._addRemoteCandidate(o,a);this._pendingCandidates=[],this._pc.setLocalDescription()}catch(o){this._signaling?.send?.({type:"error",message:o.message}),i(o)}let s=t?.answerTimeout||1e4;setTimeout(()=>i(new Error("Answer timeout")),s)})}_cleanupPeer(){this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null);try{this._pc?.close()}catch{}this._pc=null,this._dcControl=null,this._dcBinary=null}async _refreshTurn(e){let t=await dB(e.turnApiUrl,this._ctx.auth.apiKey);t?.length&&(this._iceServers=t,Y.logging?.webrtc&&console.log(`[WebRtcProtocol] TURN credentials loaded (${t.length} servers)`)),clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(()=>this._refreshTurn(e),e.turnRefreshInterval)}};var sw=new Map;function Jd(r){if(!r?.id)throw new Error("Adapter missing static id");sw.set(r.id,r)}function ow(r){return sw.get(r)}vh();Jd(dl);Jd(ml);var Al=class{constructor(e,t){let n=t.enableWebRTC?"remoteDesktop":"clientApp",i={...Jb[n]};t.enableWebRTC||(i.enabled=["ws"]),i.rtc={enableTurn:!!(t.apiKey&&t.turnApiUrl),turnApiUrl:t.turnApiUrl||null,turnRefreshInterval:t.turnRefreshInterval,dcMaxMessageSize:t.dcMaxMessageSize,answerTimeout:t.answerTimeout},this._profile=i,this._auth={apiKey:t.apiKey||null,socketId:e.id},this._socket=e,this._wsChunkSize=t.wsChunkSize,this._dcChunkSize=t.dcChunkSize,this._dcMaxTilesPerFrame=t.dcMaxTilesPerFrame,this._maxControlBuffer=t.maxControlBuffer,this._adapters=new Map,this._listeners=new Map,this._buffer=[],this._rtcSignalingHandler=null,this._sigListeners=null,this._chunkOffset=0}get type(){return this._pickAdapter(ct.binary)?.constructor.id==="rtc"?"dc":"ws"}async init(){for(let e of this._profile.enabled){let t=ow(e);if(!t)continue;let n=new t;n.on("stateChange",s=>this._onAdapterStateChange(e,s)),n.on("message",({event:s,data:o,source:a})=>this._dispatch(s,o,a)),this._adapters.set(e,n);let i=this._buildCtx(e);await n.connect(i)}}setupSignaling(e){this._installSignalingListeners()}emit(e,...t){this._sendControl(e,t)}sendTiles(e,t){let{tiles:n,timestamp:i}=e;if(!n?.length)return[];let s=this._pickAdapter(ct.binary),o=i??Date.now();if(s?.constructor.id==="rtc"&&t){let a=[];for(let c=0;c<n.length;c+=this._dcChunkSize)a.push(t(n.slice(c,c+this._dcChunkSize),o));return s.send(ct.binary,a),n}return this._emitTilesChunked(n,o)}close(){for(let e of this._adapters.values())try{e.disconnect()}catch{}this._adapters.clear(),this._buffer=[]}attachAsBus(e){if(e._rawEmit)return;let t=e.emit.bind(e);e._rawEmit=t;let n=new Set(["error","disconnect","disconnecting","connect","newListener","removeListener"]);e.emit=(i,...s)=>n.has(i)?t(i,...s):(this._sendControl(i,s),!0)}_emitTilesChunked(e,t){let n=this._adapters.get("ws");if(!n?.ready)return[];let i=this._wsChunkSize,s=e.length,o=s>i?this._chunkOffset%s:0;s>i&&(this._chunkOffset=(o+i)%s);let a=[];for(let c=0;c<s;c+=i){let u=[];for(let p=0;p<i&&c+p<s;p++)u.push(e[(o+c+p)%s]);if(n.send(ct.binary,Ts(u,t))===!1)break;a.push(...u)}return a}_buildCtx(e){let t={auth:this._auth,profile:this._profile};return e==="ws"&&(t.socket=this._socket),e==="rtc"&&(t.signaling={send:n=>this._sendSignaling(n),on:n=>{this._rtcSignalingHandler=n,this._installSignalingListeners()},off:()=>{this._rtcSignalingHandler=null,this._removeSignalingListeners()}}),t}_onAdapterStateChange(e,t){t===at.open&&this._flushBuffer()}_pickAdapter(e){let t=this._profile.channels[e];if(!t)return null;let n=[...this._adapters.values()].filter(i=>i.supports(e)&&i.ready);if(t.prefer){let i=n.find(s=>s.constructor.id===t.prefer);if(i)return i}return n.sort((i,s)=>(s.constructor.priority[e]??0)-(i.constructor.priority[e]??0)),n[0]||null}hasReadyAdapter(){return!!(this._pickAdapter(ct.control)||this._pickAdapter(ct.binary))}_sendControl(e,t,n){let i=this._pickAdapter(ct.control);if(!i){this._buffer.push({event:e,args:t,ackId:n}),this._buffer.length>this._maxControlBuffer&&this._buffer.shift();return}i.constructor.id==="rtc"?i.send(ct.control,{event:e,args:t,ackId:n}):i.send(ct.control,{event:e,args:t})}_flushBuffer(){if(!(!this._buffer.length||!this._pickAdapter(ct.control)))for(;this._buffer.length;){let{event:t,args:n,ackId:i}=this._buffer.shift();this._sendControl(t,n,i)}}_dispatch(e,t,n){if(n==="rtc"){let s=Array.isArray(t?.args)?[...t.args]:[],o=t?.ackId;o&&s.push((...u)=>this._sendAck(o,u));let a=this._listeners.get(e);if(a)for(let u of a)u(...s);let c=this._socket.listeners?.(e)||[];for(let u of c)u(...s);return}let i=this._listeners.get(e);if(i)for(let s of i)s(t)}_sendAck(e,t){let n=this._adapters.get("rtc");n?.ready&&n.send(ct.control,{event:"__ack",args:t,ackId:e})}_sendSignaling(e){let t=this._adapters.get("ws");if(t?.ready){t.send(ct.control,{event:this._sigEvent(e.type),args:[this._sigData(e)]});return}console.warn("[ProtocolManager] signaling unavailable (ws down)")}_sigEvent(e){return e==="offer"?"webrtc:offer":e==="answer"?"webrtc:answer":e==="ice"?"webrtc:ice-candidate":"webrtc:error"}_sigData(e){return e.type==="offer"||e.type==="answer"?{sdp:e.sdp}:e.type==="ice"?{candidate:e.candidate,mid:e.mid}:e}_installSignalingListeners(){if(!this._rtcSignalingHandler||this._sigListeners)return;let e=({sdp:n})=>this._rtcSignalingHandler?.({type:"offer",sdp:n}),t=({candidate:n,mid:i})=>this._rtcSignalingHandler?.({type:"ice",candidate:n,mid:i});this._sigListeners={onOffer:e,onIce:t},this._socket.on("webrtc:offer",e),this._socket.on("webrtc:ice-candidate",t)}_removeSignalingListeners(){this._sigListeners&&(this._socket.off("webrtc:offer",this._sigListeners.onOffer),this._socket.off("webrtc:ice-candidate",this._sigListeners.onIce),this._sigListeners=null)}};hi();lt();var GT=require("path"),zT=require("url");var Il=J(require("net"),1),ae=J(require("fs"),1),fe=J(require("path"),1),iS=J(require("os"),1),sS=require("child_process"),oS=require("url");var yh={win32:[{id:"cmd",label:"Command Prompt",path:"cmd.exe",args:[]},{id:"powershell",label:"PowerShell",path:"powershell.exe",args:["-NoLogo"]},{id:"pwsh",label:"PowerShell Core",path:"pwsh.exe",args:["-NoLogo"]}],unix:[{id:"bash",label:"Bash",path:"/bin/bash",args:["-l"]},{id:"zsh",label:"Zsh",path:"/bin/zsh",args:["-l"]},{id:"sh",label:"Sh",path:"/bin/sh",args:["-l"]}]};function eS(){return process.platform==="win32"?yh.win32:[]}function tS(r){if(process.platform==="win32"){let n=r?yh.win32.find(s=>s.id===r):null;if(n)return n;let i=process.env.COMSPEC;return i?{id:"cmd",label:"Command Prompt",path:i,args:[]}:yh.win32[0]}let e=process.env.SHELL||"/bin/bash",t=e.split("/").pop();return{id:t,label:t,path:e,args:["-l"]}}var bh=fe.default.dirname((0,oS.fileURLToPath)(__importMetaUrl)),gn=fe.default.join(iS.default.homedir(),".9remote"),Xo=process.platform==="win32"?"\\\\.\\pipe\\9remote-pty":fe.default.join(gn,"pty-daemon.sock"),rS=fe.default.join(bh,"ptyDaemon.js"),nS=fe.default.join(bh,"ptyDaemon.cjs"),Rl=fe.default.join(gn,"daemon");function aS(r,e){if(ae.default.existsSync(r)){ae.default.mkdirSync(e,{recursive:!0});for(let t of ae.default.readdirSync(r,{withFileTypes:!0})){let n=fe.default.join(r,t.name),i=fe.default.join(e,t.name);t.isDirectory()?aS(n,i):t.isFile()&&ae.default.copyFileSync(n,i)}}}function $B(r,e){let t=r;for(let n=0;n<6;n++){let i=fe.default.join(t,"node_modules",e);if(ae.default.existsSync(i))return i;let s=fe.default.dirname(t);if(s===t)break;t=s}return null}var HB=r=>$B(r,"node-pty");function UB(r){try{if(!ae.default.existsSync(Rl))return;let e=fe.default.join(gn,"pids","ptyDaemon.pid"),t=!1;try{let n=parseInt(ae.default.readFileSync(e,"utf8").trim(),10);if(Number.isFinite(n)&&n>0)try{process.kill(n,0),t=!0}catch{}}catch{}if(t)return;for(let n of ae.default.readdirSync(Rl))if(n!==`v${r}`)try{ae.default.rmSync(fe.default.join(Rl,n),{recursive:!0,force:!0})}catch{}}catch{}}function qB(r){UB("18");let e=fe.default.join(Rl,`v${"18"}`),t=r.endsWith(".js"),n=t?fe.default.join(e,"features","terminal"):e,i=fe.default.join(n,fe.default.basename(r)),s=fe.default.join(n,"node_modules","node-pty");if(ae.default.existsSync(i)&&ae.default.existsSync(s))return{script:i,cwd:n};try{if(ae.default.mkdirSync(n,{recursive:!0}),ae.default.copyFileSync(r,i),t){let a=fe.default.dirname(r);ae.default.copyFileSync(fe.default.join(a,"constants.js"),fe.default.join(n,"constants.js"));let c=fe.default.join(e,"lib");ae.default.mkdirSync(c,{recursive:!0}),ae.default.copyFileSync(fe.default.resolve(a,"..","..","lib","constants.js"),fe.default.join(c,"constants.js"))}let o=HB(fe.default.dirname(r));return o?(aS(o,s),{script:i,cwd:n}):null}catch{return null}}var Ur=null,As=!1,Un=!1,_h="",WB=0,Rs=new Map,kl=new Map;function GB(){return++WB}function Nl(r,e){kl.has(r)||kl.set(r,[]),kl.get(r).push(e)}function Ml(r,e){let t=kl.get(r);if(t)for(let n of t)try{n(e)}catch(i){console.error(`[DaemonClient] Error in ${r} handler:`,i)}}function wh(r){if(!Ur||!As)return!1;try{return Ur.write(JSON.stringify(r)+`
111
- `),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function Ll(r,e=5e3){return new Promise((t,n)=>{let i=GB();r.requestId=i;let s=setTimeout(()=>{Rs.delete(i),n(new Error("Request timeout"))},e);Rs.set(i,{resolve:t,reject:n,timer:s}),wh(r)||(clearTimeout(s),Rs.delete(i),n(new Error("Not connected to daemon")))})}function zB(r){let{type:e,requestId:t,...n}=r;if(t&&Rs.has(t)){let{resolve:i,timer:s}=Rs.get(t);clearTimeout(s),Rs.delete(t),i({type:e,...n});return}switch(e){case"output":Ml("output",{sessionId:n.sessionId,data:Buffer.from(n.data,"base64")});break;case"sessionClosed":Ml("sessionClosed",n.sessionId);break;case"pong":break;default:console.log("[DaemonClient] Unknown message:",e)}}function Pl(){return new Promise(r=>{let e=Il.default.connect(Xo),t=setTimeout(()=>{e.destroy(),r(!1)},1e3);e.on("connect",()=>{clearTimeout(t),e.destroy(),r(!0)}),e.on("error",()=>{if(clearTimeout(t),process.platform!=="win32"&&ae.default.existsSync(Xo))try{ae.default.unlinkSync(Xo)}catch{}r(!1)})})}function VB(){ae.default.existsSync(gn)||ae.default.mkdirSync(gn,{recursive:!0});let r=ae.default.existsSync(rS)?rS:ae.default.existsSync(nS)?nS:null;if(!r)return console.error("[DaemonClient] \u274C Daemon script not found"),null;let e=qB(r);return e||{script:r,cwd:bh}}async function KB(){if(!ae.default.existsSync(gn))try{ae.default.mkdirSync(gn,{recursive:!0})}catch(a){return console.error("[DaemonClient] Failed to create socket directory:",a.message),!1}let r=VB();if(!r)return!1;let{script:e,cwd:t}=r,n=fe.default.join(gn,"logs");try{ae.default.mkdirSync(n,{recursive:!0})}catch{}let i=fe.default.join(n,"daemon.log"),s;try{s=ae.default.openSync(i,"w")}catch(a){console.error("[DaemonClient] Failed to open log file:",a.message),s="ignore"}if((0,sS.spawn)("node",[e],{detached:!0,stdio:["ignore",s,s],cwd:t}).unref(),typeof s=="number")try{ae.default.closeSync(s)}catch{}for(let a=0;a<20;a++)if(await new Promise(c=>setTimeout(c,100)),await Pl())return!0;console.error("[DaemonClient] \u274C Failed to start daemon");try{let a=ae.default.readFileSync(i,"utf8");a.trim()&&(console.error("[DaemonClient] Daemon log:"),console.error(a))}catch{}return!1}function YB(){return new Promise(r=>{let e=Il.default.connect(Xo),t="",n=s=>{try{e.destroy()}catch{}r(s)},i=setTimeout(()=>n(null),2e3);e.on("connect",()=>e.write(JSON.stringify({type:"ping",requestId:-1})+`
112
- `)),e.on("data",s=>{t+=s.toString();let o=t.indexOf(`
113
- `);if(o!==-1){clearTimeout(i);try{let a=JSON.parse(t.slice(0,o));n(a.version||"unknown")}catch{n(null)}}}),e.on("error",()=>{clearTimeout(i),n(null)})})}async function XB(){try{let r=fe.default.join(gn,"pids","ptyDaemon.pid"),e=parseInt(ae.default.readFileSync(r,"utf8").trim(),10);Number.isFinite(e)&&e>0&&process.kill(e,"SIGTERM")}catch{}for(let r=0;r<20;r++){if(!await Pl())return;await new Promise(e=>setTimeout(e,100))}}async function cS(){if(!(As||Un)){Un=!0;try{if(await Pl()){let r=await YB();r!=="18"&&(console.log(`[DaemonClient] Daemon v${r} != v${"18"}, restarting`),await XB())}return!await Pl()&&!await KB()?(console.error("[DaemonClient] \u274C Failed to start daemon"),Un=!1,!1):new Promise(r=>{let e=setTimeout(()=>{console.error("[DaemonClient] \u274C Connection timeout after 5s"),Ur&&Ur.destroy(),Un=!1,r(!1)},5e3);Ur=Il.default.connect(Xo),Ur.on("connect",()=>{clearTimeout(e),As=!0,Un=!1,Ml("connected"),r(!0)}),Ur.on("data",t=>{_h+=t.toString();let n=_h.split(`
114
- `);_h=n.pop()||"";for(let i of n)if(i.trim())try{zB(JSON.parse(i))}catch{console.error("[DaemonClient] Invalid message:",i)}}),Ur.on("close",()=>{As=!1,Ur=null,Ml("disconnected"),setTimeout(()=>{!As&&!Un&&cS()},2e3)}),Ur.on("error",t=>{clearTimeout(e),console.error("[DaemonClient] \u274C Connection error:",t.message),console.error("[DaemonClient] Error code:",t.code),Un=!1,r(!1)})})}catch(r){return console.error("[DaemonClient] \u274C Connect error:",r),Un=!1,!1}}}async function lS(){return cS()}function Rr(){return As}async function Dl(){return(await Ll({type:"listSessions"})).sessions||[]}async function Sh(r,e=80,t=24,n=null,i=`session-${Date.now()}`,s=null){return await Ll({type:"createSession",sessionId:i,name:r,cols:e,rows:t,shellId:n,cwd:s})}async function uS(r){return await Ll({type:"joinSession",sessionId:r})}function Eh(r,e){return wh({type:"input",sessionId:r,data:e})}function pS(r,e,t){return wh({type:"resize",sessionId:r,cols:e,rows:t})}async function mi(r){return await Ll({type:"deleteSession",sessionId:r})}hi();Bi();var dS=require("child_process");lt();var JB={darwin:()=>({cmd:"caffeinate",args:["-u","-t",String(Y.displayWake.macDurationSec)]}),linux:()=>({cmd:"xset",args:["dpms","force","on"]}),win32:()=>({cmd:"powershell.exe",args:["-NonInteractive","-NoProfile","-WindowStyle","Hidden","-Command",`Add-Type -Name K -Namespace W -MemberDefinition '[System.Runtime.InteropServices.DllImport("kernel32")]public static extern uint SetThreadExecutionState(uint e);'; [void][W.K]::SetThreadExecutionState(0x80000003)`]})},fS=0;function hS(){let r=Y.displayWake;if(!r?.enabled)return;let e=Date.now();if(e-fS<r.throttleMs)return;fS=e;let t=JB[process.platform];if(t)try{let{cmd:n,args:i}=t(),s=(0,dS.spawn)(n,i,{detached:!0,stdio:"ignore",windowsHide:!0});s.on("error",()=>{}),s.unref()}catch{}}lt();var LS=On("remote"),vn=null;function nj(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function $S(){if(vn!==null)return vn;if(nj())return vn=!1,LS.info("\u2705 Remote desktop not available (headless environment)"),vn;try{let r=await import("@hurdlegroup/robotjs");(r.default||r).getScreenSize(),vn=!0}catch{vn=!1,LS.info("\u2705 Remote desktop not available (no display or robotjs not installed)")}return vn}function Ul(){return vn===!0}function HS(){return qr}var vi=null,Nh=null,Lh=null,US=null,qS=null,WS=null,GS=null,qr=null,DS=null,BS=null,jS=null,FS=null;async function ij(){if(vi&&Nh&&Lh)return!0;try{let r=await import("@hurdlegroup/robotjs");vi=r.default||r;let{TileManager:e}=await Promise.resolve().then(()=>(TS(),ES)),{ResourceManager:t}=await Promise.resolve().then(()=>(AS(),CS)),{ScreenUpdateHelper:n}=await Promise.resolve().then(()=>(kS(),RS)),{MouseHandler:i}=await Promise.resolve().then(()=>(MS(),OS)),{KeyboardHandler:s}=await Promise.resolve().then(()=>(NS(),IS)),{ScreenHandler:o}=await Promise.resolve().then(()=>(vh(),Qw));return Nh=e,Lh=t,US=n,qS=i,WS=s,GS=o,vi.setMouseDelay(2),vi.setKeyboardDelay(2),!0}catch(r){return console.error("\u274C Failed to load remote modules:",r.message),!1}}async function zS(r,e){if(!vn){r.emit("remote:unavailable");return}if(!await ij()){r.emit("remote:unavailable");return}qr||(qr=new Lh,DS=new US(qr),BS=new qS(vi,qr),jS=new WS(vi,qr),FS=new GS(qr,DS),qr.startResourceMonitoring());let n=r.data.protocol;if(!n){r.emit("remote:unavailable");return}let i=r.handshake.auth?.apiKey,s=new Nh(vi);qr.addClient(r.id,{tileManager:s,protocol:n,screenInterval:null,authenticated:!0,apiKey:i}),r.data.remoteAttached=!0;let o=a=>(...c)=>(hS(),a(...c));BS.setupMouseHandlers(r,o),jS.setupKeyboardHandlers(r,o),FS.setupScreenHandlers(r,o,n),r.on("disconnect",()=>{let a=n._adapters?.get("rtc"),c=!1,u=null,p=null,f=()=>{c||(c=!0,u&&(clearTimeout(u),u=null),a&&p&&a.off("stateChange",p),qr.removeClient(r.id),n.close(),Cs(n))};if(!a?.ready)return f();p=m=>{m===at.closed&&f()},a.on("stateChange",p),u=setTimeout(f,Y.resourceManagement.disconnectGraceMs)}),r.emit("remote:ready")}mn();var qn=J(require("fs"),1),Dh=J(require("path"),1),ql=0,Qo=null,sj=6e4,oj={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function xn(){return process.env.CODESPACES==="true"}function VS(){return xn()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function KS(){ql++,xn()&&ql===1&&aj()}function YS(){ql--,xn()&&ql===0&&cj()}function aj(){Qo||(Qo=setInterval(()=>{process.memoryUsage()},sj))}function cj(){Qo&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval(Qo),Qo=null)}function XS(r){return Dh.default.join(r,".devcontainer","devcontainer.json")}function JS(r){try{let e=XS(r);if(!qn.default.existsSync(e))return{enabled:!1,exists:!1};let t=JSON.parse(qn.default.readFileSync(e,"utf8"));return{enabled:t.postAttachCommand==="9remote start"||t.postAttachCommand==="9remote",exists:!0}}catch{return{enabled:!1,exists:!1,error:"Failed to read config"}}}function QS(r,e){try{let t=Dh.default.join(r,".devcontainer"),n=XS(r);qn.default.existsSync(t)||qn.default.mkdirSync(t,{recursive:!0});let i={...oj};if(qn.default.existsSync(n))try{i={...JSON.parse(qn.default.readFileSync(n,"utf8"))}}catch{}return e?(i.postAttachCommand="9remote start",i.postCreateCommand||(i.postCreateCommand="npm install -g 9remote@latest")):delete i.postAttachCommand,qn.default.writeFileSync(n,JSON.stringify(i,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var Wl=J(require("os"),1),ke=J(require("fs"),1),Wn=J(require("path"),1);xt();var Os=oe.BUFFERS,Gl=Wn.default.join(oe.STATE,"sessions.json"),zl=Wn.default.join(oe.STATE,"terminalGroups.json"),Vl="/tmp/9remote-uploads";ke.default.existsSync(Vl)||ke.default.mkdirSync(Vl,{recursive:!0});function Bh(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function jh(r){return r?"/workspaces":Wl.default.homedir()}function Fh(){let r=Wl.default.homedir(),e=Wl.default.userInfo().username,t=Bh(),n={...process.env};if(delete n.PORT,Object.assign(n,{HOME:r,USER:e,LOGNAME:e,SHELL:t,TERM:"xterm-256color",COLORTERM:"truecolor",LANG:"en_US.UTF-8",LC_ALL:"en_US.UTF-8",LC_CTYPE:"en_US.UTF-8",PWD:r,OLDPWD:r,TMPDIR:n.TMPDIR||(process.platform==="win32"?n.TEMP||n.TMP:"/tmp"),__CF_USER_TEXT_ENCODING:n.__CF_USER_TEXT_ENCODING,XPC_FLAGS:n.XPC_FLAGS,XPC_SERVICE_NAME:n.XPC_SERVICE_NAME,SSH_AUTH_SOCK:n.SSH_AUTH_SOCK,TERM_PROGRAM:"9Remote",TERM_PROGRAM_VERSION:"1.0.0",ITERM_SESSION_ID:`9remote-${Date.now()}`,SHLVL:"1"}),t.includes("bash")){let i=n.PROMPT_COMMAND||"";n.PROMPT_COMMAND=`printf "\\e]7;file://%s\\a" "\${HOSTNAME}\${PWD}"${i?`; ${i}`:""}`}return n}function ZS(){ke.default.existsSync(Os)||ke.default.mkdirSync(Os,{recursive:!0})}function $h(r,e,t){if(t==="buffer"){ZS();try{ke.default.writeFileSync(Wn.default.join(Os,`${r}.buf`),e.join(""),"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to save buffer for ${r}:`,n.message)}}}function eE(r,e){if(e!=="buffer")return null;let t=Wn.default.join(Os,`${r}.buf`);try{if(ke.default.existsSync(t))return ke.default.readFileSync(t,"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to load buffer for ${r}:`,n.message)}return null}function Kl(r){let e=Wn.default.join(Os,`${r}.buf`);try{ke.default.existsSync(e)&&ke.default.unlinkSync(e)}catch{}}function tE(){ZS();try{return ke.default.readdirSync(Os).filter(r=>r.endsWith(".buf")).map(r=>r.replace(".buf",""))}catch{return[]}}function Hh(){try{if(ke.default.existsSync(Gl))return JSON.parse(ke.default.readFileSync(Gl,"utf8"))}catch(r){console.log("\u26A0\uFE0F Failed to load session metadata:",r.message)}return{}}function yn(r){try{let e={};for(let[n,i]of r)e[n]={name:i.name,createdAt:i.createdAt,shellId:i.shellId,cwd:i.cwd};let t=Wn.default.dirname(Gl);ke.default.existsSync(t)||ke.default.mkdirSync(t,{recursive:!0}),ke.default.writeFileSync(Gl,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}function rE(){try{if(ke.default.existsSync(zl)){let r=JSON.parse(ke.default.readFileSync(zl,"utf8"));return{groups:r.groups||[],sessionGroups:r.sessionGroups||{}}}}catch(r){console.log("\u26A0\uFE0F Failed to load groups:",r.message)}return{groups:[],sessionGroups:{}}}function nE(r,e){try{let t=Wn.default.dirname(zl);ke.default.existsSync(t)||ke.default.mkdirSync(t,{recursive:!0});let n={groups:Array.from(r.values()),sessionGroups:e};ke.default.writeFileSync(zl,JSON.stringify(n,null,2),"utf8")}catch(t){console.log("\u26A0\uFE0F Failed to save groups:",t.message)}}var Uh=J(require("node-pty"),1);hi();var iE=2*1024*1024,lj=256*1024,xi="daemon";function sE(r,e,t,n,i){let s=null;r.onData(o=>{t.buffer.push(o),t.buffer.reduce((c,u)=>c+u.length,0)>iE&&(t.buffer=[t.buffer.join("").slice(-iE)]),St(n,"output",{sessionId:e,data:Buffer.from(o,"utf-8")}),xi==="buffer"&&(s&&clearTimeout(s),s=setTimeout(()=>$h(e,t.buffer,xi),2e3))}),r.onExit(({exitCode:o})=>{console.log(`PTY exited: sessionId=${e}, code=${o}`),xi==="buffer"&&t.buffer.length>0&&$h(e,t.buffer,xi),i.delete(e),Kl(e),St(n,"sessionClosed",e)})}function oE(r,e,t,n,i){let s=()=>nE(n,i);r.on("getSessions",o=>{let a=[];for(let[c,u]of t)a.push({id:c,name:u.name,createdAt:u.createdAt,restored:u.restored||!1,shellId:u.shellId,shellLabel:u.shellLabel,groupId:i[c]||null});o(a)}),r.on("getShells",o=>{o({platform:process.platform,shells:eS()})}),r.on("getGroups",o=>{o(Array.from(n.values()))}),r.on("createGroup",({name:o},a)=>{let c=`group-${Date.now()}`,u={id:c,name:o||"Group",createdAt:Date.now()};n.set(c,u),s(),St(e,"groupsChanged"),a({success:!0,group:u})}),r.on("renameGroup",({groupId:o,name:a},c)=>{let u=n.get(o);if(!u)return c({success:!1,error:"Group not found"});u.name=a,s(),St(e,"groupsChanged"),c({success:!0})}),r.on("deleteGroup",async({groupId:o},a)=>{if(!n.delete(o))return a({success:!1,error:"Group not found"});let c=Object.keys(i).filter(u=>i[u]===o);for(let u of c){let p=t.get(u);if(p){if(p.daemon&&Rr())try{await mi(u)}catch{}else p.pty&&(p.pty.kill(),Kl(u));t.delete(u),St(e,"sessionClosed",u)}delete i[u]}s(),St(e,"groupsChanged"),a({success:!0})}),r.on("moveSession",({sessionId:o,groupId:a},c)=>{a&&n.has(a)?i[o]=a:delete i[o],s(),St(e,"groupsChanged"),c({success:!0})}),r.on("createSession",async({name:o,shellId:a,groupId:c},u)=>{let p=`session-${Date.now()}`,f=tS(a),m=Fh();m.NINE_REMOTE_SESSION_ID=p;let y=jh(xn());try{let _=o||`${f.label} ${t.size+1}`;if(xi==="daemon"&&Rr()){let M=await Sh(_,80,24,a,p,y);M.success?(t.set(M.sessionId,{daemon:!0,name:_,createdAt:Date.now(),cwd:M.cwd,shellId:M.shellId,shellLabel:M.shellLabel}),c&&n.has(c)&&(i[M.sessionId]=c,s()),yn(t),u({success:!0,sessionId:M.sessionId,shellLabel:M.shellLabel})):u({success:!1,error:M.error});return}let S=Uh.default.spawn(f.path,f.args,{name:"xterm-256color",cols:80,rows:24,cwd:y,env:m,useConpty:!1}),A={pty:S,name:_,createdAt:Date.now(),buffer:[],cwd:y,shellId:f.id,shellLabel:f.label};sE(S,p,A,e,t),t.set(p,A),c&&n.has(c)&&(i[p]=c,s()),u({success:!0,sessionId:p,shellLabel:f.label})}catch(_){console.error("Failed to create session:",_),u({success:!1,error:_.message})}}),r.on("joinSession",async(o,a)=>{let c=t.get(o);if(!c)return a({success:!1,error:"Session not found"});if(c.daemon&&Rr()){try{if(c.needsRespawn){let p=await Sh(c.name,80,24,c.shellId,o,c.cwd);if(!p.success)return a({success:!1,error:p.error});delete c.needsRespawn,c.cwd=p.cwd,c.shellLabel=p.shellLabel,yn(t)}let u=await uS(o);u.cwd&&u.cwd!==c.cwd&&(c.cwd=u.cwd,yn(t)),a({success:u.success,name:c.name,cwd:u.cwd||c.cwd,error:u.error})}catch(u){a({success:!1,error:u.message})}return}if(c.needsRestore&&xi==="buffer")try{let u=Bh(),p=process.platform==="win32"?[]:["-l"],f=jh(xn()),m=Uh.default.spawn(u,p,{name:"xterm-256color",cols:80,rows:24,cwd:f,env:Fh(),useConpty:!1});c.pty=m,c.needsRestore=!1,c.cwd=f;let y=eE(o,xi);y&&(c.buffer=[y]),sE(m,o,c,e,t),console.log(`\u2705 Restored PTY session: ${o}`)}catch(u){return console.error("Failed to restore session:",u),a({success:!1,error:"Failed to restore session"})}c.buffer?.length>0&&r.emit("output",{sessionId:o,data:Buffer.from(c.buffer.join("").slice(-lj),"utf-8")}),a({success:!0,name:c.name,cwd:c.cwd})}),r.on("deleteSession",async(o,a)=>{let c=t.get(o);if(!c)return a({success:!1,error:"Session not found"});if(c.daemon&&Rr()){try{await mi(o),t.delete(o),i[o]&&(delete i[o],s()),yn(t),a({success:!0})}catch(u){a({success:!1,error:u.message})}return}c.pty&&c.pty.kill(),t.delete(o),i[o]&&(delete i[o],s()),Kl(o),St(e,"sessionClosed",o),yn(t),a({success:!0})}),r.on("renameSession",async({sessionId:o,name:a},c)=>{let u=t.get(o);if(!u)return c({success:!1,error:"Session not found"});u.name=a,St(e,"session-renamed",{sessionId:o,name:a}),yn(t),c({success:!0})})}var aE=J(require("fs"),1),cE=J(require("path"),1);function lE(r,e){r.on("input",({sessionId:t,data:n})=>{if(!t)return;let i=e.get(t);if(i){if(i.daemon&&Rr())return Eh(t,n);i.pty&&i.pty.write(Buffer.isBuffer(n)?n.toString("utf-8"):n)}}),r.on("resize",({sessionId:t,cols:n,rows:i})=>{if(!t)return;let s=e.get(t);if(s){if(s.daemon&&Rr())return pS(t,n,i);if(s.pty)try{s.pty.resize(n,i)}catch(o){console.log(`Resize failed for ${t}: ${o.message}`)}}}),r.on("upload-file",({sessionId:t,filename:n,size:i,content:s})=>{if(!t)return;let o=e.get(t);if(o)try{let a=n.replace(/[^a-zA-Z0-9._-]/g,"_"),c=cE.default.join(Vl,`${Date.now()}_${a}`);aE.default.writeFileSync(c,Buffer.from(s,"base64")),console.log(`\u{1F4CE} File uploaded: ${c} (${i} bytes)`),o.daemon&&Rr()?Eh(t,c):o.pty&&o.pty.write(c)}catch(a){console.error("File upload error:",a),r.emit("output",{sessionId:t,data:Buffer.from(`\r
108
+ `)+t,s=n+1,n=r.indexOf(`
109
+ `,s)}while(n!==-1);return i+=r.slice(s),i}var{stdout:Bv,stderr:jv}=Nv,Pp=Symbol("GENERATOR"),Bs=Symbol("STYLER"),lo=Symbol("IS_EMPTY"),Fv=["ansi","ansi","ansi256","ansi16m"],js=Object.create(null),_M=(r,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=Bv?Bv.level:0;r.level=e.level===void 0?t:e.level};var bM=r=>{let e=(...t)=>t.join(" ");return _M(e,r),Object.setPrototypeOf(e,uo.prototype),e};function uo(r){return bM(r)}Object.setPrototypeOf(uo.prototype,Function.prototype);for(let[r,e]of Object.entries(Er))js[r]={get(){let t=Ka(this,Np(e.open,e.close,this[Bs]),this[lo]);return Object.defineProperty(this,r,{value:t}),t}};js.visible={get(){let r=Ka(this,this[Bs],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var Ip=(r,e,t,...n)=>r==="rgb"?e==="ansi16m"?Er[t].ansi16m(...n):e==="ansi256"?Er[t].ansi256(Er.rgbToAnsi256(...n)):Er[t].ansi(Er.rgbToAnsi(...n)):r==="hex"?Ip("rgb",e,t,...Er.hexToRgb(...n)):Er[t][r](...n),wM=["rgb","hex","ansi256"];for(let r of wM){js[r]={get(){let{level:t}=this;return function(...n){let s=Np(Ip(r,Fv[t],"color",...n),Er.color.close,this[Bs]);return Ka(this,s,this[lo])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);js[e]={get(){let{level:t}=this;return function(...n){let s=Np(Ip(r,Fv[t],"bgColor",...n),Er.bgColor.close,this[Bs]);return Ka(this,s,this[lo])}}}}var SM=Object.defineProperties(()=>{},{...js,level:{enumerable:!0,get(){return this[Pp].level},set(r){this[Pp].level=r}}}),Np=(r,e,t)=>{let n,s;return t===void 0?(n=r,s=e):(n=t.openAll+r,s=e+t.closeAll),{open:r,close:e,openAll:n,closeAll:s,parent:t}},Ka=(r,e,t)=>{let n=(...s)=>EM(n,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(n,SM),n[Pp]=r,n[Bs]=e,n[lo]=t,n},EM=(r,e)=>{if(r.level<=0||!e)return r[lo]?"":e;let t=r[Bs];if(t===void 0)return e;let{openAll:n,closeAll:s}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=Lv(e,t.close,t.open),t=t.parent;let i=e.indexOf(`
110
+ `);return i!==-1&&(e=Dv(e,s,n,i)),n+e+s};Object.defineProperties(uo.prototype,js);var TM=uo(),j6=uo({level:jv?jv.level:0});var po=TM;jt();_t();$s();var Zb=J(Qb(),1),{Server:ew,Namespace:I8,Socket:N8}=Zb.default;var vk=require("fs"),yk=require("path");_t();gl();var pt={control:"control",binary:"binary"},ut={idle:"idle",connecting:"connecting",open:"open",degraded:"degraded",closed:"closed"},sw={clientApp:{enabled:["ws","rtc"],channels:{control:{strategy:"priority",prefer:"rtc"},binary:{strategy:"priority",prefer:"rtc"}}},remoteDesktop:{enabled:["ws","rtc"],channels:{control:{strategy:"priority",prefer:"rtc"},binary:{strategy:"priority",prefer:"rtc"}}}};var wi=class{static id="base";static capabilities={control:!1,binary:!1,signaling:"none"};static priority={control:0,binary:0};constructor(){this._listeners=new Map,this._state=ut.idle}get state(){return this._state}get ready(){return this._state===ut.open}supports(e){return!!this.constructor.capabilities[e]}on(e,t){this._listeners.has(e)||this._listeners.set(e,new Set),this._listeners.get(e).add(t)}off(e,t){this._listeners.get(e)?.delete(t)}_emit(e,...t){let n=this._listeners.get(e);if(n)for(let s of n)s(...t)}_setState(e){this._state!==e&&(this._state=e,this._emit("stateChange",e))}connect(e){throw new Error("Not implemented: connect")}disconnect(){throw new Error("Not implemented: disconnect")}send(e,t){throw new Error("Not implemented: send")}};var vl=class extends wi{static id="ws";static capabilities={control:!0,binary:!0,signaling:"ws"};static priority={control:100,binary:10};constructor(){super(),this._socket=null}get socket(){return this._socket}connect(e){this._socket=e.socket,this._setState(e.socket.connected?ut.open:ut.connecting),e.socket.on("connect",()=>this._setState(ut.open)),e.socket.on("disconnect",()=>this._setState(ut.closed)),e.socket.onAny?.((t,n)=>this._emit("message",{event:t,data:n,source:"ws"}))}disconnect(){this._socket=null,this._setState(ut.closed)}send(e,t){if(!this._socket?.connected)return!1;let n=this._socket._rawEmit||this._socket.emit.bind(this._socket);if(e===pt.control){let{event:s,args:i=[]}=t;return n(s,...i),!0}if(e===pt.binary){let s=this._socket.conn?.transport;return s&&s.writable===!1?!1:(n("tiles-bin-v2",t),!0)}return!1}};var pw=J(require("node-datachannel"),1);function wB(r,e){return e&&typeof e=="object"&&e.type==="Buffer"&&Array.isArray(e.data)?{__b:Buffer.from(e.data).toString("base64")}:e}function SB(r,e){return e&&typeof e=="object"&&typeof e.__b=="string"?Buffer.from(e.__b,"base64"):e}function iw(r){return JSON.stringify(r,wB)}function ow(r){return JSON.parse(typeof r=="string"?r:Buffer.from(r).toString("utf8"),SB)}ft();var lw=J(require("node:dns/promises"),1),EB=3e4,TB=/\s([0-9a-f-]{8,}\.local)\s/i,cw=new Map;async function CB(r){let e=cw.get(r);if(e&&Date.now()-e.ts<EB)return e.ip;try{let{address:t}=await lw.default.lookup(r);return cw.set(r,{ip:t,ts:Date.now()}),t}catch{return null}}async function uw(r){let e=r.match(TB);if(!e)return r;let t=await CB(e[1]);return t?r.replace(e[1],t):null}var{PeerConnection:AB}=pw.default,RB=[{hostname:"stun.l.google.com",port:19302,type:"Stun"},{hostname:"stun1.l.google.com",port:19302,type:"Stun"},{hostname:"stun2.l.google.com",port:19302,type:"Stun"},{hostname:"stun3.l.google.com",port:19302,type:"Stun"},{hostname:"stun4.l.google.com",port:19302,type:"Stun"},{hostname:"global.stun.twilio.com",port:3478,type:"Stun"},{hostname:"stun.cloudflare.com",port:3478,type:"Stun"}];async function kB(r,e){try{let t=await fetch(r,{headers:{"X-API-Key":e}});if(!t.ok)throw new Error(`HTTP ${t.status}`);let{iceServers:n}=await t.json(),s=[];for(let i of n)for(let o of i.urls)if(o.startsWith("stun:")){let a=o.replace("stun:","").split(":")[0],c=parseInt(o.split(":")[2]||"3478");s.push({hostname:a,port:c,type:"Stun"})}else if(o.startsWith("turn:")||o.startsWith("turns:")){let a=o.startsWith("turns:"),l=o.replace(/^turns?:/,"").split("?")[0],p=l.split(":")[0],f=parseInt(l.split(":")[1]||(a?"5349":"3478")),h=o.includes("transport=tcp")?"Tcp":"Udp";s.push({hostname:p,port:f,type:a?"Tls":"Turn",relayType:h,username:i.username,password:i.credential})}return s}catch(t){return console.error("[WebRtcProtocol] TURN fetch failed:",t.message),null}}var xl=class extends wi{static id="rtc";static capabilities={control:!0,binary:!0,signaling:"external"};static priority={control:50,binary:100};constructor(){super(),this._pc=null,this._dcControl=null,this._dcBinary=null,this._iceServers=RB,this._refreshTimer=null,this._remoteSet=!1,this._pendingCandidates=[],this._signaling=null,this._iceGraceTimer=null}async connect(e){this._ctx=e,this._setState(ut.connecting);let t=e.profile?.rtc||{};t.enableTurn&&e.auth?.apiKey&&t.turnApiUrl&&await this._refreshTurn(t),this._signaling=e.signaling,this._signaling?.on?.(n=>this._handleSignal(n,t))}disconnect(){clearTimeout(this._refreshTimer),this._signaling?.off?.(),this._signaling=null,this._cleanupPeer(),this._setState(ut.closed)}send(e,t){if(e===pt.control){if(!this._dcControl)return!1;try{return this._dcControl.sendMessage(iw({event:t.event,args:t.args||[],ackId:t.ackId||null})),!0}catch(n){return console.error("[WebRtcProtocol] send control:",n.message),!1}}if(e===pt.binary){if(!this._dcBinary)return!1;try{let n=Array.isArray(t)?t:[t],s=this._ctx.profile?.rtc?.dcMaxMessageSize??65536,i=Y.webrtc.dcBufferThreshold;for(let o of n){if(this._dcBinary.bufferedAmount()>i)return!0;o.length<=s&&this._dcBinary.sendMessageBinary(o)}return!0}catch(n){return console.error("[WebRtcProtocol] send binary:",n.message),!1}}return!1}_handleSignal(e,t){if(e.type==="offer")this._processOffer(e.sdp,t);else if(e.type==="ice"){if(!this._remoteSet||!this._pc){this._pendingCandidates.push({candidate:e.candidate,mid:e.mid||"0"});return}this._addRemoteCandidate(e.candidate,e.mid||"0")}}async _addRemoteCandidate(e,t){try{let n=await uw(e);if(!n||!this._pc)return;this._pc.addRemoteCandidate(n,t)}catch(n){console.error("[WebRtcProtocol] addRemoteCandidate:",n.message)}}_createPeer(e){try{this._pc?.close()}catch{}this._pc=null,this._dcControl=null,this._dcBinary=null,this._remoteSet=!1,this._pendingCandidates=[],this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null);let t=this._ctx?.auth?.socketId||"anon",n=new AB(`peer-${t}`,{iceServers:this._iceServers});this._pcState="new",n.onStateChange(s=>{if(this._pcState=s,s==="failed"||s==="closed")this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null),this._setState(ut.closed);else if(s==="disconnected"){if(this._iceGraceTimer)return;this._iceGraceTimer=setTimeout(()=>{this._iceGraceTimer=null,this._pcState!=="connected"&&this._setState(ut.closed)},Y.webrtc.iceDisconnectGraceMs)}else s==="connected"&&this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null)}),n.onDataChannel(s=>{let i=s.getLabel?.()||"",o=()=>{i==="control"?this._dcControl=s:i==="binary"&&(this._dcBinary=s),this._dcControl&&this._dcBinary&&this._setState(ut.open)};s.onOpen(o),s.onClosed(()=>{i==="control"&&(this._dcControl=null),i==="binary"&&(this._dcBinary=null),!this._dcControl&&!this._dcBinary&&this._setState(ut.closed)}),s.onError(a=>console.error(`[WebRtcProtocol] DC[${i}] error:`,a)),s.onMessage(a=>{if(i!=="control")return;let c;try{c=ow(a)}catch(l){console.error("[WebRtcProtocol] control parse:",l.message);return}try{this._emit("message",{event:c.event,data:c,source:"rtc"})}catch(l){console.error(`[WebRtcProtocol] handler error event=${c.event}:`,l.message)}})}),this._pc=n}_processOffer(e,t){return this._createPeer(t),new Promise((n,s)=>{this._pc.onLocalDescription((o,a)=>{a==="answer"&&(this._signaling?.send?.({type:"answer",sdp:o}),n())}),this._pc.onLocalCandidate((o,a)=>{o&&this._signaling?.send?.({type:"ice",candidate:o,mid:a})});try{this._pc.setRemoteDescription(e,"offer"),this._remoteSet=!0;for(let{candidate:o,mid:a}of this._pendingCandidates)this._addRemoteCandidate(o,a);this._pendingCandidates=[],this._pc.setLocalDescription()}catch(o){this._signaling?.send?.({type:"error",message:o.message}),s(o)}let i=t?.answerTimeout||1e4;setTimeout(()=>s(new Error("Answer timeout")),i)})}_cleanupPeer(){this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null);try{this._pc?.close()}catch{}this._pc=null,this._dcControl=null,this._dcBinary=null}async _refreshTurn(e){let t=await kB(e.turnApiUrl,this._ctx.auth.apiKey);t?.length&&(this._iceServers=t,Y.logging?.webrtc&&console.log(`[WebRtcProtocol] TURN credentials loaded (${t.length} servers)`)),clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(()=>this._refreshTurn(e),e.turnRefreshInterval)}};var fw=new Map;function rh(r){if(!r?.id)throw new Error("Adapter missing static id");fw.set(r.id,r)}function dw(r){return fw.get(r)}wh();rh(vl);rh(xl);var Ml=class{constructor(e,t){let n=t.enableWebRTC?"remoteDesktop":"clientApp",s={...sw[n]};t.enableWebRTC||(s.enabled=["ws"]),s.rtc={enableTurn:!!(t.apiKey&&t.turnApiUrl),turnApiUrl:t.turnApiUrl||null,turnRefreshInterval:t.turnRefreshInterval,dcMaxMessageSize:t.dcMaxMessageSize,answerTimeout:t.answerTimeout},this._profile=s,this._auth={apiKey:t.apiKey||null,socketId:e.id},this._socket=e,this._wsChunkSize=t.wsChunkSize,this._dcChunkSize=t.dcChunkSize,this._dcMaxTilesPerFrame=t.dcMaxTilesPerFrame,this._maxControlBuffer=t.maxControlBuffer,this._adapters=new Map,this._listeners=new Map,this._buffer=[],this._rtcSignalingHandler=null,this._sigListeners=null,this._chunkOffset=0}get type(){return this._pickAdapter(pt.binary)?.constructor.id==="rtc"?"dc":"ws"}async init(){for(let e of this._profile.enabled){let t=dw(e);if(!t)continue;let n=new t;n.on("stateChange",i=>this._onAdapterStateChange(e,i)),n.on("message",({event:i,data:o,source:a})=>this._dispatch(i,o,a)),this._adapters.set(e,n);let s=this._buildCtx(e);await n.connect(s)}}setupSignaling(e){this._installSignalingListeners()}emit(e,...t){this._sendControl(e,t)}sendTiles(e,t){let{tiles:n,timestamp:s}=e;if(!n?.length)return[];let i=this._pickAdapter(pt.binary),o=s??Date.now();if(i?.constructor.id==="rtc"&&t){let a=[];for(let c=0;c<n.length;c+=this._dcChunkSize)a.push(t(n.slice(c,c+this._dcChunkSize),o));return i.send(pt.binary,a),n}return this._emitTilesChunked(n,o)}close(){for(let e of this._adapters.values())try{e.disconnect()}catch{}this._adapters.clear(),this._buffer=[]}attachAsBus(e){if(e._rawEmit)return;let t=e.emit.bind(e);e._rawEmit=t;let n=new Set(["error","disconnect","disconnecting","connect","newListener","removeListener"]);e.emit=(s,...i)=>n.has(s)?t(s,...i):(this._sendControl(s,i),!0)}_emitTilesChunked(e,t){let n=this._adapters.get("ws");if(!n?.ready)return[];let s=this._wsChunkSize,i=e.length,o=i>s?this._chunkOffset%i:0;i>s&&(this._chunkOffset=(o+s)%i);let a=[];for(let c=0;c<i;c+=s){let l=[];for(let p=0;p<s&&c+p<i;p++)l.push(e[(o+c+p)%i]);if(n.send(pt.binary,ki(l,t))===!1)break;a.push(...l)}return a}_buildCtx(e){let t={auth:this._auth,profile:this._profile};return e==="ws"&&(t.socket=this._socket),e==="rtc"&&(t.signaling={send:n=>this._sendSignaling(n),on:n=>{this._rtcSignalingHandler=n,this._installSignalingListeners()},off:()=>{this._rtcSignalingHandler=null,this._removeSignalingListeners()}}),t}_onAdapterStateChange(e,t){t===ut.open&&this._flushBuffer()}_pickAdapter(e){let t=this._profile.channels[e];if(!t)return null;let n=[...this._adapters.values()].filter(s=>s.supports(e)&&s.ready);if(t.prefer){let s=n.find(i=>i.constructor.id===t.prefer);if(s)return s}return n.sort((s,i)=>(i.constructor.priority[e]??0)-(s.constructor.priority[e]??0)),n[0]||null}hasReadyAdapter(){return!!(this._pickAdapter(pt.control)||this._pickAdapter(pt.binary))}_sendControl(e,t,n){let s=this._pickAdapter(pt.control);if(!s){this._buffer.push({event:e,args:t,ackId:n}),this._buffer.length>this._maxControlBuffer&&this._buffer.shift();return}s.constructor.id==="rtc"?s.send(pt.control,{event:e,args:t,ackId:n}):s.send(pt.control,{event:e,args:t})}_flushBuffer(){if(!(!this._buffer.length||!this._pickAdapter(pt.control)))for(;this._buffer.length;){let{event:t,args:n,ackId:s}=this._buffer.shift();this._sendControl(t,n,s)}}_dispatch(e,t,n){if(n==="rtc"){let i=Array.isArray(t?.args)?[...t.args]:[],o=t?.ackId;o&&i.push((...l)=>this._sendAck(o,l));let a=this._listeners.get(e);if(a)for(let l of a)l(...i);let c=this._socket.listeners?.(e)||[];for(let l of c)l(...i);return}let s=this._listeners.get(e);if(s)for(let i of s)i(t)}_sendAck(e,t){let n=this._adapters.get("rtc");n?.ready&&n.send(pt.control,{event:"__ack",args:t,ackId:e})}_sendSignaling(e){let t=this._adapters.get("ws");if(t?.ready){t.send(pt.control,{event:this._sigEvent(e.type),args:[this._sigData(e)]});return}console.warn("[ProtocolManager] signaling unavailable (ws down)")}_sigEvent(e){return e==="offer"?"webrtc:offer":e==="answer"?"webrtc:answer":e==="ice"?"webrtc:ice-candidate":"webrtc:error"}_sigData(e){return e.type==="offer"||e.type==="answer"?{sdp:e.sdp}:e.type==="ice"?{candidate:e.candidate,mid:e.mid}:e}_installSignalingListeners(){if(!this._rtcSignalingHandler||this._sigListeners)return;let e=({sdp:n})=>this._rtcSignalingHandler?.({type:"offer",sdp:n}),t=({candidate:n,mid:s})=>this._rtcSignalingHandler?.({type:"ice",candidate:n,mid:s});this._sigListeners={onOffer:e,onIce:t},this._socket.on("webrtc:offer",e),this._socket.on("webrtc:ice-candidate",t)}_removeSignalingListeners(){this._sigListeners&&(this._socket.off("webrtc:offer",this._sigListeners.onOffer),this._socket.off("webrtc:ice-candidate",this._sigListeners.onIce),this._sigListeners=null)}};vs();ft();var oC=require("path"),aC=require("url");var Bl=J(require("net"),1),ce=J(require("fs"),1),de=J(require("path"),1),pS=J(require("os"),1),fS=require("child_process"),dS=require("url");var Eh={win32:[{id:"cmd",label:"Command Prompt",path:"cmd.exe",args:[]},{id:"powershell",label:"PowerShell",path:"powershell.exe",args:["-NoLogo"]},{id:"pwsh",label:"PowerShell Core",path:"pwsh.exe",args:["-NoLogo"]}],unix:[{id:"bash",label:"Bash",path:"/bin/bash",args:["-l"]},{id:"zsh",label:"Zsh",path:"/bin/zsh",args:["-l"]},{id:"sh",label:"Sh",path:"/bin/sh",args:["-l"]}]};function aS(){return process.platform==="win32"?Eh.win32:[]}function cS(r){if(process.platform==="win32"){let n=r?Eh.win32.find(i=>i.id===r):null;if(n)return n;let s=process.env.COMSPEC;return s?{id:"cmd",label:"Command Prompt",path:s,args:[]}:Eh.win32[0]}let e=process.env.SHELL||"/bin/bash",t=e.split("/").pop();return{id:t,label:t,path:e,args:["-l"]}}var Ch=de.default.dirname((0,dS.fileURLToPath)(__importMetaUrl)),_n=de.default.join(pS.default.homedir(),".9remote"),ea=process.platform==="win32"?"\\\\.\\pipe\\9remote-pty":de.default.join(_n,"pty-daemon.sock"),lS=de.default.join(Ch,"ptyDaemon.js"),uS=de.default.join(Ch,"ptyDaemon.cjs"),Pl=de.default.join(_n,"daemon");function hS(r,e){if(ce.default.existsSync(r)){ce.default.mkdirSync(e,{recursive:!0});for(let t of ce.default.readdirSync(r,{withFileTypes:!0})){let n=de.default.join(r,t.name),s=de.default.join(e,t.name);t.isDirectory()?hS(n,s):t.isFile()&&ce.default.copyFileSync(n,s)}}}function rj(r,e){let t=r;for(let n=0;n<6;n++){let s=de.default.join(t,"node_modules",e);if(ce.default.existsSync(s))return s;let i=de.default.dirname(t);if(i===t)break;t=i}return null}var nj=r=>rj(r,"node-pty");function sj(r){try{if(!ce.default.existsSync(Pl))return;let e=de.default.join(_n,"pids","ptyDaemon.pid"),t=!1;try{let n=parseInt(ce.default.readFileSync(e,"utf8").trim(),10);if(Number.isFinite(n)&&n>0)try{process.kill(n,0),t=!0}catch{}}catch{}if(t)return;for(let n of ce.default.readdirSync(Pl))if(n!==`v${r}`)try{ce.default.rmSync(de.default.join(Pl,n),{recursive:!0,force:!0})}catch{}}catch{}}function ij(r){sj("18");let e=de.default.join(Pl,`v${"18"}`),t=r.endsWith(".js"),n=t?de.default.join(e,"features","terminal"):e,s=de.default.join(n,de.default.basename(r)),i=de.default.join(n,"node_modules","node-pty");if(ce.default.existsSync(s)&&ce.default.existsSync(i))return{script:s,cwd:n};try{if(ce.default.mkdirSync(n,{recursive:!0}),ce.default.copyFileSync(r,s),t){let a=de.default.dirname(r);ce.default.copyFileSync(de.default.join(a,"constants.js"),de.default.join(n,"constants.js"));let c=de.default.join(e,"lib");ce.default.mkdirSync(c,{recursive:!0}),ce.default.copyFileSync(de.default.resolve(a,"..","..","lib","constants.js"),de.default.join(c,"constants.js"))}let o=nj(de.default.dirname(r));return o?(hS(o,i),{script:s,cwd:n}):null}catch{return null}}var zr=null,Mi=!1,Gn=!1,Th="",oj=0,Pi=new Map,Il=new Map;function aj(){return++oj}function jl(r,e){Il.has(r)||Il.set(r,[]),Il.get(r).push(e)}function Ll(r,e){let t=Il.get(r);if(t)for(let n of t)try{n(e)}catch(s){console.error(`[DaemonClient] Error in ${r} handler:`,s)}}function Ah(r){if(!zr||!Mi)return!1;try{return zr.write(JSON.stringify(r)+`
111
+ `),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function Fl(r,e=5e3){return new Promise((t,n)=>{let s=aj();r.requestId=s;let i=setTimeout(()=>{Pi.delete(s),n(new Error("Request timeout"))},e);Pi.set(s,{resolve:t,reject:n,timer:i}),Ah(r)||(clearTimeout(i),Pi.delete(s),n(new Error("Not connected to daemon")))})}function cj(r){let{type:e,requestId:t,...n}=r;if(t&&Pi.has(t)){let{resolve:s,timer:i}=Pi.get(t);clearTimeout(i),Pi.delete(t),s({type:e,...n});return}switch(e){case"output":Ll("output",{sessionId:n.sessionId,data:Buffer.from(n.data,"base64")});break;case"sessionClosed":Ll("sessionClosed",n.sessionId);break;case"pong":break;default:console.log("[DaemonClient] Unknown message:",e)}}function Dl(){return new Promise(r=>{let e=Bl.default.connect(ea),t=setTimeout(()=>{e.destroy(),r(!1)},1e3);e.on("connect",()=>{clearTimeout(t),e.destroy(),r(!0)}),e.on("error",()=>{if(clearTimeout(t),process.platform!=="win32"&&ce.default.existsSync(ea))try{ce.default.unlinkSync(ea)}catch{}r(!1)})})}function lj(){ce.default.existsSync(_n)||ce.default.mkdirSync(_n,{recursive:!0});let r=ce.default.existsSync(lS)?lS:ce.default.existsSync(uS)?uS:null;if(!r)return console.error("[DaemonClient] \u274C Daemon script not found"),null;let e=ij(r);return e||{script:r,cwd:Ch}}async function uj(){if(!ce.default.existsSync(_n))try{ce.default.mkdirSync(_n,{recursive:!0})}catch(a){return console.error("[DaemonClient] Failed to create socket directory:",a.message),!1}let r=lj();if(!r)return!1;let{script:e,cwd:t}=r,n=de.default.join(_n,"logs");try{ce.default.mkdirSync(n,{recursive:!0})}catch{}let s=de.default.join(n,"daemon.log"),i;try{i=ce.default.openSync(s,"w")}catch(a){console.error("[DaemonClient] Failed to open log file:",a.message),i="ignore"}if((0,fS.spawn)("node",[e],{detached:!0,stdio:["ignore",i,i],cwd:t}).unref(),typeof i=="number")try{ce.default.closeSync(i)}catch{}for(let a=0;a<20;a++)if(await new Promise(c=>setTimeout(c,100)),await Dl())return!0;console.error("[DaemonClient] \u274C Failed to start daemon");try{let a=ce.default.readFileSync(s,"utf8");a.trim()&&(console.error("[DaemonClient] Daemon log:"),console.error(a))}catch{}return!1}function pj(){return new Promise(r=>{let e=Bl.default.connect(ea),t="",n=i=>{try{e.destroy()}catch{}r(i)},s=setTimeout(()=>n(null),2e3);e.on("connect",()=>e.write(JSON.stringify({type:"ping",requestId:-1})+`
112
+ `)),e.on("data",i=>{t+=i.toString();let o=t.indexOf(`
113
+ `);if(o!==-1){clearTimeout(s);try{let a=JSON.parse(t.slice(0,o));n(a.version||"unknown")}catch{n(null)}}}),e.on("error",()=>{clearTimeout(s),n(null)})})}async function fj(){try{let r=de.default.join(_n,"pids","ptyDaemon.pid"),e=parseInt(ce.default.readFileSync(r,"utf8").trim(),10);Number.isFinite(e)&&e>0&&process.kill(e,"SIGTERM")}catch{}for(let r=0;r<20;r++){if(!await Dl())return;await new Promise(e=>setTimeout(e,100))}}async function mS(){if(!(Mi||Gn)){Gn=!0;try{if(await Dl()){let r=await pj();r!=="18"&&(console.log(`[DaemonClient] Daemon v${r} != v${"18"}, restarting`),await fj())}return!await Dl()&&!await uj()?(console.error("[DaemonClient] \u274C Failed to start daemon"),Gn=!1,!1):new Promise(r=>{let e=setTimeout(()=>{console.error("[DaemonClient] \u274C Connection timeout after 5s"),zr&&zr.destroy(),Gn=!1,r(!1)},5e3);zr=Bl.default.connect(ea),zr.on("connect",()=>{clearTimeout(e),Mi=!0,Gn=!1,Ll("connected"),r(!0)}),zr.on("data",t=>{Th+=t.toString();let n=Th.split(`
114
+ `);Th=n.pop()||"";for(let s of n)if(s.trim())try{cj(JSON.parse(s))}catch{console.error("[DaemonClient] Invalid message:",s)}}),zr.on("close",()=>{Mi=!1,zr=null,Ll("disconnected"),setTimeout(()=>{!Mi&&!Gn&&mS()},2e3)}),zr.on("error",t=>{clearTimeout(e),console.error("[DaemonClient] \u274C Connection error:",t.message),console.error("[DaemonClient] Error code:",t.code),Gn=!1,r(!1)})})}catch(r){return console.error("[DaemonClient] \u274C Connect error:",r),Gn=!1,!1}}}async function gS(){return mS()}function Pr(){return Mi}async function Hl(){return(await Fl({type:"listSessions"})).sessions||[]}async function Rh(r,e=80,t=24,n=null,s=`session-${Date.now()}`,i=null){return await Fl({type:"createSession",sessionId:s,name:r,cols:e,rows:t,shellId:n,cwd:i})}async function vS(r){return await Fl({type:"joinSession",sessionId:r})}function kh(r,e){return Ah({type:"input",sessionId:r,data:e})}function yS(r,e,t){return Ah({type:"resize",sessionId:r,cols:e,rows:t})}async function ys(r){return await Fl({type:"deleteSession",sessionId:r})}vs();$s();var _S=require("child_process");ft();var dj={darwin:()=>({cmd:"caffeinate",args:["-u","-t",String(Y.displayWake.macDurationSec)]}),linux:()=>({cmd:"xset",args:["dpms","force","on"]}),win32:()=>({cmd:"powershell.exe",args:["-NonInteractive","-NoProfile","-WindowStyle","Hidden","-Command",`Add-Type -Name K -Namespace W -MemberDefinition '[System.Runtime.InteropServices.DllImport("kernel32")]public static extern uint SetThreadExecutionState(uint e);'; [void][W.K]::SetThreadExecutionState(0x80000003)`]})},xS=0;function bS(){let r=Y.displayWake;if(!r?.enabled)return;let e=Date.now();if(e-xS<r.throttleMs)return;xS=e;let t=dj[process.platform];if(t)try{let{cmd:n,args:s}=t(),i=(0,_S.spawn)(n,s,{detached:!0,stdio:"ignore",windowsHide:!0});i.on("error",()=>{}),i.unref()}catch{}}ft();var US=In("remote"),bn=null;function xj(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function VS(){if(bn!==null)return bn;if(xj())return bn=!1,US.info("\u2705 Remote desktop not available (headless environment)"),bn;try{let r=await import("@hurdlegroup/robotjs");(r.default||r).getScreenSize(),bn=!0}catch{bn=!1,US.info("\u2705 Remote desktop not available (no display or robotjs not installed)")}return bn}function zl(){return bn===!0}function KS(){return Vr}var _s=null,Fh=null,Hh=null,YS=null,XS=null,JS=null,QS=null,Vr=null,qS=null,WS=null,GS=null,zS=null;async function _j(){if(_s&&Fh&&Hh)return!0;try{let r=await import("@hurdlegroup/robotjs");_s=r.default||r;let{TileManager:e}=await Promise.resolve().then(()=>(PS(),MS)),{ResourceManager:t}=await Promise.resolve().then(()=>(NS(),IS)),{ScreenUpdateHelper:n}=await Promise.resolve().then(()=>(DS(),LS)),{MouseHandler:s}=await Promise.resolve().then(()=>(jS(),BS)),{KeyboardHandler:i}=await Promise.resolve().then(()=>($S(),HS)),{ScreenHandler:o}=await Promise.resolve().then(()=>(wh(),iS));return Fh=e,Hh=t,YS=n,XS=s,JS=i,QS=o,_s.setMouseDelay(2),_s.setKeyboardDelay(2),!0}catch(r){return console.error("\u274C Failed to load remote modules:",r.message),!1}}async function ZS(r,e){if(!bn){r.emit("remote:unavailable");return}if(!await _j()){r.emit("remote:unavailable");return}Vr||(Vr=new Hh,qS=new YS(Vr),WS=new XS(_s,Vr),GS=new JS(_s,Vr),zS=new QS(Vr,qS),Vr.startResourceMonitoring());let n=r.data.protocol;if(!n){r.emit("remote:unavailable");return}let s=r.handshake.auth?.apiKey,i=new Fh(_s);Vr.addClient(r.id,{tileManager:i,protocol:n,screenInterval:null,authenticated:!0,apiKey:s}),r.data.remoteAttached=!0;let o=a=>(...c)=>(bS(),a(...c));WS.setupMouseHandlers(r,o),GS.setupKeyboardHandlers(r,o),zS.setupScreenHandlers(r,o,n),r.on("disconnect",()=>{let a=n._adapters?.get("rtc"),c=!1,l=null,p=null,f=()=>{c||(c=!0,l&&(clearTimeout(l),l=null),a&&p&&a.off("stateChange",p),Vr.removeClient(r.id),n.close(),Oi(n))};if(!a?.ready)return f();p=h=>{h===ut.closed&&f()},a.on("stateChange",p),l=setTimeout(f,Y.resourceManagement.disconnectGraceMs)}),r.emit("remote:ready")}xn();var zn=J(require("fs"),1),$h=J(require("path"),1),Vl=0,ra=null,bj=6e4,wj={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function wn(){return process.env.CODESPACES==="true"}function eE(){return wn()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function tE(){Vl++,wn()&&Vl===1&&Sj()}function rE(){Vl--,wn()&&Vl===0&&Ej()}function Sj(){ra||(ra=setInterval(()=>{process.memoryUsage()},bj))}function Ej(){ra&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval(ra),ra=null)}function nE(r){return $h.default.join(r,".devcontainer","devcontainer.json")}function sE(r){try{let e=nE(r);if(!zn.default.existsSync(e))return{enabled:!1,exists:!1};let t=JSON.parse(zn.default.readFileSync(e,"utf8"));return{enabled:t.postAttachCommand==="9remote start"||t.postAttachCommand==="9remote",exists:!0}}catch{return{enabled:!1,exists:!1,error:"Failed to read config"}}}function iE(r,e){try{let t=$h.default.join(r,".devcontainer"),n=nE(r);zn.default.existsSync(t)||zn.default.mkdirSync(t,{recursive:!0});let s={...wj};if(zn.default.existsSync(n))try{s={...JSON.parse(zn.default.readFileSync(n,"utf8"))}}catch{}return e?(s.postAttachCommand="9remote start",s.postCreateCommand||(s.postCreateCommand="npm install -g 9remote@latest")):delete s.postAttachCommand,zn.default.writeFileSync(n,JSON.stringify(s,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var Kl=J(require("os"),1),Me=J(require("fs"),1),Vn=J(require("path"),1);_t();var Ni=oe.BUFFERS,Yl=Vn.default.join(oe.STATE,"sessions.json"),Xl=Vn.default.join(oe.STATE,"terminalGroups.json"),Jl="/tmp/9remote-uploads";Me.default.existsSync(Jl)||Me.default.mkdirSync(Jl,{recursive:!0});function Uh(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function qh(r){return r?"/workspaces":Kl.default.homedir()}function Wh(){let r=Kl.default.homedir(),e=Kl.default.userInfo().username,t=Uh(),n={...process.env};if(delete n.PORT,Object.assign(n,{HOME:r,USER:e,LOGNAME:e,SHELL:t,TERM:"xterm-256color",COLORTERM:"truecolor",LANG:"en_US.UTF-8",LC_ALL:"en_US.UTF-8",LC_CTYPE:"en_US.UTF-8",PWD:r,OLDPWD:r,TMPDIR:n.TMPDIR||(process.platform==="win32"?n.TEMP||n.TMP:"/tmp"),__CF_USER_TEXT_ENCODING:n.__CF_USER_TEXT_ENCODING,XPC_FLAGS:n.XPC_FLAGS,XPC_SERVICE_NAME:n.XPC_SERVICE_NAME,SSH_AUTH_SOCK:n.SSH_AUTH_SOCK,TERM_PROGRAM:"9Remote",TERM_PROGRAM_VERSION:"1.0.0",ITERM_SESSION_ID:`9remote-${Date.now()}`,SHLVL:"1"}),t.includes("bash")){let s=n.PROMPT_COMMAND||"";n.PROMPT_COMMAND=`printf "\\e]7;file://%s\\a" "\${HOSTNAME}\${PWD}"${s?`; ${s}`:""}`}return n}function oE(){Me.default.existsSync(Ni)||Me.default.mkdirSync(Ni,{recursive:!0})}function Gh(r,e,t){if(t==="buffer"){oE();try{Me.default.writeFileSync(Vn.default.join(Ni,`${r}.buf`),e.join(""),"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to save buffer for ${r}:`,n.message)}}}function aE(r,e){if(e!=="buffer")return null;let t=Vn.default.join(Ni,`${r}.buf`);try{if(Me.default.existsSync(t))return Me.default.readFileSync(t,"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to load buffer for ${r}:`,n.message)}return null}function Ql(r){let e=Vn.default.join(Ni,`${r}.buf`);try{Me.default.existsSync(e)&&Me.default.unlinkSync(e)}catch{}}function cE(){oE();try{return Me.default.readdirSync(Ni).filter(r=>r.endsWith(".buf")).map(r=>r.replace(".buf",""))}catch{return[]}}function zh(){try{if(Me.default.existsSync(Yl))return JSON.parse(Me.default.readFileSync(Yl,"utf8"))}catch(r){console.log("\u26A0\uFE0F Failed to load session metadata:",r.message)}return{}}function Sn(r){try{let e={};for(let[n,s]of r)e[n]={name:s.name,createdAt:s.createdAt,shellId:s.shellId,cwd:s.cwd};let t=Vn.default.dirname(Yl);Me.default.existsSync(t)||Me.default.mkdirSync(t,{recursive:!0}),Me.default.writeFileSync(Yl,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}function lE(){try{if(Me.default.existsSync(Xl)){let r=JSON.parse(Me.default.readFileSync(Xl,"utf8"));return{groups:r.groups||[],sessionGroups:r.sessionGroups||{},sessionOrder:r.sessionOrder||[]}}}catch(r){console.log("\u26A0\uFE0F Failed to load groups:",r.message)}return{groups:[],sessionGroups:{},sessionOrder:[]}}function uE(r,e,t=[]){try{let n=Vn.default.dirname(Xl);Me.default.existsSync(n)||Me.default.mkdirSync(n,{recursive:!0});let s={groups:Array.from(r.values()),sessionGroups:e,sessionOrder:t};Me.default.writeFileSync(Xl,JSON.stringify(s,null,2),"utf8")}catch(n){console.log("\u26A0\uFE0F Failed to save groups:",n.message)}}var Vh=J(require("node-pty"),1);vs();var pE=2*1024*1024,Tj=256*1024,bs="daemon";function fE(r,e,t,n,s){let i=null;r.onData(o=>{t.buffer.push(o),t.buffer.reduce((c,l)=>c+l.length,0)>pE&&(t.buffer=[t.buffer.join("").slice(-pE)]),bt(n,"output",{sessionId:e,data:Buffer.from(o,"utf-8")}),bs==="buffer"&&(i&&clearTimeout(i),i=setTimeout(()=>Gh(e,t.buffer,bs),2e3))}),r.onExit(({exitCode:o})=>{console.log(`PTY exited: sessionId=${e}, code=${o}`),bs==="buffer"&&t.buffer.length>0&&Gh(e,t.buffer,bs),s.delete(e),Ql(e),bt(n,"sessionClosed",e)})}function dE(r,e,t,n,s,i=[]){let o=()=>uE(n,s,i);r.on("getSessions",a=>{let c=[];for(let[p,f]of t)c.push({id:p,name:f.name,createdAt:f.createdAt,restored:f.restored||!1,shellId:f.shellId,shellLabel:f.shellLabel,groupId:s[p]||null});let l=new Map(i.map((p,f)=>[p,f]));c.sort((p,f)=>(l.has(p.id)?l.get(p.id):1/0)-(l.has(f.id)?l.get(f.id):1/0)),a(c)}),r.on("getShells",a=>{a({platform:process.platform,shells:aS()})}),r.on("getGroups",a=>{a(Array.from(n.values()))}),r.on("createGroup",({name:a},c)=>{let l=`group-${Date.now()}`,p={id:l,name:a||"Group",createdAt:Date.now()};n.set(l,p),o(),bt(e,"groupsChanged"),c({success:!0,group:p})}),r.on("renameGroup",({groupId:a,name:c},l)=>{let p=n.get(a);if(!p)return l({success:!1,error:"Group not found"});p.name=c,o(),bt(e,"groupsChanged"),l({success:!0})}),r.on("deleteGroup",async({groupId:a},c)=>{if(!n.delete(a))return c({success:!1,error:"Group not found"});let l=Object.keys(s).filter(p=>s[p]===a);for(let p of l){let f=t.get(p);if(f){if(f.daemon&&Pr())try{await ys(p)}catch{}else f.pty&&(f.pty.kill(),Ql(p));t.delete(p),bt(e,"sessionClosed",p)}delete s[p]}o(),bt(e,"groupsChanged"),c({success:!0})}),r.on("moveSession",({sessionId:a,groupId:c},l)=>{c&&n.has(c)?s[a]=c:delete s[a],o(),bt(e,"groupsChanged"),l({success:!0})}),r.on("reorderSession",({orderedIds:a},c)=>{if(!Array.isArray(a))return c?.({success:!1,error:"orderedIds required"});let l=new Set(a),p=i.filter(h=>!l.has(h)),f=[...t.keys()].filter(h=>!l.has(h)&&!p.includes(h));i.length=0,i.push(...p,...f,...a),o(),bt(e,"groupsChanged"),c?.({success:!0})}),r.on("createSession",async({name:a,shellId:c,groupId:l},p)=>{let f=`session-${Date.now()}`,h=cS(c),x=Wh();x.NINE_REMOTE_SESSION_ID=f;let _=qh(wn());try{let S=a||`${h.label} ${t.size+1}`;if(bs==="daemon"&&Pr()){let N=await Rh(S,80,24,c,f,_);N.success?(t.set(N.sessionId,{daemon:!0,name:S,createdAt:Date.now(),cwd:N.cwd,shellId:N.shellId,shellLabel:N.shellLabel}),l&&n.has(l)&&(s[N.sessionId]=l,o()),Sn(t),p({success:!0,sessionId:N.sessionId,shellLabel:N.shellLabel})):p({success:!1,error:N.error});return}let A=Vh.default.spawn(h.path,h.args,{name:"xterm-256color",cols:80,rows:24,cwd:_,env:x,useConpty:!1}),M={pty:A,name:S,createdAt:Date.now(),buffer:[],cwd:_,shellId:h.id,shellLabel:h.label};fE(A,f,M,e,t),t.set(f,M),l&&n.has(l)&&(s[f]=l,o()),p({success:!0,sessionId:f,shellLabel:h.label})}catch(S){console.error("Failed to create session:",S),p({success:!1,error:S.message})}}),r.on("joinSession",async(a,c)=>{let l=t.get(a);if(!l)return c({success:!1,error:"Session not found"});if(l.daemon&&Pr()){try{if(l.needsRespawn){let f=await Rh(l.name,80,24,l.shellId,a,l.cwd);if(!f.success)return c({success:!1,error:f.error});delete l.needsRespawn,l.cwd=f.cwd,l.shellLabel=f.shellLabel,Sn(t)}let p=await vS(a);p.cwd&&p.cwd!==l.cwd&&(l.cwd=p.cwd,Sn(t)),c({success:p.success,name:l.name,cwd:p.cwd||l.cwd,error:p.error})}catch(p){c({success:!1,error:p.message})}return}if(l.needsRestore&&bs==="buffer")try{let p=Uh(),f=process.platform==="win32"?[]:["-l"],h=qh(wn()),x=Vh.default.spawn(p,f,{name:"xterm-256color",cols:80,rows:24,cwd:h,env:Wh(),useConpty:!1});l.pty=x,l.needsRestore=!1,l.cwd=h;let _=aE(a,bs);_&&(l.buffer=[_]),fE(x,a,l,e,t),console.log(`\u2705 Restored PTY session: ${a}`)}catch(p){return console.error("Failed to restore session:",p),c({success:!1,error:"Failed to restore session"})}l.buffer?.length>0&&r.emit("output",{sessionId:a,data:Buffer.from(l.buffer.join("").slice(-Tj),"utf-8")}),c({success:!0,name:l.name,cwd:l.cwd})}),r.on("deleteSession",async(a,c)=>{let l=t.get(a);if(!l)return c({success:!1,error:"Session not found"});if(l.daemon&&Pr()){try{await ys(a),t.delete(a),s[a]&&(delete s[a],o()),Sn(t),c({success:!0})}catch(p){c({success:!1,error:p.message})}return}l.pty&&l.pty.kill(),t.delete(a),s[a]&&(delete s[a],o()),Ql(a),bt(e,"sessionClosed",a),Sn(t),c({success:!0})}),r.on("renameSession",async({sessionId:a,name:c},l)=>{let p=t.get(a);if(!p)return l({success:!1,error:"Session not found"});p.name=c,bt(e,"session-renamed",{sessionId:a,name:c}),Sn(t),l({success:!0})})}var hE=J(require("fs"),1),mE=J(require("path"),1);function gE(r,e){r.on("input",({sessionId:t,data:n})=>{if(!t)return;let s=e.get(t);if(s){if(s.daemon&&Pr())return kh(t,n);s.pty&&s.pty.write(Buffer.isBuffer(n)?n.toString("utf-8"):n)}}),r.on("resize",({sessionId:t,cols:n,rows:s})=>{if(!t)return;let i=e.get(t);if(i){if(i.daemon&&Pr())return yS(t,n,s);if(i.pty)try{i.pty.resize(n,s)}catch(o){console.log(`Resize failed for ${t}: ${o.message}`)}}}),r.on("upload-file",({sessionId:t,filename:n,size:s,content:i})=>{if(!t)return;let o=e.get(t);if(o)try{let a=n.replace(/[^a-zA-Z0-9._-]/g,"_"),c=mE.default.join(Jl,`${Date.now()}_${a}`);hE.default.writeFileSync(c,Buffer.from(i,"base64")),console.log(`\u{1F4CE} File uploaded: ${c} (${s} bytes)`),o.daemon&&Pr()?kh(t,c):o.pty&&o.pty.write(c)}catch(a){console.error("File upload error:",a),r.emit("output",{sessionId:t,data:Buffer.from(`\r
115
115
  Error uploading file: ${a.message}\r
116
- `,"utf-8")})}})}var Mr=J(require("fs"),1),aa=J(require("path"),1),yu=J(CT(),1);xt();mn();var _u=aa.default.join(oe.CONFIG,"vapid.json"),bu=aa.default.join(oe.CONFIG,"push-subscriptions.json"),yz=1800*1e3,Et=[];function d3(){try{if(Mr.default.existsSync(_u))return JSON.parse(Mr.default.readFileSync(_u,"utf8"))}catch{}return null}function h3(r){let e=aa.default.dirname(_u);Mr.default.existsSync(e)||Mr.default.mkdirSync(e,{recursive:!0}),Mr.default.writeFileSync(_u,JSON.stringify(r,null,2),"utf8")}function m3(){let r=d3();if(!r){let e=yu.default.generateVAPIDKeys();r={publicKey:e.publicKey,privateKey:e.privateKey},h3(r)}return yu.default.setVapidDetails("mailto:admin@9remote.cc",r.publicKey,r.privateKey),r}function g3(){try{Mr.default.existsSync(bu)&&(Et=JSON.parse(Mr.default.readFileSync(bu,"utf8")))}catch{Et=[]}}function ca(){try{let r=aa.default.dirname(bu);Mr.default.existsSync(r)||Mr.default.mkdirSync(r,{recursive:!0}),Mr.default.writeFileSync(bu,JSON.stringify(Et,null,2),"utf8")}catch(r){ye(`Failed to save push subscriptions: ${r.message}`)}}function wi(r){return r.type==="expo"?r.token:r.endpoint}function AT(r,e){let t=wi(r),n=Et.find(i=>wi(i)===t);Et=Et.filter(i=>wi(i)!==t),Et.push({...r,socketId:e,lastConnectedAt:Date.now(),hidden:n?.hidden??!1}),ca()}function RT(r,e){for(let t of Et)t.socketId===r&&(t.hidden=!!e,e||(t.disconnectedAt=null))}function kT(){let r=Et.reduce((e,t)=>(e?.lastConnectedAt??0)>=(t?.lastConnectedAt??0)?e:t,null);return r?r.disconnectedAt!=null||!!r.hidden:!1}function OT(r){Et=Et.filter(e=>wi(e)!==r),ca()}function MT(r){for(let e of Et)e.socketId===r&&(e.disconnectedAt=Date.now());ca()}function PT(r,e){for(let t of Et)wi(t)===e&&(t.socketId=r,t.disconnectedAt=null,t.lastConnectedAt=Date.now());ca()}async function v3(r,e,t){let n={to:r.token,sound:"default",title:t.type==="stop"?`${e} \u2705`:`${e} \u{1F514}`,body:t.type==="stop"?`${e} completed the task`:`${e} needs your input`,data:{url:`/workspace?t=${t.sessionId}`,sessionId:t.sessionId,type:t.type}},s=await(await fetch("https://exp.host/--/api/v2/push/send",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)})).json();if(s.data?.status==="error")throw new Error(s.data.message);ye(`Expo push sent to ${r.token.slice(0,30)}...`)}async function IT(r){let e=Hv[r.tool]||"AI",t=Et.reduce((i,s)=>(i?.lastConnectedAt??0)>=(s?.lastConnectedAt??0)?i:s,null);if(!t)return;let n=wi(t);try{if(t.type==="expo")await v3(t,e,r);else{let i=JSON.stringify({title:r.type==="stop"?`${e} \u2705`:`${e} \u{1F514}`,body:r.type==="stop"?`${e} completed the task`:`${e} needs your input`,data:{url:`/workspace?t=${r.sessionId}`,sessionId:r.sessionId,type:r.type}});await yu.default.sendNotification({endpoint:t.endpoint,keys:t.keys},i),ye(`WebPush sent to ${t.endpoint.slice(0,50)}...`)}}catch(i){ye(`Push failed: ${i.statusCode||i.message}`),(i.statusCode===410||i.statusCode===404||i.message?.includes("DeviceNotRegistered"))&&(Et=Et.filter(o=>wi(o)!==n),ca())}}var x3=m3();g3();function NT(){return x3.publicKey}var Cm={};function LT(r,e){Cm[r]=e}function wu(r){delete Cm[r]}function DT(){return{...Cm}}ys();function BT(r){r.on("getNotificationState",()=>{r.emit("notificationState",DT())}),r.on("requestUpdate",()=>$n("update")),r.on("clearNotification",e=>{e&&(wu(e),r.broadcast.emit("notificationCleared",e))}),r.on("getVapidKey",e=>e(NT())),r.on("pushSubscribe",e=>{let t=e?.type==="expo"?e.token:e?.endpoint;t&&(PT(r.id,t),AT(e,r.id))}),r.on("pushUnsubscribe",e=>{e&&OT(e)}),r.on("visibilityChange",e=>RT(r.id,e)),r.on("getAutoStartStatus",e=>{if(!xn())return e({success:!1,error:"Not in Codespaces"});let t=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();e({success:!0,...JS(t)})}),r.on("setAutoStart",({enabled:e},t)=>{if(!xn())return t({success:!1,error:"Not in Codespaces"});let n=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();t(QS(n,e))})}var Vr=J(require("os"),1),mt=J(require("fs"),1),Ht=J(require("path"),1);xt();var FT=`http://localhost:${Ga}/api/notify`,$T="nineRemoteNotify",y3=Ht.default.join(oe.STATE,"claudeEnvBackup.json"),bn={claude:()=>Ht.default.join(Vr.default.homedir(),".claude","settings.json"),codex:()=>Ht.default.join(Vr.default.homedir(),".codex","config.toml"),gemini:()=>Ht.default.join(Vr.default.homedir(),".gemini","settings.json"),opencode:()=>Ht.default.join(Vr.default.homedir(),".config","opencode","plugin",`${$T}.js`)},_3={claude:()=>Ht.default.join(Vr.default.homedir(),".claude"),codex:()=>Ht.default.join(Vr.default.homedir(),".codex"),gemini:()=>Ht.default.join(Vr.default.homedir(),".gemini"),opencode:()=>[Ht.default.join(Vr.default.homedir(),".config","opencode"),Ht.default.join(Vr.default.homedir(),".opencode")]},la=(r,e)=>`command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "${FT}?type=${r}&sessionId=$NINE_REMOTE_SESSION_ID&tool=${e}" > /dev/null 2>&1 & true`;function ua(r){try{if(mt.default.existsSync(r))return JSON.parse(mt.default.readFileSync(r,"utf8"))}catch{}return{}}function Su(r,e){let t=Ht.default.dirname(r);mt.default.existsSync(t)||mt.default.mkdirSync(t,{recursive:!0}),mt.default.writeFileSync(r,JSON.stringify(e,null,2),"utf8")}function HT(r){let e={},t=r.env||{};for(let n of Object.keys(uo))e[n]=t[n]??null;Su(y3,e),r.env={...t,...uo}}function b3(){let r=bn.claude(),e=ua(r),t=la("stop","claude"),n=la("notification","claude");return e.hooks={...e.hooks||{},Stop:[{matcher:"",hooks:[{type:"command",command:t}]}],Notification:[{matcher:"permission_prompt|idle_prompt",hooks:[{type:"command",command:n}]}]},HT(e),Su(r,e),{success:!0}}var w3=/# 9Remote notification\nnotify\s*=.*\n?/g,S3="# 9Remote-saved: ";function E3(r){let e=r.search(/^\[/m);return e===-1?[r,""]:[r.slice(0,e),r.slice(e)]}var jT=/^notify\s*=\s*(\[[^\n]*\])\s*$/m;function T3(){let r=bn.codex(),e=Ht.default.dirname(r);mt.default.existsSync(e)||mt.default.mkdirSync(e,{recursive:!0});let t=mt.default.existsSync(r)?mt.default.readFileSync(r,"utf8"):"";t=t.replace(w3,"");let[n,i]=E3(t),s="",o=n.match(jT);if(o){try{let u=JSON.parse(o[1]);Array.isArray(u)&&u.length&&(s=` ; exec ${u.map(p=>`'${String(p).replace(/'/g,"'\\''")}'`).join(" ")} "$@"`)}catch{}n=n.replace(jT,`${S3}$&`)}let a=`${la("stop","codex")}${s}`,c=`# 9Remote notification
116
+ `,"utf-8")})}})}var Lr=J(require("fs"),1),pa=J(require("path"),1),Su=J(IT(),1);_t();xn();var Eu=pa.default.join(oe.CONFIG,"vapid.json"),Tu=pa.default.join(oe.CONFIG,"push-subscriptions.json"),sV=1800*1e3,Ct=[];function kH(){try{if(Lr.default.existsSync(Eu))return JSON.parse(Lr.default.readFileSync(Eu,"utf8"))}catch{}return null}function OH(r){let e=pa.default.dirname(Eu);Lr.default.existsSync(e)||Lr.default.mkdirSync(e,{recursive:!0}),Lr.default.writeFileSync(Eu,JSON.stringify(r,null,2),"utf8")}function MH(){let r=kH();if(!r){let e=Su.default.generateVAPIDKeys();r={publicKey:e.publicKey,privateKey:e.privateKey},OH(r)}return Su.default.setVapidDetails("mailto:admin@9remote.cc",r.publicKey,r.privateKey),r}function PH(){try{Lr.default.existsSync(Tu)&&(Ct=JSON.parse(Lr.default.readFileSync(Tu,"utf8")))}catch{Ct=[]}}function fa(){try{let r=pa.default.dirname(Tu);Lr.default.existsSync(r)||Lr.default.mkdirSync(r,{recursive:!0}),Lr.default.writeFileSync(Tu,JSON.stringify(Ct,null,2),"utf8")}catch(r){_e(`Failed to save push subscriptions: ${r.message}`)}}function Ts(r){return r.type==="expo"?r.token:r.endpoint}function NT(r,e){let t=Ts(r),n=Ct.find(s=>Ts(s)===t);Ct=Ct.filter(s=>Ts(s)!==t),Ct.push({...r,socketId:e,lastConnectedAt:Date.now(),hidden:n?.hidden??!1}),fa()}function LT(r,e){for(let t of Ct)t.socketId===r&&(t.hidden=!!e,e||(t.disconnectedAt=null))}function DT(){let r=Ct.reduce((e,t)=>(e?.lastConnectedAt??0)>=(t?.lastConnectedAt??0)?e:t,null);return r?r.disconnectedAt!=null||!!r.hidden:!1}function BT(r){Ct=Ct.filter(e=>Ts(e)!==r),fa()}function jT(r){for(let e of Ct)e.socketId===r&&(e.disconnectedAt=Date.now());fa()}function FT(r,e){for(let t of Ct)Ts(t)===e&&(t.socketId=r,t.disconnectedAt=null,t.lastConnectedAt=Date.now());fa()}async function IH(r,e,t){let n={to:r.token,sound:"default",title:t.type==="stop"?`${e} \u2705`:`${e} \u{1F514}`,body:t.type==="stop"?`${e} completed the task`:`${e} needs your input`,data:{url:`/workspace?t=${t.sessionId}`,sessionId:t.sessionId,type:t.type}},i=await(await fetch("https://exp.host/--/api/v2/push/send",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)})).json();if(i.data?.status==="error")throw new Error(i.data.message);_e(`Expo push sent to ${r.token.slice(0,30)}...`)}async function HT(r){let e=Kv[r.tool]||"AI",t=Ct.reduce((s,i)=>(s?.lastConnectedAt??0)>=(i?.lastConnectedAt??0)?s:i,null);if(!t)return;let n=Ts(t);try{if(t.type==="expo")await IH(t,e,r);else{let s=JSON.stringify({title:r.type==="stop"?`${e} \u2705`:`${e} \u{1F514}`,body:r.type==="stop"?`${e} completed the task`:`${e} needs your input`,data:{url:`/workspace?t=${r.sessionId}`,sessionId:r.sessionId,type:r.type}});await Su.default.sendNotification({endpoint:t.endpoint,keys:t.keys},s),_e(`WebPush sent to ${t.endpoint.slice(0,50)}...`)}}catch(s){_e(`Push failed: ${s.statusCode||s.message}`),(s.statusCode===410||s.statusCode===404||s.message?.includes("DeviceNotRegistered"))&&(Ct=Ct.filter(o=>Ts(o)!==n),fa())}}var NH=MH();PH();function $T(){return NH.publicKey}var Mm={};function UT(r,e){Mm[r]=e}function Cu(r){delete Mm[r]}function qT(){return{...Mm}}Si();function WT(r){r.on("getNotificationState",()=>{r.emit("notificationState",qT())}),r.on("requestUpdate",()=>qn("update")),r.on("clearNotification",e=>{e&&(Cu(e),r.broadcast.emit("notificationCleared",e))}),r.on("getVapidKey",e=>e($T())),r.on("pushSubscribe",e=>{let t=e?.type==="expo"?e.token:e?.endpoint;t&&(FT(r.id,t),NT(e,r.id))}),r.on("pushUnsubscribe",e=>{e&&BT(e)}),r.on("visibilityChange",e=>LT(r.id,e)),r.on("getAutoStartStatus",e=>{if(!wn())return e({success:!1,error:"Not in Codespaces"});let t=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();e({success:!0,...sE(t)})}),r.on("setAutoStart",({enabled:e},t)=>{if(!wn())return t({success:!1,error:"Not in Codespaces"});let n=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();t(iE(n,e))})}var XT=J(require("os"),1),ae=J(require("fs"),1),Pe=J(require("path"),1);_t();var Im=`http://localhost:${Ya}/api/notify`,JT="nineRemoteNotify",LH=Pe.default.join(oe.STATE,"claudeEnvBackup.json"),Nt=(...r)=>Pe.default.join(XT.default.homedir(),...r),Cs=(r,...e)=>{let t=process.env[r];return t&&t.trim()?t.trim():Nt(...e)},Ae={claude:()=>Nt(".claude","settings.json"),codex:()=>Nt(".codex","config.toml"),gemini:()=>Nt(".gemini","settings.json"),opencode:()=>Nt(".config","opencode","plugin",`${JT}.js`),grok:()=>Pe.default.join(Cs("GROK_HOME",".grok"),"hooks","9remote.json"),cursor:()=>Nt(".cursor","hooks.json"),antigravity:()=>Nt(".gemini","config","hooks.json"),kiro:()=>Pe.default.join(Cs("KIRO_HOME",".kiro"),"agents","9remote.json"),copilot:()=>Pe.default.join(Cs("COPILOT_HOME",".copilot"),"config.json"),codebuddy:()=>Pe.default.join(Cs("CODEBUDDY_CONFIG_DIR",".codebuddy"),"settings.json"),factory:()=>Nt(".factory","settings.json"),qoder:()=>Pe.default.join(Cs("QODER_CONFIG_DIR",".qoder"),"settings.json"),rovodev:()=>Nt(".rovodev","config.yml"),hermes:()=>Pe.default.join(Cs("HERMES_HOME",".hermes"),"config.yaml"),amp:()=>Nt(".config","amp","plugins","9remote.ts"),pi:()=>Pe.default.join(Cs("PI_CODING_AGENT_DIR",".pi","agent"),"extensions","9remote.ts")},DH={claude:"claude",codex:"codex",gemini:"gemini",opencode:"opencode",grok:"grok",cursor:"cursor-agent",antigravity:"agy",kiro:"kiro-cli",copilot:"copilot",codebuddy:"codebuddy",factory:"droid",qoder:"qodercli",rovodev:"acli",hermes:"hermes",amp:"amp",pi:"pi"},Lt=(r,e)=>`command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "${Im}?type=${r}&sessionId=$NINE_REMOTE_SESSION_ID&tool=${e}" > /dev/null 2>&1 & true`,BH={claude:()=>Nt(".claude"),codex:()=>Nt(".codex"),gemini:()=>Nt(".gemini"),opencode:()=>[Nt(".config","opencode"),Nt(".opencode")]},Pm=r=>Math.ceil(r/1e3),da=5e3,Au=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),QT=r=>`"${r.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`;function jH(r,e,t,n){let s=ae.default.existsSync(r)?ae.default.readFileSync(r,"utf8"):"";s=s.replace(new RegExp(`${Au(e)}[\\s\\S]*?${Au(t)}\\n?`,"g"),""),s.length&&!s.endsWith(`
117
+ `)&&(s+=`
118
+ `),s+=`${n}
119
+ `;let i=Pe.default.dirname(r);ae.default.existsSync(i)||ae.default.mkdirSync(i,{recursive:!0}),ae.default.writeFileSync(r,s,"utf8")}function _r(r){try{if(ae.default.existsSync(r))return JSON.parse(ae.default.readFileSync(r,"utf8"))}catch{}return{}}function Jr(r,e){let t=Pe.default.dirname(r);ae.default.existsSync(t)||ae.default.mkdirSync(t,{recursive:!0}),ae.default.writeFileSync(r,JSON.stringify(e,null,2),"utf8")}function ZT(r){let e={},t=r.env||{};for(let n of Object.keys(mo))e[n]=t[n]??null;Jr(LH,e),r.env={...t,...mo}}function FH(){let r=Ae.claude(),e=_r(r),t=Lt("stop","claude"),n=Lt("notification","claude");return e.hooks={...e.hooks||{},Stop:[{matcher:"",hooks:[{type:"command",command:t}]}],Notification:[{matcher:"permission_prompt",hooks:[{type:"command",command:n}]}]},ZT(e),Jr(r,e),{success:!0}}var HH=/# 9Remote notification\nnotify\s*=.*\n?/g,$H="# 9Remote-saved: ";function UH(r){let e=r.search(/^\[/m);return e===-1?[r,""]:[r.slice(0,e),r.slice(e)]}var GT=/^notify\s*=\s*(\[[^\n]*\])\s*$/m;function qH(){let r=Ae.codex(),e=Pe.default.dirname(r);ae.default.existsSync(e)||ae.default.mkdirSync(e,{recursive:!0});let t=ae.default.existsSync(r)?ae.default.readFileSync(r,"utf8"):"";t=t.replace(HH,"");let[n,s]=UH(t),i="",o=n.match(GT);if(o){try{let l=JSON.parse(o[1]);Array.isArray(l)&&l.length&&(i=` ; exec ${l.map(p=>`'${String(p).replace(/'/g,"'\\''")}'`).join(" ")} "$@"`)}catch{}n=n.replace(GT,`${$H}$&`)}let a=`${Lt("stop","codex")}${i}`,c=`# 9Remote notification
117
120
  notify = ["bash", "-c", ${JSON.stringify(a)}, "9remote"]
118
121
  `;return n.length&&!n.endsWith(`
119
122
  `)&&(n+=`
120
- `),mt.default.writeFileSync(r,n+c+i,"utf8"),{success:!0}}function C3(){let r=bn.gemini(),e=ua(r),t=la("stop","gemini"),n=la("notification","gemini");return e.hooks={...e.hooks||{},enabled:!0,AfterAgent:[{matcher:"",hooks:[{name:"9remote-stop",type:"command",command:t,description:"9Remote stop notify"}]}],Notification:[{matcher:"",hooks:[{name:"9remote-notification",type:"command",command:n,description:"9Remote input-needed notify"}]}]},e.tools={...e.tools||{},enableHooks:!0},Su(r,e),{success:!0}}function A3(){return`// 9Remote OpenCode notify plugin (auto-generated)
121
- const base = ${JSON.stringify(FT)};
123
+ `),ae.default.writeFileSync(r,n+c+s,"utf8"),{success:!0}}function WH(){let r=Ae.gemini(),e=_r(r),t=Lt("stop","gemini"),n=Lt("notification","gemini");return e.hooks={...e.hooks||{},enabled:!0,AfterAgent:[{matcher:"",hooks:[{name:"9remote-stop",type:"command",command:t,description:"9Remote stop notify"}]}],Notification:[{matcher:"",hooks:[{name:"9remote-notification",type:"command",command:n,description:"9Remote input-needed notify"}]}]},e.tools={...e.tools||{},enableHooks:!0},Jr(r,e),{success:!0}}function GH(){return`// 9Remote OpenCode notify plugin (auto-generated)
124
+ const base = ${JSON.stringify(Im)};
122
125
  const post = (type) => {
123
126
  const sid = process.env.NINE_REMOTE_SESSION_ID || "";
124
127
  if (!sid) return;
125
128
  const url = base + "?type=" + type + "&sessionId=" + encodeURIComponent(sid) + "&tool=opencode";
126
129
  try { fetch(url, { signal: AbortSignal.timeout(2000) }).catch(() => {}); } catch {}
127
130
  };
128
- export const ${$T} = async () => ({
131
+ export const ${JT} = async () => ({
129
132
  event: async ({ event }) => {
130
133
  if (event.type === "session.idle") post("stop");
131
134
  else if (event.type === "permission.asked") post("notification");
132
135
  },
133
136
  });
134
- `}function R3(){let r=bn.opencode(),e=Ht.default.dirname(r);return mt.default.existsSync(e)||mt.default.mkdirSync(e,{recursive:!0}),mt.default.writeFileSync(r,A3(),"utf8"),{success:!0}}function k3(r){switch(r){case"claude":{let e=ua(bn.claude());return!!(e.hooks?.Stop||e.hooks?.Notification)}case"codex":{let e=bn.codex();return mt.default.existsSync(e)&&mt.default.readFileSync(e,"utf8").includes("# 9Remote notification")}case"gemini":{let e=ua(bn.gemini());return!!(e.hooks?.AfterAgent||e.hooks?.Notification)}case"opencode":return mt.default.existsSync(bn.opencode());default:return!1}}function O3(r){let e=_3[r]?.();return e?(Array.isArray(e)?e:[e]).some(n=>mt.default.existsSync(n)):!1}var M3={claude:b3,codex:T3,gemini:C3,opencode:R3};var P3=$v;function I3(r){return M3[r]?.()||{success:!1,error:"Unknown tool"}}function UT(){let r={};for(let e of P3)if(!(!O3(e)||k3(e)))try{r[e]=I3(e).success}catch{r[e]=!1}return r}function qT(){let r=bn.claude(),e=ua(r);if(!e.hooks?.Stop&&!e.hooks?.Notification)return;let t=e.env||{};Object.keys(uo).some(i=>t[i]!==uo[i])&&(HT(e),Su(r,e))}hi();var Wz=(0,GT.dirname)((0,zT.fileURLToPath)(__importMetaUrl)),Gz=ao.rgb(230,138,110),Am="daemon",N3="2.0.68",Vn=new Map,VT=new Map,KT={};async function WT(){let r=await Dl(),e=new Map(r.map(n=>[n.id,n])),t=Hh();for(let n of r)if(!t[n.id])try{await mi(n.id)}catch{}Vn.clear();for(let[n,i]of Object.entries(t)){let s=e.get(n);Vn.set(n,{daemon:!0,name:i.name,createdAt:i.createdAt,shellId:i.shellId,cwd:s?.cwd||i.cwd,needsRespawn:!s})}yn(Vn)}async function YT(){let r=rE();for(let n of r.groups)VT.set(n.id,n);Object.assign(KT,r.sessionGroups);try{qT()}catch{}try{UT()}catch{}if(Am==="daemon")if(!await lS())console.error("\u274C Failed to connect to PTY daemon, falling back to buffer mode");else{await WT(),Nl("connected",()=>{WT().catch(()=>{})});return}console.log("\u{1F4E6} Buffer persistence mode - scrollback enabled");let e=tE(),t=Hh();for(let n of e){let i=t[n]||{};Vn.set(n,{pty:null,name:i.name||`Terminal ${Vn.size+1}`,createdAt:i.createdAt||Date.now(),buffer:[],needsRestore:!0}),console.log(`\u{1F504} Found saved session: ${n}`)}e.length>0&&console.log(`\u2705 Found ${e.length} saved session(s)`)}function Ws(r,e){Am==="daemon"&&(Nl("output",({sessionId:i,data:s})=>St(r,"output",{sessionId:i,data:s})),Nl("sessionClosed",i=>{Vn.delete(i),wu(i),St(r,"sessionClosed",i),St(r,"notificationCleared",i)}));let t=()=>({version:N3,remoteAvailable:Es(),daemonMode:Am==="daemon"&&Rr(),platform:process.platform,updateAvailable:kw(),canSelfUpdate:!0,...VS()}),n=()=>{let i=t();for(let s of r.sockets.sockets.values())s.data?.approved&&s.emit("serverInfo",i)};Pw(n),Ws._buildServerInfo=t,Ws._emitServerInfo=n}function XT(){Ws._emitServerInfo?.()}var JT=null;function QT(r){JT=r}async function ZT(r,e,t){KS(),JT?.(),r.emit("serverInfo",Ws._buildServerInfo?.()),oE(r,e,Vn,VT,KT),lE(r,Vn),BT(r),Ul()&&await zS(r,t).catch(n=>{console.error("\u274C Failed to setup remote handlers:",n.message)}),r.on("disconnect",()=>{MT(r.id),YS()})}var se=J(require("fs"),1),xr=J(require("path"),1),Xr=J(require("os"),1),Qs=require("child_process"),OR=J(bR(),1);var Dg=["node_modules",".git","dist","build",".next","coverage","__pycache__",".cache",".vscode",".idea",".turbo",".vercel",".output","out",".nuxt",".svelte-kit","target","vendor",".gradle",".pytest_cache",".mypy_cache",".tox",".venv","venv","env",".DS_Store",".parcel-cache",".rollup.cache"],zu=[".png",".jpg",".jpeg",".gif",".webp",".ico",".svg",".bmp",".pdf",".zip",".tar",".gz",".rar",".7z",".exe",".dll",".so",".dylib",".mp3",".mp4",".wav",".avi",".mov",".webm",".woff",".woff2",".ttf",".eot",".otf",".sqlite",".db"];var wR=[".ssh",".aws",".gnupg",".kube",".docker",".cargo",".npmrc",".netrc",".pypirc",".config/gh",".config/gcloud"],SR=["/etc/shadow","/etc/sudoers","/etc/ssh","/root","/private/etc/sudoers"];var ER=J(require("fs"),1),Ca=J(require("path"),1),TR=J(require("os"),1);var CR=TR.default.homedir();function Lq(r){if(!r)return null;let e=r.startsWith("~")?r.replace(/^~/,CR):r;try{return ER.default.realpathSync(e)}catch{return Ca.default.resolve(e)}}function Tn(r){let e=Lq(r);if(!e)return!1;for(let t of SR)if(e===t||e.startsWith(t+Ca.default.sep))return!0;for(let t of wR){let n=Ca.default.join(CR,t);if(e===n||e.startsWith(n+Ca.default.sep))return!0}return!1}function Vu(r){return Dg.includes(r)}function Zs(r){return zu.includes(xr.default.extname(r).toLowerCase())}function Bq(r,e){return r.isDirectory()?"folder":Zs(e)?"binary":"file"}function Aa(r){return r<1024?`${r}B`:r<1024*1024?`${(r/1024).toFixed(1)}KB`:`${(r/(1024*1024)).toFixed(1)}MB`}function MR(r,e,t,n=50){if(!(t.length>=n))try{for(let i of se.default.readdirSync(r)){if(t.length>=n)return;if(i.startsWith(".")||Vu(i))continue;let s=xr.default.join(r,i);try{let o=se.default.statSync(s);o.isDirectory()?MR(s,e,t,n):i.toLowerCase().includes(e.toLowerCase())&&t.push({name:i,path:s,type:Zs(i)?"binary":"file",size:o.size,sizeFormatted:Aa(o.size)})}catch{}}}catch{}}function kR(r){if(!r)return null;let e=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"::ANY::").replace(/\*/g,"[^/]*").replace(/::ANY::/g,".*").replace(/\?/g,".");return new RegExp(`^${e}$`)}function PR(r,e,t,n,i,s){if(s.length>=200)return;let o;try{o=se.default.readdirSync(r,{withFileTypes:!0})}catch{return}for(let a of o){if(s.length>=200)return;if(Vu(a.name))continue;let c=xr.default.join(r,a.name),u=xr.default.relative(e,c);if(a.isDirectory()){PR(c,e,t,n,i,s);continue}if(a.isFile()&&!Zs(a.name)&&!(i&&i.test(u))&&!(n&&!n.test(u)))try{if(se.default.statSync(c).size>512e3)continue;let m=se.default.readFileSync(c,"utf-8").split(`
135
- `),y=[];for(let _=0;_<m.length&&y.length<10;_++){let S=m[_],A=t(S);for(let M of A){if(y.length>=10)break;y.push({line:_+1,column:M.column+1,lineText:S,matchLength:M.length})}}y.length&&s.push({path:c,matches:y})}catch{}}}function IR(r,e,t){let n;try{n=se.default.readdirSync(r,{withFileTypes:!0})}catch{return[]}let i=[];for(let s of n){if(!t&&s.name.startsWith(".")&&s.name!==".env"&&s.name!==".env.example"||Vu(s.name))continue;let o=xr.default.join(r,s.name);if(s.isDirectory()){let a={name:s.name,path:o,type:"folder"};e>0&&(a.children=IR(o,e-1,t)),i.push(a)}else s.isFile()&&i.push({name:s.name,path:o,type:Zs(s.name)?"binary":"file"})}return i.sort((s,o)=>s.type==="folder"&&o.type!=="folder"?-1:s.type!=="folder"&&o.type==="folder"?1:s.name.localeCompare(o.name)),i}function jq(){if(process.platform!=="win32")return[];try{return(0,Qs.execSync)("wmic logicaldisk get name",{encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).split(/\r?\n/).map(e=>e.trim()).filter(e=>/^[A-Z]:$/.test(e)).map(e=>({letter:e[0],path:e+"\\"}))}catch{return"CDEFGHIJ".split("").map(r=>`${r}:\\`).filter(r=>se.default.existsSync(r)).map(r=>({letter:r[0],path:r}))}}function NR(r){r.on("getSystemInfo",t=>{let n=process.platform;t({success:!0,platform:n,isWindows:n==="win32",drives:n==="win32"?jq():[],homedir:Xr.default.homedir()})}),r.on("getFiles",({dirPath:t,showHidden:n},i)=>{try{let s=t||Xr.default.homedir(),o=s.startsWith("~")?s.replace("~",Xr.default.homedir()):s;if(Tn(o))return i({success:!1,error:"Access denied"});if(!se.default.existsSync(o))return i({success:!1,error:"Directory not found"});let a=[];for(let c of se.default.readdirSync(o))if(!(!n&&c.startsWith(".")&&c!==".env"&&c!==".env.example")&&!Vu(c))try{let u=xr.default.join(o,c),p=se.default.statSync(u);a.push({name:c,path:u,type:Bq(p,c),size:p.isFile()?p.size:null,sizeFormatted:p.isFile()?Aa(p.size):null,modified:p.mtime.getTime()})}catch{}a.sort((c,u)=>c.type==="folder"&&u.type!=="folder"?-1:c.type!=="folder"&&u.type==="folder"?1:c.name.localeCompare(u.name)),i({success:!0,files:a,currentPath:o,parentPath:xr.default.dirname(o)})}catch(s){i({success:!1,error:s.message})}}),r.on("searchFiles",({workspace:t,query:n},i)=>{try{if(!n||n.length<2)return i({success:!0,files:[]});let s=(t||Xr.default.homedir()).replace(/^~/,Xr.default.homedir());if(!se.default.existsSync(s))return i({success:!1,error:"Workspace not found"});let o=[];MR(s,n,o,50),o.sort((a,c)=>{let u=a.name.toLowerCase()===n.toLowerCase(),p=c.name.toLowerCase()===n.toLowerCase();return u&&!p?-1:!u&&p?1:a.path.length-c.path.length}),i({success:!0,files:o})}catch(s){i({success:!1,error:s.message})}}),r.on("readFile",({filePath:t},n)=>{try{if(Tn(t))return n({success:!1,error:"Access denied"});if(!se.default.existsSync(t))return n({success:!1,error:"File not found"});let i=se.default.statSync(t);if(i.size>512e3)return n({success:!1,error:`File too large (${Aa(i.size)}). Max ${Aa(512e3)}`});if(Zs(t))return n({success:!1,error:"Cannot open binary file"});n({success:!0,content:se.default.readFileSync(t,"utf-8")})}catch(i){n({success:!1,error:i.message})}}),r.on("readImage",({filePath:t},n)=>{try{if(Tn(t))return n({success:!1,error:"Access denied"});if(!se.default.existsSync(t))return n({success:!1,error:"File not found"});let i=se.default.statSync(t),s=10*1024*1024;if(i.size>s)return n({success:!1,error:`Image too large (${Aa(i.size)})`});let o=xr.default.extname(t).toLowerCase().slice(1),c={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",ico:"image/x-icon",bmp:"image/bmp"}[o]||"application/octet-stream",u=se.default.readFileSync(t),p=`data:${c};base64,${u.toString("base64")}`;n({success:!0,dataUrl:p,size:i.size,mime:c})}catch(i){n({success:!1,error:i.message})}}),r.on("writeFile",({filePath:t,content:n},i)=>{try{if(Tn(t))return i({success:!1,error:"Access denied"});se.default.writeFileSync(t,n,"utf-8"),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("createItem",({itemPath:t,type:n},i)=>{try{if(Tn(t))return i({success:!1,error:"Access denied"});if(se.default.existsSync(t))return i({success:!1,error:"Item already exists"});n==="folder"?se.default.mkdirSync(t,{recursive:!0}):se.default.writeFileSync(t,"","utf-8"),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("deleteItem",({itemPath:t},n)=>{try{if(Tn(t))return n({success:!1,error:"Access denied"});if(!se.default.existsSync(t))return n({success:!1,error:"Item not found"});se.default.statSync(t).isDirectory()?se.default.rmSync(t,{recursive:!0}):se.default.unlinkSync(t),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("renameItem",({oldPath:t,newPath:n},i)=>{try{if(Tn(t)||Tn(n))return i({success:!1,error:"Access denied"});if(!se.default.existsSync(t))return i({success:!1,error:"Item not found"});if(se.default.existsSync(n))return i({success:!1,error:"Target already exists"});se.default.renameSync(t,n),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("searchInFiles",({workspace:t,query:n,caseSensitive:i,regex:s,includeGlob:o,excludeGlob:a},c)=>{try{if(!n)return c({success:!0,results:[]});let u=(t||Xr.default.homedir()).replace(/^~/,Xr.default.homedir());if(!se.default.existsSync(u))return c({success:!1,error:"Workspace not found"});let p;if(s){let _;try{_=new RegExp(n,i?"g":"gi")}catch(S){return c({success:!1,error:`Invalid regex: ${S.message}`})}p=S=>{let A=[],M;for(_.lastIndex=0;(M=_.exec(S))!==null;)A.push({column:M.index,length:M[0].length}),M.index===_.lastIndex&&_.lastIndex++;return A}}else{let _=i?n:n.toLowerCase();p=S=>{let A=i?S:S.toLowerCase(),M=[],L=0;for(;(L=A.indexOf(_,L))!==-1;)M.push({column:L,length:_.length}),L+=_.length||1;return M}}let f=kR(o),m=kR(a),y=[];PR(u,u,p,f,m,y),c({success:!0,results:y})}catch(u){c({success:!1,error:u.message})}}),r.on("replaceInFiles",({workspace:t,query:n,replacement:i,caseSensitive:s,regex:o,files:a},c)=>{try{if(!n||!Array.isArray(a)||!a.length)return c({success:!0,replacedCount:0,fileCount:0});let u;if(o){let m;try{m=new RegExp(n,s?"g":"gi")}catch(y){return c({success:!1,error:`Invalid regex: ${y.message}`})}u=y=>{let _=0;return{next:y.replace(m,A=>(_++,i)),count:_}}}else u=m=>{let y=0,_=s?"g":"gi",S=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),A=new RegExp(S,_);return{next:m.replace(A,()=>(y++,i)),count:y}};let p=0,f=0;for(let m of a)try{if(!se.default.existsSync(m)||Zs(m))continue;let y=se.default.statSync(m);if(!y.isFile()||y.size>512e3)continue;let _=se.default.readFileSync(m,"utf-8"),{next:S,count:A}=u(_);A>0&&(se.default.writeFileSync(m,S,"utf-8"),p+=A,f++)}catch{}c({success:!0,replacedCount:p,fileCount:f})}catch(u){c({success:!1,error:u.message})}});let e=new Map;r.on("watchDir",({dirPath:t},n)=>{try{if(!t||!se.default.existsSync(t))return n({success:!1,error:"Directory not found"});let i=e.get(t);if(i)return i.count++,n({success:!0});let s=OR.default.watch(t,{depth:0,ignoreInitial:!0,persistent:!0,ignored:a=>Dg.includes(xr.default.basename(a))}),o=a=>c=>r.emit("fileChange",{type:a,path:c});s.on("add",o("add")).on("change",o("change")).on("unlink",o("unlink")).on("addDir",o("addDir")).on("unlinkDir",o("unlinkDir")),e.set(t,{w:s,count:1}),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("unwatchDir",({dirPath:t},n)=>{try{let i=e.get(t);i&&--i.count<=0&&(i.w.close(),e.delete(t)),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.once("disconnect",()=>{for(let{w:t}of e.values())try{t.close()}catch{}e.clear()}),r.on("revealInOS",({filePath:t},n)=>{try{if(!t)return n({success:!1,error:"No path"});let i=process.platform,s,o;i==="darwin"?(s="open",o=["-R",t]):i==="win32"?(s="explorer",o=[`/select,${t}`]):(s="xdg-open",o=[xr.default.dirname(t)]);let a=(0,Qs.spawn)(s,o,{detached:!0,stdio:"ignore",windowsHide:!0});a.on("error",c=>n({success:!1,error:c.message})),a.unref(),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("openInTerminal",({dirPath:t},n)=>{try{if(!t||!se.default.existsSync(t))return n({success:!1,error:"Directory not found"});let i=process.platform,s,o,a={detached:!0,stdio:"ignore",windowsHide:!0};i==="darwin"?(s="open",o=["-a","Terminal",t]):i==="win32"?(s="cmd",o=["/C","start","cmd","/K",`cd /d "${t}"`],a.shell=!1):(s="gnome-terminal",o=[`--working-directory=${t}`]);let c=(0,Qs.spawn)(s,o,a);c.on("error",()=>{if(i==="linux"){let u=(0,Qs.spawn)("xterm",["-e",`cd "${t}" && bash`],a);u.on("error",p=>n({success:!1,error:p.message})),u.unref()}else n({success:!1,error:"Failed to open terminal"})}),c.unref(),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("getFileTree",({dirPath:t,depth:n,showHidden:i},s)=>{try{let o=(t||Xr.default.homedir()).replace(/^~/,Xr.default.homedir());if(!se.default.existsSync(o))return s({success:!1,error:"Directory not found"});let c=IR(o,typeof n=="number"?n:3,!!i);s({success:!0,tree:{name:xr.default.basename(o)||o,path:o,type:"folder",children:c}})}catch(o){s({success:!1,error:o.message})}})}var Wt=J(require("fs"),1),Ai=J(require("path"),1),yr=require("child_process");function Ci(r,e){return new Promise(t=>{let n=(0,yr.spawn)("git",r,{cwd:e,windowsHide:!0}),i="",s="";n.stdout.on("data",o=>{i+=o.toString()}),n.stderr.on("data",o=>{s+=o.toString()}),n.on("error",o=>t({code:-1,stdout:i,stderr:o.message})),n.on("close",o=>t({code:o,stdout:i,stderr:s}))})}function LR(r){return zu.includes(Ai.default.extname(r).toLowerCase())}function DR(r){r.on("gitStatus",({repoPath:e},t)=>{try{let n=(0,yr.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),i={};try{(0,yr.execSync)("git diff HEAD --numstat",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).trim().split(`
136
- `).filter(Boolean).forEach(a=>{let c=a.split(" ");c.length>=3&&(i[c[2]]={added:c[0]==="-"?0:parseInt(c[0],10)||0,deleted:c[1]==="-"?0:parseInt(c[1],10)||0})})}catch{}let s=[];for(let o of n.trim().split(`
137
- `).filter(Boolean)){let a=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!a)continue;let c=a[1],u=a[2];if(!u)continue;let p;c.includes("?")?p="?":c.includes("A")?p="A":c.includes("D")?p="D":c.includes("M")?p="M":c.includes("R")?p="R":p=c.trim()[0]||"?";let f=i[u]||{added:0,deleted:0};if(p==="?")try{let m=Ai.default.join(e,u);if(Wt.default.existsSync(m)&&!LR(u)){let y=Wt.default.readFileSync(m,"utf-8");f.added=y.split(`
138
- `).length,f.deleted=0}}catch{}s.push({status:p,path:u,added:f.added,deleted:f.deleted})}t({success:!0,files:s})}catch{t({success:!1,error:"Not a git repository or git not available"})}}),r.on("gitChangedCount",({repoPath:e},t)=>{try{let n=(0,yr.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),i=n.trim()?n.trim().split(`
139
- `).length:0;t({success:!0,count:i})}catch{t({success:!1,error:"Not a git repository or git not available"})}}),r.on("gitFileStatus",({repoPath:e,filePath:t},n)=>{try{let i=Ai.default.relative(e,t),o=(0,yr.execSync)(`git status --porcelain -- "${i}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).trim();if(!o)return n({success:!0,status:null});let a=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!a)return n({success:!0,status:null});let c=a[1],u;c.includes("?")?u="?":c.includes("A")?u="A":c.includes("D")?u="D":c.includes("M")?u="M":c.includes("R")?u="R":u=c.trim()[0]||"?",n({success:!0,status:u,file:i})}catch{n({success:!0,status:null})}}),r.on("gitDiff",({repoPath:e,file:t,status:n},i)=>{try{let s="";if(t&&n==="?"){let o=Ai.default.join(e,t);if(Wt.default.existsSync(o)){let c=Wt.default.readFileSync(o,"utf-8").split(`
140
- `);s=`diff --git a/${t} b/${t}
137
+ `}function zH(){let r=Ae.opencode(),e=Pe.default.dirname(r);return ae.default.existsSync(e)||ae.default.mkdirSync(e,{recursive:!0}),ae.default.writeFileSync(r,GH(),"utf8"),{success:!0}}function ha(r,e,t){let n=`9remote-${r}`,s=o=>({hooks:[{type:"command",command:Lt(o,r),timeout:t(da)}]}),i=o=>o?.hooks?.some(a=>typeof a.command=="string"&&a.command.includes(`&tool=${r}`));return{enable(o,a){let c=_r(o),l={...c.hooks||{}};for(let[p,f]of Object.entries(e))l[p]=[...(l[p]||[]).filter(h=>!i(h)),s(f)];return c.hooks=l,a&&a(c),Jr(o,c),{success:!0}},disable(o,a){let c=_r(o);if(c.hooks){for(let l of Object.keys(e))c.hooks[l]=(c.hooks[l]||[]).filter(p=>!i(p)),c.hooks[l].length===0&&delete c.hooks[l];Object.keys(c.hooks).length===0&&delete c.hooks}return a&&a(c),Jr(o,c),{success:!0}},isEnabled(o){let a=_r(o);return Object.keys(e).some(c=>(a.hooks?.[c]||[]).some(i))},marker:n}}var VH=ha("grok",{Stop:"stop",Notification:"notification"},Pm);function KH(){return VH.enable(Ae.grok())}var Ru={Stop:"stop",PreToolUse:"notification"},YH=ha("copilot",Ru,r=>r),XH=ha("codebuddy",Ru,r=>r),JH=ha("factory",Ru,r=>r),QH=ha("qoder",Ru,r=>r);function ZH(){return YH.enable(Ae.copilot())}function e3(){return XH.enable(Ae.codebuddy())}function t3(){return JH.enable(Ae.factory())}function r3(){return QH.enable(Ae.qoder())}function n3(){let r=Ae.cursor(),e=_r(r),t=s=>typeof s.command=="string"&&s.command.includes("&tool=cursor"),n={...e.hooks||{}};return n.stop=[...(n.stop||[]).filter(s=>!t(s)),{command:Lt("stop","cursor")}],n.beforeShellExecution=[...(n.beforeShellExecution||[]).filter(s=>!t(s)),{command:Lt("notification","cursor")}],e.hooks=n,e.version=e.version||1,Jr(r,e),{success:!0}}var s3="9remote";function i3(){let r=Ae.antigravity(),e=_r(r);return e[s3]={Stop:[{type:"command",command:Lt("stop","antigravity"),timeout:Pm(da)}],Notification:[{type:"command",command:Lt("notification","antigravity"),timeout:Pm(da)}]},Jr(r,e),{success:!0}}function o3(){let r=Ae.kiro(),e=_r(r);return e.name=e.name||"9remote",e.description=e.description||"9Remote notification hooks for Kiro CLI.",Array.isArray(e.tools)||(e.tools=["*"]),e.hooks={...e.hooks||{},stop:[{command:Lt("stop","kiro"),timeout_ms:da}],preToolUse:[{command:Lt("notification","kiro"),timeout_ms:da}]},Jr(r,e),{success:!0}}var eC=" # 9remote hooks begin",tC=" # 9remote hooks end";function a3(){let r=(e,t)=>` - name: ${e}
138
+ commands:
139
+ - command: ${QT(Lt(t,"rovodev"))}`;return[eC,r("on_complete","stop"),r("on_error","stop"),r("on_tool_permission","notification"),tC].join(`
140
+ `)}function c3(){let r=Ae.rovodev(),e=ae.default.existsSync(r)?ae.default.readFileSync(r,"utf8"):"";e=e.replace(new RegExp(`${Au(eC)}[\\s\\S]*?${Au(tC)}\\n?`,"g"),""),/^eventHooks:/m.test(e)?/^\s+events:/m.test(e)||(e=e.replace(/^eventHooks:.*$/m,n=>`${n}
141
+ events:`)):(e.length&&!e.endsWith(`
142
+ `)&&(e+=`
143
+ `),e+=`eventHooks:
144
+ events:
145
+ `),e=e.replace(/^(\s*)events:.*$/m,n=>`${n}
146
+ ${a3()}`);let t=Pe.default.dirname(r);return ae.default.existsSync(t)||ae.default.mkdirSync(t,{recursive:!0}),ae.default.writeFileSync(r,e,"utf8"),{success:!0}}var zT="# 9remote hooks begin",VT="# 9remote hooks end",l3=()=>Pe.default.join(Pe.default.dirname(Ae.hermes()),"shell-hooks-allowlist.json"),KT=[{event:"post_llm_call",type:"stop"},{event:"pre_approval_request",type:"notification"}];function u3(){let r=Ae.hermes(),e=[zT,"hooks:",...KT.map(({event:i,type:o})=>` ${i}:
147
+ - command: ${QT(Lt(o,"hermes"))}
148
+ timeout: 5`),VT].join(`
149
+ `);jH(r,zT,VT,e);let t=l3(),n=_r(t),s=(n.approvals||[]).filter(i=>!(typeof i.command=="string"&&i.command.includes("&tool=hermes")));return n.approvals=[...s,...KT.map(({event:i,type:o})=>({event:i,command:Lt(o,"hermes"),approved_at:"2020-01-01T00:00:00Z"}))],Jr(t,n),{success:!0}}function rC(r,e,t){return`// 9Remote ${r} notify plugin (auto-generated)
150
+ function post(type) {
151
+ const sid = process.env.NINE_REMOTE_SESSION_ID || "";
152
+ if (!sid) return;
153
+ const url = ${JSON.stringify(Im)} + "?type=" + type + "&sessionId=" + encodeURIComponent(sid) + "&tool=${r}";
154
+ try { fetch(url, { signal: AbortSignal.timeout(2000) }).catch(() => {}); } catch (_) {}
155
+ }
156
+ export default function (${e}) {
157
+ ${e}.on(${JSON.stringify(t)}, async () => post("stop"));
158
+ }
159
+ `}function p3(){let r=Ae.amp(),e=Pe.default.dirname(r);return ae.default.existsSync(e)||ae.default.mkdirSync(e,{recursive:!0}),ae.default.writeFileSync(r,rC("amp","amp","agent.end"),"utf8"),{success:!0}}function f3(){let r=Ae.pi(),e=Pe.default.dirname(r);return ae.default.existsSync(e)||ae.default.mkdirSync(e,{recursive:!0}),ae.default.writeFileSync(r,rC("pi","pi","agent_end"),"utf8"),{success:!0}}function YT(r,e){try{return ae.default.existsSync(r)&&ae.default.readFileSync(r,"utf8").includes(e)}catch{return!1}}function d3(r){switch(r){case"claude":{let e=_r(Ae.claude());return!!(e.hooks?.Stop||e.hooks?.Notification)}case"codex":return YT(Ae.codex(),"# 9Remote notification");case"gemini":{let e=_r(Ae.gemini());return!!(e.hooks?.AfterAgent||e.hooks?.Notification)}case"opencode":case"amp":case"pi":return ae.default.existsSync(Ae[r]());case"kiro":case"antigravity":case"cursor":case"grok":case"copilot":case"codebuddy":case"factory":case"qoder":case"rovodev":case"hermes":return YT(Ae[r](),`&tool=${r}`);default:return!1}}function h3(r){let e=(process.env.PATH||"").split(Pe.default.delimiter).filter(Boolean),t=process.platform==="win32"?(process.env.PATHEXT||".EXE;.CMD;.BAT").split(";"):[""];return e.some(n=>t.some(s=>{try{return ae.default.existsSync(Pe.default.join(n,r+s))}catch{return!1}}))}function m3(r){let e=DH[r];if(e&&h3(e))return!0;let t=BH[r]?.();return t?(Array.isArray(t)?t:[t]).some(n=>ae.default.existsSync(n)):!1}var g3={claude:FH,codex:qH,gemini:WH,opencode:zH,grok:KH,cursor:n3,antigravity:i3,kiro:o3,copilot:ZH,codebuddy:e3,factory:t3,qoder:r3,rovodev:c3,hermes:u3,amp:p3,pi:f3};var v3=Vv;function y3(r){return g3[r]?.()||{success:!1,error:"Unknown tool"}}function nC(){let r={};for(let e of v3)if(!(!m3(e)||d3(e)))try{r[e]=y3(e).success}catch{r[e]=!1}return r}function sC(){let r=Ae.claude(),e=_r(r);if(!e.hooks?.Stop&&!e.hooks?.Notification)return;let t=e.env||{};Object.keys(mo).some(s=>t[s]!==mo[s])&&(ZT(e),Jr(r,e))}vs();var kV=(0,oC.dirname)((0,aC.fileURLToPath)(__importMetaUrl)),OV=po.rgb(230,138,110),Nm="daemon",x3="2.0.70",Xn=new Map,cC=new Map,lC={},uC=[];async function iC(){let r=await Hl(),e=new Map(r.map(n=>[n.id,n])),t=zh();for(let n of r)if(!t[n.id])try{await ys(n.id)}catch{}Xn.clear();for(let[n,s]of Object.entries(t)){let i=e.get(n);Xn.set(n,{daemon:!0,name:s.name,createdAt:s.createdAt,shellId:s.shellId,cwd:i?.cwd||s.cwd,needsRespawn:!i})}Sn(Xn)}async function pC(){let r=lE();for(let n of r.groups)cC.set(n.id,n);Object.assign(lC,r.sessionGroups),uC.push(...r.sessionOrder);try{sC()}catch{}try{nC()}catch{}if(Nm==="daemon")if(!await gS())console.error("\u274C Failed to connect to PTY daemon, falling back to buffer mode");else{await iC(),jl("connected",()=>{iC().catch(()=>{})});return}console.log("\u{1F4E6} Buffer persistence mode - scrollback enabled");let e=cE(),t=zh();for(let n of e){let s=t[n]||{};Xn.set(n,{pty:null,name:s.name||`Terminal ${Xn.size+1}`,createdAt:s.createdAt||Date.now(),buffer:[],needsRestore:!0}),console.log(`\u{1F504} Found saved session: ${n}`)}e.length>0&&console.log(`\u2705 Found ${e.length} saved session(s)`)}function Ki(r,e){Nm==="daemon"&&(jl("output",({sessionId:s,data:i})=>bt(r,"output",{sessionId:s,data:i})),jl("sessionClosed",s=>{Xn.delete(s),Cu(s),bt(r,"sessionClosed",s),bt(r,"notificationCleared",s)}));let t=()=>({version:x3,remoteAvailable:Ri(),daemonMode:Nm==="daemon"&&Pr(),platform:process.platform,updateAvailable:Dw(),canSelfUpdate:!0,...eE()}),n=()=>{let s=t();for(let i of r.sockets.sockets.values())i.data?.approved&&i.emit("serverInfo",s)};Fw(n),Ki._buildServerInfo=t,Ki._emitServerInfo=n}function fC(){Ki._emitServerInfo?.()}var dC=null;function hC(r){dC=r}async function mC(r,e,t){tE(),dC?.(),r.emit("serverInfo",Ki._buildServerInfo?.()),dE(r,e,Xn,cC,lC,uC),gE(r,Xn),WT(r),zl()&&await ZS(r,t).catch(n=>{console.error("\u274C Failed to setup remote handlers:",n.message)}),r.on("disconnect",()=>{jT(r.id),rE()})}var ie=J(require("fs"),1),wr=J(require("path"),1),en=J(require("os"),1),ro=require("child_process"),zR=J(BR(),1);var qg=["node_modules",".git","dist","build",".next","coverage","__pycache__",".cache",".vscode",".idea",".turbo",".vercel",".output","out",".nuxt",".svelte-kit","target","vendor",".gradle",".pytest_cache",".mypy_cache",".tox",".venv","venv","env",".DS_Store",".parcel-cache",".rollup.cache"],Ju=[".png",".jpg",".jpeg",".gif",".webp",".ico",".svg",".bmp",".pdf",".zip",".tar",".gz",".rar",".7z",".exe",".dll",".so",".dylib",".mp3",".mp4",".wav",".avi",".mov",".webm",".woff",".woff2",".ttf",".eot",".otf",".sqlite",".db"];var jR=[".ssh",".aws",".gnupg",".kube",".docker",".cargo",".npmrc",".netrc",".pypirc",".config/gh",".config/gcloud"],FR=["/etc/shadow","/etc/sudoers","/etc/ssh","/root","/private/etc/sudoers"];var HR=J(require("fs"),1),Oa=J(require("path"),1),$R=J(require("os"),1);var UR=$R.default.homedir();function _4(r){if(!r)return null;let e=r.startsWith("~")?r.replace(/^~/,UR):r;try{return HR.default.realpathSync(e)}catch{return Oa.default.resolve(e)}}function Rn(r){let e=_4(r);if(!e)return!1;for(let t of FR)if(e===t||e.startsWith(t+Oa.default.sep))return!0;for(let t of jR){let n=Oa.default.join(UR,t);if(e===n||e.startsWith(n+Oa.default.sep))return!0}return!1}function Qu(r){return qg.includes(r)}function no(r){return Ju.includes(wr.default.extname(r).toLowerCase())}function w4(r,e){return r.isDirectory()?"folder":no(e)?"binary":"file"}function Ma(r){return r<1024?`${r}B`:r<1024*1024?`${(r/1024).toFixed(1)}KB`:`${(r/(1024*1024)).toFixed(1)}MB`}function VR(r,e,t,n=50){if(!(t.length>=n))try{for(let s of ie.default.readdirSync(r)){if(t.length>=n)return;if(s.startsWith(".")||Qu(s))continue;let i=wr.default.join(r,s);try{let o=ie.default.statSync(i);o.isDirectory()?VR(i,e,t,n):s.toLowerCase().includes(e.toLowerCase())&&t.push({name:s,path:i,type:no(s)?"binary":"file",size:o.size,sizeFormatted:Ma(o.size)})}catch{}}}catch{}}function GR(r){if(!r)return null;let e=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"::ANY::").replace(/\*/g,"[^/]*").replace(/::ANY::/g,".*").replace(/\?/g,".");return new RegExp(`^${e}$`)}function KR(r,e,t,n,s,i){if(i.length>=200)return;let o;try{o=ie.default.readdirSync(r,{withFileTypes:!0})}catch{return}for(let a of o){if(i.length>=200)return;if(Qu(a.name))continue;let c=wr.default.join(r,a.name),l=wr.default.relative(e,c);if(a.isDirectory()){KR(c,e,t,n,s,i);continue}if(a.isFile()&&!no(a.name)&&!(s&&s.test(l))&&!(n&&!n.test(l)))try{if(ie.default.statSync(c).size>512e3)continue;let h=ie.default.readFileSync(c,"utf-8").split(`
160
+ `),x=[];for(let _=0;_<h.length&&x.length<10;_++){let S=h[_],A=t(S);for(let M of A){if(x.length>=10)break;x.push({line:_+1,column:M.column+1,lineText:S,matchLength:M.length})}}x.length&&i.push({path:c,matches:x})}catch{}}}function YR(r,e,t){let n;try{n=ie.default.readdirSync(r,{withFileTypes:!0})}catch{return[]}let s=[];for(let i of n){if(!t&&i.name.startsWith(".")&&i.name!==".env"&&i.name!==".env.example"||Qu(i.name))continue;let o=wr.default.join(r,i.name);if(i.isDirectory()){let a={name:i.name,path:o,type:"folder"};e>0&&(a.children=YR(o,e-1,t)),s.push(a)}else i.isFile()&&s.push({name:i.name,path:o,type:no(i.name)?"binary":"file"})}return s.sort((i,o)=>i.type==="folder"&&o.type!=="folder"?-1:i.type!=="folder"&&o.type==="folder"?1:i.name.localeCompare(o.name)),s}function S4(){if(process.platform!=="win32")return[];try{return(0,ro.execSync)("wmic logicaldisk get name",{encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).split(/\r?\n/).map(e=>e.trim()).filter(e=>/^[A-Z]:$/.test(e)).map(e=>({letter:e[0],path:e+"\\"}))}catch{return"CDEFGHIJ".split("").map(r=>`${r}:\\`).filter(r=>ie.default.existsSync(r)).map(r=>({letter:r[0],path:r}))}}function XR(r){r.on("getSystemInfo",t=>{let n=process.platform;t({success:!0,platform:n,isWindows:n==="win32",drives:n==="win32"?S4():[],homedir:en.default.homedir()})}),r.on("getFiles",({dirPath:t,showHidden:n},s)=>{try{let i=t||en.default.homedir(),o=i.startsWith("~")?i.replace("~",en.default.homedir()):i;if(Rn(o))return s({success:!1,error:"Access denied"});if(!ie.default.existsSync(o))return s({success:!1,error:"Directory not found"});let a=[];for(let c of ie.default.readdirSync(o))if(!(!n&&c.startsWith(".")&&c!==".env"&&c!==".env.example")&&!Qu(c))try{let l=wr.default.join(o,c),p=ie.default.statSync(l);a.push({name:c,path:l,type:w4(p,c),size:p.isFile()?p.size:null,sizeFormatted:p.isFile()?Ma(p.size):null,modified:p.mtime.getTime()})}catch{}a.sort((c,l)=>c.type==="folder"&&l.type!=="folder"?-1:c.type!=="folder"&&l.type==="folder"?1:c.name.localeCompare(l.name)),s({success:!0,files:a,currentPath:o,parentPath:wr.default.dirname(o)})}catch(i){s({success:!1,error:i.message})}}),r.on("searchFiles",({workspace:t,query:n},s)=>{try{if(!n||n.length<2)return s({success:!0,files:[]});let i=(t||en.default.homedir()).replace(/^~/,en.default.homedir());if(!ie.default.existsSync(i))return s({success:!1,error:"Workspace not found"});let o=[];VR(i,n,o,50),o.sort((a,c)=>{let l=a.name.toLowerCase()===n.toLowerCase(),p=c.name.toLowerCase()===n.toLowerCase();return l&&!p?-1:!l&&p?1:a.path.length-c.path.length}),s({success:!0,files:o})}catch(i){s({success:!1,error:i.message})}}),r.on("readFile",({filePath:t},n)=>{try{if(Rn(t))return n({success:!1,error:"Access denied"});if(!ie.default.existsSync(t))return n({success:!1,error:"File not found"});let s=ie.default.statSync(t);if(s.size>512e3)return n({success:!1,error:`File too large (${Ma(s.size)}). Max ${Ma(512e3)}`});if(no(t))return n({success:!1,error:"Cannot open binary file"});n({success:!0,content:ie.default.readFileSync(t,"utf-8")})}catch(s){n({success:!1,error:s.message})}}),r.on("readImage",({filePath:t},n)=>{try{if(Rn(t))return n({success:!1,error:"Access denied"});if(!ie.default.existsSync(t))return n({success:!1,error:"File not found"});let s=ie.default.statSync(t),i=10*1024*1024;if(s.size>i)return n({success:!1,error:`Image too large (${Ma(s.size)})`});let o=wr.default.extname(t).toLowerCase().slice(1),c={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",ico:"image/x-icon",bmp:"image/bmp"}[o]||"application/octet-stream",l=ie.default.readFileSync(t),p=`data:${c};base64,${l.toString("base64")}`;n({success:!0,dataUrl:p,size:s.size,mime:c})}catch(s){n({success:!1,error:s.message})}}),r.on("writeFile",({filePath:t,content:n},s)=>{try{if(Rn(t))return s({success:!1,error:"Access denied"});ie.default.writeFileSync(t,n,"utf-8"),s({success:!0})}catch(i){s({success:!1,error:i.message})}}),r.on("createItem",({itemPath:t,type:n},s)=>{try{if(Rn(t))return s({success:!1,error:"Access denied"});if(ie.default.existsSync(t))return s({success:!1,error:"Item already exists"});n==="folder"?ie.default.mkdirSync(t,{recursive:!0}):ie.default.writeFileSync(t,"","utf-8"),s({success:!0})}catch(i){s({success:!1,error:i.message})}}),r.on("deleteItem",({itemPath:t},n)=>{try{if(Rn(t))return n({success:!1,error:"Access denied"});if(!ie.default.existsSync(t))return n({success:!1,error:"Item not found"});ie.default.statSync(t).isDirectory()?ie.default.rmSync(t,{recursive:!0}):ie.default.unlinkSync(t),n({success:!0})}catch(s){n({success:!1,error:s.message})}}),r.on("renameItem",({oldPath:t,newPath:n},s)=>{try{if(Rn(t)||Rn(n))return s({success:!1,error:"Access denied"});if(!ie.default.existsSync(t))return s({success:!1,error:"Item not found"});if(ie.default.existsSync(n))return s({success:!1,error:"Target already exists"});ie.default.renameSync(t,n),s({success:!0})}catch(i){s({success:!1,error:i.message})}}),r.on("searchInFiles",({workspace:t,query:n,caseSensitive:s,regex:i,includeGlob:o,excludeGlob:a},c)=>{try{if(!n)return c({success:!0,results:[]});let l=(t||en.default.homedir()).replace(/^~/,en.default.homedir());if(!ie.default.existsSync(l))return c({success:!1,error:"Workspace not found"});let p;if(i){let _;try{_=new RegExp(n,s?"g":"gi")}catch(S){return c({success:!1,error:`Invalid regex: ${S.message}`})}p=S=>{let A=[],M;for(_.lastIndex=0;(M=_.exec(S))!==null;)A.push({column:M.index,length:M[0].length}),M.index===_.lastIndex&&_.lastIndex++;return A}}else{let _=s?n:n.toLowerCase();p=S=>{let A=s?S:S.toLowerCase(),M=[],N=0;for(;(N=A.indexOf(_,N))!==-1;)M.push({column:N,length:_.length}),N+=_.length||1;return M}}let f=GR(o),h=GR(a),x=[];KR(l,l,p,f,h,x),c({success:!0,results:x})}catch(l){c({success:!1,error:l.message})}}),r.on("replaceInFiles",({workspace:t,query:n,replacement:s,caseSensitive:i,regex:o,files:a},c)=>{try{if(!n||!Array.isArray(a)||!a.length)return c({success:!0,replacedCount:0,fileCount:0});let l;if(o){let h;try{h=new RegExp(n,i?"g":"gi")}catch(x){return c({success:!1,error:`Invalid regex: ${x.message}`})}l=x=>{let _=0;return{next:x.replace(h,A=>(_++,s)),count:_}}}else l=h=>{let x=0,_=i?"g":"gi",S=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),A=new RegExp(S,_);return{next:h.replace(A,()=>(x++,s)),count:x}};let p=0,f=0;for(let h of a)try{if(!ie.default.existsSync(h)||no(h))continue;let x=ie.default.statSync(h);if(!x.isFile()||x.size>512e3)continue;let _=ie.default.readFileSync(h,"utf-8"),{next:S,count:A}=l(_);A>0&&(ie.default.writeFileSync(h,S,"utf-8"),p+=A,f++)}catch{}c({success:!0,replacedCount:p,fileCount:f})}catch(l){c({success:!1,error:l.message})}});let e=new Map;r.on("watchDir",({dirPath:t},n)=>{try{if(!t||!ie.default.existsSync(t))return n({success:!1,error:"Directory not found"});let s=e.get(t);if(s)return s.count++,n({success:!0});let i=zR.default.watch(t,{depth:0,ignoreInitial:!0,persistent:!0,ignored:a=>qg.includes(wr.default.basename(a))}),o=a=>c=>r.emit("fileChange",{type:a,path:c});i.on("add",o("add")).on("change",o("change")).on("unlink",o("unlink")).on("addDir",o("addDir")).on("unlinkDir",o("unlinkDir")),e.set(t,{w:i,count:1}),n({success:!0})}catch(s){n({success:!1,error:s.message})}}),r.on("unwatchDir",({dirPath:t},n)=>{try{let s=e.get(t);s&&--s.count<=0&&(s.w.close(),e.delete(t)),n({success:!0})}catch(s){n({success:!1,error:s.message})}}),r.once("disconnect",()=>{for(let{w:t}of e.values())try{t.close()}catch{}e.clear()}),r.on("revealInOS",({filePath:t},n)=>{try{if(!t)return n({success:!1,error:"No path"});let s=process.platform,i,o;s==="darwin"?(i="open",o=["-R",t]):s==="win32"?(i="explorer",o=[`/select,${t}`]):(i="xdg-open",o=[wr.default.dirname(t)]);let a=(0,ro.spawn)(i,o,{detached:!0,stdio:"ignore",windowsHide:!0});a.on("error",c=>n({success:!1,error:c.message})),a.unref(),n({success:!0})}catch(s){n({success:!1,error:s.message})}}),r.on("openInTerminal",({dirPath:t},n)=>{try{if(!t||!ie.default.existsSync(t))return n({success:!1,error:"Directory not found"});let s=process.platform,i,o,a={detached:!0,stdio:"ignore",windowsHide:!0};s==="darwin"?(i="open",o=["-a","Terminal",t]):s==="win32"?(i="cmd",o=["/C","start","cmd","/K",`cd /d "${t}"`],a.shell=!1):(i="gnome-terminal",o=[`--working-directory=${t}`]);let c=(0,ro.spawn)(i,o,a);c.on("error",()=>{if(s==="linux"){let l=(0,ro.spawn)("xterm",["-e",`cd "${t}" && bash`],a);l.on("error",p=>n({success:!1,error:p.message})),l.unref()}else n({success:!1,error:"Failed to open terminal"})}),c.unref(),n({success:!0})}catch(s){n({success:!1,error:s.message})}}),r.on("getFileTree",({dirPath:t,depth:n,showHidden:s},i)=>{try{let o=(t||en.default.homedir()).replace(/^~/,en.default.homedir());if(!ie.default.existsSync(o))return i({success:!1,error:"Directory not found"});let c=YR(o,typeof n=="number"?n:3,!!s);i({success:!0,tree:{name:wr.default.basename(o)||o,path:o,type:"folder",children:c}})}catch(o){i({success:!1,error:o.message})}})}var Vt=J(require("fs"),1),Ms=J(require("path"),1),Sr=require("child_process");function Os(r,e){return new Promise(t=>{let n=(0,Sr.spawn)("git",r,{cwd:e,windowsHide:!0}),s="",i="";n.stdout.on("data",o=>{s+=o.toString()}),n.stderr.on("data",o=>{i+=o.toString()}),n.on("error",o=>t({code:-1,stdout:s,stderr:o.message})),n.on("close",o=>t({code:o,stdout:s,stderr:i}))})}function JR(r){return Ju.includes(Ms.default.extname(r).toLowerCase())}function QR(r){r.on("gitStatus",({repoPath:e},t)=>{try{let n=(0,Sr.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),s={};try{(0,Sr.execSync)("git diff HEAD --numstat",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).trim().split(`
161
+ `).filter(Boolean).forEach(a=>{let c=a.split(" ");c.length>=3&&(s[c[2]]={added:c[0]==="-"?0:parseInt(c[0],10)||0,deleted:c[1]==="-"?0:parseInt(c[1],10)||0})})}catch{}let i=[];for(let o of n.trim().split(`
162
+ `).filter(Boolean)){let a=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!a)continue;let c=a[1],l=a[2];if(!l)continue;let p;c.includes("?")?p="?":c.includes("A")?p="A":c.includes("D")?p="D":c.includes("M")?p="M":c.includes("R")?p="R":p=c.trim()[0]||"?";let f=s[l]||{added:0,deleted:0};if(p==="?")try{let h=Ms.default.join(e,l);if(Vt.default.existsSync(h)&&!JR(l)){let x=Vt.default.readFileSync(h,"utf-8");f.added=x.split(`
163
+ `).length,f.deleted=0}}catch{}i.push({status:p,path:l,added:f.added,deleted:f.deleted})}t({success:!0,files:i})}catch{t({success:!1,error:"Not a git repository or git not available"})}}),r.on("gitChangedCount",({repoPath:e},t)=>{try{let n=(0,Sr.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),s=n.trim()?n.trim().split(`
164
+ `).length:0;t({success:!0,count:s})}catch{t({success:!1,error:"Not a git repository or git not available"})}}),r.on("gitFileStatus",({repoPath:e,filePath:t},n)=>{try{let s=Ms.default.relative(e,t),o=(0,Sr.execSync)(`git status --porcelain -- "${s}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).trim();if(!o)return n({success:!0,status:null});let a=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!a)return n({success:!0,status:null});let c=a[1],l;c.includes("?")?l="?":c.includes("A")?l="A":c.includes("D")?l="D":c.includes("M")?l="M":c.includes("R")?l="R":l=c.trim()[0]||"?",n({success:!0,status:l,file:s})}catch{n({success:!0,status:null})}}),r.on("gitDiff",({repoPath:e,file:t,status:n},s)=>{try{let i="";if(t&&n==="?"){let o=Ms.default.join(e,t);if(Vt.default.existsSync(o)){let c=Vt.default.readFileSync(o,"utf-8").split(`
165
+ `);i=`diff --git a/${t} b/${t}
141
166
  new file mode 100644
142
167
  --- /dev/null
143
168
  +++ b/${t}
144
169
  @@ -0,0 +1,${c.length} @@
145
- ${c.map(u=>`+${u}`).join(`
146
- `)}`}}else if(t)s=(0,yr.execSync)(`git diff HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0});else{s=(0,yr.execSync)("git diff HEAD",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0});let a=(0,yr.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).trim().split(`
147
- `).filter(c=>c.startsWith("??")).map(c=>c.substring(3));for(let c of a){let u=Ai.default.join(e,c);if(Wt.default.existsSync(u)&&!LR(c))try{if(Wt.default.statSync(u).size<=512e3){let m=Wt.default.readFileSync(u,"utf-8").split(`
148
- `);s+=`
170
+ ${c.map(l=>`+${l}`).join(`
171
+ `)}`}}else if(t)i=(0,Sr.execSync)(`git diff HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0});else{i=(0,Sr.execSync)("git diff HEAD",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0});let a=(0,Sr.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).trim().split(`
172
+ `).filter(c=>c.startsWith("??")).map(c=>c.substring(3));for(let c of a){let l=Ms.default.join(e,c);if(Vt.default.existsSync(l)&&!JR(c))try{if(Vt.default.statSync(l).size<=512e3){let h=Vt.default.readFileSync(l,"utf-8").split(`
173
+ `);i+=`
149
174
  diff --git a/${c} b/${c}
150
175
  new file mode 100644
151
176
  --- /dev/null
152
177
  +++ b/${c}
153
- @@ -0,0 +1,${m.length} @@
154
- ${m.map(y=>`+${y}`).join(`
155
- `)}`}}catch{}}}i({success:!0,diff:s})}catch(s){i({success:!1,error:s.message})}}),r.on("gitBranch",async({repoPath:e},t)=>{let n=await Ci(["branch","--show-current"],e);if(n.code!==0)return t({success:!1});t({success:!0,branch:n.stdout.trim()})}),r.on("gitAdd",async({repoPath:e,files:t},n)=>{try{let i=Array.isArray(t)&&t.length?t:["."],s=await Ci(["add","--",...i],e);if(s.code!==0)return n({success:!1,error:s.stderr.trim()});n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("gitReset",async({repoPath:e,files:t},n)=>{try{let i=Array.isArray(t)&&t.length?t:["."],s=await Ci(["reset","HEAD","--",...i],e);n({success:s.code===0,error:s.code===0?void 0:s.stderr.trim()})}catch(i){n({success:!1,error:i.message})}}),r.on("gitCommit",async({repoPath:e,message:t},n)=>{try{if(!t)return n({success:!1,error:"Empty message"});let i=await Ci(["commit","-m",t],e),s=(i.stdout+i.stderr).trim();if(i.code!==0)return n({success:!1,output:s,error:i.stderr.trim()});n({success:!0,output:s})}catch(i){n({success:!1,error:i.message})}}),r.on("gitPush",async({repoPath:e},t)=>{try{let n=await Ci(["push"],e),i=(n.stdout+n.stderr).trim();if(n.code!==0)return t({success:!1,output:i,error:n.stderr.trim()});t({success:!0,output:i})}catch(n){t({success:!1,error:n.message})}}),r.on("gitPull",async({repoPath:e},t)=>{try{let n=await Ci(["pull"],e),i=(n.stdout+n.stderr).trim();if(n.code!==0)return t({success:!1,output:i,error:n.stderr.trim()});t({success:!0,output:i})}catch(n){t({success:!1,error:n.message})}}),r.on("gitLog",async({repoPath:e,limit:t},n)=>{try{let i=typeof t=="number"&&t>0?t:20,s=await Ci(["log","-n",String(i),"--pretty=format:%h%x09%s"],e);if(s.code!==0)return n({success:!1,error:s.stderr.trim()});let o=s.stdout.split(`
156
- `).filter(Boolean).map(a=>{let[c,...u]=a.split(" ");return{hash:c,message:u.join(" ")}});n({success:!0,commits:o})}catch(i){n({success:!1,error:i.message})}}),r.on("gitDiscard",({repoPath:e,file:t,status:n},i)=>{try{if(!t)return i({success:!1,error:"No file specified"});let s=Ai.default.join(e,t);n==="?"?Wt.default.existsSync(s)&&(Wt.default.statSync(s).isDirectory()?Wt.default.rmSync(s,{recursive:!0}):Wt.default.unlinkSync(s)):n==="A"?((0,yr.execSync)(`git reset HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),Wt.default.existsSync(s)&&Wt.default.unlinkSync(s)):(0,yr.execSync)(`git checkout HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),i({success:!0})}catch(s){i({success:!1,error:s.message})}})}function BR(r){NR(r),DR(r)}mn();var Cn=require("fs"),FR=require("path");xt();oh();var jR=oe.CONFIG,Bg=(0,FR.join)(oe.CONFIG,"approvedDevices.json"),Ir=new Map,eo=!1,Ra=new Map,to=new Map;function $R(){(0,Cn.existsSync)(jR)||(0,Cn.mkdirSync)(jR,{recursive:!0})}function HR(){try{if($R(),(0,Cn.existsSync)(Bg)){let r=JSON.parse((0,Cn.readFileSync)(Bg,"utf8"));Array.isArray(r)?Ir=new Map(r.map(e=>[e,{approvedAt:null}])):Ir=new Map(Object.entries(r)),Ir.delete(co)&&Ku()}}catch{Ir=new Map}}function Ku(){try{$R(),(0,Cn.writeFileSync)(Bg,JSON.stringify(Object.fromEntries(Ir),null,2))}catch{}}function UR(r){return r?Ir.has(r):!1}function Yu(r){!r||r===co||(Ir.set(r,{approvedAt:new Date().toISOString()}),Ku())}function qR(r){Ir.delete(r),Ku()}function WR(r,e){let t=Ir.get(r);return t?(Ir.set(r,{...t,label:e||""}),Ku(),!0):!1}function GR(){return[...Ir.entries()].map(([r,e])=>({deviceId:r,...e}))}function zR(r,e){Ra.set(r,e)}function jg(r){return Ra.get(r)||null}function Xu(r){Ra.delete(r)}function VR(r){if(!r)return!1;for(let e of Ra.values())if(e.deviceId===r)return!0;return!1}function KR(){return[...Ra.entries()].map(([r,e])=>({socketId:r,...e}))}function YR(r,e){r&&to.set(r,{...e,rejectedAt:new Date().toISOString()})}function XR(r){return r?to.has(r):!1}function JR(r,e,t){let n=to.get(r);n&&to.set(r,{...n,socketId:e,ip:t})}function QR(){return[...to.entries()].map(([r,e])=>({deviceId:r,...e}))}function ro(r){to.delete(r)}function ZR(){return eo=!!Vo().autoApprove,eo}function Ju(){return eo}function ek(r){return eo=!!r,yl({autoApprove:eo}),eo}function Fg(){try{let r=(0,rk.join)(oe.ROOT,"keys.json");return JSON.parse((0,tk.readFileSync)(r,"utf8")).key||null}catch{return null}}var Ri=null;function Oa(){return Ri}async function ka(r){r.handshake.auth?.tempKey&&(ye("One-time key used \u2014 clearing from UI"),Rw()),await $q(r),BR(r),await ZT(r,Ri,Fg())}async function $q(r){if(r.data.protocol)return;let{webrtc:e,streaming:t}=Y,n=new Al(r,{enableWebRTC:e.enableWebRTC,apiKey:e.enableTurn?Fg():null,turnApiUrl:e.enableTurn?e.turnApiUrl:null,turnRefreshInterval:e.turnRefreshInterval,dcMaxMessageSize:e.dcMaxMessageSize,dcChunkSize:e.dcChunkSize,dcMaxTilesPerFrame:e.dcMaxTilesPerFrame,answerTimeout:e.answerTimeout,maxControlBuffer:e.maxControlBuffer,wsChunkSize:t.chunkSize});r.data.protocol=n,Zw(n),n.attachAsBus(r);try{await n.init(),n.setupSignaling(r)}catch(i){console.error("[transport] pm init failed:",i.message)}}function nk(r){let e=Ri;if(!e)return!1;let t=e.sockets.sockets.get(r),n=jg(r);return!t||!n?!1:(Yu(n.deviceId),Xu(r),ro(n.deviceId),t.data.approved=!0,t.emit("device:approved"),ka(t),ye(`Device approved: ${n.deviceId.slice(0,8)}...`),!0)}function ik(r){let e=Ri;if(!e||!r)return!1;Yu(r),ro(r);for(let t of e.sockets.sockets.values())t.handshake.auth?.deviceId===r&&(t.data.approved=!0,t.emit("device:approved"),ka(t));return ye(`Device approved from pending: ${r.slice(0,8)}...`),!0}function Qu(r){let e=Ri;if(!e||!r)return 0;let t=0;for(let n of e.sockets.sockets.values())n.handshake.auth?.deviceId===r&&(n.disconnect(!0),t++);return t&&ye(`Disconnected ${t} socket(s) for device ${r.slice(0,8)}...`),t}function sk(r){let e=Ri;if(!e)return!1;let t=jg(r),n=e.sockets.sockets.get(r);return Xu(r),t?.deviceId&&YR(t.deviceId,{ip:t.ip,socketId:r}),n&&(n.emit("device:rejected"),n.disconnect(!0)),wt("deviceApproval",{action:"refresh"}),ye(`Device rejected: ${t?.deviceId?.slice(0,8)||"unknown"}...`),!0}async function ok(r){HR(),ZR();let e=new Vb(r,{cors:{origin:"*",methods:["GET","POST"],credentials:!0,allowedHeaders:["*"]},transports:["websocket","polling"],allowEIO3:!0,allowUpgrades:!0,pingTimeout:6e4,pingInterval:25e3,maxHttpBufferSize:1e8,perMessageDeflate:{threshold:1024}}),t=await $S();return Mw(t),e.on("connection",n=>{let i=n.handshake.headers["x-forwarded-for"]||n.handshake.address||"unknown",s=n.handshake.auth?.deviceId||null;n.data.approved=!1,n.use((f,m)=>{if(n.data.approved)return m();let y=f[0];return y==="device:clientReady"||y==="disconnect"?m():m(new Error("Device not approved"))});let o=n.handshake.address||"",a=o==="127.0.0.1"||o==="::1"||o==="::ffff:127.0.0.1",c=!!n.handshake.headers["cf-connecting-ip"],u=n.handshake.headers.origin,p=!u||Va.includes(u);if(!c&&a&&p&&Xb(n.handshake.auth?.localToken)){n.data.approved=!0,n.data.localUi=!0,ye("Local UI connected \u2014 trusted (token)"),ka(n);return}if(s===co){ye(`Rejected untrusted local-ui socket from ${i}`),n.disconnect(!0);return}if(Nw(n.id,i,s),ye(`Client connected: ${i} (device: ${s?.slice(0,8)||"none"})`),n.on("disconnect",f=>{Lw(n.id),Xu(n.id),ye(`Client disconnected: ${i} (${f})`);let m=n.data?.protocol;if(m&&!n.data?.remoteAttached){try{m.close()}catch{}Cs(m)}}),s&&UR(s))ye(`Device recognized: ${s.slice(0,8)}...`),n.data.approved=!0,ka(n);else if(s&&XR(s))JR(s,n.id,i),ye(`Rejected device reconnected: ${s.slice(0,8)} \u2014 waiting in Clients list`),n.emit("device:rejected"),wt("deviceApproval",{action:"refresh"});else if(s&&Ju())Yu(s),ro(s),n.data.approved=!0,ye(`Auto-approved device: ${s.slice(0,8)}...`),ka(n),n.once("device:clientReady",()=>n.emit("device:approved")),wt("deviceApproval",{action:"refresh"});else{if(ye(`Unknown device: ${s?.slice(0,8)||"no-id"} \u2014 waiting for approval`),VR(s)){ye(`Device ${s?.slice(0,8)} already pending, ignoring duplicate`),n.disconnect(!0);return}zR(n.id,{deviceId:s,ip:i}),n.once("device:clientReady",()=>{n.emit("device:pendingApproval"),wt("deviceApproval",{socketId:n.id,deviceId:s,ip:i,action:"pending"})})}}),Ws(e,Fg()),Ri=e,e}function ak(r){r.setHeader("Access-Control-Allow-Origin","*"),r.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Authorization, Content-Type"),r.setHeader("Access-Control-Max-Age","86400")}function ck(r,e){return r.method==="OPTIONS"?(e.writeHead(200),e.end(),!0):!1}var io=require("zlib"),Wk=J($k(),1);var v4=["data:","javascript:","#","mailto:","blob:"],x4=["href","src","action","srcset","poster","data","formaction","data-src","data-href","data-url","data-background"];function rp(r,e){return!r||v4.some(t=>r.startsWith(t))||r.startsWith("/proxy/")?r:r.startsWith(`http://localhost:${e}`)?r.replace(`http://localhost:${e}`,`/proxy/${e}`):r.startsWith("/")&&!r.startsWith("//")?`/proxy/${e}${r}`:r}function Hk(r,e){let t=`/proxy/${e}`,n=new RegExp(`(${x4.join("|")})=(["'])([^"']*?)\\2`,"gi");return r=r.replace(n,(i,s,o,a)=>{if(s.toLowerCase()==="srcset"){let c=a.split(",").map(u=>{let[p,...f]=u.trim().split(/\s+/),m=rp(p,e);return f.length?`${m} ${f.join(" ")}`:m}).join(", ");return`${s}=${o}${c}${o}`}return`${s}=${o}${rp(a,e)}${o}`}),r=r.replace(/url\(\s*(["']?)(\/_next\/[^)"']+)\1\s*\)/gi,(i,s,o)=>`url(${s}${t}${o}${s})`),r=r.replace(/"(\/_next\/[^"]+)"/g,(i,s)=>`"${t}${s}"`),r}function Uk(r){let e=`/proxy/${r}`;return`
178
+ @@ -0,0 +1,${h.length} @@
179
+ ${h.map(x=>`+${x}`).join(`
180
+ `)}`}}catch{}}}s({success:!0,diff:i})}catch(i){s({success:!1,error:i.message})}}),r.on("gitBranch",async({repoPath:e},t)=>{let n=await Os(["branch","--show-current"],e);if(n.code!==0)return t({success:!1});t({success:!0,branch:n.stdout.trim()})}),r.on("gitAdd",async({repoPath:e,files:t},n)=>{try{let s=Array.isArray(t)&&t.length?t:["."],i=await Os(["add","--",...s],e);if(i.code!==0)return n({success:!1,error:i.stderr.trim()});n({success:!0})}catch(s){n({success:!1,error:s.message})}}),r.on("gitReset",async({repoPath:e,files:t},n)=>{try{let s=Array.isArray(t)&&t.length?t:["."],i=await Os(["reset","HEAD","--",...s],e);n({success:i.code===0,error:i.code===0?void 0:i.stderr.trim()})}catch(s){n({success:!1,error:s.message})}}),r.on("gitCommit",async({repoPath:e,message:t},n)=>{try{if(!t)return n({success:!1,error:"Empty message"});let s=await Os(["commit","-m",t],e),i=(s.stdout+s.stderr).trim();if(s.code!==0)return n({success:!1,output:i,error:s.stderr.trim()});n({success:!0,output:i})}catch(s){n({success:!1,error:s.message})}}),r.on("gitPush",async({repoPath:e},t)=>{try{let n=await Os(["push"],e),s=(n.stdout+n.stderr).trim();if(n.code!==0)return t({success:!1,output:s,error:n.stderr.trim()});t({success:!0,output:s})}catch(n){t({success:!1,error:n.message})}}),r.on("gitPull",async({repoPath:e},t)=>{try{let n=await Os(["pull"],e),s=(n.stdout+n.stderr).trim();if(n.code!==0)return t({success:!1,output:s,error:n.stderr.trim()});t({success:!0,output:s})}catch(n){t({success:!1,error:n.message})}}),r.on("gitLog",async({repoPath:e,limit:t},n)=>{try{let s=typeof t=="number"&&t>0?t:20,i=await Os(["log","-n",String(s),"--pretty=format:%h%x09%s"],e);if(i.code!==0)return n({success:!1,error:i.stderr.trim()});let o=i.stdout.split(`
181
+ `).filter(Boolean).map(a=>{let[c,...l]=a.split(" ");return{hash:c,message:l.join(" ")}});n({success:!0,commits:o})}catch(s){n({success:!1,error:s.message})}}),r.on("gitDiscard",({repoPath:e,file:t,status:n},s)=>{try{if(!t)return s({success:!1,error:"No file specified"});let i=Ms.default.join(e,t);n==="?"?Vt.default.existsSync(i)&&(Vt.default.statSync(i).isDirectory()?Vt.default.rmSync(i,{recursive:!0}):Vt.default.unlinkSync(i)):n==="A"?((0,Sr.execSync)(`git reset HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),Vt.default.existsSync(i)&&Vt.default.unlinkSync(i)):(0,Sr.execSync)(`git checkout HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),s({success:!0})}catch(i){s({success:!1,error:i.message})}})}function ZR(r){XR(r),QR(r)}xn();var kn=require("fs"),tk=require("path");_t();ph();var ek=oe.CONFIG,Wg=(0,tk.join)(oe.CONFIG,"approvedDevices.json"),Br=new Map,so=!1,Pa=new Map,io=new Map;function rk(){(0,kn.existsSync)(ek)||(0,kn.mkdirSync)(ek,{recursive:!0})}function nk(){try{if(rk(),(0,kn.existsSync)(Wg)){let r=JSON.parse((0,kn.readFileSync)(Wg,"utf8"));Array.isArray(r)?Br=new Map(r.map(e=>[e,{approvedAt:null}])):Br=new Map(Object.entries(r)),Br.delete(fo)&&Zu()}}catch{Br=new Map}}function Zu(){try{rk(),(0,kn.writeFileSync)(Wg,JSON.stringify(Object.fromEntries(Br),null,2))}catch{}}function sk(r){return r?Br.has(r):!1}function ep(r){!r||r===fo||(Br.set(r,{approvedAt:new Date().toISOString()}),Zu())}function ik(r){Br.delete(r),Zu()}function ok(r,e){let t=Br.get(r);return t?(Br.set(r,{...t,label:e||""}),Zu(),!0):!1}function ak(){return[...Br.entries()].map(([r,e])=>({deviceId:r,...e}))}function ck(r,e){Pa.set(r,e)}function Gg(r){return Pa.get(r)||null}function tp(r){Pa.delete(r)}function lk(r){if(!r)return!1;for(let e of Pa.values())if(e.deviceId===r)return!0;return!1}function uk(){return[...Pa.entries()].map(([r,e])=>({socketId:r,...e}))}function pk(r,e){r&&io.set(r,{...e,rejectedAt:new Date().toISOString()})}function fk(r){return r?io.has(r):!1}function dk(r,e,t){let n=io.get(r);n&&io.set(r,{...n,socketId:e,ip:t})}function hk(){return[...io.entries()].map(([r,e])=>({deviceId:r,...e}))}function oo(r){io.delete(r)}function mk(){return so=!!Jo().autoApprove,so}function rp(){return so}function gk(r){return so=!!r,Sl({autoApprove:so}),so}function zg(){try{let r=(0,yk.join)(oe.ROOT,"keys.json");return JSON.parse((0,vk.readFileSync)(r,"utf8")).key||null}catch{return null}}var Ps=null;function Na(){return Ps}async function Ia(r){r.handshake.auth?.tempKey&&(_e("One-time key used \u2014 clearing from UI"),Lw()),await T4(r),ZR(r),await mC(r,Ps,zg())}async function T4(r){if(r.data.protocol)return;let{webrtc:e,streaming:t}=Y,n=new Ml(r,{enableWebRTC:e.enableWebRTC,apiKey:e.enableTurn?zg():null,turnApiUrl:e.enableTurn?e.turnApiUrl:null,turnRefreshInterval:e.turnRefreshInterval,dcMaxMessageSize:e.dcMaxMessageSize,dcChunkSize:e.dcChunkSize,dcMaxTilesPerFrame:e.dcMaxTilesPerFrame,answerTimeout:e.answerTimeout,maxControlBuffer:e.maxControlBuffer,wsChunkSize:t.chunkSize});r.data.protocol=n,oS(n),n.attachAsBus(r);try{await n.init(),n.setupSignaling(r)}catch(s){console.error("[transport] pm init failed:",s.message)}}function xk(r){let e=Ps;if(!e)return!1;let t=e.sockets.sockets.get(r),n=Gg(r);return!t||!n?!1:(ep(n.deviceId),tp(r),oo(n.deviceId),t.data.approved=!0,t.emit("device:approved"),Ia(t),_e(`Device approved: ${n.deviceId.slice(0,8)}...`),!0)}function _k(r){let e=Ps;if(!e||!r)return!1;ep(r),oo(r);for(let t of e.sockets.sockets.values())t.handshake.auth?.deviceId===r&&(t.data.approved=!0,t.emit("device:approved"),Ia(t));return _e(`Device approved from pending: ${r.slice(0,8)}...`),!0}function np(r){let e=Ps;if(!e||!r)return 0;let t=0;for(let n of e.sockets.sockets.values())n.handshake.auth?.deviceId===r&&(n.disconnect(!0),t++);return t&&_e(`Disconnected ${t} socket(s) for device ${r.slice(0,8)}...`),t}function bk(r){let e=Ps;if(!e)return!1;let t=Gg(r),n=e.sockets.sockets.get(r);return tp(r),t?.deviceId&&pk(t.deviceId,{ip:t.ip,socketId:r}),n&&(n.emit("device:rejected"),n.disconnect(!0)),Tt("deviceApproval",{action:"refresh"}),_e(`Device rejected: ${t?.deviceId?.slice(0,8)||"unknown"}...`),!0}async function wk(r){nk(),mk();let e=new ew(r,{cors:{origin:"*",methods:["GET","POST"],credentials:!0,allowedHeaders:["*"]},transports:["websocket","polling"],allowEIO3:!0,allowUpgrades:!0,pingTimeout:6e4,pingInterval:25e3,maxHttpBufferSize:1e8,perMessageDeflate:{threshold:1024}}),t=await VS();return jw(t),e.on("connection",n=>{let s=n.handshake.headers["x-forwarded-for"]||n.handshake.address||"unknown",i=n.handshake.auth?.deviceId||null;n.data.approved=!1,n.use((f,h)=>{if(n.data.approved)return h();let x=f[0];return x==="device:clientReady"||x==="disconnect"?h():h(new Error("Device not approved"))});let o=n.handshake.address||"",a=o==="127.0.0.1"||o==="::1"||o==="::ffff:127.0.0.1",c=!!n.handshake.headers["cf-connecting-ip"],l=n.handshake.headers.origin,p=!l||Ja.includes(l);if(!c&&a&&p&&nw(n.handshake.auth?.localToken)){n.data.approved=!0,n.data.localUi=!0,_e("Local UI connected \u2014 trusted (token)"),Ia(n);return}if(i===fo){_e(`Rejected untrusted local-ui socket from ${s}`),n.disconnect(!0);return}if($w(n.id,s,i),_e(`Client connected: ${s} (device: ${i?.slice(0,8)||"none"})`),n.on("disconnect",f=>{Uw(n.id),tp(n.id),_e(`Client disconnected: ${s} (${f})`);let h=n.data?.protocol;if(h&&!n.data?.remoteAttached){try{h.close()}catch{}Oi(h)}}),i&&sk(i))_e(`Device recognized: ${i.slice(0,8)}...`),n.data.approved=!0,Ia(n);else if(i&&fk(i))dk(i,n.id,s),_e(`Rejected device reconnected: ${i.slice(0,8)} \u2014 waiting in Clients list`),n.emit("device:rejected"),Tt("deviceApproval",{action:"refresh"});else if(i&&rp())ep(i),oo(i),n.data.approved=!0,_e(`Auto-approved device: ${i.slice(0,8)}...`),Ia(n),n.once("device:clientReady",()=>n.emit("device:approved")),Tt("deviceApproval",{action:"refresh"});else{if(_e(`Unknown device: ${i?.slice(0,8)||"no-id"} \u2014 waiting for approval`),lk(i)){_e(`Device ${i?.slice(0,8)} already pending, ignoring duplicate`),n.disconnect(!0);return}ck(n.id,{deviceId:i,ip:s}),n.once("device:clientReady",()=>{n.emit("device:pendingApproval"),Tt("deviceApproval",{socketId:n.id,deviceId:i,ip:s,action:"pending"})})}}),Ki(e,zg()),Ps=e,e}function Sk(r){r.setHeader("Access-Control-Allow-Origin","*"),r.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Authorization, Content-Type"),r.setHeader("Access-Control-Max-Age","86400")}function Ek(r,e){return r.method==="OPTIONS"?(e.writeHead(200),e.end(),!0):!1}var co=require("zlib"),oO=J(rO(),1);var r6=["data:","javascript:","#","mailto:","blob:"],n6=["href","src","action","srcset","poster","data","formaction","data-src","data-href","data-url","data-background"];function ap(r,e){return!r||r6.some(t=>r.startsWith(t))||r.startsWith("/proxy/")?r:r.startsWith(`http://localhost:${e}`)?r.replace(`http://localhost:${e}`,`/proxy/${e}`):r.startsWith("/")&&!r.startsWith("//")?`/proxy/${e}${r}`:r}function nO(r,e){let t=`/proxy/${e}`,n=new RegExp(`(${n6.join("|")})=(["'])([^"']*?)\\2`,"gi");return r=r.replace(n,(s,i,o,a)=>{if(i.toLowerCase()==="srcset"){let c=a.split(",").map(l=>{let[p,...f]=l.trim().split(/\s+/),h=ap(p,e);return f.length?`${h} ${f.join(" ")}`:h}).join(", ");return`${i}=${o}${c}${o}`}return`${i}=${o}${ap(a,e)}${o}`}),r=r.replace(/url\(\s*(["']?)(\/_next\/[^)"']+)\1\s*\)/gi,(s,i,o)=>`url(${i}${t}${o}${i})`),r=r.replace(/"(\/_next\/[^"]+)"/g,(s,i)=>`"${t}${i}"`),r}function sO(r){let e=`/proxy/${r}`;return`
157
182
  // Service Worker for 9Remote Proxy - Port ${r}
158
183
  const PROXY_BASE = '${e}';
159
184
  const TARGET_PORT = ${r};
@@ -208,7 +233,7 @@ self.addEventListener('fetch', (event) => {
208
233
 
209
234
  event.respondWith(fetch(new Request(newUrl, requestInit)));
210
235
  });
211
- `}function qk(r){return`
236
+ `}function iO(r){return`
212
237
  <script data-proxy-injected="true">
213
238
  (function() {
214
239
  if (window.__proxySwRegistered) return;
@@ -250,7 +275,7 @@ self.addEventListener('fetch', (event) => {
250
275
  });
251
276
  }
252
277
  })();
253
- </script>`}var rv=new Set;function Gk(r){rv.add(String(r))}function zk(r){rv.delete(String(r))}function y4(r){return rv.has(String(r))}function _4(r){switch(r){case"gzip":return(0,io.createGunzip)();case"deflate":return(0,io.createInflate)();case"br":return(0,io.createBrotliDecompress)();default:return null}}function b4(r,e){if(r.includes("<head>"))return r.replace("<head>","<head>"+e);if(r.includes("<HEAD>"))return r.replace("<HEAD>","<HEAD>"+e);let t=r.match(/<head[^>]*>/i);return t?r.replace(t[0],t[0]+e):e+r}function Vk(){"";let r=Wk.default.createProxyServer({selfHandleResponse:!0});return r.on("proxyRes",(e,t,n)=>{let i=t._proxyTargetPort,s=e.headers["content-type"]||"",o=e.headers["content-encoding"]||"",a=s.includes("text/html"),c={...e.headers};if(c.location&&(c.location=rp(c.location,i)),s.includes("application/json")||s.includes("text/x-component")){n.writeHead(e.statusCode,c),e.pipe(n);return}if(s.includes("javascript")||s.includes("text/javascript")){n.writeHead(e.statusCode,c),e.pipe(n);return}if(!a){n.writeHead(e.statusCode,c),e.pipe(n);return}delete c["content-length"],delete c["content-encoding"];let f=_4(o),m=f?e.pipe(f):e,y=[];m.on("data",_=>y.push(_)),m.on("error",_=>{console.error("[Proxy] Decompress error:",_.message),n.writeHead(502),n.end("Bad Gateway: Decompression failed")}),m.on("end",()=>{let _=Buffer.concat(y).toString("utf8");_=Hk(_,i);let S=qk(i);_=b4(_,S),n.writeHead(e.statusCode,c),n.end(_)})}),r}function Kk(r,e,t,n,i,s){if(i==="/sw.js"){let o=Uk(n);t.writeHead(200,{"Content-Type":"application/javascript; charset=utf-8","Service-Worker-Allowed":"/","Cache-Control":"no-store, no-cache, must-revalidate"}),t.end(o);return}if(!y4(n)){t.writeHead(401,{"Content-Type":"text/html"}),t.end(`
278
+ </script>`}var lv=new Set;function aO(r){lv.add(String(r))}function cO(r){lv.delete(String(r))}function s6(r){return lv.has(String(r))}function i6(r){switch(r){case"gzip":return(0,co.createGunzip)();case"deflate":return(0,co.createInflate)();case"br":return(0,co.createBrotliDecompress)();default:return null}}function o6(r,e){if(r.includes("<head>"))return r.replace("<head>","<head>"+e);if(r.includes("<HEAD>"))return r.replace("<HEAD>","<HEAD>"+e);let t=r.match(/<head[^>]*>/i);return t?r.replace(t[0],t[0]+e):e+r}function lO(){"";let r=oO.default.createProxyServer({selfHandleResponse:!0});return r.on("proxyRes",(e,t,n)=>{let s=t._proxyTargetPort,i=e.headers["content-type"]||"",o=e.headers["content-encoding"]||"",a=i.includes("text/html"),c={...e.headers};if(c.location&&(c.location=ap(c.location,s)),i.includes("application/json")||i.includes("text/x-component")){n.writeHead(e.statusCode,c),e.pipe(n);return}if(i.includes("javascript")||i.includes("text/javascript")){n.writeHead(e.statusCode,c),e.pipe(n);return}if(!a){n.writeHead(e.statusCode,c),e.pipe(n);return}delete c["content-length"],delete c["content-encoding"];let f=i6(o),h=f?e.pipe(f):e,x=[];h.on("data",_=>x.push(_)),h.on("error",_=>{console.error("[Proxy] Decompress error:",_.message),n.writeHead(502),n.end("Bad Gateway: Decompression failed")}),h.on("end",()=>{let _=Buffer.concat(x).toString("utf8");_=nO(_,s);let S=iO(s);_=o6(_,S),n.writeHead(e.statusCode,c),n.end(_)})}),r}function uO(r,e,t,n,s,i){if(s==="/sw.js"){let o=sO(n);t.writeHead(200,{"Content-Type":"application/javascript; charset=utf-8","Service-Worker-Allowed":"/","Cache-Control":"no-store, no-cache, must-revalidate"}),t.end(o);return}if(!s6(n)){t.writeHead(401,{"Content-Type":"text/html"}),t.end(`
254
279
  <!DOCTYPE html>
255
280
  <html>
256
281
  <head><title>Unauthorized</title></head>
@@ -261,8 +286,8 @@ self.addEventListener('fetch', (event) => {
261
286
  </div>
262
287
  </body>
263
288
  </html>
264
- `);return}e._proxyTargetPort=n,e.url=i+(s||""),r.web(e,t,{target:`http://localhost:${n}`,changeOrigin:!0},o=>{t.writeHead(502),t.end(`Bad Gateway: ${o.message}`)})}var Yk=J(require("http"),1),Xk=J(require("https"),1),Jk=require("child_process"),Qk=require("util"),w4=(0,Qk.promisify)(Jk.exec);async function S4(){let r=process.platform,e=new Set([80,443]);try{let t;if(r==="win32")t="netstat -ano | findstr LISTENING";else{let s="/dev/null";t=`lsof -iTCP -sTCP:LISTEN -P -n 2>${s} || netstat -tlnp 2>${s}`}let{stdout:n}=await w4(t),i=n.split(`
265
- `);for(let s of i){let o=s.match(/[:\*\]](\d{2,5})(?:\s|$)/g);if(o)for(let a of o){let c=parseInt(a.replace(/[:\*\]\s]/g,""),10);c>0&&c<=65535&&(c===80||c===443||c>=1024)&&e.add(c)}}return Array.from(e)}catch(t){return console.error("Failed to get listening ports:",t.message),[80,443,3e3,3001,4200,5e3,5173,8e3,8080,9e3]}}function E4(r,e=2e3){return new Promise(t=>{let n=Yk.default.request({host:"localhost",port:r,method:"GET",path:"/",timeout:e},i=>{i.on("data",()=>{}),i.on("end",()=>{}),t({active:!0,protocol:"http",status:i.statusCode})});n.on("error",i=>{t({active:!1,error:i.message})}),n.on("timeout",()=>{n.destroy(),t({active:!1,error:"timeout"})}),n.end()})}function T4(r,e=2e3){return new Promise(t=>{let n=Xk.default.request({host:"localhost",port:r,method:"GET",path:"/",timeout:e,rejectUnauthorized:!1},i=>{i.on("data",()=>{}),i.on("end",()=>{}),t({active:!0,protocol:"https",status:i.statusCode})});n.on("error",i=>{t({active:!1,error:i.message})}),n.on("timeout",()=>{n.destroy(),t({active:!1,error:"timeout"})}),n.end()})}async function C4(r){let[e,t]=await Promise.all([E4(r),T4(r)]);return t.active?{port:r,...t}:e.active?{port:r,...e}:{port:r,active:!1}}async function Zk(){let r=await S4();return(await Promise.all(r.map(t=>C4(t)))).filter(t=>t.active).map(t=>({port:t.port,protocol:t.protocol,url:`${t.protocol}://localhost:${t.port}`,name:`localhost:${t.port}`,status:t.status})).sort((t,n)=>t.port-n.port)}var eO=J(require("crypto"),1),A4=process.env.API_KEY_SECRET||"9remote-api-key-secret";function R4(){let r="abcdefghijklmnopqrstuvwxyz0123456789",e="";for(let t=0;t<4;t++)e+=r.charAt(Math.floor(Math.random()*r.length));return e}function tO(r,e){return eO.default.createHmac("sha256",A4).update(r+e).digest("hex").slice(0,6)}function rO(r){let e=r.slice(0,8),t=R4(),n=tO(e,t);return{key:`sk-${e}-${t}-${n}`,keyId:t}}function k4(r){if(!r||!r.startsWith("sk-"))return null;let e=r.split("-");if(e.length===4){let[,t,n,i]=e,s=tO(t,n);return i!==s?null:{machineId:t,keyId:n}}return null}function np(r){return k4(r)!==null}async function nO(r,e){let t=r.headers.authorization;if(!t||!t.startsWith("Bearer ")){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Missing API key"}));return}let n=t.slice(7);if(!np(n)){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Invalid API key"}));return}let i=await Zk();e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify(i))}fl();var oO=require("url");var ip=J(require("path"),1),aO=J(require("os"),1);xt();var iO=J(require("path"),1),sO=J(require("os"),1);var EK=iO.default.join(sO.default.homedir(),".9remote","pids");sh();var ja={checkIntervalMs:36e5,connectCheckDebounceMs:9e5,maxRetry:3,retryDelayMs:3e3,verifyTimeoutMs:15e3,lockTtlMs:3e5,lockFile:"update.lock"};var AK={orange:ao.rgb(230,138,110),orangeDim:ao.rgb(200,120,95)};var LK=ip.default.dirname((0,oO.fileURLToPath)(__importMetaUrl));var DK=ip.default.join(aO.default.homedir(),".9remote","cloudflared.pid");function cO(r,e){let t=r.split(".").map(Number),n=e.split(".").map(Number);for(let i=0;i<3;i++){if(n[i]>t[i])return!0;if(n[i]<t[i])return!1}return!1}var BK=ip.default.join(oe.STATE,ja.lockFile);mn();Nt();xt();ys();var uO=J(lO(),1),iv=J(require("crypto"),1),{machineIdSync:O4}=uO.default;async function pO(r=null){let e=r||process.env.MACHINE_ID_SALT||"9remote-salt";try{let t=O4();return iv.default.createHash("sha256").update(t+e).digest("hex").substring(0,16)}catch(t){return console.error("Error getting machine ID:",t),iv.default.randomUUID().replace(/-/g,"").substring(0,16)}}mn();async function fO(r,e){let t=Aw(),n=t.workerUrl||"https://9remote.cc";if(!t.permanentKey){ce(e,400,"No permanent key set");return}try{let s=await(await po(`${n}/api/temp-key/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t.permanentKey,expiryMinutes:30})})).json(),o=`${n}/login?k=${s.tempKey}`;hn({oneTimeKey:s.tempKey,oneTimeKeyExpiresAt:s.expiresAt,qrUrl:o}),ee(e,{oneTimeKey:s.tempKey,expiresAt:s.expiresAt,qrUrl:o})}catch(i){ce(e,500,i.message)}}async function dO(r,e){try{let t=await pO(),{key:n}=rO(t),i=cw();lw(t,n,i?.name||"Default"),hn({permanentKey:n}),ee(e,{ok:!0,permanentKey:n})}catch(t){ce(e,500,t.message)}}Nt();async function hO(r,e){let t=await It(r,e);if(!t)return;let n=nk(t.socketId);ee(e,{ok:n})}async function mO(r,e){let t=await It(r,e);if(!t)return;let n=sk(t.socketId);ee(e,{ok:n})}function gO(r,e){ee(e,{pending:KR()})}function vO(r,e){ee(e,{devices:GR()})}function xO(r,e){ee(e,{rejected:QR()})}async function yO(r,e){let t=await It(r,e);if(!t)return;let n=ik(t.deviceId);ee(e,{ok:n})}async function _O(r,e){let t=await It(r,e);t&&(Qu(t.deviceId),ro(t.deviceId),ee(e))}async function bO(r,e){let t=await It(r,e);t&&(Qu(t.deviceId),qR(t.deviceId),ee(e))}async function wO(r,e){let t=await It(r,e);if(!t)return;let n=Qu(t.deviceId);ee(e,{disconnected:n})}function SO(r,e){ee(e,{enabled:Ju()})}async function EO(r,e){let t=await It(r,e);if(!t)return;let n=WR(t.deviceId,t.label);ee(e,{ok:n})}async function TO(r,e){let t=await It(r,e);if(!t)return;let n=ek(!!t.enabled);ee(e,{enabled:n})}Nt();hi();var CO={},M4=1e4;function AO(r,e){if(e)return{type:e.type||"stop",sessionId:e.sessionId||"",tool:e.tool||"claude"};let t=JSON.parse(r||"{}");return{type:t.type||"stop",sessionId:t.sessionId||"",tool:t.tool||"claude"}}async function RO(r,e){let t="";await new Promise(n=>{r.on("data",i=>t+=i),r.on("end",n)});try{OO(AO(t,null)),ee(e,{success:!0})}catch{ce(e,400,"Invalid JSON")}}function kO(r,e,{query:t}){OO(AO(null,t)),ee(e,{success:!0})}function OO({type:r,sessionId:e,tool:t}){let n=Date.now(),i=Oa();if(!i||!e)return;let s={type:r,sessionId:e,tool:t,timestamp:n};if(LT(e,s),St(i,"chatNotification",s),!kT())return;let o=`${e}:${r}`;n-(CO[o]||0)<M4||(CO[o]=n,IT(s))}Nt();Sl();ys();lt();mn();function MO(){return{mode:ph(),active:uh(),presets:Object.keys(Y.sleepInhibit?.presets||{})}}function PO(r,e){ee(e,MO())}async function IO(r,e){let t=await It(r,e);if(!t)return;let n=Yo(t.mode);aw({sleepInhibitMode:n});let i=MO();wt("sleepInhibit",i),ee(e,i)}Nt();async function NO(r,e){try{let t=await Dl();ee(e,{sessions:t})}catch(t){ce(e,500,t.message)}}async function LO(r,e){let t=await It(r,e);if(t){if(!t.sessionId)return ce(e,400,"sessionId required");try{await mi(t.sessionId),ee(e)}catch(n){ce(e,500,n.message)}}}var Rn=J(require("os"),1);lt();Nt();function P4(){let r=HS();if(!r?.activeClients)return{total:0,streaming:0};let e=0;for(let t of r.activeClients.values())t.isStreaming&&e++;return{total:r.activeClients.size,streaming:e}}function I4(){let r=process.memoryUsage(),e=Rn.default.cpus();return{agent:{pid:process.pid,version:"2.0.68",nodeVersion:process.version,platform:`${process.platform}/${process.arch}`,uptimeSec:Math.round(process.uptime()),memory:{heapUsedMB:Math.round(r.heapUsed/1048576*10)/10,heapTotalMB:Math.round(r.heapTotal/1048576*10)/10,rssMB:Math.round(r.rss/1048576*10)/10,externalMB:Math.round(r.external/1048576*10)/10}},os:{hostname:Rn.default.hostname(),platform:Rn.default.platform(),arch:Rn.default.arch(),uptimeSec:Math.round(Rn.default.uptime()),loadAvg:Rn.default.loadavg(),cpuModel:e?.[0]?.model||"unknown",cpuCount:e.length,totalMemMB:Math.round(Rn.default.totalmem()/1048576),freeMemMB:Math.round(Rn.default.freemem()/1048576)},remote:{available:Ul(),...P4(),memoryWarningThresholdMB:Y.resourceManagement.memoryWarningThreshold},timestamp:Date.now()}}function DO(r,e){try{ee(e,I4())}catch(t){ce(e,500,"stats error",t.message)}}Sl();ys();lt();Wv();var Kn=On("server"),Yn=(0,$O.fileURLToPath)(new URL(".",__importMetaUrl)),HO=process.env.NODE_ENV==="development",N4=5173,sv=(0,Pi.existsSync)((0,tr.join)(Yn,"ui","dist"))?(0,tr.join)(Yn,"ui","dist"):(0,tr.join)(Yn,"ui"),L4={".html":"text/html",".js":"application/javascript",".css":"text/css",".svg":"image/svg+xml",".png":"image/png",".ico":"image/x-icon",".woff2":"font/woff2",".woff":"font/woff"};function D4(r,e,t){let n=(0,sp.request)({hostname:"localhost",port:N4,path:r.url,method:r.method,headers:r.headers},i=>{e.writeHead(i.statusCode,i.headers),i.pipe(e)});n.on("error",()=>t?t():void(e.writeHead(502),e.end("Vite dev server not ready"))),r.pipe(n)}function BO(r,e){if(!(0,Pi.existsSync)(e))return!1;let t=L4[(0,tr.extname)(e)]||"application/octet-stream";return r.setHeader("Content-Type",t),r.writeHead(200),r.end((0,Pi.readFileSync)(e)),!0}async function ov(r){try{let e=await po(Pp);if(!e.ok)return;let{version:t}=await e.json();t&&cO(r,t)&&(Ow({version:t}),wt("updateAvailable",{version:t}),XT())}catch{}}var jO=0;function B4(r){let e=Date.now();e-jO<ja.connectCheckDebounceMs||(jO=e,ov(r))}function j4(r,e){if(process.env.CODESPACES!=="true"){ce(e,400,"Not running on Codespaces");return}let t=process.env.CODESPACE_NAME;if(!t){ce(e,400,"Codespace name not found");return}let n=Oa();n&&n.emit("codespace:stopping"),ee(e,{success:!0,message:"Stopping codespace..."}),setTimeout(()=>(0,op.execFile)("gh",["codespace","stop","-c",t],{windowsHide:!0}),500)}var UO;async function FO(r,e,{pathname:t}){let n=r.headers.authorization;if(!n||!n.startsWith("Bearer ")||!np(n.slice(7))){ce(e,401,"Unauthorized");return}let{parseJsonBody:i}=await Promise.resolve().then(()=>(Nt(),Li)),s=await i(r,e);if(s){if(!s.port){ce(e,400,"Port required");return}t.endsWith("start")?Gk(s.port):zk(s.port),ee(e,{success:!0})}}function F4(r,e,{pathname:t,search:n}){let i=t.match(/^\/proxy\/(\d+)(\/.*)?$/);i?Kk(UO,r,e,i[1],i[2]||"/",n):ce(e,404,"Not found")}var $4=[{path:"/api/health",method:"GET",public:!0,handler:(r,e)=>ee(e,{status:"ok",timestamp:Date.now()})},{path:"/api/version",method:"GET",public:!0,handler:(r,e)=>{ee(e,{version:"2.0.68"})}},{path:"/api/notify",method:"POST",public:!0,handler:RO},{path:"/api/notify",method:"GET",public:!0,handler:kO},{path:"/proxy/*",method:"*",public:!0,handler:F4},{path:"/api/ui/events",method:"GET",handler:Bw},{path:"/api/local-token",method:"GET",handler:Iw},{path:"/api/ui/state",method:"GET",handler:jw},{path:"/api/ui/state",method:"POST",handler:Fw},{path:"/api/ui/stop",method:"POST",handler:$w},{path:"/api/ui/start",method:"POST",handler:Hw},{path:"/api/ui/stop-tunnel",method:"POST",handler:Uw},{path:"/api/ui/shutdown",method:"POST",handler:qw},{path:"/api/update",method:"POST",handler:Ww},{path:"/api/system/stats",method:"GET",handler:DO},{path:"/api/key/one-time",method:"POST",handler:fO},{path:"/api/key/regenerate",method:"POST",handler:dO},{path:"/api/device/approve",method:"POST",handler:hO},{path:"/api/device/reject",method:"POST",handler:mO},{path:"/api/device/pending",method:"GET",handler:gO},{path:"/api/device/approved",method:"GET",handler:vO},{path:"/api/device/rejected",method:"GET",handler:xO},{path:"/api/device/approve-rejected",method:"POST",handler:yO},{path:"/api/device/clear-rejected",method:"POST",handler:_O},{path:"/api/device/remove",method:"POST",handler:bO},{path:"/api/device/label",method:"POST",handler:EO},{path:"/api/device/disconnect",method:"POST",handler:wO},{path:"/api/device/auto-approve",method:"GET",handler:SO},{path:"/api/device/auto-approve",method:"POST",handler:TO},{path:"/api/connections",method:"GET",handler:Gw},{path:"/api/logs",method:"GET",handler:zw},{path:"/api/permissions",method:"GET",handler:Kw},{path:"/api/permissions/request",method:"POST",handler:Jw},{path:"/api/desktop/toggle",method:"POST",handler:Vw},{path:"/api/autostart",method:"GET",handler:Yw},{path:"/api/autostart",method:"POST",handler:Xw},{path:"/api/sleep-inhibit",method:"GET",handler:PO},{path:"/api/sleep-inhibit",method:"POST",handler:IO},{path:"/api/sessions",method:"GET",handler:NO},{path:"/api/sessions/delete",method:"POST",handler:LO},{path:"/api/local-sites",method:"*",public:!0,handler:nO},{path:"/api/codespace/stop",method:"POST",handler:j4},{path:"/api/proxy/start",method:"POST",public:!0,handler:FO},{path:"/api/proxy/end",method:"POST",public:!0,handler:FO}];var H4=parseInt(process.env.PORT||"2208",10),$a=null;function U4(){if(!HO)return;let r=(0,tr.join)(Yn,"vite.config.js");if(!(0,Pi.existsSync)(r))return;let e=(0,Pi.existsSync)((0,tr.join)(Yn,"node_modules",".bin","vite"))?(0,tr.join)(Yn,"node_modules",".bin","vite"):(0,tr.join)(Yn,"..","node_modules",".bin","vite");$a=(0,op.spawn)("node",[e,"--config",r],{cwd:Yn,stdio:"ignore",detached:!1}),$a.on("error",()=>{}),$a.unref()}async function qO(){let r=th(),e=r.sleepInhibitMode;e||(r.sleepInhibit===!1?e="never":e=Y.sleepInhibit?.defaultMode||"never"),Yo(e),await YT(),UO=Vk(),U4();let n=Op($4,{fallback:(a,c,{pathname:u})=>{if(u.startsWith("/api/")||u.startsWith("/socket.io")){ce(c,404,"Not found");return}let p=!!a.headers["cf-connecting-ip"],f=a.socket.remoteAddress==="127.0.0.1"||a.socket.remoteAddress==="::1";if(p||!f){ce(c,403,"Forbidden");return}let m=()=>{let y=u==="/"||u===""?(0,tr.join)(sv,"index.html"):(0,tr.join)(sv,u);BO(c,y)||BO(c,(0,tr.join)(sv,"index.html"))};if(HO){D4(a,c,m);return}m()}}),i=(0,sp.createServer)(async(a,c)=>{ak(c),!ck(a,c)&&await n(a,c)});Xd(),Tw(),Cw(),Cl(),process.platform==="darwin"&&setInterval(Cl,Bv),await ok(i),i.listen(H4,a=>{if(a)throw a;let c="2.0.68";ov(c),setInterval(()=>ov(c),ja.checkIntervalMs),QT(()=>B4(c))});let s=!1,o=async a=>{if(s)return;s=!0,lh(),Kn.info(`\u{1F6D1} Received ${a}, shutting down gracefully...`);let c=setTimeout(()=>{Kn.error("\u26A0\uFE0F Forced exit"),process.exit(1)},5e3);try{if(i.close(()=>Kn.info("\u2713 HTTP server closed")),$a)try{$a.kill()}catch{}let u=Oa();u&&(u.emit("server:shutdown"),u.close(()=>Kn.info("\u2713 Socket.IO closed"))),await new Promise(p=>setTimeout(p,500)),clearTimeout(c),Kn.info("\u2705 Server stopped cleanly"),process.exit(0)}catch(u){Kn.error(`\u274C Error during shutdown: ${u?.message||u}`),clearTimeout(c),process.exit(1)}};return process.on("SIGINT",()=>o("SIGINT")),process.on("SIGTERM",()=>o("SIGTERM")),process.platform==="win32"&&process.on("SIGBREAK",()=>o("SIGBREAK")),process.on("uncaughtException",a=>{Kn.error(`\u26A0\uFE0F uncaughtException: ${a?.stack||a}`)}),process.on("unhandledRejection",a=>{Kn.error(`\u26A0\uFE0F unhandledRejection: ${a?.stack||a}`)}),i}qO();0&&(module.exports={startServer});
289
+ `);return}e._proxyTargetPort=n,e.url=s+(i||""),r.web(e,t,{target:`http://localhost:${n}`,changeOrigin:!0},o=>{t.writeHead(502),t.end(`Bad Gateway: ${o.message}`)})}var pO=J(require("http"),1),fO=J(require("https"),1),dO=require("child_process"),hO=require("util"),a6=(0,hO.promisify)(dO.exec);async function c6(){let r=process.platform,e=new Set([80,443]);try{let t;if(r==="win32")t="netstat -ano | findstr LISTENING";else{let i="/dev/null";t=`lsof -iTCP -sTCP:LISTEN -P -n 2>${i} || netstat -tlnp 2>${i}`}let{stdout:n}=await a6(t),s=n.split(`
290
+ `);for(let i of s){let o=i.match(/[:\*\]](\d{2,5})(?:\s|$)/g);if(o)for(let a of o){let c=parseInt(a.replace(/[:\*\]\s]/g,""),10);c>0&&c<=65535&&(c===80||c===443||c>=1024)&&e.add(c)}}return Array.from(e)}catch(t){return console.error("Failed to get listening ports:",t.message),[80,443,3e3,3001,4200,5e3,5173,8e3,8080,9e3]}}function l6(r,e=2e3){return new Promise(t=>{let n=pO.default.request({host:"localhost",port:r,method:"GET",path:"/",timeout:e},s=>{s.on("data",()=>{}),s.on("end",()=>{}),t({active:!0,protocol:"http",status:s.statusCode})});n.on("error",s=>{t({active:!1,error:s.message})}),n.on("timeout",()=>{n.destroy(),t({active:!1,error:"timeout"})}),n.end()})}function u6(r,e=2e3){return new Promise(t=>{let n=fO.default.request({host:"localhost",port:r,method:"GET",path:"/",timeout:e,rejectUnauthorized:!1},s=>{s.on("data",()=>{}),s.on("end",()=>{}),t({active:!0,protocol:"https",status:s.statusCode})});n.on("error",s=>{t({active:!1,error:s.message})}),n.on("timeout",()=>{n.destroy(),t({active:!1,error:"timeout"})}),n.end()})}async function p6(r){let[e,t]=await Promise.all([l6(r),u6(r)]);return t.active?{port:r,...t}:e.active?{port:r,...e}:{port:r,active:!1}}async function mO(){let r=await c6();return(await Promise.all(r.map(t=>p6(t)))).filter(t=>t.active).map(t=>({port:t.port,protocol:t.protocol,url:`${t.protocol}://localhost:${t.port}`,name:`localhost:${t.port}`,status:t.status})).sort((t,n)=>t.port-n.port)}var gO=J(require("crypto"),1),f6=process.env.API_KEY_SECRET||"9remote-api-key-secret";function d6(){let r="abcdefghijklmnopqrstuvwxyz0123456789",e="";for(let t=0;t<4;t++)e+=r.charAt(Math.floor(Math.random()*r.length));return e}function vO(r,e){return gO.default.createHmac("sha256",f6).update(r+e).digest("hex").slice(0,6)}function yO(r){let e=r.slice(0,8),t=d6(),n=vO(e,t);return{key:`sk-${e}-${t}-${n}`,keyId:t}}function h6(r){if(!r||!r.startsWith("sk-"))return null;let e=r.split("-");if(e.length===4){let[,t,n,s]=e,i=vO(t,n);return s!==i?null:{machineId:t,keyId:n}}return null}function cp(r){return h6(r)!==null}async function xO(r,e){let t=r.headers.authorization;if(!t||!t.startsWith("Bearer ")){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Missing API key"}));return}let n=t.slice(7);if(!cp(n)){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Invalid API key"}));return}let s=await mO();e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify(s))}gl();var wO=require("url");var lp=J(require("path"),1),SO=J(require("os"),1);_t();var _O=J(require("path"),1),bO=J(require("os"),1);var l5=_O.default.join(bO.default.homedir(),".9remote","pids");uh();var Ua={checkIntervalMs:36e5,connectCheckDebounceMs:9e5,maxRetry:3,retryDelayMs:3e3,verifyTimeoutMs:15e3,lockTtlMs:3e5,lockFile:"update.lock"};var f5={orange:po.rgb(230,138,110),orangeDim:po.rgb(200,120,95)};var _5=lp.default.dirname((0,wO.fileURLToPath)(__importMetaUrl));var b5=lp.default.join(SO.default.homedir(),".9remote","cloudflared.pid");function EO(r,e){let t=r.split(".").map(Number),n=e.split(".").map(Number);for(let s=0;s<3;s++){if(n[s]>t[s])return!0;if(n[s]<t[s])return!1}return!1}var w5=lp.default.join(oe.STATE,Ua.lockFile);xn();jt();_t();Si();var CO=J(TO(),1),pv=J(require("crypto"),1),{machineIdSync:m6}=CO.default;async function AO(r=null){let e=r||process.env.MACHINE_ID_SALT||"9remote-salt";try{let t=m6();return pv.default.createHash("sha256").update(t+e).digest("hex").substring(0,16)}catch(t){return console.error("Error getting machine ID:",t),pv.default.randomUUID().replace(/-/g,"").substring(0,16)}}xn();async function RO(r,e){let t=Nw(),n=t.workerUrl||"https://9remote.cc";if(!t.permanentKey){le(e,400,"No permanent key set");return}try{let i=await(await go(`${n}/api/temp-key/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t.permanentKey,expiryMinutes:30})})).json(),o=`${n}/login?k=${i.tempKey}`;yn({oneTimeKey:i.tempKey,oneTimeKeyExpiresAt:i.expiresAt,qrUrl:o}),ee(e,{oneTimeKey:i.tempKey,expiresAt:i.expiresAt,qrUrl:o})}catch(s){le(e,500,s.message)}}async function kO(r,e){try{let t=await AO(),{key:n}=yO(t),s=mw();gw(t,n,s?.name||"Default"),yn({permanentKey:n}),ee(e,{ok:!0,permanentKey:n})}catch(t){le(e,500,t.message)}}jt();async function OO(r,e){let t=await Bt(r,e);if(!t)return;let n=xk(t.socketId);ee(e,{ok:n})}async function MO(r,e){let t=await Bt(r,e);if(!t)return;let n=bk(t.socketId);ee(e,{ok:n})}function PO(r,e){ee(e,{pending:uk()})}function IO(r,e){ee(e,{devices:ak()})}function NO(r,e){ee(e,{rejected:hk()})}async function LO(r,e){let t=await Bt(r,e);if(!t)return;let n=_k(t.deviceId);ee(e,{ok:n})}async function DO(r,e){let t=await Bt(r,e);t&&(np(t.deviceId),oo(t.deviceId),ee(e))}async function BO(r,e){let t=await Bt(r,e);t&&(np(t.deviceId),ik(t.deviceId),ee(e))}async function jO(r,e){let t=await Bt(r,e);if(!t)return;let n=np(t.deviceId);ee(e,{disconnected:n})}function FO(r,e){ee(e,{enabled:rp()})}async function HO(r,e){let t=await Bt(r,e);if(!t)return;let n=ok(t.deviceId,t.label);ee(e,{ok:n})}async function $O(r,e){let t=await Bt(r,e);if(!t)return;let n=gk(!!t.enabled);ee(e,{enabled:n})}jt();vs();var UO={},g6=1e4;function qO(r,e){if(e)return{type:e.type||"stop",sessionId:e.sessionId||"",tool:e.tool||"claude"};let t=JSON.parse(r||"{}");return{type:t.type||"stop",sessionId:t.sessionId||"",tool:t.tool||"claude"}}async function WO(r,e){let t="";await new Promise(n=>{r.on("data",s=>t+=s),r.on("end",n)});try{zO(qO(t,null)),ee(e,{success:!0})}catch{le(e,400,"Invalid JSON")}}function GO(r,e,{query:t}){zO(qO(null,t)),ee(e,{success:!0})}function zO({type:r,sessionId:e,tool:t}){let n=Date.now(),s=Na();if(!s||!e)return;let i={type:r,sessionId:e,tool:t,timestamp:n};if(UT(e,i),bt(s,"chatNotification",i),!DT())return;let o=`${e}:${r}`;n-(UO[o]||0)<g6||(UO[o]=n,HT(i))}jt();Al();Si();ft();xn();function VO(){return{mode:gh(),active:mh(),presets:Object.keys(Y.sleepInhibit?.presets||{})}}function KO(r,e){ee(e,VO())}async function YO(r,e){let t=await Bt(r,e);if(!t)return;let n=Zo(t.mode);hw({sleepInhibitMode:n});let s=VO();Tt("sleepInhibit",s),ee(e,s)}jt();async function XO(r,e){try{let t=await Hl();ee(e,{sessions:t})}catch(t){le(e,500,t.message)}}async function JO(r,e){let t=await Bt(r,e);if(t){if(!t.sessionId)return le(e,400,"sessionId required");try{await ys(t.sessionId),ee(e)}catch(n){le(e,500,n.message)}}}var Mn=J(require("os"),1);ft();jt();function v6(){let r=KS();if(!r?.activeClients)return{total:0,streaming:0};let e=0;for(let t of r.activeClients.values())t.isStreaming&&e++;return{total:r.activeClients.size,streaming:e}}function y6(){let r=process.memoryUsage(),e=Mn.default.cpus();return{agent:{pid:process.pid,version:"2.0.70",nodeVersion:process.version,platform:`${process.platform}/${process.arch}`,uptimeSec:Math.round(process.uptime()),memory:{heapUsedMB:Math.round(r.heapUsed/1048576*10)/10,heapTotalMB:Math.round(r.heapTotal/1048576*10)/10,rssMB:Math.round(r.rss/1048576*10)/10,externalMB:Math.round(r.external/1048576*10)/10}},os:{hostname:Mn.default.hostname(),platform:Mn.default.platform(),arch:Mn.default.arch(),uptimeSec:Math.round(Mn.default.uptime()),loadAvg:Mn.default.loadavg(),cpuModel:e?.[0]?.model||"unknown",cpuCount:e.length,totalMemMB:Math.round(Mn.default.totalmem()/1048576),freeMemMB:Math.round(Mn.default.freemem()/1048576)},remote:{available:zl(),...v6(),memoryWarningThresholdMB:Y.resourceManagement.memoryWarningThreshold},timestamp:Date.now()}}function QO(r,e){try{ee(e,y6())}catch(t){le(e,500,"stats error",t.message)}}Al();Si();ft();Jv();var Jn=In("server"),Qn=(0,rM.fileURLToPath)(new URL(".",__importMetaUrl)),nM=process.env.NODE_ENV==="development",x6=5173,fv=(0,Ds.existsSync)((0,sr.join)(Qn,"ui","dist"))?(0,sr.join)(Qn,"ui","dist"):(0,sr.join)(Qn,"ui"),_6={".html":"text/html",".js":"application/javascript",".css":"text/css",".svg":"image/svg+xml",".png":"image/png",".ico":"image/x-icon",".woff2":"font/woff2",".woff":"font/woff"};function b6(r,e,t){let n=(0,up.request)({hostname:"localhost",port:x6,path:r.url,method:r.method,headers:r.headers},s=>{e.writeHead(s.statusCode,s.headers),s.pipe(e)});n.on("error",()=>t?t():void(e.writeHead(502),e.end("Vite dev server not ready"))),r.pipe(n)}function ZO(r,e){if(!(0,Ds.existsSync)(e))return!1;let t=_6[(0,sr.extname)(e)]||"application/octet-stream";return r.setHeader("Content-Type",t),r.writeHead(200),r.end((0,Ds.readFileSync)(e)),!0}async function dv(r){try{let e=await go(Bp);if(!e.ok)return;let{version:t}=await e.json();t&&EO(r,t)&&(Bw({version:t}),Tt("updateAvailable",{version:t}),fC())}catch{}}var eM=0;function w6(r){let e=Date.now();e-eM<Ua.connectCheckDebounceMs||(eM=e,dv(r))}function S6(r,e){if(process.env.CODESPACES!=="true"){le(e,400,"Not running on Codespaces");return}let t=process.env.CODESPACE_NAME;if(!t){le(e,400,"Codespace name not found");return}let n=Na();n&&n.emit("codespace:stopping"),ee(e,{success:!0,message:"Stopping codespace..."}),setTimeout(()=>(0,pp.execFile)("gh",["codespace","stop","-c",t],{windowsHide:!0}),500)}var sM;async function tM(r,e,{pathname:t}){let n=r.headers.authorization;if(!n||!n.startsWith("Bearer ")||!cp(n.slice(7))){le(e,401,"Unauthorized");return}let{parseJsonBody:s}=await Promise.resolve().then(()=>(jt(),Fs)),i=await s(r,e);if(i){if(!i.port){le(e,400,"Port required");return}t.endsWith("start")?aO(i.port):cO(i.port),ee(e,{success:!0})}}function E6(r,e,{pathname:t,search:n}){let s=t.match(/^\/proxy\/(\d+)(\/.*)?$/);s?uO(sM,r,e,s[1],s[2]||"/",n):le(e,404,"Not found")}var T6=[{path:"/api/health",method:"GET",public:!0,handler:(r,e)=>ee(e,{status:"ok",timestamp:Date.now()})},{path:"/api/version",method:"GET",public:!0,handler:(r,e)=>{ee(e,{version:"2.0.70"})}},{path:"/api/notify",method:"POST",public:!0,handler:WO},{path:"/api/notify",method:"GET",public:!0,handler:GO},{path:"/proxy/*",method:"*",public:!0,handler:E6},{path:"/api/ui/events",method:"GET",handler:Ww},{path:"/api/local-token",method:"GET",handler:Hw},{path:"/api/ui/state",method:"GET",handler:Gw},{path:"/api/ui/state",method:"POST",handler:zw},{path:"/api/ui/stop",method:"POST",handler:Vw},{path:"/api/ui/start",method:"POST",handler:Kw},{path:"/api/ui/stop-tunnel",method:"POST",handler:Yw},{path:"/api/ui/shutdown",method:"POST",handler:Xw},{path:"/api/update",method:"POST",handler:Jw},{path:"/api/system/stats",method:"GET",handler:QO},{path:"/api/key/one-time",method:"POST",handler:RO},{path:"/api/key/regenerate",method:"POST",handler:kO},{path:"/api/device/approve",method:"POST",handler:OO},{path:"/api/device/reject",method:"POST",handler:MO},{path:"/api/device/pending",method:"GET",handler:PO},{path:"/api/device/approved",method:"GET",handler:IO},{path:"/api/device/rejected",method:"GET",handler:NO},{path:"/api/device/approve-rejected",method:"POST",handler:LO},{path:"/api/device/clear-rejected",method:"POST",handler:DO},{path:"/api/device/remove",method:"POST",handler:BO},{path:"/api/device/label",method:"POST",handler:HO},{path:"/api/device/disconnect",method:"POST",handler:jO},{path:"/api/device/auto-approve",method:"GET",handler:FO},{path:"/api/device/auto-approve",method:"POST",handler:$O},{path:"/api/connections",method:"GET",handler:Qw},{path:"/api/logs",method:"GET",handler:Zw},{path:"/api/permissions",method:"GET",handler:tS},{path:"/api/permissions/request",method:"POST",handler:sS},{path:"/api/desktop/toggle",method:"POST",handler:eS},{path:"/api/autostart",method:"GET",handler:rS},{path:"/api/autostart",method:"POST",handler:nS},{path:"/api/sleep-inhibit",method:"GET",handler:KO},{path:"/api/sleep-inhibit",method:"POST",handler:YO},{path:"/api/sessions",method:"GET",handler:XO},{path:"/api/sessions/delete",method:"POST",handler:JO},{path:"/api/local-sites",method:"*",public:!0,handler:xO},{path:"/api/codespace/stop",method:"POST",handler:S6},{path:"/api/proxy/start",method:"POST",public:!0,handler:tM},{path:"/api/proxy/end",method:"POST",public:!0,handler:tM}];var C6=parseInt(process.env.PORT||"2208",10),Wa=null;function A6(){if(!nM)return;let r=(0,sr.join)(Qn,"vite.config.js");if(!(0,Ds.existsSync)(r))return;let e=(0,Ds.existsSync)((0,sr.join)(Qn,"node_modules",".bin","vite"))?(0,sr.join)(Qn,"node_modules",".bin","vite"):(0,sr.join)(Qn,"..","node_modules",".bin","vite");Wa=(0,pp.spawn)("node",[e,"--config",r],{cwd:Qn,stdio:"ignore",detached:!1}),Wa.on("error",()=>{}),Wa.unref()}async function iM(){let r=oh(),e=r.sleepInhibitMode;e||(r.sleepInhibit===!1?e="never":e=Y.sleepInhibit?.defaultMode||"never"),Zo(e),await pC(),sM=lO(),A6();let n=Lp(T6,{fallback:(a,c,{pathname:l})=>{if(l.startsWith("/api/")||l.startsWith("/socket.io")){le(c,404,"Not found");return}let p=!!a.headers["cf-connecting-ip"],f=a.socket.remoteAddress==="127.0.0.1"||a.socket.remoteAddress==="::1";if(p||!f){le(c,403,"Forbidden");return}let h=()=>{let x=l==="/"||l===""?(0,sr.join)(fv,"index.html"):(0,sr.join)(fv,l);ZO(c,x)||ZO(c,(0,sr.join)(fv,"index.html"))};if(nM){b6(a,c,h);return}h()}}),s=(0,up.createServer)(async(a,c)=>{Sk(c),!Ek(a,c)&&await n(a,c)});th(),Pw(),Iw(),Ol(),process.platform==="darwin"&&setInterval(Ol,Wv),await wk(s),s.listen(C6,a=>{if(a)throw a;let c="2.0.70";dv(c),setInterval(()=>dv(c),Ua.checkIntervalMs),hC(()=>w6(c))});let i=!1,o=async a=>{if(i)return;i=!0,hh(),Jn.info(`\u{1F6D1} Received ${a}, shutting down gracefully...`);let c=setTimeout(()=>{Jn.error("\u26A0\uFE0F Forced exit"),process.exit(1)},5e3);try{if(s.close(()=>Jn.info("\u2713 HTTP server closed")),Wa)try{Wa.kill()}catch{}let l=Na();l&&(l.emit("server:shutdown"),l.close(()=>Jn.info("\u2713 Socket.IO closed"))),await new Promise(p=>setTimeout(p,500)),clearTimeout(c),Jn.info("\u2705 Server stopped cleanly"),process.exit(0)}catch(l){Jn.error(`\u274C Error during shutdown: ${l?.message||l}`),clearTimeout(c),process.exit(1)}};return process.on("SIGINT",()=>o("SIGINT")),process.on("SIGTERM",()=>o("SIGTERM")),process.platform==="win32"&&process.on("SIGBREAK",()=>o("SIGBREAK")),process.on("uncaughtException",a=>{Jn.error(`\u26A0\uFE0F uncaughtException: ${a?.stack||a}`)}),process.on("unhandledRejection",a=>{Jn.error(`\u26A0\uFE0F unhandledRejection: ${a?.stack||a}`)}),s}iM();0&&(module.exports={startServer});
266
291
  /*! Bundled license information:
267
292
 
268
293
  negotiator/index.js: