9remote 0.1.44 → 0.1.45

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,48 +1,48 @@
1
1
  const __importMetaUrl = require('url').pathToFileURL(__filename).href;
2
- var Fx=Object.create;var Ts=Object.defineProperty;var Ux=Object.getOwnPropertyDescriptor;var Hx=Object.getOwnPropertyNames;var zx=Object.getPrototypeOf,$x=Object.prototype.hasOwnProperty;var yi=(i,e)=>()=>(i&&(e=i(i=0)),e);var C=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),bi=(i,e)=>{for(var t in e)Ts(i,t,{get:e[t],enumerable:!0})},Nu=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Hx(e))!$x.call(i,s)&&s!==t&&Ts(i,s,{get:()=>e[s],enumerable:!(n=Ux(e,s))||n.enumerable});return i};var L=(i,e,t)=>(t=i!=null?Fx(zx(i)):{},Nu(e||!i||!i.__esModule?Ts(t,"default",{value:i,enumerable:!0}):t,i)),Wx=i=>Nu(Ts({},"__esModule",{value:!0}),i);var Lu=C((v2,Qo)=>{"use strict";Qo.exports=qu;Qo.exports.preferredCharsets=qu;var Vx=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function Kx(i){for(var e=i.split(","),t=0,n=0;t<e.length;t++){var s=Gx(e[t].trim(),t);s&&(e[n++]=s)}return e.length=n,e}function Gx(i,e){var t=Vx.exec(i);if(!t)return null;var n=t[1],s=1;if(t[2])for(var r=t[2].split(";"),o=0;o<r.length;o++){var a=r[o].trim().split("=");if(a[0]==="q"){s=parseFloat(a[1]);break}}return{charset:n,q:s,i:e}}function Yx(i,e,t){for(var n={o:-1,q:0,s:0},s=0;s<e.length;s++){var r=Jx(i,e[s],t);r&&(n.s-r.s||n.q-r.q||n.o-r.o)<0&&(n=r)}return n}function Jx(i,e,t){var n=0;if(e.charset.toLowerCase()===i.toLowerCase())n|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function qu(i,e){var t=Kx(i===void 0?"*":i||"");if(!e)return t.filter(Du).sort(Iu).map(Xx);var n=e.map(function(r,o){return Yx(r,t,o)});return n.filter(Du).sort(Iu).map(function(r){return e[n.indexOf(r)]})}function Iu(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function Xx(i){return i.charset}function Du(i){return i.q>0}});var $u=C((g2,ea)=>{"use strict";ea.exports=zu;ea.exports.preferredEncodings=zu;var Zx=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function Qx(i){for(var e=i.split(","),t=!1,n=1,s=0,r=0;s<e.length;s++){var o=ey(e[s].trim(),s);o&&(e[r++]=o,t=t||Hu("identity",o),n=Math.min(n,o.q||1))}return t||(e[r++]={encoding:"identity",q:n,i:s}),e.length=r,e}function ey(i,e){var t=Zx.exec(i);if(!t)return null;var n=t[1],s=1;if(t[2])for(var r=t[2].split(";"),o=0;o<r.length;o++){var a=r[o].trim().split("=");if(a[0]==="q"){s=parseFloat(a[1]);break}}return{encoding:n,q:s,i:e}}function ty(i,e,t){for(var n={o:-1,q:0,s:0},s=0;s<e.length;s++){var r=Hu(i,e[s],t);r&&(n.s-r.s||n.q-r.q||n.o-r.o)<0&&(n=r)}return n}function Hu(i,e,t){var n=0;if(e.encoding.toLowerCase()===i.toLowerCase())n|=1;else if(e.encoding!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function zu(i,e){var t=Qx(i||"");if(!e)return t.filter(Uu).sort(Fu).map(iy);var n=e.map(function(r,o){return ty(r,t,o)});return n.filter(Uu).sort(Fu).map(function(r){return e[n.indexOf(r)]})}function Fu(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function iy(i){return i.encoding}function Uu(i){return i.q>0}});var Yu=C((x2,ta)=>{"use strict";ta.exports=Gu;ta.exports.preferredLanguages=Gu;var ny=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function sy(i){for(var e=i.split(","),t=0,n=0;t<e.length;t++){var s=Ku(e[t].trim(),t);s&&(e[n++]=s)}return e.length=n,e}function Ku(i,e){var t=ny.exec(i);if(!t)return null;var n=t[1],s=t[2],r=n;s&&(r+="-"+s);var o=1;if(t[3])for(var a=t[3].split(";"),l=0;l<a.length;l++){var p=a[l].split("=");p[0]==="q"&&(o=parseFloat(p[1]))}return{prefix:n,suffix:s,q:o,i:e,full:r}}function ry(i,e,t){for(var n={o:-1,q:0,s:0},s=0;s<e.length;s++){var r=oy(i,e[s],t);r&&(n.s-r.s||n.q-r.q||n.o-r.o)<0&&(n=r)}return n}function oy(i,e,t){var n=Ku(i);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 Gu(i,e){var t=sy(i===void 0?"*":i||"");if(!e)return t.filter(Vu).sort(Wu).map(ay);var n=e.map(function(r,o){return ry(r,t,o)});return n.filter(Vu).sort(Wu).map(function(r){return e[n.indexOf(r)]})}function Wu(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function ay(i){return i.full}function Vu(i){return i.q>0}});var tp=C((y2,ia)=>{"use strict";ia.exports=Qu;ia.exports.preferredMediaTypes=Qu;var cy=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function ly(i){for(var e=hy(i),t=0,n=0;t<e.length;t++){var s=Zu(e[t].trim(),t);s&&(e[n++]=s)}return e.length=n,e}function Zu(i,e){var t=cy.exec(i);if(!t)return null;var n=Object.create(null),s=1,r=t[2],o=t[1];if(t[3])for(var a=my(t[3]).map(fy),l=0;l<a.length;l++){var p=a[l],f=p[0].toLowerCase(),m=p[1],_=m&&m[0]==='"'&&m[m.length-1]==='"'?m.substr(1,m.length-2):m;if(f==="q"){s=parseFloat(_);break}n[f]=_}return{type:o,subtype:r,params:n,q:s,i:e}}function uy(i,e,t){for(var n={o:-1,q:0,s:0},s=0;s<e.length;s++){var r=py(i,e[s],t);r&&(n.s-r.s||n.q-r.q||n.o-r.o)<0&&(n=r)}return n}function py(i,e,t){var n=Zu(i),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 r=Object.keys(e.params);if(r.length>0)if(r.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 Qu(i,e){var t=ly(i===void 0?"*/*":i||"");if(!e)return t.filter(Xu).sort(Ju).map(dy);var n=e.map(function(r,o){return uy(r,t,o)});return n.filter(Xu).sort(Ju).map(function(r){return e[n.indexOf(r)]})}function Ju(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function dy(i){return i.type+"/"+i.subtype}function Xu(i){return i.q>0}function ep(i){for(var e=0,t=0;(t=i.indexOf('"',t))!==-1;)e++,t++;return e}function fy(i){var e=i.indexOf("="),t,n;return e===-1?t=i:(t=i.substr(0,e),n=i.substr(e+1)),[t,n]}function hy(i){for(var e=i.split(","),t=1,n=0;t<e.length;t++)ep(e[n])%2==0?e[++n]=e[t]:e[n]+=","+e[t];return e.length=n+1,e}function my(i){for(var e=i.split(";"),t=1,n=0;t<e.length;t++)ep(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 ip=C((b2,na)=>{"use strict";var vy=Lu(),gy=$u(),xy=Yu(),yy=tp();na.exports=$;na.exports.Negotiator=$;function $(i){if(!(this instanceof $))return new $(i);this.request=i}$.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};$.prototype.charsets=function(e){return vy(this.request.headers["accept-charset"],e)};$.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};$.prototype.encodings=function(e){return gy(this.request.headers["accept-encoding"],e)};$.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};$.prototype.languages=function(e){return xy(this.request.headers["accept-language"],e)};$.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};$.prototype.mediaTypes=function(e){return yy(this.request.headers.accept,e)};$.prototype.preferredCharset=$.prototype.charset;$.prototype.preferredCharsets=$.prototype.charsets;$.prototype.preferredEncoding=$.prototype.encoding;$.prototype.preferredEncodings=$.prototype.encodings;$.prototype.preferredLanguage=$.prototype.language;$.prototype.preferredLanguages=$.prototype.languages;$.prototype.preferredMediaType=$.prototype.mediaType;$.prototype.preferredMediaTypes=$.prototype.mediaTypes});var np=C((w2,by)=>{by.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 rp=C((_2,sp)=>{sp.exports=np()});var cp=C(it=>{"use strict";var Ms=rp(),wy=require("path").extname,op=/^\s*([^;\s]*)(?:;|\s|$)/,_y=/^text\//i;it.charset=ap;it.charsets={lookup:ap};it.contentType=Sy;it.extension=Ey;it.extensions=Object.create(null);it.lookup=ky;it.types=Object.create(null);Cy(it.extensions,it.types);function ap(i){if(!i||typeof i!="string")return!1;var e=op.exec(i),t=e&&Ms[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&_y.test(e[1])?"UTF-8":!1}function Sy(i){if(!i||typeof i!="string")return!1;var e=i.indexOf("/")===-1?it.lookup(i):i;if(!e)return!1;if(e.indexOf("charset")===-1){var t=it.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function Ey(i){if(!i||typeof i!="string")return!1;var e=op.exec(i),t=e&&it.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function ky(i){if(!i||typeof i!="string")return!1;var e=wy("x."+i).toLowerCase().substr(1);return e&&it.types[e]||!1}function Cy(i,e){var t=["nginx","apache",void 0,"iana"];Object.keys(Ms).forEach(function(s){var r=Ms[s],o=r.extensions;if(!(!o||!o.length)){i[s]=o;for(var a=0;a<o.length;a++){var l=o[a];if(e[l]){var p=t.indexOf(Ms[e[l]].source),f=t.indexOf(r.source);if(e[l]!=="application/octet-stream"&&(p>f||p===f&&e[l].substr(0,12)==="application/"))continue}e[l]=s}}})}});var Os=C((E2,lp)=>{"use strict";var Ty=ip(),My=cp();lp.exports=ct;function ct(i){if(!(this instanceof ct))return new ct(i);this.headers=i.headers,this.negotiator=new Ty(i)}ct.prototype.type=ct.prototype.types=function(i){var e=i;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(Oy),s=this.negotiator.mediaTypes(n.filter(Ay)),r=s[0];return r?e[n.indexOf(r)]:!1};ct.prototype.encoding=ct.prototype.encodings=function(i){var e=i;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};ct.prototype.charset=ct.prototype.charsets=function(i){var e=i;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};ct.prototype.lang=ct.prototype.langs=ct.prototype.language=ct.prototype.languages=function(i){var e=i;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 Oy(i){return i.indexOf("/")===-1?My.lookup(i):i}function Ay(i){return typeof i=="string"}});var ra=C((up,pp)=>{var zn=require("crypto"),sa=function(){};sa.prototype.getRandomBytes=function(i){var e=4096,t=this;if(i=i||12,i>e)return zn.randomBytes(i);var n=parseInt(e/i),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,zn.randomBytes(e,function(o,a){t.bytesBuffer=a,t.bytesBufferIndex=0,t.isGeneratingBytes=!1})),this.bytesBufferIndex==-1)))return zn.randomBytes(i);var r=this.bytesBuffer.slice(i*this.bytesBufferIndex,i*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,r};sa.prototype.generateId=function(){var i=Buffer.alloc(15);return i.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,i.writeInt32BE(this.sequenceNumber,11),zn.randomBytes?this.getRandomBytes(12).copy(i):[0,4,8].forEach(function(e){i.writeInt32BE(Math.random()*Math.pow(2,32)|0,e)}),i.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()};up=pp.exports=new sa});var As=C(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.ERROR_PACKET=ri.PACKET_TYPES_REVERSE=ri.PACKET_TYPES=void 0;var Dt=Object.create(null);ri.PACKET_TYPES=Dt;Dt.open="0";Dt.close="1";Dt.ping="2";Dt.pong="3";Dt.message="4";Dt.upgrade="5";Dt.noop="6";var dp=Object.create(null);ri.PACKET_TYPES_REVERSE=dp;Object.keys(Dt).forEach(i=>{dp[Dt[i]]=i});var Ry={type:"error",data:"parser error"};ri.ERROR_PACKET=Ry});var hp=C(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.encodePacket=void 0;Hi.encodePacketToBinary=jy;var Py=As(),By=({type:i,data:e},t,n)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?n(t?e:"b"+fp(e,!0).toString("base64")):n(Py.PACKET_TYPES[i]+(e||""));Hi.encodePacket=By;var fp=(i,e)=>Buffer.isBuffer(i)||i instanceof Uint8Array&&!e?i:i instanceof ArrayBuffer?Buffer.from(i):Buffer.from(i.buffer,i.byteOffset,i.byteLength),oa;function jy(i,e){if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return e(fp(i.data,!1));(0,Hi.encodePacket)(i,!0,t=>{oa||(oa=new TextEncoder),e(oa.encode(t))})}});var vp=C(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.decodePacket=void 0;var Rs=As(),Ny=(i,e)=>{if(typeof i!="string")return{type:"message",data:mp(i,e)};let t=i.charAt(0);if(t==="b"){let n=Buffer.from(i.substring(1),"base64");return{type:"message",data:mp(n,e)}}return Rs.PACKET_TYPES_REVERSE[t]?i.length>1?{type:Rs.PACKET_TYPES_REVERSE[t],data:i.substring(1)}:{type:Rs.PACKET_TYPES_REVERSE[t]}:Rs.ERROR_PACKET};Ps.decodePacket=Ny;var mp=(i,e)=>e==="arraybuffer"?i instanceof ArrayBuffer?i:Buffer.isBuffer(i)?i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength):i.buffer:Buffer.isBuffer(i)?i:Buffer.from(i)});var $n=C(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.decodePayload=nt.decodePacket=nt.encodePayload=nt.encodePacket=nt.protocol=void 0;nt.createPacketEncoderStream=qy;nt.createPacketDecoderStream=Ly;var ca=hp();Object.defineProperty(nt,"encodePacket",{enumerable:!0,get:function(){return ca.encodePacket}});var la=vp();Object.defineProperty(nt,"decodePacket",{enumerable:!0,get:function(){return la.decodePacket}});var gp=As(),xp="",Iy=(i,e)=>{let t=i.length,n=new Array(t),s=0;i.forEach((r,o)=>{(0,ca.encodePacket)(r,!1,a=>{n[o]=a,++s===t&&e(n.join(xp))})})};nt.encodePayload=Iy;var Dy=(i,e)=>{let t=i.split(xp),n=[];for(let s=0;s<t.length;s++){let r=(0,la.decodePacket)(t[s],e);if(n.push(r),r.type==="error")break}return n};nt.decodePayload=Dy;function qy(){return new TransformStream({transform(i,e){(0,ca.encodePacketToBinary)(i,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 r=new DataView(s.buffer);r.setUint8(0,126),r.setUint16(1,n)}else{s=new Uint8Array(9);let r=new DataView(s.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(n))}i.data&&typeof i.data!="string"&&(s[0]|=128),e.enqueue(s),e.enqueue(t)})}})}var aa;function Bs(i){return i.reduce((e,t)=>e+t.length,0)}function js(i,e){if(i[0].length===e)return i.shift();let t=new Uint8Array(e),n=0;for(let s=0;s<e;s++)t[s]=i[0][n++],n===i[0].length&&(i.shift(),n=0);return i.length&&n<i[0].length&&(i[0]=i[0].slice(n)),t}function Ly(i,e){aa||(aa=new TextDecoder);let t=[],n=0,s=-1,r=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(n===0){if(Bs(t)<1)break;let l=js(t,1);r=(l[0]&128)===128,s=l[0]&127,s<126?n=3:s===126?n=1:n=2}else if(n===1){if(Bs(t)<2)break;let l=js(t,2);s=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),n=3}else if(n===2){if(Bs(t)<8)break;let l=js(t,8),p=new DataView(l.buffer,l.byteOffset,l.length),f=p.getUint32(0);if(f>Math.pow(2,21)-1){a.enqueue(gp.ERROR_PACKET);break}s=f*Math.pow(2,32)+p.getUint32(4),n=3}else{if(Bs(t)<s)break;let l=js(t,s);a.enqueue((0,la.decodePacket)(r?l:aa.decode(l),e)),n=0}if(s===0||s>i){a.enqueue(gp.ERROR_PACKET);break}}}})}nt.protocol=4});var _p=C((O2,wp)=>{var oi=String.fromCharCode;function yp(i){for(var e=[],t=0,n=i.length,s,r;t<n;)s=i.charCodeAt(t++),s>=55296&&s<=56319&&t<n?(r=i.charCodeAt(t++),(r&64512)==56320?e.push(((s&1023)<<10)+(r&1023)+65536):(e.push(s),t--)):e.push(s);return e}function Fy(i){for(var e=i.length,t=-1,n,s="";++t<e;)n=i[t],n>65535&&(n-=65536,s+=oi(n>>>10&1023|55296),n=56320|n&1023),s+=oi(n);return s}function bp(i,e){if(i>=55296&&i<=57343){if(e)throw Error("Lone surrogate U+"+i.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function ua(i,e){return oi(i>>e&63|128)}function Uy(i,e){if((i&4294967168)==0)return oi(i);var t="";return(i&4294965248)==0?t=oi(i>>6&31|192):(i&4294901760)==0?(bp(i,e)||(i=65533),t=oi(i>>12&15|224),t+=ua(i,6)):(i&4292870144)==0&&(t=oi(i>>18&7|240),t+=ua(i,12),t+=ua(i,6)),t+=oi(i&63|128),t}function Hy(i,e){e=e||{};for(var t=e.strict!==!1,n=yp(i),s=n.length,r=-1,o,a="";++r<s;)o=n[r],a+=Uy(o,t);return a}function zi(){if(ai>=Is)throw Error("Invalid byte index");var i=Ns[ai]&255;if(ai++,(i&192)==128)return i&63;throw Error("Invalid continuation byte")}function zy(i){var e,t,n,s,r;if(ai>Is)throw Error("Invalid byte index");if(ai==Is)return!1;if(e=Ns[ai]&255,ai++,(e&128)==0)return e;if((e&224)==192){if(t=zi(),r=(e&31)<<6|t,r>=128)return r;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=zi(),n=zi(),r=(e&15)<<12|t<<6|n,r>=2048)return bp(r,i)?r:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=zi(),n=zi(),s=zi(),r=(e&7)<<18|t<<12|n<<6|s,r>=65536&&r<=1114111))return r;throw Error("Invalid UTF-8 detected")}var Ns,Is,ai;function $y(i,e){e=e||{};var t=e.strict!==!1;Ns=yp(i),Is=Ns.length,ai=0;for(var n=[],s;(s=zy(t))!==!1;)n.push(s);return Fy(n)}wp.exports={version:"2.1.2",encode:Hy,decode:$y}});var Ap=C(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.packets=He.protocol=void 0;He.encodePacket=pa;He.encodeBase64Packet=kp;He.decodePacket=da;He.decodeBase64Packet=Cp;He.encodePayload=Gy;He.decodePayload=Jy;He.encodePayloadAsBinary=Mp;He.decodePayloadAsBinary=Op;var Ep=_p();He.protocol=3;var Wy=i=>{for(let e of i)if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return!0;return!1};He.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var $i=Object.keys(He.packets),At={type:"error",data:"parser error"},Vy=Buffer.concat([]);function pa(i,e,t,n){if(typeof e=="function"&&(n=e,e=null),typeof t=="function"&&(n=t,t=null),Buffer.isBuffer(i.data))return Sp(i,e,n);if(i.data&&(i.data.buffer||i.data)instanceof ArrayBuffer)return Sp({type:i.type,data:fa(i.data)},e,n);var s=He.packets[i.type];return i.data!==void 0&&(s+=t?Ep.encode(String(i.data),{strict:!1}):String(i.data)),n(""+s)}function Sp(i,e,t){if(!e)return kp(i,t);var n=i.data,s=Buffer.allocUnsafe(1);return s[0]=He.packets[i.type],t(Buffer.concat([s,n]))}function kp(i,e){var t=Buffer.isBuffer(i.data)?i.data:fa(i.data),n="b"+He.packets[i.type];return n+=t.toString("base64"),e(n)}function da(i,e,t){if(i===void 0)return At;let n;if(typeof i=="string")return n=i.charAt(0),n==="b"?Cp(i.slice(1),e):t&&(i=Ky(i),i===!1)||Number(n)!=n||!$i[n]?At:i.length>1?{type:$i[n],data:i.slice(1)}:{type:$i[n]};if(e==="arraybuffer"){var s=new Uint8Array(i);return n=s[0],{type:$i[n],data:s.buffer.slice(1)}}return i instanceof ArrayBuffer&&(i=fa(i)),n=i[0],{type:$i[n],data:i.slice(1)}}function Ky(i){try{i=Ep.decode(i,{strict:!1})}catch{return!1}return i}function Cp(i,e){var t=$i[i.charAt(0)],n=Buffer.from(i.slice(1),"base64");if(e==="arraybuffer"){for(var s=new Uint8Array(n.length),r=0;r<s.length;r++)s[r]=n[r];n=s.buffer}return{type:t,data:n}}function Gy(i,e,t){if(typeof e=="function"&&(t=e,e=null),e&&Wy(i))return Mp(i,t);if(!i.length)return t("0:");function n(s,r){pa(s,e,!1,function(o){r(null,Yy(o))})}Tp(i,n,function(s,r){return t(r.join(""))})}function Yy(i){return i.length+":"+i}function Tp(i,e,t){let n=new Array(i.length),s=0;for(let r=0;r<i.length;r++)e(i[r],(o,a)=>{n[r]=a,++s===i.length&&t(null,n)})}function Jy(i,e,t){if(typeof i!="string")return Op(i,e,t);if(typeof e=="function"&&(t=e,e=null),i==="")return t(At,0,1);for(var n="",s,r,o,a=0,l=i.length;a<l;a++){var p=i.charAt(a);if(p!==":"){n+=p;continue}if(n===""||n!=(s=Number(n))||(r=i.slice(a+1,a+1+s),n!=r.length))return t(At,0,1);if(r.length){if(o=da(r,e,!1),At.type===o.type&&At.data===o.data)return t(At,0,1);var f=t(o,a+s,l);if(f===!1)return}a+=s,n=""}if(n!=="")return t(At,0,1)}function Xy(i){for(var e="",t=0,n=i.length;t<n;t++)e+=String.fromCharCode(i[t]);return e}function Zy(i){for(var e=Buffer.allocUnsafe(i.length),t=0,n=i.length;t<n;t++)e.writeUInt8(i.charCodeAt(t),t);return e}function fa(i){var e=i.byteLength||i.length,t=i.byteOffset||0;return Buffer.from(i.buffer||i,t,e)}function Mp(i,e){if(!i.length)return e(Vy);Tp(i,Qy,function(t,n){return e(Buffer.concat(n))})}function Qy(i,e){function t(n){var s=""+n.length,r;if(typeof n=="string"){r=Buffer.allocUnsafe(s.length+2),r[0]=0;for(var o=0;o<s.length;o++)r[o+1]=parseInt(s[o],10);return r[r.length-1]=255,e(null,Buffer.concat([r,Zy(n)]))}r=Buffer.allocUnsafe(s.length+2),r[0]=1;for(var o=0;o<s.length;o++)r[o+1]=parseInt(s[o],10);r[r.length-1]=255,e(null,Buffer.concat([r,n]))}pa(i,!0,!0,t)}function Op(i,e,t){typeof e=="function"&&(t=e,e=null);for(var n=i,s=[],r;n.length>0;){var o="",a=n[0]===0;for(r=1;n[r]!==255;r++){if(o.length>310)return t(At,0,1);o+=""+n[r]}n=n.slice(o.length+1);var l=parseInt(o,10),p=n.slice(1,l+1);a&&(p=Xy(p)),s.push(p),n=n.slice(l+1)}var f=s.length;for(r=0;r<f;r++){var m=s[r];t(da(m,e,!0),r,f)}}});var Pp=C((R2,Rp)=>{var Wi=1e3,Vi=Wi*60,Ki=Vi*60,wi=Ki*24,eb=wi*7,tb=wi*365.25;Rp.exports=function(i,e){e=e||{};var t=typeof i;if(t==="string"&&i.length>0)return ib(i);if(t==="number"&&isFinite(i))return e.long?sb(i):nb(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function ib(i){if(i=String(i),!(i.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(i);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*tb;case"weeks":case"week":case"w":return t*eb;case"days":case"day":case"d":return t*wi;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Ki;case"minutes":case"minute":case"mins":case"min":case"m":return t*Vi;case"seconds":case"second":case"secs":case"sec":case"s":return t*Wi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function nb(i){var e=Math.abs(i);return e>=wi?Math.round(i/wi)+"d":e>=Ki?Math.round(i/Ki)+"h":e>=Vi?Math.round(i/Vi)+"m":e>=Wi?Math.round(i/Wi)+"s":i+"ms"}function sb(i){var e=Math.abs(i);return e>=wi?Ds(i,e,wi,"day"):e>=Ki?Ds(i,e,Ki,"hour"):e>=Vi?Ds(i,e,Vi,"minute"):e>=Wi?Ds(i,e,Wi,"second"):i+" ms"}function Ds(i,e,t,n){var s=e>=t*1.5;return Math.round(i/t)+" "+n+(s?"s":"")}});var ha=C((P2,Bp)=>{function rb(i){t.debug=t,t.default=t,t.coerce=l,t.disable=o,t.enable=s,t.enabled=a,t.humanize=Pp(),t.destroy=p,Object.keys(i).forEach(f=>{t[f]=i[f]}),t.names=[],t.skips=[],t.formatters={};function e(f){let m=0;for(let _=0;_<f.length;_++)m=(m<<5)-m+f.charCodeAt(_),m|=0;return t.colors[Math.abs(m)%t.colors.length]}t.selectColor=e;function t(f){let m,_=null,E,k;function T(...O){if(!T.enabled)return;let M=T,A=Number(new Date),I=A-(m||A);M.diff=I,M.prev=m,M.curr=A,m=A,O[0]=t.coerce(O[0]),typeof O[0]!="string"&&O.unshift("%O");let U=0;O[0]=O[0].replace(/%([a-zA-Z%])/g,(J,ne)=>{if(J==="%%")return"%";U++;let H=t.formatters[ne];if(typeof H=="function"){let Ue=O[U];J=H.call(M,Ue),O.splice(U,1),U--}return J}),t.formatArgs.call(M,O),(M.log||t.log).apply(M,O)}return T.namespace=f,T.useColors=t.useColors(),T.color=t.selectColor(f),T.extend=n,T.destroy=t.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(E!==t.namespaces&&(E=t.namespaces,k=t.enabled(f)),k),set:O=>{_=O}}),typeof t.init=="function"&&t.init(T),T}function n(f,m){let _=t(this.namespace+(typeof m>"u"?":":m)+f);return _.log=this.log,_}function s(f){t.save(f),t.namespaces=f,t.names=[],t.skips=[];let m=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let _ of m)_[0]==="-"?t.skips.push(_.slice(1)):t.names.push(_)}function r(f,m){let _=0,E=0,k=-1,T=0;for(;_<f.length;)if(E<m.length&&(m[E]===f[_]||m[E]==="*"))m[E]==="*"?(k=E,T=_,E++):(_++,E++);else if(k!==-1)E=k+1,T++,_=T;else return!1;for(;E<m.length&&m[E]==="*";)E++;return E===m.length}function o(){let f=[...t.names,...t.skips.map(m=>"-"+m)].join(",");return t.enable(""),f}function a(f){for(let m of t.skips)if(r(f,m))return!1;for(let m of t.names)if(r(f,m))return!0;return!1}function l(f){return f instanceof Error?f.stack||f.message:f}function p(){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}Bp.exports=rb});var jp=C((st,qs)=>{st.formatArgs=ab;st.save=cb;st.load=lb;st.useColors=ob;st.storage=ub();st.destroy=(()=>{let i=!1;return()=>{i||(i=!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`."))}})();st.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 ob(){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 i;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&&(i=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(i[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function ab(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+qs.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;i.splice(1,0,e,"color: inherit");let t=0,n=0;i[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(t++,s==="%c"&&(n=t))}),i.splice(n,0,e)}st.log=console.debug||console.log||(()=>{});function cb(i){try{i?st.storage.setItem("debug",i):st.storage.removeItem("debug")}catch{}}function lb(){let i;try{i=st.storage.getItem("debug")||st.storage.getItem("DEBUG")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}function ub(){try{return localStorage}catch{}}qs.exports=ha()(st);var{formatters:pb}=qs.exports;pb.j=function(i){try{return JSON.stringify(i)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Ip=C((B2,Np)=>{"use strict";Np.exports=(i,e=process.argv)=>{let t=i.startsWith("-")?"":i.length===1?"-":"--",n=e.indexOf(t+i),s=e.indexOf("--");return n!==-1&&(s===-1||n<s)}});var ga=C((j2,qp)=>{"use strict";var db=require("os"),Dp=require("tty"),mt=Ip(),{env:ze}=process,ci;mt("no-color")||mt("no-colors")||mt("color=false")||mt("color=never")?ci=0:(mt("color")||mt("colors")||mt("color=true")||mt("color=always"))&&(ci=1);"FORCE_COLOR"in ze&&(ze.FORCE_COLOR==="true"?ci=1:ze.FORCE_COLOR==="false"?ci=0:ci=ze.FORCE_COLOR.length===0?1:Math.min(parseInt(ze.FORCE_COLOR,10),3));function ma(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function va(i,e){if(ci===0)return 0;if(mt("color=16m")||mt("color=full")||mt("color=truecolor"))return 3;if(mt("color=256"))return 2;if(i&&!e&&ci===void 0)return 0;let t=ci||0;if(ze.TERM==="dumb")return t;if(process.platform==="win32"){let n=db.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in ze)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in ze)||ze.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in ze)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ze.TEAMCITY_VERSION)?1:0;if(ze.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in ze){let n=parseInt((ze.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ze.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ze.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ze.TERM)||"COLORTERM"in ze?1:t}function fb(i){let e=va(i,i&&i.isTTY);return ma(e)}qp.exports={supportsColor:fb,stdout:ma(va(!0,Dp.isatty(1))),stderr:ma(va(!0,Dp.isatty(2)))}});var Fp=C(($e,Fs)=>{var hb=require("tty"),Ls=require("util");$e.init=wb;$e.log=xb;$e.formatArgs=vb;$e.save=yb;$e.load=bb;$e.useColors=mb;$e.destroy=Ls.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");$e.colors=[6,2,3,4,5,1];try{let i=ga();i&&(i.stderr||i).level>=2&&($e.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{}$e.inspectOpts=Object.keys(process.env).filter(i=>/^debug_/i.test(i)).reduce((i,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,r)=>r.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),i[t]=n,i},{});function mb(){return"colors"in $e.inspectOpts?!!$e.inspectOpts.colors:hb.isatty(process.stderr.fd)}function vb(i){let{namespace:e,useColors:t}=this;if(t){let n=this.color,s="\x1B[3"+(n<8?n:"8;5;"+n),r=` ${s};1m${e} \x1B[0m`;i[0]=r+i[0].split(`
2
+ var Ux=Object.create;var Ts=Object.defineProperty;var Hx=Object.getOwnPropertyDescriptor;var zx=Object.getOwnPropertyNames;var $x=Object.getPrototypeOf,Wx=Object.prototype.hasOwnProperty;var yi=(i,e)=>()=>(i&&(e=i(i=0)),e);var C=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),bi=(i,e)=>{for(var t in e)Ts(i,t,{get:e[t],enumerable:!0})},Nu=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of zx(e))!Wx.call(i,s)&&s!==t&&Ts(i,s,{get:()=>e[s],enumerable:!(n=Hx(e,s))||n.enumerable});return i};var L=(i,e,t)=>(t=i!=null?Ux($x(i)):{},Nu(e||!i||!i.__esModule?Ts(t,"default",{value:i,enumerable:!0}):t,i)),Vx=i=>Nu(Ts({},"__esModule",{value:!0}),i);var Lu=C((g2,Qo)=>{"use strict";Qo.exports=qu;Qo.exports.preferredCharsets=qu;var Kx=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function Gx(i){for(var e=i.split(","),t=0,n=0;t<e.length;t++){var s=Yx(e[t].trim(),t);s&&(e[n++]=s)}return e.length=n,e}function Yx(i,e){var t=Kx.exec(i);if(!t)return null;var n=t[1],s=1;if(t[2])for(var r=t[2].split(";"),o=0;o<r.length;o++){var a=r[o].trim().split("=");if(a[0]==="q"){s=parseFloat(a[1]);break}}return{charset:n,q:s,i:e}}function Jx(i,e,t){for(var n={o:-1,q:0,s:0},s=0;s<e.length;s++){var r=Xx(i,e[s],t);r&&(n.s-r.s||n.q-r.q||n.o-r.o)<0&&(n=r)}return n}function Xx(i,e,t){var n=0;if(e.charset.toLowerCase()===i.toLowerCase())n|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function qu(i,e){var t=Gx(i===void 0?"*":i||"");if(!e)return t.filter(Iu).sort(Du).map(Zx);var n=e.map(function(r,o){return Jx(r,t,o)});return n.filter(Iu).sort(Du).map(function(r){return e[n.indexOf(r)]})}function Du(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function Zx(i){return i.charset}function Iu(i){return i.q>0}});var $u=C((x2,ea)=>{"use strict";ea.exports=zu;ea.exports.preferredEncodings=zu;var Qx=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function ey(i){for(var e=i.split(","),t=!1,n=1,s=0,r=0;s<e.length;s++){var o=ty(e[s].trim(),s);o&&(e[r++]=o,t=t||Hu("identity",o),n=Math.min(n,o.q||1))}return t||(e[r++]={encoding:"identity",q:n,i:s}),e.length=r,e}function ty(i,e){var t=Qx.exec(i);if(!t)return null;var n=t[1],s=1;if(t[2])for(var r=t[2].split(";"),o=0;o<r.length;o++){var a=r[o].trim().split("=");if(a[0]==="q"){s=parseFloat(a[1]);break}}return{encoding:n,q:s,i:e}}function iy(i,e,t){for(var n={o:-1,q:0,s:0},s=0;s<e.length;s++){var r=Hu(i,e[s],t);r&&(n.s-r.s||n.q-r.q||n.o-r.o)<0&&(n=r)}return n}function Hu(i,e,t){var n=0;if(e.encoding.toLowerCase()===i.toLowerCase())n|=1;else if(e.encoding!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function zu(i,e){var t=ey(i||"");if(!e)return t.filter(Uu).sort(Fu).map(ny);var n=e.map(function(r,o){return iy(r,t,o)});return n.filter(Uu).sort(Fu).map(function(r){return e[n.indexOf(r)]})}function Fu(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function ny(i){return i.encoding}function Uu(i){return i.q>0}});var Yu=C((y2,ta)=>{"use strict";ta.exports=Gu;ta.exports.preferredLanguages=Gu;var sy=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function ry(i){for(var e=i.split(","),t=0,n=0;t<e.length;t++){var s=Ku(e[t].trim(),t);s&&(e[n++]=s)}return e.length=n,e}function Ku(i,e){var t=sy.exec(i);if(!t)return null;var n=t[1],s=t[2],r=n;s&&(r+="-"+s);var o=1;if(t[3])for(var a=t[3].split(";"),l=0;l<a.length;l++){var p=a[l].split("=");p[0]==="q"&&(o=parseFloat(p[1]))}return{prefix:n,suffix:s,q:o,i:e,full:r}}function oy(i,e,t){for(var n={o:-1,q:0,s:0},s=0;s<e.length;s++){var r=ay(i,e[s],t);r&&(n.s-r.s||n.q-r.q||n.o-r.o)<0&&(n=r)}return n}function ay(i,e,t){var n=Ku(i);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 Gu(i,e){var t=ry(i===void 0?"*":i||"");if(!e)return t.filter(Vu).sort(Wu).map(cy);var n=e.map(function(r,o){return oy(r,t,o)});return n.filter(Vu).sort(Wu).map(function(r){return e[n.indexOf(r)]})}function Wu(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function cy(i){return i.full}function Vu(i){return i.q>0}});var tp=C((b2,ia)=>{"use strict";ia.exports=Qu;ia.exports.preferredMediaTypes=Qu;var ly=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function uy(i){for(var e=my(i),t=0,n=0;t<e.length;t++){var s=Zu(e[t].trim(),t);s&&(e[n++]=s)}return e.length=n,e}function Zu(i,e){var t=ly.exec(i);if(!t)return null;var n=Object.create(null),s=1,r=t[2],o=t[1];if(t[3])for(var a=vy(t[3]).map(hy),l=0;l<a.length;l++){var p=a[l],f=p[0].toLowerCase(),m=p[1],_=m&&m[0]==='"'&&m[m.length-1]==='"'?m.substr(1,m.length-2):m;if(f==="q"){s=parseFloat(_);break}n[f]=_}return{type:o,subtype:r,params:n,q:s,i:e}}function py(i,e,t){for(var n={o:-1,q:0,s:0},s=0;s<e.length;s++){var r=dy(i,e[s],t);r&&(n.s-r.s||n.q-r.q||n.o-r.o)<0&&(n=r)}return n}function dy(i,e,t){var n=Zu(i),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 r=Object.keys(e.params);if(r.length>0)if(r.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 Qu(i,e){var t=uy(i===void 0?"*/*":i||"");if(!e)return t.filter(Xu).sort(Ju).map(fy);var n=e.map(function(r,o){return py(r,t,o)});return n.filter(Xu).sort(Ju).map(function(r){return e[n.indexOf(r)]})}function Ju(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function fy(i){return i.type+"/"+i.subtype}function Xu(i){return i.q>0}function ep(i){for(var e=0,t=0;(t=i.indexOf('"',t))!==-1;)e++,t++;return e}function hy(i){var e=i.indexOf("="),t,n;return e===-1?t=i:(t=i.substr(0,e),n=i.substr(e+1)),[t,n]}function my(i){for(var e=i.split(","),t=1,n=0;t<e.length;t++)ep(e[n])%2==0?e[++n]=e[t]:e[n]+=","+e[t];return e.length=n+1,e}function vy(i){for(var e=i.split(";"),t=1,n=0;t<e.length;t++)ep(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 ip=C((w2,na)=>{"use strict";var gy=Lu(),xy=$u(),yy=Yu(),by=tp();na.exports=$;na.exports.Negotiator=$;function $(i){if(!(this instanceof $))return new $(i);this.request=i}$.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};$.prototype.charsets=function(e){return gy(this.request.headers["accept-charset"],e)};$.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};$.prototype.encodings=function(e){return xy(this.request.headers["accept-encoding"],e)};$.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};$.prototype.languages=function(e){return yy(this.request.headers["accept-language"],e)};$.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};$.prototype.mediaTypes=function(e){return by(this.request.headers.accept,e)};$.prototype.preferredCharset=$.prototype.charset;$.prototype.preferredCharsets=$.prototype.charsets;$.prototype.preferredEncoding=$.prototype.encoding;$.prototype.preferredEncodings=$.prototype.encodings;$.prototype.preferredLanguage=$.prototype.language;$.prototype.preferredLanguages=$.prototype.languages;$.prototype.preferredMediaType=$.prototype.mediaType;$.prototype.preferredMediaTypes=$.prototype.mediaTypes});var np=C((_2,wy)=>{wy.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 rp=C((S2,sp)=>{sp.exports=np()});var cp=C(it=>{"use strict";var Ms=rp(),_y=require("path").extname,op=/^\s*([^;\s]*)(?:;|\s|$)/,Sy=/^text\//i;it.charset=ap;it.charsets={lookup:ap};it.contentType=Ey;it.extension=ky;it.extensions=Object.create(null);it.lookup=Cy;it.types=Object.create(null);Ty(it.extensions,it.types);function ap(i){if(!i||typeof i!="string")return!1;var e=op.exec(i),t=e&&Ms[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&Sy.test(e[1])?"UTF-8":!1}function Ey(i){if(!i||typeof i!="string")return!1;var e=i.indexOf("/")===-1?it.lookup(i):i;if(!e)return!1;if(e.indexOf("charset")===-1){var t=it.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function ky(i){if(!i||typeof i!="string")return!1;var e=op.exec(i),t=e&&it.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function Cy(i){if(!i||typeof i!="string")return!1;var e=_y("x."+i).toLowerCase().substr(1);return e&&it.types[e]||!1}function Ty(i,e){var t=["nginx","apache",void 0,"iana"];Object.keys(Ms).forEach(function(s){var r=Ms[s],o=r.extensions;if(!(!o||!o.length)){i[s]=o;for(var a=0;a<o.length;a++){var l=o[a];if(e[l]){var p=t.indexOf(Ms[e[l]].source),f=t.indexOf(r.source);if(e[l]!=="application/octet-stream"&&(p>f||p===f&&e[l].substr(0,12)==="application/"))continue}e[l]=s}}})}});var Os=C((k2,lp)=>{"use strict";var My=ip(),Oy=cp();lp.exports=ct;function ct(i){if(!(this instanceof ct))return new ct(i);this.headers=i.headers,this.negotiator=new My(i)}ct.prototype.type=ct.prototype.types=function(i){var e=i;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(Ay),s=this.negotiator.mediaTypes(n.filter(Ry)),r=s[0];return r?e[n.indexOf(r)]:!1};ct.prototype.encoding=ct.prototype.encodings=function(i){var e=i;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};ct.prototype.charset=ct.prototype.charsets=function(i){var e=i;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};ct.prototype.lang=ct.prototype.langs=ct.prototype.language=ct.prototype.languages=function(i){var e=i;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 Ay(i){return i.indexOf("/")===-1?Oy.lookup(i):i}function Ry(i){return typeof i=="string"}});var ra=C((up,pp)=>{var zn=require("crypto"),sa=function(){};sa.prototype.getRandomBytes=function(i){var e=4096,t=this;if(i=i||12,i>e)return zn.randomBytes(i);var n=parseInt(e/i),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,zn.randomBytes(e,function(o,a){t.bytesBuffer=a,t.bytesBufferIndex=0,t.isGeneratingBytes=!1})),this.bytesBufferIndex==-1)))return zn.randomBytes(i);var r=this.bytesBuffer.slice(i*this.bytesBufferIndex,i*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,r};sa.prototype.generateId=function(){var i=Buffer.alloc(15);return i.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,i.writeInt32BE(this.sequenceNumber,11),zn.randomBytes?this.getRandomBytes(12).copy(i):[0,4,8].forEach(function(e){i.writeInt32BE(Math.random()*Math.pow(2,32)|0,e)}),i.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()};up=pp.exports=new sa});var As=C(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.ERROR_PACKET=ri.PACKET_TYPES_REVERSE=ri.PACKET_TYPES=void 0;var It=Object.create(null);ri.PACKET_TYPES=It;It.open="0";It.close="1";It.ping="2";It.pong="3";It.message="4";It.upgrade="5";It.noop="6";var dp=Object.create(null);ri.PACKET_TYPES_REVERSE=dp;Object.keys(It).forEach(i=>{dp[It[i]]=i});var Py={type:"error",data:"parser error"};ri.ERROR_PACKET=Py});var hp=C(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.encodePacket=void 0;Hi.encodePacketToBinary=Ny;var By=As(),jy=({type:i,data:e},t,n)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?n(t?e:"b"+fp(e,!0).toString("base64")):n(By.PACKET_TYPES[i]+(e||""));Hi.encodePacket=jy;var fp=(i,e)=>Buffer.isBuffer(i)||i instanceof Uint8Array&&!e?i:i instanceof ArrayBuffer?Buffer.from(i):Buffer.from(i.buffer,i.byteOffset,i.byteLength),oa;function Ny(i,e){if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return e(fp(i.data,!1));(0,Hi.encodePacket)(i,!0,t=>{oa||(oa=new TextEncoder),e(oa.encode(t))})}});var vp=C(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.decodePacket=void 0;var Rs=As(),Dy=(i,e)=>{if(typeof i!="string")return{type:"message",data:mp(i,e)};let t=i.charAt(0);if(t==="b"){let n=Buffer.from(i.substring(1),"base64");return{type:"message",data:mp(n,e)}}return Rs.PACKET_TYPES_REVERSE[t]?i.length>1?{type:Rs.PACKET_TYPES_REVERSE[t],data:i.substring(1)}:{type:Rs.PACKET_TYPES_REVERSE[t]}:Rs.ERROR_PACKET};Ps.decodePacket=Dy;var mp=(i,e)=>e==="arraybuffer"?i instanceof ArrayBuffer?i:Buffer.isBuffer(i)?i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength):i.buffer:Buffer.isBuffer(i)?i:Buffer.from(i)});var $n=C(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.decodePayload=nt.decodePacket=nt.encodePayload=nt.encodePacket=nt.protocol=void 0;nt.createPacketEncoderStream=Ly;nt.createPacketDecoderStream=Fy;var ca=hp();Object.defineProperty(nt,"encodePacket",{enumerable:!0,get:function(){return ca.encodePacket}});var la=vp();Object.defineProperty(nt,"decodePacket",{enumerable:!0,get:function(){return la.decodePacket}});var gp=As(),xp="",Iy=(i,e)=>{let t=i.length,n=new Array(t),s=0;i.forEach((r,o)=>{(0,ca.encodePacket)(r,!1,a=>{n[o]=a,++s===t&&e(n.join(xp))})})};nt.encodePayload=Iy;var qy=(i,e)=>{let t=i.split(xp),n=[];for(let s=0;s<t.length;s++){let r=(0,la.decodePacket)(t[s],e);if(n.push(r),r.type==="error")break}return n};nt.decodePayload=qy;function Ly(){return new TransformStream({transform(i,e){(0,ca.encodePacketToBinary)(i,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 r=new DataView(s.buffer);r.setUint8(0,126),r.setUint16(1,n)}else{s=new Uint8Array(9);let r=new DataView(s.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(n))}i.data&&typeof i.data!="string"&&(s[0]|=128),e.enqueue(s),e.enqueue(t)})}})}var aa;function Bs(i){return i.reduce((e,t)=>e+t.length,0)}function js(i,e){if(i[0].length===e)return i.shift();let t=new Uint8Array(e),n=0;for(let s=0;s<e;s++)t[s]=i[0][n++],n===i[0].length&&(i.shift(),n=0);return i.length&&n<i[0].length&&(i[0]=i[0].slice(n)),t}function Fy(i,e){aa||(aa=new TextDecoder);let t=[],n=0,s=-1,r=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(n===0){if(Bs(t)<1)break;let l=js(t,1);r=(l[0]&128)===128,s=l[0]&127,s<126?n=3:s===126?n=1:n=2}else if(n===1){if(Bs(t)<2)break;let l=js(t,2);s=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),n=3}else if(n===2){if(Bs(t)<8)break;let l=js(t,8),p=new DataView(l.buffer,l.byteOffset,l.length),f=p.getUint32(0);if(f>Math.pow(2,21)-1){a.enqueue(gp.ERROR_PACKET);break}s=f*Math.pow(2,32)+p.getUint32(4),n=3}else{if(Bs(t)<s)break;let l=js(t,s);a.enqueue((0,la.decodePacket)(r?l:aa.decode(l),e)),n=0}if(s===0||s>i){a.enqueue(gp.ERROR_PACKET);break}}}})}nt.protocol=4});var _p=C((A2,wp)=>{var oi=String.fromCharCode;function yp(i){for(var e=[],t=0,n=i.length,s,r;t<n;)s=i.charCodeAt(t++),s>=55296&&s<=56319&&t<n?(r=i.charCodeAt(t++),(r&64512)==56320?e.push(((s&1023)<<10)+(r&1023)+65536):(e.push(s),t--)):e.push(s);return e}function Uy(i){for(var e=i.length,t=-1,n,s="";++t<e;)n=i[t],n>65535&&(n-=65536,s+=oi(n>>>10&1023|55296),n=56320|n&1023),s+=oi(n);return s}function bp(i,e){if(i>=55296&&i<=57343){if(e)throw Error("Lone surrogate U+"+i.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function ua(i,e){return oi(i>>e&63|128)}function Hy(i,e){if((i&4294967168)==0)return oi(i);var t="";return(i&4294965248)==0?t=oi(i>>6&31|192):(i&4294901760)==0?(bp(i,e)||(i=65533),t=oi(i>>12&15|224),t+=ua(i,6)):(i&4292870144)==0&&(t=oi(i>>18&7|240),t+=ua(i,12),t+=ua(i,6)),t+=oi(i&63|128),t}function zy(i,e){e=e||{};for(var t=e.strict!==!1,n=yp(i),s=n.length,r=-1,o,a="";++r<s;)o=n[r],a+=Hy(o,t);return a}function zi(){if(ai>=Ds)throw Error("Invalid byte index");var i=Ns[ai]&255;if(ai++,(i&192)==128)return i&63;throw Error("Invalid continuation byte")}function $y(i){var e,t,n,s,r;if(ai>Ds)throw Error("Invalid byte index");if(ai==Ds)return!1;if(e=Ns[ai]&255,ai++,(e&128)==0)return e;if((e&224)==192){if(t=zi(),r=(e&31)<<6|t,r>=128)return r;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=zi(),n=zi(),r=(e&15)<<12|t<<6|n,r>=2048)return bp(r,i)?r:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=zi(),n=zi(),s=zi(),r=(e&7)<<18|t<<12|n<<6|s,r>=65536&&r<=1114111))return r;throw Error("Invalid UTF-8 detected")}var Ns,Ds,ai;function Wy(i,e){e=e||{};var t=e.strict!==!1;Ns=yp(i),Ds=Ns.length,ai=0;for(var n=[],s;(s=$y(t))!==!1;)n.push(s);return Uy(n)}wp.exports={version:"2.1.2",encode:zy,decode:Wy}});var Ap=C(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.packets=He.protocol=void 0;He.encodePacket=pa;He.encodeBase64Packet=kp;He.decodePacket=da;He.decodeBase64Packet=Cp;He.encodePayload=Yy;He.decodePayload=Xy;He.encodePayloadAsBinary=Mp;He.decodePayloadAsBinary=Op;var Ep=_p();He.protocol=3;var Vy=i=>{for(let e of i)if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return!0;return!1};He.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var $i=Object.keys(He.packets),At={type:"error",data:"parser error"},Ky=Buffer.concat([]);function pa(i,e,t,n){if(typeof e=="function"&&(n=e,e=null),typeof t=="function"&&(n=t,t=null),Buffer.isBuffer(i.data))return Sp(i,e,n);if(i.data&&(i.data.buffer||i.data)instanceof ArrayBuffer)return Sp({type:i.type,data:fa(i.data)},e,n);var s=He.packets[i.type];return i.data!==void 0&&(s+=t?Ep.encode(String(i.data),{strict:!1}):String(i.data)),n(""+s)}function Sp(i,e,t){if(!e)return kp(i,t);var n=i.data,s=Buffer.allocUnsafe(1);return s[0]=He.packets[i.type],t(Buffer.concat([s,n]))}function kp(i,e){var t=Buffer.isBuffer(i.data)?i.data:fa(i.data),n="b"+He.packets[i.type];return n+=t.toString("base64"),e(n)}function da(i,e,t){if(i===void 0)return At;let n;if(typeof i=="string")return n=i.charAt(0),n==="b"?Cp(i.slice(1),e):t&&(i=Gy(i),i===!1)||Number(n)!=n||!$i[n]?At:i.length>1?{type:$i[n],data:i.slice(1)}:{type:$i[n]};if(e==="arraybuffer"){var s=new Uint8Array(i);return n=s[0],{type:$i[n],data:s.buffer.slice(1)}}return i instanceof ArrayBuffer&&(i=fa(i)),n=i[0],{type:$i[n],data:i.slice(1)}}function Gy(i){try{i=Ep.decode(i,{strict:!1})}catch{return!1}return i}function Cp(i,e){var t=$i[i.charAt(0)],n=Buffer.from(i.slice(1),"base64");if(e==="arraybuffer"){for(var s=new Uint8Array(n.length),r=0;r<s.length;r++)s[r]=n[r];n=s.buffer}return{type:t,data:n}}function Yy(i,e,t){if(typeof e=="function"&&(t=e,e=null),e&&Vy(i))return Mp(i,t);if(!i.length)return t("0:");function n(s,r){pa(s,e,!1,function(o){r(null,Jy(o))})}Tp(i,n,function(s,r){return t(r.join(""))})}function Jy(i){return i.length+":"+i}function Tp(i,e,t){let n=new Array(i.length),s=0;for(let r=0;r<i.length;r++)e(i[r],(o,a)=>{n[r]=a,++s===i.length&&t(null,n)})}function Xy(i,e,t){if(typeof i!="string")return Op(i,e,t);if(typeof e=="function"&&(t=e,e=null),i==="")return t(At,0,1);for(var n="",s,r,o,a=0,l=i.length;a<l;a++){var p=i.charAt(a);if(p!==":"){n+=p;continue}if(n===""||n!=(s=Number(n))||(r=i.slice(a+1,a+1+s),n!=r.length))return t(At,0,1);if(r.length){if(o=da(r,e,!1),At.type===o.type&&At.data===o.data)return t(At,0,1);var f=t(o,a+s,l);if(f===!1)return}a+=s,n=""}if(n!=="")return t(At,0,1)}function Zy(i){for(var e="",t=0,n=i.length;t<n;t++)e+=String.fromCharCode(i[t]);return e}function Qy(i){for(var e=Buffer.allocUnsafe(i.length),t=0,n=i.length;t<n;t++)e.writeUInt8(i.charCodeAt(t),t);return e}function fa(i){var e=i.byteLength||i.length,t=i.byteOffset||0;return Buffer.from(i.buffer||i,t,e)}function Mp(i,e){if(!i.length)return e(Ky);Tp(i,eb,function(t,n){return e(Buffer.concat(n))})}function eb(i,e){function t(n){var s=""+n.length,r;if(typeof n=="string"){r=Buffer.allocUnsafe(s.length+2),r[0]=0;for(var o=0;o<s.length;o++)r[o+1]=parseInt(s[o],10);return r[r.length-1]=255,e(null,Buffer.concat([r,Qy(n)]))}r=Buffer.allocUnsafe(s.length+2),r[0]=1;for(var o=0;o<s.length;o++)r[o+1]=parseInt(s[o],10);r[r.length-1]=255,e(null,Buffer.concat([r,n]))}pa(i,!0,!0,t)}function Op(i,e,t){typeof e=="function"&&(t=e,e=null);for(var n=i,s=[],r;n.length>0;){var o="",a=n[0]===0;for(r=1;n[r]!==255;r++){if(o.length>310)return t(At,0,1);o+=""+n[r]}n=n.slice(o.length+1);var l=parseInt(o,10),p=n.slice(1,l+1);a&&(p=Zy(p)),s.push(p),n=n.slice(l+1)}var f=s.length;for(r=0;r<f;r++){var m=s[r];t(da(m,e,!0),r,f)}}});var Pp=C((P2,Rp)=>{var Wi=1e3,Vi=Wi*60,Ki=Vi*60,wi=Ki*24,tb=wi*7,ib=wi*365.25;Rp.exports=function(i,e){e=e||{};var t=typeof i;if(t==="string"&&i.length>0)return nb(i);if(t==="number"&&isFinite(i))return e.long?rb(i):sb(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function nb(i){if(i=String(i),!(i.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(i);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*ib;case"weeks":case"week":case"w":return t*tb;case"days":case"day":case"d":return t*wi;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Ki;case"minutes":case"minute":case"mins":case"min":case"m":return t*Vi;case"seconds":case"second":case"secs":case"sec":case"s":return t*Wi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function sb(i){var e=Math.abs(i);return e>=wi?Math.round(i/wi)+"d":e>=Ki?Math.round(i/Ki)+"h":e>=Vi?Math.round(i/Vi)+"m":e>=Wi?Math.round(i/Wi)+"s":i+"ms"}function rb(i){var e=Math.abs(i);return e>=wi?Is(i,e,wi,"day"):e>=Ki?Is(i,e,Ki,"hour"):e>=Vi?Is(i,e,Vi,"minute"):e>=Wi?Is(i,e,Wi,"second"):i+" ms"}function Is(i,e,t,n){var s=e>=t*1.5;return Math.round(i/t)+" "+n+(s?"s":"")}});var ha=C((B2,Bp)=>{function ob(i){t.debug=t,t.default=t,t.coerce=l,t.disable=o,t.enable=s,t.enabled=a,t.humanize=Pp(),t.destroy=p,Object.keys(i).forEach(f=>{t[f]=i[f]}),t.names=[],t.skips=[],t.formatters={};function e(f){let m=0;for(let _=0;_<f.length;_++)m=(m<<5)-m+f.charCodeAt(_),m|=0;return t.colors[Math.abs(m)%t.colors.length]}t.selectColor=e;function t(f){let m,_=null,E,k;function T(...O){if(!T.enabled)return;let M=T,A=Number(new Date),D=A-(m||A);M.diff=D,M.prev=m,M.curr=A,m=A,O[0]=t.coerce(O[0]),typeof O[0]!="string"&&O.unshift("%O");let U=0;O[0]=O[0].replace(/%([a-zA-Z%])/g,(J,ne)=>{if(J==="%%")return"%";U++;let H=t.formatters[ne];if(typeof H=="function"){let Ue=O[U];J=H.call(M,Ue),O.splice(U,1),U--}return J}),t.formatArgs.call(M,O),(M.log||t.log).apply(M,O)}return T.namespace=f,T.useColors=t.useColors(),T.color=t.selectColor(f),T.extend=n,T.destroy=t.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(E!==t.namespaces&&(E=t.namespaces,k=t.enabled(f)),k),set:O=>{_=O}}),typeof t.init=="function"&&t.init(T),T}function n(f,m){let _=t(this.namespace+(typeof m>"u"?":":m)+f);return _.log=this.log,_}function s(f){t.save(f),t.namespaces=f,t.names=[],t.skips=[];let m=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let _ of m)_[0]==="-"?t.skips.push(_.slice(1)):t.names.push(_)}function r(f,m){let _=0,E=0,k=-1,T=0;for(;_<f.length;)if(E<m.length&&(m[E]===f[_]||m[E]==="*"))m[E]==="*"?(k=E,T=_,E++):(_++,E++);else if(k!==-1)E=k+1,T++,_=T;else return!1;for(;E<m.length&&m[E]==="*";)E++;return E===m.length}function o(){let f=[...t.names,...t.skips.map(m=>"-"+m)].join(",");return t.enable(""),f}function a(f){for(let m of t.skips)if(r(f,m))return!1;for(let m of t.names)if(r(f,m))return!0;return!1}function l(f){return f instanceof Error?f.stack||f.message:f}function p(){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}Bp.exports=ob});var jp=C((st,qs)=>{st.formatArgs=cb;st.save=lb;st.load=ub;st.useColors=ab;st.storage=pb();st.destroy=(()=>{let i=!1;return()=>{i||(i=!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`."))}})();st.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 ab(){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 i;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&&(i=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(i[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function cb(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+qs.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;i.splice(1,0,e,"color: inherit");let t=0,n=0;i[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(t++,s==="%c"&&(n=t))}),i.splice(n,0,e)}st.log=console.debug||console.log||(()=>{});function lb(i){try{i?st.storage.setItem("debug",i):st.storage.removeItem("debug")}catch{}}function ub(){let i;try{i=st.storage.getItem("debug")||st.storage.getItem("DEBUG")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}function pb(){try{return localStorage}catch{}}qs.exports=ha()(st);var{formatters:db}=qs.exports;db.j=function(i){try{return JSON.stringify(i)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Dp=C((j2,Np)=>{"use strict";Np.exports=(i,e=process.argv)=>{let t=i.startsWith("-")?"":i.length===1?"-":"--",n=e.indexOf(t+i),s=e.indexOf("--");return n!==-1&&(s===-1||n<s)}});var ga=C((N2,qp)=>{"use strict";var fb=require("os"),Ip=require("tty"),mt=Dp(),{env:ze}=process,ci;mt("no-color")||mt("no-colors")||mt("color=false")||mt("color=never")?ci=0:(mt("color")||mt("colors")||mt("color=true")||mt("color=always"))&&(ci=1);"FORCE_COLOR"in ze&&(ze.FORCE_COLOR==="true"?ci=1:ze.FORCE_COLOR==="false"?ci=0:ci=ze.FORCE_COLOR.length===0?1:Math.min(parseInt(ze.FORCE_COLOR,10),3));function ma(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function va(i,e){if(ci===0)return 0;if(mt("color=16m")||mt("color=full")||mt("color=truecolor"))return 3;if(mt("color=256"))return 2;if(i&&!e&&ci===void 0)return 0;let t=ci||0;if(ze.TERM==="dumb")return t;if(process.platform==="win32"){let n=fb.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in ze)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in ze)||ze.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in ze)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ze.TEAMCITY_VERSION)?1:0;if(ze.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in ze){let n=parseInt((ze.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ze.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ze.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ze.TERM)||"COLORTERM"in ze?1:t}function hb(i){let e=va(i,i&&i.isTTY);return ma(e)}qp.exports={supportsColor:hb,stdout:ma(va(!0,Ip.isatty(1))),stderr:ma(va(!0,Ip.isatty(2)))}});var Fp=C(($e,Fs)=>{var mb=require("tty"),Ls=require("util");$e.init=_b;$e.log=yb;$e.formatArgs=gb;$e.save=bb;$e.load=wb;$e.useColors=vb;$e.destroy=Ls.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");$e.colors=[6,2,3,4,5,1];try{let i=ga();i&&(i.stderr||i).level>=2&&($e.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{}$e.inspectOpts=Object.keys(process.env).filter(i=>/^debug_/i.test(i)).reduce((i,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,r)=>r.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),i[t]=n,i},{});function vb(){return"colors"in $e.inspectOpts?!!$e.inspectOpts.colors:mb.isatty(process.stderr.fd)}function gb(i){let{namespace:e,useColors:t}=this;if(t){let n=this.color,s="\x1B[3"+(n<8?n:"8;5;"+n),r=` ${s};1m${e} \x1B[0m`;i[0]=r+i[0].split(`
3
3
  `).join(`
4
- `+r),i.push(s+"m+"+Fs.exports.humanize(this.diff)+"\x1B[0m")}else i[0]=gb()+e+" "+i[0]}function gb(){return $e.inspectOpts.hideDate?"":new Date().toISOString()+" "}function xb(...i){return process.stderr.write(Ls.formatWithOptions($e.inspectOpts,...i)+`
5
- `)}function yb(i){i?process.env.DEBUG=i:delete process.env.DEBUG}function bb(){return process.env.DEBUG}function wb(i){i.inspectOpts={};let e=Object.keys($e.inspectOpts);for(let t=0;t<e.length;t++)i.inspectOpts[e[t]]=$e.inspectOpts[e[t]]}Fs.exports=ha()($e);var{formatters:Lp}=Fs.exports;Lp.o=function(i){return this.inspectOpts.colors=this.useColors,Ls.inspect(i,this.inspectOpts).split(`
6
- `).map(e=>e.trim()).join(" ")};Lp.O=function(i){return this.inspectOpts.colors=this.useColors,Ls.inspect(i,this.inspectOpts)}});var se=C((N2,xa)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?xa.exports=jp():xa.exports=Fp()});var _i=C(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.Transport=void 0;var _b=require("events"),Sb=$n(),Eb=Ap(),kb=se(),Up=(0,kb.default)("engine:transport");function Cb(){}var Us=class extends _b.EventEmitter{get readyState(){return this._readyState}set readyState(e){Up("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?Sb:Eb,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||Cb))}onError(e,t){if(this.listeners("error").length){let n=new Error(e);n.type="TransportError",n.description=t,this.emit("error",n)}else Up("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")}};Hs.Transport=Us;Us.upgradesTo=[]});var ba=C(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.Polling=void 0;var Tb=_i(),Hp=require("zlib"),Mb=Os(),Ob=se(),lt=(0,Ob.default)("engine:polling"),Ab={gzip:Hp.createGzip,deflate:Hp.createDeflate},ya=class extends Tb.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){lt("request overlap"),this.onError("overlap from client"),t.writeHead(400),t.end();return}lt("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&&(lt("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([]):"",r=()=>{e.removeListener("data",a),e.removeListener("end",l),e.removeListener("close",o),this.dataReq=this.dataRes=s=null},o=()=>{r(),this.onError("data request connection closed prematurely")},a=p=>{let f;n?(s=Buffer.concat([s,p]),f=s.length):(s+=p,f=Buffer.byteLength(s)),f>this.maxHttpBufferSize&&(t.writeHead(413).end(),r())},l=()=>{this.onData(s);let p={"Content-Type":"text/html","Content-Length":"2"};t.writeHead(200,this.headers(e,p)),t.end("ok"),r()};e.on("close",o),n||e.setEncoding("utf8"),e.on("data",a),e.on("end",l)}onData(e){lt('received "%s"',e);let t=n=>{if(n.type==="close")return lt("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&&(lt("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let s=e.some(r=>r.options&&r.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){lt('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=f=>{o["Content-Length"]=typeof f=="string"?Buffer.byteLength(f):f.length,this.res.writeHead(200,this.headers(this.req,o)),this.res.end(f),n()};if(!this.httpCompression||!t.compress){a(e);return}if((s?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let p=Mb(this.req).encodings(["gzip","deflate"]);if(!p){a(e);return}this.compress(e,p,(f,m)=>{if(f){this.res.writeHead(500),this.res.end(),n(f);return}o["Content-Encoding"]=p,a(m)})}compress(e,t,n){lt("compressing");let s=[],r=0;Ab[t](this.httpCompression).on("error",n).on("data",function(o){s.push(o),r+=o.length}).on("end",function(){n(null,Buffer.concat(s,r))}).end(e)}doClose(e){lt("closing");let t;this.dataReq&&(lt("aborting ongoing data request"),this.dataReq.destroy());let n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(lt("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(lt("transport discarded - closing right away"),n()):(lt("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}};zs.Polling=ya});var zp=C($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.JSONP=void 0;var Rb=ba(),Pb=require("querystring"),Bb=/\\\\n/g,jb=/(\\)?\\n/g,wa=class extends Rb.Polling{constructor(e){super(e),this.head="___eio["+(e._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(e){e=Pb.parse(e).d,typeof e=="string"&&(e=e.replace(jb,function(t,n){return n?t:`
7
- `}),super.onData(e.replace(Bb,"\\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)}};$s.JSONP=wa});var Wp=C(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.WebSocket=void 0;var Nb=_i(),Ib=se(),$p=(0,Ib.default)("engine:ws"),_a=class extends Nb.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();$p('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){$p("closing"),this.socket.close(),e&&e()}};Ws.WebSocket=_a});var Ea=C(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.WebTransport=void 0;var Db=_i(),qb=se(),Lb=$n(),Gi=(0,qb.default)("engine:webtransport"),Sa=class extends Db.Transport{constructor(e,t,n){super({_query:{EIO:"4"}}),this.session=e;let s=(0,Lb.createPacketEncoderStream)();s.readable.pipeTo(t.writable).catch(()=>{Gi("the stream was closed")}),this.writer=s.writable.getWriter(),(async()=>{try{for(;;){let{value:r,done:o}=await n.read();if(o){Gi("session is closed");break}Gi("received chunk: %o",r),this.onPacket(r)}}catch(r){Gi("error while reading: %s",r.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()}};Vs.WebTransport=Sa});var Ca=C(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});var Fb=ba(),Ub=zp(),Hb=Wp(),zb=Ea();ka.default={polling:Vp,websocket:Hb.WebSocket,webtransport:zb.WebTransport};function Vp(i){return typeof i._query.j=="string"?new Ub.JSONP(i):new Fb.Polling(i)}Vp.upgradesTo=["websocket","webtransport"]});var Ma=C(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.Socket=void 0;var $b=require("events"),Wb=se(),Kt=require("timers"),re=(0,Wb.default)("engine:socket"),Ta=class extends $b.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,s,r){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=r,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 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,Kt.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,Kt.setTimeout)(()=>{re("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,Kt.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,Kt.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),r=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",r),this.transport.once("close",o),this.cleanupFn.push(function(){e.removeListener("error",t),e.removeListener("ready",n),e.removeListener("packet",s),e.removeListener("drain",r),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,Kt.setTimeout)(()=>{re("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),n,s=f=>{f.type==="ping"&&f.data==="probe"?(re("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(n),n=setInterval(r,100)):f.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())},r=()=>{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,Kt.clearTimeout)(t),e.removeListener("packet",s),e.removeListener("close",l),e.removeListener("error",a),this.removeListener("close",p)},a=f=>{re("client did not complete upgrade - %s",f),o(),e.close(),e=null},l=()=>{a("transport closed")},p=()=>{a("socket closed")};e.on("packet",s),e.once("close",l),e.once("error",a),this.once("close",p)}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,Kt.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,Kt.clearTimeout)(this.pingIntervalTimer),(0,Kt.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"){re('sending packet "%s" (%s)',e,t),n.compress=n.compress!==!1;let r={type:e,options:n};t&&(r.data=t),this.emit("packetCreate",r),this.writeBuffer.push(r),typeof s=="function"&&this.packetsFn.push(s),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 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){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"))}};Ks.Socket=Ta});var Yp=C(Oa=>{"use strict";Oa.parse=Zb;Oa.serialize=Qb;var Vb=Object.prototype.toString,Kb=Object.prototype.hasOwnProperty,Gb=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Yb=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,Jb=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Xb=/^[\u0020-\u003A\u003D-\u007E]*$/;function Zb(i,e){if(typeof i!="string")throw new TypeError("argument str must be a string");var t={},n=i.length;if(n<2)return t;var s=e&&e.decode||ew,r=0,o=0,a=0;do{if(o=i.indexOf("=",r),o===-1)break;if(a=i.indexOf(";",r),a===-1)a=n;else if(o>a){r=i.lastIndexOf(";",o-1)+1;continue}var l=Kp(i,r,o),p=Gp(i,o,l),f=i.slice(l,p);if(!Kb.call(t,f)){var m=Kp(i,o+1,a),_=Gp(i,a,m);i.charCodeAt(m)===34&&i.charCodeAt(_-1)===34&&(m++,_--);var E=i.slice(m,_);t[f]=iw(E,s)}r=a+1}while(r<n);return t}function Kp(i,e,t){do{var n=i.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<t);return t}function Gp(i,e,t){for(;e>t;){var n=i.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return t}function Qb(i,e,t){var n=t&&t.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!Gb.test(i))throw new TypeError("argument name is invalid");var s=n(e);if(!Yb.test(s))throw new TypeError("argument val is invalid");var r=i+"="+s;if(!t)return r;if(t.maxAge!=null){var o=Math.floor(t.maxAge);if(!isFinite(o))throw new TypeError("option maxAge is invalid");r+="; Max-Age="+o}if(t.domain){if(!Jb.test(t.domain))throw new TypeError("option domain is invalid");r+="; Domain="+t.domain}if(t.path){if(!Xb.test(t.path))throw new TypeError("option path is invalid");r+="; Path="+t.path}if(t.expires){var a=t.expires;if(!tw(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");r+="; Expires="+a.toUTCString()}if(t.httpOnly&&(r+="; HttpOnly"),t.secure&&(r+="; Secure"),t.partitioned&&(r+="; Partitioned"),t.priority){var l=typeof t.priority=="string"?t.priority.toLowerCase():t.priority;switch(l){case"low":r+="; Priority=Low";break;case"medium":r+="; Priority=Medium";break;case"high":r+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(t.sameSite){var p=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(p){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return r}function ew(i){return i.indexOf("%")!==-1?decodeURIComponent(i):i}function tw(i){return Vb.call(i)==="[object Date]"}function iw(i,e){try{return e(i)}catch{return i}}});var Gt=C(($2,Zp)=>{"use strict";var Jp=["nodebuffer","arraybuffer","fragments"],Xp=typeof Blob<"u";Xp&&Jp.push("blob");Zp.exports={BINARY_TYPES:Jp,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Xp,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var hd=C((W2,fd)=>{var id=require("fs"),Yt=require("path"),nd=require("os"),sd=typeof __webpack_require__=="function"?__non_webpack_require__:require,nw=process.config&&process.config.variables||{},sw=!!process.env.PREBUILDS_ONLY,Qp=process.versions.modules,Aa=aw()?"electron":ow()?"node-webkit":"node",Ra=process.env.npm_config_arch||nd.arch(),Pa=process.env.npm_config_platform||nd.platform(),rd=process.env.LIBC||(cw(Pa)?"musl":"glibc"),Ba=process.env.ARM_VERSION||(Ra==="arm64"?"8":nw.arm_version)||"",od=(process.versions.uv||"").split(".")[0];fd.exports=qt;function qt(i){return sd(qt.resolve(i))}qt.resolve=qt.path=function(i){i=Yt.resolve(i||".");try{var e=sd(Yt.join(i,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(i=process.env[e+"_PREBUILD"])}catch{}if(!sw){var t=ed(Yt.join(i,"build/Release"),td);if(t)return t;var n=ed(Yt.join(i,"build/Debug"),td);if(n)return n}var s=a(i);if(s)return s;var r=a(Yt.dirname(process.execPath));if(r)return r;var o=["platform="+Pa,"arch="+Ra,"runtime="+Aa,"abi="+Qp,"uv="+od,Ba?"armv="+Ba:"","libc="+rd,"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+`
4
+ `+r),i.push(s+"m+"+Fs.exports.humanize(this.diff)+"\x1B[0m")}else i[0]=xb()+e+" "+i[0]}function xb(){return $e.inspectOpts.hideDate?"":new Date().toISOString()+" "}function yb(...i){return process.stderr.write(Ls.formatWithOptions($e.inspectOpts,...i)+`
5
+ `)}function bb(i){i?process.env.DEBUG=i:delete process.env.DEBUG}function wb(){return process.env.DEBUG}function _b(i){i.inspectOpts={};let e=Object.keys($e.inspectOpts);for(let t=0;t<e.length;t++)i.inspectOpts[e[t]]=$e.inspectOpts[e[t]]}Fs.exports=ha()($e);var{formatters:Lp}=Fs.exports;Lp.o=function(i){return this.inspectOpts.colors=this.useColors,Ls.inspect(i,this.inspectOpts).split(`
6
+ `).map(e=>e.trim()).join(" ")};Lp.O=function(i){return this.inspectOpts.colors=this.useColors,Ls.inspect(i,this.inspectOpts)}});var se=C((D2,xa)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?xa.exports=jp():xa.exports=Fp()});var _i=C(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.Transport=void 0;var Sb=require("events"),Eb=$n(),kb=Ap(),Cb=se(),Up=(0,Cb.default)("engine:transport");function Tb(){}var Us=class extends Sb.EventEmitter{get readyState(){return this._readyState}set readyState(e){Up("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?Eb:kb,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||Tb))}onError(e,t){if(this.listeners("error").length){let n=new Error(e);n.type="TransportError",n.description=t,this.emit("error",n)}else Up("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")}};Hs.Transport=Us;Us.upgradesTo=[]});var ba=C(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.Polling=void 0;var Mb=_i(),Hp=require("zlib"),Ob=Os(),Ab=se(),lt=(0,Ab.default)("engine:polling"),Rb={gzip:Hp.createGzip,deflate:Hp.createDeflate},ya=class extends Mb.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){lt("request overlap"),this.onError("overlap from client"),t.writeHead(400),t.end();return}lt("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&&(lt("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([]):"",r=()=>{e.removeListener("data",a),e.removeListener("end",l),e.removeListener("close",o),this.dataReq=this.dataRes=s=null},o=()=>{r(),this.onError("data request connection closed prematurely")},a=p=>{let f;n?(s=Buffer.concat([s,p]),f=s.length):(s+=p,f=Buffer.byteLength(s)),f>this.maxHttpBufferSize&&(t.writeHead(413).end(),r())},l=()=>{this.onData(s);let p={"Content-Type":"text/html","Content-Length":"2"};t.writeHead(200,this.headers(e,p)),t.end("ok"),r()};e.on("close",o),n||e.setEncoding("utf8"),e.on("data",a),e.on("end",l)}onData(e){lt('received "%s"',e);let t=n=>{if(n.type==="close")return lt("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&&(lt("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let s=e.some(r=>r.options&&r.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){lt('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=f=>{o["Content-Length"]=typeof f=="string"?Buffer.byteLength(f):f.length,this.res.writeHead(200,this.headers(this.req,o)),this.res.end(f),n()};if(!this.httpCompression||!t.compress){a(e);return}if((s?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let p=Ob(this.req).encodings(["gzip","deflate"]);if(!p){a(e);return}this.compress(e,p,(f,m)=>{if(f){this.res.writeHead(500),this.res.end(),n(f);return}o["Content-Encoding"]=p,a(m)})}compress(e,t,n){lt("compressing");let s=[],r=0;Rb[t](this.httpCompression).on("error",n).on("data",function(o){s.push(o),r+=o.length}).on("end",function(){n(null,Buffer.concat(s,r))}).end(e)}doClose(e){lt("closing");let t;this.dataReq&&(lt("aborting ongoing data request"),this.dataReq.destroy());let n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(lt("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(lt("transport discarded - closing right away"),n()):(lt("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}};zs.Polling=ya});var zp=C($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.JSONP=void 0;var Pb=ba(),Bb=require("querystring"),jb=/\\\\n/g,Nb=/(\\)?\\n/g,wa=class extends Pb.Polling{constructor(e){super(e),this.head="___eio["+(e._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(e){e=Bb.parse(e).d,typeof e=="string"&&(e=e.replace(Nb,function(t,n){return n?t:`
7
+ `}),super.onData(e.replace(jb,"\\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)}};$s.JSONP=wa});var Wp=C(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.WebSocket=void 0;var Db=_i(),Ib=se(),$p=(0,Ib.default)("engine:ws"),_a=class extends Db.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();$p('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){$p("closing"),this.socket.close(),e&&e()}};Ws.WebSocket=_a});var Ea=C(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.WebTransport=void 0;var qb=_i(),Lb=se(),Fb=$n(),Gi=(0,Lb.default)("engine:webtransport"),Sa=class extends qb.Transport{constructor(e,t,n){super({_query:{EIO:"4"}}),this.session=e;let s=(0,Fb.createPacketEncoderStream)();s.readable.pipeTo(t.writable).catch(()=>{Gi("the stream was closed")}),this.writer=s.writable.getWriter(),(async()=>{try{for(;;){let{value:r,done:o}=await n.read();if(o){Gi("session is closed");break}Gi("received chunk: %o",r),this.onPacket(r)}}catch(r){Gi("error while reading: %s",r.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()}};Vs.WebTransport=Sa});var Ca=C(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});var Ub=ba(),Hb=zp(),zb=Wp(),$b=Ea();ka.default={polling:Vp,websocket:zb.WebSocket,webtransport:$b.WebTransport};function Vp(i){return typeof i._query.j=="string"?new Hb.JSONP(i):new Ub.Polling(i)}Vp.upgradesTo=["websocket","webtransport"]});var Ma=C(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.Socket=void 0;var Wb=require("events"),Vb=se(),Kt=require("timers"),re=(0,Vb.default)("engine:socket"),Ta=class extends Wb.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,s,r){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=r,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 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,Kt.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,Kt.setTimeout)(()=>{re("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,Kt.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,Kt.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),r=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",r),this.transport.once("close",o),this.cleanupFn.push(function(){e.removeListener("error",t),e.removeListener("ready",n),e.removeListener("packet",s),e.removeListener("drain",r),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,Kt.setTimeout)(()=>{re("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),n,s=f=>{f.type==="ping"&&f.data==="probe"?(re("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(n),n=setInterval(r,100)):f.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())},r=()=>{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,Kt.clearTimeout)(t),e.removeListener("packet",s),e.removeListener("close",l),e.removeListener("error",a),this.removeListener("close",p)},a=f=>{re("client did not complete upgrade - %s",f),o(),e.close(),e=null},l=()=>{a("transport closed")},p=()=>{a("socket closed")};e.on("packet",s),e.once("close",l),e.once("error",a),this.once("close",p)}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,Kt.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,Kt.clearTimeout)(this.pingIntervalTimer),(0,Kt.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"){re('sending packet "%s" (%s)',e,t),n.compress=n.compress!==!1;let r={type:e,options:n};t&&(r.data=t),this.emit("packetCreate",r),this.writeBuffer.push(r),typeof s=="function"&&this.packetsFn.push(s),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 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){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"))}};Ks.Socket=Ta});var Yp=C(Oa=>{"use strict";Oa.parse=Qb;Oa.serialize=ew;var Kb=Object.prototype.toString,Gb=Object.prototype.hasOwnProperty,Yb=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Jb=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,Xb=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Zb=/^[\u0020-\u003A\u003D-\u007E]*$/;function Qb(i,e){if(typeof i!="string")throw new TypeError("argument str must be a string");var t={},n=i.length;if(n<2)return t;var s=e&&e.decode||tw,r=0,o=0,a=0;do{if(o=i.indexOf("=",r),o===-1)break;if(a=i.indexOf(";",r),a===-1)a=n;else if(o>a){r=i.lastIndexOf(";",o-1)+1;continue}var l=Kp(i,r,o),p=Gp(i,o,l),f=i.slice(l,p);if(!Gb.call(t,f)){var m=Kp(i,o+1,a),_=Gp(i,a,m);i.charCodeAt(m)===34&&i.charCodeAt(_-1)===34&&(m++,_--);var E=i.slice(m,_);t[f]=nw(E,s)}r=a+1}while(r<n);return t}function Kp(i,e,t){do{var n=i.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<t);return t}function Gp(i,e,t){for(;e>t;){var n=i.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return t}function ew(i,e,t){var n=t&&t.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!Yb.test(i))throw new TypeError("argument name is invalid");var s=n(e);if(!Jb.test(s))throw new TypeError("argument val is invalid");var r=i+"="+s;if(!t)return r;if(t.maxAge!=null){var o=Math.floor(t.maxAge);if(!isFinite(o))throw new TypeError("option maxAge is invalid");r+="; Max-Age="+o}if(t.domain){if(!Xb.test(t.domain))throw new TypeError("option domain is invalid");r+="; Domain="+t.domain}if(t.path){if(!Zb.test(t.path))throw new TypeError("option path is invalid");r+="; Path="+t.path}if(t.expires){var a=t.expires;if(!iw(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");r+="; Expires="+a.toUTCString()}if(t.httpOnly&&(r+="; HttpOnly"),t.secure&&(r+="; Secure"),t.partitioned&&(r+="; Partitioned"),t.priority){var l=typeof t.priority=="string"?t.priority.toLowerCase():t.priority;switch(l){case"low":r+="; Priority=Low";break;case"medium":r+="; Priority=Medium";break;case"high":r+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(t.sameSite){var p=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(p){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return r}function tw(i){return i.indexOf("%")!==-1?decodeURIComponent(i):i}function iw(i){return Kb.call(i)==="[object Date]"}function nw(i,e){try{return e(i)}catch{return i}}});var Gt=C((W2,Zp)=>{"use strict";var Jp=["nodebuffer","arraybuffer","fragments"],Xp=typeof Blob<"u";Xp&&Jp.push("blob");Zp.exports={BINARY_TYPES:Jp,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Xp,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var hd=C((V2,fd)=>{var id=require("fs"),Yt=require("path"),nd=require("os"),sd=typeof __webpack_require__=="function"?__non_webpack_require__:require,sw=process.config&&process.config.variables||{},rw=!!process.env.PREBUILDS_ONLY,Qp=process.versions.modules,Aa=cw()?"electron":aw()?"node-webkit":"node",Ra=process.env.npm_config_arch||nd.arch(),Pa=process.env.npm_config_platform||nd.platform(),rd=process.env.LIBC||(lw(Pa)?"musl":"glibc"),Ba=process.env.ARM_VERSION||(Ra==="arm64"?"8":sw.arm_version)||"",od=(process.versions.uv||"").split(".")[0];fd.exports=qt;function qt(i){return sd(qt.resolve(i))}qt.resolve=qt.path=function(i){i=Yt.resolve(i||".");try{var e=sd(Yt.join(i,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(i=process.env[e+"_PREBUILD"])}catch{}if(!rw){var t=ed(Yt.join(i,"build/Release"),td);if(t)return t;var n=ed(Yt.join(i,"build/Debug"),td);if(n)return n}var s=a(i);if(s)return s;var r=a(Yt.dirname(process.execPath));if(r)return r;var o=["platform="+Pa,"arch="+Ra,"runtime="+Aa,"abi="+Qp,"uv="+od,Ba?"armv="+Ba:"","libc="+rd,"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+`
8
8
  loaded from: `+i+`
9
- `);function a(l){var p=ja(Yt.join(l,"prebuilds")).map(ad),f=p.filter(cd(Pa,Ra)).sort(ld)[0];if(f){var m=Yt.join(l,"prebuilds",f.name),_=ja(m).map(ud),E=_.filter(pd(Aa,Qp)),k=E.sort(dd(Aa))[0];if(k)return Yt.join(m,k.file)}}};function ja(i){try{return id.readdirSync(i)}catch{return[]}}function ed(i,e){var t=ja(i).filter(e);return t[0]&&Yt.join(i,t[0])}function td(i){return/\.node$/.test(i)}function ad(i){var e=i.split("-");if(e.length===2){var t=e[0],n=e[1].split("+");if(t&&n.length&&n.every(Boolean))return{name:i,platform:t,architectures:n}}}function cd(i,e){return function(t){return t==null||t.platform!==i?!1:t.architectures.includes(e)}}function ld(i,e){return i.architectures.length-e.architectures.length}function ud(i){var e=i.split("."),t=e.pop(),n={file:i,specificity:0};if(t==="node"){for(var s=0;s<e.length;s++){var r=e[s];if(r==="node"||r==="electron"||r==="node-webkit")n.runtime=r;else if(r==="napi")n.napi=!0;else if(r.slice(0,3)==="abi")n.abi=r.slice(3);else if(r.slice(0,2)==="uv")n.uv=r.slice(2);else if(r.slice(0,4)==="armv")n.armv=r.slice(4);else if(r==="glibc"||r==="musl")n.libc=r;else continue;n.specificity++}return n}}function pd(i,e){return function(t){return!(t==null||t.runtime&&t.runtime!==i&&!rw(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==od||t.armv&&t.armv!==Ba||t.libc&&t.libc!==rd)}}function rw(i){return i.runtime==="node"&&i.napi}function dd(i){return function(e,t){return e.runtime!==t.runtime?e.runtime===i?-1:1:e.abi!==t.abi?e.abi?-1:1:e.specificity!==t.specificity?e.specificity>t.specificity?-1:1:0}}function ow(){return!!(process.versions&&process.versions.nw)}function aw(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function cw(i){return i==="linux"&&id.existsSync("/etc/alpine-release")}qt.parseTags=ud;qt.matchTags=pd;qt.compareTags=dd;qt.parseTuple=ad;qt.matchTuple=cd;qt.compareTuples=ld});var Da=C((V2,Ia)=>{var Na=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof Na.addon=="function"?Ia.exports=Na.addon.bind(Na):Ia.exports=hd()});var vd=C((K2,md)=>{"use strict";var lw=(i,e,t,n,s)=>{for(var r=0;r<s;r++)t[n+r]=i[r]^e[r&3]},uw=(i,e)=>{let t=i.length;for(var n=0;n<t;n++)i[n]^=e[n&3]};md.exports={mask:lw,unmask:uw}});var gd=C((G2,qa)=>{"use strict";try{qa.exports=Da()(__dirname)}catch{qa.exports=vd()}});var Wn=C((Y2,Gs)=>{"use strict";var{EMPTY_BUFFER:pw}=Gt(),La=Buffer[Symbol.species];function dw(i,e){if(i.length===0)return pw;if(i.length===1)return i[0];let t=Buffer.allocUnsafe(e),n=0;for(let s=0;s<i.length;s++){let r=i[s];t.set(r,n),n+=r.length}return n<e?new La(t.buffer,t.byteOffset,n):t}function xd(i,e,t,n,s){for(let r=0;r<s;r++)t[n+r]=i[r]^e[r&3]}function yd(i,e){for(let t=0;t<i.length;t++)i[t]^=e[t&3]}function fw(i){return i.length===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.length)}function Fa(i){if(Fa.readOnly=!0,Buffer.isBuffer(i))return i;let e;return i instanceof ArrayBuffer?e=new La(i):ArrayBuffer.isView(i)?e=new La(i.buffer,i.byteOffset,i.byteLength):(e=Buffer.from(i),Fa.readOnly=!1),e}Gs.exports={concat:dw,mask:xd,toArrayBuffer:fw,toBuffer:Fa,unmask:yd};if(!process.env.WS_NO_BUFFER_UTIL)try{let i=gd();Gs.exports.mask=function(e,t,n,s,r){r<48?xd(e,t,n,s,r):i.mask(e,t,n,s,r)},Gs.exports.unmask=function(e,t){e.length<32?yd(e,t):i.unmask(e,t)}}catch{}});var _d=C((J2,wd)=>{"use strict";var bd=Symbol("kDone"),Ua=Symbol("kRun"),Ha=class{constructor(e){this[bd]=()=>{this.pending--,this[Ua]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Ua]()}[Ua](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[bd])}}};wd.exports=Ha});var Kn=C((X2,Cd)=>{"use strict";var Vn=require("zlib"),Sd=Wn(),hw=_d(),{kStatusCode:Ed}=Gt(),mw=Buffer[Symbol.species],vw=Buffer.from([0,0,255,255]),Js=Symbol("permessage-deflate"),Jt=Symbol("total-length"),Yi=Symbol("callback"),li=Symbol("buffers"),Ji=Symbol("error"),Ys,za=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,!Ys){let s=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Ys=new hw(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[Yi];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 r=+s;if(!Number.isInteger(r)||r<8||r>15)throw new TypeError(`Invalid value for parameter "${n}": ${s}`);s=r}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${s}`)}else if(n==="server_max_window_bits"){let r=+s;if(!Number.isInteger(r)||r<8||r>15)throw new TypeError(`Invalid value for parameter "${n}": ${s}`);s=r}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){Ys.add(s=>{this._decompress(e,t,(r,o)=>{s(),n(r,o)})})}compress(e,t,n){Ys.add(s=>{this._compress(e,t,(r,o)=>{s(),n(r,o)})})}_decompress(e,t,n){let s=this._isServer?"client":"server";if(!this._inflate){let r=`${s}_max_window_bits`,o=typeof this.params[r]!="number"?Vn.Z_DEFAULT_WINDOWBITS:this.params[r];this._inflate=Vn.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[Js]=this,this._inflate[Jt]=0,this._inflate[li]=[],this._inflate.on("error",xw),this._inflate.on("data",kd)}this._inflate[Yi]=n,this._inflate.write(e),t&&this._inflate.write(vw),this._inflate.flush(()=>{let r=this._inflate[Ji];if(r){this._inflate.close(),this._inflate=null,n(r);return}let o=Sd.concat(this._inflate[li],this._inflate[Jt]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Jt]=0,this._inflate[li]=[],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 r=`${s}_max_window_bits`,o=typeof this.params[r]!="number"?Vn.Z_DEFAULT_WINDOWBITS:this.params[r];this._deflate=Vn.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[Jt]=0,this._deflate[li]=[],this._deflate.on("data",gw)}this._deflate[Yi]=n,this._deflate.write(e),this._deflate.flush(Vn.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let r=Sd.concat(this._deflate[li],this._deflate[Jt]);t&&(r=new mw(r.buffer,r.byteOffset,r.length-4)),this._deflate[Yi]=null,this._deflate[Jt]=0,this._deflate[li]=[],t&&this.params[`${s}_no_context_takeover`]&&this._deflate.reset(),n(null,r)})}};Cd.exports=za;function gw(i){this[li].push(i),this[Jt]+=i.length}function kd(i){if(this[Jt]+=i.length,this[Js]._maxPayload<1||this[Jt]<=this[Js]._maxPayload){this[li].push(i);return}this[Ji]=new RangeError("Max payload size exceeded"),this[Ji].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Ji][Ed]=1009,this.removeListener("data",kd),this.reset()}function xw(i){if(this[Js]._inflate=null,this[Ji]){this[Yi](this[Ji]);return}i[Ed]=1007,this[Yi](i)}});var Md=C((Z2,Td)=>{"use strict";function yw(i){let e=i.length,t=0;for(;t<e;)if((i[t]&128)===0)t++;else if((i[t]&224)===192){if(t+1===e||(i[t+1]&192)!==128||(i[t]&254)===192)return!1;t+=2}else if((i[t]&240)===224){if(t+2>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||i[t]===224&&(i[t+1]&224)===128||i[t]===237&&(i[t+1]&224)===160)return!1;t+=3}else if((i[t]&248)===240){if(t+3>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||(i[t+3]&192)!==128||i[t]===240&&(i[t+1]&240)===128||i[t]===244&&i[t+1]>143||i[t]>244)return!1;t+=4}else return!1;return!0}Td.exports=yw});var Od=C((Q2,$a)=>{"use strict";try{$a.exports=Da()(__dirname)}catch{$a.exports=Md()}});var Xi=C((eT,Xs)=>{"use strict";var{isUtf8:Ad}=require("buffer"),{hasBlob:bw}=Gt(),ww=[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 _w(i){return i>=1e3&&i<=1014&&i!==1004&&i!==1005&&i!==1006||i>=3e3&&i<=4999}function Wa(i){let e=i.length,t=0;for(;t<e;)if((i[t]&128)===0)t++;else if((i[t]&224)===192){if(t+1===e||(i[t+1]&192)!==128||(i[t]&254)===192)return!1;t+=2}else if((i[t]&240)===224){if(t+2>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||i[t]===224&&(i[t+1]&224)===128||i[t]===237&&(i[t+1]&224)===160)return!1;t+=3}else if((i[t]&248)===240){if(t+3>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||(i[t+3]&192)!==128||i[t]===240&&(i[t+1]&240)===128||i[t]===244&&i[t+1]>143||i[t]>244)return!1;t+=4}else return!1;return!0}function Sw(i){return bw&&typeof i=="object"&&typeof i.arrayBuffer=="function"&&typeof i.type=="string"&&typeof i.stream=="function"&&(i[Symbol.toStringTag]==="Blob"||i[Symbol.toStringTag]==="File")}Xs.exports={isBlob:Sw,isValidStatusCode:_w,isValidUTF8:Wa,tokenChars:ww};if(Ad)Xs.exports.isValidUTF8=function(i){return i.length<24?Wa(i):Ad(i)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let i=Od();Xs.exports.isValidUTF8=function(e){return e.length<32?Wa(e):i(e)}}catch{}});var Ja=C((tT,Dd)=>{"use strict";var{Writable:Ew}=require("stream"),Rd=Kn(),{BINARY_TYPES:kw,EMPTY_BUFFER:Pd,kStatusCode:Cw,kWebSocket:Tw}=Gt(),{concat:Va,toArrayBuffer:Mw,unmask:Ow}=Wn(),{isValidStatusCode:Aw,isValidUTF8:Bd}=Xi(),Zs=Buffer[Symbol.species],vt=0,jd=1,Nd=2,Id=3,Ka=4,Ga=5,Qs=6,Ya=class extends Ew{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||kw[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[Tw]=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=vt}_write(e,t,n){if(this._opcode===8&&this._state==vt)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 Zs(n.buffer,n.byteOffset+e,n.length-e),new Zs(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 Zs(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 vt:this.getInfo(e);break;case jd:this.getPayloadLength16(e);break;case Nd:this.getPayloadLength64(e);break;case Id:this.getMask();break;case Ka:this.getData(e);break;case Ga:case Qs: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[Rd.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=jd:this._payloadLength===127?this._state=Nd: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=Id:this._state=Ka}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Ka}getData(e){let t=Pd;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&&Ow(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=Ga,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[Rd.extensionName].decompress(e,this._fin,(s,r)=>{if(s)return t(s);if(r.length){if(this._messageLength+=r.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(r)}this.dataMessage(t),this._state===vt&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=vt;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=Va(n,t):this._binaryType==="arraybuffer"?s=Mw(Va(n,t)):this._binaryType==="blob"?s=new Blob(n):s=n,this._allowSynchronousEvents?(this.emit("message",s,!0),this._state=vt):(this._state=Qs,setImmediate(()=>{this.emit("message",s,!0),this._state=vt,this.startLoop(e)}))}else{let s=Va(n,t);if(!this._skipUTF8Validation&&!Bd(s)){let r=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(r);return}this._state===Ga||this._allowSynchronousEvents?(this.emit("message",s,!1),this._state=vt):(this._state=Qs,setImmediate(()=>{this.emit("message",s,!1),this._state=vt,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Pd),this.end();else{let n=e.readUInt16BE(0);if(!Aw(n)){let r=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(r);return}let s=new Zs(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Bd(s)){let r=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(r);return}this._loop=!1,this.emit("conclude",n,s),this.end()}this._state=vt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=vt):(this._state=Qs,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=vt,this.startLoop(t)}))}createError(e,t,n,s,r){this._loop=!1,this._errored=!0;let o=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=r,o[Cw]=s,o}};Dd.exports=Ya});var Qa=C((nT,Fd)=>{"use strict";var{Duplex:iT}=require("stream"),{randomFillSync:Rw}=require("crypto"),qd=Kn(),{EMPTY_BUFFER:Pw,kWebSocket:Bw,NOOP:jw}=Gt(),{isBlob:Zi,isValidStatusCode:Nw}=Xi(),{mask:Ld,toBuffer:Si}=Wn(),gt=Symbol("kByteLength"),Iw=Buffer.alloc(4),er=8*1024,Ei,Qi=er,Rt=0,Dw=1,qw=2,Xa=class i{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=Rt,this.onerror=jw,this[Bw]=void 0}static frame(e,t){let n,s=!1,r=2,o=!1;t.mask&&(n=t.maskBuffer||Iw,t.generateMask?t.generateMask(n):(Qi===er&&(Ei===void 0&&(Ei=Buffer.alloc(er)),Rw(Ei,0,er),Qi=0),n[0]=Ei[Qi++],n[1]=Ei[Qi++],n[2]=Ei[Qi++],n[3]=Ei[Qi++]),o=(n[0]|n[1]|n[2]|n[3])===0,r=6);let a;typeof e=="string"?(!t.mask||o)&&t[gt]!==void 0?a=t[gt]:(e=Buffer.from(e),a=e.length):(a=e.length,s=t.mask&&t.readOnly&&!o);let l=a;a>=65536?(r+=8,l=127):a>125&&(r+=2,l=126);let p=Buffer.allocUnsafe(s?a+r:r);return p[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(p[0]|=64),p[1]=l,l===126?p.writeUInt16BE(a,2):l===127&&(p[2]=p[3]=0,p.writeUIntBE(a,4,6)),t.mask?(p[1]|=128,p[r-4]=n[0],p[r-3]=n[1],p[r-2]=n[2],p[r-1]=n[3],o?[p,e]:s?(Ld(e,n,p,r,a),[p]):(Ld(e,n,e,0,a),[p,e])):[p,e]}close(e,t,n,s){let r;if(e===void 0)r=Pw;else{if(typeof e!="number"||!Nw(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)r=Buffer.allocUnsafe(2),r.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");r=Buffer.allocUnsafe(2+a),r.writeUInt16BE(e,0),typeof t=="string"?r.write(t,2):r.set(t,2)}}let o={[gt]:r.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Rt?this.enqueue([this.dispatch,r,!1,o,s]):this.sendFrame(i.frame(r,o),s)}ping(e,t,n){let s,r;if(typeof e=="string"?(s=Buffer.byteLength(e),r=!1):Zi(e)?(s=e.size,r=!1):(e=Si(e),s=e.length,r=Si.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[gt]:s,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:r,rsv1:!1};Zi(e)?this._state!==Rt?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Rt?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(i.frame(e,o),n)}pong(e,t,n){let s,r;if(typeof e=="string"?(s=Buffer.byteLength(e),r=!1):Zi(e)?(s=e.size,r=!1):(e=Si(e),s=e.length,r=Si.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[gt]:s,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:r,rsv1:!1};Zi(e)?this._state!==Rt?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Rt?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(i.frame(e,o),n)}send(e,t,n){let s=this._extensions[qd.extensionName],r=t.binary?2:1,o=t.compress,a,l;typeof e=="string"?(a=Buffer.byteLength(e),l=!1):Zi(e)?(a=e.size,l=!1):(e=Si(e),a=e.length,l=Si.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,r=0),t.fin&&(this._firstFragment=!0);let p={[gt]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:r,readOnly:l,rsv1:o};Zi(e)?this._state!==Rt?this.enqueue([this.getBlobData,e,this._compress,p,n]):this.getBlobData(e,this._compress,p,n):this._state!==Rt?this.enqueue([this.dispatch,e,this._compress,p,n]):this.dispatch(e,this._compress,p,n)}getBlobData(e,t,n,s){this._bufferedBytes+=n[gt],this._state=qw,e.arrayBuffer().then(r=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Za,this,a,s);return}this._bufferedBytes-=n[gt];let o=Si(r);t?this.dispatch(o,t,n,s):(this._state=Rt,this.sendFrame(i.frame(o,n),s),this.dequeue())}).catch(r=>{process.nextTick(Lw,this,r,s)})}dispatch(e,t,n,s){if(!t){this.sendFrame(i.frame(e,n),s);return}let r=this._extensions[qd.extensionName];this._bufferedBytes+=n[gt],this._state=Dw,r.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");Za(this,l,s);return}this._bufferedBytes-=n[gt],this._state=Rt,n.readOnly=!1,this.sendFrame(i.frame(a,n),s),this.dequeue()})}dequeue(){for(;this._state===Rt&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][gt],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][gt],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)}};Fd.exports=Xa;function Za(i,e,t){typeof t=="function"&&t(e);for(let n=0;n<i._queue.length;n++){let s=i._queue[n],r=s[s.length-1];typeof r=="function"&&r(e)}}function Lw(i,e,t){Za(i,e,t),i.onerror(e)}});var Yd=C((sT,Gd)=>{"use strict";var{kForOnEventAttribute:Gn,kListener:ec}=Gt(),Ud=Symbol("kCode"),Hd=Symbol("kData"),zd=Symbol("kError"),$d=Symbol("kMessage"),Wd=Symbol("kReason"),en=Symbol("kTarget"),Vd=Symbol("kType"),Kd=Symbol("kWasClean"),Xt=class{constructor(e){this[en]=null,this[Vd]=e}get target(){return this[en]}get type(){return this[Vd]}};Object.defineProperty(Xt.prototype,"target",{enumerable:!0});Object.defineProperty(Xt.prototype,"type",{enumerable:!0});var ki=class extends Xt{constructor(e,t={}){super(e),this[Ud]=t.code===void 0?0:t.code,this[Wd]=t.reason===void 0?"":t.reason,this[Kd]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[Ud]}get reason(){return this[Wd]}get wasClean(){return this[Kd]}};Object.defineProperty(ki.prototype,"code",{enumerable:!0});Object.defineProperty(ki.prototype,"reason",{enumerable:!0});Object.defineProperty(ki.prototype,"wasClean",{enumerable:!0});var tn=class extends Xt{constructor(e,t={}){super(e),this[zd]=t.error===void 0?null:t.error,this[$d]=t.message===void 0?"":t.message}get error(){return this[zd]}get message(){return this[$d]}};Object.defineProperty(tn.prototype,"error",{enumerable:!0});Object.defineProperty(tn.prototype,"message",{enumerable:!0});var Yn=class extends Xt{constructor(e,t={}){super(e),this[Hd]=t.data===void 0?null:t.data}get data(){return this[Hd]}};Object.defineProperty(Yn.prototype,"data",{enumerable:!0});var Fw={addEventListener(i,e,t={}){for(let s of this.listeners(i))if(!t[Gn]&&s[ec]===e&&!s[Gn])return;let n;if(i==="message")n=function(r,o){let a=new Yn("message",{data:o?r:r.toString()});a[en]=this,tr(e,this,a)};else if(i==="close")n=function(r,o){let a=new ki("close",{code:r,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[en]=this,tr(e,this,a)};else if(i==="error")n=function(r){let o=new tn("error",{error:r,message:r.message});o[en]=this,tr(e,this,o)};else if(i==="open")n=function(){let r=new Xt("open");r[en]=this,tr(e,this,r)};else return;n[Gn]=!!t[Gn],n[ec]=e,t.once?this.once(i,n):this.on(i,n)},removeEventListener(i,e){for(let t of this.listeners(i))if(t[ec]===e&&!t[Gn]){this.removeListener(i,t);break}}};Gd.exports={CloseEvent:ki,ErrorEvent:tn,Event:Xt,EventTarget:Fw,MessageEvent:Yn};function tr(i,e,t){typeof i=="object"&&i.handleEvent?i.handleEvent.call(i,t):i.call(e,t)}});var tc=C((rT,Jd)=>{"use strict";var{tokenChars:Jn}=Xi();function Lt(i,e,t){i[e]===void 0?i[e]=[t]:i[e].push(t)}function Uw(i){let e=Object.create(null),t=Object.create(null),n=!1,s=!1,r=!1,o,a,l=-1,p=-1,f=-1,m=0;for(;m<i.length;m++)if(p=i.charCodeAt(m),o===void 0)if(f===-1&&Jn[p]===1)l===-1&&(l=m);else if(m!==0&&(p===32||p===9))f===-1&&l!==-1&&(f=m);else if(p===59||p===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${m}`);f===-1&&(f=m);let E=i.slice(l,f);p===44?(Lt(e,E,t),t=Object.create(null)):o=E,l=f=-1}else throw new SyntaxError(`Unexpected character at index ${m}`);else if(a===void 0)if(f===-1&&Jn[p]===1)l===-1&&(l=m);else if(p===32||p===9)f===-1&&l!==-1&&(f=m);else if(p===59||p===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${m}`);f===-1&&(f=m),Lt(t,i.slice(l,f),!0),p===44&&(Lt(e,o,t),t=Object.create(null),o=void 0),l=f=-1}else if(p===61&&l!==-1&&f===-1)a=i.slice(l,m),l=f=-1;else throw new SyntaxError(`Unexpected character at index ${m}`);else if(s){if(Jn[p]!==1)throw new SyntaxError(`Unexpected character at index ${m}`);l===-1?l=m:n||(n=!0),s=!1}else if(r)if(Jn[p]===1)l===-1&&(l=m);else if(p===34&&l!==-1)r=!1,f=m;else if(p===92)s=!0;else throw new SyntaxError(`Unexpected character at index ${m}`);else if(p===34&&i.charCodeAt(m-1)===61)r=!0;else if(f===-1&&Jn[p]===1)l===-1&&(l=m);else if(l!==-1&&(p===32||p===9))f===-1&&(f=m);else if(p===59||p===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${m}`);f===-1&&(f=m);let E=i.slice(l,f);n&&(E=E.replace(/\\/g,""),n=!1),Lt(t,a,E),p===44&&(Lt(e,o,t),t=Object.create(null),o=void 0),a=void 0,l=f=-1}else throw new SyntaxError(`Unexpected character at index ${m}`);if(l===-1||r||p===32||p===9)throw new SyntaxError("Unexpected end of input");f===-1&&(f=m);let _=i.slice(l,f);return o===void 0?Lt(e,_,t):(a===void 0?Lt(t,_,!0):n?Lt(t,a,_.replace(/\\/g,"")):Lt(t,a,_),Lt(e,o,t)),e}function Hw(i){return Object.keys(i).map(e=>{let t=i[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(s=>{let r=n[s];return Array.isArray(r)||(r=[r]),r.map(o=>o===!0?s:`${s}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Jd.exports={format:Hw,parse:Uw}});var rr=C((cT,lf)=>{"use strict";var zw=require("events"),$w=require("https"),Ww=require("http"),Qd=require("net"),Vw=require("tls"),{randomBytes:Kw,createHash:Gw}=require("crypto"),{Duplex:oT,Readable:aT}=require("stream"),{URL:ic}=require("url"),ui=Kn(),Yw=Ja(),Jw=Qa(),{isBlob:Xw}=Xi(),{BINARY_TYPES:Xd,EMPTY_BUFFER:ir,GUID:Zw,kForOnEventAttribute:nc,kListener:Qw,kStatusCode:e1,kWebSocket:We,NOOP:ef}=Gt(),{EventTarget:{addEventListener:t1,removeEventListener:i1}}=Yd(),{format:n1,parse:s1}=tc(),{toBuffer:r1}=Wn(),o1=30*1e3,tf=Symbol("kAborted"),sc=[8,13],Zt=["CONNECTING","OPEN","CLOSING","CLOSED"],a1=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Q=class i extends zw{constructor(e,t,n){super(),this._binaryType=Xd[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=ir,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=i.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]),nf(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Xd.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 Yw({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),r=new Jw(e,this._extensions,n.generateMask);this._receiver=s,this._sender=r,this._socket=e,s[We]=this,r[We]=this,e[We]=this,s.on("conclude",u1),s.on("drain",p1),s.on("error",d1),s.on("message",f1),s.on("ping",h1),s.on("pong",m1),r.onerror=v1,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",of),e.on("data",sr),e.on("end",af),e.on("error",cf),this._readyState=i.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[ui.extensionName]&&this._extensions[ui.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){ut(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===i.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=i.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),rf(this)}}pause(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===i.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!==i.OPEN){rc(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||ir,t,n)}pong(e,t,n){if(this.readyState===i.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!==i.OPEN){rc(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||ir,t,n)}resume(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===i.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!==i.OPEN){rc(this,e,n);return}let s={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[ui.extensionName]||(s.compress=!1),this._sender.send(e||ir,s,n)}terminate(){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){ut(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=i.CLOSING,this._socket.destroy())}}};Object.defineProperty(Q,"CONNECTING",{enumerable:!0,value:Zt.indexOf("CONNECTING")});Object.defineProperty(Q.prototype,"CONNECTING",{enumerable:!0,value:Zt.indexOf("CONNECTING")});Object.defineProperty(Q,"OPEN",{enumerable:!0,value:Zt.indexOf("OPEN")});Object.defineProperty(Q.prototype,"OPEN",{enumerable:!0,value:Zt.indexOf("OPEN")});Object.defineProperty(Q,"CLOSING",{enumerable:!0,value:Zt.indexOf("CLOSING")});Object.defineProperty(Q.prototype,"CLOSING",{enumerable:!0,value:Zt.indexOf("CLOSING")});Object.defineProperty(Q,"CLOSED",{enumerable:!0,value:Zt.indexOf("CLOSED")});Object.defineProperty(Q.prototype,"CLOSED",{enumerable:!0,value:Zt.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(i=>{Object.defineProperty(Q.prototype,i,{enumerable:!0})});["open","error","close","message"].forEach(i=>{Object.defineProperty(Q.prototype,`on${i}`,{enumerable:!0,get(){for(let e of this.listeners(i))if(e[nc])return e[Qw];return null},set(e){for(let t of this.listeners(i))if(t[nc]){this.removeListener(i,t);break}typeof e=="function"&&this.addEventListener(i,e,{[nc]:!0})}})});Q.prototype.addEventListener=t1;Q.prototype.removeEventListener=i1;lf.exports=Q;function nf(i,e,t,n){let s={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:sc[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(i._autoPong=s.autoPong,!sc.includes(s.protocolVersion))throw new RangeError(`Unsupported protocol version: ${s.protocolVersion} (supported versions: ${sc.join(", ")})`);let r;if(e instanceof ic)r=e;else try{r=new ic(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}r.protocol==="http:"?r.protocol="ws:":r.protocol==="https:"&&(r.protocol="wss:"),i._url=r.href;let o=r.protocol==="wss:",a=r.protocol==="ws+unix:",l;if(r.protocol!=="ws:"&&!o&&!a?l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!r.pathname?l="The URL's pathname is empty":r.hash&&(l="The URL contains a fragment identifier"),l){let T=new SyntaxError(l);if(i._redirects===0)throw T;nr(i,T);return}let p=o?443:80,f=Kw(16).toString("base64"),m=o?$w.request:Ww.request,_=new Set,E;if(s.createConnection=s.createConnection||(o?l1:c1),s.defaultPort=s.defaultPort||p,s.port=r.port||p,s.host=r.hostname.startsWith("[")?r.hostname.slice(1,-1):r.hostname,s.headers={...s.headers,"Sec-WebSocket-Version":s.protocolVersion,"Sec-WebSocket-Key":f,Connection:"Upgrade",Upgrade:"websocket"},s.path=r.pathname+r.search,s.timeout=s.handshakeTimeout,s.perMessageDeflate&&(E=new ui(s.perMessageDeflate!==!0?s.perMessageDeflate:{},!1,s.maxPayload),s.headers["Sec-WebSocket-Extensions"]=n1({[ui.extensionName]:E.offer()})),t.length){for(let T of t){if(typeof T!="string"||!a1.test(T)||_.has(T))throw new SyntaxError("An invalid or duplicated subprotocol was specified");_.add(T)}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),(r.username||r.password)&&(s.auth=`${r.username}:${r.password}`),a){let T=s.path.split(":");s.socketPath=T[0],s.path=T[1]}let k;if(s.followRedirects){if(i._redirects===0){i._originalIpc=a,i._originalSecure=o,i._originalHostOrSocketPath=a?s.socketPath:r.host;let T=n&&n.headers;if(n={...n,headers:{}},T)for(let[O,M]of Object.entries(T))n.headers[O.toLowerCase()]=M}else if(i.listenerCount("redirect")===0){let T=a?i._originalIpc?s.socketPath===i._originalHostOrSocketPath:!1:i._originalIpc?!1:r.host===i._originalHostOrSocketPath;(!T||i._originalSecure&&!o)&&(delete s.headers.authorization,delete s.headers.cookie,T||delete s.headers.host,s.auth=void 0)}s.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(s.auth).toString("base64")),k=i._req=m(s),i._redirects&&i.emit("redirect",i.url,k)}else k=i._req=m(s);s.timeout&&k.on("timeout",()=>{ut(i,k,"Opening handshake has timed out")}),k.on("error",T=>{k===null||k[tf]||(k=i._req=null,nr(i,T))}),k.on("response",T=>{let O=T.headers.location,M=T.statusCode;if(O&&s.followRedirects&&M>=300&&M<400){if(++i._redirects>s.maxRedirects){ut(i,k,"Maximum redirects exceeded");return}k.abort();let A;try{A=new ic(O,e)}catch{let U=new SyntaxError(`Invalid URL: ${O}`);nr(i,U);return}nf(i,A,t,n)}else i.emit("unexpected-response",k,T)||ut(i,k,`Unexpected server response: ${T.statusCode}`)}),k.on("upgrade",(T,O,M)=>{if(i.emit("upgrade",T),i.readyState!==Q.CONNECTING)return;k=i._req=null;let A=T.headers.upgrade;if(A===void 0||A.toLowerCase()!=="websocket"){ut(i,O,"Invalid Upgrade header");return}let I=Gw("sha1").update(f+Zw).digest("base64");if(T.headers["sec-websocket-accept"]!==I){ut(i,O,"Invalid Sec-WebSocket-Accept header");return}let U=T.headers["sec-websocket-protocol"],ie;if(U!==void 0?_.size?_.has(U)||(ie="Server sent an invalid subprotocol"):ie="Server sent a subprotocol but none was requested":_.size&&(ie="Server sent no subprotocol"),ie){ut(i,O,ie);return}U&&(i._protocol=U);let J=T.headers["sec-websocket-extensions"];if(J!==void 0){if(!E){ut(i,O,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let ne;try{ne=s1(J)}catch{ut(i,O,"Invalid Sec-WebSocket-Extensions header");return}let H=Object.keys(ne);if(H.length!==1||H[0]!==ui.extensionName){ut(i,O,"Server indicated an extension that was not requested");return}try{E.accept(ne[ui.extensionName])}catch{ut(i,O,"Invalid Sec-WebSocket-Extensions header");return}i._extensions[ui.extensionName]=E}i.setSocket(O,M,{allowSynchronousEvents:s.allowSynchronousEvents,generateMask:s.generateMask,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation})}),s.finishRequest?s.finishRequest(k,i):k.end()}function nr(i,e){i._readyState=Q.CLOSING,i._errorEmitted=!0,i.emit("error",e),i.emitClose()}function c1(i){return i.path=i.socketPath,Qd.connect(i)}function l1(i){return i.path=void 0,!i.servername&&i.servername!==""&&(i.servername=Qd.isIP(i.host)?"":i.host),Vw.connect(i)}function ut(i,e,t){i._readyState=Q.CLOSING;let n=new Error(t);Error.captureStackTrace(n,ut),e.setHeader?(e[tf]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(nr,i,n)):(e.destroy(n),e.once("error",i.emit.bind(i,"error")),e.once("close",i.emitClose.bind(i)))}function rc(i,e,t){if(e){let n=Xw(e)?e.size:r1(e).length;i._socket?i._sender._bufferedBytes+=n:i._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${i.readyState} (${Zt[i.readyState]})`);process.nextTick(t,n)}}function u1(i,e){let t=this[We];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=i,t._socket[We]!==void 0&&(t._socket.removeListener("data",sr),process.nextTick(sf,t._socket),i===1005?t.close():t.close(i,e))}function p1(){let i=this[We];i.isPaused||i._socket.resume()}function d1(i){let e=this[We];e._socket[We]!==void 0&&(e._socket.removeListener("data",sr),process.nextTick(sf,e._socket),e.close(i[e1])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",i))}function Zd(){this[We].emitClose()}function f1(i,e){this[We].emit("message",i,e)}function h1(i){let e=this[We];e._autoPong&&e.pong(i,!this._isServer,ef),e.emit("ping",i)}function m1(i){this[We].emit("pong",i)}function sf(i){i.resume()}function v1(i){let e=this[We];e.readyState!==Q.CLOSED&&(e.readyState===Q.OPEN&&(e._readyState=Q.CLOSING,rf(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",i)))}function rf(i){i._closeTimer=setTimeout(i._socket.destroy.bind(i._socket),o1)}function of(){let i=this[We];this.removeListener("close",of),this.removeListener("data",sr),this.removeListener("end",af),i._readyState=Q.CLOSING;let e;!this._readableState.endEmitted&&!i._closeFrameReceived&&!i._receiver._writableState.errorEmitted&&(e=i._socket.read())!==null&&i._receiver.write(e),i._receiver.end(),this[We]=void 0,clearTimeout(i._closeTimer),i._receiver._writableState.finished||i._receiver._writableState.errorEmitted?i.emitClose():(i._receiver.on("error",Zd),i._receiver.on("finish",Zd))}function sr(i){this[We]._receiver.write(i)||this.pause()}function af(){let i=this[We];i._readyState=Q.CLOSING,i._receiver.end(),this.end()}function cf(){let i=this[We];this.removeListener("error",cf),this.on("error",ef),i&&(i._readyState=Q.CLOSING,this.destroy())}});var ff=C((uT,df)=>{"use strict";var lT=rr(),{Duplex:g1}=require("stream");function uf(i){i.emit("close")}function x1(){!this.destroyed&&this._writableState.finished&&this.destroy()}function pf(i){this.removeListener("error",pf),this.destroy(),this.listenerCount("error")===0&&this.emit("error",i)}function y1(i,e){let t=!0,n=new g1({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return i.on("message",function(r,o){let a=!o&&n._readableState.objectMode?r.toString():r;n.push(a)||i.pause()}),i.once("error",function(r){n.destroyed||(t=!1,n.destroy(r))}),i.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(s,r){if(i.readyState===i.CLOSED){r(s),process.nextTick(uf,n);return}let o=!1;i.once("error",function(l){o=!0,r(l)}),i.once("close",function(){o||r(s),process.nextTick(uf,n)}),t&&i.terminate()},n._final=function(s){if(i.readyState===i.CONNECTING){i.once("open",function(){n._final(s)});return}i._socket!==null&&(i._socket._writableState.finished?(s(),n._readableState.endEmitted&&n.destroy()):(i._socket.once("finish",function(){s()}),i.close()))},n._read=function(){i.isPaused&&i.resume()},n._write=function(s,r,o){if(i.readyState===i.CONNECTING){i.once("open",function(){n._write(s,r,o)});return}i.send(s,o)},n.on("end",x1),n.on("error",pf),n}df.exports=y1});var mf=C((pT,hf)=>{"use strict";var{tokenChars:b1}=Xi();function w1(i){let e=new Set,t=-1,n=-1,s=0;for(s;s<i.length;s++){let o=i.charCodeAt(s);if(n===-1&&b1[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=i.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 r=i.slice(t,s);if(e.has(r))throw new SyntaxError(`The "${r}" subprotocol is duplicated`);return e.add(r),e}hf.exports={parse:w1}});var _f=C((fT,wf)=>{"use strict";var _1=require("events"),or=require("http"),{Duplex:dT}=require("stream"),{createHash:S1}=require("crypto"),vf=tc(),Ci=Kn(),E1=mf(),k1=rr(),{GUID:C1,kWebSocket:T1}=Gt(),M1=/^[+/0-9A-Za-z]{22}==$/,gf=0,xf=1,bf=2,oc=class extends _1{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:k1,...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=or.createServer((n,s)=>{let r=or.STATUS_CODES[426];s.writeHead(426,{"Content-Length":r.length,"Content-Type":"text/plain"}),s.end(r)}),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=O1(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(s,r,o)=>{this.handleUpgrade(s,r,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=gf}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===bf){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Xn,this);return}if(e&&this.once("close",e),this._state!==xf)if(this._state=xf,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(Xn,this):process.nextTick(Xn,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{Xn(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",yf);let r=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){Ti(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){Ti(this,e,t,400,"Invalid Upgrade header");return}if(r===void 0||!M1.test(r)){Ti(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Ti(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Zn(t,400);return}let l=e.headers["sec-websocket-protocol"],p=new Set;if(l!==void 0)try{p=E1.parse(l)}catch{Ti(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let f=e.headers["sec-websocket-extensions"],m={};if(this.options.perMessageDeflate&&f!==void 0){let _=new Ci(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let E=vf.parse(f);E[Ci.extensionName]&&(_.accept(E[Ci.extensionName]),m[Ci.extensionName]=_)}catch{Ti(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let _={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(_,(E,k,T,O)=>{if(!E)return Zn(t,k||401,T,O);this.completeUpgrade(m,r,p,e,t,n,s)});return}if(!this.options.verifyClient(_))return Zn(t,401)}this.completeUpgrade(m,r,p,e,t,n,s)}completeUpgrade(e,t,n,s,r,o,a){if(!r.readable||!r.writable)return r.destroy();if(r[T1])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>gf)return Zn(r,503);let p=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${S1("sha1").update(t+C1).digest("base64")}`],f=new this.options.WebSocket(null,void 0,this.options);if(n.size){let m=this.options.handleProtocols?this.options.handleProtocols(n,s):n.values().next().value;m&&(p.push(`Sec-WebSocket-Protocol: ${m}`),f._protocol=m)}if(e[Ci.extensionName]){let m=e[Ci.extensionName].params,_=vf.format({[Ci.extensionName]:[m]});p.push(`Sec-WebSocket-Extensions: ${_}`),f._extensions=e}this.emit("headers",p,s),r.write(p.concat(`\r
9
+ `);function a(l){var p=ja(Yt.join(l,"prebuilds")).map(ad),f=p.filter(cd(Pa,Ra)).sort(ld)[0];if(f){var m=Yt.join(l,"prebuilds",f.name),_=ja(m).map(ud),E=_.filter(pd(Aa,Qp)),k=E.sort(dd(Aa))[0];if(k)return Yt.join(m,k.file)}}};function ja(i){try{return id.readdirSync(i)}catch{return[]}}function ed(i,e){var t=ja(i).filter(e);return t[0]&&Yt.join(i,t[0])}function td(i){return/\.node$/.test(i)}function ad(i){var e=i.split("-");if(e.length===2){var t=e[0],n=e[1].split("+");if(t&&n.length&&n.every(Boolean))return{name:i,platform:t,architectures:n}}}function cd(i,e){return function(t){return t==null||t.platform!==i?!1:t.architectures.includes(e)}}function ld(i,e){return i.architectures.length-e.architectures.length}function ud(i){var e=i.split("."),t=e.pop(),n={file:i,specificity:0};if(t==="node"){for(var s=0;s<e.length;s++){var r=e[s];if(r==="node"||r==="electron"||r==="node-webkit")n.runtime=r;else if(r==="napi")n.napi=!0;else if(r.slice(0,3)==="abi")n.abi=r.slice(3);else if(r.slice(0,2)==="uv")n.uv=r.slice(2);else if(r.slice(0,4)==="armv")n.armv=r.slice(4);else if(r==="glibc"||r==="musl")n.libc=r;else continue;n.specificity++}return n}}function pd(i,e){return function(t){return!(t==null||t.runtime&&t.runtime!==i&&!ow(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==od||t.armv&&t.armv!==Ba||t.libc&&t.libc!==rd)}}function ow(i){return i.runtime==="node"&&i.napi}function dd(i){return function(e,t){return e.runtime!==t.runtime?e.runtime===i?-1:1:e.abi!==t.abi?e.abi?-1:1:e.specificity!==t.specificity?e.specificity>t.specificity?-1:1:0}}function aw(){return!!(process.versions&&process.versions.nw)}function cw(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function lw(i){return i==="linux"&&id.existsSync("/etc/alpine-release")}qt.parseTags=ud;qt.matchTags=pd;qt.compareTags=dd;qt.parseTuple=ad;qt.matchTuple=cd;qt.compareTuples=ld});var Ia=C((K2,Da)=>{var Na=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof Na.addon=="function"?Da.exports=Na.addon.bind(Na):Da.exports=hd()});var vd=C((G2,md)=>{"use strict";var uw=(i,e,t,n,s)=>{for(var r=0;r<s;r++)t[n+r]=i[r]^e[r&3]},pw=(i,e)=>{let t=i.length;for(var n=0;n<t;n++)i[n]^=e[n&3]};md.exports={mask:uw,unmask:pw}});var gd=C((Y2,qa)=>{"use strict";try{qa.exports=Ia()(__dirname)}catch{qa.exports=vd()}});var Wn=C((J2,Gs)=>{"use strict";var{EMPTY_BUFFER:dw}=Gt(),La=Buffer[Symbol.species];function fw(i,e){if(i.length===0)return dw;if(i.length===1)return i[0];let t=Buffer.allocUnsafe(e),n=0;for(let s=0;s<i.length;s++){let r=i[s];t.set(r,n),n+=r.length}return n<e?new La(t.buffer,t.byteOffset,n):t}function xd(i,e,t,n,s){for(let r=0;r<s;r++)t[n+r]=i[r]^e[r&3]}function yd(i,e){for(let t=0;t<i.length;t++)i[t]^=e[t&3]}function hw(i){return i.length===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.length)}function Fa(i){if(Fa.readOnly=!0,Buffer.isBuffer(i))return i;let e;return i instanceof ArrayBuffer?e=new La(i):ArrayBuffer.isView(i)?e=new La(i.buffer,i.byteOffset,i.byteLength):(e=Buffer.from(i),Fa.readOnly=!1),e}Gs.exports={concat:fw,mask:xd,toArrayBuffer:hw,toBuffer:Fa,unmask:yd};if(!process.env.WS_NO_BUFFER_UTIL)try{let i=gd();Gs.exports.mask=function(e,t,n,s,r){r<48?xd(e,t,n,s,r):i.mask(e,t,n,s,r)},Gs.exports.unmask=function(e,t){e.length<32?yd(e,t):i.unmask(e,t)}}catch{}});var _d=C((X2,wd)=>{"use strict";var bd=Symbol("kDone"),Ua=Symbol("kRun"),Ha=class{constructor(e){this[bd]=()=>{this.pending--,this[Ua]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Ua]()}[Ua](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[bd])}}};wd.exports=Ha});var Kn=C((Z2,Cd)=>{"use strict";var Vn=require("zlib"),Sd=Wn(),mw=_d(),{kStatusCode:Ed}=Gt(),vw=Buffer[Symbol.species],gw=Buffer.from([0,0,255,255]),Js=Symbol("permessage-deflate"),Jt=Symbol("total-length"),Yi=Symbol("callback"),li=Symbol("buffers"),Ji=Symbol("error"),Ys,za=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,!Ys){let s=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Ys=new mw(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[Yi];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 r=+s;if(!Number.isInteger(r)||r<8||r>15)throw new TypeError(`Invalid value for parameter "${n}": ${s}`);s=r}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${s}`)}else if(n==="server_max_window_bits"){let r=+s;if(!Number.isInteger(r)||r<8||r>15)throw new TypeError(`Invalid value for parameter "${n}": ${s}`);s=r}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){Ys.add(s=>{this._decompress(e,t,(r,o)=>{s(),n(r,o)})})}compress(e,t,n){Ys.add(s=>{this._compress(e,t,(r,o)=>{s(),n(r,o)})})}_decompress(e,t,n){let s=this._isServer?"client":"server";if(!this._inflate){let r=`${s}_max_window_bits`,o=typeof this.params[r]!="number"?Vn.Z_DEFAULT_WINDOWBITS:this.params[r];this._inflate=Vn.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[Js]=this,this._inflate[Jt]=0,this._inflate[li]=[],this._inflate.on("error",yw),this._inflate.on("data",kd)}this._inflate[Yi]=n,this._inflate.write(e),t&&this._inflate.write(gw),this._inflate.flush(()=>{let r=this._inflate[Ji];if(r){this._inflate.close(),this._inflate=null,n(r);return}let o=Sd.concat(this._inflate[li],this._inflate[Jt]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Jt]=0,this._inflate[li]=[],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 r=`${s}_max_window_bits`,o=typeof this.params[r]!="number"?Vn.Z_DEFAULT_WINDOWBITS:this.params[r];this._deflate=Vn.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[Jt]=0,this._deflate[li]=[],this._deflate.on("data",xw)}this._deflate[Yi]=n,this._deflate.write(e),this._deflate.flush(Vn.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let r=Sd.concat(this._deflate[li],this._deflate[Jt]);t&&(r=new vw(r.buffer,r.byteOffset,r.length-4)),this._deflate[Yi]=null,this._deflate[Jt]=0,this._deflate[li]=[],t&&this.params[`${s}_no_context_takeover`]&&this._deflate.reset(),n(null,r)})}};Cd.exports=za;function xw(i){this[li].push(i),this[Jt]+=i.length}function kd(i){if(this[Jt]+=i.length,this[Js]._maxPayload<1||this[Jt]<=this[Js]._maxPayload){this[li].push(i);return}this[Ji]=new RangeError("Max payload size exceeded"),this[Ji].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Ji][Ed]=1009,this.removeListener("data",kd),this.reset()}function yw(i){if(this[Js]._inflate=null,this[Ji]){this[Yi](this[Ji]);return}i[Ed]=1007,this[Yi](i)}});var Md=C((Q2,Td)=>{"use strict";function bw(i){let e=i.length,t=0;for(;t<e;)if((i[t]&128)===0)t++;else if((i[t]&224)===192){if(t+1===e||(i[t+1]&192)!==128||(i[t]&254)===192)return!1;t+=2}else if((i[t]&240)===224){if(t+2>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||i[t]===224&&(i[t+1]&224)===128||i[t]===237&&(i[t+1]&224)===160)return!1;t+=3}else if((i[t]&248)===240){if(t+3>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||(i[t+3]&192)!==128||i[t]===240&&(i[t+1]&240)===128||i[t]===244&&i[t+1]>143||i[t]>244)return!1;t+=4}else return!1;return!0}Td.exports=bw});var Od=C((eT,$a)=>{"use strict";try{$a.exports=Ia()(__dirname)}catch{$a.exports=Md()}});var Xi=C((tT,Xs)=>{"use strict";var{isUtf8:Ad}=require("buffer"),{hasBlob:ww}=Gt(),_w=[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 Sw(i){return i>=1e3&&i<=1014&&i!==1004&&i!==1005&&i!==1006||i>=3e3&&i<=4999}function Wa(i){let e=i.length,t=0;for(;t<e;)if((i[t]&128)===0)t++;else if((i[t]&224)===192){if(t+1===e||(i[t+1]&192)!==128||(i[t]&254)===192)return!1;t+=2}else if((i[t]&240)===224){if(t+2>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||i[t]===224&&(i[t+1]&224)===128||i[t]===237&&(i[t+1]&224)===160)return!1;t+=3}else if((i[t]&248)===240){if(t+3>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||(i[t+3]&192)!==128||i[t]===240&&(i[t+1]&240)===128||i[t]===244&&i[t+1]>143||i[t]>244)return!1;t+=4}else return!1;return!0}function Ew(i){return ww&&typeof i=="object"&&typeof i.arrayBuffer=="function"&&typeof i.type=="string"&&typeof i.stream=="function"&&(i[Symbol.toStringTag]==="Blob"||i[Symbol.toStringTag]==="File")}Xs.exports={isBlob:Ew,isValidStatusCode:Sw,isValidUTF8:Wa,tokenChars:_w};if(Ad)Xs.exports.isValidUTF8=function(i){return i.length<24?Wa(i):Ad(i)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let i=Od();Xs.exports.isValidUTF8=function(e){return e.length<32?Wa(e):i(e)}}catch{}});var Ja=C((iT,Id)=>{"use strict";var{Writable:kw}=require("stream"),Rd=Kn(),{BINARY_TYPES:Cw,EMPTY_BUFFER:Pd,kStatusCode:Tw,kWebSocket:Mw}=Gt(),{concat:Va,toArrayBuffer:Ow,unmask:Aw}=Wn(),{isValidStatusCode:Rw,isValidUTF8:Bd}=Xi(),Zs=Buffer[Symbol.species],vt=0,jd=1,Nd=2,Dd=3,Ka=4,Ga=5,Qs=6,Ya=class extends kw{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||Cw[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[Mw]=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=vt}_write(e,t,n){if(this._opcode===8&&this._state==vt)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 Zs(n.buffer,n.byteOffset+e,n.length-e),new Zs(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 Zs(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 vt:this.getInfo(e);break;case jd:this.getPayloadLength16(e);break;case Nd:this.getPayloadLength64(e);break;case Dd:this.getMask();break;case Ka:this.getData(e);break;case Ga:case Qs: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[Rd.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=jd:this._payloadLength===127?this._state=Nd: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=Dd:this._state=Ka}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Ka}getData(e){let t=Pd;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&&Aw(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=Ga,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[Rd.extensionName].decompress(e,this._fin,(s,r)=>{if(s)return t(s);if(r.length){if(this._messageLength+=r.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(r)}this.dataMessage(t),this._state===vt&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=vt;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=Va(n,t):this._binaryType==="arraybuffer"?s=Ow(Va(n,t)):this._binaryType==="blob"?s=new Blob(n):s=n,this._allowSynchronousEvents?(this.emit("message",s,!0),this._state=vt):(this._state=Qs,setImmediate(()=>{this.emit("message",s,!0),this._state=vt,this.startLoop(e)}))}else{let s=Va(n,t);if(!this._skipUTF8Validation&&!Bd(s)){let r=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(r);return}this._state===Ga||this._allowSynchronousEvents?(this.emit("message",s,!1),this._state=vt):(this._state=Qs,setImmediate(()=>{this.emit("message",s,!1),this._state=vt,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Pd),this.end();else{let n=e.readUInt16BE(0);if(!Rw(n)){let r=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(r);return}let s=new Zs(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Bd(s)){let r=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(r);return}this._loop=!1,this.emit("conclude",n,s),this.end()}this._state=vt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=vt):(this._state=Qs,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=vt,this.startLoop(t)}))}createError(e,t,n,s,r){this._loop=!1,this._errored=!0;let o=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=r,o[Tw]=s,o}};Id.exports=Ya});var Qa=C((sT,Fd)=>{"use strict";var{Duplex:nT}=require("stream"),{randomFillSync:Pw}=require("crypto"),qd=Kn(),{EMPTY_BUFFER:Bw,kWebSocket:jw,NOOP:Nw}=Gt(),{isBlob:Zi,isValidStatusCode:Dw}=Xi(),{mask:Ld,toBuffer:Si}=Wn(),gt=Symbol("kByteLength"),Iw=Buffer.alloc(4),er=8*1024,Ei,Qi=er,Rt=0,qw=1,Lw=2,Xa=class i{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=Rt,this.onerror=Nw,this[jw]=void 0}static frame(e,t){let n,s=!1,r=2,o=!1;t.mask&&(n=t.maskBuffer||Iw,t.generateMask?t.generateMask(n):(Qi===er&&(Ei===void 0&&(Ei=Buffer.alloc(er)),Pw(Ei,0,er),Qi=0),n[0]=Ei[Qi++],n[1]=Ei[Qi++],n[2]=Ei[Qi++],n[3]=Ei[Qi++]),o=(n[0]|n[1]|n[2]|n[3])===0,r=6);let a;typeof e=="string"?(!t.mask||o)&&t[gt]!==void 0?a=t[gt]:(e=Buffer.from(e),a=e.length):(a=e.length,s=t.mask&&t.readOnly&&!o);let l=a;a>=65536?(r+=8,l=127):a>125&&(r+=2,l=126);let p=Buffer.allocUnsafe(s?a+r:r);return p[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(p[0]|=64),p[1]=l,l===126?p.writeUInt16BE(a,2):l===127&&(p[2]=p[3]=0,p.writeUIntBE(a,4,6)),t.mask?(p[1]|=128,p[r-4]=n[0],p[r-3]=n[1],p[r-2]=n[2],p[r-1]=n[3],o?[p,e]:s?(Ld(e,n,p,r,a),[p]):(Ld(e,n,e,0,a),[p,e])):[p,e]}close(e,t,n,s){let r;if(e===void 0)r=Bw;else{if(typeof e!="number"||!Dw(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)r=Buffer.allocUnsafe(2),r.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");r=Buffer.allocUnsafe(2+a),r.writeUInt16BE(e,0),typeof t=="string"?r.write(t,2):r.set(t,2)}}let o={[gt]:r.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Rt?this.enqueue([this.dispatch,r,!1,o,s]):this.sendFrame(i.frame(r,o),s)}ping(e,t,n){let s,r;if(typeof e=="string"?(s=Buffer.byteLength(e),r=!1):Zi(e)?(s=e.size,r=!1):(e=Si(e),s=e.length,r=Si.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[gt]:s,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:r,rsv1:!1};Zi(e)?this._state!==Rt?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Rt?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(i.frame(e,o),n)}pong(e,t,n){let s,r;if(typeof e=="string"?(s=Buffer.byteLength(e),r=!1):Zi(e)?(s=e.size,r=!1):(e=Si(e),s=e.length,r=Si.readOnly),s>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[gt]:s,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:r,rsv1:!1};Zi(e)?this._state!==Rt?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Rt?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(i.frame(e,o),n)}send(e,t,n){let s=this._extensions[qd.extensionName],r=t.binary?2:1,o=t.compress,a,l;typeof e=="string"?(a=Buffer.byteLength(e),l=!1):Zi(e)?(a=e.size,l=!1):(e=Si(e),a=e.length,l=Si.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,r=0),t.fin&&(this._firstFragment=!0);let p={[gt]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:r,readOnly:l,rsv1:o};Zi(e)?this._state!==Rt?this.enqueue([this.getBlobData,e,this._compress,p,n]):this.getBlobData(e,this._compress,p,n):this._state!==Rt?this.enqueue([this.dispatch,e,this._compress,p,n]):this.dispatch(e,this._compress,p,n)}getBlobData(e,t,n,s){this._bufferedBytes+=n[gt],this._state=Lw,e.arrayBuffer().then(r=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Za,this,a,s);return}this._bufferedBytes-=n[gt];let o=Si(r);t?this.dispatch(o,t,n,s):(this._state=Rt,this.sendFrame(i.frame(o,n),s),this.dequeue())}).catch(r=>{process.nextTick(Fw,this,r,s)})}dispatch(e,t,n,s){if(!t){this.sendFrame(i.frame(e,n),s);return}let r=this._extensions[qd.extensionName];this._bufferedBytes+=n[gt],this._state=qw,r.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");Za(this,l,s);return}this._bufferedBytes-=n[gt],this._state=Rt,n.readOnly=!1,this.sendFrame(i.frame(a,n),s),this.dequeue()})}dequeue(){for(;this._state===Rt&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][gt],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][gt],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)}};Fd.exports=Xa;function Za(i,e,t){typeof t=="function"&&t(e);for(let n=0;n<i._queue.length;n++){let s=i._queue[n],r=s[s.length-1];typeof r=="function"&&r(e)}}function Fw(i,e,t){Za(i,e,t),i.onerror(e)}});var Yd=C((rT,Gd)=>{"use strict";var{kForOnEventAttribute:Gn,kListener:ec}=Gt(),Ud=Symbol("kCode"),Hd=Symbol("kData"),zd=Symbol("kError"),$d=Symbol("kMessage"),Wd=Symbol("kReason"),en=Symbol("kTarget"),Vd=Symbol("kType"),Kd=Symbol("kWasClean"),Xt=class{constructor(e){this[en]=null,this[Vd]=e}get target(){return this[en]}get type(){return this[Vd]}};Object.defineProperty(Xt.prototype,"target",{enumerable:!0});Object.defineProperty(Xt.prototype,"type",{enumerable:!0});var ki=class extends Xt{constructor(e,t={}){super(e),this[Ud]=t.code===void 0?0:t.code,this[Wd]=t.reason===void 0?"":t.reason,this[Kd]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[Ud]}get reason(){return this[Wd]}get wasClean(){return this[Kd]}};Object.defineProperty(ki.prototype,"code",{enumerable:!0});Object.defineProperty(ki.prototype,"reason",{enumerable:!0});Object.defineProperty(ki.prototype,"wasClean",{enumerable:!0});var tn=class extends Xt{constructor(e,t={}){super(e),this[zd]=t.error===void 0?null:t.error,this[$d]=t.message===void 0?"":t.message}get error(){return this[zd]}get message(){return this[$d]}};Object.defineProperty(tn.prototype,"error",{enumerable:!0});Object.defineProperty(tn.prototype,"message",{enumerable:!0});var Yn=class extends Xt{constructor(e,t={}){super(e),this[Hd]=t.data===void 0?null:t.data}get data(){return this[Hd]}};Object.defineProperty(Yn.prototype,"data",{enumerable:!0});var Uw={addEventListener(i,e,t={}){for(let s of this.listeners(i))if(!t[Gn]&&s[ec]===e&&!s[Gn])return;let n;if(i==="message")n=function(r,o){let a=new Yn("message",{data:o?r:r.toString()});a[en]=this,tr(e,this,a)};else if(i==="close")n=function(r,o){let a=new ki("close",{code:r,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[en]=this,tr(e,this,a)};else if(i==="error")n=function(r){let o=new tn("error",{error:r,message:r.message});o[en]=this,tr(e,this,o)};else if(i==="open")n=function(){let r=new Xt("open");r[en]=this,tr(e,this,r)};else return;n[Gn]=!!t[Gn],n[ec]=e,t.once?this.once(i,n):this.on(i,n)},removeEventListener(i,e){for(let t of this.listeners(i))if(t[ec]===e&&!t[Gn]){this.removeListener(i,t);break}}};Gd.exports={CloseEvent:ki,ErrorEvent:tn,Event:Xt,EventTarget:Uw,MessageEvent:Yn};function tr(i,e,t){typeof i=="object"&&i.handleEvent?i.handleEvent.call(i,t):i.call(e,t)}});var tc=C((oT,Jd)=>{"use strict";var{tokenChars:Jn}=Xi();function Lt(i,e,t){i[e]===void 0?i[e]=[t]:i[e].push(t)}function Hw(i){let e=Object.create(null),t=Object.create(null),n=!1,s=!1,r=!1,o,a,l=-1,p=-1,f=-1,m=0;for(;m<i.length;m++)if(p=i.charCodeAt(m),o===void 0)if(f===-1&&Jn[p]===1)l===-1&&(l=m);else if(m!==0&&(p===32||p===9))f===-1&&l!==-1&&(f=m);else if(p===59||p===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${m}`);f===-1&&(f=m);let E=i.slice(l,f);p===44?(Lt(e,E,t),t=Object.create(null)):o=E,l=f=-1}else throw new SyntaxError(`Unexpected character at index ${m}`);else if(a===void 0)if(f===-1&&Jn[p]===1)l===-1&&(l=m);else if(p===32||p===9)f===-1&&l!==-1&&(f=m);else if(p===59||p===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${m}`);f===-1&&(f=m),Lt(t,i.slice(l,f),!0),p===44&&(Lt(e,o,t),t=Object.create(null),o=void 0),l=f=-1}else if(p===61&&l!==-1&&f===-1)a=i.slice(l,m),l=f=-1;else throw new SyntaxError(`Unexpected character at index ${m}`);else if(s){if(Jn[p]!==1)throw new SyntaxError(`Unexpected character at index ${m}`);l===-1?l=m:n||(n=!0),s=!1}else if(r)if(Jn[p]===1)l===-1&&(l=m);else if(p===34&&l!==-1)r=!1,f=m;else if(p===92)s=!0;else throw new SyntaxError(`Unexpected character at index ${m}`);else if(p===34&&i.charCodeAt(m-1)===61)r=!0;else if(f===-1&&Jn[p]===1)l===-1&&(l=m);else if(l!==-1&&(p===32||p===9))f===-1&&(f=m);else if(p===59||p===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${m}`);f===-1&&(f=m);let E=i.slice(l,f);n&&(E=E.replace(/\\/g,""),n=!1),Lt(t,a,E),p===44&&(Lt(e,o,t),t=Object.create(null),o=void 0),a=void 0,l=f=-1}else throw new SyntaxError(`Unexpected character at index ${m}`);if(l===-1||r||p===32||p===9)throw new SyntaxError("Unexpected end of input");f===-1&&(f=m);let _=i.slice(l,f);return o===void 0?Lt(e,_,t):(a===void 0?Lt(t,_,!0):n?Lt(t,a,_.replace(/\\/g,"")):Lt(t,a,_),Lt(e,o,t)),e}function zw(i){return Object.keys(i).map(e=>{let t=i[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(s=>{let r=n[s];return Array.isArray(r)||(r=[r]),r.map(o=>o===!0?s:`${s}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Jd.exports={format:zw,parse:Hw}});var rr=C((lT,lf)=>{"use strict";var $w=require("events"),Ww=require("https"),Vw=require("http"),Qd=require("net"),Kw=require("tls"),{randomBytes:Gw,createHash:Yw}=require("crypto"),{Duplex:aT,Readable:cT}=require("stream"),{URL:ic}=require("url"),ui=Kn(),Jw=Ja(),Xw=Qa(),{isBlob:Zw}=Xi(),{BINARY_TYPES:Xd,EMPTY_BUFFER:ir,GUID:Qw,kForOnEventAttribute:nc,kListener:e1,kStatusCode:t1,kWebSocket:We,NOOP:ef}=Gt(),{EventTarget:{addEventListener:i1,removeEventListener:n1}}=Yd(),{format:s1,parse:r1}=tc(),{toBuffer:o1}=Wn(),a1=30*1e3,tf=Symbol("kAborted"),sc=[8,13],Zt=["CONNECTING","OPEN","CLOSING","CLOSED"],c1=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Q=class i extends $w{constructor(e,t,n){super(),this._binaryType=Xd[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=ir,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=i.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]),nf(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Xd.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 Jw({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),r=new Xw(e,this._extensions,n.generateMask);this._receiver=s,this._sender=r,this._socket=e,s[We]=this,r[We]=this,e[We]=this,s.on("conclude",p1),s.on("drain",d1),s.on("error",f1),s.on("message",h1),s.on("ping",m1),s.on("pong",v1),r.onerror=g1,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",of),e.on("data",sr),e.on("end",af),e.on("error",cf),this._readyState=i.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[ui.extensionName]&&this._extensions[ui.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){ut(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===i.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=i.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),rf(this)}}pause(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===i.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!==i.OPEN){rc(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||ir,t,n)}pong(e,t,n){if(this.readyState===i.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!==i.OPEN){rc(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||ir,t,n)}resume(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===i.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!==i.OPEN){rc(this,e,n);return}let s={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[ui.extensionName]||(s.compress=!1),this._sender.send(e||ir,s,n)}terminate(){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){ut(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=i.CLOSING,this._socket.destroy())}}};Object.defineProperty(Q,"CONNECTING",{enumerable:!0,value:Zt.indexOf("CONNECTING")});Object.defineProperty(Q.prototype,"CONNECTING",{enumerable:!0,value:Zt.indexOf("CONNECTING")});Object.defineProperty(Q,"OPEN",{enumerable:!0,value:Zt.indexOf("OPEN")});Object.defineProperty(Q.prototype,"OPEN",{enumerable:!0,value:Zt.indexOf("OPEN")});Object.defineProperty(Q,"CLOSING",{enumerable:!0,value:Zt.indexOf("CLOSING")});Object.defineProperty(Q.prototype,"CLOSING",{enumerable:!0,value:Zt.indexOf("CLOSING")});Object.defineProperty(Q,"CLOSED",{enumerable:!0,value:Zt.indexOf("CLOSED")});Object.defineProperty(Q.prototype,"CLOSED",{enumerable:!0,value:Zt.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(i=>{Object.defineProperty(Q.prototype,i,{enumerable:!0})});["open","error","close","message"].forEach(i=>{Object.defineProperty(Q.prototype,`on${i}`,{enumerable:!0,get(){for(let e of this.listeners(i))if(e[nc])return e[e1];return null},set(e){for(let t of this.listeners(i))if(t[nc]){this.removeListener(i,t);break}typeof e=="function"&&this.addEventListener(i,e,{[nc]:!0})}})});Q.prototype.addEventListener=i1;Q.prototype.removeEventListener=n1;lf.exports=Q;function nf(i,e,t,n){let s={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:sc[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(i._autoPong=s.autoPong,!sc.includes(s.protocolVersion))throw new RangeError(`Unsupported protocol version: ${s.protocolVersion} (supported versions: ${sc.join(", ")})`);let r;if(e instanceof ic)r=e;else try{r=new ic(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}r.protocol==="http:"?r.protocol="ws:":r.protocol==="https:"&&(r.protocol="wss:"),i._url=r.href;let o=r.protocol==="wss:",a=r.protocol==="ws+unix:",l;if(r.protocol!=="ws:"&&!o&&!a?l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!r.pathname?l="The URL's pathname is empty":r.hash&&(l="The URL contains a fragment identifier"),l){let T=new SyntaxError(l);if(i._redirects===0)throw T;nr(i,T);return}let p=o?443:80,f=Gw(16).toString("base64"),m=o?Ww.request:Vw.request,_=new Set,E;if(s.createConnection=s.createConnection||(o?u1:l1),s.defaultPort=s.defaultPort||p,s.port=r.port||p,s.host=r.hostname.startsWith("[")?r.hostname.slice(1,-1):r.hostname,s.headers={...s.headers,"Sec-WebSocket-Version":s.protocolVersion,"Sec-WebSocket-Key":f,Connection:"Upgrade",Upgrade:"websocket"},s.path=r.pathname+r.search,s.timeout=s.handshakeTimeout,s.perMessageDeflate&&(E=new ui(s.perMessageDeflate!==!0?s.perMessageDeflate:{},!1,s.maxPayload),s.headers["Sec-WebSocket-Extensions"]=s1({[ui.extensionName]:E.offer()})),t.length){for(let T of t){if(typeof T!="string"||!c1.test(T)||_.has(T))throw new SyntaxError("An invalid or duplicated subprotocol was specified");_.add(T)}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),(r.username||r.password)&&(s.auth=`${r.username}:${r.password}`),a){let T=s.path.split(":");s.socketPath=T[0],s.path=T[1]}let k;if(s.followRedirects){if(i._redirects===0){i._originalIpc=a,i._originalSecure=o,i._originalHostOrSocketPath=a?s.socketPath:r.host;let T=n&&n.headers;if(n={...n,headers:{}},T)for(let[O,M]of Object.entries(T))n.headers[O.toLowerCase()]=M}else if(i.listenerCount("redirect")===0){let T=a?i._originalIpc?s.socketPath===i._originalHostOrSocketPath:!1:i._originalIpc?!1:r.host===i._originalHostOrSocketPath;(!T||i._originalSecure&&!o)&&(delete s.headers.authorization,delete s.headers.cookie,T||delete s.headers.host,s.auth=void 0)}s.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(s.auth).toString("base64")),k=i._req=m(s),i._redirects&&i.emit("redirect",i.url,k)}else k=i._req=m(s);s.timeout&&k.on("timeout",()=>{ut(i,k,"Opening handshake has timed out")}),k.on("error",T=>{k===null||k[tf]||(k=i._req=null,nr(i,T))}),k.on("response",T=>{let O=T.headers.location,M=T.statusCode;if(O&&s.followRedirects&&M>=300&&M<400){if(++i._redirects>s.maxRedirects){ut(i,k,"Maximum redirects exceeded");return}k.abort();let A;try{A=new ic(O,e)}catch{let U=new SyntaxError(`Invalid URL: ${O}`);nr(i,U);return}nf(i,A,t,n)}else i.emit("unexpected-response",k,T)||ut(i,k,`Unexpected server response: ${T.statusCode}`)}),k.on("upgrade",(T,O,M)=>{if(i.emit("upgrade",T),i.readyState!==Q.CONNECTING)return;k=i._req=null;let A=T.headers.upgrade;if(A===void 0||A.toLowerCase()!=="websocket"){ut(i,O,"Invalid Upgrade header");return}let D=Yw("sha1").update(f+Qw).digest("base64");if(T.headers["sec-websocket-accept"]!==D){ut(i,O,"Invalid Sec-WebSocket-Accept header");return}let U=T.headers["sec-websocket-protocol"],ie;if(U!==void 0?_.size?_.has(U)||(ie="Server sent an invalid subprotocol"):ie="Server sent a subprotocol but none was requested":_.size&&(ie="Server sent no subprotocol"),ie){ut(i,O,ie);return}U&&(i._protocol=U);let J=T.headers["sec-websocket-extensions"];if(J!==void 0){if(!E){ut(i,O,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let ne;try{ne=r1(J)}catch{ut(i,O,"Invalid Sec-WebSocket-Extensions header");return}let H=Object.keys(ne);if(H.length!==1||H[0]!==ui.extensionName){ut(i,O,"Server indicated an extension that was not requested");return}try{E.accept(ne[ui.extensionName])}catch{ut(i,O,"Invalid Sec-WebSocket-Extensions header");return}i._extensions[ui.extensionName]=E}i.setSocket(O,M,{allowSynchronousEvents:s.allowSynchronousEvents,generateMask:s.generateMask,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation})}),s.finishRequest?s.finishRequest(k,i):k.end()}function nr(i,e){i._readyState=Q.CLOSING,i._errorEmitted=!0,i.emit("error",e),i.emitClose()}function l1(i){return i.path=i.socketPath,Qd.connect(i)}function u1(i){return i.path=void 0,!i.servername&&i.servername!==""&&(i.servername=Qd.isIP(i.host)?"":i.host),Kw.connect(i)}function ut(i,e,t){i._readyState=Q.CLOSING;let n=new Error(t);Error.captureStackTrace(n,ut),e.setHeader?(e[tf]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(nr,i,n)):(e.destroy(n),e.once("error",i.emit.bind(i,"error")),e.once("close",i.emitClose.bind(i)))}function rc(i,e,t){if(e){let n=Zw(e)?e.size:o1(e).length;i._socket?i._sender._bufferedBytes+=n:i._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${i.readyState} (${Zt[i.readyState]})`);process.nextTick(t,n)}}function p1(i,e){let t=this[We];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=i,t._socket[We]!==void 0&&(t._socket.removeListener("data",sr),process.nextTick(sf,t._socket),i===1005?t.close():t.close(i,e))}function d1(){let i=this[We];i.isPaused||i._socket.resume()}function f1(i){let e=this[We];e._socket[We]!==void 0&&(e._socket.removeListener("data",sr),process.nextTick(sf,e._socket),e.close(i[t1])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",i))}function Zd(){this[We].emitClose()}function h1(i,e){this[We].emit("message",i,e)}function m1(i){let e=this[We];e._autoPong&&e.pong(i,!this._isServer,ef),e.emit("ping",i)}function v1(i){this[We].emit("pong",i)}function sf(i){i.resume()}function g1(i){let e=this[We];e.readyState!==Q.CLOSED&&(e.readyState===Q.OPEN&&(e._readyState=Q.CLOSING,rf(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",i)))}function rf(i){i._closeTimer=setTimeout(i._socket.destroy.bind(i._socket),a1)}function of(){let i=this[We];this.removeListener("close",of),this.removeListener("data",sr),this.removeListener("end",af),i._readyState=Q.CLOSING;let e;!this._readableState.endEmitted&&!i._closeFrameReceived&&!i._receiver._writableState.errorEmitted&&(e=i._socket.read())!==null&&i._receiver.write(e),i._receiver.end(),this[We]=void 0,clearTimeout(i._closeTimer),i._receiver._writableState.finished||i._receiver._writableState.errorEmitted?i.emitClose():(i._receiver.on("error",Zd),i._receiver.on("finish",Zd))}function sr(i){this[We]._receiver.write(i)||this.pause()}function af(){let i=this[We];i._readyState=Q.CLOSING,i._receiver.end(),this.end()}function cf(){let i=this[We];this.removeListener("error",cf),this.on("error",ef),i&&(i._readyState=Q.CLOSING,this.destroy())}});var ff=C((pT,df)=>{"use strict";var uT=rr(),{Duplex:x1}=require("stream");function uf(i){i.emit("close")}function y1(){!this.destroyed&&this._writableState.finished&&this.destroy()}function pf(i){this.removeListener("error",pf),this.destroy(),this.listenerCount("error")===0&&this.emit("error",i)}function b1(i,e){let t=!0,n=new x1({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return i.on("message",function(r,o){let a=!o&&n._readableState.objectMode?r.toString():r;n.push(a)||i.pause()}),i.once("error",function(r){n.destroyed||(t=!1,n.destroy(r))}),i.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(s,r){if(i.readyState===i.CLOSED){r(s),process.nextTick(uf,n);return}let o=!1;i.once("error",function(l){o=!0,r(l)}),i.once("close",function(){o||r(s),process.nextTick(uf,n)}),t&&i.terminate()},n._final=function(s){if(i.readyState===i.CONNECTING){i.once("open",function(){n._final(s)});return}i._socket!==null&&(i._socket._writableState.finished?(s(),n._readableState.endEmitted&&n.destroy()):(i._socket.once("finish",function(){s()}),i.close()))},n._read=function(){i.isPaused&&i.resume()},n._write=function(s,r,o){if(i.readyState===i.CONNECTING){i.once("open",function(){n._write(s,r,o)});return}i.send(s,o)},n.on("end",y1),n.on("error",pf),n}df.exports=b1});var mf=C((dT,hf)=>{"use strict";var{tokenChars:w1}=Xi();function _1(i){let e=new Set,t=-1,n=-1,s=0;for(s;s<i.length;s++){let o=i.charCodeAt(s);if(n===-1&&w1[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=i.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 r=i.slice(t,s);if(e.has(r))throw new SyntaxError(`The "${r}" subprotocol is duplicated`);return e.add(r),e}hf.exports={parse:_1}});var _f=C((hT,wf)=>{"use strict";var S1=require("events"),or=require("http"),{Duplex:fT}=require("stream"),{createHash:E1}=require("crypto"),vf=tc(),Ci=Kn(),k1=mf(),C1=rr(),{GUID:T1,kWebSocket:M1}=Gt(),O1=/^[+/0-9A-Za-z]{22}==$/,gf=0,xf=1,bf=2,oc=class extends S1{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:C1,...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=or.createServer((n,s)=>{let r=or.STATUS_CODES[426];s.writeHead(426,{"Content-Length":r.length,"Content-Type":"text/plain"}),s.end(r)}),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=A1(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(s,r,o)=>{this.handleUpgrade(s,r,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=gf}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===bf){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Xn,this);return}if(e&&this.once("close",e),this._state!==xf)if(this._state=xf,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(Xn,this):process.nextTick(Xn,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{Xn(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",yf);let r=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){Ti(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){Ti(this,e,t,400,"Invalid Upgrade header");return}if(r===void 0||!O1.test(r)){Ti(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Ti(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Zn(t,400);return}let l=e.headers["sec-websocket-protocol"],p=new Set;if(l!==void 0)try{p=k1.parse(l)}catch{Ti(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let f=e.headers["sec-websocket-extensions"],m={};if(this.options.perMessageDeflate&&f!==void 0){let _=new Ci(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let E=vf.parse(f);E[Ci.extensionName]&&(_.accept(E[Ci.extensionName]),m[Ci.extensionName]=_)}catch{Ti(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let _={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(_,(E,k,T,O)=>{if(!E)return Zn(t,k||401,T,O);this.completeUpgrade(m,r,p,e,t,n,s)});return}if(!this.options.verifyClient(_))return Zn(t,401)}this.completeUpgrade(m,r,p,e,t,n,s)}completeUpgrade(e,t,n,s,r,o,a){if(!r.readable||!r.writable)return r.destroy();if(r[M1])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>gf)return Zn(r,503);let p=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${E1("sha1").update(t+T1).digest("base64")}`],f=new this.options.WebSocket(null,void 0,this.options);if(n.size){let m=this.options.handleProtocols?this.options.handleProtocols(n,s):n.values().next().value;m&&(p.push(`Sec-WebSocket-Protocol: ${m}`),f._protocol=m)}if(e[Ci.extensionName]){let m=e[Ci.extensionName].params,_=vf.format({[Ci.extensionName]:[m]});p.push(`Sec-WebSocket-Extensions: ${_}`),f._extensions=e}this.emit("headers",p,s),r.write(p.concat(`\r
10
10
  `).join(`\r
11
- `)),r.removeListener("error",yf),f.setSocket(r,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(f),f.on("close",()=>{this.clients.delete(f),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Xn,this)})),a(f,s)}};wf.exports=oc;function O1(i,e){for(let t of Object.keys(e))i.on(t,e[t]);return function(){for(let n of Object.keys(e))i.removeListener(n,e[n])}}function Xn(i){i._state=bf,i.emit("close")}function yf(){this.destroy()}function Zn(i,e,t,n){t=t||or.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},i.once("finish",i.destroy),i.end(`HTTP/1.1 ${e} ${or.STATUS_CODES[e]}\r
11
+ `)),r.removeListener("error",yf),f.setSocket(r,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(f),f.on("close",()=>{this.clients.delete(f),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Xn,this)})),a(f,s)}};wf.exports=oc;function A1(i,e){for(let t of Object.keys(e))i.on(t,e[t]);return function(){for(let n of Object.keys(e))i.removeListener(n,e[n])}}function Xn(i){i._state=bf,i.emit("close")}function yf(){this.destroy()}function Zn(i,e,t,n){t=t||or.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},i.once("finish",i.destroy),i.end(`HTTP/1.1 ${e} ${or.STATUS_CODES[e]}\r
12
12
  `+Object.keys(n).map(s=>`${s}: ${n[s]}`).join(`\r
13
13
  `)+`\r
14
14
  \r
15
- `+t)}function Ti(i,e,t,n,s,r){if(i.listenerCount("wsClientError")){let o=new Error(s);Error.captureStackTrace(o,Ti),i.emit("wsClientError",o,t,e)}else Zn(t,n,s,r)}});var ac=C((hT,Sf)=>{"use strict";var Qt=rr();Qt.createWebSocketStream=ff();Qt.Server=_f();Qt.Receiver=Ja();Qt.Sender=Qa();Qt.WebSocket=Qt;Qt.WebSocketServer=Qt.Server;Sf.exports=Qt});var Cf=C((mT,kf)=>{"use strict";var Ef=Object.getOwnPropertySymbols,A1=Object.prototype.hasOwnProperty,R1=Object.prototype.propertyIsEnumerable;function P1(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function B1(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(e).map(function(r){return e[r]});if(n.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(r){s[r]=r}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}kf.exports=B1()?Object.assign:function(i,e){for(var t,n=P1(i),s,r=1;r<arguments.length;r++){t=Object(arguments[r]);for(var o in t)A1.call(t,o)&&(n[o]=t[o]);if(Ef){s=Ef(t);for(var a=0;a<s.length;a++)R1.call(t,s[a])&&(n[s[a]]=t[s[a]])}}return n}});var Of=C((vT,cc)=>{"use strict";cc.exports=N1;cc.exports.append=Mf;var j1=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Mf(i,e){if(typeof i!="string")throw new TypeError("header argument is required");if(!e)throw new TypeError("field argument is required");for(var t=Array.isArray(e)?e:Tf(String(e)),n=0;n<t.length;n++)if(!j1.test(t[n]))throw new TypeError("field argument contains an invalid header name");if(i==="*")return i;var s=i,r=Tf(i.toLowerCase());if(t.indexOf("*")!==-1||r.indexOf("*")!==-1)return"*";for(var o=0;o<t.length;o++){var a=t[o].toLowerCase();r.indexOf(a)===-1&&(r.push(a),s=s?s+", "+t[o]:t[o])}return s}function Tf(i){for(var e=0,t=[],n=0,s=0,r=i.length;s<r;s++)switch(i.charCodeAt(s)){case 32:n===e&&(n=e=s+1);break;case 44:t.push(i.substring(n,e)),n=e=s+1;break;default:e=s+1;break}return t.push(i.substring(n,e)),t}function N1(i,e){if(!i||!i.getHeader||!i.setHeader)throw new TypeError("res argument is required");var t=i.getHeader("Vary")||"",n=Array.isArray(t)?t.join(", "):String(t);(t=Mf(n,e))&&i.setHeader("Vary",t)}});var lc=C((gT,Af)=>{(function(){"use strict";var i=Cf(),e=Of(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function n(k){return typeof k=="string"||k instanceof String}function s(k,T){if(Array.isArray(T)){for(var O=0;O<T.length;++O)if(s(k,T[O]))return!0;return!1}else return n(T)?k===T:T instanceof RegExp?T.test(k):!!T}function r(k,T){var O=T.headers.origin,M=[],A;return!k.origin||k.origin==="*"?M.push([{key:"Access-Control-Allow-Origin",value:"*"}]):n(k.origin)?(M.push([{key:"Access-Control-Allow-Origin",value:k.origin}]),M.push([{key:"Vary",value:"Origin"}])):(A=s(O,k.origin),M.push([{key:"Access-Control-Allow-Origin",value:A?O:!1}]),M.push([{key:"Vary",value:"Origin"}])),M}function o(k){var T=k.methods;return T.join&&(T=k.methods.join(",")),{key:"Access-Control-Allow-Methods",value:T}}function a(k){return k.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function l(k,T){var O=k.allowedHeaders||k.headers,M=[];return O?O.join&&(O=O.join(",")):(O=T.headers["access-control-request-headers"],M.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),O&&O.length&&M.push([{key:"Access-Control-Allow-Headers",value:O}]),M}function p(k){var T=k.exposedHeaders;if(T)T.join&&(T=T.join(","));else return null;return T&&T.length?{key:"Access-Control-Expose-Headers",value:T}:null}function f(k){var T=(typeof k.maxAge=="number"||k.maxAge)&&k.maxAge.toString();return T&&T.length?{key:"Access-Control-Max-Age",value:T}:null}function m(k,T){for(var O=0,M=k.length;O<M;O++){var A=k[O];A&&(Array.isArray(A)?m(A,T):A.key==="Vary"&&A.value?e(T,A.value):A.value&&T.setHeader(A.key,A.value))}}function _(k,T,O,M){var A=[],I=T.method&&T.method.toUpperCase&&T.method.toUpperCase();I==="OPTIONS"?(A.push(r(k,T)),A.push(a(k)),A.push(o(k)),A.push(l(k,T)),A.push(f(k)),A.push(p(k)),m(A,O),k.preflightContinue?M():(O.statusCode=k.optionsSuccessStatus,O.setHeader("Content-Length","0"),O.end())):(A.push(r(k,T)),A.push(a(k)),A.push(p(k)),m(A,O),M())}function E(k){var T=null;return typeof k=="function"?T=k:T=function(O,M){M(null,k)},function(M,A,I){T(M,function(U,ie){if(U)I(U);else{var J=i({},t,ie),ne=null;J.origin&&typeof J.origin=="function"?ne=J.origin:J.origin&&(ne=function(H,Ue){Ue(null,J.origin)}),ne?ne(M.headers.origin,function(H,Ue){H||!Ue?I(H):(J.origin=Ue,_(J,M,A,I))}):I()}})}}Af.exports=E})()});var pc=C(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.Server=rn.BaseServer=void 0;var Rf=ra(),ar=Ca(),I1=require("events"),Pf=Ma(),D1=se(),q1=Yp(),L1=ac(),Bf=Ea(),F1=$n(),q=(0,D1.default)("engine"),nn=Symbol("responseHeaders");function U1(i){try{let e=JSON.parse(i);if(typeof e.sid=="string")return e.sid}catch{}}var sn=class extends I1.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:L1.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(lc()(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?ar.default[e].upgradesTo||[]:[]}verify(e,t,n){let s=e._query.transport;if(!~this.opts.transports.indexOf(s)||s==="webtransport")return q('unknown transport "%s"',s),n(X.errors.UNKNOWN_TRANSPORT,{transport:s});if(H1(e.headers.origin)){let a=e.headers.origin;return e.headers.origin=null,q("origin header invalid"),n(X.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:a})}let o=e._query.sid;if(o){if(!this.clients.hasOwnProperty(o))return q('unknown sid "%s"',o),n(X.errors.UNKNOWN_SID,{sid:o});let a=this.clients[o].transport.name;if(!t&&a!==s)return q("bad request: unexpected transport without upgrade"),n(X.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:s,previousTransport:a})}else return e.method!=="GET"?n(X.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):s==="websocket"&&!t?(q("invalid transport upgrade"),n(X.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(e,(a,l)=>{if(!l)return n(X.errors.FORBIDDEN,{message:a});n()}):n();n()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return q("no middleware to apply, skipping"),n();let s=r=>{q("applying middleware n\xB0%d",r+1),this.middlewares[r](e,t,o=>{if(o)return n(o);r+1<this.middlewares.length?s(r+1):n()})};s(0)}close(){q("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 Rf.generateId()}async handshake(e,t,n){let s=t._query.EIO==="4"?4:3;if(s===3&&!this.opts.allowEIO3){q("unsupported protocol version"),this.emit("connection_error",{req:t,code:X.errors.UNSUPPORTED_PROTOCOL_VERSION,message:X.errorMessages[X.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:s}}),n(X.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let r;try{r=await this.generateId(t)}catch(l){q("error while generating an id"),this.emit("connection_error",{req:t,code:X.errors.BAD_REQUEST,message:X.errorMessages[X.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:l}}),n(X.errors.BAD_REQUEST);return}q('handshaking client "%s"',r);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(l){q('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:X.errors.BAD_REQUEST,message:X.errorMessages[X.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:l}}),n(X.errors.BAD_REQUEST);return}let a=new Pf.Socket(r,this,o,t,s);return o.on("headers",(l,p)=>{!p._query.sid&&(this.opts.cookie&&(l["Set-Cookie"]=[(0,q1.serialize)(this.opts.cookie.name,r,this.opts.cookie)]),this.emit("initial_headers",l,p)),this.emit("headers",l,p)}),o.onRequest(t),this.clients[r]=a,this.clientsCount++,a.once("close",()=>{delete this.clients[r],this.clientsCount--}),this.emit("connection",a),o}async onWebTransportSession(e){let t=setTimeout(()=>{q("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){q("session is closed");return}let r=s.value,o=(0,F1.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),a=r.readable.pipeThrough(o).getReader(),{value:l,done:p}=await a.read();if(p){q("stream is closed");return}if(clearTimeout(t),l.type!=="open")return q("invalid WebTransport handshake"),e.close();if(l.data===void 0){let _=new Bf.WebTransport(e,r,a),E=Rf.generateId();q('handshaking client "%s" (WebTransport)',E);let k=new Pf.Socket(E,this,_,null,4);this.clients[E]=k,this.clientsCount++,k.once("close",()=>{delete this.clients[E],this.clientsCount--}),this.emit("connection",k);return}let f=U1(l.data);if(!f)return q("invalid WebTransport handshake"),e.close();let m=this.clients[f];if(!m)q("upgrade attempt for closed client"),e.close();else if(m.upgrading)q("transport has already been trying to upgrade"),e.close();else if(m.upgraded)q("transport had already been upgraded"),e.close();else{q("upgrading existing transport");let _=new Bf.WebTransport(e,r,a);m._maybeUpgrade(_)}}};rn.BaseServer=sn;sn.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};sn.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var uc=class{constructor(e,t){this.req=e,this.socket=t,e[nn]={}}setHeader(e,t){this.req[nn][e]=t}getHeader(e){return this.req[nn][e]}removeHeader(e){delete this.req[nn][e]}write(){}writeHead(){}end(){this.socket.destroy()}},X=class i extends sn{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[nn]||{};delete t[nn],!t._query.sid&&this.emit("initial_headers",n,t),this.emit("headers",n,t),q("writing headers: %j",n),Object.keys(n).forEach(r=>{e.push(`${r}: ${n[r]}`)})}))}cleanup(){this.ws&&(q("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 ar.default[e](t)}handleRequest(e,t){q('handling "%s" http request "%s"',e.method,e.url),this.prepare(e),e.res=t;let n=(s,r)=>{if(s!==void 0){this.emit("connection_error",{req:e,code:s,message:i.errorMessages[s],context:r}),jf(t,s,r);return}if(e._query.sid)q("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(a,l)=>jf(t,a,l);this.handshake(e._query.transport,e,o)}};this._applyMiddlewares(e,t,s=>{s?n(i.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!1,n)})}handleUpgrade(e,t,n){this.prepare(e);let s=new uc(e,t),r=(o,a)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:i.errorMessages[o],context:a}),Nf(t,o,a);return}let l=Buffer.from(n);n=null,s.writeHead(),this.ws.handleUpgrade(e,t,l,p=>{this.onWebSocket(e,t,p)})};this._applyMiddlewares(e,s,o=>{o?r(i.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!0,r)})}onWebSocket(e,t,n){if(n.on("error",r),ar.default[e._query.transport]!==void 0&&!ar.default[e._query.transport].prototype.handlesUpgrades){q("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)q("upgrade attempt for closed client"),n.close();else if(o.upgrading)q("transport has already been trying to upgrade"),n.close();else if(o.upgraded)q("transport had already been upgraded"),n.close();else{q("upgrading existing transport"),n.removeListener("error",r);let a=this.createTransport(e._query.transport,e);a.perMessageDeflate=this.opts.perMessageDeflate,o._maybeUpgrade(a)}}else{let o=(a,l)=>Nf(t,a,l);this.handshake(e._query.transport,e,o)}function r(){q("websocket error before upgrade")}}attach(e,t={}){let n=this._computePath(t),s=t.destroyUpgradeTimeout||1e3;function r(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,l)=>{if(r(a))q('intercepting request for path "%s"',n),this.handleRequest(a,l);else{let p=0,f=o.length;for(;p<f;p++)o[p].call(e,a,l)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(a,l,p)=>{r(a)?this.handleUpgrade(a,l,p):t.destroyUpgrade!==!1&&setTimeout(function(){if(l.writable&&l.bytesWritten<=0)return l.on("error",f=>{q("error while destroying upgrade: %s",f.message)}),l.end()},s)})}};rn.Server=X;function jf(i,e,t){let n=e===X.errors.FORBIDDEN?403:400,s=t&&t.message?t.message:X.errorMessages[e];i.writeHead(n,{"Content-Type":"application/json"}),i.end(JSON.stringify({code:e,message:s}))}function Nf(i,e,t={}){if(i.on("error",()=>{q("ignoring error from closed connection")}),i.writable){let n=t.message||X.errorMessages[e],s=Buffer.byteLength(n);i.write(`HTTP/1.1 400 Bad Request\r
15
+ `+t)}function Ti(i,e,t,n,s,r){if(i.listenerCount("wsClientError")){let o=new Error(s);Error.captureStackTrace(o,Ti),i.emit("wsClientError",o,t,e)}else Zn(t,n,s,r)}});var ac=C((mT,Sf)=>{"use strict";var Qt=rr();Qt.createWebSocketStream=ff();Qt.Server=_f();Qt.Receiver=Ja();Qt.Sender=Qa();Qt.WebSocket=Qt;Qt.WebSocketServer=Qt.Server;Sf.exports=Qt});var Cf=C((vT,kf)=>{"use strict";var Ef=Object.getOwnPropertySymbols,R1=Object.prototype.hasOwnProperty,P1=Object.prototype.propertyIsEnumerable;function B1(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function j1(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(e).map(function(r){return e[r]});if(n.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(r){s[r]=r}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}kf.exports=j1()?Object.assign:function(i,e){for(var t,n=B1(i),s,r=1;r<arguments.length;r++){t=Object(arguments[r]);for(var o in t)R1.call(t,o)&&(n[o]=t[o]);if(Ef){s=Ef(t);for(var a=0;a<s.length;a++)P1.call(t,s[a])&&(n[s[a]]=t[s[a]])}}return n}});var Of=C((gT,cc)=>{"use strict";cc.exports=D1;cc.exports.append=Mf;var N1=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Mf(i,e){if(typeof i!="string")throw new TypeError("header argument is required");if(!e)throw new TypeError("field argument is required");for(var t=Array.isArray(e)?e:Tf(String(e)),n=0;n<t.length;n++)if(!N1.test(t[n]))throw new TypeError("field argument contains an invalid header name");if(i==="*")return i;var s=i,r=Tf(i.toLowerCase());if(t.indexOf("*")!==-1||r.indexOf("*")!==-1)return"*";for(var o=0;o<t.length;o++){var a=t[o].toLowerCase();r.indexOf(a)===-1&&(r.push(a),s=s?s+", "+t[o]:t[o])}return s}function Tf(i){for(var e=0,t=[],n=0,s=0,r=i.length;s<r;s++)switch(i.charCodeAt(s)){case 32:n===e&&(n=e=s+1);break;case 44:t.push(i.substring(n,e)),n=e=s+1;break;default:e=s+1;break}return t.push(i.substring(n,e)),t}function D1(i,e){if(!i||!i.getHeader||!i.setHeader)throw new TypeError("res argument is required");var t=i.getHeader("Vary")||"",n=Array.isArray(t)?t.join(", "):String(t);(t=Mf(n,e))&&i.setHeader("Vary",t)}});var lc=C((xT,Af)=>{(function(){"use strict";var i=Cf(),e=Of(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function n(k){return typeof k=="string"||k instanceof String}function s(k,T){if(Array.isArray(T)){for(var O=0;O<T.length;++O)if(s(k,T[O]))return!0;return!1}else return n(T)?k===T:T instanceof RegExp?T.test(k):!!T}function r(k,T){var O=T.headers.origin,M=[],A;return!k.origin||k.origin==="*"?M.push([{key:"Access-Control-Allow-Origin",value:"*"}]):n(k.origin)?(M.push([{key:"Access-Control-Allow-Origin",value:k.origin}]),M.push([{key:"Vary",value:"Origin"}])):(A=s(O,k.origin),M.push([{key:"Access-Control-Allow-Origin",value:A?O:!1}]),M.push([{key:"Vary",value:"Origin"}])),M}function o(k){var T=k.methods;return T.join&&(T=k.methods.join(",")),{key:"Access-Control-Allow-Methods",value:T}}function a(k){return k.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function l(k,T){var O=k.allowedHeaders||k.headers,M=[];return O?O.join&&(O=O.join(",")):(O=T.headers["access-control-request-headers"],M.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),O&&O.length&&M.push([{key:"Access-Control-Allow-Headers",value:O}]),M}function p(k){var T=k.exposedHeaders;if(T)T.join&&(T=T.join(","));else return null;return T&&T.length?{key:"Access-Control-Expose-Headers",value:T}:null}function f(k){var T=(typeof k.maxAge=="number"||k.maxAge)&&k.maxAge.toString();return T&&T.length?{key:"Access-Control-Max-Age",value:T}:null}function m(k,T){for(var O=0,M=k.length;O<M;O++){var A=k[O];A&&(Array.isArray(A)?m(A,T):A.key==="Vary"&&A.value?e(T,A.value):A.value&&T.setHeader(A.key,A.value))}}function _(k,T,O,M){var A=[],D=T.method&&T.method.toUpperCase&&T.method.toUpperCase();D==="OPTIONS"?(A.push(r(k,T)),A.push(a(k)),A.push(o(k)),A.push(l(k,T)),A.push(f(k)),A.push(p(k)),m(A,O),k.preflightContinue?M():(O.statusCode=k.optionsSuccessStatus,O.setHeader("Content-Length","0"),O.end())):(A.push(r(k,T)),A.push(a(k)),A.push(p(k)),m(A,O),M())}function E(k){var T=null;return typeof k=="function"?T=k:T=function(O,M){M(null,k)},function(M,A,D){T(M,function(U,ie){if(U)D(U);else{var J=i({},t,ie),ne=null;J.origin&&typeof J.origin=="function"?ne=J.origin:J.origin&&(ne=function(H,Ue){Ue(null,J.origin)}),ne?ne(M.headers.origin,function(H,Ue){H||!Ue?D(H):(J.origin=Ue,_(J,M,A,D))}):D()}})}}Af.exports=E})()});var pc=C(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.Server=rn.BaseServer=void 0;var Rf=ra(),ar=Ca(),I1=require("events"),Pf=Ma(),q1=se(),L1=Yp(),F1=ac(),Bf=Ea(),U1=$n(),q=(0,q1.default)("engine"),nn=Symbol("responseHeaders");function H1(i){try{let e=JSON.parse(i);if(typeof e.sid=="string")return e.sid}catch{}}var sn=class extends I1.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:F1.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(lc()(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?ar.default[e].upgradesTo||[]:[]}verify(e,t,n){let s=e._query.transport;if(!~this.opts.transports.indexOf(s)||s==="webtransport")return q('unknown transport "%s"',s),n(X.errors.UNKNOWN_TRANSPORT,{transport:s});if(z1(e.headers.origin)){let a=e.headers.origin;return e.headers.origin=null,q("origin header invalid"),n(X.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:a})}let o=e._query.sid;if(o){if(!this.clients.hasOwnProperty(o))return q('unknown sid "%s"',o),n(X.errors.UNKNOWN_SID,{sid:o});let a=this.clients[o].transport.name;if(!t&&a!==s)return q("bad request: unexpected transport without upgrade"),n(X.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:s,previousTransport:a})}else return e.method!=="GET"?n(X.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):s==="websocket"&&!t?(q("invalid transport upgrade"),n(X.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(e,(a,l)=>{if(!l)return n(X.errors.FORBIDDEN,{message:a});n()}):n();n()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return q("no middleware to apply, skipping"),n();let s=r=>{q("applying middleware n\xB0%d",r+1),this.middlewares[r](e,t,o=>{if(o)return n(o);r+1<this.middlewares.length?s(r+1):n()})};s(0)}close(){q("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 Rf.generateId()}async handshake(e,t,n){let s=t._query.EIO==="4"?4:3;if(s===3&&!this.opts.allowEIO3){q("unsupported protocol version"),this.emit("connection_error",{req:t,code:X.errors.UNSUPPORTED_PROTOCOL_VERSION,message:X.errorMessages[X.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:s}}),n(X.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let r;try{r=await this.generateId(t)}catch(l){q("error while generating an id"),this.emit("connection_error",{req:t,code:X.errors.BAD_REQUEST,message:X.errorMessages[X.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:l}}),n(X.errors.BAD_REQUEST);return}q('handshaking client "%s"',r);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(l){q('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:X.errors.BAD_REQUEST,message:X.errorMessages[X.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:l}}),n(X.errors.BAD_REQUEST);return}let a=new Pf.Socket(r,this,o,t,s);return o.on("headers",(l,p)=>{!p._query.sid&&(this.opts.cookie&&(l["Set-Cookie"]=[(0,L1.serialize)(this.opts.cookie.name,r,this.opts.cookie)]),this.emit("initial_headers",l,p)),this.emit("headers",l,p)}),o.onRequest(t),this.clients[r]=a,this.clientsCount++,a.once("close",()=>{delete this.clients[r],this.clientsCount--}),this.emit("connection",a),o}async onWebTransportSession(e){let t=setTimeout(()=>{q("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){q("session is closed");return}let r=s.value,o=(0,U1.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),a=r.readable.pipeThrough(o).getReader(),{value:l,done:p}=await a.read();if(p){q("stream is closed");return}if(clearTimeout(t),l.type!=="open")return q("invalid WebTransport handshake"),e.close();if(l.data===void 0){let _=new Bf.WebTransport(e,r,a),E=Rf.generateId();q('handshaking client "%s" (WebTransport)',E);let k=new Pf.Socket(E,this,_,null,4);this.clients[E]=k,this.clientsCount++,k.once("close",()=>{delete this.clients[E],this.clientsCount--}),this.emit("connection",k);return}let f=H1(l.data);if(!f)return q("invalid WebTransport handshake"),e.close();let m=this.clients[f];if(!m)q("upgrade attempt for closed client"),e.close();else if(m.upgrading)q("transport has already been trying to upgrade"),e.close();else if(m.upgraded)q("transport had already been upgraded"),e.close();else{q("upgrading existing transport");let _=new Bf.WebTransport(e,r,a);m._maybeUpgrade(_)}}};rn.BaseServer=sn;sn.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};sn.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var uc=class{constructor(e,t){this.req=e,this.socket=t,e[nn]={}}setHeader(e,t){this.req[nn][e]=t}getHeader(e){return this.req[nn][e]}removeHeader(e){delete this.req[nn][e]}write(){}writeHead(){}end(){this.socket.destroy()}},X=class i extends sn{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[nn]||{};delete t[nn],!t._query.sid&&this.emit("initial_headers",n,t),this.emit("headers",n,t),q("writing headers: %j",n),Object.keys(n).forEach(r=>{e.push(`${r}: ${n[r]}`)})}))}cleanup(){this.ws&&(q("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 ar.default[e](t)}handleRequest(e,t){q('handling "%s" http request "%s"',e.method,e.url),this.prepare(e),e.res=t;let n=(s,r)=>{if(s!==void 0){this.emit("connection_error",{req:e,code:s,message:i.errorMessages[s],context:r}),jf(t,s,r);return}if(e._query.sid)q("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(a,l)=>jf(t,a,l);this.handshake(e._query.transport,e,o)}};this._applyMiddlewares(e,t,s=>{s?n(i.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!1,n)})}handleUpgrade(e,t,n){this.prepare(e);let s=new uc(e,t),r=(o,a)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:i.errorMessages[o],context:a}),Nf(t,o,a);return}let l=Buffer.from(n);n=null,s.writeHead(),this.ws.handleUpgrade(e,t,l,p=>{this.onWebSocket(e,t,p)})};this._applyMiddlewares(e,s,o=>{o?r(i.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!0,r)})}onWebSocket(e,t,n){if(n.on("error",r),ar.default[e._query.transport]!==void 0&&!ar.default[e._query.transport].prototype.handlesUpgrades){q("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)q("upgrade attempt for closed client"),n.close();else if(o.upgrading)q("transport has already been trying to upgrade"),n.close();else if(o.upgraded)q("transport had already been upgraded"),n.close();else{q("upgrading existing transport"),n.removeListener("error",r);let a=this.createTransport(e._query.transport,e);a.perMessageDeflate=this.opts.perMessageDeflate,o._maybeUpgrade(a)}}else{let o=(a,l)=>Nf(t,a,l);this.handshake(e._query.transport,e,o)}function r(){q("websocket error before upgrade")}}attach(e,t={}){let n=this._computePath(t),s=t.destroyUpgradeTimeout||1e3;function r(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,l)=>{if(r(a))q('intercepting request for path "%s"',n),this.handleRequest(a,l);else{let p=0,f=o.length;for(;p<f;p++)o[p].call(e,a,l)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(a,l,p)=>{r(a)?this.handleUpgrade(a,l,p):t.destroyUpgrade!==!1&&setTimeout(function(){if(l.writable&&l.bytesWritten<=0)return l.on("error",f=>{q("error while destroying upgrade: %s",f.message)}),l.end()},s)})}};rn.Server=X;function jf(i,e,t){let n=e===X.errors.FORBIDDEN?403:400,s=t&&t.message?t.message:X.errorMessages[e];i.writeHead(n,{"Content-Type":"application/json"}),i.end(JSON.stringify({code:e,message:s}))}function Nf(i,e,t={}){if(i.on("error",()=>{q("ignoring error from closed connection")}),i.writable){let n=t.message||X.errorMessages[e],s=Buffer.byteLength(n);i.write(`HTTP/1.1 400 Bad Request\r
16
16
  Connection: close\r
17
17
  Content-type: text/html\r
18
18
  Content-Length: `+s+`\r
19
19
  \r
20
- `+n)}i.destroy()}var Qn=[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 H1(i){if(i+="",i.length<1)return!1;if(!Qn[i.charCodeAt(0)])return q('invalid header, index 0, char "%s"',i.charCodeAt(0)),!0;if(i.length<2)return!1;if(!Qn[i.charCodeAt(1)])return q('invalid header, index 1, char "%s"',i.charCodeAt(1)),!0;if(i.length<3)return!1;if(!Qn[i.charCodeAt(2)])return q('invalid header, index 2, char "%s"',i.charCodeAt(2)),!0;if(i.length<4)return!1;if(!Qn[i.charCodeAt(3)])return q('invalid header, index 3, char "%s"',i.charCodeAt(3)),!0;for(let e=4;e<i.length;++e)if(!Qn[i.charCodeAt(e)])return q('invalid header, index "%i", char "%s"',e,i.charCodeAt(e)),!0;return!1}});var Df=C(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.Polling=void 0;var z1=_i(),If=require("zlib"),$1=Os(),W1=se(),xt=(0,W1.default)("engine:polling"),V1={gzip:If.createGzip,deflate:If.createDeflate},dc=class extends z1.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){xt("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}xt("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&&(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.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 r,o=0,a={"Content-Type":"text/html"};this.headers(e,a);for(let p in a)t.writeHeader(p,String(a[p]));let l=p=>{this.onData(p.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((p,f)=>{let m=o+p.byteLength;if(m>n){this.onError("content-length mismatch"),t.close();return}if(!r){if(f){l(Buffer.from(p));return}r=Buffer.allocUnsafe(n)}if(Buffer.from(p).copy(r,o),f){if(m!=n){this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}l(r);return}o=m})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}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(r=>r.options&&r.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=f=>{this.headers(this.req,o),this.res.cork(()=>{Object.keys(o).forEach(m=>{this.res.writeHeader(m,String(o[m]))}),this.res.end(f)}),n()};if(!this.httpCompression||!t.compress){a(e);return}if((s?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let p=$1(this.req).encodings(["gzip","deflate"]);if(!p){a(e);return}this.compress(e,p,(f,m)=>{if(f){this.res.writeStatus("500 Internal Server Error"),this.res.end(),n(f);return}o["Content-Encoding"]=p,a(m)})}compress(e,t,n){xt("compressing");let s=[],r=0;V1[t](this.httpCompression).on("error",n).on("data",function(o){s.push(o),r+=o.length}).on("end",function(){n(null,Buffer.concat(s,r))}).end(e)}doClose(e){xt("closing");let t,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){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}};cr.Polling=dc});var Lf=C(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.WebSocket=void 0;var K1=_i(),G1=se(),qf=(0,G1.default)("engine:ws"),fc=class extends K1.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,r=o=>{let a=typeof o!="string",l=this.perMessageDeflate&&Buffer.byteLength(o)>this.perMessageDeflate.threshold;qf('writing "%s"',o),this.socket.send(o,a,l),s&&(this.emit("drain"),this.writable=!0,this.emit("ready"))};n.options&&typeof n.options.wsPreEncoded=="string"?r(n.options.wsPreEncoded):this.parser.encodePacket(n,this.supportsBinary,r)}}doClose(e){qf("closing"),e&&e(),this.socket.end()}};lr.WebSocket=fc});var Ff=C(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});var Y1=Df(),J1=Lf();hc.default={polling:Y1.Polling,websocket:J1.WebSocket}});var Uf=C(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.uServer=void 0;var X1=se(),Mi=pc(),Z1=Ff(),pi=(0,X1.default)("engine:uws"),mc=class extends Mi.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,r)=>{e.headers[s]=r}),e.connection={remoteAddress:Buffer.from(t.getRemoteAddressAsText()).toString()},t.onAborted(()=>{pi("response has been aborted")})}createTransport(e,t){return new Z1.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 r=s.getUserData().transport;r.socket=s,r.writable=!0,r.emit("ready")},message:(s,r,o)=>{s.getUserData().transport.onData(o?r:Buffer.from(r).toString())},close:(s,r,o)=>{s.getUserData().transport.onClose(r,o)}})}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return n();e.res=new vc(t),super._applyMiddlewares(e,e.res,s=>{e.res.writeHead(),n(s)})}handleRequest(e,t){pi('handling "%s" http request "%s"',t.getMethod(),t.getUrl()),this.prepare(t,e),t.res=e;let n=(s,r)=>{if(s!==void 0){this.emit("connection_error",{req:t,code:s,message:Mi.Server.errorMessages[s],context:r}),this.abortRequest(t.res,s,r);return}if(t._query.sid)pi("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{let o=(a,l)=>this.abortRequest(e,a,l);this.handshake(t._query.transport,t,o)}};this._applyMiddlewares(t,e,s=>{s?n(Mi.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,n)})}handleUpgrade(e,t,n){pi("on upgrade"),this.prepare(t,e),t.res=e;let s=async(r,o)=>{if(r!==void 0){this.emit("connection_error",{req:t,code:r,message:Mi.Server.errorMessages[r],context:o}),this.abortRequest(e,r,o);return}let a=t._query.sid,l;if(a){let p=this.clients[a];if(p){if(p.upgrading)return pi("transport has already been trying to upgrade"),e.close();if(p.upgraded)return pi("transport had already been upgraded"),e.close();pi("upgrading existing transport"),l=this.createTransport(t._query.transport,t),p._maybeUpgrade(l)}else return pi("upgrade attempt for closed client"),e.close()}else if(l=await this.handshake(t._query.transport,t,(p,f)=>this.abortRequest(e,p,f)),!l)return;t.res.writeStatus("101 Switching Protocols"),e.upgrade({transport:l},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),n)};this._applyMiddlewares(t,e,r=>{r?s(Mi.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,s)})}abortRequest(e,t,n){let s=t===Mi.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",r=n&&n.message?n.message:Mi.Server.errorMessages[t];e.writeStatus(s),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:r}))}};ur.uServer=mc;var vc=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 Wf=C(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.protocol=Ve.Transport=Ve.Socket=Ve.uServer=Ve.parser=Ve.transports=Ve.Server=void 0;Ve.listen=s_;Ve.attach=$f;var Q1=require("http"),Hf=pc();Object.defineProperty(Ve,"Server",{enumerable:!0,get:function(){return Hf.Server}});var e_=Ca();Ve.transports=e_.default;var zf=$n();Ve.parser=zf;var t_=Uf();Object.defineProperty(Ve,"uServer",{enumerable:!0,get:function(){return t_.uServer}});var i_=Ma();Object.defineProperty(Ve,"Socket",{enumerable:!0,get:function(){return i_.Socket}});var n_=_i();Object.defineProperty(Ve,"Transport",{enumerable:!0,get:function(){return n_.Transport}});Ve.protocol=zf.protocol;function s_(i,e,t){typeof e=="function"&&(t=e,e={});let n=(0,Q1.createServer)(function(r,o){o.writeHead(501),o.end("Not Implemented")}),s=$f(n,e);return s.httpServer=n,n.listen(i,t),s}function $f(i,e){let t=new Hf.Server(e);return t.attach(i,e),t}});var Kf=C(Vf=>{Vf.Emitter=Ze;function Ze(i){if(i)return r_(i)}function r_(i){for(var e in Ze.prototype)i[e]=Ze.prototype[e];return i}Ze.prototype.on=Ze.prototype.addEventListener=function(i,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(e),this};Ze.prototype.once=function(i,e){function t(){this.off(i,t),e.apply(this,arguments)}return t.fn=e,this.on(i,t),this};Ze.prototype.off=Ze.prototype.removeListener=Ze.prototype.removeAllListeners=Ze.prototype.removeEventListener=function(i,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+i];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+i],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["$"+i],this};Ze.prototype.emit=function(i){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+i],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};Ze.prototype.emitReserved=Ze.prototype.emit;Ze.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]};Ze.prototype.hasListeners=function(i){return!!this.listeners(i).length}});var gc=C(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.isBinary=Yf;dr.hasBinary=pr;var o_=typeof ArrayBuffer=="function",a_=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i.buffer instanceof ArrayBuffer,Gf=Object.prototype.toString,c_=typeof Blob=="function"||typeof Blob<"u"&&Gf.call(Blob)==="[object BlobConstructor]",l_=typeof File=="function"||typeof File<"u"&&Gf.call(File)==="[object FileConstructor]";function Yf(i){return o_&&(i instanceof ArrayBuffer||a_(i))||c_&&i instanceof Blob||l_&&i instanceof File}function pr(i,e){if(!i||typeof i!="object")return!1;if(Array.isArray(i)){for(let t=0,n=i.length;t<n;t++)if(pr(i[t]))return!0;return!1}if(Yf(i))return!0;if(i.toJSON&&typeof i.toJSON=="function"&&arguments.length===1)return pr(i.toJSON(),!0);for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)&&pr(i[t]))return!0;return!1}});var Jf=C(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.deconstructPacket=p_;fr.reconstructPacket=d_;var u_=gc();function p_(i){let e=[],t=i.data,n=i;return n.data=xc(t,e),n.attachments=e.length,{packet:n,buffers:e}}function xc(i,e){if(!i)return i;if((0,u_.isBinary)(i)){let t={_placeholder:!0,num:e.length};return e.push(i),t}else if(Array.isArray(i)){let t=new Array(i.length);for(let n=0;n<i.length;n++)t[n]=xc(i[n],e);return t}else if(typeof i=="object"&&!(i instanceof Date)){let t={};for(let n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=xc(i[n],e));return t}return i}function d_(i,e){return i.data=yc(i.data,e),delete i.attachments,i}function yc(i,e){if(!i)return i;if(i&&i._placeholder===!0){if(typeof i.num=="number"&&i.num>=0&&i.num<e.length)return e[i.num];throw new Error("illegal attachments")}else if(Array.isArray(i))for(let t=0;t<i.length;t++)i[t]=yc(i[t],e);else if(typeof i=="object")for(let t in i)Object.prototype.hasOwnProperty.call(i,t)&&(i[t]=yc(i[t],e));return i}});var es=C(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.Decoder=Pt.Encoder=Pt.PacketType=Pt.protocol=void 0;Pt.isPacketValid=y_;var f_=Kf(),Xf=Jf(),Zf=gc(),h_=se(),bc=(0,h_.default)("socket.io-parser"),Qf=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];Pt.protocol=5;var W;(function(i){i[i.CONNECT=0]="CONNECT",i[i.DISCONNECT=1]="DISCONNECT",i[i.EVENT=2]="EVENT",i[i.ACK=3]="ACK",i[i.CONNECT_ERROR=4]="CONNECT_ERROR",i[i.BINARY_EVENT=5]="BINARY_EVENT",i[i.BINARY_ACK=6]="BINARY_ACK"})(W||(Pt.PacketType=W={}));var wc=class{constructor(e){this.replacer=e}encode(e){return bc("encoding packet %j",e),(e.type===W.EVENT||e.type===W.ACK)&&(0,Zf.hasBinary)(e)?this.encodeAsBinary({type:e.type===W.EVENT?W.BINARY_EVENT:W.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===W.BINARY_EVENT||e.type===W.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)),bc("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,Xf.deconstructPacket)(e),n=this.encodeAsString(t.packet),s=t.buffers;return s.unshift(n),s}};Pt.Encoder=wc;var _c=class i extends f_.Emitter{constructor(e){super(),this.reviver=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===W.BINARY_EVENT;n||t.type===W.BINARY_ACK?(t.type=n?W.EVENT:W.ACK,this.reconstructor=new Sc(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,Zf.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(W[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===W.BINARY_EVENT||n.type===W.BINARY_ACK){let r=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(r,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");n.attachments=Number(o)}if(e.charAt(t+1)==="/"){let r=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(r,t)}else n.nsp="/";let s=e.charAt(t+1);if(s!==""&&Number(s)==s){let r=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(r,t+1))}if(e.charAt(++t)){let r=this.tryParse(e.substr(t));if(i.isPayloadValid(n.type,r))n.data=r;else throw new Error("invalid payload")}return bc("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case W.CONNECT:return hr(t);case W.DISCONNECT:return t===void 0;case W.CONNECT_ERROR:return typeof t=="string"||hr(t);case W.EVENT:case W.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&Qf.indexOf(t[0])===-1);case W.ACK:case W.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};Pt.Decoder=_c;var Sc=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,Xf.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function m_(i){return typeof i=="string"}var v_=Number.isInteger||function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i};function g_(i){return i===void 0||v_(i)}function hr(i){return Object.prototype.toString.call(i)==="[object Object]"}function x_(i,e){switch(i){case W.CONNECT:return e===void 0||hr(e);case W.DISCONNECT:return e===void 0;case W.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&Qf.indexOf(e[0])===-1);case W.ACK:return Array.isArray(e);case W.CONNECT_ERROR:return typeof e=="string"||hr(e);default:return!1}}function y_(i){return m_(i.nsp)&&g_(i.id)&&x_(i.type,i.data)}});var eh=C(on=>{"use strict";var b_=on&&on.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(on,"__esModule",{value:!0});on.Client=void 0;var mr=es(),w_=b_(se()),Bt=(0,w_.default)("socket.io:client"),Ec=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?(Bt("no namespace joined yet, close the client"),this.close()):Bt("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return Bt("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,n=>{n?this.doConnect(e,t):(Bt("creation of namespace %s was denied",e),this._packet({type:mr.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 Bt("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(Bt("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){Bt("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){Bt("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){Bt("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:n}=this._parseNamespace(e),s=this.nsps.get(t);!s&&e.type===mr.PacketType.CONNECT?this.connect(t,n):s&&e.type!==mr.PacketType.CONNECT&&e.type!==mr.PacketType.CONNECT_ERROR?process.nextTick(function(){s._onpacket(e)}):(Bt("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){Bt("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)}};on.Client=Ec});var gr=C(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.StrictEventEmitter=void 0;var __=require("events"),kc=class extends __.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)}};vr.StrictEventEmitter=kc});var Cc=C(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.RESERVED_EVENTS=void 0;xr.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var Tc=C(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.RemoteSocket=an.BroadcastOperator=void 0;var S_=Cc(),E_=es(),yr=class i{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 i(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 i(this.adapter,this.rooms,t,this.flags)}compress(e){let t=Object.assign({},this.flags,{compress:e});return new i(this.adapter,this.rooms,this.exceptRooms,t)}get volatile(){let e=Object.assign({},this.flags,{volatile:!0});return new i(this.adapter,this.rooms,this.exceptRooms,e)}get local(){let e=Object.assign({},this.flags,{local:!0});return new i(this.adapter,this.rooms,this.exceptRooms,e)}timeout(e){let t=Object.assign({},this.flags,{timeout:e});return new i(this.adapter,this.rooms,this.exceptRooms,t)}emit(e,...t){if(S_.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],s={type:E_.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,l=[],p=setTimeout(()=>{a=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:l])},this.flags.timeout),f=-1,m=0,_=0,E=()=>{!a&&f===m&&l.length===_&&(clearTimeout(p),o.apply(this,[null,this.flags.expectSingleResponse?l[0]:l]))};return this.adapter.broadcastWithAck(s,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},k=>{_+=k,m++,E()},k=>{l.push(k),E()}),this.adapter.serverCount().then(k=>{f=k,E()}),!0}emitWithAck(e,...t){return new Promise((n,s)=>{t.push((r,o)=>r?(r.responses=o,s(r)):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 br(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)}};an.BroadcastOperator=yr;var br=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 yr(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}};an.RemoteSocket=br});var Oc=C(cn=>{"use strict";var nh=cn&&cn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(cn,"__esModule",{value:!0});cn.Socket=void 0;var yt=es(),k_=nh(se()),C_=gr(),th=nh(ra()),T_=Tc(),M_=Cc(),Ge=(0,k_.default)("socket.io:socket"),O_=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function ih(){}var Mc=class extends C_.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(r=>this.join(r)),this.data=s.data,s.missedPackets.forEach(r=>{this.packet({type:yt.PacketType.EVENT,data:r})}),this.recovered=!0):(t.conn.protocol===3?this.id=e.name!=="/"?e.name+"#"+t.id:t.id:this.id=th.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=th.default.generateId())),this.handshake=this.buildHandshake(n),this.on("error",ih)}buildHandshake(e){var t,n,s,r;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:((r=this.request)===null||r===void 0?void 0:r._query)||{},auth:e}}emit(e,...t){if(M_.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],s={type:yt.PacketType.EVENT,data:n};if(typeof n[n.length-1]=="function"){let o=this.nsp._ids++;Ge("emitting packet with ack id %d",o),this.registerAckCallback(o,n.pop()),s.id=o}let r=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:r}):(this.notifyOutgoingListeners(s),this.packet(s,r)),!0}emitWithAck(e,...t){let n=this.flags.timeout!==void 0;return new Promise((s,r)=>{t.push((o,a)=>n?o?r(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(()=>{Ge("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,(...r)=>{clearTimeout(s),t.apply(this,[null,...r])})}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 Ge("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return Ge("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){Ge("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3?this.packet({type:yt.PacketType.CONNECT}):this.packet({type:yt.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(Ge("got packet %j",e),e.type){case yt.PacketType.EVENT:this.onevent(e);break;case yt.PacketType.BINARY_EVENT:this.onevent(e);break;case yt.PacketType.ACK:this.onack(e);break;case yt.PacketType.BINARY_ACK:this.onack(e);break;case yt.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(e){let t=e.data||[];if(Ge("emitting event %j",t),e.id!=null&&(Ge("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);Ge("sending ack %j",s),t.packet({id:e,type:yt.PacketType.ACK,data:s}),n=!0}}onack(e){let t=this.acks.get(e.id);typeof t=="function"?(Ge("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):Ge("bad ack %s",e.id)}ondisconnect(){Ge("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;Ge("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&O_.has(e)&&(Ge("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=ih}_error(e){this.packet({type:yt.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:yt.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){Ge("dispatching an event %j",e),this.run(e,t=>{process.nextTick(()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):Ge("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(r){n[r](e,o=>{if(o)return t(o);if(!n[r+1])return t();s(r+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 T_.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};cn.Socket=Mc});var Rc=C(ei=>{"use strict";var A_=ei&&ei.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ei,"__esModule",{value:!0});ei.Namespace=ei.RESERVED_EVENTS=void 0;var sh=Oc(),R_=gr(),P_=A_(se()),pt=Tc(),ln=(0,P_.default)("socket.io:namespace");ei.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var Ac=class extends R_.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=>{ln("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(r){n[r](e,o=>{if(o)return t(o);if(!n[r+1])return t();s(r+1)})}s(0)}to(e){return new pt.BroadcastOperator(this.adapter).to(e)}in(e){return new pt.BroadcastOperator(this.adapter).in(e)}except(e){return new pt.BroadcastOperator(this.adapter).except(e)}async _add(e,t,n){var s;ln("adding socket to nsp %s",this.name);let r=await this._createSocket(e,t);if(this._preConnectSockets.set(r.id,r),!((s=this.server.opts.connectionStateRecovery)===null||s===void 0)&&s.skipMiddlewares&&r.recovered&&e.conn.readyState==="open")return this._doConnect(r,n);this.run(r,o=>{process.nextTick(()=>{if(e.conn.readyState!=="open"){ln("next called after client was closed - ignoring socket"),r._cleanup();return}if(o)return ln("middleware error, sending CONNECT_ERROR packet to the client"),r._cleanup(),e.conn.protocol===3?r._error(o.data||o.message):r._error({message:o.message,data:o.data});this._doConnect(r,n)})})}async _createSocket(e,t){let n=t.pid,s=t.offset;if(this.server.opts.connectionStateRecovery&&typeof n=="string"&&typeof s=="string"){let r;try{r=await this.adapter.restoreSession(n,s)}catch(o){ln("error while restoring session: %s",o)}if(r)return ln("connection state recovered for sid %s",r.sid),new sh.Socket(this,e,t,r)}return new sh.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 pt.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(ei.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((r,o)=>r?(r.responses=o,s(r)):n(o)),this.serverSideEmit(e,...t)})}_onServerSideEmit(e){super.emitUntyped.apply(this,e)}allSockets(){return new pt.BroadcastOperator(this.adapter).allSockets()}compress(e){return new pt.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new pt.BroadcastOperator(this.adapter).volatile}get local(){return new pt.BroadcastOperator(this.adapter).local}timeout(e){return new pt.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new pt.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new pt.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new pt.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new pt.BroadcastOperator(this.adapter).disconnectSockets(e)}};ei.Namespace=Ac});var lh=C(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.encode=Pc;ts.decode=B_;ts.yeast=j_;var ah="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),wr=64,ch={},rh=0,di=0,oh;function Pc(i){let e="";do e=ah[i%wr]+e,i=Math.floor(i/wr);while(i>0);return e}function B_(i){let e=0;for(di=0;di<i.length;di++)e=e*wr+ch[i.charAt(di)];return e}function j_(){let i=Pc(+new Date);return i!==oh?(rh=0,oh=i):i+"."+Pc(rh++)}for(;di<wr;di++)ch[ah[di]]=di});var Nc=C(un=>{"use strict";var Bc;Object.defineProperty(un,"__esModule",{value:!0});un.SessionAwareAdapter=un.Adapter=void 0;var N_=require("events"),I_=lh(),_r=ac(),D_=typeof((Bc=_r?.Sender)===null||Bc===void 0?void 0:Bc.frame)=="function",Sr=class extends N_.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 r=this._encode(e,s);this.apply(t,o=>{typeof o.notifyOutgoingListeners=="function"&&o.notifyOutgoingListeners(e),o.client.writeToEngine(r,s)})}broadcastWithAck(e,t,n,s){let r=t.flags||{},o={preEncoded:!0,volatile:r.volatile,compress:r.compress};e.nsp=this.nsp.name,e.id=this.nsp._ids++;let a=this._encode(e,o),l=0;this.apply(t,p=>{l++,p.acks.set(e.id,s),typeof p.notifyOutgoingListeners=="function"&&p.notifyOutgoingListeners(e),p.client.writeToEngine(a,o)}),n(l)}_encode(e,t){let n=this.encoder.encode(e);if(D_&&n.length===1&&typeof n[0]=="string"){let s=Buffer.from("4"+n[0]);t.wsPreEncodedFrame=_r.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 r=new Set;for(let o of n)if(this.rooms.has(o))for(let a of this.rooms.get(o)){if(r.has(a)||s.has(a))continue;let l=this.nsp.sockets.get(a);l&&(t(l),r.add(a))}}else for(let[r]of this.sids){if(s.has(r))continue;let o=this.nsp.sockets.get(r);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}};un.Adapter=Sr;var jc=class extends Sr{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,r)=>{s.disconnectedAt<n&&this.sessions.delete(r)});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 r=this.packets.findIndex(a=>a.id===t);if(r===-1)return null;let o=[];for(let a=r+1;a<this.packets.length;a++){let l=this.packets[a];q_(n.rooms,l.opts)&&o.push(l.data)}return Promise.resolve(Object.assign(Object.assign({},n),{missedPackets:o}))}broadcast(e,t){var n;let s=e.type===2,r=e.id===void 0,o=((n=t.flags)===null||n===void 0?void 0:n.volatile)===void 0;if(s&&r&&o){let a=(0,I_.yeast)();e.data.push(a),this.packets.push({id:a,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};un.SessionAwareAdapter=jc;function q_(i,e){let t=e.rooms.size===0||i.some(s=>e.rooms.has(s)),n=i.every(s=>!e.except.has(s));return t&&n}});var uh=C(Ft=>{"use strict";var L_=Ft&&Ft.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.ClusterAdapterWithHeartbeat=Ft.ClusterAdapter=Ft.MessageType=void 0;var F_=Nc(),U_=se(),H_=require("crypto"),ee=(0,U_.debug)("socket.io-adapter"),z_="emitter",Er=5e3;function dn(){return(0,H_.randomBytes)(8).toString("hex")}var N;(function(i){i[i.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",i[i.HEARTBEAT=2]="HEARTBEAT",i[i.BROADCAST=3]="BROADCAST",i[i.SOCKETS_JOIN=4]="SOCKETS_JOIN",i[i.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",i[i.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",i[i.FETCH_SOCKETS=7]="FETCH_SOCKETS",i[i.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",i[i.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",i[i.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",i[i.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",i[i.BROADCAST_ACK=12]="BROADCAST_ACK",i[i.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(N||(Ft.MessageType=N={}));function Oi(i){return{rooms:[...i.rooms],except:[...i.except],flags:i.flags}}function pn(i){return{rooms:new Set(i.rooms),except:new Set(i.except),flags:i.flags}}var kr=class extends F_.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=dn()}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 N.BROADCAST:{if(e.data.requestId!==void 0)super.broadcastWithAck(e.data.packet,pn(e.data.opts),s=>{ee("[%s] waiting for %d client acknowledgements",this.uid,s),this.publishResponse(e.uid,{type:N.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:s}})},s=>{ee("[%s] received acknowledgement with value %j",this.uid,s),this.publishResponse(e.uid,{type:N.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:s}})});else{let s=e.data.packet,r=pn(e.data.opts);this.addOffsetIfNecessary(s,r,t),super.broadcast(s,r)}break}case N.SOCKETS_JOIN:super.addSockets(pn(e.data.opts),e.data.rooms);break;case N.SOCKETS_LEAVE:super.delSockets(pn(e.data.opts),e.data.rooms);break;case N.DISCONNECT_SOCKETS:super.disconnectSockets(pn(e.data.opts),e.data.close);break;case N.FETCH_SOCKETS:{ee("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(pn(e.data.opts)).then(n=>{this.publishResponse(e.uid,{type:N.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:n.map(s=>{let r=s.handshake,{sessionStore:o}=r,a=L_(r,["sessionStore"]);return{id:s.id,handshake:a,rooms:[...s.rooms],data:s.data}})}})});break}case N.SERVER_SIDE_EMIT:{let n=e.data.packet;if(!(e.data.requestId!==void 0)){this.nsp._onServerSideEmit(n);return}let r=!1,o=a=>{r||(r=!0,ee("[%s] calling acknowledgement with %j",this.uid,a),this.publishResponse(e.uid,{type:N.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:a}}))};this.nsp._onServerSideEmit([...n,o]);break}case N.BROADCAST_CLIENT_COUNT:case N.BROADCAST_ACK:case N.FETCH_SOCKETS_RESPONSE:case N.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 s=e.data.requestId;switch(ee("[%s] received response %s to request %s",this.uid,e.type,s),e.type){case N.BROADCAST_CLIENT_COUNT:{(t=this.ackRequests.get(s))===null||t===void 0||t.clientCountCallback(e.data.clientCount);break}case N.BROADCAST_ACK:{(n=this.ackRequests.get(s))===null||n===void 0||n.ack(e.data.packet);break}case N.FETCH_SOCKETS_RESPONSE:{let r=this.requests.get(s);if(!r)return;r.current++,e.data.sockets.forEach(o=>r.responses.push(o)),r.current===r.expected&&(clearTimeout(r.timeout),r.resolve(r.responses),this.requests.delete(s));break}case N.SERVER_SIDE_EMIT_RESPONSE:{let r=this.requests.get(s);if(!r)return;r.current++,r.responses.push(e.data.packet),r.current===r.expected&&(clearTimeout(r.timeout),r.resolve(null,r.responses),this.requests.delete(s));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 r=await this.publishAndReturnOffset({type:N.BROADCAST,data:{packet:e,opts:Oi(t)}});this.addOffsetIfNecessary(e,t,r)}catch(r){return ee("[%s] error while broadcasting message: %s",this.uid,r.message)}super.broadcast(e,t)}addOffsetIfNecessary(e,t,n){var s;if(!this.nsp.server.opts.connectionStateRecovery)return;let r=e.type===2,o=e.id===void 0,a=((s=t.flags)===null||s===void 0?void 0:s.volatile)===void 0;r&&o&&a&&e.data.push(n)}broadcastWithAck(e,t,n,s){var r;if(!((r=t?.flags)===null||r===void 0?void 0:r.local)){let a=dn();this.ackRequests.set(a,{clientCountCallback:n,ack:s}),this.publish({type:N.BROADCAST,data:{packet:e,requestId:a,opts:Oi(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:N.SOCKETS_JOIN,data:{opts:Oi(e),rooms:t}})}catch(r){ee("[%s] error while publishing message: %s",this.uid,r.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:N.SOCKETS_LEAVE,data:{opts:Oi(e),rooms:t}})}catch(r){ee("[%s] error while publishing message: %s",this.uid,r.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:N.DISCONNECT_SOCKETS,data:{opts:Oi(e),close:t}})}catch(r){ee("[%s] error while publishing message: %s",this.uid,r.message)}super.disconnectSockets(e,t)}async fetchSockets(e){var t;let[n,s]=await Promise.all([super.fetchSockets(e),this.serverCount()]),r=s-1;if(!((t=e.flags)===null||t===void 0)&&t.local||r<=0)return n;let o=dn();return new Promise((a,l)=>{let p=setTimeout(()=>{let m=this.requests.get(o);m&&(l(new Error(`timeout reached: only ${m.current} responses received out of ${m.expected}`)),this.requests.delete(o))},e.flags.timeout||Er),f={type:N.FETCH_SOCKETS,resolve:a,timeout:p,current:0,expected:r,responses:n};this.requests.set(o,f),this.publish({type:N.FETCH_SOCKETS,data:{opts:Oi(e),requestId:o}})})}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:N.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),s=await this.serverCount()-1;if(ee('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,s),s<=0)return n(null,[]);let r=dn(),o=setTimeout(()=>{let l=this.requests.get(r);l&&(n(new Error(`timeout reached: only ${l.current} responses received out of ${l.expected}`),l.responses),this.requests.delete(r))},Er),a={type:N.SERVER_SIDE_EMIT,resolve:n,timeout:o,current:0,expected:s,responses:[]};this.requests.set(r,a),this.publish({type:N.SERVER_SIDE_EMIT,data:{requestId:r,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)})}};Ft.ClusterAdapter=kr;var Ic=class extends kr{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,r)=>{n-s>this._opts.heartbeatTimeout&&(ee("[%s] node %s seems down",this.uid,r),this.removeNode(r))})},1e3)}init(){this.publish({type:N.INITIAL_HEARTBEAT})}scheduleHeartbeat(){this.heartbeatTimer?this.heartbeatTimer.refresh():this.heartbeatTimer=setTimeout(()=>{this.publish({type:N.HEARTBEAT})},this._opts.heartbeatInterval)}close(){this.publish({type:N.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!==z_&&this.nodesMap.set(e.uid,Date.now()),e.type){case N.INITIAL_HEARTBEAT:this.publish({type:N.HEARTBEAT});break;case N.HEARTBEAT:break;case N.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:N.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),s=this.nodesMap.size;if(ee('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,s),s<=0)return n(null,[]);let r=dn(),o=setTimeout(()=>{let l=this.customRequests.get(r);l&&(n(new Error(`timeout reached: missing ${l.missingUids.size} responses`),l.responses),this.customRequests.delete(r))},Er),a={type:N.SERVER_SIDE_EMIT,resolve:n,timeout:o,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(r,a),this.publish({type:N.SERVER_SIDE_EMIT,data:{requestId:r,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()]),r=s-1;if(!((t=e.flags)===null||t===void 0)&&t.local||r<=0)return n;let o=dn();return new Promise((a,l)=>{let p=setTimeout(()=>{let m=this.customRequests.get(o);m&&(l(new Error(`timeout reached: missing ${m.missingUids.size} responses`)),this.customRequests.delete(o))},e.flags.timeout||Er),f={type:N.FETCH_SOCKETS,resolve:a,timeout:p,missingUids:new Set([...this.nodesMap.keys()]),responses:n};this.customRequests.set(o,f),this.publish({type:N.FETCH_SOCKETS,data:{opts:Oi(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 N.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 N.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===N.FETCH_SOCKETS?t.resolve(t.responses):t.type===N.SERVER_SIDE_EMIT&&t.resolve(null,t.responses),this.customRequests.delete(n))}),this.nodesMap.delete(e)}};Ft.ClusterAdapterWithHeartbeat=Ic});var Cr=C(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.MessageType=bt.ClusterAdapterWithHeartbeat=bt.ClusterAdapter=bt.SessionAwareAdapter=bt.Adapter=void 0;var ph=Nc();Object.defineProperty(bt,"Adapter",{enumerable:!0,get:function(){return ph.Adapter}});Object.defineProperty(bt,"SessionAwareAdapter",{enumerable:!0,get:function(){return ph.SessionAwareAdapter}});var Dc=uh();Object.defineProperty(bt,"ClusterAdapter",{enumerable:!0,get:function(){return Dc.ClusterAdapter}});Object.defineProperty(bt,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return Dc.ClusterAdapterWithHeartbeat}});Object.defineProperty(bt,"MessageType",{enumerable:!0,get:function(){return Dc.MessageType}})});var hh=C(fn=>{"use strict";var $_=fn&&fn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(fn,"__esModule",{value:!0});fn.ParentNamespace=void 0;var dh=Rc(),W_=Cr(),V_=$_(se()),fh=(0,V_.default)("socket.io:parent-namespace"),Tr=class i extends dh.Namespace{constructor(e){super(e,"/_"+i.count++),this.children=new Set}_initAdapter(){this.adapter=new qc(this)}emit(e,...t){return this.children.forEach(n=>{n.emit(e,...t)}),!0}createChild(e){fh("creating child namespace %s",e);let t=new dh.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&&(fh("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")}};fn.ParentNamespace=Tr;Tr.count=0;var qc=class extends W_.Adapter{broadcast(e,t){this.nsp.children.forEach(n=>{n.adapter.broadcast(e,t)})}}});var bh=C(Ri=>{"use strict";var K_=Ri&&Ri.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.patchAdapter=Y_;Ri.restoreAdapter=J_;Ri.serveFile=Z_;var Ai=Cr(),mh=require("fs"),G_=K_(se()),Mr=(0,G_.default)("socket.io:adapter-uws"),Lc="",{addAll:gh,del:xh,broadcast:yh}=Ai.Adapter.prototype;function Y_(i){Ai.Adapter.prototype.addAll=function(e,t){let n=!this.sids.has(e);gh.call(this,e,t);let s=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(s){if(s.conn.transport.name==="websocket"){vh(this.nsp.name,s,n,t);return}n&&s.conn.on("upgrade",()=>{let r=this.sids.get(e);r&&vh(this.nsp.name,s,n,r)})}},Ai.Adapter.prototype.del=function(e,t){xh.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,r=n.conn.transport.socket,o=`${this.nsp.name}${Lc}${t}`;Mr("unsubscribe connection %s from topic %s",s,o),r.unsubscribe(o)}},Ai.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){yh.call(this,e,t);return}let s=t.flags||{},r={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}${Lc}${t.rooms.keys().next().value}`;Mr("fast publish to %s",a),o.forEach(l=>{let p=typeof l!="string";i.publish(a,p?l:"4"+l,p)}),this.apply(t,l=>{l.conn.transport.name!=="websocket"&&l.client.writeToEngine(o,r)})}}function vh(i,e,t,n){let s=e.conn.id,r=e.conn.transport.socket;t&&(Mr("subscribe connection %s to topic %s",s,i),r.subscribe(i)),n.forEach(o=>{let a=`${i}${Lc}${o}`;Mr("subscribe connection %s to topic %s",s,a),r.subscribe(a)})}function J_(){Ai.Adapter.prototype.addAll=gh,Ai.Adapter.prototype.del=xh,Ai.Adapter.prototype.broadcast=yh}var X_=i=>{let{buffer:e,byteOffset:t,byteLength:n}=i;return e.slice(t,t+n)};function Z_(i,e){let{size:t}=(0,mh.statSync)(e),n=(0,mh.createReadStream)(e),s=()=>!n.destroyed&&n.destroy(),r=a=>{throw s(),a},o=a=>{let l=X_(a);i.cork(()=>{let p=i.getWriteOffset(),[f,m]=i.tryEnd(l,t);!m&&!f&&(n.pause(),i.onWritable(_=>{let[E,k]=i.tryEnd(l.slice(_-p),t);return!k&&E&&n.resume(),E}))})};i.onAborted(s),n.on("data",o).on("error",r).on("end",s)}});var wh=C((FT,Q_)=>{Q_.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 Oh=C((Ye,is)=>{"use strict";var eS=Ye&&Ye.__createBinding||(Object.create?(function(i,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(i,n,s)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),tS=Ye&&Ye.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),iS=Ye&&Ye.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&eS(e,i,t);return tS(e,i),e},Hc=Ye&&Ye.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.Namespace=Ye.Socket=Ye.Server=void 0;var nS=Hc(require("http")),sS=require("fs"),Fc=require("zlib"),rS=Os(),Or=require("stream"),_h=require("path"),Sh=Wf(),oS=eh(),Eh=require("events"),zc=Rc();Object.defineProperty(Ye,"Namespace",{enumerable:!0,get:function(){return zc.Namespace}});var aS=hh(),kh=Cr(),cS=iS(es()),lS=Hc(se()),Mh=Oc();Object.defineProperty(Ye,"Socket",{enumerable:!0,get:function(){return Mh.Socket}});var uS=gr(),Uc=bh(),pS=Hc(lc()),Qe=(0,lS.default)("socket.io:server"),Ch=wh().version,Th=/\.map/,hn=class i extends uS.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||cS,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||kh.SessionAwareAdapter)):this.adapter(t.adapter||kh.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||typeof e=="number")&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,pS.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(),r=()=>{let o=s.next();if(o.done)return n(!1);o.value(e,t,(a,l)=>{if(a||!l)return r();if(this._nsps.has(e))return Qe("dynamic namespace %s already exists",e),n(this._nsps.get(e));let p=this.parentNsps.get(o.value).createChild(e);Qe("dynamic namespace %s was created",e),n(p)})};r()}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"){Qe("creating http server and binding to %d",e);let n=e;e=nS.default.createServer((s,r)=>{r.writeHead(404),r.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,Qe("creating uWebSockets.js-based engine with opts %j",t);let n=new Sh.uServer(t);n.attach(e,t),this.bind(n),this._serveClient&&e.get(`${this._path}/*`,(s,r)=>{if(!this.clientPathRegex.test(r.getUrl())){r.setYield(!0);return}let o=r.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),a=Th.test(o),l=a?"map":"source",p='"'+Ch+'"',f="W/"+p,m=r.getHeader("if-none-match");if(m&&(p===m||f===m)){Qe("serve client %s 304",l),s.writeStatus("304 Not Modified"),s.end();return}Qe("serve client %s",l),s.writeHeader("cache-control","public, max-age=0"),s.writeHeader("content-type","application/"+(a?"json":"javascript")+"; charset=utf-8"),s.writeHeader("etag",p);let _=_h.join(__dirname,"../client-dist/",o);(0,Uc.serveFile)(s,_)}),(0,Uc.patchAdapter)(e)}initEngine(e,t){Qe("creating engine.io instance with opts %j",t),this.eio=(0,Sh.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){Qe("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 r=0;r<t.length;r++)t[r].call(e,n,s)})}serve(e,t){let n=e.url.replace(this._path,"").replace(/\?.*$/,""),s=Th.test(n),r=s?"map":"source",o='"'+Ch+'"',a="W/"+o,l=e.headers["if-none-match"];if(l&&(o===l||a===l)){Qe("serve client %s 304",r),t.writeHead(304),t.end();return}Qe("serve client %s",r),t.setHeader("Cache-Control","public, max-age=0"),t.setHeader("Content-Type","application/"+(s?"json":"javascript")+"; charset=utf-8"),t.setHeader("ETag",o),i.sendFile(n,e,t)}static sendFile(e,t,n){let s=(0,sS.createReadStream)(_h.join(__dirname,"../client-dist/",e)),r=rS(t).encodings(["br","gzip","deflate"]),o=a=>{a&&n.end()};switch(r){case"br":n.writeHead(200,{"content-encoding":"br"}),(0,Or.pipeline)(s,(0,Fc.createBrotliCompress)(),n,o);break;case"gzip":n.writeHead(200,{"content-encoding":"gzip"}),(0,Or.pipeline)(s,(0,Fc.createGzip)(),n,o);break;case"deflate":n.writeHead(200,{"content-encoding":"deflate"}),(0,Or.pipeline)(s,(0,Fc.createDeflate)(),n,o);break;default:n.writeHead(200),(0,Or.pipeline)(s,n,o)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){Qe("incoming connection with id %s",e.id);let t=new oS.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let s=new aS.ParentNamespace(this);return Qe("initializing parent namespace %s",s.name),typeof e=="function"?this.parentNsps.set(e,s):(this.parentNsps.set((r,o,a)=>a(null,e.test(r)),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,r]of this.parentNamespacesFromRegExp)if(s.test(e))return Qe("attaching namespace %s to parent namespace %s",e,s),r.createChild(e);Qe("initializing namespace %s",e),n=new zc.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,Uc.restoreAdapter)(),this.httpServer)return new Promise(t=>{this.httpServer.close(n=>{e&&e(n),n&&Qe("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)}};Ye.Server=hn;var dS=Object.keys(Eh.EventEmitter.prototype).filter(function(i){return typeof Eh.EventEmitter.prototype[i]=="function"});dS.forEach(function(i){hn.prototype[i]=function(){return this.sockets[i].apply(this.sockets,arguments)}});is.exports=(i,e)=>new hn(i,e);is.exports.Server=hn;is.exports.Namespace=zc.Namespace;is.exports.Socket=Mh.Socket});var Bh=C(($T,Ph)=>{"use strict";Ph.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var $c=C((WT,Nh)=>{var ns=Bh(),jh={};for(let i of Object.keys(ns))jh[ns[i]]=i;var R={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Nh.exports=R;for(let i of Object.keys(R)){if(!("channels"in R[i]))throw new Error("missing channels property: "+i);if(!("labels"in R[i]))throw new Error("missing channel labels property: "+i);if(R[i].labels.length!==R[i].channels)throw new Error("channel and label counts mismatch: "+i);let{channels:e,labels:t}=R[i];delete R[i].channels,delete R[i].labels,Object.defineProperty(R[i],"channels",{value:e}),Object.defineProperty(R[i],"labels",{value:t})}R.rgb.hsl=function(i){let e=i[0]/255,t=i[1]/255,n=i[2]/255,s=Math.min(e,t,n),r=Math.max(e,t,n),o=r-s,a,l;r===s?a=0:e===r?a=(t-n)/o:t===r?a=2+(n-e)/o:n===r&&(a=4+(e-t)/o),a=Math.min(a*60,360),a<0&&(a+=360);let p=(s+r)/2;return r===s?l=0:p<=.5?l=o/(r+s):l=o/(2-r-s),[a,l*100,p*100]};R.rgb.hsv=function(i){let e,t,n,s,r,o=i[0]/255,a=i[1]/255,l=i[2]/255,p=Math.max(o,a,l),f=p-Math.min(o,a,l),m=function(_){return(p-_)/6/f+1/2};return f===0?(s=0,r=0):(r=f/p,e=m(o),t=m(a),n=m(l),o===p?s=n-t:a===p?s=1/3+e-n:l===p&&(s=2/3+t-e),s<0?s+=1:s>1&&(s-=1)),[s*360,r*100,p*100]};R.rgb.hwb=function(i){let e=i[0],t=i[1],n=i[2],s=R.rgb.hsl(i)[0],r=1/255*Math.min(e,Math.min(t,n));return n=1-1/255*Math.max(e,Math.max(t,n)),[s,r*100,n*100]};R.rgb.cmyk=function(i){let e=i[0]/255,t=i[1]/255,n=i[2]/255,s=Math.min(1-e,1-t,1-n),r=(1-e-s)/(1-s)||0,o=(1-t-s)/(1-s)||0,a=(1-n-s)/(1-s)||0;return[r*100,o*100,a*100,s*100]};function fS(i,e){return(i[0]-e[0])**2+(i[1]-e[1])**2+(i[2]-e[2])**2}R.rgb.keyword=function(i){let e=jh[i];if(e)return e;let t=1/0,n;for(let s of Object.keys(ns)){let r=ns[s],o=fS(i,r);o<t&&(t=o,n=s)}return n};R.keyword.rgb=function(i){return ns[i]};R.rgb.xyz=function(i){let e=i[0]/255,t=i[1]/255,n=i[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let s=e*.4124+t*.3576+n*.1805,r=e*.2126+t*.7152+n*.0722,o=e*.0193+t*.1192+n*.9505;return[s*100,r*100,o*100]};R.rgb.lab=function(i){let e=R.rgb.xyz(i),t=e[0],n=e[1],s=e[2];t/=95.047,n/=100,s/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;let r=116*n-16,o=500*(t-n),a=200*(n-s);return[r,o,a]};R.hsl.rgb=function(i){let e=i[0]/360,t=i[1]/100,n=i[2]/100,s,r,o;if(t===0)return o=n*255,[o,o,o];n<.5?s=n*(1+t):s=n+t-n*t;let a=2*n-s,l=[0,0,0];for(let p=0;p<3;p++)r=e+1/3*-(p-1),r<0&&r++,r>1&&r--,6*r<1?o=a+(s-a)*6*r:2*r<1?o=s:3*r<2?o=a+(s-a)*(2/3-r)*6:o=a,l[p]=o*255;return l};R.hsl.hsv=function(i){let e=i[0],t=i[1]/100,n=i[2]/100,s=t,r=Math.max(n,.01);n*=2,t*=n<=1?n:2-n,s*=r<=1?r:2-r;let o=(n+t)/2,a=n===0?2*s/(r+s):2*t/(n+t);return[e,a*100,o*100]};R.hsv.rgb=function(i){let e=i[0]/60,t=i[1]/100,n=i[2]/100,s=Math.floor(e)%6,r=e-Math.floor(e),o=255*n*(1-t),a=255*n*(1-t*r),l=255*n*(1-t*(1-r));switch(n*=255,s){case 0:return[n,l,o];case 1:return[a,n,o];case 2:return[o,n,l];case 3:return[o,a,n];case 4:return[l,o,n];case 5:return[n,o,a]}};R.hsv.hsl=function(i){let e=i[0],t=i[1]/100,n=i[2]/100,s=Math.max(n,.01),r,o;o=(2-t)*n;let a=(2-t)*s;return r=t*s,r/=a<=1?a:2-a,r=r||0,o/=2,[e,r*100,o*100]};R.hwb.rgb=function(i){let e=i[0]/360,t=i[1]/100,n=i[2]/100,s=t+n,r;s>1&&(t/=s,n/=s);let o=Math.floor(6*e),a=1-n;r=6*e-o,(o&1)!==0&&(r=1-r);let l=t+r*(a-t),p,f,m;switch(o){default:case 6:case 0:p=a,f=l,m=t;break;case 1:p=l,f=a,m=t;break;case 2:p=t,f=a,m=l;break;case 3:p=t,f=l,m=a;break;case 4:p=l,f=t,m=a;break;case 5:p=a,f=t,m=l;break}return[p*255,f*255,m*255]};R.cmyk.rgb=function(i){let e=i[0]/100,t=i[1]/100,n=i[2]/100,s=i[3]/100,r=1-Math.min(1,e*(1-s)+s),o=1-Math.min(1,t*(1-s)+s),a=1-Math.min(1,n*(1-s)+s);return[r*255,o*255,a*255]};R.xyz.rgb=function(i){let e=i[0]/100,t=i[1]/100,n=i[2]/100,s,r,o;return s=e*3.2406+t*-1.5372+n*-.4986,r=e*-.9689+t*1.8758+n*.0415,o=e*.0557+t*-.204+n*1.057,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,r=r>.0031308?1.055*r**(1/2.4)-.055:r*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=Math.min(Math.max(0,s),1),r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),[s*255,r*255,o*255]};R.xyz.lab=function(i){let e=i[0],t=i[1],n=i[2];e/=95.047,t/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let s=116*t-16,r=500*(e-t),o=200*(t-n);return[s,r,o]};R.lab.xyz=function(i){let e=i[0],t=i[1],n=i[2],s,r,o;r=(e+16)/116,s=t/500+r,o=r-n/200;let a=r**3,l=s**3,p=o**3;return r=a>.008856?a:(r-16/116)/7.787,s=l>.008856?l:(s-16/116)/7.787,o=p>.008856?p:(o-16/116)/7.787,s*=95.047,r*=100,o*=108.883,[s,r,o]};R.lab.lch=function(i){let e=i[0],t=i[1],n=i[2],s;s=Math.atan2(n,t)*360/2/Math.PI,s<0&&(s+=360);let o=Math.sqrt(t*t+n*n);return[e,o,s]};R.lch.lab=function(i){let e=i[0],t=i[1],s=i[2]/360*2*Math.PI,r=t*Math.cos(s),o=t*Math.sin(s);return[e,r,o]};R.rgb.ansi16=function(i,e=null){let[t,n,s]=i,r=e===null?R.rgb.hsv(i)[2]:e;if(r=Math.round(r/50),r===0)return 30;let o=30+(Math.round(s/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return r===2&&(o+=60),o};R.hsv.ansi16=function(i){return R.rgb.ansi16(R.hsv.rgb(i),i[2])};R.rgb.ansi256=function(i){let e=i[0],t=i[1],n=i[2];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)};R.ansi16.rgb=function(i){let e=i%10;if(e===0||e===7)return i>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let t=(~~(i>50)+1)*.5,n=(e&1)*t*255,s=(e>>1&1)*t*255,r=(e>>2&1)*t*255;return[n,s,r]};R.ansi256.rgb=function(i){if(i>=232){let r=(i-232)*10+8;return[r,r,r]}i-=16;let e,t=Math.floor(i/36)/5*255,n=Math.floor((e=i%36)/6)/5*255,s=e%6/5*255;return[t,n,s]};R.rgb.hex=function(i){let t=(((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t};R.hex.rgb=function(i){let e=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let t=e[0];e[0].length===3&&(t=t.split("").map(a=>a+a).join(""));let n=parseInt(t,16),s=n>>16&255,r=n>>8&255,o=n&255;return[s,r,o]};R.rgb.hcg=function(i){let e=i[0]/255,t=i[1]/255,n=i[2]/255,s=Math.max(Math.max(e,t),n),r=Math.min(Math.min(e,t),n),o=s-r,a,l;return o<1?a=r/(1-o):a=0,o<=0?l=0:s===e?l=(t-n)/o%6:s===t?l=2+(n-e)/o:l=4+(e-t)/o,l/=6,l%=1,[l*360,o*100,a*100]};R.hsl.hcg=function(i){let e=i[1]/100,t=i[2]/100,n=t<.5?2*e*t:2*e*(1-t),s=0;return n<1&&(s=(t-.5*n)/(1-n)),[i[0],n*100,s*100]};R.hsv.hcg=function(i){let e=i[1]/100,t=i[2]/100,n=e*t,s=0;return n<1&&(s=(t-n)/(1-n)),[i[0],n*100,s*100]};R.hcg.rgb=function(i){let e=i[0]/360,t=i[1]/100,n=i[2]/100;if(t===0)return[n*255,n*255,n*255];let s=[0,0,0],r=e%1*6,o=r%1,a=1-o,l=0;switch(Math.floor(r)){case 0:s[0]=1,s[1]=o,s[2]=0;break;case 1:s[0]=a,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=o;break;case 3:s[0]=0,s[1]=a,s[2]=1;break;case 4:s[0]=o,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=a}return l=(1-t)*n,[(t*s[0]+l)*255,(t*s[1]+l)*255,(t*s[2]+l)*255]};R.hcg.hsv=function(i){let e=i[1]/100,t=i[2]/100,n=e+t*(1-e),s=0;return n>0&&(s=e/n),[i[0],s*100,n*100]};R.hcg.hsl=function(i){let e=i[1]/100,n=i[2]/100*(1-e)+.5*e,s=0;return n>0&&n<.5?s=e/(2*n):n>=.5&&n<1&&(s=e/(2*(1-n))),[i[0],s*100,n*100]};R.hcg.hwb=function(i){let e=i[1]/100,t=i[2]/100,n=e+t*(1-e);return[i[0],(n-e)*100,(1-n)*100]};R.hwb.hcg=function(i){let e=i[1]/100,n=1-i[2]/100,s=n-e,r=0;return s<1&&(r=(n-s)/(1-s)),[i[0],s*100,r*100]};R.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]};R.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]};R.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]};R.gray.hsl=function(i){return[0,0,i[0]]};R.gray.hsv=R.gray.hsl;R.gray.hwb=function(i){return[0,100,i[0]]};R.gray.cmyk=function(i){return[0,0,0,i[0]]};R.gray.lab=function(i){return[i[0],0,0]};R.gray.hex=function(i){let e=Math.round(i[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};R.rgb.gray=function(i){return[(i[0]+i[1]+i[2])/3/255*100]}});var Dh=C((VT,Ih)=>{var Ar=$c();function hS(){let i={},e=Object.keys(Ar);for(let t=e.length,n=0;n<t;n++)i[e[n]]={distance:-1,parent:null};return i}function mS(i){let e=hS(),t=[i];for(e[i].distance=0;t.length;){let n=t.pop(),s=Object.keys(Ar[n]);for(let r=s.length,o=0;o<r;o++){let a=s[o],l=e[a];l.distance===-1&&(l.distance=e[n].distance+1,l.parent=n,t.unshift(a))}}return e}function vS(i,e){return function(t){return e(i(t))}}function gS(i,e){let t=[e[i].parent,i],n=Ar[e[i].parent][i],s=e[i].parent;for(;e[s].parent;)t.unshift(e[s].parent),n=vS(Ar[e[s].parent][s],n),s=e[s].parent;return n.conversion=t,n}Ih.exports=function(i){let e=mS(i),t={},n=Object.keys(e);for(let s=n.length,r=0;r<s;r++){let o=n[r];e[o].parent!==null&&(t[o]=gS(o,e))}return t}});var Lh=C((KT,qh)=>{var Wc=$c(),xS=Dh(),mn={},yS=Object.keys(Wc);function bS(i){let e=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),i(t))};return"conversion"in i&&(e.conversion=i.conversion),e}function wS(i){let e=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let s=i(t);if(typeof s=="object")for(let r=s.length,o=0;o<r;o++)s[o]=Math.round(s[o]);return s};return"conversion"in i&&(e.conversion=i.conversion),e}yS.forEach(i=>{mn[i]={},Object.defineProperty(mn[i],"channels",{value:Wc[i].channels}),Object.defineProperty(mn[i],"labels",{value:Wc[i].labels});let e=xS(i);Object.keys(e).forEach(n=>{let s=e[n];mn[i][n]=wS(s),mn[i][n].raw=bS(s)})});qh.exports=mn});var Wh=C((GT,$h)=>{"use strict";var Fh=(i,e)=>(...t)=>`\x1B[${i(...t)+e}m`,Uh=(i,e)=>(...t)=>{let n=i(...t);return`\x1B[${38+e};5;${n}m`},Hh=(i,e)=>(...t)=>{let n=i(...t);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},Rr=i=>i,zh=(i,e,t)=>[i,e,t],vn=(i,e,t)=>{Object.defineProperty(i,e,{get:()=>{let n=t();return Object.defineProperty(i,e,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},Vc,gn=(i,e,t,n)=>{Vc===void 0&&(Vc=Lh());let s=n?10:0,r={};for(let[o,a]of Object.entries(Vc)){let l=o==="ansi16"?"ansi":o;o===e?r[l]=i(t,s):typeof a=="object"&&(r[l]=i(a[e],s))}return r};function _S(){let i=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,n]of Object.entries(e)){for(let[s,r]of Object.entries(n))e[s]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[s]=e[s],i.set(r[0],r[1]);Object.defineProperty(e,t,{value:n,enumerable:!1})}return Object.defineProperty(e,"codes",{value:i,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",vn(e.color,"ansi",()=>gn(Fh,"ansi16",Rr,!1)),vn(e.color,"ansi256",()=>gn(Uh,"ansi256",Rr,!1)),vn(e.color,"ansi16m",()=>gn(Hh,"rgb",zh,!1)),vn(e.bgColor,"ansi",()=>gn(Fh,"ansi16",Rr,!0)),vn(e.bgColor,"ansi256",()=>gn(Uh,"ansi256",Rr,!0)),vn(e.bgColor,"ansi16m",()=>gn(Hh,"rgb",zh,!0)),e}Object.defineProperty($h,"exports",{enumerable:!0,get:_S})});var Kh=C((YT,Vh)=>{"use strict";var SS=(i,e,t)=>{let n=i.indexOf(e);if(n===-1)return i;let s=e.length,r=0,o="";do o+=i.substr(r,n-r)+e+t,r=n+s,n=i.indexOf(e,r);while(n!==-1);return o+=i.substr(r),o},ES=(i,e,t,n)=>{let s=0,r="";do{let o=i[n-1]==="\r";r+=i.substr(s,(o?n-1:n)-s)+e+(o?`\r
20
+ `+n)}i.destroy()}var Qn=[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 z1(i){if(i+="",i.length<1)return!1;if(!Qn[i.charCodeAt(0)])return q('invalid header, index 0, char "%s"',i.charCodeAt(0)),!0;if(i.length<2)return!1;if(!Qn[i.charCodeAt(1)])return q('invalid header, index 1, char "%s"',i.charCodeAt(1)),!0;if(i.length<3)return!1;if(!Qn[i.charCodeAt(2)])return q('invalid header, index 2, char "%s"',i.charCodeAt(2)),!0;if(i.length<4)return!1;if(!Qn[i.charCodeAt(3)])return q('invalid header, index 3, char "%s"',i.charCodeAt(3)),!0;for(let e=4;e<i.length;++e)if(!Qn[i.charCodeAt(e)])return q('invalid header, index "%i", char "%s"',e,i.charCodeAt(e)),!0;return!1}});var If=C(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.Polling=void 0;var $1=_i(),Df=require("zlib"),W1=Os(),V1=se(),xt=(0,V1.default)("engine:polling"),K1={gzip:Df.createGzip,deflate:Df.createDeflate},dc=class extends $1.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){xt("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}xt("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&&(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.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 r,o=0,a={"Content-Type":"text/html"};this.headers(e,a);for(let p in a)t.writeHeader(p,String(a[p]));let l=p=>{this.onData(p.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((p,f)=>{let m=o+p.byteLength;if(m>n){this.onError("content-length mismatch"),t.close();return}if(!r){if(f){l(Buffer.from(p));return}r=Buffer.allocUnsafe(n)}if(Buffer.from(p).copy(r,o),f){if(m!=n){this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}l(r);return}o=m})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}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(r=>r.options&&r.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=f=>{this.headers(this.req,o),this.res.cork(()=>{Object.keys(o).forEach(m=>{this.res.writeHeader(m,String(o[m]))}),this.res.end(f)}),n()};if(!this.httpCompression||!t.compress){a(e);return}if((s?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let p=W1(this.req).encodings(["gzip","deflate"]);if(!p){a(e);return}this.compress(e,p,(f,m)=>{if(f){this.res.writeStatus("500 Internal Server Error"),this.res.end(),n(f);return}o["Content-Encoding"]=p,a(m)})}compress(e,t,n){xt("compressing");let s=[],r=0;K1[t](this.httpCompression).on("error",n).on("data",function(o){s.push(o),r+=o.length}).on("end",function(){n(null,Buffer.concat(s,r))}).end(e)}doClose(e){xt("closing");let t,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){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}};cr.Polling=dc});var Lf=C(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.WebSocket=void 0;var G1=_i(),Y1=se(),qf=(0,Y1.default)("engine:ws"),fc=class extends G1.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,r=o=>{let a=typeof o!="string",l=this.perMessageDeflate&&Buffer.byteLength(o)>this.perMessageDeflate.threshold;qf('writing "%s"',o),this.socket.send(o,a,l),s&&(this.emit("drain"),this.writable=!0,this.emit("ready"))};n.options&&typeof n.options.wsPreEncoded=="string"?r(n.options.wsPreEncoded):this.parser.encodePacket(n,this.supportsBinary,r)}}doClose(e){qf("closing"),e&&e(),this.socket.end()}};lr.WebSocket=fc});var Ff=C(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});var J1=If(),X1=Lf();hc.default={polling:J1.Polling,websocket:X1.WebSocket}});var Uf=C(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.uServer=void 0;var Z1=se(),Mi=pc(),Q1=Ff(),pi=(0,Z1.default)("engine:uws"),mc=class extends Mi.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,r)=>{e.headers[s]=r}),e.connection={remoteAddress:Buffer.from(t.getRemoteAddressAsText()).toString()},t.onAborted(()=>{pi("response has been aborted")})}createTransport(e,t){return new Q1.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 r=s.getUserData().transport;r.socket=s,r.writable=!0,r.emit("ready")},message:(s,r,o)=>{s.getUserData().transport.onData(o?r:Buffer.from(r).toString())},close:(s,r,o)=>{s.getUserData().transport.onClose(r,o)}})}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return n();e.res=new vc(t),super._applyMiddlewares(e,e.res,s=>{e.res.writeHead(),n(s)})}handleRequest(e,t){pi('handling "%s" http request "%s"',t.getMethod(),t.getUrl()),this.prepare(t,e),t.res=e;let n=(s,r)=>{if(s!==void 0){this.emit("connection_error",{req:t,code:s,message:Mi.Server.errorMessages[s],context:r}),this.abortRequest(t.res,s,r);return}if(t._query.sid)pi("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{let o=(a,l)=>this.abortRequest(e,a,l);this.handshake(t._query.transport,t,o)}};this._applyMiddlewares(t,e,s=>{s?n(Mi.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,n)})}handleUpgrade(e,t,n){pi("on upgrade"),this.prepare(t,e),t.res=e;let s=async(r,o)=>{if(r!==void 0){this.emit("connection_error",{req:t,code:r,message:Mi.Server.errorMessages[r],context:o}),this.abortRequest(e,r,o);return}let a=t._query.sid,l;if(a){let p=this.clients[a];if(p){if(p.upgrading)return pi("transport has already been trying to upgrade"),e.close();if(p.upgraded)return pi("transport had already been upgraded"),e.close();pi("upgrading existing transport"),l=this.createTransport(t._query.transport,t),p._maybeUpgrade(l)}else return pi("upgrade attempt for closed client"),e.close()}else if(l=await this.handshake(t._query.transport,t,(p,f)=>this.abortRequest(e,p,f)),!l)return;t.res.writeStatus("101 Switching Protocols"),e.upgrade({transport:l},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),n)};this._applyMiddlewares(t,e,r=>{r?s(Mi.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,s)})}abortRequest(e,t,n){let s=t===Mi.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",r=n&&n.message?n.message:Mi.Server.errorMessages[t];e.writeStatus(s),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:r}))}};ur.uServer=mc;var vc=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 Wf=C(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.protocol=Ve.Transport=Ve.Socket=Ve.uServer=Ve.parser=Ve.transports=Ve.Server=void 0;Ve.listen=r_;Ve.attach=$f;var e_=require("http"),Hf=pc();Object.defineProperty(Ve,"Server",{enumerable:!0,get:function(){return Hf.Server}});var t_=Ca();Ve.transports=t_.default;var zf=$n();Ve.parser=zf;var i_=Uf();Object.defineProperty(Ve,"uServer",{enumerable:!0,get:function(){return i_.uServer}});var n_=Ma();Object.defineProperty(Ve,"Socket",{enumerable:!0,get:function(){return n_.Socket}});var s_=_i();Object.defineProperty(Ve,"Transport",{enumerable:!0,get:function(){return s_.Transport}});Ve.protocol=zf.protocol;function r_(i,e,t){typeof e=="function"&&(t=e,e={});let n=(0,e_.createServer)(function(r,o){o.writeHead(501),o.end("Not Implemented")}),s=$f(n,e);return s.httpServer=n,n.listen(i,t),s}function $f(i,e){let t=new Hf.Server(e);return t.attach(i,e),t}});var Kf=C(Vf=>{Vf.Emitter=Ze;function Ze(i){if(i)return o_(i)}function o_(i){for(var e in Ze.prototype)i[e]=Ze.prototype[e];return i}Ze.prototype.on=Ze.prototype.addEventListener=function(i,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(e),this};Ze.prototype.once=function(i,e){function t(){this.off(i,t),e.apply(this,arguments)}return t.fn=e,this.on(i,t),this};Ze.prototype.off=Ze.prototype.removeListener=Ze.prototype.removeAllListeners=Ze.prototype.removeEventListener=function(i,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+i];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+i],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["$"+i],this};Ze.prototype.emit=function(i){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+i],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};Ze.prototype.emitReserved=Ze.prototype.emit;Ze.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]};Ze.prototype.hasListeners=function(i){return!!this.listeners(i).length}});var gc=C(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.isBinary=Yf;dr.hasBinary=pr;var a_=typeof ArrayBuffer=="function",c_=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i.buffer instanceof ArrayBuffer,Gf=Object.prototype.toString,l_=typeof Blob=="function"||typeof Blob<"u"&&Gf.call(Blob)==="[object BlobConstructor]",u_=typeof File=="function"||typeof File<"u"&&Gf.call(File)==="[object FileConstructor]";function Yf(i){return a_&&(i instanceof ArrayBuffer||c_(i))||l_&&i instanceof Blob||u_&&i instanceof File}function pr(i,e){if(!i||typeof i!="object")return!1;if(Array.isArray(i)){for(let t=0,n=i.length;t<n;t++)if(pr(i[t]))return!0;return!1}if(Yf(i))return!0;if(i.toJSON&&typeof i.toJSON=="function"&&arguments.length===1)return pr(i.toJSON(),!0);for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)&&pr(i[t]))return!0;return!1}});var Jf=C(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.deconstructPacket=d_;fr.reconstructPacket=f_;var p_=gc();function d_(i){let e=[],t=i.data,n=i;return n.data=xc(t,e),n.attachments=e.length,{packet:n,buffers:e}}function xc(i,e){if(!i)return i;if((0,p_.isBinary)(i)){let t={_placeholder:!0,num:e.length};return e.push(i),t}else if(Array.isArray(i)){let t=new Array(i.length);for(let n=0;n<i.length;n++)t[n]=xc(i[n],e);return t}else if(typeof i=="object"&&!(i instanceof Date)){let t={};for(let n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=xc(i[n],e));return t}return i}function f_(i,e){return i.data=yc(i.data,e),delete i.attachments,i}function yc(i,e){if(!i)return i;if(i&&i._placeholder===!0){if(typeof i.num=="number"&&i.num>=0&&i.num<e.length)return e[i.num];throw new Error("illegal attachments")}else if(Array.isArray(i))for(let t=0;t<i.length;t++)i[t]=yc(i[t],e);else if(typeof i=="object")for(let t in i)Object.prototype.hasOwnProperty.call(i,t)&&(i[t]=yc(i[t],e));return i}});var es=C(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.Decoder=Pt.Encoder=Pt.PacketType=Pt.protocol=void 0;Pt.isPacketValid=b_;var h_=Kf(),Xf=Jf(),Zf=gc(),m_=se(),bc=(0,m_.default)("socket.io-parser"),Qf=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];Pt.protocol=5;var W;(function(i){i[i.CONNECT=0]="CONNECT",i[i.DISCONNECT=1]="DISCONNECT",i[i.EVENT=2]="EVENT",i[i.ACK=3]="ACK",i[i.CONNECT_ERROR=4]="CONNECT_ERROR",i[i.BINARY_EVENT=5]="BINARY_EVENT",i[i.BINARY_ACK=6]="BINARY_ACK"})(W||(Pt.PacketType=W={}));var wc=class{constructor(e){this.replacer=e}encode(e){return bc("encoding packet %j",e),(e.type===W.EVENT||e.type===W.ACK)&&(0,Zf.hasBinary)(e)?this.encodeAsBinary({type:e.type===W.EVENT?W.BINARY_EVENT:W.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===W.BINARY_EVENT||e.type===W.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)),bc("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,Xf.deconstructPacket)(e),n=this.encodeAsString(t.packet),s=t.buffers;return s.unshift(n),s}};Pt.Encoder=wc;var _c=class i extends h_.Emitter{constructor(e){super(),this.reviver=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===W.BINARY_EVENT;n||t.type===W.BINARY_ACK?(t.type=n?W.EVENT:W.ACK,this.reconstructor=new Sc(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,Zf.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(W[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===W.BINARY_EVENT||n.type===W.BINARY_ACK){let r=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(r,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");n.attachments=Number(o)}if(e.charAt(t+1)==="/"){let r=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(r,t)}else n.nsp="/";let s=e.charAt(t+1);if(s!==""&&Number(s)==s){let r=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(r,t+1))}if(e.charAt(++t)){let r=this.tryParse(e.substr(t));if(i.isPayloadValid(n.type,r))n.data=r;else throw new Error("invalid payload")}return bc("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case W.CONNECT:return hr(t);case W.DISCONNECT:return t===void 0;case W.CONNECT_ERROR:return typeof t=="string"||hr(t);case W.EVENT:case W.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&Qf.indexOf(t[0])===-1);case W.ACK:case W.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};Pt.Decoder=_c;var Sc=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,Xf.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function v_(i){return typeof i=="string"}var g_=Number.isInteger||function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i};function x_(i){return i===void 0||g_(i)}function hr(i){return Object.prototype.toString.call(i)==="[object Object]"}function y_(i,e){switch(i){case W.CONNECT:return e===void 0||hr(e);case W.DISCONNECT:return e===void 0;case W.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&Qf.indexOf(e[0])===-1);case W.ACK:return Array.isArray(e);case W.CONNECT_ERROR:return typeof e=="string"||hr(e);default:return!1}}function b_(i){return v_(i.nsp)&&x_(i.id)&&y_(i.type,i.data)}});var eh=C(on=>{"use strict";var w_=on&&on.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(on,"__esModule",{value:!0});on.Client=void 0;var mr=es(),__=w_(se()),Bt=(0,__.default)("socket.io:client"),Ec=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?(Bt("no namespace joined yet, close the client"),this.close()):Bt("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return Bt("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,n=>{n?this.doConnect(e,t):(Bt("creation of namespace %s was denied",e),this._packet({type:mr.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 Bt("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(Bt("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){Bt("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){Bt("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){Bt("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:n}=this._parseNamespace(e),s=this.nsps.get(t);!s&&e.type===mr.PacketType.CONNECT?this.connect(t,n):s&&e.type!==mr.PacketType.CONNECT&&e.type!==mr.PacketType.CONNECT_ERROR?process.nextTick(function(){s._onpacket(e)}):(Bt("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){Bt("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)}};on.Client=Ec});var gr=C(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.StrictEventEmitter=void 0;var S_=require("events"),kc=class extends S_.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)}};vr.StrictEventEmitter=kc});var Cc=C(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.RESERVED_EVENTS=void 0;xr.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var Tc=C(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.RemoteSocket=an.BroadcastOperator=void 0;var E_=Cc(),k_=es(),yr=class i{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 i(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 i(this.adapter,this.rooms,t,this.flags)}compress(e){let t=Object.assign({},this.flags,{compress:e});return new i(this.adapter,this.rooms,this.exceptRooms,t)}get volatile(){let e=Object.assign({},this.flags,{volatile:!0});return new i(this.adapter,this.rooms,this.exceptRooms,e)}get local(){let e=Object.assign({},this.flags,{local:!0});return new i(this.adapter,this.rooms,this.exceptRooms,e)}timeout(e){let t=Object.assign({},this.flags,{timeout:e});return new i(this.adapter,this.rooms,this.exceptRooms,t)}emit(e,...t){if(E_.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],s={type:k_.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,l=[],p=setTimeout(()=>{a=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:l])},this.flags.timeout),f=-1,m=0,_=0,E=()=>{!a&&f===m&&l.length===_&&(clearTimeout(p),o.apply(this,[null,this.flags.expectSingleResponse?l[0]:l]))};return this.adapter.broadcastWithAck(s,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},k=>{_+=k,m++,E()},k=>{l.push(k),E()}),this.adapter.serverCount().then(k=>{f=k,E()}),!0}emitWithAck(e,...t){return new Promise((n,s)=>{t.push((r,o)=>r?(r.responses=o,s(r)):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 br(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)}};an.BroadcastOperator=yr;var br=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 yr(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}};an.RemoteSocket=br});var Oc=C(cn=>{"use strict";var nh=cn&&cn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(cn,"__esModule",{value:!0});cn.Socket=void 0;var yt=es(),C_=nh(se()),T_=gr(),th=nh(ra()),M_=Tc(),O_=Cc(),Ge=(0,C_.default)("socket.io:socket"),A_=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function ih(){}var Mc=class extends T_.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(r=>this.join(r)),this.data=s.data,s.missedPackets.forEach(r=>{this.packet({type:yt.PacketType.EVENT,data:r})}),this.recovered=!0):(t.conn.protocol===3?this.id=e.name!=="/"?e.name+"#"+t.id:t.id:this.id=th.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=th.default.generateId())),this.handshake=this.buildHandshake(n),this.on("error",ih)}buildHandshake(e){var t,n,s,r;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:((r=this.request)===null||r===void 0?void 0:r._query)||{},auth:e}}emit(e,...t){if(O_.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],s={type:yt.PacketType.EVENT,data:n};if(typeof n[n.length-1]=="function"){let o=this.nsp._ids++;Ge("emitting packet with ack id %d",o),this.registerAckCallback(o,n.pop()),s.id=o}let r=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:r}):(this.notifyOutgoingListeners(s),this.packet(s,r)),!0}emitWithAck(e,...t){let n=this.flags.timeout!==void 0;return new Promise((s,r)=>{t.push((o,a)=>n?o?r(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(()=>{Ge("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,(...r)=>{clearTimeout(s),t.apply(this,[null,...r])})}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 Ge("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return Ge("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){Ge("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3?this.packet({type:yt.PacketType.CONNECT}):this.packet({type:yt.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(Ge("got packet %j",e),e.type){case yt.PacketType.EVENT:this.onevent(e);break;case yt.PacketType.BINARY_EVENT:this.onevent(e);break;case yt.PacketType.ACK:this.onack(e);break;case yt.PacketType.BINARY_ACK:this.onack(e);break;case yt.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(e){let t=e.data||[];if(Ge("emitting event %j",t),e.id!=null&&(Ge("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);Ge("sending ack %j",s),t.packet({id:e,type:yt.PacketType.ACK,data:s}),n=!0}}onack(e){let t=this.acks.get(e.id);typeof t=="function"?(Ge("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):Ge("bad ack %s",e.id)}ondisconnect(){Ge("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;Ge("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&A_.has(e)&&(Ge("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=ih}_error(e){this.packet({type:yt.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:yt.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){Ge("dispatching an event %j",e),this.run(e,t=>{process.nextTick(()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):Ge("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(r){n[r](e,o=>{if(o)return t(o);if(!n[r+1])return t();s(r+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 M_.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};cn.Socket=Mc});var Rc=C(ei=>{"use strict";var R_=ei&&ei.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ei,"__esModule",{value:!0});ei.Namespace=ei.RESERVED_EVENTS=void 0;var sh=Oc(),P_=gr(),B_=R_(se()),pt=Tc(),ln=(0,B_.default)("socket.io:namespace");ei.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var Ac=class extends P_.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=>{ln("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(r){n[r](e,o=>{if(o)return t(o);if(!n[r+1])return t();s(r+1)})}s(0)}to(e){return new pt.BroadcastOperator(this.adapter).to(e)}in(e){return new pt.BroadcastOperator(this.adapter).in(e)}except(e){return new pt.BroadcastOperator(this.adapter).except(e)}async _add(e,t,n){var s;ln("adding socket to nsp %s",this.name);let r=await this._createSocket(e,t);if(this._preConnectSockets.set(r.id,r),!((s=this.server.opts.connectionStateRecovery)===null||s===void 0)&&s.skipMiddlewares&&r.recovered&&e.conn.readyState==="open")return this._doConnect(r,n);this.run(r,o=>{process.nextTick(()=>{if(e.conn.readyState!=="open"){ln("next called after client was closed - ignoring socket"),r._cleanup();return}if(o)return ln("middleware error, sending CONNECT_ERROR packet to the client"),r._cleanup(),e.conn.protocol===3?r._error(o.data||o.message):r._error({message:o.message,data:o.data});this._doConnect(r,n)})})}async _createSocket(e,t){let n=t.pid,s=t.offset;if(this.server.opts.connectionStateRecovery&&typeof n=="string"&&typeof s=="string"){let r;try{r=await this.adapter.restoreSession(n,s)}catch(o){ln("error while restoring session: %s",o)}if(r)return ln("connection state recovered for sid %s",r.sid),new sh.Socket(this,e,t,r)}return new sh.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 pt.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(ei.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((r,o)=>r?(r.responses=o,s(r)):n(o)),this.serverSideEmit(e,...t)})}_onServerSideEmit(e){super.emitUntyped.apply(this,e)}allSockets(){return new pt.BroadcastOperator(this.adapter).allSockets()}compress(e){return new pt.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new pt.BroadcastOperator(this.adapter).volatile}get local(){return new pt.BroadcastOperator(this.adapter).local}timeout(e){return new pt.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new pt.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new pt.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new pt.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new pt.BroadcastOperator(this.adapter).disconnectSockets(e)}};ei.Namespace=Ac});var lh=C(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.encode=Pc;ts.decode=j_;ts.yeast=N_;var ah="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),wr=64,ch={},rh=0,di=0,oh;function Pc(i){let e="";do e=ah[i%wr]+e,i=Math.floor(i/wr);while(i>0);return e}function j_(i){let e=0;for(di=0;di<i.length;di++)e=e*wr+ch[i.charAt(di)];return e}function N_(){let i=Pc(+new Date);return i!==oh?(rh=0,oh=i):i+"."+Pc(rh++)}for(;di<wr;di++)ch[ah[di]]=di});var Nc=C(un=>{"use strict";var Bc;Object.defineProperty(un,"__esModule",{value:!0});un.SessionAwareAdapter=un.Adapter=void 0;var D_=require("events"),I_=lh(),_r=ac(),q_=typeof((Bc=_r?.Sender)===null||Bc===void 0?void 0:Bc.frame)=="function",Sr=class extends D_.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 r=this._encode(e,s);this.apply(t,o=>{typeof o.notifyOutgoingListeners=="function"&&o.notifyOutgoingListeners(e),o.client.writeToEngine(r,s)})}broadcastWithAck(e,t,n,s){let r=t.flags||{},o={preEncoded:!0,volatile:r.volatile,compress:r.compress};e.nsp=this.nsp.name,e.id=this.nsp._ids++;let a=this._encode(e,o),l=0;this.apply(t,p=>{l++,p.acks.set(e.id,s),typeof p.notifyOutgoingListeners=="function"&&p.notifyOutgoingListeners(e),p.client.writeToEngine(a,o)}),n(l)}_encode(e,t){let n=this.encoder.encode(e);if(q_&&n.length===1&&typeof n[0]=="string"){let s=Buffer.from("4"+n[0]);t.wsPreEncodedFrame=_r.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 r=new Set;for(let o of n)if(this.rooms.has(o))for(let a of this.rooms.get(o)){if(r.has(a)||s.has(a))continue;let l=this.nsp.sockets.get(a);l&&(t(l),r.add(a))}}else for(let[r]of this.sids){if(s.has(r))continue;let o=this.nsp.sockets.get(r);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}};un.Adapter=Sr;var jc=class extends Sr{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,r)=>{s.disconnectedAt<n&&this.sessions.delete(r)});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 r=this.packets.findIndex(a=>a.id===t);if(r===-1)return null;let o=[];for(let a=r+1;a<this.packets.length;a++){let l=this.packets[a];L_(n.rooms,l.opts)&&o.push(l.data)}return Promise.resolve(Object.assign(Object.assign({},n),{missedPackets:o}))}broadcast(e,t){var n;let s=e.type===2,r=e.id===void 0,o=((n=t.flags)===null||n===void 0?void 0:n.volatile)===void 0;if(s&&r&&o){let a=(0,I_.yeast)();e.data.push(a),this.packets.push({id:a,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};un.SessionAwareAdapter=jc;function L_(i,e){let t=e.rooms.size===0||i.some(s=>e.rooms.has(s)),n=i.every(s=>!e.except.has(s));return t&&n}});var uh=C(Ft=>{"use strict";var F_=Ft&&Ft.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.ClusterAdapterWithHeartbeat=Ft.ClusterAdapter=Ft.MessageType=void 0;var U_=Nc(),H_=se(),z_=require("crypto"),ee=(0,H_.debug)("socket.io-adapter"),$_="emitter",Er=5e3;function dn(){return(0,z_.randomBytes)(8).toString("hex")}var N;(function(i){i[i.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",i[i.HEARTBEAT=2]="HEARTBEAT",i[i.BROADCAST=3]="BROADCAST",i[i.SOCKETS_JOIN=4]="SOCKETS_JOIN",i[i.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",i[i.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",i[i.FETCH_SOCKETS=7]="FETCH_SOCKETS",i[i.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",i[i.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",i[i.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",i[i.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",i[i.BROADCAST_ACK=12]="BROADCAST_ACK",i[i.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(N||(Ft.MessageType=N={}));function Oi(i){return{rooms:[...i.rooms],except:[...i.except],flags:i.flags}}function pn(i){return{rooms:new Set(i.rooms),except:new Set(i.except),flags:i.flags}}var kr=class extends U_.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=dn()}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 N.BROADCAST:{if(e.data.requestId!==void 0)super.broadcastWithAck(e.data.packet,pn(e.data.opts),s=>{ee("[%s] waiting for %d client acknowledgements",this.uid,s),this.publishResponse(e.uid,{type:N.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:s}})},s=>{ee("[%s] received acknowledgement with value %j",this.uid,s),this.publishResponse(e.uid,{type:N.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:s}})});else{let s=e.data.packet,r=pn(e.data.opts);this.addOffsetIfNecessary(s,r,t),super.broadcast(s,r)}break}case N.SOCKETS_JOIN:super.addSockets(pn(e.data.opts),e.data.rooms);break;case N.SOCKETS_LEAVE:super.delSockets(pn(e.data.opts),e.data.rooms);break;case N.DISCONNECT_SOCKETS:super.disconnectSockets(pn(e.data.opts),e.data.close);break;case N.FETCH_SOCKETS:{ee("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(pn(e.data.opts)).then(n=>{this.publishResponse(e.uid,{type:N.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:n.map(s=>{let r=s.handshake,{sessionStore:o}=r,a=F_(r,["sessionStore"]);return{id:s.id,handshake:a,rooms:[...s.rooms],data:s.data}})}})});break}case N.SERVER_SIDE_EMIT:{let n=e.data.packet;if(!(e.data.requestId!==void 0)){this.nsp._onServerSideEmit(n);return}let r=!1,o=a=>{r||(r=!0,ee("[%s] calling acknowledgement with %j",this.uid,a),this.publishResponse(e.uid,{type:N.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:a}}))};this.nsp._onServerSideEmit([...n,o]);break}case N.BROADCAST_CLIENT_COUNT:case N.BROADCAST_ACK:case N.FETCH_SOCKETS_RESPONSE:case N.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 s=e.data.requestId;switch(ee("[%s] received response %s to request %s",this.uid,e.type,s),e.type){case N.BROADCAST_CLIENT_COUNT:{(t=this.ackRequests.get(s))===null||t===void 0||t.clientCountCallback(e.data.clientCount);break}case N.BROADCAST_ACK:{(n=this.ackRequests.get(s))===null||n===void 0||n.ack(e.data.packet);break}case N.FETCH_SOCKETS_RESPONSE:{let r=this.requests.get(s);if(!r)return;r.current++,e.data.sockets.forEach(o=>r.responses.push(o)),r.current===r.expected&&(clearTimeout(r.timeout),r.resolve(r.responses),this.requests.delete(s));break}case N.SERVER_SIDE_EMIT_RESPONSE:{let r=this.requests.get(s);if(!r)return;r.current++,r.responses.push(e.data.packet),r.current===r.expected&&(clearTimeout(r.timeout),r.resolve(null,r.responses),this.requests.delete(s));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 r=await this.publishAndReturnOffset({type:N.BROADCAST,data:{packet:e,opts:Oi(t)}});this.addOffsetIfNecessary(e,t,r)}catch(r){return ee("[%s] error while broadcasting message: %s",this.uid,r.message)}super.broadcast(e,t)}addOffsetIfNecessary(e,t,n){var s;if(!this.nsp.server.opts.connectionStateRecovery)return;let r=e.type===2,o=e.id===void 0,a=((s=t.flags)===null||s===void 0?void 0:s.volatile)===void 0;r&&o&&a&&e.data.push(n)}broadcastWithAck(e,t,n,s){var r;if(!((r=t?.flags)===null||r===void 0?void 0:r.local)){let a=dn();this.ackRequests.set(a,{clientCountCallback:n,ack:s}),this.publish({type:N.BROADCAST,data:{packet:e,requestId:a,opts:Oi(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:N.SOCKETS_JOIN,data:{opts:Oi(e),rooms:t}})}catch(r){ee("[%s] error while publishing message: %s",this.uid,r.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:N.SOCKETS_LEAVE,data:{opts:Oi(e),rooms:t}})}catch(r){ee("[%s] error while publishing message: %s",this.uid,r.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:N.DISCONNECT_SOCKETS,data:{opts:Oi(e),close:t}})}catch(r){ee("[%s] error while publishing message: %s",this.uid,r.message)}super.disconnectSockets(e,t)}async fetchSockets(e){var t;let[n,s]=await Promise.all([super.fetchSockets(e),this.serverCount()]),r=s-1;if(!((t=e.flags)===null||t===void 0)&&t.local||r<=0)return n;let o=dn();return new Promise((a,l)=>{let p=setTimeout(()=>{let m=this.requests.get(o);m&&(l(new Error(`timeout reached: only ${m.current} responses received out of ${m.expected}`)),this.requests.delete(o))},e.flags.timeout||Er),f={type:N.FETCH_SOCKETS,resolve:a,timeout:p,current:0,expected:r,responses:n};this.requests.set(o,f),this.publish({type:N.FETCH_SOCKETS,data:{opts:Oi(e),requestId:o}})})}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:N.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),s=await this.serverCount()-1;if(ee('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,s),s<=0)return n(null,[]);let r=dn(),o=setTimeout(()=>{let l=this.requests.get(r);l&&(n(new Error(`timeout reached: only ${l.current} responses received out of ${l.expected}`),l.responses),this.requests.delete(r))},Er),a={type:N.SERVER_SIDE_EMIT,resolve:n,timeout:o,current:0,expected:s,responses:[]};this.requests.set(r,a),this.publish({type:N.SERVER_SIDE_EMIT,data:{requestId:r,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)})}};Ft.ClusterAdapter=kr;var Dc=class extends kr{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,r)=>{n-s>this._opts.heartbeatTimeout&&(ee("[%s] node %s seems down",this.uid,r),this.removeNode(r))})},1e3)}init(){this.publish({type:N.INITIAL_HEARTBEAT})}scheduleHeartbeat(){this.heartbeatTimer?this.heartbeatTimer.refresh():this.heartbeatTimer=setTimeout(()=>{this.publish({type:N.HEARTBEAT})},this._opts.heartbeatInterval)}close(){this.publish({type:N.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!==$_&&this.nodesMap.set(e.uid,Date.now()),e.type){case N.INITIAL_HEARTBEAT:this.publish({type:N.HEARTBEAT});break;case N.HEARTBEAT:break;case N.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:N.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),s=this.nodesMap.size;if(ee('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,s),s<=0)return n(null,[]);let r=dn(),o=setTimeout(()=>{let l=this.customRequests.get(r);l&&(n(new Error(`timeout reached: missing ${l.missingUids.size} responses`),l.responses),this.customRequests.delete(r))},Er),a={type:N.SERVER_SIDE_EMIT,resolve:n,timeout:o,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(r,a),this.publish({type:N.SERVER_SIDE_EMIT,data:{requestId:r,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()]),r=s-1;if(!((t=e.flags)===null||t===void 0)&&t.local||r<=0)return n;let o=dn();return new Promise((a,l)=>{let p=setTimeout(()=>{let m=this.customRequests.get(o);m&&(l(new Error(`timeout reached: missing ${m.missingUids.size} responses`)),this.customRequests.delete(o))},e.flags.timeout||Er),f={type:N.FETCH_SOCKETS,resolve:a,timeout:p,missingUids:new Set([...this.nodesMap.keys()]),responses:n};this.customRequests.set(o,f),this.publish({type:N.FETCH_SOCKETS,data:{opts:Oi(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 N.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 N.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===N.FETCH_SOCKETS?t.resolve(t.responses):t.type===N.SERVER_SIDE_EMIT&&t.resolve(null,t.responses),this.customRequests.delete(n))}),this.nodesMap.delete(e)}};Ft.ClusterAdapterWithHeartbeat=Dc});var Cr=C(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.MessageType=bt.ClusterAdapterWithHeartbeat=bt.ClusterAdapter=bt.SessionAwareAdapter=bt.Adapter=void 0;var ph=Nc();Object.defineProperty(bt,"Adapter",{enumerable:!0,get:function(){return ph.Adapter}});Object.defineProperty(bt,"SessionAwareAdapter",{enumerable:!0,get:function(){return ph.SessionAwareAdapter}});var Ic=uh();Object.defineProperty(bt,"ClusterAdapter",{enumerable:!0,get:function(){return Ic.ClusterAdapter}});Object.defineProperty(bt,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return Ic.ClusterAdapterWithHeartbeat}});Object.defineProperty(bt,"MessageType",{enumerable:!0,get:function(){return Ic.MessageType}})});var hh=C(fn=>{"use strict";var W_=fn&&fn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(fn,"__esModule",{value:!0});fn.ParentNamespace=void 0;var dh=Rc(),V_=Cr(),K_=W_(se()),fh=(0,K_.default)("socket.io:parent-namespace"),Tr=class i extends dh.Namespace{constructor(e){super(e,"/_"+i.count++),this.children=new Set}_initAdapter(){this.adapter=new qc(this)}emit(e,...t){return this.children.forEach(n=>{n.emit(e,...t)}),!0}createChild(e){fh("creating child namespace %s",e);let t=new dh.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&&(fh("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")}};fn.ParentNamespace=Tr;Tr.count=0;var qc=class extends V_.Adapter{broadcast(e,t){this.nsp.children.forEach(n=>{n.adapter.broadcast(e,t)})}}});var bh=C(Ri=>{"use strict";var G_=Ri&&Ri.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.patchAdapter=J_;Ri.restoreAdapter=X_;Ri.serveFile=Q_;var Ai=Cr(),mh=require("fs"),Y_=G_(se()),Mr=(0,Y_.default)("socket.io:adapter-uws"),Lc="",{addAll:gh,del:xh,broadcast:yh}=Ai.Adapter.prototype;function J_(i){Ai.Adapter.prototype.addAll=function(e,t){let n=!this.sids.has(e);gh.call(this,e,t);let s=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(s){if(s.conn.transport.name==="websocket"){vh(this.nsp.name,s,n,t);return}n&&s.conn.on("upgrade",()=>{let r=this.sids.get(e);r&&vh(this.nsp.name,s,n,r)})}},Ai.Adapter.prototype.del=function(e,t){xh.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,r=n.conn.transport.socket,o=`${this.nsp.name}${Lc}${t}`;Mr("unsubscribe connection %s from topic %s",s,o),r.unsubscribe(o)}},Ai.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){yh.call(this,e,t);return}let s=t.flags||{},r={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}${Lc}${t.rooms.keys().next().value}`;Mr("fast publish to %s",a),o.forEach(l=>{let p=typeof l!="string";i.publish(a,p?l:"4"+l,p)}),this.apply(t,l=>{l.conn.transport.name!=="websocket"&&l.client.writeToEngine(o,r)})}}function vh(i,e,t,n){let s=e.conn.id,r=e.conn.transport.socket;t&&(Mr("subscribe connection %s to topic %s",s,i),r.subscribe(i)),n.forEach(o=>{let a=`${i}${Lc}${o}`;Mr("subscribe connection %s to topic %s",s,a),r.subscribe(a)})}function X_(){Ai.Adapter.prototype.addAll=gh,Ai.Adapter.prototype.del=xh,Ai.Adapter.prototype.broadcast=yh}var Z_=i=>{let{buffer:e,byteOffset:t,byteLength:n}=i;return e.slice(t,t+n)};function Q_(i,e){let{size:t}=(0,mh.statSync)(e),n=(0,mh.createReadStream)(e),s=()=>!n.destroyed&&n.destroy(),r=a=>{throw s(),a},o=a=>{let l=Z_(a);i.cork(()=>{let p=i.getWriteOffset(),[f,m]=i.tryEnd(l,t);!m&&!f&&(n.pause(),i.onWritable(_=>{let[E,k]=i.tryEnd(l.slice(_-p),t);return!k&&E&&n.resume(),E}))})};i.onAborted(s),n.on("data",o).on("error",r).on("end",s)}});var wh=C((UT,eS)=>{eS.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 Oh=C((Ye,is)=>{"use strict";var tS=Ye&&Ye.__createBinding||(Object.create?(function(i,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(i,n,s)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),iS=Ye&&Ye.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),nS=Ye&&Ye.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&tS(e,i,t);return iS(e,i),e},Hc=Ye&&Ye.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.Namespace=Ye.Socket=Ye.Server=void 0;var sS=Hc(require("http")),rS=require("fs"),Fc=require("zlib"),oS=Os(),Or=require("stream"),_h=require("path"),Sh=Wf(),aS=eh(),Eh=require("events"),zc=Rc();Object.defineProperty(Ye,"Namespace",{enumerable:!0,get:function(){return zc.Namespace}});var cS=hh(),kh=Cr(),lS=nS(es()),uS=Hc(se()),Mh=Oc();Object.defineProperty(Ye,"Socket",{enumerable:!0,get:function(){return Mh.Socket}});var pS=gr(),Uc=bh(),dS=Hc(lc()),Qe=(0,uS.default)("socket.io:server"),Ch=wh().version,Th=/\.map/,hn=class i extends pS.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||lS,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||kh.SessionAwareAdapter)):this.adapter(t.adapter||kh.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||typeof e=="number")&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,dS.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(),r=()=>{let o=s.next();if(o.done)return n(!1);o.value(e,t,(a,l)=>{if(a||!l)return r();if(this._nsps.has(e))return Qe("dynamic namespace %s already exists",e),n(this._nsps.get(e));let p=this.parentNsps.get(o.value).createChild(e);Qe("dynamic namespace %s was created",e),n(p)})};r()}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"){Qe("creating http server and binding to %d",e);let n=e;e=sS.default.createServer((s,r)=>{r.writeHead(404),r.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,Qe("creating uWebSockets.js-based engine with opts %j",t);let n=new Sh.uServer(t);n.attach(e,t),this.bind(n),this._serveClient&&e.get(`${this._path}/*`,(s,r)=>{if(!this.clientPathRegex.test(r.getUrl())){r.setYield(!0);return}let o=r.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),a=Th.test(o),l=a?"map":"source",p='"'+Ch+'"',f="W/"+p,m=r.getHeader("if-none-match");if(m&&(p===m||f===m)){Qe("serve client %s 304",l),s.writeStatus("304 Not Modified"),s.end();return}Qe("serve client %s",l),s.writeHeader("cache-control","public, max-age=0"),s.writeHeader("content-type","application/"+(a?"json":"javascript")+"; charset=utf-8"),s.writeHeader("etag",p);let _=_h.join(__dirname,"../client-dist/",o);(0,Uc.serveFile)(s,_)}),(0,Uc.patchAdapter)(e)}initEngine(e,t){Qe("creating engine.io instance with opts %j",t),this.eio=(0,Sh.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){Qe("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 r=0;r<t.length;r++)t[r].call(e,n,s)})}serve(e,t){let n=e.url.replace(this._path,"").replace(/\?.*$/,""),s=Th.test(n),r=s?"map":"source",o='"'+Ch+'"',a="W/"+o,l=e.headers["if-none-match"];if(l&&(o===l||a===l)){Qe("serve client %s 304",r),t.writeHead(304),t.end();return}Qe("serve client %s",r),t.setHeader("Cache-Control","public, max-age=0"),t.setHeader("Content-Type","application/"+(s?"json":"javascript")+"; charset=utf-8"),t.setHeader("ETag",o),i.sendFile(n,e,t)}static sendFile(e,t,n){let s=(0,rS.createReadStream)(_h.join(__dirname,"../client-dist/",e)),r=oS(t).encodings(["br","gzip","deflate"]),o=a=>{a&&n.end()};switch(r){case"br":n.writeHead(200,{"content-encoding":"br"}),(0,Or.pipeline)(s,(0,Fc.createBrotliCompress)(),n,o);break;case"gzip":n.writeHead(200,{"content-encoding":"gzip"}),(0,Or.pipeline)(s,(0,Fc.createGzip)(),n,o);break;case"deflate":n.writeHead(200,{"content-encoding":"deflate"}),(0,Or.pipeline)(s,(0,Fc.createDeflate)(),n,o);break;default:n.writeHead(200),(0,Or.pipeline)(s,n,o)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){Qe("incoming connection with id %s",e.id);let t=new aS.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let s=new cS.ParentNamespace(this);return Qe("initializing parent namespace %s",s.name),typeof e=="function"?this.parentNsps.set(e,s):(this.parentNsps.set((r,o,a)=>a(null,e.test(r)),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,r]of this.parentNamespacesFromRegExp)if(s.test(e))return Qe("attaching namespace %s to parent namespace %s",e,s),r.createChild(e);Qe("initializing namespace %s",e),n=new zc.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,Uc.restoreAdapter)(),this.httpServer)return new Promise(t=>{this.httpServer.close(n=>{e&&e(n),n&&Qe("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)}};Ye.Server=hn;var fS=Object.keys(Eh.EventEmitter.prototype).filter(function(i){return typeof Eh.EventEmitter.prototype[i]=="function"});fS.forEach(function(i){hn.prototype[i]=function(){return this.sockets[i].apply(this.sockets,arguments)}});is.exports=(i,e)=>new hn(i,e);is.exports.Server=hn;is.exports.Namespace=zc.Namespace;is.exports.Socket=Mh.Socket});var Bh=C((WT,Ph)=>{"use strict";Ph.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var $c=C((VT,Nh)=>{var ns=Bh(),jh={};for(let i of Object.keys(ns))jh[ns[i]]=i;var R={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Nh.exports=R;for(let i of Object.keys(R)){if(!("channels"in R[i]))throw new Error("missing channels property: "+i);if(!("labels"in R[i]))throw new Error("missing channel labels property: "+i);if(R[i].labels.length!==R[i].channels)throw new Error("channel and label counts mismatch: "+i);let{channels:e,labels:t}=R[i];delete R[i].channels,delete R[i].labels,Object.defineProperty(R[i],"channels",{value:e}),Object.defineProperty(R[i],"labels",{value:t})}R.rgb.hsl=function(i){let e=i[0]/255,t=i[1]/255,n=i[2]/255,s=Math.min(e,t,n),r=Math.max(e,t,n),o=r-s,a,l;r===s?a=0:e===r?a=(t-n)/o:t===r?a=2+(n-e)/o:n===r&&(a=4+(e-t)/o),a=Math.min(a*60,360),a<0&&(a+=360);let p=(s+r)/2;return r===s?l=0:p<=.5?l=o/(r+s):l=o/(2-r-s),[a,l*100,p*100]};R.rgb.hsv=function(i){let e,t,n,s,r,o=i[0]/255,a=i[1]/255,l=i[2]/255,p=Math.max(o,a,l),f=p-Math.min(o,a,l),m=function(_){return(p-_)/6/f+1/2};return f===0?(s=0,r=0):(r=f/p,e=m(o),t=m(a),n=m(l),o===p?s=n-t:a===p?s=1/3+e-n:l===p&&(s=2/3+t-e),s<0?s+=1:s>1&&(s-=1)),[s*360,r*100,p*100]};R.rgb.hwb=function(i){let e=i[0],t=i[1],n=i[2],s=R.rgb.hsl(i)[0],r=1/255*Math.min(e,Math.min(t,n));return n=1-1/255*Math.max(e,Math.max(t,n)),[s,r*100,n*100]};R.rgb.cmyk=function(i){let e=i[0]/255,t=i[1]/255,n=i[2]/255,s=Math.min(1-e,1-t,1-n),r=(1-e-s)/(1-s)||0,o=(1-t-s)/(1-s)||0,a=(1-n-s)/(1-s)||0;return[r*100,o*100,a*100,s*100]};function hS(i,e){return(i[0]-e[0])**2+(i[1]-e[1])**2+(i[2]-e[2])**2}R.rgb.keyword=function(i){let e=jh[i];if(e)return e;let t=1/0,n;for(let s of Object.keys(ns)){let r=ns[s],o=hS(i,r);o<t&&(t=o,n=s)}return n};R.keyword.rgb=function(i){return ns[i]};R.rgb.xyz=function(i){let e=i[0]/255,t=i[1]/255,n=i[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let s=e*.4124+t*.3576+n*.1805,r=e*.2126+t*.7152+n*.0722,o=e*.0193+t*.1192+n*.9505;return[s*100,r*100,o*100]};R.rgb.lab=function(i){let e=R.rgb.xyz(i),t=e[0],n=e[1],s=e[2];t/=95.047,n/=100,s/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;let r=116*n-16,o=500*(t-n),a=200*(n-s);return[r,o,a]};R.hsl.rgb=function(i){let e=i[0]/360,t=i[1]/100,n=i[2]/100,s,r,o;if(t===0)return o=n*255,[o,o,o];n<.5?s=n*(1+t):s=n+t-n*t;let a=2*n-s,l=[0,0,0];for(let p=0;p<3;p++)r=e+1/3*-(p-1),r<0&&r++,r>1&&r--,6*r<1?o=a+(s-a)*6*r:2*r<1?o=s:3*r<2?o=a+(s-a)*(2/3-r)*6:o=a,l[p]=o*255;return l};R.hsl.hsv=function(i){let e=i[0],t=i[1]/100,n=i[2]/100,s=t,r=Math.max(n,.01);n*=2,t*=n<=1?n:2-n,s*=r<=1?r:2-r;let o=(n+t)/2,a=n===0?2*s/(r+s):2*t/(n+t);return[e,a*100,o*100]};R.hsv.rgb=function(i){let e=i[0]/60,t=i[1]/100,n=i[2]/100,s=Math.floor(e)%6,r=e-Math.floor(e),o=255*n*(1-t),a=255*n*(1-t*r),l=255*n*(1-t*(1-r));switch(n*=255,s){case 0:return[n,l,o];case 1:return[a,n,o];case 2:return[o,n,l];case 3:return[o,a,n];case 4:return[l,o,n];case 5:return[n,o,a]}};R.hsv.hsl=function(i){let e=i[0],t=i[1]/100,n=i[2]/100,s=Math.max(n,.01),r,o;o=(2-t)*n;let a=(2-t)*s;return r=t*s,r/=a<=1?a:2-a,r=r||0,o/=2,[e,r*100,o*100]};R.hwb.rgb=function(i){let e=i[0]/360,t=i[1]/100,n=i[2]/100,s=t+n,r;s>1&&(t/=s,n/=s);let o=Math.floor(6*e),a=1-n;r=6*e-o,(o&1)!==0&&(r=1-r);let l=t+r*(a-t),p,f,m;switch(o){default:case 6:case 0:p=a,f=l,m=t;break;case 1:p=l,f=a,m=t;break;case 2:p=t,f=a,m=l;break;case 3:p=t,f=l,m=a;break;case 4:p=l,f=t,m=a;break;case 5:p=a,f=t,m=l;break}return[p*255,f*255,m*255]};R.cmyk.rgb=function(i){let e=i[0]/100,t=i[1]/100,n=i[2]/100,s=i[3]/100,r=1-Math.min(1,e*(1-s)+s),o=1-Math.min(1,t*(1-s)+s),a=1-Math.min(1,n*(1-s)+s);return[r*255,o*255,a*255]};R.xyz.rgb=function(i){let e=i[0]/100,t=i[1]/100,n=i[2]/100,s,r,o;return s=e*3.2406+t*-1.5372+n*-.4986,r=e*-.9689+t*1.8758+n*.0415,o=e*.0557+t*-.204+n*1.057,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,r=r>.0031308?1.055*r**(1/2.4)-.055:r*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=Math.min(Math.max(0,s),1),r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),[s*255,r*255,o*255]};R.xyz.lab=function(i){let e=i[0],t=i[1],n=i[2];e/=95.047,t/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let s=116*t-16,r=500*(e-t),o=200*(t-n);return[s,r,o]};R.lab.xyz=function(i){let e=i[0],t=i[1],n=i[2],s,r,o;r=(e+16)/116,s=t/500+r,o=r-n/200;let a=r**3,l=s**3,p=o**3;return r=a>.008856?a:(r-16/116)/7.787,s=l>.008856?l:(s-16/116)/7.787,o=p>.008856?p:(o-16/116)/7.787,s*=95.047,r*=100,o*=108.883,[s,r,o]};R.lab.lch=function(i){let e=i[0],t=i[1],n=i[2],s;s=Math.atan2(n,t)*360/2/Math.PI,s<0&&(s+=360);let o=Math.sqrt(t*t+n*n);return[e,o,s]};R.lch.lab=function(i){let e=i[0],t=i[1],s=i[2]/360*2*Math.PI,r=t*Math.cos(s),o=t*Math.sin(s);return[e,r,o]};R.rgb.ansi16=function(i,e=null){let[t,n,s]=i,r=e===null?R.rgb.hsv(i)[2]:e;if(r=Math.round(r/50),r===0)return 30;let o=30+(Math.round(s/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return r===2&&(o+=60),o};R.hsv.ansi16=function(i){return R.rgb.ansi16(R.hsv.rgb(i),i[2])};R.rgb.ansi256=function(i){let e=i[0],t=i[1],n=i[2];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)};R.ansi16.rgb=function(i){let e=i%10;if(e===0||e===7)return i>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let t=(~~(i>50)+1)*.5,n=(e&1)*t*255,s=(e>>1&1)*t*255,r=(e>>2&1)*t*255;return[n,s,r]};R.ansi256.rgb=function(i){if(i>=232){let r=(i-232)*10+8;return[r,r,r]}i-=16;let e,t=Math.floor(i/36)/5*255,n=Math.floor((e=i%36)/6)/5*255,s=e%6/5*255;return[t,n,s]};R.rgb.hex=function(i){let t=(((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t};R.hex.rgb=function(i){let e=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let t=e[0];e[0].length===3&&(t=t.split("").map(a=>a+a).join(""));let n=parseInt(t,16),s=n>>16&255,r=n>>8&255,o=n&255;return[s,r,o]};R.rgb.hcg=function(i){let e=i[0]/255,t=i[1]/255,n=i[2]/255,s=Math.max(Math.max(e,t),n),r=Math.min(Math.min(e,t),n),o=s-r,a,l;return o<1?a=r/(1-o):a=0,o<=0?l=0:s===e?l=(t-n)/o%6:s===t?l=2+(n-e)/o:l=4+(e-t)/o,l/=6,l%=1,[l*360,o*100,a*100]};R.hsl.hcg=function(i){let e=i[1]/100,t=i[2]/100,n=t<.5?2*e*t:2*e*(1-t),s=0;return n<1&&(s=(t-.5*n)/(1-n)),[i[0],n*100,s*100]};R.hsv.hcg=function(i){let e=i[1]/100,t=i[2]/100,n=e*t,s=0;return n<1&&(s=(t-n)/(1-n)),[i[0],n*100,s*100]};R.hcg.rgb=function(i){let e=i[0]/360,t=i[1]/100,n=i[2]/100;if(t===0)return[n*255,n*255,n*255];let s=[0,0,0],r=e%1*6,o=r%1,a=1-o,l=0;switch(Math.floor(r)){case 0:s[0]=1,s[1]=o,s[2]=0;break;case 1:s[0]=a,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=o;break;case 3:s[0]=0,s[1]=a,s[2]=1;break;case 4:s[0]=o,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=a}return l=(1-t)*n,[(t*s[0]+l)*255,(t*s[1]+l)*255,(t*s[2]+l)*255]};R.hcg.hsv=function(i){let e=i[1]/100,t=i[2]/100,n=e+t*(1-e),s=0;return n>0&&(s=e/n),[i[0],s*100,n*100]};R.hcg.hsl=function(i){let e=i[1]/100,n=i[2]/100*(1-e)+.5*e,s=0;return n>0&&n<.5?s=e/(2*n):n>=.5&&n<1&&(s=e/(2*(1-n))),[i[0],s*100,n*100]};R.hcg.hwb=function(i){let e=i[1]/100,t=i[2]/100,n=e+t*(1-e);return[i[0],(n-e)*100,(1-n)*100]};R.hwb.hcg=function(i){let e=i[1]/100,n=1-i[2]/100,s=n-e,r=0;return s<1&&(r=(n-s)/(1-s)),[i[0],s*100,r*100]};R.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]};R.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]};R.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]};R.gray.hsl=function(i){return[0,0,i[0]]};R.gray.hsv=R.gray.hsl;R.gray.hwb=function(i){return[0,100,i[0]]};R.gray.cmyk=function(i){return[0,0,0,i[0]]};R.gray.lab=function(i){return[i[0],0,0]};R.gray.hex=function(i){let e=Math.round(i[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};R.rgb.gray=function(i){return[(i[0]+i[1]+i[2])/3/255*100]}});var Ih=C((KT,Dh)=>{var Ar=$c();function mS(){let i={},e=Object.keys(Ar);for(let t=e.length,n=0;n<t;n++)i[e[n]]={distance:-1,parent:null};return i}function vS(i){let e=mS(),t=[i];for(e[i].distance=0;t.length;){let n=t.pop(),s=Object.keys(Ar[n]);for(let r=s.length,o=0;o<r;o++){let a=s[o],l=e[a];l.distance===-1&&(l.distance=e[n].distance+1,l.parent=n,t.unshift(a))}}return e}function gS(i,e){return function(t){return e(i(t))}}function xS(i,e){let t=[e[i].parent,i],n=Ar[e[i].parent][i],s=e[i].parent;for(;e[s].parent;)t.unshift(e[s].parent),n=gS(Ar[e[s].parent][s],n),s=e[s].parent;return n.conversion=t,n}Dh.exports=function(i){let e=vS(i),t={},n=Object.keys(e);for(let s=n.length,r=0;r<s;r++){let o=n[r];e[o].parent!==null&&(t[o]=xS(o,e))}return t}});var Lh=C((GT,qh)=>{var Wc=$c(),yS=Ih(),mn={},bS=Object.keys(Wc);function wS(i){let e=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),i(t))};return"conversion"in i&&(e.conversion=i.conversion),e}function _S(i){let e=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let s=i(t);if(typeof s=="object")for(let r=s.length,o=0;o<r;o++)s[o]=Math.round(s[o]);return s};return"conversion"in i&&(e.conversion=i.conversion),e}bS.forEach(i=>{mn[i]={},Object.defineProperty(mn[i],"channels",{value:Wc[i].channels}),Object.defineProperty(mn[i],"labels",{value:Wc[i].labels});let e=yS(i);Object.keys(e).forEach(n=>{let s=e[n];mn[i][n]=_S(s),mn[i][n].raw=wS(s)})});qh.exports=mn});var Wh=C((YT,$h)=>{"use strict";var Fh=(i,e)=>(...t)=>`\x1B[${i(...t)+e}m`,Uh=(i,e)=>(...t)=>{let n=i(...t);return`\x1B[${38+e};5;${n}m`},Hh=(i,e)=>(...t)=>{let n=i(...t);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},Rr=i=>i,zh=(i,e,t)=>[i,e,t],vn=(i,e,t)=>{Object.defineProperty(i,e,{get:()=>{let n=t();return Object.defineProperty(i,e,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},Vc,gn=(i,e,t,n)=>{Vc===void 0&&(Vc=Lh());let s=n?10:0,r={};for(let[o,a]of Object.entries(Vc)){let l=o==="ansi16"?"ansi":o;o===e?r[l]=i(t,s):typeof a=="object"&&(r[l]=i(a[e],s))}return r};function SS(){let i=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,n]of Object.entries(e)){for(let[s,r]of Object.entries(n))e[s]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[s]=e[s],i.set(r[0],r[1]);Object.defineProperty(e,t,{value:n,enumerable:!1})}return Object.defineProperty(e,"codes",{value:i,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",vn(e.color,"ansi",()=>gn(Fh,"ansi16",Rr,!1)),vn(e.color,"ansi256",()=>gn(Uh,"ansi256",Rr,!1)),vn(e.color,"ansi16m",()=>gn(Hh,"rgb",zh,!1)),vn(e.bgColor,"ansi",()=>gn(Fh,"ansi16",Rr,!0)),vn(e.bgColor,"ansi256",()=>gn(Uh,"ansi256",Rr,!0)),vn(e.bgColor,"ansi16m",()=>gn(Hh,"rgb",zh,!0)),e}Object.defineProperty($h,"exports",{enumerable:!0,get:SS})});var Kh=C((JT,Vh)=>{"use strict";var ES=(i,e,t)=>{let n=i.indexOf(e);if(n===-1)return i;let s=e.length,r=0,o="";do o+=i.substr(r,n-r)+e+t,r=n+s,n=i.indexOf(e,r);while(n!==-1);return o+=i.substr(r),o},kS=(i,e,t,n)=>{let s=0,r="";do{let o=i[n-1]==="\r";r+=i.substr(s,(o?n-1:n)-s)+e+(o?`\r
21
21
  `:`
22
22
  `)+t,s=n+1,n=i.indexOf(`
23
- `,s)}while(n!==-1);return r+=i.substr(s),r};Vh.exports={stringReplaceAll:SS,stringEncaseCRLFWithFirstIndex:ES}});var Zh=C((JT,Xh)=>{"use strict";var kS=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Gh=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,CS=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,TS=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,MS=new Map([["n",`
24
- `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Jh(i){let e=i[0]==="u",t=i[1]==="{";return e&&!t&&i.length===5||i[0]==="x"&&i.length===3?String.fromCharCode(parseInt(i.slice(1),16)):e&&t?String.fromCodePoint(parseInt(i.slice(2,-1),16)):MS.get(i)||i}function OS(i,e){let t=[],n=e.trim().split(/\s*,\s*/g),s;for(let r of n){let o=Number(r);if(!Number.isNaN(o))t.push(o);else if(s=r.match(CS))t.push(s[2].replace(TS,(a,l,p)=>l?Jh(l):p));else throw new Error(`Invalid Chalk template style argument: ${r} (in style '${i}')`)}return t}function AS(i){Gh.lastIndex=0;let e=[],t;for(;(t=Gh.exec(i))!==null;){let n=t[1];if(t[2]){let s=OS(n,t[2]);e.push([n].concat(s))}else e.push([n])}return e}function Yh(i,e){let t={};for(let s of e)for(let r of s.styles)t[r[0]]=s.inverse?null:r.slice(1);let n=i;for(let[s,r]of Object.entries(t))if(Array.isArray(r)){if(!(s in n))throw new Error(`Unknown Chalk style: ${s}`);n=r.length>0?n[s](...r):n[s]}return n}Xh.exports=(i,e)=>{let t=[],n=[],s=[];if(e.replace(kS,(r,o,a,l,p,f)=>{if(o)s.push(Jh(o));else if(l){let m=s.join("");s=[],n.push(t.length===0?m:Yh(i,t)(m)),t.push({inverse:a,styles:AS(l)})}else if(p){if(t.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(Yh(i,t)(s.join(""))),s=[],t.pop()}else s.push(f)}),n.push(s.join("")),t.length>0){let r=`Chalk template literal is missing ${t.length} closing bracket${t.length===1?"":"s"} (\`}\`)`;throw new Error(r)}return n.join("")}});var Zc=C((XT,sm)=>{"use strict";var ss=Wh(),{stdout:Gc,stderr:Yc}=ga(),{stringReplaceAll:RS,stringEncaseCRLFWithFirstIndex:PS}=Kh(),{isArray:Pr}=Array,em=["ansi","ansi","ansi256","ansi16m"],xn=Object.create(null),BS=(i,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=Gc?Gc.level:0;i.level=e.level===void 0?t:e.level},Jc=class{constructor(e){return tm(e)}},tm=i=>{let e={};return BS(e,i),e.template=(...t)=>nm(e.template,...t),Object.setPrototypeOf(e,Br.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=Jc,e.template};function Br(i){return tm(i)}for(let[i,e]of Object.entries(ss))xn[i]={get(){let t=jr(this,Xc(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,i,{value:t}),t}};xn.visible={get(){let i=jr(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:i}),i}};var im=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let i of im)xn[i]={get(){let{level:e}=this;return function(...t){let n=Xc(ss.color[em[e]][i](...t),ss.color.close,this._styler);return jr(this,n,this._isEmpty)}}};for(let i of im){let e="bg"+i[0].toUpperCase()+i.slice(1);xn[e]={get(){let{level:t}=this;return function(...n){let s=Xc(ss.bgColor[em[t]][i](...n),ss.bgColor.close,this._styler);return jr(this,s,this._isEmpty)}}}}var jS=Object.defineProperties(()=>{},{...xn,level:{enumerable:!0,get(){return this._generator.level},set(i){this._generator.level=i}}}),Xc=(i,e,t)=>{let n,s;return t===void 0?(n=i,s=e):(n=t.openAll+i,s=e+t.closeAll),{open:i,close:e,openAll:n,closeAll:s,parent:t}},jr=(i,e,t)=>{let n=(...s)=>Pr(s[0])&&Pr(s[0].raw)?Qh(n,nm(n,...s)):Qh(n,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(n,jS),n._generator=i,n._styler=e,n._isEmpty=t,n},Qh=(i,e)=>{if(i.level<=0||!e)return i._isEmpty?"":e;let t=i._styler;if(t===void 0)return e;let{openAll:n,closeAll:s}=t;if(e.indexOf("\x1B")!==-1)for(;t!==void 0;)e=RS(e,t.close,t.open),t=t.parent;let r=e.indexOf(`
25
- `);return r!==-1&&(e=PS(e,s,n,r)),n+e+s},Kc,nm=(i,...e)=>{let[t]=e;if(!Pr(t)||!Pr(t.raw))return e.join(" ");let n=e.slice(1),s=[t.raw[0]];for(let r=1;r<t.length;r++)s.push(String(n[r-1]).replace(/[{}\\]/g,"\\$&"),String(t.raw[r]));return Kc===void 0&&(Kc=Zh()),Kc(i,s.join(""))};Object.defineProperties(Br.prototype,xn);var Nr=Br();Nr.supportsColor=Gc;Nr.stderr=Br({level:Yc?Yc.level:0});Nr.stderr.supportsColor=Yc;sm.exports=Nr});var Fe,Pi=yi(()=>{Fe={webrtc:{enableWebRTC:!1,enableTurn:!0,turnApiUrl:"https://9remote.cc/api/webrtc/turn-credentials",turnRefreshInterval:828e5,dcMaxMessageSize:65536,answerTimeout:1e4},robotSettings:{mouseDelay:2,keyboardDelay:2},throttling:{mouseThrottle:8,keyThrottle:25,typeTextThrottle:100,maxTextLength:1e3},resourceManagement:{inactiveTimeout:12e4,memoryCheckInterval:6e4,memoryWarningThreshold:1e3,maxTimersPerClient:100,maxChunkTimersPerClient:50},streaming:{activeInterval:80,idleInterval:400,idleThreshold:3,actionCaptureDelay:50,chunkSize:32,chunkDelay:5}}});var am={};bi(am,{TileManager:()=>Qc});var qr,yn,Lr,om,HS,zS,Qc,cm=yi(()=>{qr=L(require("sharp"),1),yn=L(require("fs"),1),Lr=L(require("path"),1),om=require("url"),HS=(0,om.fileURLToPath)(__importMetaUrl),zS=Lr.default.dirname(HS),Qc=class{constructor(e){this.robot=e,this.tileSize=100,this.lastTileChecksums=new Map,this.screenWidth=0,this.screenHeight=0,this.tilesPerRow=0,this.tilesPerColumn=0,this.totalTiles=0,this.frameCount=0,this.tempDir=Lr.default.join(zS,"../../temp"),this.compressionQuality=1,this.changeThreshold=1,this.scaleFactor=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.compressionQuality=85,yn.default.existsSync(this.tempDir)||yn.default.mkdirSync(this.tempDir,{recursive:!0}),this.initializeScreenDimensions()}initializeScreenDimensions(){try{let{width:e,height:t}=this.robot.getScreenSize();this.screenWidth=e,this.screenHeight=t,this.detectDpiScale(),this.scaledWidth=Math.floor(e*this.scaleFactor),this.scaledHeight=Math.floor(t*this.scaleFactor),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}console.log(`\u{1F5A5}\uFE0F TileManager: ${e}x${t} (DPI ${this.dpiScale}x) -> ${this.totalTiles} tiles`)}catch(e){console.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,1,1);this.dpiScale=e.byteWidth/e.bytesPerPixel}else this.dpiScale=1;this.captureWidth=Math.floor(this.screenWidth*this.dpiScale),this.captureHeight=Math.floor(this.screenHeight*this.dpiScale)}async captureFullScreen(){let e=this.robot.screen.capture(0,0,this.captureWidth,this.captureHeight),t=Buffer.from(e.image),n=new Uint32Array(t.buffer,t.byteOffset,t.length>>2);for(let p=0;p<n.length;p++){let f=n[p];n[p]=f&4278255360|(f&16711680)>>16|(f&255)<<16}let s=e.byteWidth/e.bytesPerPixel,r=e.height,o=t,a=s,l=r;if(this.dpiScale>1||this.scaleFactor<1){let p=Math.floor(this.screenWidth*this.scaleFactor),f=Math.floor(this.screenHeight*this.scaleFactor);o=await(0,qr.default)(t,{raw:{width:s,height:r,channels:e.bytesPerPixel}}).resize(p,f,{kernel:qr.default.kernel.nearest,fit:"fill"}).raw().toBuffer(),a=p,l=f}return{buffer:o,width:a,height:l,channels:e.bytesPerPixel}}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)}clearScreenCache(){}async detectChangedTiles(){return(await this.detectChangedTilesWithHashes()).tiles}async detectChangedTilesWithHashes(){if(this.isProcessing)return{tiles:[],currentHashes:Array.from(this.lastTileChecksums.values())};this.isProcessing=!0;try{let e=await this.getSharedScreenCapture(),t=[],n=[],s=new Map;this.frameCount++;for(let a=0;a<this.totalTiles;a++){let l=this.calculateTileChecksumDirect(e,a);s.set(a,l)}let r=Array.from(s.values());if(this.lastTileChecksums.size===0){let a=[];for(let p=0;p<this.totalTiles;p++)this.lastTileChecksums.set(p,s.get(p)),a.push(this.processTileAsync(e,p));let l=await Promise.all(a);return t.push(...l),{tiles:t,currentHashes:r}}for(let a=0;a<this.totalTiles;a++){let l=s.get(a),p=this.lastTileChecksums.get(a);l!==p&&(n.push(a),this.lastTileChecksums.set(a,l))}if(n.length/this.totalTiles>this.changeThreshold){let a=[];for(let p=0;p<this.totalTiles;p++)a.push(this.processTileAsync(e,p));let l=await Promise.all(a);t.push(...l.map(p=>({...p,fullRefresh:!0})))}else if(n.length>0){let a=n.map(p=>this.processTileAsync(e,p)),l=await Promise.all(a);t.push(...l)}return{tiles:t,currentHashes:r}}finally{this.isProcessing=!1}}async processTileAsync(e,t,n=null){let s=n||this.extractTile(e,t),r=await this.compressTileImage(s.buffer,s.width,s.height),{row:o,col:a}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:a*this.tileSize,y:o*this.tileSize,width:s.width,height:s.height,imageBuffer:r,timestamp:Date.now(),frameCount:this.frameCount}}calculateTileChecksumDirect(e,t){let{row:n,col:s}=this.getTilePosition(t),r=s*this.tileSize,o=n*this.tileSize,a=Math.min(r+this.tileSize,e.width),l=Math.min(o+this.tileSize,e.height),p=a-r,f=l-o,m=e.channels,_=e.width*m,E=0,k=16;for(let T=0;T<f;T+=4){let O=(o+T)*_+r*m;for(let M=0;M<p;M+=k){let A=O+M*m;E+=e.buffer[A]||0,E^=e.buffer[A+1]||0,E+=(e.buffer[A+2]||0)<<1,E^=(e.buffer[A+3]||0)<<2}}return E>>>0}getTilePosition(e){return{row:Math.floor(e/this.tilesPerRow),col:e%this.tilesPerRow}}extractTile(e,t){let{row:n,col:s}=this.getTilePosition(t),r=s*this.tileSize,o=n*this.tileSize,a=Math.min(r+this.tileSize,e.width),l=Math.min(o+this.tileSize,e.height),p=a-r,f=l-o,m=e.channels,_=p*m,E=Buffer.alloc(p*f*m);for(let k=0;k<f;k++){let T=((o+k)*e.width+r)*m,O=k*_;e.buffer.copy(E,O,T,T+_)}return{buffer:E,width:p,height:f,channels:m,tileIndex:t,x:r,y:o}}async compressTileImage(e,t,n){return(0,qr.default)(e,{raw:{width:t,height:n,channels:4}}).jpeg({quality:this.compressionQuality}).toBuffer()}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){console.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 r=new Map;for(let a=0;a<this.totalTiles;a++){let l=this.calculateTileChecksumDirect(t,a);r.set(a,l),this.lastTileChecksums.set(a,l)}if(!e||e.length===0){let a=[];for(let p=0;p<this.totalTiles;p++)a.push(this.processTileAsync(t,p));let l=await Promise.all(a);return n.push(...l),{tiles:n,currentHashes:Array.from(r.values())}}for(let a=0;a<this.totalTiles;a++)e[a]!==r.get(a)&&s.push(a);if(s.length/this.totalTiles>this.changeThreshold){let a=[];for(let p=0;p<this.totalTiles;p++)a.push(this.processTileAsync(t,p));let l=await Promise.all(a);n.push(...l.map(p=>({...p,fullRefresh:!0})))}else if(s.length>0){let a=s.map(p=>this.processTileAsync(t,p)),l=await Promise.all(a);n.push(...l)}return{tiles:n,currentHashes:Array.from(r.values()),changedIndices:s}}finally{this.isProcessing=!1}}clearMemory(){this.sharedScreenCache=null,this.lastCaptureTime=0,this.lastTileChecksums.clear()}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{yn.default.existsSync(this.tempDir)&&yn.default.readdirSync(this.tempDir).forEach(t=>yn.default.unlinkSync(Lr.default.join(this.tempDir,t)))}catch(e){console.warn("Cleanup error:",e)}}}});var lm={};bi(lm,{ResourceManager:()=>el});var el,um=yi(()=>{Pi();el=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>Fe.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},Fe.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=Fe.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(r=>clearTimeout(r)),this.activeTimers.delete(e));let s=this.chunkTimers.get(e);s&&(s.forEach(r=>clearTimeout(r)),this.chunkTimers.delete(e)),t?.tileManager&&(t.tileManager.clearMemory(),t.tileManager.cleanup(),t.tileManager.reset())}catch(n){console.error(`Error cleaning up ${e}:`,n.message)}}getStreamingConfig(){return Fe.streaming}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 pm={};bi(pm,{ScreenUpdateHelper:()=>tl});var tl,dm=yi(()=>{Pi();tl=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,n,s=!1){if(!t||t.length===0)return;let r=Fe.streaming.chunkSize,o=[];for(let l=0;l<t.length;l+=r)o.push(t.slice(l,l+r));let a=this.resourceManager.getChunkTimers(e.id);for(let l=0;l<o.length;l++){let p=o[l],f=l===o.length-1,m=setTimeout(()=>{a.delete(m),e.connected&&e.emit("tiles-data",{tiles:p,timestamp:n,forceRefresh:!1,userAction:s,chunkInfo:{chunkIndex:l,totalChunks:o.length,isLastChunk:f}})},l*Fe.streaming.chunkDelay);a.add(m)}}}});var fm={};bi(fm,{MouseHandler:()=>il});var il,hm=yi(()=>{Pi();il=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 r=Date.now();if(!(r-this.lastMouseMove<Fe.throttling.mouseThrottle)){this.lastMouseMove=r;try{let o=n.getScreenSize(),a=Math.round(s.x/100*o.width),l=Math.round(s.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),f=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,f),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Mouse move error:",o.message)}}})),e.on("mouse-click",t(async s=>{try{let r=this.resourceManager.getClient(e.id);if(!r)return;let o=n.getScreenSize(),a=Math.round(s.x/100*o.width),l=Math.round(s.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),f=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,f),n.mouseClick(s.button||"left",s.double||!1),r.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Mouse click error:",r.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),l=Math.round(s.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),f=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,f),n.mouseToggle("down",s.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Mouse press error:",r.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),l=Math.round(s.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),f=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,f),n.mouseToggle("up",s.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Mouse release error:",r.message)}})),e.on("scroll",t(async s=>{try{let{direction:r,amount:o=60,horizontal:a=!1}=s,l=this.resourceManager.getClient(e.id);if(!l)return;let p=0,f=0;a||r==="left"||r==="right"?p=r==="right"?o:-o:f=r==="down"?-o:o,n.scrollMouse(p,f),l.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Scroll error:",r.message)}})),e.on("mouse-drag-select",t(s=>{try{let{startX:r,startY:o,endX:a,endY:l}=s,p=n.getScreenSize(),f=Math.round(r/100*p.width),m=Math.round(o/100*p.height),_=Math.round(a/100*p.width),E=Math.round(l/100*p.height),k=Math.max(0,Math.min(p.width-1,f)),T=Math.max(0,Math.min(p.height-1,m)),O=Math.max(0,Math.min(p.width-1,_)),M=Math.max(0,Math.min(p.height-1,E));n.moveMouse(k,T),n.mouseToggle("down","left"),n.dragMouse(O,M),n.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Drag selection error:",r.message)}}))}}});var mm={};bi(mm,{KeyboardHandler:()=>nl});var nl,vm=yi(()=>{Pi();nl=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 r=Date.now();if(!(r-this.lastKeyPress<Fe.throttling.keyThrottle)){this.lastKeyPress=r;try{if(!s.key||typeof s.key!="string")return;let o=this.resourceManager.getClient(e.id),a=s.key;if(a.length===1){n.keyTap(a,s.modifier||[]);for(let l of s.modifier||[])n.keyToggle(l,"up")}else switch(a.toLowerCase()){case"enter":case"return":n.keyTap("enter");break;case"space":n.keyTap(" ");break;case"backspace":n.keyTap("backspace");break;case"tab":n.keyTap("tab");break;case"escape":n.keyTap("escape");break;default:n.keyTap(a,s.modifier||[])}o&&(o.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Key press error:",o.message)}}})),e.on("type-text",t(s=>{let r=Date.now();if(!(r-this.lastTypeText<Fe.throttling.typeTextThrottle)){this.lastTypeText=r;try{if(!s.text||typeof s.text!="string")return;let o=s.text;o.length>Fe.throttling.maxTextLength&&(o=o.substring(0,Fe.throttling.maxTextLength));let a=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),l=this.resourceManager.getClient(e.id);setTimeout(()=>{try{n.typeString(a),this.resourceManager.updateClientActivity(e.id),l&&(l.idleFrameCount=0,l.tileManager&&l.tileManager.clearScreenCache())}catch(p){console.error("Robot typeString error:",p.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var gm={};bi(gm,{ScreenHandler:()=>sl});function $S(i){let e=Buffer.alloc(20);return e.writeUInt32LE(i.tileIndex,0),e.writeUInt32LE(i.x,4),e.writeUInt32LE(i.y,8),e.writeUInt32LE(i.width,12),e.writeUInt32LE(i.height,16),Buffer.concat([e,i.imageBuffer])}var sl,xm=yi(()=>{sl=class{constructor(e,t,n=null){this.resourceManager=e,this.screenUpdateHelper=t,this.webrtcManager=n}_sendTiles(e,t){if(this.webrtcManager?.isReady(e.id)&&t.tiles?.length>0){let n=!0;for(let s of t.tiles){let r=$S(s);if(!this.webrtcManager.sendTile(e.id,r)){n=!1;break}}if(n)return}e.emit("tiles-data",t)}setupScreenHandlers(e,t){e.on("request-screen",t(async()=>{let n=this.resourceManager.getClient(e.id);if(n)try{let s=await n.tileManager.detectChangedTiles();s.length>0&&this._sendTiles(e,{tiles:s,timestamp:Date.now()}),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Tile capture error:",s),e.emit("screen-error",{error:s.message})}})),e.on("request-screen-with-hashes",t(async n=>{let s=this.resourceManager.getClient(e.id);if(s)try{let r=n.tileHashes||[],o=await s.tileManager.compareClientTileHashes(r);o?.tiles?.length>0?this._sendTiles(e,{tiles:o.tiles,timestamp:Date.now(),currentHashes:o.currentHashes,changedIndices:o.changedIndices}):e.emit("tiles-data",{tiles:[],timestamp:Date.now(),currentHashes:o.currentHashes,changedIndices:[]}),this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Tile capture with hashes error:",r),e.emit("screen-error",{error:r.message})}})),e.on("start-streaming",t(()=>{let n=this.resourceManager.getClient(e.id);if(!n)return;n.streamingTimeout&&(clearTimeout(n.streamingTimeout),n.streamingTimeout=null),console.log("\u{1F680} Remote streaming started"),n.idleFrameCount=0,n.isStreaming=!0;let s=async()=>{if(!e.connected||!n.isStreaming){n.streamingTimeout=null;return}try{let r=performance.now(),o=await n.tileManager.detectChangedTilesWithHashes();o.tiles.length>0&&e.connected?(this._sendTiles(e,{tiles:o.tiles,timestamp:Date.now(),currentHashes:o.currentHashes}),n.idleFrameCount=0):n.idleFrameCount++;let{activeInterval:l,idleInterval:p,idleThreshold:f}=this.resourceManager.getStreamingConfig(),m=n.idleFrameCount>=f?p:l,_=Math.max(0,m-(performance.now()-r));n.streamingTimeout=setTimeout(s,_)}catch(r){console.error("Auto streaming error:",r),n.streamingTimeout=setTimeout(s,200)}};s()})),e.on("stop-streaming",()=>{let n=this.resourceManager.getClient(e.id);n&&(n.isStreaming=!1,n.streamingTimeout&&(clearTimeout(n.streamingTimeout),n.streamingTimeout=null),console.log("\u23F9\uFE0F Remote streaming stopped"))}),e.on("get-screen-dimensions",t(async()=>{let n=this.resourceManager.getClient(e.id);if(n)try{let s=await n.tileManager.getScreenDimensions();e.emit("screen-dimensions",s)}catch(s){console.error("Get dimensions error:",s),e.emit("screen-error",{error:s.message})}})),e.on("boost-stream",t(()=>{let n=this.resourceManager.getClient(e.id);n&&(n.idleFrameCount=0)}))}}});var ul=C((Lm,ll)=>{(function(i,e){"use strict";function t(b,c){if(!b)throw new Error(c||"Assertion failed")}function n(b,c){b.super_=c;var d=function(){};d.prototype=c.prototype,b.prototype=new d,b.prototype.constructor=b}function s(b,c,d){if(s.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((c==="le"||c==="be")&&(d=c,c=10),this._init(b||0,c||10,d||"be"))}typeof i=="object"?i.exports=s:e.BN=s,s.BN=s,s.wordSize=26;var r;try{typeof window<"u"&&typeof window.Buffer<"u"?r=window.Buffer:r=require("buffer").Buffer}catch{}s.isBN=function(c){return c instanceof s?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===s.wordSize&&Array.isArray(c.words)},s.max=function(c,d){return c.cmp(d)>0?c:d},s.min=function(c,d){return c.cmp(d)<0?c:d},s.prototype._init=function(c,d,h){if(typeof c=="number")return this._initNumber(c,d,h);if(typeof c=="object")return this._initArray(c,d,h);d==="hex"&&(d=16),t(d===(d|0)&&d>=2&&d<=36),c=c.toString().replace(/\s+/g,"");var v=0;c[0]==="-"&&(v++,this.negative=1),v<c.length&&(d===16?this._parseHex(c,v,h):(this._parseBase(c,d,v),h==="le"&&this._initArray(this.toArray(),d,h)))},s.prototype._initNumber=function(c,d,h){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(t(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),d,h)},s.prototype._initArray=function(c,d,h){if(t(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var y,w,S=0;if(h==="be")for(v=c.length-1,y=0;v>=0;v-=3)w=c[v]|c[v-1]<<8|c[v-2]<<16,this.words[y]|=w<<S&67108863,this.words[y+1]=w>>>26-S&67108863,S+=24,S>=26&&(S-=26,y++);else if(h==="le")for(v=0,y=0;v<c.length;v+=3)w=c[v]|c[v+1]<<8|c[v+2]<<16,this.words[y]|=w<<S&67108863,this.words[y+1]=w>>>26-S&67108863,S+=24,S>=26&&(S-=26,y++);return this.strip()};function o(b,c){var d=b.charCodeAt(c);return d>=65&&d<=70?d-55:d>=97&&d<=102?d-87:d-48&15}function a(b,c,d){var h=o(b,d);return d-1>=c&&(h|=o(b,d-1)<<4),h}s.prototype._parseHex=function(c,d,h){this.length=Math.ceil((c.length-d)/6),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var y=0,w=0,S;if(h==="be")for(v=c.length-1;v>=d;v-=2)S=a(c,d,v)<<y,this.words[w]|=S&67108863,y>=18?(y-=18,w+=1,this.words[w]|=S>>>26):y+=8;else{var g=c.length-d;for(v=g%2===0?d+1:d;v<c.length;v+=2)S=a(c,d,v)<<y,this.words[w]|=S&67108863,y>=18?(y-=18,w+=1,this.words[w]|=S>>>26):y+=8}this.strip()};function l(b,c,d,h){for(var v=0,y=Math.min(b.length,d),w=c;w<y;w++){var S=b.charCodeAt(w)-48;v*=h,S>=49?v+=S-49+10:S>=17?v+=S-17+10:v+=S}return v}s.prototype._parseBase=function(c,d,h){this.words=[0],this.length=1;for(var v=0,y=1;y<=67108863;y*=d)v++;v--,y=y/d|0;for(var w=c.length-h,S=w%v,g=Math.min(w,w-S)+h,u=0,x=h;x<g;x+=v)u=l(c,x,x+v,d),this.imuln(y),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(S!==0){var P=1;for(u=l(c,x,c.length,d),x=0;x<S;x++)P*=d;this.imuln(P),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},s.prototype.copy=function(c){c.words=new Array(this.length);for(var d=0;d<this.length;d++)c.words[d]=this.words[d];c.length=this.length,c.negative=this.negative,c.red=this.red},s.prototype.clone=function(){var c=new s(null);return this.copy(c),c},s.prototype._expand=function(c){for(;this.length<c;)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 p=["","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"],f=[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],m=[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(c,d){c=c||10,d=d|0||1;var h;if(c===16||c==="hex"){h="";for(var v=0,y=0,w=0;w<this.length;w++){var S=this.words[w],g=((S<<v|y)&16777215).toString(16);y=S>>>24-v&16777215,v+=2,v>=26&&(v-=26,w--),y!==0||w!==this.length-1?h=p[6-g.length]+g+h:h=g+h}for(y!==0&&(h=y.toString(16)+h);h.length%d!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(c===(c|0)&&c>=2&&c<=36){var u=f[c],x=m[c];h="";var P=this.clone();for(P.negative=0;!P.isZero();){var B=P.modn(x).toString(c);P=P.idivn(x),P.isZero()?h=B+h:h=p[u-B.length]+B+h}for(this.isZero()&&(h="0"+h);h.length%d!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}t(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(c,d){return t(typeof r<"u"),this.toArrayLike(r,c,d)},s.prototype.toArray=function(c,d){return this.toArrayLike(Array,c,d)},s.prototype.toArrayLike=function(c,d,h){var v=this.byteLength(),y=h||Math.max(1,v);t(v<=y,"byte array longer than desired length"),t(y>0,"Requested array length <= 0"),this.strip();var w=d==="le",S=new c(y),g,u,x=this.clone();if(w){for(u=0;!x.isZero();u++)g=x.andln(255),x.iushrn(8),S[u]=g;for(;u<y;u++)S[u]=0}else{for(u=0;u<y-v;u++)S[u]=0;for(u=0;!x.isZero();u++)g=x.andln(255),x.iushrn(8),S[y-u-1]=g}return S},Math.clz32?s.prototype._countBits=function(c){return 32-Math.clz32(c)}:s.prototype._countBits=function(c){var d=c,h=0;return d>=4096&&(h+=13,d>>>=13),d>=64&&(h+=7,d>>>=7),d>=8&&(h+=4,d>>>=4),d>=2&&(h+=2,d>>>=2),h+d},s.prototype._zeroBits=function(c){if(c===0)return 26;var d=c,h=0;return(d&8191)===0&&(h+=13,d>>>=13),(d&127)===0&&(h+=7,d>>>=7),(d&15)===0&&(h+=4,d>>>=4),(d&3)===0&&(h+=2,d>>>=2),(d&1)===0&&h++,h},s.prototype.bitLength=function(){var c=this.words[this.length-1],d=this._countBits(c);return(this.length-1)*26+d};function _(b){for(var c=new Array(b.bitLength()),d=0;d<c.length;d++){var h=d/26|0,v=d%26;c[d]=(b.words[h]&1<<v)>>>v}return c}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var c=0,d=0;d<this.length;d++){var h=this._zeroBits(this.words[d]);if(c+=h,h!==26)break}return c},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},s.prototype.fromTwos=function(c){return this.testn(c-1)?this.notn(c).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(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var d=0;d<c.length;d++)this.words[d]=this.words[d]|c.words[d];return this.strip()},s.prototype.ior=function(c){return t((this.negative|c.negative)===0),this.iuor(c)},s.prototype.or=function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},s.prototype.uor=function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},s.prototype.iuand=function(c){var d;this.length>c.length?d=c:d=this;for(var h=0;h<d.length;h++)this.words[h]=this.words[h]&c.words[h];return this.length=d.length,this.strip()},s.prototype.iand=function(c){return t((this.negative|c.negative)===0),this.iuand(c)},s.prototype.and=function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},s.prototype.uand=function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},s.prototype.iuxor=function(c){var d,h;this.length>c.length?(d=this,h=c):(d=c,h=this);for(var v=0;v<h.length;v++)this.words[v]=d.words[v]^h.words[v];if(this!==d)for(;v<d.length;v++)this.words[v]=d.words[v];return this.length=d.length,this.strip()},s.prototype.ixor=function(c){return t((this.negative|c.negative)===0),this.iuxor(c)},s.prototype.xor=function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},s.prototype.uxor=function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},s.prototype.inotn=function(c){t(typeof c=="number"&&c>=0);var d=Math.ceil(c/26)|0,h=c%26;this._expand(d),h>0&&d--;for(var v=0;v<d;v++)this.words[v]=~this.words[v]&67108863;return h>0&&(this.words[v]=~this.words[v]&67108863>>26-h),this.strip()},s.prototype.notn=function(c){return this.clone().inotn(c)},s.prototype.setn=function(c,d){t(typeof c=="number"&&c>=0);var h=c/26|0,v=c%26;return this._expand(h+1),d?this.words[h]=this.words[h]|1<<v:this.words[h]=this.words[h]&~(1<<v),this.strip()},s.prototype.iadd=function(c){var d;if(this.negative!==0&&c.negative===0)return this.negative=0,d=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,d=this.isub(c),c.negative=1,d._normSign();var h,v;this.length>c.length?(h=this,v=c):(h=c,v=this);for(var y=0,w=0;w<v.length;w++)d=(h.words[w]|0)+(v.words[w]|0)+y,this.words[w]=d&67108863,y=d>>>26;for(;y!==0&&w<h.length;w++)d=(h.words[w]|0)+y,this.words[w]=d&67108863,y=d>>>26;if(this.length=h.length,y!==0)this.words[this.length]=y,this.length++;else if(h!==this)for(;w<h.length;w++)this.words[w]=h.words[w];return this},s.prototype.add=function(c){var d;return c.negative!==0&&this.negative===0?(c.negative=0,d=this.sub(c),c.negative^=1,d):c.negative===0&&this.negative!==0?(this.negative=0,d=c.sub(this),this.negative=1,d):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},s.prototype.isub=function(c){if(c.negative!==0){c.negative=0;var d=this.iadd(c);return c.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var h=this.cmp(c);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var v,y;h>0?(v=this,y=c):(v=c,y=this);for(var w=0,S=0;S<y.length;S++)d=(v.words[S]|0)-(y.words[S]|0)+w,w=d>>26,this.words[S]=d&67108863;for(;w!==0&&S<v.length;S++)d=(v.words[S]|0)+w,w=d>>26,this.words[S]=d&67108863;if(w===0&&S<v.length&&v!==this)for(;S<v.length;S++)this.words[S]=v.words[S];return this.length=Math.max(this.length,S),v!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(c){return this.clone().isub(c)};function E(b,c,d){d.negative=c.negative^b.negative;var h=b.length+c.length|0;d.length=h,h=h-1|0;var v=b.words[0]|0,y=c.words[0]|0,w=v*y,S=w&67108863,g=w/67108864|0;d.words[0]=S;for(var u=1;u<h;u++){for(var x=g>>>26,P=g&67108863,B=Math.min(u,c.length-1),j=Math.max(0,u-b.length+1);j<=B;j++){var D=u-j|0;v=b.words[D]|0,y=c.words[j]|0,w=v*y+P,x+=w/67108864|0,P=w&67108863}d.words[u]=P|0,g=x|0}return g!==0?d.words[u]=g|0:d.length--,d.strip()}var k=function(c,d,h){var v=c.words,y=d.words,w=h.words,S=0,g,u,x,P=v[0]|0,B=P&8191,j=P>>>13,D=v[1]|0,z=D&8191,G=D>>>13,si=v[2]|0,Y=si&8191,Z=si>>>13,xu=v[3]|0,oe=xu&8191,ae=xu>>>13,yu=v[4]|0,ce=yu&8191,le=yu>>>13,bu=v[5]|0,ue=bu&8191,pe=bu>>>13,wu=v[6]|0,de=wu&8191,fe=wu>>>13,_u=v[7]|0,he=_u&8191,me=_u>>>13,Su=v[8]|0,ve=Su&8191,ge=Su>>>13,Eu=v[9]|0,xe=Eu&8191,ye=Eu>>>13,ku=y[0]|0,be=ku&8191,we=ku>>>13,Cu=y[1]|0,_e=Cu&8191,Se=Cu>>>13,Tu=y[2]|0,Ee=Tu&8191,ke=Tu>>>13,Mu=y[3]|0,Ce=Mu&8191,Te=Mu>>>13,Ou=y[4]|0,Me=Ou&8191,Oe=Ou>>>13,Au=y[5]|0,Ae=Au&8191,Re=Au>>>13,Ru=y[6]|0,Pe=Ru&8191,Be=Ru>>>13,Pu=y[7]|0,je=Pu&8191,Ne=Pu>>>13,Bu=y[8]|0,Ie=Bu&8191,De=Bu>>>13,ju=y[9]|0,qe=ju&8191,Le=ju>>>13;h.negative=c.negative^d.negative,h.length=19,g=Math.imul(B,be),u=Math.imul(B,we),u=u+Math.imul(j,be)|0,x=Math.imul(j,we);var jo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(jo>>>26)|0,jo&=67108863,g=Math.imul(z,be),u=Math.imul(z,we),u=u+Math.imul(G,be)|0,x=Math.imul(G,we),g=g+Math.imul(B,_e)|0,u=u+Math.imul(B,Se)|0,u=u+Math.imul(j,_e)|0,x=x+Math.imul(j,Se)|0;var No=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(No>>>26)|0,No&=67108863,g=Math.imul(Y,be),u=Math.imul(Y,we),u=u+Math.imul(Z,be)|0,x=Math.imul(Z,we),g=g+Math.imul(z,_e)|0,u=u+Math.imul(z,Se)|0,u=u+Math.imul(G,_e)|0,x=x+Math.imul(G,Se)|0,g=g+Math.imul(B,Ee)|0,u=u+Math.imul(B,ke)|0,u=u+Math.imul(j,Ee)|0,x=x+Math.imul(j,ke)|0;var Io=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Io>>>26)|0,Io&=67108863,g=Math.imul(oe,be),u=Math.imul(oe,we),u=u+Math.imul(ae,be)|0,x=Math.imul(ae,we),g=g+Math.imul(Y,_e)|0,u=u+Math.imul(Y,Se)|0,u=u+Math.imul(Z,_e)|0,x=x+Math.imul(Z,Se)|0,g=g+Math.imul(z,Ee)|0,u=u+Math.imul(z,ke)|0,u=u+Math.imul(G,Ee)|0,x=x+Math.imul(G,ke)|0,g=g+Math.imul(B,Ce)|0,u=u+Math.imul(B,Te)|0,u=u+Math.imul(j,Ce)|0,x=x+Math.imul(j,Te)|0;var Do=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Do>>>26)|0,Do&=67108863,g=Math.imul(ce,be),u=Math.imul(ce,we),u=u+Math.imul(le,be)|0,x=Math.imul(le,we),g=g+Math.imul(oe,_e)|0,u=u+Math.imul(oe,Se)|0,u=u+Math.imul(ae,_e)|0,x=x+Math.imul(ae,Se)|0,g=g+Math.imul(Y,Ee)|0,u=u+Math.imul(Y,ke)|0,u=u+Math.imul(Z,Ee)|0,x=x+Math.imul(Z,ke)|0,g=g+Math.imul(z,Ce)|0,u=u+Math.imul(z,Te)|0,u=u+Math.imul(G,Ce)|0,x=x+Math.imul(G,Te)|0,g=g+Math.imul(B,Me)|0,u=u+Math.imul(B,Oe)|0,u=u+Math.imul(j,Me)|0,x=x+Math.imul(j,Oe)|0;var qo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(qo>>>26)|0,qo&=67108863,g=Math.imul(ue,be),u=Math.imul(ue,we),u=u+Math.imul(pe,be)|0,x=Math.imul(pe,we),g=g+Math.imul(ce,_e)|0,u=u+Math.imul(ce,Se)|0,u=u+Math.imul(le,_e)|0,x=x+Math.imul(le,Se)|0,g=g+Math.imul(oe,Ee)|0,u=u+Math.imul(oe,ke)|0,u=u+Math.imul(ae,Ee)|0,x=x+Math.imul(ae,ke)|0,g=g+Math.imul(Y,Ce)|0,u=u+Math.imul(Y,Te)|0,u=u+Math.imul(Z,Ce)|0,x=x+Math.imul(Z,Te)|0,g=g+Math.imul(z,Me)|0,u=u+Math.imul(z,Oe)|0,u=u+Math.imul(G,Me)|0,x=x+Math.imul(G,Oe)|0,g=g+Math.imul(B,Ae)|0,u=u+Math.imul(B,Re)|0,u=u+Math.imul(j,Ae)|0,x=x+Math.imul(j,Re)|0;var Lo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,g=Math.imul(de,be),u=Math.imul(de,we),u=u+Math.imul(fe,be)|0,x=Math.imul(fe,we),g=g+Math.imul(ue,_e)|0,u=u+Math.imul(ue,Se)|0,u=u+Math.imul(pe,_e)|0,x=x+Math.imul(pe,Se)|0,g=g+Math.imul(ce,Ee)|0,u=u+Math.imul(ce,ke)|0,u=u+Math.imul(le,Ee)|0,x=x+Math.imul(le,ke)|0,g=g+Math.imul(oe,Ce)|0,u=u+Math.imul(oe,Te)|0,u=u+Math.imul(ae,Ce)|0,x=x+Math.imul(ae,Te)|0,g=g+Math.imul(Y,Me)|0,u=u+Math.imul(Y,Oe)|0,u=u+Math.imul(Z,Me)|0,x=x+Math.imul(Z,Oe)|0,g=g+Math.imul(z,Ae)|0,u=u+Math.imul(z,Re)|0,u=u+Math.imul(G,Ae)|0,x=x+Math.imul(G,Re)|0,g=g+Math.imul(B,Pe)|0,u=u+Math.imul(B,Be)|0,u=u+Math.imul(j,Pe)|0,x=x+Math.imul(j,Be)|0;var Fo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Fo>>>26)|0,Fo&=67108863,g=Math.imul(he,be),u=Math.imul(he,we),u=u+Math.imul(me,be)|0,x=Math.imul(me,we),g=g+Math.imul(de,_e)|0,u=u+Math.imul(de,Se)|0,u=u+Math.imul(fe,_e)|0,x=x+Math.imul(fe,Se)|0,g=g+Math.imul(ue,Ee)|0,u=u+Math.imul(ue,ke)|0,u=u+Math.imul(pe,Ee)|0,x=x+Math.imul(pe,ke)|0,g=g+Math.imul(ce,Ce)|0,u=u+Math.imul(ce,Te)|0,u=u+Math.imul(le,Ce)|0,x=x+Math.imul(le,Te)|0,g=g+Math.imul(oe,Me)|0,u=u+Math.imul(oe,Oe)|0,u=u+Math.imul(ae,Me)|0,x=x+Math.imul(ae,Oe)|0,g=g+Math.imul(Y,Ae)|0,u=u+Math.imul(Y,Re)|0,u=u+Math.imul(Z,Ae)|0,x=x+Math.imul(Z,Re)|0,g=g+Math.imul(z,Pe)|0,u=u+Math.imul(z,Be)|0,u=u+Math.imul(G,Pe)|0,x=x+Math.imul(G,Be)|0,g=g+Math.imul(B,je)|0,u=u+Math.imul(B,Ne)|0,u=u+Math.imul(j,je)|0,x=x+Math.imul(j,Ne)|0;var Uo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,g=Math.imul(ve,be),u=Math.imul(ve,we),u=u+Math.imul(ge,be)|0,x=Math.imul(ge,we),g=g+Math.imul(he,_e)|0,u=u+Math.imul(he,Se)|0,u=u+Math.imul(me,_e)|0,x=x+Math.imul(me,Se)|0,g=g+Math.imul(de,Ee)|0,u=u+Math.imul(de,ke)|0,u=u+Math.imul(fe,Ee)|0,x=x+Math.imul(fe,ke)|0,g=g+Math.imul(ue,Ce)|0,u=u+Math.imul(ue,Te)|0,u=u+Math.imul(pe,Ce)|0,x=x+Math.imul(pe,Te)|0,g=g+Math.imul(ce,Me)|0,u=u+Math.imul(ce,Oe)|0,u=u+Math.imul(le,Me)|0,x=x+Math.imul(le,Oe)|0,g=g+Math.imul(oe,Ae)|0,u=u+Math.imul(oe,Re)|0,u=u+Math.imul(ae,Ae)|0,x=x+Math.imul(ae,Re)|0,g=g+Math.imul(Y,Pe)|0,u=u+Math.imul(Y,Be)|0,u=u+Math.imul(Z,Pe)|0,x=x+Math.imul(Z,Be)|0,g=g+Math.imul(z,je)|0,u=u+Math.imul(z,Ne)|0,u=u+Math.imul(G,je)|0,x=x+Math.imul(G,Ne)|0,g=g+Math.imul(B,Ie)|0,u=u+Math.imul(B,De)|0,u=u+Math.imul(j,Ie)|0,x=x+Math.imul(j,De)|0;var Ho=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Ho>>>26)|0,Ho&=67108863,g=Math.imul(xe,be),u=Math.imul(xe,we),u=u+Math.imul(ye,be)|0,x=Math.imul(ye,we),g=g+Math.imul(ve,_e)|0,u=u+Math.imul(ve,Se)|0,u=u+Math.imul(ge,_e)|0,x=x+Math.imul(ge,Se)|0,g=g+Math.imul(he,Ee)|0,u=u+Math.imul(he,ke)|0,u=u+Math.imul(me,Ee)|0,x=x+Math.imul(me,ke)|0,g=g+Math.imul(de,Ce)|0,u=u+Math.imul(de,Te)|0,u=u+Math.imul(fe,Ce)|0,x=x+Math.imul(fe,Te)|0,g=g+Math.imul(ue,Me)|0,u=u+Math.imul(ue,Oe)|0,u=u+Math.imul(pe,Me)|0,x=x+Math.imul(pe,Oe)|0,g=g+Math.imul(ce,Ae)|0,u=u+Math.imul(ce,Re)|0,u=u+Math.imul(le,Ae)|0,x=x+Math.imul(le,Re)|0,g=g+Math.imul(oe,Pe)|0,u=u+Math.imul(oe,Be)|0,u=u+Math.imul(ae,Pe)|0,x=x+Math.imul(ae,Be)|0,g=g+Math.imul(Y,je)|0,u=u+Math.imul(Y,Ne)|0,u=u+Math.imul(Z,je)|0,x=x+Math.imul(Z,Ne)|0,g=g+Math.imul(z,Ie)|0,u=u+Math.imul(z,De)|0,u=u+Math.imul(G,Ie)|0,x=x+Math.imul(G,De)|0,g=g+Math.imul(B,qe)|0,u=u+Math.imul(B,Le)|0,u=u+Math.imul(j,qe)|0,x=x+Math.imul(j,Le)|0;var zo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(zo>>>26)|0,zo&=67108863,g=Math.imul(xe,_e),u=Math.imul(xe,Se),u=u+Math.imul(ye,_e)|0,x=Math.imul(ye,Se),g=g+Math.imul(ve,Ee)|0,u=u+Math.imul(ve,ke)|0,u=u+Math.imul(ge,Ee)|0,x=x+Math.imul(ge,ke)|0,g=g+Math.imul(he,Ce)|0,u=u+Math.imul(he,Te)|0,u=u+Math.imul(me,Ce)|0,x=x+Math.imul(me,Te)|0,g=g+Math.imul(de,Me)|0,u=u+Math.imul(de,Oe)|0,u=u+Math.imul(fe,Me)|0,x=x+Math.imul(fe,Oe)|0,g=g+Math.imul(ue,Ae)|0,u=u+Math.imul(ue,Re)|0,u=u+Math.imul(pe,Ae)|0,x=x+Math.imul(pe,Re)|0,g=g+Math.imul(ce,Pe)|0,u=u+Math.imul(ce,Be)|0,u=u+Math.imul(le,Pe)|0,x=x+Math.imul(le,Be)|0,g=g+Math.imul(oe,je)|0,u=u+Math.imul(oe,Ne)|0,u=u+Math.imul(ae,je)|0,x=x+Math.imul(ae,Ne)|0,g=g+Math.imul(Y,Ie)|0,u=u+Math.imul(Y,De)|0,u=u+Math.imul(Z,Ie)|0,x=x+Math.imul(Z,De)|0,g=g+Math.imul(z,qe)|0,u=u+Math.imul(z,Le)|0,u=u+Math.imul(G,qe)|0,x=x+Math.imul(G,Le)|0;var $o=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+($o>>>26)|0,$o&=67108863,g=Math.imul(xe,Ee),u=Math.imul(xe,ke),u=u+Math.imul(ye,Ee)|0,x=Math.imul(ye,ke),g=g+Math.imul(ve,Ce)|0,u=u+Math.imul(ve,Te)|0,u=u+Math.imul(ge,Ce)|0,x=x+Math.imul(ge,Te)|0,g=g+Math.imul(he,Me)|0,u=u+Math.imul(he,Oe)|0,u=u+Math.imul(me,Me)|0,x=x+Math.imul(me,Oe)|0,g=g+Math.imul(de,Ae)|0,u=u+Math.imul(de,Re)|0,u=u+Math.imul(fe,Ae)|0,x=x+Math.imul(fe,Re)|0,g=g+Math.imul(ue,Pe)|0,u=u+Math.imul(ue,Be)|0,u=u+Math.imul(pe,Pe)|0,x=x+Math.imul(pe,Be)|0,g=g+Math.imul(ce,je)|0,u=u+Math.imul(ce,Ne)|0,u=u+Math.imul(le,je)|0,x=x+Math.imul(le,Ne)|0,g=g+Math.imul(oe,Ie)|0,u=u+Math.imul(oe,De)|0,u=u+Math.imul(ae,Ie)|0,x=x+Math.imul(ae,De)|0,g=g+Math.imul(Y,qe)|0,u=u+Math.imul(Y,Le)|0,u=u+Math.imul(Z,qe)|0,x=x+Math.imul(Z,Le)|0;var Wo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Wo>>>26)|0,Wo&=67108863,g=Math.imul(xe,Ce),u=Math.imul(xe,Te),u=u+Math.imul(ye,Ce)|0,x=Math.imul(ye,Te),g=g+Math.imul(ve,Me)|0,u=u+Math.imul(ve,Oe)|0,u=u+Math.imul(ge,Me)|0,x=x+Math.imul(ge,Oe)|0,g=g+Math.imul(he,Ae)|0,u=u+Math.imul(he,Re)|0,u=u+Math.imul(me,Ae)|0,x=x+Math.imul(me,Re)|0,g=g+Math.imul(de,Pe)|0,u=u+Math.imul(de,Be)|0,u=u+Math.imul(fe,Pe)|0,x=x+Math.imul(fe,Be)|0,g=g+Math.imul(ue,je)|0,u=u+Math.imul(ue,Ne)|0,u=u+Math.imul(pe,je)|0,x=x+Math.imul(pe,Ne)|0,g=g+Math.imul(ce,Ie)|0,u=u+Math.imul(ce,De)|0,u=u+Math.imul(le,Ie)|0,x=x+Math.imul(le,De)|0,g=g+Math.imul(oe,qe)|0,u=u+Math.imul(oe,Le)|0,u=u+Math.imul(ae,qe)|0,x=x+Math.imul(ae,Le)|0;var Vo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Vo>>>26)|0,Vo&=67108863,g=Math.imul(xe,Me),u=Math.imul(xe,Oe),u=u+Math.imul(ye,Me)|0,x=Math.imul(ye,Oe),g=g+Math.imul(ve,Ae)|0,u=u+Math.imul(ve,Re)|0,u=u+Math.imul(ge,Ae)|0,x=x+Math.imul(ge,Re)|0,g=g+Math.imul(he,Pe)|0,u=u+Math.imul(he,Be)|0,u=u+Math.imul(me,Pe)|0,x=x+Math.imul(me,Be)|0,g=g+Math.imul(de,je)|0,u=u+Math.imul(de,Ne)|0,u=u+Math.imul(fe,je)|0,x=x+Math.imul(fe,Ne)|0,g=g+Math.imul(ue,Ie)|0,u=u+Math.imul(ue,De)|0,u=u+Math.imul(pe,Ie)|0,x=x+Math.imul(pe,De)|0,g=g+Math.imul(ce,qe)|0,u=u+Math.imul(ce,Le)|0,u=u+Math.imul(le,qe)|0,x=x+Math.imul(le,Le)|0;var Ko=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Ko>>>26)|0,Ko&=67108863,g=Math.imul(xe,Ae),u=Math.imul(xe,Re),u=u+Math.imul(ye,Ae)|0,x=Math.imul(ye,Re),g=g+Math.imul(ve,Pe)|0,u=u+Math.imul(ve,Be)|0,u=u+Math.imul(ge,Pe)|0,x=x+Math.imul(ge,Be)|0,g=g+Math.imul(he,je)|0,u=u+Math.imul(he,Ne)|0,u=u+Math.imul(me,je)|0,x=x+Math.imul(me,Ne)|0,g=g+Math.imul(de,Ie)|0,u=u+Math.imul(de,De)|0,u=u+Math.imul(fe,Ie)|0,x=x+Math.imul(fe,De)|0,g=g+Math.imul(ue,qe)|0,u=u+Math.imul(ue,Le)|0,u=u+Math.imul(pe,qe)|0,x=x+Math.imul(pe,Le)|0;var Go=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Go>>>26)|0,Go&=67108863,g=Math.imul(xe,Pe),u=Math.imul(xe,Be),u=u+Math.imul(ye,Pe)|0,x=Math.imul(ye,Be),g=g+Math.imul(ve,je)|0,u=u+Math.imul(ve,Ne)|0,u=u+Math.imul(ge,je)|0,x=x+Math.imul(ge,Ne)|0,g=g+Math.imul(he,Ie)|0,u=u+Math.imul(he,De)|0,u=u+Math.imul(me,Ie)|0,x=x+Math.imul(me,De)|0,g=g+Math.imul(de,qe)|0,u=u+Math.imul(de,Le)|0,u=u+Math.imul(fe,qe)|0,x=x+Math.imul(fe,Le)|0;var Yo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Yo>>>26)|0,Yo&=67108863,g=Math.imul(xe,je),u=Math.imul(xe,Ne),u=u+Math.imul(ye,je)|0,x=Math.imul(ye,Ne),g=g+Math.imul(ve,Ie)|0,u=u+Math.imul(ve,De)|0,u=u+Math.imul(ge,Ie)|0,x=x+Math.imul(ge,De)|0,g=g+Math.imul(he,qe)|0,u=u+Math.imul(he,Le)|0,u=u+Math.imul(me,qe)|0,x=x+Math.imul(me,Le)|0;var Jo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Jo>>>26)|0,Jo&=67108863,g=Math.imul(xe,Ie),u=Math.imul(xe,De),u=u+Math.imul(ye,Ie)|0,x=Math.imul(ye,De),g=g+Math.imul(ve,qe)|0,u=u+Math.imul(ve,Le)|0,u=u+Math.imul(ge,qe)|0,x=x+Math.imul(ge,Le)|0;var Xo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Xo>>>26)|0,Xo&=67108863,g=Math.imul(xe,qe),u=Math.imul(xe,Le),u=u+Math.imul(ye,qe)|0,x=Math.imul(ye,Le);var Zo=(S+g|0)+((u&8191)<<13)|0;return S=(x+(u>>>13)|0)+(Zo>>>26)|0,Zo&=67108863,w[0]=jo,w[1]=No,w[2]=Io,w[3]=Do,w[4]=qo,w[5]=Lo,w[6]=Fo,w[7]=Uo,w[8]=Ho,w[9]=zo,w[10]=$o,w[11]=Wo,w[12]=Vo,w[13]=Ko,w[14]=Go,w[15]=Yo,w[16]=Jo,w[17]=Xo,w[18]=Zo,S!==0&&(w[19]=S,h.length++),h};Math.imul||(k=E);function T(b,c,d){d.negative=c.negative^b.negative,d.length=b.length+c.length;for(var h=0,v=0,y=0;y<d.length-1;y++){var w=v;v=0;for(var S=h&67108863,g=Math.min(y,c.length-1),u=Math.max(0,y-b.length+1);u<=g;u++){var x=y-u,P=b.words[x]|0,B=c.words[u]|0,j=P*B,D=j&67108863;w=w+(j/67108864|0)|0,D=D+S|0,S=D&67108863,w=w+(D>>>26)|0,v+=w>>>26,w&=67108863}d.words[y]=S,h=w,w=v}return h!==0?d.words[y]=h:d.length--,d.strip()}function O(b,c,d){var h=new M;return h.mulp(b,c,d)}s.prototype.mulTo=function(c,d){var h,v=this.length+c.length;return this.length===10&&c.length===10?h=k(this,c,d):v<63?h=E(this,c,d):v<1024?h=T(this,c,d):h=O(this,c,d),h};function M(b,c){this.x=b,this.y=c}M.prototype.makeRBT=function(c){for(var d=new Array(c),h=s.prototype._countBits(c)-1,v=0;v<c;v++)d[v]=this.revBin(v,h,c);return d},M.prototype.revBin=function(c,d,h){if(c===0||c===h-1)return c;for(var v=0,y=0;y<d;y++)v|=(c&1)<<d-y-1,c>>=1;return v},M.prototype.permute=function(c,d,h,v,y,w){for(var S=0;S<w;S++)v[S]=d[c[S]],y[S]=h[c[S]]},M.prototype.transform=function(c,d,h,v,y,w){this.permute(w,c,d,h,v,y);for(var S=1;S<y;S<<=1)for(var g=S<<1,u=Math.cos(2*Math.PI/g),x=Math.sin(2*Math.PI/g),P=0;P<y;P+=g)for(var B=u,j=x,D=0;D<S;D++){var z=h[P+D],G=v[P+D],si=h[P+D+S],Y=v[P+D+S],Z=B*si-j*Y;Y=B*Y+j*si,si=Z,h[P+D]=z+si,v[P+D]=G+Y,h[P+D+S]=z-si,v[P+D+S]=G-Y,D!==g&&(Z=u*B-x*j,j=u*j+x*B,B=Z)}},M.prototype.guessLen13b=function(c,d){var h=Math.max(d,c)|1,v=h&1,y=0;for(h=h/2|0;h;h=h>>>1)y++;return 1<<y+1+v},M.prototype.conjugate=function(c,d,h){if(!(h<=1))for(var v=0;v<h/2;v++){var y=c[v];c[v]=c[h-v-1],c[h-v-1]=y,y=d[v],d[v]=-d[h-v-1],d[h-v-1]=-y}},M.prototype.normalize13b=function(c,d){for(var h=0,v=0;v<d/2;v++){var y=Math.round(c[2*v+1]/d)*8192+Math.round(c[2*v]/d)+h;c[v]=y&67108863,y<67108864?h=0:h=y/67108864|0}return c},M.prototype.convert13b=function(c,d,h,v){for(var y=0,w=0;w<d;w++)y=y+(c[w]|0),h[2*w]=y&8191,y=y>>>13,h[2*w+1]=y&8191,y=y>>>13;for(w=2*d;w<v;++w)h[w]=0;t(y===0),t((y&-8192)===0)},M.prototype.stub=function(c){for(var d=new Array(c),h=0;h<c;h++)d[h]=0;return d},M.prototype.mulp=function(c,d,h){var v=2*this.guessLen13b(c.length,d.length),y=this.makeRBT(v),w=this.stub(v),S=new Array(v),g=new Array(v),u=new Array(v),x=new Array(v),P=new Array(v),B=new Array(v),j=h.words;j.length=v,this.convert13b(c.words,c.length,S,v),this.convert13b(d.words,d.length,x,v),this.transform(S,w,g,u,v,y),this.transform(x,w,P,B,v,y);for(var D=0;D<v;D++){var z=g[D]*P[D]-u[D]*B[D];u[D]=g[D]*B[D]+u[D]*P[D],g[D]=z}return this.conjugate(g,u,v),this.transform(g,u,j,w,v,y),this.conjugate(j,w,v),this.normalize13b(j,v),h.negative=c.negative^d.negative,h.length=c.length+d.length,h.strip()},s.prototype.mul=function(c){var d=new s(null);return d.words=new Array(this.length+c.length),this.mulTo(c,d)},s.prototype.mulf=function(c){var d=new s(null);return d.words=new Array(this.length+c.length),O(this,c,d)},s.prototype.imul=function(c){return this.clone().mulTo(c,this)},s.prototype.imuln=function(c){t(typeof c=="number"),t(c<67108864);for(var d=0,h=0;h<this.length;h++){var v=(this.words[h]|0)*c,y=(v&67108863)+(d&67108863);d>>=26,d+=v/67108864|0,d+=y>>>26,this.words[h]=y&67108863}return d!==0&&(this.words[h]=d,this.length++),this.length=c===0?1:this.length,this},s.prototype.muln=function(c){return this.clone().imuln(c)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(c){var d=_(c);if(d.length===0)return new s(1);for(var h=this,v=0;v<d.length&&d[v]===0;v++,h=h.sqr());if(++v<d.length)for(var y=h.sqr();v<d.length;v++,y=y.sqr())d[v]!==0&&(h=h.mul(y));return h},s.prototype.iushln=function(c){t(typeof c=="number"&&c>=0);var d=c%26,h=(c-d)/26,v=67108863>>>26-d<<26-d,y;if(d!==0){var w=0;for(y=0;y<this.length;y++){var S=this.words[y]&v,g=(this.words[y]|0)-S<<d;this.words[y]=g|w,w=S>>>26-d}w&&(this.words[y]=w,this.length++)}if(h!==0){for(y=this.length-1;y>=0;y--)this.words[y+h]=this.words[y];for(y=0;y<h;y++)this.words[y]=0;this.length+=h}return this.strip()},s.prototype.ishln=function(c){return t(this.negative===0),this.iushln(c)},s.prototype.iushrn=function(c,d,h){t(typeof c=="number"&&c>=0);var v;d?v=(d-d%26)/26:v=0;var y=c%26,w=Math.min((c-y)/26,this.length),S=67108863^67108863>>>y<<y,g=h;if(v-=w,v=Math.max(0,v),g){for(var u=0;u<w;u++)g.words[u]=this.words[u];g.length=w}if(w!==0)if(this.length>w)for(this.length-=w,u=0;u<this.length;u++)this.words[u]=this.words[u+w];else this.words[0]=0,this.length=1;var x=0;for(u=this.length-1;u>=0&&(x!==0||u>=v);u--){var P=this.words[u]|0;this.words[u]=x<<26-y|P>>>y,x=P&S}return g&&x!==0&&(g.words[g.length++]=x),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(c,d,h){return t(this.negative===0),this.iushrn(c,d,h)},s.prototype.shln=function(c){return this.clone().ishln(c)},s.prototype.ushln=function(c){return this.clone().iushln(c)},s.prototype.shrn=function(c){return this.clone().ishrn(c)},s.prototype.ushrn=function(c){return this.clone().iushrn(c)},s.prototype.testn=function(c){t(typeof c=="number"&&c>=0);var d=c%26,h=(c-d)/26,v=1<<d;if(this.length<=h)return!1;var y=this.words[h];return!!(y&v)},s.prototype.imaskn=function(c){t(typeof c=="number"&&c>=0);var d=c%26,h=(c-d)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(d!==0&&h++,this.length=Math.min(h,this.length),d!==0){var v=67108863^67108863>>>d<<d;this.words[this.length-1]&=v}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.maskn=function(c){return this.clone().imaskn(c)},s.prototype.iaddn=function(c){return t(typeof c=="number"),t(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},s.prototype._iaddn=function(c){this.words[0]+=c;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},s.prototype.isubn=function(c){if(t(typeof c=="number"),t(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this.strip()},s.prototype.addn=function(c){return this.clone().iaddn(c)},s.prototype.subn=function(c){return this.clone().isubn(c)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(c,d,h){var v=c.length+h,y;this._expand(v);var w,S=0;for(y=0;y<c.length;y++){w=(this.words[y+h]|0)+S;var g=(c.words[y]|0)*d;w-=g&67108863,S=(w>>26)-(g/67108864|0),this.words[y+h]=w&67108863}for(;y<this.length-h;y++)w=(this.words[y+h]|0)+S,S=w>>26,this.words[y+h]=w&67108863;if(S===0)return this.strip();for(t(S===-1),S=0,y=0;y<this.length;y++)w=-(this.words[y]|0)+S,S=w>>26,this.words[y]=w&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(c,d){var h=this.length-c.length,v=this.clone(),y=c,w=y.words[y.length-1]|0,S=this._countBits(w);h=26-S,h!==0&&(y=y.ushln(h),v.iushln(h),w=y.words[y.length-1]|0);var g=v.length-y.length,u;if(d!=="mod"){u=new s(null),u.length=g+1,u.words=new Array(u.length);for(var x=0;x<u.length;x++)u.words[x]=0}var P=v.clone()._ishlnsubmul(y,1,g);P.negative===0&&(v=P,u&&(u.words[g]=1));for(var B=g-1;B>=0;B--){var j=(v.words[y.length+B]|0)*67108864+(v.words[y.length+B-1]|0);for(j=Math.min(j/w|0,67108863),v._ishlnsubmul(y,j,B);v.negative!==0;)j--,v.negative=0,v._ishlnsubmul(y,1,B),v.isZero()||(v.negative^=1);u&&(u.words[B]=j)}return u&&u.strip(),v.strip(),d!=="div"&&h!==0&&v.iushrn(h),{div:u||null,mod:v}},s.prototype.divmod=function(c,d,h){if(t(!c.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var v,y,w;return this.negative!==0&&c.negative===0?(w=this.neg().divmod(c,d),d!=="mod"&&(v=w.div.neg()),d!=="div"&&(y=w.mod.neg(),h&&y.negative!==0&&y.iadd(c)),{div:v,mod:y}):this.negative===0&&c.negative!==0?(w=this.divmod(c.neg(),d),d!=="mod"&&(v=w.div.neg()),{div:v,mod:w.mod}):(this.negative&c.negative)!==0?(w=this.neg().divmod(c.neg(),d),d!=="div"&&(y=w.mod.neg(),h&&y.negative!==0&&y.isub(c)),{div:w.div,mod:y}):c.length>this.length||this.cmp(c)<0?{div:new s(0),mod:this}:c.length===1?d==="div"?{div:this.divn(c.words[0]),mod:null}:d==="mod"?{div:null,mod:new s(this.modn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new s(this.modn(c.words[0]))}:this._wordDiv(c,d)},s.prototype.div=function(c){return this.divmod(c,"div",!1).div},s.prototype.mod=function(c){return this.divmod(c,"mod",!1).mod},s.prototype.umod=function(c){return this.divmod(c,"mod",!0).mod},s.prototype.divRound=function(c){var d=this.divmod(c);if(d.mod.isZero())return d.div;var h=d.div.negative!==0?d.mod.isub(c):d.mod,v=c.ushrn(1),y=c.andln(1),w=h.cmp(v);return w<0||y===1&&w===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},s.prototype.modn=function(c){t(c<=67108863);for(var d=(1<<26)%c,h=0,v=this.length-1;v>=0;v--)h=(d*h+(this.words[v]|0))%c;return h},s.prototype.idivn=function(c){t(c<=67108863);for(var d=0,h=this.length-1;h>=0;h--){var v=(this.words[h]|0)+d*67108864;this.words[h]=v/c|0,d=v%c}return this.strip()},s.prototype.divn=function(c){return this.clone().idivn(c)},s.prototype.egcd=function(c){t(c.negative===0),t(!c.isZero());var d=this,h=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var v=new s(1),y=new s(0),w=new s(0),S=new s(1),g=0;d.isEven()&&h.isEven();)d.iushrn(1),h.iushrn(1),++g;for(var u=h.clone(),x=d.clone();!d.isZero();){for(var P=0,B=1;(d.words[0]&B)===0&&P<26;++P,B<<=1);if(P>0)for(d.iushrn(P);P-- >0;)(v.isOdd()||y.isOdd())&&(v.iadd(u),y.isub(x)),v.iushrn(1),y.iushrn(1);for(var j=0,D=1;(h.words[0]&D)===0&&j<26;++j,D<<=1);if(j>0)for(h.iushrn(j);j-- >0;)(w.isOdd()||S.isOdd())&&(w.iadd(u),S.isub(x)),w.iushrn(1),S.iushrn(1);d.cmp(h)>=0?(d.isub(h),v.isub(w),y.isub(S)):(h.isub(d),w.isub(v),S.isub(y))}return{a:w,b:S,gcd:h.iushln(g)}},s.prototype._invmp=function(c){t(c.negative===0),t(!c.isZero());var d=this,h=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var v=new s(1),y=new s(0),w=h.clone();d.cmpn(1)>0&&h.cmpn(1)>0;){for(var S=0,g=1;(d.words[0]&g)===0&&S<26;++S,g<<=1);if(S>0)for(d.iushrn(S);S-- >0;)v.isOdd()&&v.iadd(w),v.iushrn(1);for(var u=0,x=1;(h.words[0]&x)===0&&u<26;++u,x<<=1);if(u>0)for(h.iushrn(u);u-- >0;)y.isOdd()&&y.iadd(w),y.iushrn(1);d.cmp(h)>=0?(d.isub(h),v.isub(y)):(h.isub(d),y.isub(v))}var P;return d.cmpn(1)===0?P=v:P=y,P.cmpn(0)<0&&P.iadd(c),P},s.prototype.gcd=function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var d=this.clone(),h=c.clone();d.negative=0,h.negative=0;for(var v=0;d.isEven()&&h.isEven();v++)d.iushrn(1),h.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;h.isEven();)h.iushrn(1);var y=d.cmp(h);if(y<0){var w=d;d=h,h=w}else if(y===0||h.cmpn(1)===0)break;d.isub(h)}while(!0);return h.iushln(v)},s.prototype.invm=function(c){return this.egcd(c).a.umod(c)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(c){return this.words[0]&c},s.prototype.bincn=function(c){t(typeof c=="number");var d=c%26,h=(c-d)/26,v=1<<d;if(this.length<=h)return this._expand(h+1),this.words[h]|=v,this;for(var y=v,w=h;y!==0&&w<this.length;w++){var S=this.words[w]|0;S+=y,y=S>>>26,S&=67108863,this.words[w]=S}return y!==0&&(this.words[w]=y,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(c){var d=c<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this.strip();var h;if(this.length>1)h=1;else{d&&(c=-c),t(c<=67108863,"Number is too big");var v=this.words[0]|0;h=v===c?0:v<c?-1:1}return this.negative!==0?-h|0:h},s.prototype.cmp=function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var d=this.ucmp(c);return this.negative!==0?-d|0:d},s.prototype.ucmp=function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var d=0,h=this.length-1;h>=0;h--){var v=this.words[h]|0,y=c.words[h]|0;if(v!==y){v<y?d=-1:v>y&&(d=1);break}}return d},s.prototype.gtn=function(c){return this.cmpn(c)===1},s.prototype.gt=function(c){return this.cmp(c)===1},s.prototype.gten=function(c){return this.cmpn(c)>=0},s.prototype.gte=function(c){return this.cmp(c)>=0},s.prototype.ltn=function(c){return this.cmpn(c)===-1},s.prototype.lt=function(c){return this.cmp(c)===-1},s.prototype.lten=function(c){return this.cmpn(c)<=0},s.prototype.lte=function(c){return this.cmp(c)<=0},s.prototype.eqn=function(c){return this.cmpn(c)===0},s.prototype.eq=function(c){return this.cmp(c)===0},s.red=function(c){return new H(c)},s.prototype.toRed=function(c){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},s.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(c){return this.red=c,this},s.prototype.forceRed=function(c){return t(!this.red,"Already a number in reduction context"),this._forceRed(c)},s.prototype.redAdd=function(c){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},s.prototype.redIAdd=function(c){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},s.prototype.redSub=function(c){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},s.prototype.redISub=function(c){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},s.prototype.redShl=function(c){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},s.prototype.redMul=function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},s.prototype.redIMul=function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},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(c){return t(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)};var A={k256:null,p224:null,p192:null,p25519:null};function I(b,c){this.name=b,this.p=new s(c,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}I.prototype._tmp=function(){var c=new s(null);return c.words=new Array(Math.ceil(this.n/13)),c},I.prototype.ireduce=function(c){var d=c,h;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),h=d.bitLength();while(h>this.n);var v=h<this.n?-1:d.ucmp(this.p);return v===0?(d.words[0]=0,d.length=1):v>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},I.prototype.split=function(c,d){c.iushrn(this.n,0,d)},I.prototype.imulK=function(c){return c.imul(this.k)};function U(){I.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(U,I),U.prototype.split=function(c,d){for(var h=4194303,v=Math.min(c.length,9),y=0;y<v;y++)d.words[y]=c.words[y];if(d.length=v,c.length<=9){c.words[0]=0,c.length=1;return}var w=c.words[9];for(d.words[d.length++]=w&h,y=10;y<c.length;y++){var S=c.words[y]|0;c.words[y-10]=(S&h)<<4|w>>>22,w=S}w>>>=22,c.words[y-10]=w,w===0&&c.length>10?c.length-=10:c.length-=9},U.prototype.imulK=function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var d=0,h=0;h<c.length;h++){var v=c.words[h]|0;d+=v*977,c.words[h]=d&67108863,d=v*64+(d/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c};function ie(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(ie,I);function J(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(J,I);function ne(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(ne,I),ne.prototype.imulK=function(c){for(var d=0,h=0;h<c.length;h++){var v=(c.words[h]|0)*19+d,y=v&67108863;v>>>=26,c.words[h]=y,d=v}return d!==0&&(c.words[c.length++]=d),c},s._prime=function(c){if(A[c])return A[c];var d;if(c==="k256")d=new U;else if(c==="p224")d=new ie;else if(c==="p192")d=new J;else if(c==="p25519")d=new ne;else throw new Error("Unknown prime "+c);return A[c]=d,d};function H(b){if(typeof b=="string"){var c=s._prime(b);this.m=c.p,this.prime=c}else t(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}H.prototype._verify1=function(c){t(c.negative===0,"red works only with positives"),t(c.red,"red works only with red numbers")},H.prototype._verify2=function(c,d){t((c.negative|d.negative)===0,"red works only with positives"),t(c.red&&c.red===d.red,"red works only with red numbers")},H.prototype.imod=function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):c.umod(this.m)._forceRed(this)},H.prototype.neg=function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},H.prototype.add=function(c,d){this._verify2(c,d);var h=c.add(d);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},H.prototype.iadd=function(c,d){this._verify2(c,d);var h=c.iadd(d);return h.cmp(this.m)>=0&&h.isub(this.m),h},H.prototype.sub=function(c,d){this._verify2(c,d);var h=c.sub(d);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},H.prototype.isub=function(c,d){this._verify2(c,d);var h=c.isub(d);return h.cmpn(0)<0&&h.iadd(this.m),h},H.prototype.shl=function(c,d){return this._verify1(c),this.imod(c.ushln(d))},H.prototype.imul=function(c,d){return this._verify2(c,d),this.imod(c.imul(d))},H.prototype.mul=function(c,d){return this._verify2(c,d),this.imod(c.mul(d))},H.prototype.isqr=function(c){return this.imul(c,c.clone())},H.prototype.sqr=function(c){return this.mul(c,c)},H.prototype.sqrt=function(c){if(c.isZero())return c.clone();var d=this.m.andln(3);if(t(d%2===1),d===3){var h=this.m.add(new s(1)).iushrn(2);return this.pow(c,h)}for(var v=this.m.subn(1),y=0;!v.isZero()&&v.andln(1)===0;)y++,v.iushrn(1);t(!v.isZero());var w=new s(1).toRed(this),S=w.redNeg(),g=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);this.pow(u,g).cmp(S)!==0;)u.redIAdd(S);for(var x=this.pow(u,v),P=this.pow(c,v.addn(1).iushrn(1)),B=this.pow(c,v),j=y;B.cmp(w)!==0;){for(var D=B,z=0;D.cmp(w)!==0;z++)D=D.redSqr();t(z<j);var G=this.pow(x,new s(1).iushln(j-z-1));P=P.redMul(G),x=G.redSqr(),B=B.redMul(x),j=z}return P},H.prototype.invm=function(c){var d=c._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},H.prototype.pow=function(c,d){if(d.isZero())return new s(1).toRed(this);if(d.cmpn(1)===0)return c.clone();var h=4,v=new Array(1<<h);v[0]=new s(1).toRed(this),v[1]=c;for(var y=2;y<v.length;y++)v[y]=this.mul(v[y-1],c);var w=v[0],S=0,g=0,u=d.bitLength()%26;for(u===0&&(u=26),y=d.length-1;y>=0;y--){for(var x=d.words[y],P=u-1;P>=0;P--){var B=x>>P&1;if(w!==v[0]&&(w=this.sqr(w)),B===0&&S===0){g=0;continue}S<<=1,S|=B,g++,!(g!==h&&(y!==0||P!==0))&&(w=this.mul(w,v[S]),g=0,S=0)}u=26}return w},H.prototype.convertTo=function(c){var d=c.umod(this.m);return d===c?d.clone():d},H.prototype.convertFrom=function(c){var d=c.clone();return d.red=null,d},s.mont=function(c){return new Ue(c)};function Ue(b){H.call(this,b),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(Ue,H),Ue.prototype.convertTo=function(c){return this.imod(c.ushln(this.shift))},Ue.prototype.convertFrom=function(c){var d=this.imod(c.mul(this.rinv));return d.red=null,d},Ue.prototype.imul=function(c,d){if(c.isZero()||d.isZero())return c.words[0]=0,c.length=1,c;var h=c.imul(d),v=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=h.isub(v).iushrn(this.shift),w=y;return y.cmp(this.m)>=0?w=y.isub(this.m):y.cmpn(0)<0&&(w=y.iadd(this.m)),w._forceRed(this)},Ue.prototype.mul=function(c,d){if(c.isZero()||d.isZero())return new s(0)._forceRed(this);var h=c.mul(d),v=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=h.isub(v).iushrn(this.shift),w=y;return y.cmp(this.m)>=0?w=y.isub(this.m):y.cmpn(0)<0&&(w=y.iadd(this.m)),w._forceRed(this)},Ue.prototype.invm=function(c){var d=this.imod(c._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(typeof ll>"u"||ll,Lm)});var Fm=C((pM,pl)=>{typeof Object.create=="function"?pl.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:pl.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 mi=C((dM,fl)=>{try{if(dl=require("util"),typeof dl.inherits!="function")throw"";fl.exports=dl.inherits}catch{fl.exports=Fm()}var dl});var Xr=C((fM,Um)=>{"use strict";var Jr=require("buffer"),kn=Jr.Buffer,_t={},St;for(St in Jr)Jr.hasOwnProperty(St)&&(St==="SlowBuffer"||St==="Buffer"||(_t[St]=Jr[St]));var Cn=_t.Buffer={};for(St in kn)kn.hasOwnProperty(St)&&(St==="allocUnsafe"||St==="allocUnsafeSlow"||(Cn[St]=kn[St]));_t.Buffer.prototype=kn.prototype;(!Cn.from||Cn.from===Uint8Array.from)&&(Cn.from=function(i,e,t){if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof i);if(i&&typeof i.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);return kn(i,e,t)});Cn.alloc||(Cn.alloc=function(i,e,t){if(typeof i!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof i);if(i<0||i>=2*(1<<30))throw new RangeError('The value "'+i+'" is invalid for option "size"');var n=kn(i);return!e||e.length===0?n.fill(0):typeof t=="string"?n.fill(e,t):n.fill(e),n});if(!_t.kStringMaxLength)try{_t.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}_t.constants||(_t.constants={MAX_LENGTH:_t.kMaxLength},_t.kStringMaxLength&&(_t.constants.MAX_STRING_LENGTH=_t.kStringMaxLength));Um.exports=_t});var Zr=C(Hm=>{"use strict";var aE=mi();function Et(i){this._reporterState={obj:null,path:[],options:i||{},errors:[]}}Hm.Reporter=Et;Et.prototype.isError=function(e){return e instanceof Tn};Et.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};Et.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};Et.prototype.enterKey=function(e){return this._reporterState.path.push(e)};Et.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};Et.prototype.leaveKey=function(e,t,n){let s=this._reporterState;this.exitKey(e),s.obj!==null&&(s.obj[t]=n)};Et.prototype.path=function(){return this._reporterState.path.join("/")};Et.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};Et.prototype.leaveObject=function(e){let t=this._reporterState,n=t.obj;return t.obj=e,n};Et.prototype.error=function(e){let t,n=this._reporterState,s=e instanceof Tn;if(s?t=e:t=new Tn(n.path.map(function(r){return"["+JSON.stringify(r)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw t;return s||n.errors.push(t),t};Et.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function Tn(i,e){this.path=i,this.rethrow(e)}aE(Tn,Error);Tn.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Tn),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var An=C(hl=>{"use strict";var cE=mi(),Qr=Zr().Reporter,Mn=Xr().Buffer;function kt(i,e){if(Qr.call(this,e),!Mn.isBuffer(i)){this.error("Input not Buffer");return}this.base=i,this.offset=0,this.length=i.length}cE(kt,Qr);hl.DecoderBuffer=kt;kt.isDecoderBuffer=function(e){return e instanceof kt?!0:typeof e=="object"&&Mn.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"};kt.prototype.save=function(){return{offset:this.offset,reporter:Qr.prototype.save.call(this)}};kt.prototype.restore=function(e){let t=new kt(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,Qr.prototype.restore.call(this,e.reporter),t};kt.prototype.isEmpty=function(){return this.offset===this.length};kt.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};kt.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");let n=new kt(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};kt.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function On(i,e){if(Array.isArray(i))this.length=0,this.value=i.map(function(t){return On.isEncoderBuffer(t)||(t=new On(t,e)),this.length+=t.length,t},this);else if(typeof i=="number"){if(!(0<=i&&i<=255))return e.error("non-byte EncoderBuffer value");this.value=i,this.length=1}else if(typeof i=="string")this.value=i,this.length=Mn.byteLength(i);else if(Mn.isBuffer(i))this.value=i,this.length=i.length;else return e.error("Unsupported type: "+typeof i)}hl.EncoderBuffer=On;On.isEncoderBuffer=function(e){return e instanceof On?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};On.prototype.join=function(e,t){return e||(e=Mn.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):Mn.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var Wm=C((vM,$m)=>{$m.exports=zm;function zm(i,e){if(!i)throw new Error(e||"Assertion failed")}zm.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}});var eo=C((gM,Km)=>{"use strict";var lE=Zr().Reporter,uE=An().EncoderBuffer,pE=An().DecoderBuffer,et=Wm(),Vm=["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"],dE=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(Vm),fE=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function V(i,e,t){let n={};this._baseState=n,n.name=t,n.enc=i,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())}Km.exports=V;var hE=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];V.prototype.clone=function(){let e=this._baseState,t={};hE.forEach(function(s){t[s]=e[s]});let n=new this.constructor(t.parent);return n._baseState=t,n};V.prototype._wrap=function(){let e=this._baseState;dE.forEach(function(t){this[t]=function(){let s=new this.constructor(this);return e.children.push(s),s[t].apply(s,arguments)}},this)};V.prototype._init=function(e){let t=this._baseState;et(t.parent===null),e.call(this),t.children=t.children.filter(function(n){return n._baseState.parent===this},this),et.equal(t.children.length,1,"Root node can have only one child")};V.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&&(et(t.children===null),t.children=n,n.forEach(function(s){s._baseState.parent=this},this)),e.length!==0&&(et(t.args===null),t.args=e,t.reverseArgs=e.map(function(s){if(typeof s!="object"||s.constructor!==Object)return s;let r={};return Object.keys(s).forEach(function(o){o==(o|0)&&(o|=0);let a=s[o];r[a]=o}),r}))};fE.forEach(function(i){V.prototype[i]=function(){let t=this._baseState;throw new Error(i+" not implemented for encoding: "+t.enc)}});Vm.forEach(function(i){V.prototype[i]=function(){let t=this._baseState,n=Array.prototype.slice.call(arguments);return et(t.tag===null),t.tag=i,this._useArgs(n),this}});V.prototype.use=function(e){et(e);let t=this._baseState;return et(t.use===null),t.use=e,this};V.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};V.prototype.def=function(e){let t=this._baseState;return et(t.default===null),t.default=e,t.optional=!0,this};V.prototype.explicit=function(e){let t=this._baseState;return et(t.explicit===null&&t.implicit===null),t.explicit=e,this};V.prototype.implicit=function(e){let t=this._baseState;return et(t.explicit===null&&t.implicit===null),t.implicit=e,this};V.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};V.prototype.key=function(e){let t=this._baseState;return et(t.key===null),t.key=e,this};V.prototype.any=function(){let e=this._baseState;return e.any=!0,this};V.prototype.choice=function(e){let t=this._baseState;return et(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map(function(n){return e[n]})),this};V.prototype.contains=function(e){let t=this._baseState;return et(t.use===null),t.contains=e,this};V.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,r=!0,o=null;if(n.key!==null&&(o=e.enterKey(n.key)),n.optional){let l=null;if(n.explicit!==null?l=n.explicit:n.implicit!==null?l=n.implicit:n.tag!==null&&(l=n.tag),l===null&&!n.any){let p=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),r=!0}catch{r=!1}e.restore(p)}else if(r=this._peekTag(e,l,n.any),e.isError(r))return r}let a;if(n.obj&&r&&(a=e.enterObject()),r){if(n.explicit!==null){let p=this._decodeTag(e,n.explicit);if(e.isError(p))return p;e=p}let l=e.offset;if(n.use===null&&n.choice===null){let p;n.any&&(p=e.save());let f=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(f))return f;n.any?s=e.raw(p):e=f}if(t&&t.track&&n.tag!==null&&t.track(e.path(),l,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(f){f._decode(e,t)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){let p=new pE(s);s=this._getUse(n.contains,e._reporterState.obj)._decode(p,t)}}return n.obj&&r&&(s=e.leaveObject(a)),n.key!==null&&(s!==null||r===!0)?e.leaveKey(o,n.key,s):o!==null&&e.exitKey(o),s};V.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)};V.prototype._getUse=function(e,t){let n=this._baseState;return n.useDecoder=this._use(e,t),et(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};V.prototype._decodeChoice=function(e,t){let n=this._baseState,s=null,r=!1;return Object.keys(n.choice).some(function(o){let a=e.save(),l=n.choice[o];try{let p=l._decode(e,t);if(e.isError(p))return!1;s={type:o,value:p},r=!0}catch{return e.restore(a),!1}return!0},this),r?s:e.error("Choice not matched")};V.prototype._createEncoderBuffer=function(e){return new uE(e,this.reporter)};V.prototype._encode=function(e,t,n){let s=this._baseState;if(s.default!==null&&s.default===e)return;let r=this._encodeValue(e,t,n);if(r!==void 0&&!this._skipDefault(r,t,n))return r};V.prototype._encodeValue=function(e,t,n){let s=this._baseState;if(s.parent===null)return s.children[0]._encode(e,t||new lE);let r=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)r=this._createEncoderBuffer(e);else if(s.choice)r=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(l){if(l._baseState.tag==="null_")return l._encode(null,t,e);if(l._baseState.key===null)return t.error("Child should have a key");let p=t.enterKey(l._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let f=l._encode(e[l._baseState.key],t,e);return t.leaveKey(p),f},this).filter(function(l){return l}),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 l=this.clone();l._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(p){let f=this._baseState;return this._getUse(f.args[0],e)._encode(p,t)},l))}else s.use!==null?r=this._getUse(s.use,n)._encode(e,t):(o=this._encodePrimitive(s.tag,e),a=!0);if(!s.any&&s.choice===null){let l=s.implicit!==null?s.implicit:s.tag,p=s.implicit===null?"universal":"context";l===null?s.use===null&&t.error("Tag could be omitted only for .use()"):s.use===null&&(r=this._encodeComposite(l,a,p,o))}return s.explicit!==null&&(r=this._encodeComposite(s.explicit,!1,"context",r)),r};V.prototype._encodeChoice=function(e,t){let n=this._baseState,s=n.choice[e.type];return s||et(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),s._encode(e.value,t)};V.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)};V.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};V.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var to=C(Ni=>{"use strict";function Gm(i){let e={};return Object.keys(i).forEach(function(t){(t|0)==t&&(t=t|0);let n=i[t];e[n]=t}),e}Ni.tagClass={0:"universal",1:"application",2:"context",3:"private"};Ni.tagClassByName=Gm(Ni.tagClass);Ni.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"};Ni.tagByName=Gm(Ni.tag)});var vl=C((yM,Xm)=>{"use strict";var mE=mi(),ii=Xr().Buffer,Ym=eo(),ml=to();function Jm(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new jt,this.tree._init(i.body)}Xm.exports=Jm;Jm.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function jt(i){Ym.call(this,"der",i)}mE(jt,Ym);jt.prototype._encodeComposite=function(e,t,n,s){let r=vE(e,t,n,this.reporter);if(s.length<128){let l=ii.alloc(2);return l[0]=r,l[1]=s.length,this._createEncoderBuffer([l,s])}let o=1;for(let l=s.length;l>=256;l>>=8)o++;let a=ii.alloc(2+o);a[0]=r,a[1]=128|o;for(let l=1+o,p=s.length;p>0;l--,p>>=8)a[l]=p&255;return this._createEncoderBuffer([a,s])};jt.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let n=ii.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")};jt.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 l=e[a];for(s++;l>=128;l>>=7)s++}let r=ii.alloc(s),o=r.length-1;for(let a=e.length-1;a>=0;a--){let l=e[a];for(r[o--]=l&127;(l>>=7)>0;)r[o--]=128|l&127}return this._createEncoderBuffer(r)};function Ct(i){return i<10?"0"+i:i}jt.prototype._encodeTime=function(e,t){let n,s=new Date(e);return t==="gentime"?n=[Ct(s.getUTCFullYear()),Ct(s.getUTCMonth()+1),Ct(s.getUTCDate()),Ct(s.getUTCHours()),Ct(s.getUTCMinutes()),Ct(s.getUTCSeconds()),"Z"].join(""):t==="utctime"?n=[Ct(s.getUTCFullYear()%100),Ct(s.getUTCMonth()+1),Ct(s.getUTCDate()),Ct(s.getUTCHours()),Ct(s.getUTCMinutes()),Ct(s.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")};jt.prototype._encodeNull=function(){return this._createEncoderBuffer("")};jt.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"&&!ii.isBuffer(e)){let r=e.toArray();!e.sign&&r[0]&128&&r.unshift(0),e=ii.from(r)}if(ii.isBuffer(e)){let r=e.length;e.length===0&&r++;let o=ii.alloc(r);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 r=e;r>=256;r>>=8)n++;let s=new Array(n);for(let r=s.length-1;r>=0;r--)s[r]=e&255,e>>=8;return s[0]&128&&s.unshift(0),this._createEncoderBuffer(ii.from(s))};jt.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};jt.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getEncoder("der").tree};jt.prototype._skipDefault=function(e,t,n){let s=this._baseState,r;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(r=0;r<o.length;r++)if(o[r]!==s.defaultBuffer[r])return!1;return!0};function vE(i,e,t,n){let s;if(i==="seqof"?i="seq":i==="setof"&&(i="set"),ml.tagByName.hasOwnProperty(i))s=ml.tagByName[i];else if(typeof i=="number"&&(i|0)===i)s=i;else return n.error("Unknown tag: "+i);return s>=31?n.error("Multi-octet tag encoding unsupported"):(e||(s|=32),s|=ml.tagClassByName[t||"universal"]<<6,s)}});var Qm=C((bM,Zm)=>{"use strict";var gE=mi(),gl=vl();function xl(i){gl.call(this,i),this.enc="pem"}gE(xl,gl);Zm.exports=xl;xl.prototype.encode=function(e,t){let s=gl.prototype.encode.call(this,e).toString("base64"),r=["-----BEGIN "+t.label+"-----"];for(let o=0;o<s.length;o+=64)r.push(s.slice(o,o+64));return r.push("-----END "+t.label+"-----"),r.join(`
26
- `)}});var yl=C(tv=>{"use strict";var ev=tv;ev.der=vl();ev.pem=Qm()});var wl=C((_M,av)=>{"use strict";var xE=mi(),yE=ul(),iv=An().DecoderBuffer,sv=eo(),nv=to();function rv(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new dt,this.tree._init(i.body)}av.exports=rv;rv.prototype.decode=function(e,t){return iv.isDecoderBuffer(e)||(e=new iv(e,t)),this.tree._decode(e,t)};function dt(i){sv.call(this,"der",i)}xE(dt,sv);dt.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;let s=e.save(),r=bl(e,'Failed to peek tag: "'+t+'"');return e.isError(r)?r:(e.restore(s),r.tag===t||r.tagStr===t||r.tagStr+"of"===t||n)};dt.prototype._decodeTag=function(e,t,n){let s=bl(e,'Failed to decode tag of "'+t+'"');if(e.isError(s))return s;let r=ov(e,s.primitive,'Failed to get length of "'+t+'"');if(e.isError(r))return r;if(!n&&s.tag!==t&&s.tagStr!==t&&s.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(s.primitive||r!==null)return e.skip(r,'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:(r=e.offset-o.offset,e.restore(o),e.skip(r,'Failed to match body of: "'+t+'"'))};dt.prototype._skipUntilEnd=function(e,t){for(;;){let n=bl(e,t);if(e.isError(n))return n;let s=ov(e,n.primitive,t);if(e.isError(s))return s;let r;if(n.primitive||s!==null?r=e.skip(s):r=this._skipUntilEnd(e,t),e.isError(r))return r;if(n.tagStr==="end")break}};dt.prototype._decodeList=function(e,t,n,s){let r=[];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;r.push(a)}return r};dt.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 r=0;r<n.length/2;r++)s+=String.fromCharCode(n.readUInt16BE(r*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")}};dt.prototype._decodeObjid=function(e,t,n){let s,r=[],o=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),o<<=7,o|=a&127,(a&128)===0&&(r.push(o),o=0);a&128&&r.push(o);let l=r[0]/40|0,p=r[0]%40;if(n?s=r:s=[l,p].concat(r.slice(1)),t){let f=t[s.join(" ")];f===void 0&&(f=t[s.join(".")]),f!==void 0&&(s=f)}return s};dt.prototype._decodeTime=function(e,t){let n=e.raw().toString(),s,r,o,a,l,p;if(t==="gentime")s=n.slice(0,4)|0,r=n.slice(4,6)|0,o=n.slice(6,8)|0,a=n.slice(8,10)|0,l=n.slice(10,12)|0,p=n.slice(12,14)|0;else if(t==="utctime")s=n.slice(0,2)|0,r=n.slice(2,4)|0,o=n.slice(4,6)|0,a=n.slice(6,8)|0,l=n.slice(8,10)|0,p=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,r-1,o,a,l,p,0)};dt.prototype._decodeNull=function(){return null};dt.prototype._decodeBool=function(e){let t=e.readUInt8();return e.isError(t)?t:t!==0};dt.prototype._decodeInt=function(e,t){let n=e.raw(),s=new yE(n);return t&&(s=t[s.toString(10)]||s),s};dt.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function bl(i,e){let t=i.readUInt8(e);if(i.isError(t))return t;let n=nv.tagClass[t>>6],s=(t&32)===0;if((t&31)===31){let o=t;for(t=0;(o&128)===128;){if(o=i.readUInt8(e),i.isError(o))return o;t<<=7,t|=o&127}}else t&=31;let r=nv.tag[t];return{cls:n,primitive:s,tag:t,tagStr:r}}function ov(i,e,t){let n=i.readUInt8(t);if(i.isError(n))return n;if(!e&&n===128)return null;if((n&128)===0)return n;let s=n&127;if(s>4)return i.error("length octect is too long");n=0;for(let r=0;r<s;r++){n<<=8;let o=i.readUInt8(t);if(i.isError(o))return o;n|=o}return n}});var lv=C((SM,cv)=>{"use strict";var bE=mi(),wE=Xr().Buffer,_l=wl();function Sl(i){_l.call(this,i),this.enc="pem"}bE(Sl,_l);cv.exports=Sl;Sl.prototype.decode=function(e,t){let n=e.toString().split(/[\r\n]+/g),s=t.label.toUpperCase(),r=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,a=-1;for(let f=0;f<n.length;f++){let m=n[f].match(r);if(m!==null&&m[2]===s)if(o===-1){if(m[1]!=="BEGIN")break;o=f}else{if(m[1]!=="END")break;a=f;break}}if(o===-1||a===-1)throw new Error("PEM section not found for: "+s);let l=n.slice(o+1,a).join("");l.replace(/[^a-z0-9+/=]+/gi,"");let p=wE.from(l,"base64");return _l.prototype.decode.call(this,p,t)}});var El=C(pv=>{"use strict";var uv=pv;uv.der=wl();uv.pem=lv()});var fv=C(dv=>{"use strict";var _E=yl(),SE=El(),EE=mi(),kE=dv;kE.define=function(e,t){return new Rn(e,t)};function Rn(i,e){this.name=i,this.body=e,this.decoders={},this.encoders={}}Rn.prototype._createNamed=function(e){let t=this.name;function n(s){this._initNamed(s,t)}return EE(n,e),n.prototype._initNamed=function(r,o){e.call(this,r,o)},new n(this)};Rn.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(SE[e])),this.decoders[e]};Rn.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)};Rn.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(_E[e])),this.encoders[e]};Rn.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}});var mv=C(hv=>{"use strict";var io=hv;io.Reporter=Zr().Reporter;io.DecoderBuffer=An().DecoderBuffer;io.EncoderBuffer=An().EncoderBuffer;io.Node=eo()});var xv=C(gv=>{"use strict";var vv=gv;vv._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};vv.der=to()});var bv=C(yv=>{"use strict";var Pn=yv;Pn.bignum=ul();Pn.define=fv().define;Pn.base=mv();Pn.constants=xv();Pn.decoders=El();Pn.encoders=yl()});var Bn=C((kl,_v)=>{var no=require("buffer"),Ht=no.Buffer;function wv(i,e){for(var t in i)e[t]=i[t]}Ht.from&&Ht.alloc&&Ht.allocUnsafe&&Ht.allocUnsafeSlow?_v.exports=no:(wv(no,kl),kl.Buffer=Ii);function Ii(i,e,t){return Ht(i,e,t)}Ii.prototype=Object.create(Ht.prototype);wv(Ht,Ii);Ii.from=function(i,e,t){if(typeof i=="number")throw new TypeError("Argument must not be a number");return Ht(i,e,t)};Ii.alloc=function(i,e,t){if(typeof i!="number")throw new TypeError("Argument must be a number");var n=Ht(i);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};Ii.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return Ht(i)};Ii.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return no.SlowBuffer(i)}});var Cl=C((OM,Sv)=>{var so=Bn().Buffer,CE=require("stream"),TE=require("util");function ro(i){if(this.buffer=null,this.writable=!0,this.readable=!0,!i)return this.buffer=so.alloc(0),this;if(typeof i.pipe=="function")return this.buffer=so.alloc(0),i.pipe(this),this;if(i.length||typeof i=="object")return this.buffer=i,this.writable=!1,process.nextTick(function(){this.emit("end",i),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof i+")")}TE.inherits(ro,CE);ro.prototype.write=function(e){this.buffer=so.concat([this.buffer,so.from(e)]),this.emit("data",e)};ro.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};Sv.exports=ro});var kv=C((AM,Ev)=>{"use strict";function Tl(i){var e=(i/8|0)+(i%8===0?0:1);return e}var ME={ES256:Tl(256),ES384:Tl(384),ES512:Tl(521)};function OE(i){var e=ME[i];if(e)return e;throw new Error('Unknown algorithm "'+i+'"')}Ev.exports=OE});var Pv=C((RM,Rv)=>{"use strict";var oo=Bn().Buffer,Tv=kv(),ao=128,Mv=0,AE=32,RE=16,PE=2,Ov=RE|AE|Mv<<6,co=PE|Mv<<6;function BE(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Av(i){if(oo.isBuffer(i))return i;if(typeof i=="string")return oo.from(i,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function jE(i,e){i=Av(i);var t=Tv(e),n=t+1,s=i.length,r=0;if(i[r++]!==Ov)throw new Error('Could not find expected "seq"');var o=i[r++];if(o===(ao|1)&&(o=i[r++]),s-r<o)throw new Error('"seq" specified length of "'+o+'", only "'+(s-r)+'" remaining');if(i[r++]!==co)throw new Error('Could not find expected "int" for "r"');var a=i[r++];if(s-r-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(s-r-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var l=r;if(r+=a,i[r++]!==co)throw new Error('Could not find expected "int" for "s"');var p=i[r++];if(s-r!==p)throw new Error('"s" specified length of "'+p+'", expected "'+(s-r)+'"');if(n<p)throw new Error('"s" specified length of "'+p+'", max of "'+n+'" is acceptable');var f=r;if(r+=p,r!==s)throw new Error('Expected to consume entire buffer, but "'+(s-r)+'" bytes remain');var m=t-a,_=t-p,E=oo.allocUnsafe(m+a+_+p);for(r=0;r<m;++r)E[r]=0;i.copy(E,r,l+Math.max(-m,0),l+a),r=t;for(var k=r;r<k+_;++r)E[r]=0;return i.copy(E,r,f+Math.max(-_,0),f+p),E=E.toString("base64"),E=BE(E),E}function Cv(i,e,t){for(var n=0;e+n<t&&i[e+n]===0;)++n;var s=i[e+n]>=ao;return s&&--n,n}function NE(i,e){i=Av(i);var t=Tv(e),n=i.length;if(n!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+n+'"');var s=Cv(i,0,t),r=Cv(i,t,i.length),o=t-s,a=t-r,l=2+o+1+1+a,p=l<ao,f=oo.allocUnsafe((p?2:3)+l),m=0;return f[m++]=Ov,p?f[m++]=l:(f[m++]=ao|1,f[m++]=l&255),f[m++]=co,f[m++]=o,s<0?(f[m++]=0,m+=i.copy(f,m,0,t)):m+=i.copy(f,m,s,t),f[m++]=co,f[m++]=a,r<0?(f[m++]=0,i.copy(f,m,t)):i.copy(f,m,t+r),f}Rv.exports={derToJose:jE,joseToDer:NE}});var jv=C((PM,Bv)=>{"use strict";var as=require("buffer").Buffer,Ml=require("buffer").SlowBuffer;Bv.exports=lo;function lo(i,e){if(!as.isBuffer(i)||!as.isBuffer(e)||i.length!==e.length)return!1;for(var t=0,n=0;n<i.length;n++)t|=i[n]^e[n];return t===0}lo.install=function(){as.prototype.equal=Ml.prototype.equal=function(e){return lo(this,e)}};var IE=as.prototype.equal,DE=Ml.prototype.equal;lo.restore=function(){as.prototype.equal=IE,Ml.prototype.equal=DE}});var Pl=C((BM,zv)=>{var Nn=Bn().Buffer,Tt=require("crypto"),Iv=Pv(),Nv=require("util"),qE=`"%s" is not a valid algorithm.
23
+ `,s)}while(n!==-1);return r+=i.substr(s),r};Vh.exports={stringReplaceAll:ES,stringEncaseCRLFWithFirstIndex:kS}});var Zh=C((XT,Xh)=>{"use strict";var CS=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Gh=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,TS=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,MS=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,OS=new Map([["n",`
24
+ `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Jh(i){let e=i[0]==="u",t=i[1]==="{";return e&&!t&&i.length===5||i[0]==="x"&&i.length===3?String.fromCharCode(parseInt(i.slice(1),16)):e&&t?String.fromCodePoint(parseInt(i.slice(2,-1),16)):OS.get(i)||i}function AS(i,e){let t=[],n=e.trim().split(/\s*,\s*/g),s;for(let r of n){let o=Number(r);if(!Number.isNaN(o))t.push(o);else if(s=r.match(TS))t.push(s[2].replace(MS,(a,l,p)=>l?Jh(l):p));else throw new Error(`Invalid Chalk template style argument: ${r} (in style '${i}')`)}return t}function RS(i){Gh.lastIndex=0;let e=[],t;for(;(t=Gh.exec(i))!==null;){let n=t[1];if(t[2]){let s=AS(n,t[2]);e.push([n].concat(s))}else e.push([n])}return e}function Yh(i,e){let t={};for(let s of e)for(let r of s.styles)t[r[0]]=s.inverse?null:r.slice(1);let n=i;for(let[s,r]of Object.entries(t))if(Array.isArray(r)){if(!(s in n))throw new Error(`Unknown Chalk style: ${s}`);n=r.length>0?n[s](...r):n[s]}return n}Xh.exports=(i,e)=>{let t=[],n=[],s=[];if(e.replace(CS,(r,o,a,l,p,f)=>{if(o)s.push(Jh(o));else if(l){let m=s.join("");s=[],n.push(t.length===0?m:Yh(i,t)(m)),t.push({inverse:a,styles:RS(l)})}else if(p){if(t.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(Yh(i,t)(s.join(""))),s=[],t.pop()}else s.push(f)}),n.push(s.join("")),t.length>0){let r=`Chalk template literal is missing ${t.length} closing bracket${t.length===1?"":"s"} (\`}\`)`;throw new Error(r)}return n.join("")}});var Zc=C((ZT,sm)=>{"use strict";var ss=Wh(),{stdout:Gc,stderr:Yc}=ga(),{stringReplaceAll:PS,stringEncaseCRLFWithFirstIndex:BS}=Kh(),{isArray:Pr}=Array,em=["ansi","ansi","ansi256","ansi16m"],xn=Object.create(null),jS=(i,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=Gc?Gc.level:0;i.level=e.level===void 0?t:e.level},Jc=class{constructor(e){return tm(e)}},tm=i=>{let e={};return jS(e,i),e.template=(...t)=>nm(e.template,...t),Object.setPrototypeOf(e,Br.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=Jc,e.template};function Br(i){return tm(i)}for(let[i,e]of Object.entries(ss))xn[i]={get(){let t=jr(this,Xc(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,i,{value:t}),t}};xn.visible={get(){let i=jr(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:i}),i}};var im=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let i of im)xn[i]={get(){let{level:e}=this;return function(...t){let n=Xc(ss.color[em[e]][i](...t),ss.color.close,this._styler);return jr(this,n,this._isEmpty)}}};for(let i of im){let e="bg"+i[0].toUpperCase()+i.slice(1);xn[e]={get(){let{level:t}=this;return function(...n){let s=Xc(ss.bgColor[em[t]][i](...n),ss.bgColor.close,this._styler);return jr(this,s,this._isEmpty)}}}}var NS=Object.defineProperties(()=>{},{...xn,level:{enumerable:!0,get(){return this._generator.level},set(i){this._generator.level=i}}}),Xc=(i,e,t)=>{let n,s;return t===void 0?(n=i,s=e):(n=t.openAll+i,s=e+t.closeAll),{open:i,close:e,openAll:n,closeAll:s,parent:t}},jr=(i,e,t)=>{let n=(...s)=>Pr(s[0])&&Pr(s[0].raw)?Qh(n,nm(n,...s)):Qh(n,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(n,NS),n._generator=i,n._styler=e,n._isEmpty=t,n},Qh=(i,e)=>{if(i.level<=0||!e)return i._isEmpty?"":e;let t=i._styler;if(t===void 0)return e;let{openAll:n,closeAll:s}=t;if(e.indexOf("\x1B")!==-1)for(;t!==void 0;)e=PS(e,t.close,t.open),t=t.parent;let r=e.indexOf(`
25
+ `);return r!==-1&&(e=BS(e,s,n,r)),n+e+s},Kc,nm=(i,...e)=>{let[t]=e;if(!Pr(t)||!Pr(t.raw))return e.join(" ");let n=e.slice(1),s=[t.raw[0]];for(let r=1;r<t.length;r++)s.push(String(n[r-1]).replace(/[{}\\]/g,"\\$&"),String(t.raw[r]));return Kc===void 0&&(Kc=Zh()),Kc(i,s.join(""))};Object.defineProperties(Br.prototype,xn);var Nr=Br();Nr.supportsColor=Gc;Nr.stderr=Br({level:Yc?Yc.level:0});Nr.stderr.supportsColor=Yc;sm.exports=Nr});var Fe,Pi=yi(()=>{Fe={webrtc:{enableWebRTC:!1,enableTurn:!0,turnApiUrl:"https://9remote.cc/api/webrtc/turn-credentials",turnRefreshInterval:828e5,dcMaxMessageSize:65536,answerTimeout:1e4},robotSettings:{mouseDelay:2,keyboardDelay:2},throttling:{mouseThrottle:8,keyThrottle:25,typeTextThrottle:100,maxTextLength:1e3},resourceManagement:{inactiveTimeout:12e4,memoryCheckInterval:6e4,memoryWarningThreshold:1e3,maxTimersPerClient:100,maxChunkTimersPerClient:50},streaming:{activeInterval:80,idleInterval:400,idleThreshold:3,actionCaptureDelay:50,chunkSize:32,chunkDelay:5}}});var cm={};bi(cm,{TileManager:()=>Qc});var qr,yn,Lr,om,am,zS,$S,Qc,lm=yi(()=>{qr=L(require("sharp"),1),yn=L(require("fs"),1),Lr=L(require("path"),1),om=require("child_process"),am=require("url"),zS=(0,am.fileURLToPath)(__importMetaUrl),$S=Lr.default.dirname(zS),Qc=class{constructor(e){this.robot=e,this.tileSize=100,this.lastTileChecksums=new Map,this.screenWidth=0,this.screenHeight=0,this.tilesPerRow=0,this.tilesPerColumn=0,this.totalTiles=0,this.frameCount=0,this.tempDir=Lr.default.join($S,"../../temp"),this.compressionQuality=1,this.changeThreshold=1,this.scaleFactor=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.compressionQuality=85,yn.default.existsSync(this.tempDir)||yn.default.mkdirSync(this.tempDir,{recursive:!0}),this.initializeScreenDimensions()}initializeScreenDimensions(){try{let{width:e,height:t}=this.robot.getScreenSize();this.screenWidth=e,this.screenHeight=t,this.detectDpiScale(),this.scaledWidth=Math.floor(e*this.scaleFactor),this.scaledHeight=Math.floor(t*this.scaleFactor),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}console.log(`\u{1F5A5}\uFE0F TileManager: ${e}x${t} (DPI ${this.dpiScale}x) -> ${this.totalTiles} tiles`)}catch(e){console.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,1,1);this.dpiScale=e.byteWidth/e.bytesPerPixel}else if(this.dpiScale=1,process.platform==="win32")try{let e=(0,om.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);t>0&&t!==this.screenWidth&&(this.dpiScale=t/this.screenWidth)}catch{}this.captureWidth=Math.floor(this.screenWidth*this.dpiScale),this.captureHeight=Math.floor(this.screenHeight*this.dpiScale)}async captureFullScreen(){let e=this.robot.screen.capture(0,0,this.captureWidth,this.captureHeight),t=Buffer.from(e.image),n=new Uint32Array(t.buffer,t.byteOffset,t.length>>2);for(let p=0;p<n.length;p++){let f=n[p];n[p]=f&4278255360|(f&16711680)>>16|(f&255)<<16}let s=e.byteWidth/e.bytesPerPixel,r=e.height,o=t,a=s,l=r;if(this.dpiScale>1||this.scaleFactor<1){let p=Math.floor(this.screenWidth*this.scaleFactor),f=Math.floor(this.screenHeight*this.scaleFactor);o=await(0,qr.default)(t,{raw:{width:s,height:r,channels:e.bytesPerPixel}}).resize(p,f,{kernel:qr.default.kernel.nearest,fit:"fill"}).raw().toBuffer(),a=p,l=f}return{buffer:o,width:a,height:l,channels:e.bytesPerPixel}}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)}clearScreenCache(){}async detectChangedTiles(){return(await this.detectChangedTilesWithHashes()).tiles}async detectChangedTilesWithHashes(){if(this.isProcessing)return{tiles:[],currentHashes:Array.from(this.lastTileChecksums.values())};this.isProcessing=!0;try{let e=await this.getSharedScreenCapture(),t=[],n=[],s=new Map;this.frameCount++;for(let a=0;a<this.totalTiles;a++){let l=this.calculateTileChecksumDirect(e,a);s.set(a,l)}let r=Array.from(s.values());if(this.lastTileChecksums.size===0){let a=[];for(let p=0;p<this.totalTiles;p++)this.lastTileChecksums.set(p,s.get(p)),a.push(this.processTileAsync(e,p));let l=await Promise.all(a);return t.push(...l),{tiles:t,currentHashes:r}}for(let a=0;a<this.totalTiles;a++){let l=s.get(a),p=this.lastTileChecksums.get(a);l!==p&&(n.push(a),this.lastTileChecksums.set(a,l))}if(n.length/this.totalTiles>this.changeThreshold){let a=[];for(let p=0;p<this.totalTiles;p++)a.push(this.processTileAsync(e,p));let l=await Promise.all(a);t.push(...l.map(p=>({...p,fullRefresh:!0})))}else if(n.length>0){let a=n.map(p=>this.processTileAsync(e,p)),l=await Promise.all(a);t.push(...l)}return{tiles:t,currentHashes:r}}finally{this.isProcessing=!1}}async processTileAsync(e,t,n=null){let s=n||this.extractTile(e,t),r=await this.compressTileImage(s.buffer,s.width,s.height),{row:o,col:a}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:a*this.tileSize,y:o*this.tileSize,width:s.width,height:s.height,imageBuffer:r,timestamp:Date.now(),frameCount:this.frameCount}}calculateTileChecksumDirect(e,t){let{row:n,col:s}=this.getTilePosition(t),r=s*this.tileSize,o=n*this.tileSize,a=Math.min(r+this.tileSize,e.width),l=Math.min(o+this.tileSize,e.height),p=a-r,f=l-o,m=e.channels,_=e.width*m,E=0,k=16;for(let T=0;T<f;T+=4){let O=(o+T)*_+r*m;for(let M=0;M<p;M+=k){let A=O+M*m;E+=e.buffer[A]||0,E^=e.buffer[A+1]||0,E+=(e.buffer[A+2]||0)<<1,E^=(e.buffer[A+3]||0)<<2}}return E>>>0}getTilePosition(e){return{row:Math.floor(e/this.tilesPerRow),col:e%this.tilesPerRow}}extractTile(e,t){let{row:n,col:s}=this.getTilePosition(t),r=s*this.tileSize,o=n*this.tileSize,a=Math.min(r+this.tileSize,e.width),l=Math.min(o+this.tileSize,e.height),p=a-r,f=l-o,m=e.channels,_=p*m,E=Buffer.alloc(p*f*m);for(let k=0;k<f;k++){let T=((o+k)*e.width+r)*m,O=k*_;e.buffer.copy(E,O,T,T+_)}return{buffer:E,width:p,height:f,channels:m,tileIndex:t,x:r,y:o}}async compressTileImage(e,t,n){return(0,qr.default)(e,{raw:{width:t,height:n,channels:4}}).jpeg({quality:this.compressionQuality}).toBuffer()}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){console.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 r=new Map;for(let a=0;a<this.totalTiles;a++){let l=this.calculateTileChecksumDirect(t,a);r.set(a,l),this.lastTileChecksums.set(a,l)}if(!e||e.length===0){let a=[];for(let p=0;p<this.totalTiles;p++)a.push(this.processTileAsync(t,p));let l=await Promise.all(a);return n.push(...l),{tiles:n,currentHashes:Array.from(r.values())}}for(let a=0;a<this.totalTiles;a++)e[a]!==r.get(a)&&s.push(a);if(s.length/this.totalTiles>this.changeThreshold){let a=[];for(let p=0;p<this.totalTiles;p++)a.push(this.processTileAsync(t,p));let l=await Promise.all(a);n.push(...l.map(p=>({...p,fullRefresh:!0})))}else if(s.length>0){let a=s.map(p=>this.processTileAsync(t,p)),l=await Promise.all(a);n.push(...l)}return{tiles:n,currentHashes:Array.from(r.values()),changedIndices:s}}finally{this.isProcessing=!1}}clearMemory(){this.sharedScreenCache=null,this.lastCaptureTime=0,this.lastTileChecksums.clear()}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{yn.default.existsSync(this.tempDir)&&yn.default.readdirSync(this.tempDir).forEach(t=>yn.default.unlinkSync(Lr.default.join(this.tempDir,t)))}catch(e){console.warn("Cleanup error:",e)}}}});var um={};bi(um,{ResourceManager:()=>el});var el,pm=yi(()=>{Pi();el=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>Fe.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},Fe.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=Fe.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(r=>clearTimeout(r)),this.activeTimers.delete(e));let s=this.chunkTimers.get(e);s&&(s.forEach(r=>clearTimeout(r)),this.chunkTimers.delete(e)),t?.tileManager&&(t.tileManager.clearMemory(),t.tileManager.cleanup(),t.tileManager.reset())}catch(n){console.error(`Error cleaning up ${e}:`,n.message)}}getStreamingConfig(){return Fe.streaming}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 dm={};bi(dm,{ScreenUpdateHelper:()=>tl});var tl,fm=yi(()=>{Pi();tl=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,n,s=!1){if(!t||t.length===0)return;let r=Fe.streaming.chunkSize,o=[];for(let l=0;l<t.length;l+=r)o.push(t.slice(l,l+r));let a=this.resourceManager.getChunkTimers(e.id);for(let l=0;l<o.length;l++){let p=o[l],f=l===o.length-1,m=setTimeout(()=>{a.delete(m),e.connected&&e.emit("tiles-data",{tiles:p,timestamp:n,forceRefresh:!1,userAction:s,chunkInfo:{chunkIndex:l,totalChunks:o.length,isLastChunk:f}})},l*Fe.streaming.chunkDelay);a.add(m)}}}});var hm={};bi(hm,{MouseHandler:()=>il});var il,mm=yi(()=>{Pi();il=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 r=Date.now();if(!(r-this.lastMouseMove<Fe.throttling.mouseThrottle)){this.lastMouseMove=r;try{let o=n.getScreenSize(),a=Math.round(s.x/100*o.width),l=Math.round(s.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),f=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,f),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Mouse move error:",o.message)}}})),e.on("mouse-click",t(async s=>{try{let r=this.resourceManager.getClient(e.id);if(!r)return;let o=n.getScreenSize(),a=Math.round(s.x/100*o.width),l=Math.round(s.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),f=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,f),n.mouseClick(s.button||"left",s.double||!1),r.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Mouse click error:",r.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),l=Math.round(s.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),f=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,f),n.mouseToggle("down",s.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Mouse press error:",r.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),l=Math.round(s.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),f=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,f),n.mouseToggle("up",s.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Mouse release error:",r.message)}})),e.on("scroll",t(async s=>{try{let{direction:r,amount:o=60,horizontal:a=!1}=s,l=this.resourceManager.getClient(e.id);if(!l)return;let p=0,f=0;a||r==="left"||r==="right"?p=r==="right"?o:-o:f=r==="down"?-o:o,n.scrollMouse(p,f),l.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Scroll error:",r.message)}})),e.on("mouse-drag-select",t(s=>{try{let{startX:r,startY:o,endX:a,endY:l}=s,p=n.getScreenSize(),f=Math.round(r/100*p.width),m=Math.round(o/100*p.height),_=Math.round(a/100*p.width),E=Math.round(l/100*p.height),k=Math.max(0,Math.min(p.width-1,f)),T=Math.max(0,Math.min(p.height-1,m)),O=Math.max(0,Math.min(p.width-1,_)),M=Math.max(0,Math.min(p.height-1,E));n.moveMouse(k,T),n.mouseToggle("down","left"),n.dragMouse(O,M),n.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Drag selection error:",r.message)}}))}}});var vm={};bi(vm,{KeyboardHandler:()=>nl});var nl,gm=yi(()=>{Pi();nl=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 r=Date.now();if(!(r-this.lastKeyPress<Fe.throttling.keyThrottle)){this.lastKeyPress=r;try{if(!s.key||typeof s.key!="string")return;let o=this.resourceManager.getClient(e.id),a=s.key;if(a.length===1){n.keyTap(a,s.modifier||[]);for(let l of s.modifier||[])n.keyToggle(l,"up")}else switch(a.toLowerCase()){case"enter":case"return":n.keyTap("enter");break;case"space":n.keyTap(" ");break;case"backspace":n.keyTap("backspace");break;case"tab":n.keyTap("tab");break;case"escape":n.keyTap("escape");break;default:n.keyTap(a,s.modifier||[])}o&&(o.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Key press error:",o.message)}}})),e.on("type-text",t(s=>{let r=Date.now();if(!(r-this.lastTypeText<Fe.throttling.typeTextThrottle)){this.lastTypeText=r;try{if(!s.text||typeof s.text!="string")return;let o=s.text;o.length>Fe.throttling.maxTextLength&&(o=o.substring(0,Fe.throttling.maxTextLength));let a=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),l=this.resourceManager.getClient(e.id);setTimeout(()=>{try{n.typeString(a),this.resourceManager.updateClientActivity(e.id),l&&(l.idleFrameCount=0,l.tileManager&&l.tileManager.clearScreenCache())}catch(p){console.error("Robot typeString error:",p.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var xm={};bi(xm,{ScreenHandler:()=>sl});function WS(i){let e=Buffer.alloc(20);return e.writeUInt32LE(i.tileIndex,0),e.writeUInt32LE(i.x,4),e.writeUInt32LE(i.y,8),e.writeUInt32LE(i.width,12),e.writeUInt32LE(i.height,16),Buffer.concat([e,i.imageBuffer])}var sl,ym=yi(()=>{sl=class{constructor(e,t,n=null){this.resourceManager=e,this.screenUpdateHelper=t,this.webrtcManager=n}_sendTiles(e,t){if(this.webrtcManager?.isReady(e.id)&&t.tiles?.length>0){let n=!0;for(let s of t.tiles){let r=WS(s);if(!this.webrtcManager.sendTile(e.id,r)){n=!1;break}}if(n)return}e.emit("tiles-data",t)}setupScreenHandlers(e,t){e.on("request-screen",t(async()=>{let n=this.resourceManager.getClient(e.id);if(n)try{let s=await n.tileManager.detectChangedTiles();s.length>0&&this._sendTiles(e,{tiles:s,timestamp:Date.now()}),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Tile capture error:",s),e.emit("screen-error",{error:s.message})}})),e.on("request-screen-with-hashes",t(async n=>{let s=this.resourceManager.getClient(e.id);if(s)try{let r=n.tileHashes||[],o=await s.tileManager.compareClientTileHashes(r);o?.tiles?.length>0?this._sendTiles(e,{tiles:o.tiles,timestamp:Date.now(),currentHashes:o.currentHashes,changedIndices:o.changedIndices}):e.emit("tiles-data",{tiles:[],timestamp:Date.now(),currentHashes:o.currentHashes,changedIndices:[]}),this.resourceManager.updateClientActivity(e.id)}catch(r){console.error("Tile capture with hashes error:",r),e.emit("screen-error",{error:r.message})}})),e.on("start-streaming",t(()=>{let n=this.resourceManager.getClient(e.id);if(!n)return;n.streamingTimeout&&(clearTimeout(n.streamingTimeout),n.streamingTimeout=null),console.log("\u{1F680} Remote streaming started"),n.idleFrameCount=0,n.isStreaming=!0;let s=async()=>{if(!e.connected||!n.isStreaming){n.streamingTimeout=null;return}try{let r=performance.now(),o=await n.tileManager.detectChangedTilesWithHashes();o.tiles.length>0&&e.connected?(this._sendTiles(e,{tiles:o.tiles,timestamp:Date.now(),currentHashes:o.currentHashes}),n.idleFrameCount=0):n.idleFrameCount++;let{activeInterval:l,idleInterval:p,idleThreshold:f}=this.resourceManager.getStreamingConfig(),m=n.idleFrameCount>=f?p:l,_=Math.max(0,m-(performance.now()-r));n.streamingTimeout=setTimeout(s,_)}catch(r){console.error("Auto streaming error:",r),n.streamingTimeout=setTimeout(s,200)}};s()})),e.on("stop-streaming",()=>{let n=this.resourceManager.getClient(e.id);n&&(n.isStreaming=!1,n.streamingTimeout&&(clearTimeout(n.streamingTimeout),n.streamingTimeout=null),console.log("\u23F9\uFE0F Remote streaming stopped"))}),e.on("get-screen-dimensions",t(async()=>{let n=this.resourceManager.getClient(e.id);if(n)try{let s=await n.tileManager.getScreenDimensions();e.emit("screen-dimensions",s)}catch(s){console.error("Get dimensions error:",s),e.emit("screen-error",{error:s.message})}})),e.on("boost-stream",t(()=>{let n=this.resourceManager.getClient(e.id);n&&(n.idleFrameCount=0)}))}}});var ul=C((Fm,ll)=>{(function(i,e){"use strict";function t(b,c){if(!b)throw new Error(c||"Assertion failed")}function n(b,c){b.super_=c;var d=function(){};d.prototype=c.prototype,b.prototype=new d,b.prototype.constructor=b}function s(b,c,d){if(s.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((c==="le"||c==="be")&&(d=c,c=10),this._init(b||0,c||10,d||"be"))}typeof i=="object"?i.exports=s:e.BN=s,s.BN=s,s.wordSize=26;var r;try{typeof window<"u"&&typeof window.Buffer<"u"?r=window.Buffer:r=require("buffer").Buffer}catch{}s.isBN=function(c){return c instanceof s?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===s.wordSize&&Array.isArray(c.words)},s.max=function(c,d){return c.cmp(d)>0?c:d},s.min=function(c,d){return c.cmp(d)<0?c:d},s.prototype._init=function(c,d,h){if(typeof c=="number")return this._initNumber(c,d,h);if(typeof c=="object")return this._initArray(c,d,h);d==="hex"&&(d=16),t(d===(d|0)&&d>=2&&d<=36),c=c.toString().replace(/\s+/g,"");var v=0;c[0]==="-"&&(v++,this.negative=1),v<c.length&&(d===16?this._parseHex(c,v,h):(this._parseBase(c,d,v),h==="le"&&this._initArray(this.toArray(),d,h)))},s.prototype._initNumber=function(c,d,h){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(t(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),d,h)},s.prototype._initArray=function(c,d,h){if(t(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var y,w,S=0;if(h==="be")for(v=c.length-1,y=0;v>=0;v-=3)w=c[v]|c[v-1]<<8|c[v-2]<<16,this.words[y]|=w<<S&67108863,this.words[y+1]=w>>>26-S&67108863,S+=24,S>=26&&(S-=26,y++);else if(h==="le")for(v=0,y=0;v<c.length;v+=3)w=c[v]|c[v+1]<<8|c[v+2]<<16,this.words[y]|=w<<S&67108863,this.words[y+1]=w>>>26-S&67108863,S+=24,S>=26&&(S-=26,y++);return this.strip()};function o(b,c){var d=b.charCodeAt(c);return d>=65&&d<=70?d-55:d>=97&&d<=102?d-87:d-48&15}function a(b,c,d){var h=o(b,d);return d-1>=c&&(h|=o(b,d-1)<<4),h}s.prototype._parseHex=function(c,d,h){this.length=Math.ceil((c.length-d)/6),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var y=0,w=0,S;if(h==="be")for(v=c.length-1;v>=d;v-=2)S=a(c,d,v)<<y,this.words[w]|=S&67108863,y>=18?(y-=18,w+=1,this.words[w]|=S>>>26):y+=8;else{var g=c.length-d;for(v=g%2===0?d+1:d;v<c.length;v+=2)S=a(c,d,v)<<y,this.words[w]|=S&67108863,y>=18?(y-=18,w+=1,this.words[w]|=S>>>26):y+=8}this.strip()};function l(b,c,d,h){for(var v=0,y=Math.min(b.length,d),w=c;w<y;w++){var S=b.charCodeAt(w)-48;v*=h,S>=49?v+=S-49+10:S>=17?v+=S-17+10:v+=S}return v}s.prototype._parseBase=function(c,d,h){this.words=[0],this.length=1;for(var v=0,y=1;y<=67108863;y*=d)v++;v--,y=y/d|0;for(var w=c.length-h,S=w%v,g=Math.min(w,w-S)+h,u=0,x=h;x<g;x+=v)u=l(c,x,x+v,d),this.imuln(y),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(S!==0){var P=1;for(u=l(c,x,c.length,d),x=0;x<S;x++)P*=d;this.imuln(P),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},s.prototype.copy=function(c){c.words=new Array(this.length);for(var d=0;d<this.length;d++)c.words[d]=this.words[d];c.length=this.length,c.negative=this.negative,c.red=this.red},s.prototype.clone=function(){var c=new s(null);return this.copy(c),c},s.prototype._expand=function(c){for(;this.length<c;)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 p=["","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"],f=[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],m=[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(c,d){c=c||10,d=d|0||1;var h;if(c===16||c==="hex"){h="";for(var v=0,y=0,w=0;w<this.length;w++){var S=this.words[w],g=((S<<v|y)&16777215).toString(16);y=S>>>24-v&16777215,v+=2,v>=26&&(v-=26,w--),y!==0||w!==this.length-1?h=p[6-g.length]+g+h:h=g+h}for(y!==0&&(h=y.toString(16)+h);h.length%d!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(c===(c|0)&&c>=2&&c<=36){var u=f[c],x=m[c];h="";var P=this.clone();for(P.negative=0;!P.isZero();){var B=P.modn(x).toString(c);P=P.idivn(x),P.isZero()?h=B+h:h=p[u-B.length]+B+h}for(this.isZero()&&(h="0"+h);h.length%d!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}t(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(c,d){return t(typeof r<"u"),this.toArrayLike(r,c,d)},s.prototype.toArray=function(c,d){return this.toArrayLike(Array,c,d)},s.prototype.toArrayLike=function(c,d,h){var v=this.byteLength(),y=h||Math.max(1,v);t(v<=y,"byte array longer than desired length"),t(y>0,"Requested array length <= 0"),this.strip();var w=d==="le",S=new c(y),g,u,x=this.clone();if(w){for(u=0;!x.isZero();u++)g=x.andln(255),x.iushrn(8),S[u]=g;for(;u<y;u++)S[u]=0}else{for(u=0;u<y-v;u++)S[u]=0;for(u=0;!x.isZero();u++)g=x.andln(255),x.iushrn(8),S[y-u-1]=g}return S},Math.clz32?s.prototype._countBits=function(c){return 32-Math.clz32(c)}:s.prototype._countBits=function(c){var d=c,h=0;return d>=4096&&(h+=13,d>>>=13),d>=64&&(h+=7,d>>>=7),d>=8&&(h+=4,d>>>=4),d>=2&&(h+=2,d>>>=2),h+d},s.prototype._zeroBits=function(c){if(c===0)return 26;var d=c,h=0;return(d&8191)===0&&(h+=13,d>>>=13),(d&127)===0&&(h+=7,d>>>=7),(d&15)===0&&(h+=4,d>>>=4),(d&3)===0&&(h+=2,d>>>=2),(d&1)===0&&h++,h},s.prototype.bitLength=function(){var c=this.words[this.length-1],d=this._countBits(c);return(this.length-1)*26+d};function _(b){for(var c=new Array(b.bitLength()),d=0;d<c.length;d++){var h=d/26|0,v=d%26;c[d]=(b.words[h]&1<<v)>>>v}return c}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var c=0,d=0;d<this.length;d++){var h=this._zeroBits(this.words[d]);if(c+=h,h!==26)break}return c},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},s.prototype.fromTwos=function(c){return this.testn(c-1)?this.notn(c).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(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var d=0;d<c.length;d++)this.words[d]=this.words[d]|c.words[d];return this.strip()},s.prototype.ior=function(c){return t((this.negative|c.negative)===0),this.iuor(c)},s.prototype.or=function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},s.prototype.uor=function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},s.prototype.iuand=function(c){var d;this.length>c.length?d=c:d=this;for(var h=0;h<d.length;h++)this.words[h]=this.words[h]&c.words[h];return this.length=d.length,this.strip()},s.prototype.iand=function(c){return t((this.negative|c.negative)===0),this.iuand(c)},s.prototype.and=function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},s.prototype.uand=function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},s.prototype.iuxor=function(c){var d,h;this.length>c.length?(d=this,h=c):(d=c,h=this);for(var v=0;v<h.length;v++)this.words[v]=d.words[v]^h.words[v];if(this!==d)for(;v<d.length;v++)this.words[v]=d.words[v];return this.length=d.length,this.strip()},s.prototype.ixor=function(c){return t((this.negative|c.negative)===0),this.iuxor(c)},s.prototype.xor=function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},s.prototype.uxor=function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},s.prototype.inotn=function(c){t(typeof c=="number"&&c>=0);var d=Math.ceil(c/26)|0,h=c%26;this._expand(d),h>0&&d--;for(var v=0;v<d;v++)this.words[v]=~this.words[v]&67108863;return h>0&&(this.words[v]=~this.words[v]&67108863>>26-h),this.strip()},s.prototype.notn=function(c){return this.clone().inotn(c)},s.prototype.setn=function(c,d){t(typeof c=="number"&&c>=0);var h=c/26|0,v=c%26;return this._expand(h+1),d?this.words[h]=this.words[h]|1<<v:this.words[h]=this.words[h]&~(1<<v),this.strip()},s.prototype.iadd=function(c){var d;if(this.negative!==0&&c.negative===0)return this.negative=0,d=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,d=this.isub(c),c.negative=1,d._normSign();var h,v;this.length>c.length?(h=this,v=c):(h=c,v=this);for(var y=0,w=0;w<v.length;w++)d=(h.words[w]|0)+(v.words[w]|0)+y,this.words[w]=d&67108863,y=d>>>26;for(;y!==0&&w<h.length;w++)d=(h.words[w]|0)+y,this.words[w]=d&67108863,y=d>>>26;if(this.length=h.length,y!==0)this.words[this.length]=y,this.length++;else if(h!==this)for(;w<h.length;w++)this.words[w]=h.words[w];return this},s.prototype.add=function(c){var d;return c.negative!==0&&this.negative===0?(c.negative=0,d=this.sub(c),c.negative^=1,d):c.negative===0&&this.negative!==0?(this.negative=0,d=c.sub(this),this.negative=1,d):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},s.prototype.isub=function(c){if(c.negative!==0){c.negative=0;var d=this.iadd(c);return c.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var h=this.cmp(c);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var v,y;h>0?(v=this,y=c):(v=c,y=this);for(var w=0,S=0;S<y.length;S++)d=(v.words[S]|0)-(y.words[S]|0)+w,w=d>>26,this.words[S]=d&67108863;for(;w!==0&&S<v.length;S++)d=(v.words[S]|0)+w,w=d>>26,this.words[S]=d&67108863;if(w===0&&S<v.length&&v!==this)for(;S<v.length;S++)this.words[S]=v.words[S];return this.length=Math.max(this.length,S),v!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(c){return this.clone().isub(c)};function E(b,c,d){d.negative=c.negative^b.negative;var h=b.length+c.length|0;d.length=h,h=h-1|0;var v=b.words[0]|0,y=c.words[0]|0,w=v*y,S=w&67108863,g=w/67108864|0;d.words[0]=S;for(var u=1;u<h;u++){for(var x=g>>>26,P=g&67108863,B=Math.min(u,c.length-1),j=Math.max(0,u-b.length+1);j<=B;j++){var I=u-j|0;v=b.words[I]|0,y=c.words[j]|0,w=v*y+P,x+=w/67108864|0,P=w&67108863}d.words[u]=P|0,g=x|0}return g!==0?d.words[u]=g|0:d.length--,d.strip()}var k=function(c,d,h){var v=c.words,y=d.words,w=h.words,S=0,g,u,x,P=v[0]|0,B=P&8191,j=P>>>13,I=v[1]|0,z=I&8191,G=I>>>13,si=v[2]|0,Y=si&8191,Z=si>>>13,xu=v[3]|0,oe=xu&8191,ae=xu>>>13,yu=v[4]|0,ce=yu&8191,le=yu>>>13,bu=v[5]|0,ue=bu&8191,pe=bu>>>13,wu=v[6]|0,de=wu&8191,fe=wu>>>13,_u=v[7]|0,he=_u&8191,me=_u>>>13,Su=v[8]|0,ve=Su&8191,ge=Su>>>13,Eu=v[9]|0,xe=Eu&8191,ye=Eu>>>13,ku=y[0]|0,be=ku&8191,we=ku>>>13,Cu=y[1]|0,_e=Cu&8191,Se=Cu>>>13,Tu=y[2]|0,Ee=Tu&8191,ke=Tu>>>13,Mu=y[3]|0,Ce=Mu&8191,Te=Mu>>>13,Ou=y[4]|0,Me=Ou&8191,Oe=Ou>>>13,Au=y[5]|0,Ae=Au&8191,Re=Au>>>13,Ru=y[6]|0,Pe=Ru&8191,Be=Ru>>>13,Pu=y[7]|0,je=Pu&8191,Ne=Pu>>>13,Bu=y[8]|0,De=Bu&8191,Ie=Bu>>>13,ju=y[9]|0,qe=ju&8191,Le=ju>>>13;h.negative=c.negative^d.negative,h.length=19,g=Math.imul(B,be),u=Math.imul(B,we),u=u+Math.imul(j,be)|0,x=Math.imul(j,we);var jo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(jo>>>26)|0,jo&=67108863,g=Math.imul(z,be),u=Math.imul(z,we),u=u+Math.imul(G,be)|0,x=Math.imul(G,we),g=g+Math.imul(B,_e)|0,u=u+Math.imul(B,Se)|0,u=u+Math.imul(j,_e)|0,x=x+Math.imul(j,Se)|0;var No=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(No>>>26)|0,No&=67108863,g=Math.imul(Y,be),u=Math.imul(Y,we),u=u+Math.imul(Z,be)|0,x=Math.imul(Z,we),g=g+Math.imul(z,_e)|0,u=u+Math.imul(z,Se)|0,u=u+Math.imul(G,_e)|0,x=x+Math.imul(G,Se)|0,g=g+Math.imul(B,Ee)|0,u=u+Math.imul(B,ke)|0,u=u+Math.imul(j,Ee)|0,x=x+Math.imul(j,ke)|0;var Do=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Do>>>26)|0,Do&=67108863,g=Math.imul(oe,be),u=Math.imul(oe,we),u=u+Math.imul(ae,be)|0,x=Math.imul(ae,we),g=g+Math.imul(Y,_e)|0,u=u+Math.imul(Y,Se)|0,u=u+Math.imul(Z,_e)|0,x=x+Math.imul(Z,Se)|0,g=g+Math.imul(z,Ee)|0,u=u+Math.imul(z,ke)|0,u=u+Math.imul(G,Ee)|0,x=x+Math.imul(G,ke)|0,g=g+Math.imul(B,Ce)|0,u=u+Math.imul(B,Te)|0,u=u+Math.imul(j,Ce)|0,x=x+Math.imul(j,Te)|0;var Io=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Io>>>26)|0,Io&=67108863,g=Math.imul(ce,be),u=Math.imul(ce,we),u=u+Math.imul(le,be)|0,x=Math.imul(le,we),g=g+Math.imul(oe,_e)|0,u=u+Math.imul(oe,Se)|0,u=u+Math.imul(ae,_e)|0,x=x+Math.imul(ae,Se)|0,g=g+Math.imul(Y,Ee)|0,u=u+Math.imul(Y,ke)|0,u=u+Math.imul(Z,Ee)|0,x=x+Math.imul(Z,ke)|0,g=g+Math.imul(z,Ce)|0,u=u+Math.imul(z,Te)|0,u=u+Math.imul(G,Ce)|0,x=x+Math.imul(G,Te)|0,g=g+Math.imul(B,Me)|0,u=u+Math.imul(B,Oe)|0,u=u+Math.imul(j,Me)|0,x=x+Math.imul(j,Oe)|0;var qo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(qo>>>26)|0,qo&=67108863,g=Math.imul(ue,be),u=Math.imul(ue,we),u=u+Math.imul(pe,be)|0,x=Math.imul(pe,we),g=g+Math.imul(ce,_e)|0,u=u+Math.imul(ce,Se)|0,u=u+Math.imul(le,_e)|0,x=x+Math.imul(le,Se)|0,g=g+Math.imul(oe,Ee)|0,u=u+Math.imul(oe,ke)|0,u=u+Math.imul(ae,Ee)|0,x=x+Math.imul(ae,ke)|0,g=g+Math.imul(Y,Ce)|0,u=u+Math.imul(Y,Te)|0,u=u+Math.imul(Z,Ce)|0,x=x+Math.imul(Z,Te)|0,g=g+Math.imul(z,Me)|0,u=u+Math.imul(z,Oe)|0,u=u+Math.imul(G,Me)|0,x=x+Math.imul(G,Oe)|0,g=g+Math.imul(B,Ae)|0,u=u+Math.imul(B,Re)|0,u=u+Math.imul(j,Ae)|0,x=x+Math.imul(j,Re)|0;var Lo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,g=Math.imul(de,be),u=Math.imul(de,we),u=u+Math.imul(fe,be)|0,x=Math.imul(fe,we),g=g+Math.imul(ue,_e)|0,u=u+Math.imul(ue,Se)|0,u=u+Math.imul(pe,_e)|0,x=x+Math.imul(pe,Se)|0,g=g+Math.imul(ce,Ee)|0,u=u+Math.imul(ce,ke)|0,u=u+Math.imul(le,Ee)|0,x=x+Math.imul(le,ke)|0,g=g+Math.imul(oe,Ce)|0,u=u+Math.imul(oe,Te)|0,u=u+Math.imul(ae,Ce)|0,x=x+Math.imul(ae,Te)|0,g=g+Math.imul(Y,Me)|0,u=u+Math.imul(Y,Oe)|0,u=u+Math.imul(Z,Me)|0,x=x+Math.imul(Z,Oe)|0,g=g+Math.imul(z,Ae)|0,u=u+Math.imul(z,Re)|0,u=u+Math.imul(G,Ae)|0,x=x+Math.imul(G,Re)|0,g=g+Math.imul(B,Pe)|0,u=u+Math.imul(B,Be)|0,u=u+Math.imul(j,Pe)|0,x=x+Math.imul(j,Be)|0;var Fo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Fo>>>26)|0,Fo&=67108863,g=Math.imul(he,be),u=Math.imul(he,we),u=u+Math.imul(me,be)|0,x=Math.imul(me,we),g=g+Math.imul(de,_e)|0,u=u+Math.imul(de,Se)|0,u=u+Math.imul(fe,_e)|0,x=x+Math.imul(fe,Se)|0,g=g+Math.imul(ue,Ee)|0,u=u+Math.imul(ue,ke)|0,u=u+Math.imul(pe,Ee)|0,x=x+Math.imul(pe,ke)|0,g=g+Math.imul(ce,Ce)|0,u=u+Math.imul(ce,Te)|0,u=u+Math.imul(le,Ce)|0,x=x+Math.imul(le,Te)|0,g=g+Math.imul(oe,Me)|0,u=u+Math.imul(oe,Oe)|0,u=u+Math.imul(ae,Me)|0,x=x+Math.imul(ae,Oe)|0,g=g+Math.imul(Y,Ae)|0,u=u+Math.imul(Y,Re)|0,u=u+Math.imul(Z,Ae)|0,x=x+Math.imul(Z,Re)|0,g=g+Math.imul(z,Pe)|0,u=u+Math.imul(z,Be)|0,u=u+Math.imul(G,Pe)|0,x=x+Math.imul(G,Be)|0,g=g+Math.imul(B,je)|0,u=u+Math.imul(B,Ne)|0,u=u+Math.imul(j,je)|0,x=x+Math.imul(j,Ne)|0;var Uo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Uo>>>26)|0,Uo&=67108863,g=Math.imul(ve,be),u=Math.imul(ve,we),u=u+Math.imul(ge,be)|0,x=Math.imul(ge,we),g=g+Math.imul(he,_e)|0,u=u+Math.imul(he,Se)|0,u=u+Math.imul(me,_e)|0,x=x+Math.imul(me,Se)|0,g=g+Math.imul(de,Ee)|0,u=u+Math.imul(de,ke)|0,u=u+Math.imul(fe,Ee)|0,x=x+Math.imul(fe,ke)|0,g=g+Math.imul(ue,Ce)|0,u=u+Math.imul(ue,Te)|0,u=u+Math.imul(pe,Ce)|0,x=x+Math.imul(pe,Te)|0,g=g+Math.imul(ce,Me)|0,u=u+Math.imul(ce,Oe)|0,u=u+Math.imul(le,Me)|0,x=x+Math.imul(le,Oe)|0,g=g+Math.imul(oe,Ae)|0,u=u+Math.imul(oe,Re)|0,u=u+Math.imul(ae,Ae)|0,x=x+Math.imul(ae,Re)|0,g=g+Math.imul(Y,Pe)|0,u=u+Math.imul(Y,Be)|0,u=u+Math.imul(Z,Pe)|0,x=x+Math.imul(Z,Be)|0,g=g+Math.imul(z,je)|0,u=u+Math.imul(z,Ne)|0,u=u+Math.imul(G,je)|0,x=x+Math.imul(G,Ne)|0,g=g+Math.imul(B,De)|0,u=u+Math.imul(B,Ie)|0,u=u+Math.imul(j,De)|0,x=x+Math.imul(j,Ie)|0;var Ho=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Ho>>>26)|0,Ho&=67108863,g=Math.imul(xe,be),u=Math.imul(xe,we),u=u+Math.imul(ye,be)|0,x=Math.imul(ye,we),g=g+Math.imul(ve,_e)|0,u=u+Math.imul(ve,Se)|0,u=u+Math.imul(ge,_e)|0,x=x+Math.imul(ge,Se)|0,g=g+Math.imul(he,Ee)|0,u=u+Math.imul(he,ke)|0,u=u+Math.imul(me,Ee)|0,x=x+Math.imul(me,ke)|0,g=g+Math.imul(de,Ce)|0,u=u+Math.imul(de,Te)|0,u=u+Math.imul(fe,Ce)|0,x=x+Math.imul(fe,Te)|0,g=g+Math.imul(ue,Me)|0,u=u+Math.imul(ue,Oe)|0,u=u+Math.imul(pe,Me)|0,x=x+Math.imul(pe,Oe)|0,g=g+Math.imul(ce,Ae)|0,u=u+Math.imul(ce,Re)|0,u=u+Math.imul(le,Ae)|0,x=x+Math.imul(le,Re)|0,g=g+Math.imul(oe,Pe)|0,u=u+Math.imul(oe,Be)|0,u=u+Math.imul(ae,Pe)|0,x=x+Math.imul(ae,Be)|0,g=g+Math.imul(Y,je)|0,u=u+Math.imul(Y,Ne)|0,u=u+Math.imul(Z,je)|0,x=x+Math.imul(Z,Ne)|0,g=g+Math.imul(z,De)|0,u=u+Math.imul(z,Ie)|0,u=u+Math.imul(G,De)|0,x=x+Math.imul(G,Ie)|0,g=g+Math.imul(B,qe)|0,u=u+Math.imul(B,Le)|0,u=u+Math.imul(j,qe)|0,x=x+Math.imul(j,Le)|0;var zo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(zo>>>26)|0,zo&=67108863,g=Math.imul(xe,_e),u=Math.imul(xe,Se),u=u+Math.imul(ye,_e)|0,x=Math.imul(ye,Se),g=g+Math.imul(ve,Ee)|0,u=u+Math.imul(ve,ke)|0,u=u+Math.imul(ge,Ee)|0,x=x+Math.imul(ge,ke)|0,g=g+Math.imul(he,Ce)|0,u=u+Math.imul(he,Te)|0,u=u+Math.imul(me,Ce)|0,x=x+Math.imul(me,Te)|0,g=g+Math.imul(de,Me)|0,u=u+Math.imul(de,Oe)|0,u=u+Math.imul(fe,Me)|0,x=x+Math.imul(fe,Oe)|0,g=g+Math.imul(ue,Ae)|0,u=u+Math.imul(ue,Re)|0,u=u+Math.imul(pe,Ae)|0,x=x+Math.imul(pe,Re)|0,g=g+Math.imul(ce,Pe)|0,u=u+Math.imul(ce,Be)|0,u=u+Math.imul(le,Pe)|0,x=x+Math.imul(le,Be)|0,g=g+Math.imul(oe,je)|0,u=u+Math.imul(oe,Ne)|0,u=u+Math.imul(ae,je)|0,x=x+Math.imul(ae,Ne)|0,g=g+Math.imul(Y,De)|0,u=u+Math.imul(Y,Ie)|0,u=u+Math.imul(Z,De)|0,x=x+Math.imul(Z,Ie)|0,g=g+Math.imul(z,qe)|0,u=u+Math.imul(z,Le)|0,u=u+Math.imul(G,qe)|0,x=x+Math.imul(G,Le)|0;var $o=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+($o>>>26)|0,$o&=67108863,g=Math.imul(xe,Ee),u=Math.imul(xe,ke),u=u+Math.imul(ye,Ee)|0,x=Math.imul(ye,ke),g=g+Math.imul(ve,Ce)|0,u=u+Math.imul(ve,Te)|0,u=u+Math.imul(ge,Ce)|0,x=x+Math.imul(ge,Te)|0,g=g+Math.imul(he,Me)|0,u=u+Math.imul(he,Oe)|0,u=u+Math.imul(me,Me)|0,x=x+Math.imul(me,Oe)|0,g=g+Math.imul(de,Ae)|0,u=u+Math.imul(de,Re)|0,u=u+Math.imul(fe,Ae)|0,x=x+Math.imul(fe,Re)|0,g=g+Math.imul(ue,Pe)|0,u=u+Math.imul(ue,Be)|0,u=u+Math.imul(pe,Pe)|0,x=x+Math.imul(pe,Be)|0,g=g+Math.imul(ce,je)|0,u=u+Math.imul(ce,Ne)|0,u=u+Math.imul(le,je)|0,x=x+Math.imul(le,Ne)|0,g=g+Math.imul(oe,De)|0,u=u+Math.imul(oe,Ie)|0,u=u+Math.imul(ae,De)|0,x=x+Math.imul(ae,Ie)|0,g=g+Math.imul(Y,qe)|0,u=u+Math.imul(Y,Le)|0,u=u+Math.imul(Z,qe)|0,x=x+Math.imul(Z,Le)|0;var Wo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Wo>>>26)|0,Wo&=67108863,g=Math.imul(xe,Ce),u=Math.imul(xe,Te),u=u+Math.imul(ye,Ce)|0,x=Math.imul(ye,Te),g=g+Math.imul(ve,Me)|0,u=u+Math.imul(ve,Oe)|0,u=u+Math.imul(ge,Me)|0,x=x+Math.imul(ge,Oe)|0,g=g+Math.imul(he,Ae)|0,u=u+Math.imul(he,Re)|0,u=u+Math.imul(me,Ae)|0,x=x+Math.imul(me,Re)|0,g=g+Math.imul(de,Pe)|0,u=u+Math.imul(de,Be)|0,u=u+Math.imul(fe,Pe)|0,x=x+Math.imul(fe,Be)|0,g=g+Math.imul(ue,je)|0,u=u+Math.imul(ue,Ne)|0,u=u+Math.imul(pe,je)|0,x=x+Math.imul(pe,Ne)|0,g=g+Math.imul(ce,De)|0,u=u+Math.imul(ce,Ie)|0,u=u+Math.imul(le,De)|0,x=x+Math.imul(le,Ie)|0,g=g+Math.imul(oe,qe)|0,u=u+Math.imul(oe,Le)|0,u=u+Math.imul(ae,qe)|0,x=x+Math.imul(ae,Le)|0;var Vo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Vo>>>26)|0,Vo&=67108863,g=Math.imul(xe,Me),u=Math.imul(xe,Oe),u=u+Math.imul(ye,Me)|0,x=Math.imul(ye,Oe),g=g+Math.imul(ve,Ae)|0,u=u+Math.imul(ve,Re)|0,u=u+Math.imul(ge,Ae)|0,x=x+Math.imul(ge,Re)|0,g=g+Math.imul(he,Pe)|0,u=u+Math.imul(he,Be)|0,u=u+Math.imul(me,Pe)|0,x=x+Math.imul(me,Be)|0,g=g+Math.imul(de,je)|0,u=u+Math.imul(de,Ne)|0,u=u+Math.imul(fe,je)|0,x=x+Math.imul(fe,Ne)|0,g=g+Math.imul(ue,De)|0,u=u+Math.imul(ue,Ie)|0,u=u+Math.imul(pe,De)|0,x=x+Math.imul(pe,Ie)|0,g=g+Math.imul(ce,qe)|0,u=u+Math.imul(ce,Le)|0,u=u+Math.imul(le,qe)|0,x=x+Math.imul(le,Le)|0;var Ko=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Ko>>>26)|0,Ko&=67108863,g=Math.imul(xe,Ae),u=Math.imul(xe,Re),u=u+Math.imul(ye,Ae)|0,x=Math.imul(ye,Re),g=g+Math.imul(ve,Pe)|0,u=u+Math.imul(ve,Be)|0,u=u+Math.imul(ge,Pe)|0,x=x+Math.imul(ge,Be)|0,g=g+Math.imul(he,je)|0,u=u+Math.imul(he,Ne)|0,u=u+Math.imul(me,je)|0,x=x+Math.imul(me,Ne)|0,g=g+Math.imul(de,De)|0,u=u+Math.imul(de,Ie)|0,u=u+Math.imul(fe,De)|0,x=x+Math.imul(fe,Ie)|0,g=g+Math.imul(ue,qe)|0,u=u+Math.imul(ue,Le)|0,u=u+Math.imul(pe,qe)|0,x=x+Math.imul(pe,Le)|0;var Go=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Go>>>26)|0,Go&=67108863,g=Math.imul(xe,Pe),u=Math.imul(xe,Be),u=u+Math.imul(ye,Pe)|0,x=Math.imul(ye,Be),g=g+Math.imul(ve,je)|0,u=u+Math.imul(ve,Ne)|0,u=u+Math.imul(ge,je)|0,x=x+Math.imul(ge,Ne)|0,g=g+Math.imul(he,De)|0,u=u+Math.imul(he,Ie)|0,u=u+Math.imul(me,De)|0,x=x+Math.imul(me,Ie)|0,g=g+Math.imul(de,qe)|0,u=u+Math.imul(de,Le)|0,u=u+Math.imul(fe,qe)|0,x=x+Math.imul(fe,Le)|0;var Yo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Yo>>>26)|0,Yo&=67108863,g=Math.imul(xe,je),u=Math.imul(xe,Ne),u=u+Math.imul(ye,je)|0,x=Math.imul(ye,Ne),g=g+Math.imul(ve,De)|0,u=u+Math.imul(ve,Ie)|0,u=u+Math.imul(ge,De)|0,x=x+Math.imul(ge,Ie)|0,g=g+Math.imul(he,qe)|0,u=u+Math.imul(he,Le)|0,u=u+Math.imul(me,qe)|0,x=x+Math.imul(me,Le)|0;var Jo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Jo>>>26)|0,Jo&=67108863,g=Math.imul(xe,De),u=Math.imul(xe,Ie),u=u+Math.imul(ye,De)|0,x=Math.imul(ye,Ie),g=g+Math.imul(ve,qe)|0,u=u+Math.imul(ve,Le)|0,u=u+Math.imul(ge,qe)|0,x=x+Math.imul(ge,Le)|0;var Xo=(S+g|0)+((u&8191)<<13)|0;S=(x+(u>>>13)|0)+(Xo>>>26)|0,Xo&=67108863,g=Math.imul(xe,qe),u=Math.imul(xe,Le),u=u+Math.imul(ye,qe)|0,x=Math.imul(ye,Le);var Zo=(S+g|0)+((u&8191)<<13)|0;return S=(x+(u>>>13)|0)+(Zo>>>26)|0,Zo&=67108863,w[0]=jo,w[1]=No,w[2]=Do,w[3]=Io,w[4]=qo,w[5]=Lo,w[6]=Fo,w[7]=Uo,w[8]=Ho,w[9]=zo,w[10]=$o,w[11]=Wo,w[12]=Vo,w[13]=Ko,w[14]=Go,w[15]=Yo,w[16]=Jo,w[17]=Xo,w[18]=Zo,S!==0&&(w[19]=S,h.length++),h};Math.imul||(k=E);function T(b,c,d){d.negative=c.negative^b.negative,d.length=b.length+c.length;for(var h=0,v=0,y=0;y<d.length-1;y++){var w=v;v=0;for(var S=h&67108863,g=Math.min(y,c.length-1),u=Math.max(0,y-b.length+1);u<=g;u++){var x=y-u,P=b.words[x]|0,B=c.words[u]|0,j=P*B,I=j&67108863;w=w+(j/67108864|0)|0,I=I+S|0,S=I&67108863,w=w+(I>>>26)|0,v+=w>>>26,w&=67108863}d.words[y]=S,h=w,w=v}return h!==0?d.words[y]=h:d.length--,d.strip()}function O(b,c,d){var h=new M;return h.mulp(b,c,d)}s.prototype.mulTo=function(c,d){var h,v=this.length+c.length;return this.length===10&&c.length===10?h=k(this,c,d):v<63?h=E(this,c,d):v<1024?h=T(this,c,d):h=O(this,c,d),h};function M(b,c){this.x=b,this.y=c}M.prototype.makeRBT=function(c){for(var d=new Array(c),h=s.prototype._countBits(c)-1,v=0;v<c;v++)d[v]=this.revBin(v,h,c);return d},M.prototype.revBin=function(c,d,h){if(c===0||c===h-1)return c;for(var v=0,y=0;y<d;y++)v|=(c&1)<<d-y-1,c>>=1;return v},M.prototype.permute=function(c,d,h,v,y,w){for(var S=0;S<w;S++)v[S]=d[c[S]],y[S]=h[c[S]]},M.prototype.transform=function(c,d,h,v,y,w){this.permute(w,c,d,h,v,y);for(var S=1;S<y;S<<=1)for(var g=S<<1,u=Math.cos(2*Math.PI/g),x=Math.sin(2*Math.PI/g),P=0;P<y;P+=g)for(var B=u,j=x,I=0;I<S;I++){var z=h[P+I],G=v[P+I],si=h[P+I+S],Y=v[P+I+S],Z=B*si-j*Y;Y=B*Y+j*si,si=Z,h[P+I]=z+si,v[P+I]=G+Y,h[P+I+S]=z-si,v[P+I+S]=G-Y,I!==g&&(Z=u*B-x*j,j=u*j+x*B,B=Z)}},M.prototype.guessLen13b=function(c,d){var h=Math.max(d,c)|1,v=h&1,y=0;for(h=h/2|0;h;h=h>>>1)y++;return 1<<y+1+v},M.prototype.conjugate=function(c,d,h){if(!(h<=1))for(var v=0;v<h/2;v++){var y=c[v];c[v]=c[h-v-1],c[h-v-1]=y,y=d[v],d[v]=-d[h-v-1],d[h-v-1]=-y}},M.prototype.normalize13b=function(c,d){for(var h=0,v=0;v<d/2;v++){var y=Math.round(c[2*v+1]/d)*8192+Math.round(c[2*v]/d)+h;c[v]=y&67108863,y<67108864?h=0:h=y/67108864|0}return c},M.prototype.convert13b=function(c,d,h,v){for(var y=0,w=0;w<d;w++)y=y+(c[w]|0),h[2*w]=y&8191,y=y>>>13,h[2*w+1]=y&8191,y=y>>>13;for(w=2*d;w<v;++w)h[w]=0;t(y===0),t((y&-8192)===0)},M.prototype.stub=function(c){for(var d=new Array(c),h=0;h<c;h++)d[h]=0;return d},M.prototype.mulp=function(c,d,h){var v=2*this.guessLen13b(c.length,d.length),y=this.makeRBT(v),w=this.stub(v),S=new Array(v),g=new Array(v),u=new Array(v),x=new Array(v),P=new Array(v),B=new Array(v),j=h.words;j.length=v,this.convert13b(c.words,c.length,S,v),this.convert13b(d.words,d.length,x,v),this.transform(S,w,g,u,v,y),this.transform(x,w,P,B,v,y);for(var I=0;I<v;I++){var z=g[I]*P[I]-u[I]*B[I];u[I]=g[I]*B[I]+u[I]*P[I],g[I]=z}return this.conjugate(g,u,v),this.transform(g,u,j,w,v,y),this.conjugate(j,w,v),this.normalize13b(j,v),h.negative=c.negative^d.negative,h.length=c.length+d.length,h.strip()},s.prototype.mul=function(c){var d=new s(null);return d.words=new Array(this.length+c.length),this.mulTo(c,d)},s.prototype.mulf=function(c){var d=new s(null);return d.words=new Array(this.length+c.length),O(this,c,d)},s.prototype.imul=function(c){return this.clone().mulTo(c,this)},s.prototype.imuln=function(c){t(typeof c=="number"),t(c<67108864);for(var d=0,h=0;h<this.length;h++){var v=(this.words[h]|0)*c,y=(v&67108863)+(d&67108863);d>>=26,d+=v/67108864|0,d+=y>>>26,this.words[h]=y&67108863}return d!==0&&(this.words[h]=d,this.length++),this.length=c===0?1:this.length,this},s.prototype.muln=function(c){return this.clone().imuln(c)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(c){var d=_(c);if(d.length===0)return new s(1);for(var h=this,v=0;v<d.length&&d[v]===0;v++,h=h.sqr());if(++v<d.length)for(var y=h.sqr();v<d.length;v++,y=y.sqr())d[v]!==0&&(h=h.mul(y));return h},s.prototype.iushln=function(c){t(typeof c=="number"&&c>=0);var d=c%26,h=(c-d)/26,v=67108863>>>26-d<<26-d,y;if(d!==0){var w=0;for(y=0;y<this.length;y++){var S=this.words[y]&v,g=(this.words[y]|0)-S<<d;this.words[y]=g|w,w=S>>>26-d}w&&(this.words[y]=w,this.length++)}if(h!==0){for(y=this.length-1;y>=0;y--)this.words[y+h]=this.words[y];for(y=0;y<h;y++)this.words[y]=0;this.length+=h}return this.strip()},s.prototype.ishln=function(c){return t(this.negative===0),this.iushln(c)},s.prototype.iushrn=function(c,d,h){t(typeof c=="number"&&c>=0);var v;d?v=(d-d%26)/26:v=0;var y=c%26,w=Math.min((c-y)/26,this.length),S=67108863^67108863>>>y<<y,g=h;if(v-=w,v=Math.max(0,v),g){for(var u=0;u<w;u++)g.words[u]=this.words[u];g.length=w}if(w!==0)if(this.length>w)for(this.length-=w,u=0;u<this.length;u++)this.words[u]=this.words[u+w];else this.words[0]=0,this.length=1;var x=0;for(u=this.length-1;u>=0&&(x!==0||u>=v);u--){var P=this.words[u]|0;this.words[u]=x<<26-y|P>>>y,x=P&S}return g&&x!==0&&(g.words[g.length++]=x),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(c,d,h){return t(this.negative===0),this.iushrn(c,d,h)},s.prototype.shln=function(c){return this.clone().ishln(c)},s.prototype.ushln=function(c){return this.clone().iushln(c)},s.prototype.shrn=function(c){return this.clone().ishrn(c)},s.prototype.ushrn=function(c){return this.clone().iushrn(c)},s.prototype.testn=function(c){t(typeof c=="number"&&c>=0);var d=c%26,h=(c-d)/26,v=1<<d;if(this.length<=h)return!1;var y=this.words[h];return!!(y&v)},s.prototype.imaskn=function(c){t(typeof c=="number"&&c>=0);var d=c%26,h=(c-d)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(d!==0&&h++,this.length=Math.min(h,this.length),d!==0){var v=67108863^67108863>>>d<<d;this.words[this.length-1]&=v}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.maskn=function(c){return this.clone().imaskn(c)},s.prototype.iaddn=function(c){return t(typeof c=="number"),t(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},s.prototype._iaddn=function(c){this.words[0]+=c;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},s.prototype.isubn=function(c){if(t(typeof c=="number"),t(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this.strip()},s.prototype.addn=function(c){return this.clone().iaddn(c)},s.prototype.subn=function(c){return this.clone().isubn(c)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(c,d,h){var v=c.length+h,y;this._expand(v);var w,S=0;for(y=0;y<c.length;y++){w=(this.words[y+h]|0)+S;var g=(c.words[y]|0)*d;w-=g&67108863,S=(w>>26)-(g/67108864|0),this.words[y+h]=w&67108863}for(;y<this.length-h;y++)w=(this.words[y+h]|0)+S,S=w>>26,this.words[y+h]=w&67108863;if(S===0)return this.strip();for(t(S===-1),S=0,y=0;y<this.length;y++)w=-(this.words[y]|0)+S,S=w>>26,this.words[y]=w&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(c,d){var h=this.length-c.length,v=this.clone(),y=c,w=y.words[y.length-1]|0,S=this._countBits(w);h=26-S,h!==0&&(y=y.ushln(h),v.iushln(h),w=y.words[y.length-1]|0);var g=v.length-y.length,u;if(d!=="mod"){u=new s(null),u.length=g+1,u.words=new Array(u.length);for(var x=0;x<u.length;x++)u.words[x]=0}var P=v.clone()._ishlnsubmul(y,1,g);P.negative===0&&(v=P,u&&(u.words[g]=1));for(var B=g-1;B>=0;B--){var j=(v.words[y.length+B]|0)*67108864+(v.words[y.length+B-1]|0);for(j=Math.min(j/w|0,67108863),v._ishlnsubmul(y,j,B);v.negative!==0;)j--,v.negative=0,v._ishlnsubmul(y,1,B),v.isZero()||(v.negative^=1);u&&(u.words[B]=j)}return u&&u.strip(),v.strip(),d!=="div"&&h!==0&&v.iushrn(h),{div:u||null,mod:v}},s.prototype.divmod=function(c,d,h){if(t(!c.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var v,y,w;return this.negative!==0&&c.negative===0?(w=this.neg().divmod(c,d),d!=="mod"&&(v=w.div.neg()),d!=="div"&&(y=w.mod.neg(),h&&y.negative!==0&&y.iadd(c)),{div:v,mod:y}):this.negative===0&&c.negative!==0?(w=this.divmod(c.neg(),d),d!=="mod"&&(v=w.div.neg()),{div:v,mod:w.mod}):(this.negative&c.negative)!==0?(w=this.neg().divmod(c.neg(),d),d!=="div"&&(y=w.mod.neg(),h&&y.negative!==0&&y.isub(c)),{div:w.div,mod:y}):c.length>this.length||this.cmp(c)<0?{div:new s(0),mod:this}:c.length===1?d==="div"?{div:this.divn(c.words[0]),mod:null}:d==="mod"?{div:null,mod:new s(this.modn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new s(this.modn(c.words[0]))}:this._wordDiv(c,d)},s.prototype.div=function(c){return this.divmod(c,"div",!1).div},s.prototype.mod=function(c){return this.divmod(c,"mod",!1).mod},s.prototype.umod=function(c){return this.divmod(c,"mod",!0).mod},s.prototype.divRound=function(c){var d=this.divmod(c);if(d.mod.isZero())return d.div;var h=d.div.negative!==0?d.mod.isub(c):d.mod,v=c.ushrn(1),y=c.andln(1),w=h.cmp(v);return w<0||y===1&&w===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},s.prototype.modn=function(c){t(c<=67108863);for(var d=(1<<26)%c,h=0,v=this.length-1;v>=0;v--)h=(d*h+(this.words[v]|0))%c;return h},s.prototype.idivn=function(c){t(c<=67108863);for(var d=0,h=this.length-1;h>=0;h--){var v=(this.words[h]|0)+d*67108864;this.words[h]=v/c|0,d=v%c}return this.strip()},s.prototype.divn=function(c){return this.clone().idivn(c)},s.prototype.egcd=function(c){t(c.negative===0),t(!c.isZero());var d=this,h=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var v=new s(1),y=new s(0),w=new s(0),S=new s(1),g=0;d.isEven()&&h.isEven();)d.iushrn(1),h.iushrn(1),++g;for(var u=h.clone(),x=d.clone();!d.isZero();){for(var P=0,B=1;(d.words[0]&B)===0&&P<26;++P,B<<=1);if(P>0)for(d.iushrn(P);P-- >0;)(v.isOdd()||y.isOdd())&&(v.iadd(u),y.isub(x)),v.iushrn(1),y.iushrn(1);for(var j=0,I=1;(h.words[0]&I)===0&&j<26;++j,I<<=1);if(j>0)for(h.iushrn(j);j-- >0;)(w.isOdd()||S.isOdd())&&(w.iadd(u),S.isub(x)),w.iushrn(1),S.iushrn(1);d.cmp(h)>=0?(d.isub(h),v.isub(w),y.isub(S)):(h.isub(d),w.isub(v),S.isub(y))}return{a:w,b:S,gcd:h.iushln(g)}},s.prototype._invmp=function(c){t(c.negative===0),t(!c.isZero());var d=this,h=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var v=new s(1),y=new s(0),w=h.clone();d.cmpn(1)>0&&h.cmpn(1)>0;){for(var S=0,g=1;(d.words[0]&g)===0&&S<26;++S,g<<=1);if(S>0)for(d.iushrn(S);S-- >0;)v.isOdd()&&v.iadd(w),v.iushrn(1);for(var u=0,x=1;(h.words[0]&x)===0&&u<26;++u,x<<=1);if(u>0)for(h.iushrn(u);u-- >0;)y.isOdd()&&y.iadd(w),y.iushrn(1);d.cmp(h)>=0?(d.isub(h),v.isub(y)):(h.isub(d),y.isub(v))}var P;return d.cmpn(1)===0?P=v:P=y,P.cmpn(0)<0&&P.iadd(c),P},s.prototype.gcd=function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var d=this.clone(),h=c.clone();d.negative=0,h.negative=0;for(var v=0;d.isEven()&&h.isEven();v++)d.iushrn(1),h.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;h.isEven();)h.iushrn(1);var y=d.cmp(h);if(y<0){var w=d;d=h,h=w}else if(y===0||h.cmpn(1)===0)break;d.isub(h)}while(!0);return h.iushln(v)},s.prototype.invm=function(c){return this.egcd(c).a.umod(c)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(c){return this.words[0]&c},s.prototype.bincn=function(c){t(typeof c=="number");var d=c%26,h=(c-d)/26,v=1<<d;if(this.length<=h)return this._expand(h+1),this.words[h]|=v,this;for(var y=v,w=h;y!==0&&w<this.length;w++){var S=this.words[w]|0;S+=y,y=S>>>26,S&=67108863,this.words[w]=S}return y!==0&&(this.words[w]=y,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(c){var d=c<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this.strip();var h;if(this.length>1)h=1;else{d&&(c=-c),t(c<=67108863,"Number is too big");var v=this.words[0]|0;h=v===c?0:v<c?-1:1}return this.negative!==0?-h|0:h},s.prototype.cmp=function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var d=this.ucmp(c);return this.negative!==0?-d|0:d},s.prototype.ucmp=function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var d=0,h=this.length-1;h>=0;h--){var v=this.words[h]|0,y=c.words[h]|0;if(v!==y){v<y?d=-1:v>y&&(d=1);break}}return d},s.prototype.gtn=function(c){return this.cmpn(c)===1},s.prototype.gt=function(c){return this.cmp(c)===1},s.prototype.gten=function(c){return this.cmpn(c)>=0},s.prototype.gte=function(c){return this.cmp(c)>=0},s.prototype.ltn=function(c){return this.cmpn(c)===-1},s.prototype.lt=function(c){return this.cmp(c)===-1},s.prototype.lten=function(c){return this.cmpn(c)<=0},s.prototype.lte=function(c){return this.cmp(c)<=0},s.prototype.eqn=function(c){return this.cmpn(c)===0},s.prototype.eq=function(c){return this.cmp(c)===0},s.red=function(c){return new H(c)},s.prototype.toRed=function(c){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},s.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(c){return this.red=c,this},s.prototype.forceRed=function(c){return t(!this.red,"Already a number in reduction context"),this._forceRed(c)},s.prototype.redAdd=function(c){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},s.prototype.redIAdd=function(c){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},s.prototype.redSub=function(c){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},s.prototype.redISub=function(c){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},s.prototype.redShl=function(c){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},s.prototype.redMul=function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},s.prototype.redIMul=function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},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(c){return t(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)};var A={k256:null,p224:null,p192:null,p25519:null};function D(b,c){this.name=b,this.p=new s(c,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var c=new s(null);return c.words=new Array(Math.ceil(this.n/13)),c},D.prototype.ireduce=function(c){var d=c,h;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),h=d.bitLength();while(h>this.n);var v=h<this.n?-1:d.ucmp(this.p);return v===0?(d.words[0]=0,d.length=1):v>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},D.prototype.split=function(c,d){c.iushrn(this.n,0,d)},D.prototype.imulK=function(c){return c.imul(this.k)};function U(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(U,D),U.prototype.split=function(c,d){for(var h=4194303,v=Math.min(c.length,9),y=0;y<v;y++)d.words[y]=c.words[y];if(d.length=v,c.length<=9){c.words[0]=0,c.length=1;return}var w=c.words[9];for(d.words[d.length++]=w&h,y=10;y<c.length;y++){var S=c.words[y]|0;c.words[y-10]=(S&h)<<4|w>>>22,w=S}w>>>=22,c.words[y-10]=w,w===0&&c.length>10?c.length-=10:c.length-=9},U.prototype.imulK=function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var d=0,h=0;h<c.length;h++){var v=c.words[h]|0;d+=v*977,c.words[h]=d&67108863,d=v*64+(d/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c};function ie(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(ie,D);function J(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(J,D);function ne(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(ne,D),ne.prototype.imulK=function(c){for(var d=0,h=0;h<c.length;h++){var v=(c.words[h]|0)*19+d,y=v&67108863;v>>>=26,c.words[h]=y,d=v}return d!==0&&(c.words[c.length++]=d),c},s._prime=function(c){if(A[c])return A[c];var d;if(c==="k256")d=new U;else if(c==="p224")d=new ie;else if(c==="p192")d=new J;else if(c==="p25519")d=new ne;else throw new Error("Unknown prime "+c);return A[c]=d,d};function H(b){if(typeof b=="string"){var c=s._prime(b);this.m=c.p,this.prime=c}else t(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}H.prototype._verify1=function(c){t(c.negative===0,"red works only with positives"),t(c.red,"red works only with red numbers")},H.prototype._verify2=function(c,d){t((c.negative|d.negative)===0,"red works only with positives"),t(c.red&&c.red===d.red,"red works only with red numbers")},H.prototype.imod=function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):c.umod(this.m)._forceRed(this)},H.prototype.neg=function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},H.prototype.add=function(c,d){this._verify2(c,d);var h=c.add(d);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},H.prototype.iadd=function(c,d){this._verify2(c,d);var h=c.iadd(d);return h.cmp(this.m)>=0&&h.isub(this.m),h},H.prototype.sub=function(c,d){this._verify2(c,d);var h=c.sub(d);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},H.prototype.isub=function(c,d){this._verify2(c,d);var h=c.isub(d);return h.cmpn(0)<0&&h.iadd(this.m),h},H.prototype.shl=function(c,d){return this._verify1(c),this.imod(c.ushln(d))},H.prototype.imul=function(c,d){return this._verify2(c,d),this.imod(c.imul(d))},H.prototype.mul=function(c,d){return this._verify2(c,d),this.imod(c.mul(d))},H.prototype.isqr=function(c){return this.imul(c,c.clone())},H.prototype.sqr=function(c){return this.mul(c,c)},H.prototype.sqrt=function(c){if(c.isZero())return c.clone();var d=this.m.andln(3);if(t(d%2===1),d===3){var h=this.m.add(new s(1)).iushrn(2);return this.pow(c,h)}for(var v=this.m.subn(1),y=0;!v.isZero()&&v.andln(1)===0;)y++,v.iushrn(1);t(!v.isZero());var w=new s(1).toRed(this),S=w.redNeg(),g=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);this.pow(u,g).cmp(S)!==0;)u.redIAdd(S);for(var x=this.pow(u,v),P=this.pow(c,v.addn(1).iushrn(1)),B=this.pow(c,v),j=y;B.cmp(w)!==0;){for(var I=B,z=0;I.cmp(w)!==0;z++)I=I.redSqr();t(z<j);var G=this.pow(x,new s(1).iushln(j-z-1));P=P.redMul(G),x=G.redSqr(),B=B.redMul(x),j=z}return P},H.prototype.invm=function(c){var d=c._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},H.prototype.pow=function(c,d){if(d.isZero())return new s(1).toRed(this);if(d.cmpn(1)===0)return c.clone();var h=4,v=new Array(1<<h);v[0]=new s(1).toRed(this),v[1]=c;for(var y=2;y<v.length;y++)v[y]=this.mul(v[y-1],c);var w=v[0],S=0,g=0,u=d.bitLength()%26;for(u===0&&(u=26),y=d.length-1;y>=0;y--){for(var x=d.words[y],P=u-1;P>=0;P--){var B=x>>P&1;if(w!==v[0]&&(w=this.sqr(w)),B===0&&S===0){g=0;continue}S<<=1,S|=B,g++,!(g!==h&&(y!==0||P!==0))&&(w=this.mul(w,v[S]),g=0,S=0)}u=26}return w},H.prototype.convertTo=function(c){var d=c.umod(this.m);return d===c?d.clone():d},H.prototype.convertFrom=function(c){var d=c.clone();return d.red=null,d},s.mont=function(c){return new Ue(c)};function Ue(b){H.call(this,b),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(Ue,H),Ue.prototype.convertTo=function(c){return this.imod(c.ushln(this.shift))},Ue.prototype.convertFrom=function(c){var d=this.imod(c.mul(this.rinv));return d.red=null,d},Ue.prototype.imul=function(c,d){if(c.isZero()||d.isZero())return c.words[0]=0,c.length=1,c;var h=c.imul(d),v=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=h.isub(v).iushrn(this.shift),w=y;return y.cmp(this.m)>=0?w=y.isub(this.m):y.cmpn(0)<0&&(w=y.iadd(this.m)),w._forceRed(this)},Ue.prototype.mul=function(c,d){if(c.isZero()||d.isZero())return new s(0)._forceRed(this);var h=c.mul(d),v=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=h.isub(v).iushrn(this.shift),w=y;return y.cmp(this.m)>=0?w=y.isub(this.m):y.cmpn(0)<0&&(w=y.iadd(this.m)),w._forceRed(this)},Ue.prototype.invm=function(c){var d=this.imod(c._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(typeof ll>"u"||ll,Fm)});var Um=C((dM,pl)=>{typeof Object.create=="function"?pl.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:pl.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 mi=C((fM,fl)=>{try{if(dl=require("util"),typeof dl.inherits!="function")throw"";fl.exports=dl.inherits}catch{fl.exports=Um()}var dl});var Xr=C((hM,Hm)=>{"use strict";var Jr=require("buffer"),kn=Jr.Buffer,_t={},St;for(St in Jr)Jr.hasOwnProperty(St)&&(St==="SlowBuffer"||St==="Buffer"||(_t[St]=Jr[St]));var Cn=_t.Buffer={};for(St in kn)kn.hasOwnProperty(St)&&(St==="allocUnsafe"||St==="allocUnsafeSlow"||(Cn[St]=kn[St]));_t.Buffer.prototype=kn.prototype;(!Cn.from||Cn.from===Uint8Array.from)&&(Cn.from=function(i,e,t){if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof i);if(i&&typeof i.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);return kn(i,e,t)});Cn.alloc||(Cn.alloc=function(i,e,t){if(typeof i!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof i);if(i<0||i>=2*(1<<30))throw new RangeError('The value "'+i+'" is invalid for option "size"');var n=kn(i);return!e||e.length===0?n.fill(0):typeof t=="string"?n.fill(e,t):n.fill(e),n});if(!_t.kStringMaxLength)try{_t.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}_t.constants||(_t.constants={MAX_LENGTH:_t.kMaxLength},_t.kStringMaxLength&&(_t.constants.MAX_STRING_LENGTH=_t.kStringMaxLength));Hm.exports=_t});var Zr=C(zm=>{"use strict";var cE=mi();function Et(i){this._reporterState={obj:null,path:[],options:i||{},errors:[]}}zm.Reporter=Et;Et.prototype.isError=function(e){return e instanceof Tn};Et.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};Et.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};Et.prototype.enterKey=function(e){return this._reporterState.path.push(e)};Et.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};Et.prototype.leaveKey=function(e,t,n){let s=this._reporterState;this.exitKey(e),s.obj!==null&&(s.obj[t]=n)};Et.prototype.path=function(){return this._reporterState.path.join("/")};Et.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};Et.prototype.leaveObject=function(e){let t=this._reporterState,n=t.obj;return t.obj=e,n};Et.prototype.error=function(e){let t,n=this._reporterState,s=e instanceof Tn;if(s?t=e:t=new Tn(n.path.map(function(r){return"["+JSON.stringify(r)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw t;return s||n.errors.push(t),t};Et.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function Tn(i,e){this.path=i,this.rethrow(e)}cE(Tn,Error);Tn.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Tn),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var An=C(hl=>{"use strict";var lE=mi(),Qr=Zr().Reporter,Mn=Xr().Buffer;function kt(i,e){if(Qr.call(this,e),!Mn.isBuffer(i)){this.error("Input not Buffer");return}this.base=i,this.offset=0,this.length=i.length}lE(kt,Qr);hl.DecoderBuffer=kt;kt.isDecoderBuffer=function(e){return e instanceof kt?!0:typeof e=="object"&&Mn.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"};kt.prototype.save=function(){return{offset:this.offset,reporter:Qr.prototype.save.call(this)}};kt.prototype.restore=function(e){let t=new kt(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,Qr.prototype.restore.call(this,e.reporter),t};kt.prototype.isEmpty=function(){return this.offset===this.length};kt.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};kt.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");let n=new kt(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};kt.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function On(i,e){if(Array.isArray(i))this.length=0,this.value=i.map(function(t){return On.isEncoderBuffer(t)||(t=new On(t,e)),this.length+=t.length,t},this);else if(typeof i=="number"){if(!(0<=i&&i<=255))return e.error("non-byte EncoderBuffer value");this.value=i,this.length=1}else if(typeof i=="string")this.value=i,this.length=Mn.byteLength(i);else if(Mn.isBuffer(i))this.value=i,this.length=i.length;else return e.error("Unsupported type: "+typeof i)}hl.EncoderBuffer=On;On.isEncoderBuffer=function(e){return e instanceof On?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};On.prototype.join=function(e,t){return e||(e=Mn.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):Mn.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var Vm=C((gM,Wm)=>{Wm.exports=$m;function $m(i,e){if(!i)throw new Error(e||"Assertion failed")}$m.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}});var eo=C((xM,Gm)=>{"use strict";var uE=Zr().Reporter,pE=An().EncoderBuffer,dE=An().DecoderBuffer,et=Vm(),Km=["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"],fE=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(Km),hE=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function V(i,e,t){let n={};this._baseState=n,n.name=t,n.enc=i,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())}Gm.exports=V;var mE=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];V.prototype.clone=function(){let e=this._baseState,t={};mE.forEach(function(s){t[s]=e[s]});let n=new this.constructor(t.parent);return n._baseState=t,n};V.prototype._wrap=function(){let e=this._baseState;fE.forEach(function(t){this[t]=function(){let s=new this.constructor(this);return e.children.push(s),s[t].apply(s,arguments)}},this)};V.prototype._init=function(e){let t=this._baseState;et(t.parent===null),e.call(this),t.children=t.children.filter(function(n){return n._baseState.parent===this},this),et.equal(t.children.length,1,"Root node can have only one child")};V.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&&(et(t.children===null),t.children=n,n.forEach(function(s){s._baseState.parent=this},this)),e.length!==0&&(et(t.args===null),t.args=e,t.reverseArgs=e.map(function(s){if(typeof s!="object"||s.constructor!==Object)return s;let r={};return Object.keys(s).forEach(function(o){o==(o|0)&&(o|=0);let a=s[o];r[a]=o}),r}))};hE.forEach(function(i){V.prototype[i]=function(){let t=this._baseState;throw new Error(i+" not implemented for encoding: "+t.enc)}});Km.forEach(function(i){V.prototype[i]=function(){let t=this._baseState,n=Array.prototype.slice.call(arguments);return et(t.tag===null),t.tag=i,this._useArgs(n),this}});V.prototype.use=function(e){et(e);let t=this._baseState;return et(t.use===null),t.use=e,this};V.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};V.prototype.def=function(e){let t=this._baseState;return et(t.default===null),t.default=e,t.optional=!0,this};V.prototype.explicit=function(e){let t=this._baseState;return et(t.explicit===null&&t.implicit===null),t.explicit=e,this};V.prototype.implicit=function(e){let t=this._baseState;return et(t.explicit===null&&t.implicit===null),t.implicit=e,this};V.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};V.prototype.key=function(e){let t=this._baseState;return et(t.key===null),t.key=e,this};V.prototype.any=function(){let e=this._baseState;return e.any=!0,this};V.prototype.choice=function(e){let t=this._baseState;return et(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map(function(n){return e[n]})),this};V.prototype.contains=function(e){let t=this._baseState;return et(t.use===null),t.contains=e,this};V.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,r=!0,o=null;if(n.key!==null&&(o=e.enterKey(n.key)),n.optional){let l=null;if(n.explicit!==null?l=n.explicit:n.implicit!==null?l=n.implicit:n.tag!==null&&(l=n.tag),l===null&&!n.any){let p=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),r=!0}catch{r=!1}e.restore(p)}else if(r=this._peekTag(e,l,n.any),e.isError(r))return r}let a;if(n.obj&&r&&(a=e.enterObject()),r){if(n.explicit!==null){let p=this._decodeTag(e,n.explicit);if(e.isError(p))return p;e=p}let l=e.offset;if(n.use===null&&n.choice===null){let p;n.any&&(p=e.save());let f=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(f))return f;n.any?s=e.raw(p):e=f}if(t&&t.track&&n.tag!==null&&t.track(e.path(),l,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(f){f._decode(e,t)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){let p=new dE(s);s=this._getUse(n.contains,e._reporterState.obj)._decode(p,t)}}return n.obj&&r&&(s=e.leaveObject(a)),n.key!==null&&(s!==null||r===!0)?e.leaveKey(o,n.key,s):o!==null&&e.exitKey(o),s};V.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)};V.prototype._getUse=function(e,t){let n=this._baseState;return n.useDecoder=this._use(e,t),et(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};V.prototype._decodeChoice=function(e,t){let n=this._baseState,s=null,r=!1;return Object.keys(n.choice).some(function(o){let a=e.save(),l=n.choice[o];try{let p=l._decode(e,t);if(e.isError(p))return!1;s={type:o,value:p},r=!0}catch{return e.restore(a),!1}return!0},this),r?s:e.error("Choice not matched")};V.prototype._createEncoderBuffer=function(e){return new pE(e,this.reporter)};V.prototype._encode=function(e,t,n){let s=this._baseState;if(s.default!==null&&s.default===e)return;let r=this._encodeValue(e,t,n);if(r!==void 0&&!this._skipDefault(r,t,n))return r};V.prototype._encodeValue=function(e,t,n){let s=this._baseState;if(s.parent===null)return s.children[0]._encode(e,t||new uE);let r=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)r=this._createEncoderBuffer(e);else if(s.choice)r=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(l){if(l._baseState.tag==="null_")return l._encode(null,t,e);if(l._baseState.key===null)return t.error("Child should have a key");let p=t.enterKey(l._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let f=l._encode(e[l._baseState.key],t,e);return t.leaveKey(p),f},this).filter(function(l){return l}),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 l=this.clone();l._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(p){let f=this._baseState;return this._getUse(f.args[0],e)._encode(p,t)},l))}else s.use!==null?r=this._getUse(s.use,n)._encode(e,t):(o=this._encodePrimitive(s.tag,e),a=!0);if(!s.any&&s.choice===null){let l=s.implicit!==null?s.implicit:s.tag,p=s.implicit===null?"universal":"context";l===null?s.use===null&&t.error("Tag could be omitted only for .use()"):s.use===null&&(r=this._encodeComposite(l,a,p,o))}return s.explicit!==null&&(r=this._encodeComposite(s.explicit,!1,"context",r)),r};V.prototype._encodeChoice=function(e,t){let n=this._baseState,s=n.choice[e.type];return s||et(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),s._encode(e.value,t)};V.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)};V.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};V.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var to=C(Ni=>{"use strict";function Ym(i){let e={};return Object.keys(i).forEach(function(t){(t|0)==t&&(t=t|0);let n=i[t];e[n]=t}),e}Ni.tagClass={0:"universal",1:"application",2:"context",3:"private"};Ni.tagClassByName=Ym(Ni.tagClass);Ni.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"};Ni.tagByName=Ym(Ni.tag)});var vl=C((bM,Zm)=>{"use strict";var vE=mi(),ii=Xr().Buffer,Jm=eo(),ml=to();function Xm(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new jt,this.tree._init(i.body)}Zm.exports=Xm;Xm.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function jt(i){Jm.call(this,"der",i)}vE(jt,Jm);jt.prototype._encodeComposite=function(e,t,n,s){let r=gE(e,t,n,this.reporter);if(s.length<128){let l=ii.alloc(2);return l[0]=r,l[1]=s.length,this._createEncoderBuffer([l,s])}let o=1;for(let l=s.length;l>=256;l>>=8)o++;let a=ii.alloc(2+o);a[0]=r,a[1]=128|o;for(let l=1+o,p=s.length;p>0;l--,p>>=8)a[l]=p&255;return this._createEncoderBuffer([a,s])};jt.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let n=ii.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")};jt.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 l=e[a];for(s++;l>=128;l>>=7)s++}let r=ii.alloc(s),o=r.length-1;for(let a=e.length-1;a>=0;a--){let l=e[a];for(r[o--]=l&127;(l>>=7)>0;)r[o--]=128|l&127}return this._createEncoderBuffer(r)};function Ct(i){return i<10?"0"+i:i}jt.prototype._encodeTime=function(e,t){let n,s=new Date(e);return t==="gentime"?n=[Ct(s.getUTCFullYear()),Ct(s.getUTCMonth()+1),Ct(s.getUTCDate()),Ct(s.getUTCHours()),Ct(s.getUTCMinutes()),Ct(s.getUTCSeconds()),"Z"].join(""):t==="utctime"?n=[Ct(s.getUTCFullYear()%100),Ct(s.getUTCMonth()+1),Ct(s.getUTCDate()),Ct(s.getUTCHours()),Ct(s.getUTCMinutes()),Ct(s.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")};jt.prototype._encodeNull=function(){return this._createEncoderBuffer("")};jt.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"&&!ii.isBuffer(e)){let r=e.toArray();!e.sign&&r[0]&128&&r.unshift(0),e=ii.from(r)}if(ii.isBuffer(e)){let r=e.length;e.length===0&&r++;let o=ii.alloc(r);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 r=e;r>=256;r>>=8)n++;let s=new Array(n);for(let r=s.length-1;r>=0;r--)s[r]=e&255,e>>=8;return s[0]&128&&s.unshift(0),this._createEncoderBuffer(ii.from(s))};jt.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};jt.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getEncoder("der").tree};jt.prototype._skipDefault=function(e,t,n){let s=this._baseState,r;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(r=0;r<o.length;r++)if(o[r]!==s.defaultBuffer[r])return!1;return!0};function gE(i,e,t,n){let s;if(i==="seqof"?i="seq":i==="setof"&&(i="set"),ml.tagByName.hasOwnProperty(i))s=ml.tagByName[i];else if(typeof i=="number"&&(i|0)===i)s=i;else return n.error("Unknown tag: "+i);return s>=31?n.error("Multi-octet tag encoding unsupported"):(e||(s|=32),s|=ml.tagClassByName[t||"universal"]<<6,s)}});var ev=C((wM,Qm)=>{"use strict";var xE=mi(),gl=vl();function xl(i){gl.call(this,i),this.enc="pem"}xE(xl,gl);Qm.exports=xl;xl.prototype.encode=function(e,t){let s=gl.prototype.encode.call(this,e).toString("base64"),r=["-----BEGIN "+t.label+"-----"];for(let o=0;o<s.length;o+=64)r.push(s.slice(o,o+64));return r.push("-----END "+t.label+"-----"),r.join(`
26
+ `)}});var yl=C(iv=>{"use strict";var tv=iv;tv.der=vl();tv.pem=ev()});var wl=C((SM,cv)=>{"use strict";var yE=mi(),bE=ul(),nv=An().DecoderBuffer,rv=eo(),sv=to();function ov(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new dt,this.tree._init(i.body)}cv.exports=ov;ov.prototype.decode=function(e,t){return nv.isDecoderBuffer(e)||(e=new nv(e,t)),this.tree._decode(e,t)};function dt(i){rv.call(this,"der",i)}yE(dt,rv);dt.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;let s=e.save(),r=bl(e,'Failed to peek tag: "'+t+'"');return e.isError(r)?r:(e.restore(s),r.tag===t||r.tagStr===t||r.tagStr+"of"===t||n)};dt.prototype._decodeTag=function(e,t,n){let s=bl(e,'Failed to decode tag of "'+t+'"');if(e.isError(s))return s;let r=av(e,s.primitive,'Failed to get length of "'+t+'"');if(e.isError(r))return r;if(!n&&s.tag!==t&&s.tagStr!==t&&s.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(s.primitive||r!==null)return e.skip(r,'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:(r=e.offset-o.offset,e.restore(o),e.skip(r,'Failed to match body of: "'+t+'"'))};dt.prototype._skipUntilEnd=function(e,t){for(;;){let n=bl(e,t);if(e.isError(n))return n;let s=av(e,n.primitive,t);if(e.isError(s))return s;let r;if(n.primitive||s!==null?r=e.skip(s):r=this._skipUntilEnd(e,t),e.isError(r))return r;if(n.tagStr==="end")break}};dt.prototype._decodeList=function(e,t,n,s){let r=[];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;r.push(a)}return r};dt.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 r=0;r<n.length/2;r++)s+=String.fromCharCode(n.readUInt16BE(r*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")}};dt.prototype._decodeObjid=function(e,t,n){let s,r=[],o=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),o<<=7,o|=a&127,(a&128)===0&&(r.push(o),o=0);a&128&&r.push(o);let l=r[0]/40|0,p=r[0]%40;if(n?s=r:s=[l,p].concat(r.slice(1)),t){let f=t[s.join(" ")];f===void 0&&(f=t[s.join(".")]),f!==void 0&&(s=f)}return s};dt.prototype._decodeTime=function(e,t){let n=e.raw().toString(),s,r,o,a,l,p;if(t==="gentime")s=n.slice(0,4)|0,r=n.slice(4,6)|0,o=n.slice(6,8)|0,a=n.slice(8,10)|0,l=n.slice(10,12)|0,p=n.slice(12,14)|0;else if(t==="utctime")s=n.slice(0,2)|0,r=n.slice(2,4)|0,o=n.slice(4,6)|0,a=n.slice(6,8)|0,l=n.slice(8,10)|0,p=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,r-1,o,a,l,p,0)};dt.prototype._decodeNull=function(){return null};dt.prototype._decodeBool=function(e){let t=e.readUInt8();return e.isError(t)?t:t!==0};dt.prototype._decodeInt=function(e,t){let n=e.raw(),s=new bE(n);return t&&(s=t[s.toString(10)]||s),s};dt.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function bl(i,e){let t=i.readUInt8(e);if(i.isError(t))return t;let n=sv.tagClass[t>>6],s=(t&32)===0;if((t&31)===31){let o=t;for(t=0;(o&128)===128;){if(o=i.readUInt8(e),i.isError(o))return o;t<<=7,t|=o&127}}else t&=31;let r=sv.tag[t];return{cls:n,primitive:s,tag:t,tagStr:r}}function av(i,e,t){let n=i.readUInt8(t);if(i.isError(n))return n;if(!e&&n===128)return null;if((n&128)===0)return n;let s=n&127;if(s>4)return i.error("length octect is too long");n=0;for(let r=0;r<s;r++){n<<=8;let o=i.readUInt8(t);if(i.isError(o))return o;n|=o}return n}});var uv=C((EM,lv)=>{"use strict";var wE=mi(),_E=Xr().Buffer,_l=wl();function Sl(i){_l.call(this,i),this.enc="pem"}wE(Sl,_l);lv.exports=Sl;Sl.prototype.decode=function(e,t){let n=e.toString().split(/[\r\n]+/g),s=t.label.toUpperCase(),r=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,a=-1;for(let f=0;f<n.length;f++){let m=n[f].match(r);if(m!==null&&m[2]===s)if(o===-1){if(m[1]!=="BEGIN")break;o=f}else{if(m[1]!=="END")break;a=f;break}}if(o===-1||a===-1)throw new Error("PEM section not found for: "+s);let l=n.slice(o+1,a).join("");l.replace(/[^a-z0-9+/=]+/gi,"");let p=_E.from(l,"base64");return _l.prototype.decode.call(this,p,t)}});var El=C(dv=>{"use strict";var pv=dv;pv.der=wl();pv.pem=uv()});var hv=C(fv=>{"use strict";var SE=yl(),EE=El(),kE=mi(),CE=fv;CE.define=function(e,t){return new Rn(e,t)};function Rn(i,e){this.name=i,this.body=e,this.decoders={},this.encoders={}}Rn.prototype._createNamed=function(e){let t=this.name;function n(s){this._initNamed(s,t)}return kE(n,e),n.prototype._initNamed=function(r,o){e.call(this,r,o)},new n(this)};Rn.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(EE[e])),this.decoders[e]};Rn.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)};Rn.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(SE[e])),this.encoders[e]};Rn.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}});var vv=C(mv=>{"use strict";var io=mv;io.Reporter=Zr().Reporter;io.DecoderBuffer=An().DecoderBuffer;io.EncoderBuffer=An().EncoderBuffer;io.Node=eo()});var yv=C(xv=>{"use strict";var gv=xv;gv._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};gv.der=to()});var wv=C(bv=>{"use strict";var Pn=bv;Pn.bignum=ul();Pn.define=hv().define;Pn.base=vv();Pn.constants=yv();Pn.decoders=El();Pn.encoders=yl()});var Bn=C((kl,Sv)=>{var no=require("buffer"),Ht=no.Buffer;function _v(i,e){for(var t in i)e[t]=i[t]}Ht.from&&Ht.alloc&&Ht.allocUnsafe&&Ht.allocUnsafeSlow?Sv.exports=no:(_v(no,kl),kl.Buffer=Di);function Di(i,e,t){return Ht(i,e,t)}Di.prototype=Object.create(Ht.prototype);_v(Ht,Di);Di.from=function(i,e,t){if(typeof i=="number")throw new TypeError("Argument must not be a number");return Ht(i,e,t)};Di.alloc=function(i,e,t){if(typeof i!="number")throw new TypeError("Argument must be a number");var n=Ht(i);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};Di.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return Ht(i)};Di.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return no.SlowBuffer(i)}});var Cl=C((AM,Ev)=>{var so=Bn().Buffer,TE=require("stream"),ME=require("util");function ro(i){if(this.buffer=null,this.writable=!0,this.readable=!0,!i)return this.buffer=so.alloc(0),this;if(typeof i.pipe=="function")return this.buffer=so.alloc(0),i.pipe(this),this;if(i.length||typeof i=="object")return this.buffer=i,this.writable=!1,process.nextTick(function(){this.emit("end",i),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof i+")")}ME.inherits(ro,TE);ro.prototype.write=function(e){this.buffer=so.concat([this.buffer,so.from(e)]),this.emit("data",e)};ro.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};Ev.exports=ro});var Cv=C((RM,kv)=>{"use strict";function Tl(i){var e=(i/8|0)+(i%8===0?0:1);return e}var OE={ES256:Tl(256),ES384:Tl(384),ES512:Tl(521)};function AE(i){var e=OE[i];if(e)return e;throw new Error('Unknown algorithm "'+i+'"')}kv.exports=AE});var Bv=C((PM,Pv)=>{"use strict";var oo=Bn().Buffer,Mv=Cv(),ao=128,Ov=0,RE=32,PE=16,BE=2,Av=PE|RE|Ov<<6,co=BE|Ov<<6;function jE(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Rv(i){if(oo.isBuffer(i))return i;if(typeof i=="string")return oo.from(i,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function NE(i,e){i=Rv(i);var t=Mv(e),n=t+1,s=i.length,r=0;if(i[r++]!==Av)throw new Error('Could not find expected "seq"');var o=i[r++];if(o===(ao|1)&&(o=i[r++]),s-r<o)throw new Error('"seq" specified length of "'+o+'", only "'+(s-r)+'" remaining');if(i[r++]!==co)throw new Error('Could not find expected "int" for "r"');var a=i[r++];if(s-r-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(s-r-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var l=r;if(r+=a,i[r++]!==co)throw new Error('Could not find expected "int" for "s"');var p=i[r++];if(s-r!==p)throw new Error('"s" specified length of "'+p+'", expected "'+(s-r)+'"');if(n<p)throw new Error('"s" specified length of "'+p+'", max of "'+n+'" is acceptable');var f=r;if(r+=p,r!==s)throw new Error('Expected to consume entire buffer, but "'+(s-r)+'" bytes remain');var m=t-a,_=t-p,E=oo.allocUnsafe(m+a+_+p);for(r=0;r<m;++r)E[r]=0;i.copy(E,r,l+Math.max(-m,0),l+a),r=t;for(var k=r;r<k+_;++r)E[r]=0;return i.copy(E,r,f+Math.max(-_,0),f+p),E=E.toString("base64"),E=jE(E),E}function Tv(i,e,t){for(var n=0;e+n<t&&i[e+n]===0;)++n;var s=i[e+n]>=ao;return s&&--n,n}function DE(i,e){i=Rv(i);var t=Mv(e),n=i.length;if(n!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+n+'"');var s=Tv(i,0,t),r=Tv(i,t,i.length),o=t-s,a=t-r,l=2+o+1+1+a,p=l<ao,f=oo.allocUnsafe((p?2:3)+l),m=0;return f[m++]=Av,p?f[m++]=l:(f[m++]=ao|1,f[m++]=l&255),f[m++]=co,f[m++]=o,s<0?(f[m++]=0,m+=i.copy(f,m,0,t)):m+=i.copy(f,m,s,t),f[m++]=co,f[m++]=a,r<0?(f[m++]=0,i.copy(f,m,t)):i.copy(f,m,t+r),f}Pv.exports={derToJose:NE,joseToDer:DE}});var Nv=C((BM,jv)=>{"use strict";var as=require("buffer").Buffer,Ml=require("buffer").SlowBuffer;jv.exports=lo;function lo(i,e){if(!as.isBuffer(i)||!as.isBuffer(e)||i.length!==e.length)return!1;for(var t=0,n=0;n<i.length;n++)t|=i[n]^e[n];return t===0}lo.install=function(){as.prototype.equal=Ml.prototype.equal=function(e){return lo(this,e)}};var IE=as.prototype.equal,qE=Ml.prototype.equal;lo.restore=function(){as.prototype.equal=IE,Ml.prototype.equal=qE}});var Pl=C((jM,$v)=>{var Nn=Bn().Buffer,Tt=require("crypto"),Iv=Bv(),Dv=require("util"),LE=`"%s" is not a valid algorithm.
27
27
  Supported algorithms are:
28
- "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,cs="secret must be a string or buffer",jn="key must be a string or a buffer",LE="key must be a string, a buffer or an object",Al=typeof Tt.createPublicKey=="function";Al&&(jn+=" or a KeyObject",cs+="or a KeyObject");function Dv(i){if(!Nn.isBuffer(i)&&typeof i!="string"&&(!Al||typeof i!="object"||typeof i.type!="string"||typeof i.asymmetricKeyType!="string"||typeof i.export!="function"))throw Nt(jn)}function qv(i){if(!Nn.isBuffer(i)&&typeof i!="string"&&typeof i!="object")throw Nt(LE)}function FE(i){if(!Nn.isBuffer(i)){if(typeof i=="string")return i;if(!Al||typeof i!="object"||i.type!=="secret"||typeof i.export!="function")throw Nt(cs)}}function Rl(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Lv(i){i=i.toString();var e=4-i.length%4;if(e!==4)for(var t=0;t<e;++t)i+="=";return i.replace(/\-/g,"+").replace(/_/g,"/")}function Nt(i){var e=[].slice.call(arguments,1),t=Nv.format.bind(Nv,i).apply(null,e);return new TypeError(t)}function UE(i){return Nn.isBuffer(i)||typeof i=="string"}function ls(i){return UE(i)||(i=JSON.stringify(i)),i}function Fv(i){return function(t,n){FE(n),t=ls(t);var s=Tt.createHmac("sha"+i,n),r=(s.update(t),s.digest("base64"));return Rl(r)}}var Ol,HE="timingSafeEqual"in Tt?function(e,t){return e.byteLength!==t.byteLength?!1:Tt.timingSafeEqual(e,t)}:function(e,t){return Ol||(Ol=jv()),Ol(e,t)};function zE(i){return function(t,n,s){var r=Fv(i)(t,s);return HE(Nn.from(n),Nn.from(r))}}function Uv(i){return function(t,n){qv(n),t=ls(t);var s=Tt.createSign("RSA-SHA"+i),r=(s.update(t),s.sign(n,"base64"));return Rl(r)}}function Hv(i){return function(t,n,s){Dv(s),t=ls(t),n=Lv(n);var r=Tt.createVerify("RSA-SHA"+i);return r.update(t),r.verify(s,n,"base64")}}function $E(i){return function(t,n){qv(n),t=ls(t);var s=Tt.createSign("RSA-SHA"+i),r=(s.update(t),s.sign({key:n,padding:Tt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Tt.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Rl(r)}}function WE(i){return function(t,n,s){Dv(s),t=ls(t),n=Lv(n);var r=Tt.createVerify("RSA-SHA"+i);return r.update(t),r.verify({key:s,padding:Tt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Tt.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function VE(i){var e=Uv(i);return function(){var n=e.apply(null,arguments);return n=Iv.derToJose(n,"ES"+i),n}}function KE(i){var e=Hv(i);return function(n,s,r){s=Iv.joseToDer(s,"ES"+i).toString("base64");var o=e(n,s,r);return o}}function GE(){return function(){return""}}function YE(){return function(e,t){return t===""}}zv.exports=function(e){var t={hs:Fv,rs:Uv,ps:$E,es:VE,none:GE},n={hs:zE,rs:Hv,ps:WE,es:KE,none:YE},s=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!s)throw Nt(qE,e);var r=(s[1]||s[3]).toLowerCase(),o=s[2];return{sign:t[r](o),verify:n[r](o)}}});var Bl=C((jM,$v)=>{var JE=require("buffer").Buffer;$v.exports=function(e){return typeof e=="string"?e:typeof e=="number"||JE.isBuffer(e)?e.toString():JSON.stringify(e)}});var Jv=C((NM,Yv)=>{var XE=Bn().Buffer,Wv=Cl(),ZE=Pl(),QE=require("stream"),Vv=Bl(),jl=require("util");function Kv(i,e){return XE.from(i,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ek(i,e,t){t=t||"utf8";var n=Kv(Vv(i),"binary"),s=Kv(Vv(e),t);return jl.format("%s.%s",n,s)}function Gv(i){var e=i.header,t=i.payload,n=i.secret||i.privateKey,s=i.encoding,r=ZE(e.alg),o=ek(e,t,s),a=r.sign(o,n);return jl.format("%s.%s",o,a)}function uo(i){var e=i.secret;if(e=e??i.privateKey,e=e??i.key,/^hs/i.test(i.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new Wv(e);this.readable=!0,this.header=i.header,this.encoding=i.encoding,this.secret=this.privateKey=this.key=t,this.payload=new Wv(i.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))}jl.inherits(uo,QE);uo.prototype.sign=function(){try{var e=Gv({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")}};uo.sign=Gv;Yv.exports=uo});var og=C((IM,rg)=>{var Zv=Bn().Buffer,Xv=Cl(),tk=Pl(),ik=require("stream"),Qv=Bl(),nk=require("util"),sk=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function rk(i){return Object.prototype.toString.call(i)==="[object Object]"}function ok(i){if(rk(i))return i;try{return JSON.parse(i)}catch{return}}function eg(i){var e=i.split(".",1)[0];return ok(Zv.from(e,"base64").toString("binary"))}function ak(i){return i.split(".",2).join(".")}function tg(i){return i.split(".")[2]}function ck(i,e){e=e||"utf8";var t=i.split(".")[1];return Zv.from(t,"base64").toString(e)}function ig(i){return sk.test(i)&&!!eg(i)}function ng(i,e,t){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}i=Qv(i);var s=tg(i),r=ak(i),o=tk(e);return o.verify(r,s,t)}function sg(i,e){if(e=e||{},i=Qv(i),!ig(i))return null;var t=eg(i);if(!t)return null;var n=ck(i);return(t.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:t,payload:n,signature:tg(i)}}function In(i){i=i||{};var e=i.secret;if(e=e??i.publicKey,e=e??i.key,/^hs/i.test(i.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new Xv(e);this.readable=!0,this.algorithm=i.algorithm,this.encoding=i.encoding,this.secret=this.publicKey=this.key=t,this.signature=new Xv(i.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))}nk.inherits(In,ik);In.prototype.verify=function(){try{var e=ng(this.signature.buffer,this.algorithm,this.key.buffer),t=sg(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")}};In.decode=sg;In.isValid=ig;In.verify=ng;rg.exports=In});var cg=C(vi=>{var ag=Jv(),po=og(),lk=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];vi.ALGORITHMS=lk;vi.sign=ag.sign;vi.verify=po.verify;vi.decode=po.decode;vi.isValid=po.isValid;vi.createSign=function(e){return new ag(e)};vi.createVerify=function(e){return new po(e)}});var fo=C((qM,lg)=>{"use strict";var Nl={};Nl.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};Nl.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};lg.exports=Nl});var Il=C((LM,ug)=>{"use strict";function uk(i){return/^[A-Za-z0-9\-_]+$/.test(i)}ug.exports={validate:uk}});var ql=C((FM,xg)=>{"use strict";var pk=require("crypto"),dk=bv(),fk=cg(),{URL:dg}=require("url"),pg=fo(),fg=Il(),hk=720*60,mk=1440*60,vk=dk.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 gk(i){return vk.encode({version:1,privateKey:i,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function xk(){let i=pk.createECDH("prime256v1");i.generateKeys();let e=i.getPublicKey(),t=i.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 hg(i){if(!i)throw new Error("No subject set in vapidDetails.subject.");if(typeof i!="string"||i.length===0)throw new Error("The subject value must be a string containing an https: URL or mailto: address. "+i);let e=null;try{e=new dg(i)}catch{throw new Error("Vapid subject is not a valid URL. "+i)}if(!["https:","mailto:"].includes(e.protocol))throw new Error("Vapid subject is not an https: or mailto: URL. "+i);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 mg(i){if(!i)throw new Error("No key set vapidDetails.publicKey");if(typeof i!="string")throw new Error("Vapid public key is must be a URL safe Base 64 encoded string.");if(!fg.validate(i))throw new Error('Vapid public key must be a URL safe Base 64 (without "=")');if(i=Buffer.from(i,"base64url"),i.length!==65)throw new Error("Vapid public key should be 65 bytes long when decoded.")}function vg(i){if(!i)throw new Error("No key set in vapidDetails.privateKey");if(typeof i!="string")throw new Error("Vapid private key must be a URL safe Base 64 encoded string.");if(!fg.validate(i))throw new Error('Vapid private key must be a URL safe Base 64 (without "=")');if(i=Buffer.from(i,"base64url"),i.length!==32)throw new Error("Vapid private key should be 32 bytes long when decoded.")}function Dl(i){let e=new Date;return e.setSeconds(e.getSeconds()+i),Math.floor(e.getTime()/1e3)}function gg(i){if(!Number.isInteger(i))throw new Error("`expiration` value must be a number");if(i<0)throw new Error("`expiration` must be a positive integer");let e=Dl(mk);if(i>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function yk(i,e,t,n,s,r){if(!i)throw new Error("No audience could be generated for VAPID.");if(typeof i!="string"||i.length===0)throw new Error("The audience value must be a string containing the origin of a push service. "+i);try{new dg(i)}catch{throw new Error("VAPID audience is not a url. "+i)}hg(e),mg(t),vg(n),n=Buffer.from(n,"base64url"),r?gg(r):r=Dl(hk);let o={typ:"JWT",alg:"ES256"},a={aud:i,exp:r,sub:e},l=fk.sign({header:o,payload:a,privateKey:gk(n)});if(s===pg.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+l+", k="+t};if(s===pg.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+l,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}xg.exports={generateVAPIDKeys:xk,getFutureExpirationTimestamp:Dl,getVapidHeaders:yk,validateSubject:hg,validatePublicKey:mg,validatePrivateKey:vg,validateExpiration:gg}});var Og=C((UM,Mg)=>{"use strict";var mo=require("crypto"),bg="aes-128-gcm",vo={aes128gcm:1,aesgcm:2},Di=16,zt=16,bk=12,wg=32,us="encrypt",ps="decrypt",K;process.env.ECE_KEYLOG==="1"?K=function(i,e){return console.warn(i+" ["+e.length+"]: "+e.toString("base64url")),e}:K=function(i,e){return e};function ho(i){return typeof i=="string"?Buffer.from(i,"base64url"):i}function _g(i,e){var t=mo.createHmac("sha256",i);return t.update(e),t.digest()}function Sg(i,e){return K("salt",i),K("ikm",e),K("extract",_g(i,e))}function Ll(i,e,t){K("prk",i),K("info",e);var n=Buffer.alloc(0),s=Buffer.alloc(0);e=Buffer.from(e,"ascii");for(var r=0,o=Buffer.alloc(1);n.length<t;)o.writeUIntBE(++r,0,1),s=_g(i,Buffer.concat([s,e,o])),n=Buffer.concat([n,s]);return K("expand",n.slice(0,t))}function Eg(i,e,t,n){return Ll(Sg(i,e),t,n)}function Fl(i,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+i+"\0","ascii"),e]);return K("info "+i,t),t}function yg(i){var e=Buffer.concat([Buffer.alloc(2),i]);return e.writeUIntBE(i.length,0,2),e}function wk(i,e){var t=i.privateKey,n,s;if(e===us)n=t.getPublicKey(),s=i.dh;else if(e===ps)n=i.dh,s=t.getPublicKey();else throw new Error("Unknown mode only "+us+" and "+ps+" supported");return{secret:t.computeSecret(i.dh),context:Buffer.concat([Buffer.from(i.keylabel,"ascii"),Buffer.from([0]),yg(s),yg(n)])}}function _k(i,e){var t={secret:null,context:Buffer.alloc(0)};if(i.key){if(t.secret=i.key,t.secret.length!==zt)throw new Error("An explicit key must be "+zt+" bytes")}else i.dh?t=wk(i,e):typeof i.keyid!==void 0&&(t.secret=i.keymap[i.keyid]);if(!t.secret)throw new Error("Unable to determine key");return K("secret",t.secret),K("context",t.context),i.authSecret&&(t.secret=Eg(i.authSecret,t.secret,Fl("auth",Buffer.alloc(0)),wg),K("authsecret",t.secret)),t}function Sk(i,e){if(!i.authSecret)throw new Error("No authentication secret for webpush");K("authsecret",i.authSecret);var t,n,s;if(e===us)n=i.privateKey.getPublicKey(),t=s=i.dh;else if(e===ps)t=n=i.keyid,s=i.privateKey.getPublicKey();else throw new Error("Unknown mode only "+us+" and "+ps+" supported");return K("remote pubkey",t),K("sender pubkey",n),K("receiver pubkey",s),K("secret dh",Eg(i.authSecret,i.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),s,n]),wg))}function Ek(i,e,t){if(t&&!Bk(t))throw new Error("Callback is not a function");if(i.key){if(i.key.length!==zt)throw new Error("An explicit key must be "+zt+" bytes");return K("secret key",i.key)}if(!i.privateKey){if(t)var n=t(i.keyid);else var n=i.keymap&&i.keymap[i.keyid];if(!n)throw new Error('No saved key (keyid: "'+i.keyid+'")');return n}return Sk(i,e)}function kg(i,e,t){if(!i.salt)throw new Error("must include a salt parameter for "+i.version);var n,s,r;if(i.version==="aesgcm"){var o=_k(i,e,t);n=Fl("aesgcm",o.context),s=Fl("nonce",o.context),r=o.secret}else if(i.version==="aes128gcm")n=Buffer.from("Content-Encoding: aes128gcm\0"),s=Buffer.from("Content-Encoding: nonce\0"),r=Ek(i,e,t);else throw new Error("Unable to set context for mode "+i.version);var a=Sg(i.salt,r),l={key:Ll(a,n,zt),nonce:Ll(a,s,bk)};return K("key",l.key),K("nonce base",l.nonce),l}function Cg(i){var e={};e.version=i.version||"aes128gcm",e.rs=parseInt(i.rs,10),isNaN(e.rs)&&(e.rs=4096);var t=vo[e.version];if(e.version==="aes128gcm"&&(t+=Di),e.rs<=t)throw new Error("The rs parameter has to be greater than "+t);if(i.salt&&(e.salt=ho(i.salt),e.salt.length!==zt))throw new Error("The salt parameter must be "+zt+" bytes");return e.keyid=i.keyid,i.key?e.key=ho(i.key):(e.privateKey=i.privateKey,e.privateKey||(e.keymap=i.keymap),e.version!=="aes128gcm"&&(e.keylabel=i.keylabel||"P-256"),i.dh&&(e.dh=ho(i.dh))),i.authSecret&&(e.authSecret=ho(i.authSecret)),e}function Tg(i,e){var t=Buffer.from(i),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),K("nonce"+e,t),t}function kk(i,e){var t=i.readUIntBE(20,1);return e.salt=i.slice(0,zt),e.rs=i.readUIntBE(zt,4),e.keyid=i.slice(21,21+t),21+t}function Ck(i,e){var t=vo[e],n=i.readUIntBE(0,t);if(n+t>i.length)throw new Error("padding exceeds block size");K("padding",i.slice(0,t+n));var s=Buffer.alloc(n);if(s.fill(0),s.compare(i.slice(t,t+n))!==0)throw new Error("invalid padding");return i.slice(t+n)}function Tk(i,e){for(var t=i.length-1;t>=0;){if(i[t]){if(e){if(i[t]!==2)throw new Error("last record needs to start padding with a 2")}else if(i[t]!==1)throw new Error("last record needs to start padding with a 2");return i.slice(0,t)}--t}throw new Error("all zero plaintext")}function Mk(i,e,t,n,s){K("decrypt",t);var r=Tg(i.nonce,e),o=mo.createDecipheriv(bg,i.key,r);o.setAuthTag(t.slice(t.length-Di));var a=o.update(t.slice(0,t.length-Di));return a=Buffer.concat([a,o.final()]),K("decrypted",a),n.version!=="aes128gcm"?Ck(a,n.version):Tk(a,s)}function Ok(i,e,t){var n=Cg(e);if(n.version==="aes128gcm"){var s=kk(i,n);i=i.slice(s)}var r=kg(n,ps,t),o=0,a=Buffer.alloc(0),l=n.rs;n.version!=="aes128gcm"&&(l+=Di);for(var p=0;o<i.length;++p){var f=o+l;if(n.version!=="aes128gcm"&&f===i.length)throw new Error("Truncated payload");if(f=Math.min(f,i.length),f-o<=Di)throw new Error("Invalid block: too small at "+p);var m=Mk(r,p,i.slice(o,f),n,f>=i.length);a=Buffer.concat([a,m]),o=f}return a}function Ak(i,e,t,n,s,r){K("encrypt",t),n=n||0;var o=Tg(i.nonce,e),a=mo.createCipheriv(bg,i.key,o),l=[],p=vo[s.version],f=Buffer.alloc(n+p);if(f.fill(0),s.version!=="aes128gcm"){if(f.writeUIntBE(n,0,p),K("padding",f),l.push(a.update(f)),l.push(a.update(t)),!r&&f.length+t.length<s.rs)throw new Error("Unable to pad to record size")}else l.push(a.update(t)),f.writeUIntBE(r?2:1,0,1),K("padding",f),l.push(a.update(f));a.final();var m=a.getAuthTag();if(m.length!==Di)throw new Error("invalid tag generated");return l.push(m),K("encrypted",Buffer.concat(l))}function Rk(i){var e=Buffer.alloc(5),t=Buffer.from(i.keyid||[]);if(t.length>255)throw new Error("keyid is too large");return e.writeUIntBE(i.rs,0,4),e.writeUIntBE(t.length,4,1),Buffer.concat([i.salt,e,t])}function Pk(i,e,t){if(!Buffer.isBuffer(i))throw new Error("buffer argument must be a Buffer");var n=Cg(e);n.salt||(n.salt=mo.randomBytes(zt));var s;n.version==="aes128gcm"?(n.privateKey&&!n.keyid&&(n.keyid=n.privateKey.getPublicKey()),s=Rk(n)):s=Buffer.alloc(0);var r=kg(n,us,t),o=0,a=vo[n.version],l=a;n.version==="aes128gcm"&&(l+=Di);for(var p=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),f=0,m=!1;!m;){var _=Math.min(n.rs-l-1,p);n.version!=="aes128gcm"&&(_=Math.min((1<<a*8)-1,_)),p>0&&_===0&&++_,p-=_;var E=o+n.rs-l-_;n.version!=="aes128gcm"?m=E>i.length:m=E>=i.length,m=m&&p<=0;var k=Ak(r,f,i.slice(o,E),_,n,m);s=Buffer.concat([s,k]),o=E,++f}return s}function Bk(i){return typeof i=="function"}Mg.exports={decrypt:Ok,encrypt:Pk}});var Ul=C((HM,Rg)=>{"use strict";var Ag=require("crypto"),jk=Og(),Nk=function(i,e,t,n){if(!i)throw new Error("No user public key provided for encryption.");if(typeof i!="string")throw new Error("The subscription p256dh value must be a string.");if(Buffer.from(i,"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=Ag.createECDH("prime256v1"),r=s.generateKeys(),o=Ag.randomBytes(16).toString("base64url"),a=jk.encrypt(t,{version:n,dh:i,privateKey:s,salt:o,authSecret:e});return{localPublicKey:r,salt:o,cipherText:a}};Rg.exports={encrypt:Nk}});var Hl=C((zM,Bg)=>{"use strict";function Pg(i,e,t,n,s){Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=i,this.statusCode=e,this.headers=t,this.body=n,this.endpoint=s}require("util").inherits(Pg,Error);Bg.exports=Pg});var Ig=C(rt=>{"use strict";var Ik=rt&&rt.__createBinding||(Object.create?(function(i,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(i,n,s)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),Dk=rt&&rt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),jg=rt&&rt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&Ik(e,i,t);return Dk(e,i),e};Object.defineProperty(rt,"__esModule",{value:!0});rt.req=rt.json=rt.toBuffer=void 0;var qk=jg(require("http")),Lk=jg(require("https"));async function Ng(i){let e=0,t=[];for await(let n of i)e+=n.length,t.push(n);return Buffer.concat(t,e)}rt.toBuffer=Ng;async function Fk(i){let t=(await Ng(i)).toString("utf8");try{return JSON.parse(t)}catch(n){let s=n;throw s.message+=` (input: ${t})`,s}}rt.json=Fk;function Uk(i,e={}){let n=((typeof i=="string"?i:i.href).startsWith("https:")?Lk:qk).request(i,e),s=new Promise((r,o)=>{n.once("response",r).once("error",o).end()});return n.then=s.then.bind(s),n}rt.req=Uk});var Fg=C(ft=>{"use strict";var qg=ft&&ft.__createBinding||(Object.create?(function(i,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(i,n,s)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),Hk=ft&&ft.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Lg=ft&&ft.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&qg(e,i,t);return Hk(e,i),e},zk=ft&&ft.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&qg(e,i,t)};Object.defineProperty(ft,"__esModule",{value:!0});ft.Agent=void 0;var $k=Lg(require("net")),Dg=Lg(require("http")),Wk=require("https");zk(Ig(),ft);var $t=Symbol("AgentBaseInternalState"),zl=class extends Dg.Agent{constructor(e){super(e),this[$t]={}}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(`
29
- `).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 $k.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)?Wk.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,n){let s={...t,secureEndpoint:this.isSecureEndpoint(t)},r=this.getName(s),o=this.incrementSockets(r);Promise.resolve().then(()=>this.connect(e,s)).then(a=>{if(this.decrementSockets(r,o),a instanceof Dg.Agent)try{return a.addRequest(e,s)}catch(l){return n(l)}this[$t].currentSocket=a,super.createSocket(e,t,n)},a=>{this.decrementSockets(r,o),n(a)})}createConnection(){let e=this[$t].currentSocket;if(this[$t].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[$t].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[$t]&&(this[$t].defaultPort=e)}get protocol(){return this[$t].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[$t]&&(this[$t].protocol=e)}};ft.Agent=zl});var Ug=C(Dn=>{"use strict";var Vk=Dn&&Dn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Dn,"__esModule",{value:!0});Dn.parseProxyResponse=void 0;var Kk=Vk(se()),go=(0,Kk.default)("https-proxy-agent:parse-proxy-response");function Gk(i){return new Promise((e,t)=>{let n=0,s=[];function r(){let f=i.read();f?p(f):i.once("readable",r)}function o(){i.removeListener("end",a),i.removeListener("error",l),i.removeListener("readable",r)}function a(){o(),go("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}function l(f){o(),go("onerror %o",f),t(f)}function p(f){s.push(f),n+=f.length;let m=Buffer.concat(s,n),_=m.indexOf(`\r
28
+ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,cs="secret must be a string or buffer",jn="key must be a string or a buffer",FE="key must be a string, a buffer or an object",Al=typeof Tt.createPublicKey=="function";Al&&(jn+=" or a KeyObject",cs+="or a KeyObject");function qv(i){if(!Nn.isBuffer(i)&&typeof i!="string"&&(!Al||typeof i!="object"||typeof i.type!="string"||typeof i.asymmetricKeyType!="string"||typeof i.export!="function"))throw Nt(jn)}function Lv(i){if(!Nn.isBuffer(i)&&typeof i!="string"&&typeof i!="object")throw Nt(FE)}function UE(i){if(!Nn.isBuffer(i)){if(typeof i=="string")return i;if(!Al||typeof i!="object"||i.type!=="secret"||typeof i.export!="function")throw Nt(cs)}}function Rl(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Fv(i){i=i.toString();var e=4-i.length%4;if(e!==4)for(var t=0;t<e;++t)i+="=";return i.replace(/\-/g,"+").replace(/_/g,"/")}function Nt(i){var e=[].slice.call(arguments,1),t=Dv.format.bind(Dv,i).apply(null,e);return new TypeError(t)}function HE(i){return Nn.isBuffer(i)||typeof i=="string"}function ls(i){return HE(i)||(i=JSON.stringify(i)),i}function Uv(i){return function(t,n){UE(n),t=ls(t);var s=Tt.createHmac("sha"+i,n),r=(s.update(t),s.digest("base64"));return Rl(r)}}var Ol,zE="timingSafeEqual"in Tt?function(e,t){return e.byteLength!==t.byteLength?!1:Tt.timingSafeEqual(e,t)}:function(e,t){return Ol||(Ol=Nv()),Ol(e,t)};function $E(i){return function(t,n,s){var r=Uv(i)(t,s);return zE(Nn.from(n),Nn.from(r))}}function Hv(i){return function(t,n){Lv(n),t=ls(t);var s=Tt.createSign("RSA-SHA"+i),r=(s.update(t),s.sign(n,"base64"));return Rl(r)}}function zv(i){return function(t,n,s){qv(s),t=ls(t),n=Fv(n);var r=Tt.createVerify("RSA-SHA"+i);return r.update(t),r.verify(s,n,"base64")}}function WE(i){return function(t,n){Lv(n),t=ls(t);var s=Tt.createSign("RSA-SHA"+i),r=(s.update(t),s.sign({key:n,padding:Tt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Tt.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Rl(r)}}function VE(i){return function(t,n,s){qv(s),t=ls(t),n=Fv(n);var r=Tt.createVerify("RSA-SHA"+i);return r.update(t),r.verify({key:s,padding:Tt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Tt.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function KE(i){var e=Hv(i);return function(){var n=e.apply(null,arguments);return n=Iv.derToJose(n,"ES"+i),n}}function GE(i){var e=zv(i);return function(n,s,r){s=Iv.joseToDer(s,"ES"+i).toString("base64");var o=e(n,s,r);return o}}function YE(){return function(){return""}}function JE(){return function(e,t){return t===""}}$v.exports=function(e){var t={hs:Uv,rs:Hv,ps:WE,es:KE,none:YE},n={hs:$E,rs:zv,ps:VE,es:GE,none:JE},s=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!s)throw Nt(LE,e);var r=(s[1]||s[3]).toLowerCase(),o=s[2];return{sign:t[r](o),verify:n[r](o)}}});var Bl=C((NM,Wv)=>{var XE=require("buffer").Buffer;Wv.exports=function(e){return typeof e=="string"?e:typeof e=="number"||XE.isBuffer(e)?e.toString():JSON.stringify(e)}});var Xv=C((DM,Jv)=>{var ZE=Bn().Buffer,Vv=Cl(),QE=Pl(),ek=require("stream"),Kv=Bl(),jl=require("util");function Gv(i,e){return ZE.from(i,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function tk(i,e,t){t=t||"utf8";var n=Gv(Kv(i),"binary"),s=Gv(Kv(e),t);return jl.format("%s.%s",n,s)}function Yv(i){var e=i.header,t=i.payload,n=i.secret||i.privateKey,s=i.encoding,r=QE(e.alg),o=tk(e,t,s),a=r.sign(o,n);return jl.format("%s.%s",o,a)}function uo(i){var e=i.secret;if(e=e??i.privateKey,e=e??i.key,/^hs/i.test(i.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new Vv(e);this.readable=!0,this.header=i.header,this.encoding=i.encoding,this.secret=this.privateKey=this.key=t,this.payload=new Vv(i.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))}jl.inherits(uo,ek);uo.prototype.sign=function(){try{var e=Yv({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")}};uo.sign=Yv;Jv.exports=uo});var ag=C((IM,og)=>{var Qv=Bn().Buffer,Zv=Cl(),ik=Pl(),nk=require("stream"),eg=Bl(),sk=require("util"),rk=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function ok(i){return Object.prototype.toString.call(i)==="[object Object]"}function ak(i){if(ok(i))return i;try{return JSON.parse(i)}catch{return}}function tg(i){var e=i.split(".",1)[0];return ak(Qv.from(e,"base64").toString("binary"))}function ck(i){return i.split(".",2).join(".")}function ig(i){return i.split(".")[2]}function lk(i,e){e=e||"utf8";var t=i.split(".")[1];return Qv.from(t,"base64").toString(e)}function ng(i){return rk.test(i)&&!!tg(i)}function sg(i,e,t){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}i=eg(i);var s=ig(i),r=ck(i),o=ik(e);return o.verify(r,s,t)}function rg(i,e){if(e=e||{},i=eg(i),!ng(i))return null;var t=tg(i);if(!t)return null;var n=lk(i);return(t.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:t,payload:n,signature:ig(i)}}function Dn(i){i=i||{};var e=i.secret;if(e=e??i.publicKey,e=e??i.key,/^hs/i.test(i.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new Zv(e);this.readable=!0,this.algorithm=i.algorithm,this.encoding=i.encoding,this.secret=this.publicKey=this.key=t,this.signature=new Zv(i.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))}sk.inherits(Dn,nk);Dn.prototype.verify=function(){try{var e=sg(this.signature.buffer,this.algorithm,this.key.buffer),t=rg(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")}};Dn.decode=rg;Dn.isValid=ng;Dn.verify=sg;og.exports=Dn});var lg=C(vi=>{var cg=Xv(),po=ag(),uk=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];vi.ALGORITHMS=uk;vi.sign=cg.sign;vi.verify=po.verify;vi.decode=po.decode;vi.isValid=po.isValid;vi.createSign=function(e){return new cg(e)};vi.createVerify=function(e){return new po(e)}});var fo=C((LM,ug)=>{"use strict";var Nl={};Nl.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};Nl.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};ug.exports=Nl});var Dl=C((FM,pg)=>{"use strict";function pk(i){return/^[A-Za-z0-9\-_]+$/.test(i)}pg.exports={validate:pk}});var ql=C((UM,yg)=>{"use strict";var dk=require("crypto"),fk=wv(),hk=lg(),{URL:fg}=require("url"),dg=fo(),hg=Dl(),mk=720*60,vk=1440*60,gk=fk.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 xk(i){return gk.encode({version:1,privateKey:i,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function yk(){let i=dk.createECDH("prime256v1");i.generateKeys();let e=i.getPublicKey(),t=i.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 mg(i){if(!i)throw new Error("No subject set in vapidDetails.subject.");if(typeof i!="string"||i.length===0)throw new Error("The subject value must be a string containing an https: URL or mailto: address. "+i);let e=null;try{e=new fg(i)}catch{throw new Error("Vapid subject is not a valid URL. "+i)}if(!["https:","mailto:"].includes(e.protocol))throw new Error("Vapid subject is not an https: or mailto: URL. "+i);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 vg(i){if(!i)throw new Error("No key set vapidDetails.publicKey");if(typeof i!="string")throw new Error("Vapid public key is must be a URL safe Base 64 encoded string.");if(!hg.validate(i))throw new Error('Vapid public key must be a URL safe Base 64 (without "=")');if(i=Buffer.from(i,"base64url"),i.length!==65)throw new Error("Vapid public key should be 65 bytes long when decoded.")}function gg(i){if(!i)throw new Error("No key set in vapidDetails.privateKey");if(typeof i!="string")throw new Error("Vapid private key must be a URL safe Base 64 encoded string.");if(!hg.validate(i))throw new Error('Vapid private key must be a URL safe Base 64 (without "=")');if(i=Buffer.from(i,"base64url"),i.length!==32)throw new Error("Vapid private key should be 32 bytes long when decoded.")}function Il(i){let e=new Date;return e.setSeconds(e.getSeconds()+i),Math.floor(e.getTime()/1e3)}function xg(i){if(!Number.isInteger(i))throw new Error("`expiration` value must be a number");if(i<0)throw new Error("`expiration` must be a positive integer");let e=Il(vk);if(i>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function bk(i,e,t,n,s,r){if(!i)throw new Error("No audience could be generated for VAPID.");if(typeof i!="string"||i.length===0)throw new Error("The audience value must be a string containing the origin of a push service. "+i);try{new fg(i)}catch{throw new Error("VAPID audience is not a url. "+i)}mg(e),vg(t),gg(n),n=Buffer.from(n,"base64url"),r?xg(r):r=Il(mk);let o={typ:"JWT",alg:"ES256"},a={aud:i,exp:r,sub:e},l=hk.sign({header:o,payload:a,privateKey:xk(n)});if(s===dg.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+l+", k="+t};if(s===dg.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+l,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}yg.exports={generateVAPIDKeys:yk,getFutureExpirationTimestamp:Il,getVapidHeaders:bk,validateSubject:mg,validatePublicKey:vg,validatePrivateKey:gg,validateExpiration:xg}});var Ag=C((HM,Og)=>{"use strict";var mo=require("crypto"),wg="aes-128-gcm",vo={aes128gcm:1,aesgcm:2},Ii=16,zt=16,wk=12,_g=32,us="encrypt",ps="decrypt",K;process.env.ECE_KEYLOG==="1"?K=function(i,e){return console.warn(i+" ["+e.length+"]: "+e.toString("base64url")),e}:K=function(i,e){return e};function ho(i){return typeof i=="string"?Buffer.from(i,"base64url"):i}function Sg(i,e){var t=mo.createHmac("sha256",i);return t.update(e),t.digest()}function Eg(i,e){return K("salt",i),K("ikm",e),K("extract",Sg(i,e))}function Ll(i,e,t){K("prk",i),K("info",e);var n=Buffer.alloc(0),s=Buffer.alloc(0);e=Buffer.from(e,"ascii");for(var r=0,o=Buffer.alloc(1);n.length<t;)o.writeUIntBE(++r,0,1),s=Sg(i,Buffer.concat([s,e,o])),n=Buffer.concat([n,s]);return K("expand",n.slice(0,t))}function kg(i,e,t,n){return Ll(Eg(i,e),t,n)}function Fl(i,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+i+"\0","ascii"),e]);return K("info "+i,t),t}function bg(i){var e=Buffer.concat([Buffer.alloc(2),i]);return e.writeUIntBE(i.length,0,2),e}function _k(i,e){var t=i.privateKey,n,s;if(e===us)n=t.getPublicKey(),s=i.dh;else if(e===ps)n=i.dh,s=t.getPublicKey();else throw new Error("Unknown mode only "+us+" and "+ps+" supported");return{secret:t.computeSecret(i.dh),context:Buffer.concat([Buffer.from(i.keylabel,"ascii"),Buffer.from([0]),bg(s),bg(n)])}}function Sk(i,e){var t={secret:null,context:Buffer.alloc(0)};if(i.key){if(t.secret=i.key,t.secret.length!==zt)throw new Error("An explicit key must be "+zt+" bytes")}else i.dh?t=_k(i,e):typeof i.keyid!==void 0&&(t.secret=i.keymap[i.keyid]);if(!t.secret)throw new Error("Unable to determine key");return K("secret",t.secret),K("context",t.context),i.authSecret&&(t.secret=kg(i.authSecret,t.secret,Fl("auth",Buffer.alloc(0)),_g),K("authsecret",t.secret)),t}function Ek(i,e){if(!i.authSecret)throw new Error("No authentication secret for webpush");K("authsecret",i.authSecret);var t,n,s;if(e===us)n=i.privateKey.getPublicKey(),t=s=i.dh;else if(e===ps)t=n=i.keyid,s=i.privateKey.getPublicKey();else throw new Error("Unknown mode only "+us+" and "+ps+" supported");return K("remote pubkey",t),K("sender pubkey",n),K("receiver pubkey",s),K("secret dh",kg(i.authSecret,i.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),s,n]),_g))}function kk(i,e,t){if(t&&!jk(t))throw new Error("Callback is not a function");if(i.key){if(i.key.length!==zt)throw new Error("An explicit key must be "+zt+" bytes");return K("secret key",i.key)}if(!i.privateKey){if(t)var n=t(i.keyid);else var n=i.keymap&&i.keymap[i.keyid];if(!n)throw new Error('No saved key (keyid: "'+i.keyid+'")');return n}return Ek(i,e)}function Cg(i,e,t){if(!i.salt)throw new Error("must include a salt parameter for "+i.version);var n,s,r;if(i.version==="aesgcm"){var o=Sk(i,e,t);n=Fl("aesgcm",o.context),s=Fl("nonce",o.context),r=o.secret}else if(i.version==="aes128gcm")n=Buffer.from("Content-Encoding: aes128gcm\0"),s=Buffer.from("Content-Encoding: nonce\0"),r=kk(i,e,t);else throw new Error("Unable to set context for mode "+i.version);var a=Eg(i.salt,r),l={key:Ll(a,n,zt),nonce:Ll(a,s,wk)};return K("key",l.key),K("nonce base",l.nonce),l}function Tg(i){var e={};e.version=i.version||"aes128gcm",e.rs=parseInt(i.rs,10),isNaN(e.rs)&&(e.rs=4096);var t=vo[e.version];if(e.version==="aes128gcm"&&(t+=Ii),e.rs<=t)throw new Error("The rs parameter has to be greater than "+t);if(i.salt&&(e.salt=ho(i.salt),e.salt.length!==zt))throw new Error("The salt parameter must be "+zt+" bytes");return e.keyid=i.keyid,i.key?e.key=ho(i.key):(e.privateKey=i.privateKey,e.privateKey||(e.keymap=i.keymap),e.version!=="aes128gcm"&&(e.keylabel=i.keylabel||"P-256"),i.dh&&(e.dh=ho(i.dh))),i.authSecret&&(e.authSecret=ho(i.authSecret)),e}function Mg(i,e){var t=Buffer.from(i),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),K("nonce"+e,t),t}function Ck(i,e){var t=i.readUIntBE(20,1);return e.salt=i.slice(0,zt),e.rs=i.readUIntBE(zt,4),e.keyid=i.slice(21,21+t),21+t}function Tk(i,e){var t=vo[e],n=i.readUIntBE(0,t);if(n+t>i.length)throw new Error("padding exceeds block size");K("padding",i.slice(0,t+n));var s=Buffer.alloc(n);if(s.fill(0),s.compare(i.slice(t,t+n))!==0)throw new Error("invalid padding");return i.slice(t+n)}function Mk(i,e){for(var t=i.length-1;t>=0;){if(i[t]){if(e){if(i[t]!==2)throw new Error("last record needs to start padding with a 2")}else if(i[t]!==1)throw new Error("last record needs to start padding with a 2");return i.slice(0,t)}--t}throw new Error("all zero plaintext")}function Ok(i,e,t,n,s){K("decrypt",t);var r=Mg(i.nonce,e),o=mo.createDecipheriv(wg,i.key,r);o.setAuthTag(t.slice(t.length-Ii));var a=o.update(t.slice(0,t.length-Ii));return a=Buffer.concat([a,o.final()]),K("decrypted",a),n.version!=="aes128gcm"?Tk(a,n.version):Mk(a,s)}function Ak(i,e,t){var n=Tg(e);if(n.version==="aes128gcm"){var s=Ck(i,n);i=i.slice(s)}var r=Cg(n,ps,t),o=0,a=Buffer.alloc(0),l=n.rs;n.version!=="aes128gcm"&&(l+=Ii);for(var p=0;o<i.length;++p){var f=o+l;if(n.version!=="aes128gcm"&&f===i.length)throw new Error("Truncated payload");if(f=Math.min(f,i.length),f-o<=Ii)throw new Error("Invalid block: too small at "+p);var m=Ok(r,p,i.slice(o,f),n,f>=i.length);a=Buffer.concat([a,m]),o=f}return a}function Rk(i,e,t,n,s,r){K("encrypt",t),n=n||0;var o=Mg(i.nonce,e),a=mo.createCipheriv(wg,i.key,o),l=[],p=vo[s.version],f=Buffer.alloc(n+p);if(f.fill(0),s.version!=="aes128gcm"){if(f.writeUIntBE(n,0,p),K("padding",f),l.push(a.update(f)),l.push(a.update(t)),!r&&f.length+t.length<s.rs)throw new Error("Unable to pad to record size")}else l.push(a.update(t)),f.writeUIntBE(r?2:1,0,1),K("padding",f),l.push(a.update(f));a.final();var m=a.getAuthTag();if(m.length!==Ii)throw new Error("invalid tag generated");return l.push(m),K("encrypted",Buffer.concat(l))}function Pk(i){var e=Buffer.alloc(5),t=Buffer.from(i.keyid||[]);if(t.length>255)throw new Error("keyid is too large");return e.writeUIntBE(i.rs,0,4),e.writeUIntBE(t.length,4,1),Buffer.concat([i.salt,e,t])}function Bk(i,e,t){if(!Buffer.isBuffer(i))throw new Error("buffer argument must be a Buffer");var n=Tg(e);n.salt||(n.salt=mo.randomBytes(zt));var s;n.version==="aes128gcm"?(n.privateKey&&!n.keyid&&(n.keyid=n.privateKey.getPublicKey()),s=Pk(n)):s=Buffer.alloc(0);var r=Cg(n,us,t),o=0,a=vo[n.version],l=a;n.version==="aes128gcm"&&(l+=Ii);for(var p=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),f=0,m=!1;!m;){var _=Math.min(n.rs-l-1,p);n.version!=="aes128gcm"&&(_=Math.min((1<<a*8)-1,_)),p>0&&_===0&&++_,p-=_;var E=o+n.rs-l-_;n.version!=="aes128gcm"?m=E>i.length:m=E>=i.length,m=m&&p<=0;var k=Rk(r,f,i.slice(o,E),_,n,m);s=Buffer.concat([s,k]),o=E,++f}return s}function jk(i){return typeof i=="function"}Og.exports={decrypt:Ak,encrypt:Bk}});var Ul=C((zM,Pg)=>{"use strict";var Rg=require("crypto"),Nk=Ag(),Dk=function(i,e,t,n){if(!i)throw new Error("No user public key provided for encryption.");if(typeof i!="string")throw new Error("The subscription p256dh value must be a string.");if(Buffer.from(i,"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=Rg.createECDH("prime256v1"),r=s.generateKeys(),o=Rg.randomBytes(16).toString("base64url"),a=Nk.encrypt(t,{version:n,dh:i,privateKey:s,salt:o,authSecret:e});return{localPublicKey:r,salt:o,cipherText:a}};Pg.exports={encrypt:Dk}});var Hl=C(($M,jg)=>{"use strict";function Bg(i,e,t,n,s){Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=i,this.statusCode=e,this.headers=t,this.body=n,this.endpoint=s}require("util").inherits(Bg,Error);jg.exports=Bg});var Ig=C(rt=>{"use strict";var Ik=rt&&rt.__createBinding||(Object.create?(function(i,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(i,n,s)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),qk=rt&&rt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Ng=rt&&rt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&Ik(e,i,t);return qk(e,i),e};Object.defineProperty(rt,"__esModule",{value:!0});rt.req=rt.json=rt.toBuffer=void 0;var Lk=Ng(require("http")),Fk=Ng(require("https"));async function Dg(i){let e=0,t=[];for await(let n of i)e+=n.length,t.push(n);return Buffer.concat(t,e)}rt.toBuffer=Dg;async function Uk(i){let t=(await Dg(i)).toString("utf8");try{return JSON.parse(t)}catch(n){let s=n;throw s.message+=` (input: ${t})`,s}}rt.json=Uk;function Hk(i,e={}){let n=((typeof i=="string"?i:i.href).startsWith("https:")?Fk:Lk).request(i,e),s=new Promise((r,o)=>{n.once("response",r).once("error",o).end()});return n.then=s.then.bind(s),n}rt.req=Hk});var Ug=C(ft=>{"use strict";var Lg=ft&&ft.__createBinding||(Object.create?(function(i,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(i,n,s)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),zk=ft&&ft.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Fg=ft&&ft.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&Lg(e,i,t);return zk(e,i),e},$k=ft&&ft.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Lg(e,i,t)};Object.defineProperty(ft,"__esModule",{value:!0});ft.Agent=void 0;var Wk=Fg(require("net")),qg=Fg(require("http")),Vk=require("https");$k(Ig(),ft);var $t=Symbol("AgentBaseInternalState"),zl=class extends qg.Agent{constructor(e){super(e),this[$t]={}}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(`
29
+ `).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 Wk.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)?Vk.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,n){let s={...t,secureEndpoint:this.isSecureEndpoint(t)},r=this.getName(s),o=this.incrementSockets(r);Promise.resolve().then(()=>this.connect(e,s)).then(a=>{if(this.decrementSockets(r,o),a instanceof qg.Agent)try{return a.addRequest(e,s)}catch(l){return n(l)}this[$t].currentSocket=a,super.createSocket(e,t,n)},a=>{this.decrementSockets(r,o),n(a)})}createConnection(){let e=this[$t].currentSocket;if(this[$t].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[$t].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[$t]&&(this[$t].defaultPort=e)}get protocol(){return this[$t].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[$t]&&(this[$t].protocol=e)}};ft.Agent=zl});var Hg=C(In=>{"use strict";var Kk=In&&In.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(In,"__esModule",{value:!0});In.parseProxyResponse=void 0;var Gk=Kk(se()),go=(0,Gk.default)("https-proxy-agent:parse-proxy-response");function Yk(i){return new Promise((e,t)=>{let n=0,s=[];function r(){let f=i.read();f?p(f):i.once("readable",r)}function o(){i.removeListener("end",a),i.removeListener("error",l),i.removeListener("readable",r)}function a(){o(),go("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}function l(f){o(),go("onerror %o",f),t(f)}function p(f){s.push(f),n+=f.length;let m=Buffer.concat(s,n),_=m.indexOf(`\r
30
30
  \r
31
31
  `);if(_===-1){go("have not received end of HTTP headers yet..."),r();return}let E=m.slice(0,_).toString("ascii").split(`\r
32
- `),k=E.shift();if(!k)return i.destroy(),t(new Error("No header received from proxy CONNECT response"));let T=k.split(" "),O=+T[1],M=T.slice(2).join(" "),A={};for(let I of E){if(!I)continue;let U=I.indexOf(":");if(U===-1)return i.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${I}"`));let ie=I.slice(0,U).toLowerCase(),J=I.slice(U+1).trimStart(),ne=A[ie];typeof ne=="string"?A[ie]=[ne,J]:Array.isArray(ne)?ne.push(J):A[ie]=J}go("got proxy server response: %o %o",k,A),o(),e({connect:{statusCode:O,statusText:M,headers:A},buffered:m})}i.on("error",l),i.on("end",a),r()})}Dn.parseProxyResponse=Gk});var Kg=C(Mt=>{"use strict";var Yk=Mt&&Mt.__createBinding||(Object.create?(function(i,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(i,n,s)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),Jk=Mt&&Mt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Wg=Mt&&Mt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&Yk(e,i,t);return Jk(e,i),e},Vg=Mt&&Mt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.HttpsProxyAgent=void 0;var xo=Wg(require("net")),Hg=Wg(require("tls")),Xk=Vg(require("assert")),Zk=Vg(se()),Qk=Fg(),eC=require("url"),tC=Ug(),ds=(0,Zk.default)("https-proxy-agent"),zg=i=>i.servername===void 0&&i.host&&!xo.isIP(i.host)?{...i,servername:i.host}:i,yo=class extends Qk.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new eC.URL(e):e,this.proxyHeaders=t?.headers??{},ds("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?$g(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:"?(ds("Creating `tls.Socket`: %o",this.connectOpts),s=Hg.connect(zg(this.connectOpts))):(ds("Creating `net.Socket`: %o",this.connectOpts),s=xo.connect(this.connectOpts));let r=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=xo.isIPv6(t.host)?`[${t.host}]`:t.host,a=`CONNECT ${o}:${t.port} HTTP/1.1\r
32
+ `),k=E.shift();if(!k)return i.destroy(),t(new Error("No header received from proxy CONNECT response"));let T=k.split(" "),O=+T[1],M=T.slice(2).join(" "),A={};for(let D of E){if(!D)continue;let U=D.indexOf(":");if(U===-1)return i.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${D}"`));let ie=D.slice(0,U).toLowerCase(),J=D.slice(U+1).trimStart(),ne=A[ie];typeof ne=="string"?A[ie]=[ne,J]:Array.isArray(ne)?ne.push(J):A[ie]=J}go("got proxy server response: %o %o",k,A),o(),e({connect:{statusCode:O,statusText:M,headers:A},buffered:m})}i.on("error",l),i.on("end",a),r()})}In.parseProxyResponse=Yk});var Gg=C(Mt=>{"use strict";var Jk=Mt&&Mt.__createBinding||(Object.create?(function(i,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(i,n,s)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),Xk=Mt&&Mt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Vg=Mt&&Mt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&Jk(e,i,t);return Xk(e,i),e},Kg=Mt&&Mt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.HttpsProxyAgent=void 0;var xo=Vg(require("net")),zg=Vg(require("tls")),Zk=Kg(require("assert")),Qk=Kg(se()),eC=Ug(),tC=require("url"),iC=Hg(),ds=(0,Qk.default)("https-proxy-agent"),$g=i=>i.servername===void 0&&i.host&&!xo.isIP(i.host)?{...i,servername:i.host}:i,yo=class extends eC.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new tC.URL(e):e,this.proxyHeaders=t?.headers??{},ds("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?Wg(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:"?(ds("Creating `tls.Socket`: %o",this.connectOpts),s=zg.connect($g(this.connectOpts))):(ds("Creating `net.Socket`: %o",this.connectOpts),s=xo.connect(this.connectOpts));let r=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=xo.isIPv6(t.host)?`[${t.host}]`:t.host,a=`CONNECT ${o}:${t.port} HTTP/1.1\r
33
33
  `;if(n.username||n.password){let _=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;r["Proxy-Authorization"]=`Basic ${Buffer.from(_).toString("base64")}`}r.Host=`${o}:${t.port}`,r["Proxy-Connection"]||(r["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let _ of Object.keys(r))a+=`${_}: ${r[_]}\r
34
- `;let l=(0,tC.parseProxyResponse)(s);s.write(`${a}\r
35
- `);let{connect:p,buffered:f}=await l;if(e.emit("proxyConnect",p),this.emit("proxyConnect",p,e),p.statusCode===200)return e.once("socket",iC),t.secureEndpoint?(ds("Upgrading socket connection to TLS"),Hg.connect({...$g(zg(t),"host","path","port"),socket:s})):s;s.destroy();let m=new xo.Socket({writable:!1});return m.readable=!0,e.once("socket",_=>{ds("Replaying proxy buffer for failed request"),(0,Xk.default)(_.listenerCount("data")>0),_.push(f),_.push(null)}),m}};yo.protocols=["http","https"];Mt.HttpsProxyAgent=yo;function iC(i){i.resume()}function $g(i,...e){let t={},n;for(n in i)e.includes(n)||(t[n]=i[n]);return t}});var Zg=C((GM,Xg)=>{"use strict";var Yg=require("url"),Jg=require("https"),nC=Hl(),bo=ql(),sC=Ul(),ht=fo(),rC=Il(),Gg=2419200,$l="",Wl;function fs(){}fs.prototype.setGCMAPIKey=function(i){if(i===null){$l=null;return}if(typeof i>"u"||typeof i!="string"||i.length===0)throw new Error("The GCM API Key should be a non-empty string or null.");$l=i};fs.prototype.setVapidDetails=function(i,e,t){if(arguments.length===1&&arguments[0]===null){Wl=null;return}bo.validateSubject(i),bo.validatePublicKey(e),bo.validatePrivateKey(t),Wl={subject:i,publicKey:e,privateKey:t}};fs.prototype.generateRequestDetails=function(i,e,t){if(!i||!i.endpoint)throw new Error("You must pass in a subscription with at least an endpoint.");if(typeof i.endpoint!="string"||i.endpoint.length===0)throw new Error("The subscription endpoint must be a string with a valid URL.");if(e&&(typeof i!="object"||!i.keys||!i.keys.p256dh||!i.keys.auth))throw new Error("To send a message with a payload, the subscription must have 'auth' and 'p256dh' keys.");let n=$l,s=Wl,r=Gg,o={},a=ht.supportedContentEncodings.AES_128_GCM,l=ht.supportedUrgency.NORMAL,p,f,m,_;if(t){let M=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],A=Object.keys(t);for(let I=0;I<A.length;I+=1){let U=A[I];if(!M.includes(U))throw new Error("'"+U+"' is an invalid option. The valid options are ['"+M.join("', '")+"'].")}if(t.headers){o=t.headers;let I=Object.keys(o).filter(function(U){return typeof t[U]<"u"});if(I.length>0)throw new Error("Duplicated headers defined ["+I.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&&(r=Number(t.TTL),r<0))throw new Error("TTL should be a number and should be at least 0");if(t.contentEncoding)if(t.contentEncoding===ht.supportedContentEncodings.AES_128_GCM||t.contentEncoding===ht.supportedContentEncodings.AES_GCM)a=t.contentEncoding;else throw new Error("Unsupported content encoding specified.");if(t.urgency)if(t.urgency===ht.supportedUrgency.VERY_LOW||t.urgency===ht.supportedUrgency.LOW||t.urgency===ht.supportedUrgency.NORMAL||t.urgency===ht.supportedUrgency.HIGH)l=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!rC.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");p=t.topic}t.proxy&&(typeof t.proxy=="string"||typeof t.proxy.host=="string"?f=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 Jg.Agent?(f&&console.warn("Agent option will be ignored because proxy option is defined."),m=t.agent):console.warn("Wrong type for the agent option, it should be an instance of https.Agent.")),typeof t.timeout=="number"&&(_=t.timeout)}typeof r>"u"&&(r=Gg);let E={method:"POST",headers:{TTL:r}};Object.keys(o).forEach(function(M){E.headers[M]=o[M]});let k=null;if(e){let M=sC.encrypt(i.keys.p256dh,i.keys.auth,e,a);E.headers["Content-Length"]=M.cipherText.length,E.headers["Content-Type"]="application/octet-stream",a===ht.supportedContentEncodings.AES_128_GCM?E.headers["Content-Encoding"]=ht.supportedContentEncodings.AES_128_GCM:a===ht.supportedContentEncodings.AES_GCM&&(E.headers["Content-Encoding"]=ht.supportedContentEncodings.AES_GCM,E.headers.Encryption="salt="+M.salt,E.headers["Crypto-Key"]="dh="+M.localPublicKey.toString("base64url")),k=M.cipherText}else E.headers["Content-Length"]=0;let T=i.endpoint.startsWith("https://android.googleapis.com/gcm/send"),O=i.endpoint.startsWith("https://fcm.googleapis.com/fcm/send");if(T)n?E.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=Yg.parse(i.endpoint),A=M.protocol+"//"+M.host,I=bo.getVapidHeaders(A,s.subject,s.publicKey,s.privateKey,a);E.headers.Authorization=I.Authorization,a===ht.supportedContentEncodings.AES_GCM&&(E.headers["Crypto-Key"]?E.headers["Crypto-Key"]+=";"+I["Crypto-Key"]:E.headers["Crypto-Key"]=I["Crypto-Key"])}else O&&n&&(E.headers.Authorization="key="+n);return E.headers.Urgency=l,p&&(E.headers.Topic=p),E.body=k,E.endpoint=i.endpoint,f&&(E.proxy=f),m&&(E.agent=m),_&&(E.timeout=_),E};fs.prototype.sendNotification=function(i,e,t){let n;try{n=this.generateRequestDetails(i,e,t)}catch(s){return Promise.reject(s)}return new Promise(function(s,r){let o={},a=Yg.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:p}=Kg();o.agent=new p(n.proxy)}let l=Jg.request(o,function(p){let f="";p.on("data",function(m){f+=m}),p.on("end",function(){p.statusCode<200||p.statusCode>299?r(new nC("Received unexpected response code",p.statusCode,p.headers,f,n.endpoint)):s({statusCode:p.statusCode,body:f,headers:p.headers})})});n.timeout&&l.on("timeout",function(){l.destroy(new Error("Socket timeout"))}),l.on("error",function(p){r(p)}),n.body&&l.write(n.body),l.end()})};Xg.exports=fs});var t0=C((YM,e0)=>{"use strict";var Qg=ql(),oC=Ul(),aC=Zg(),cC=Hl(),lC=fo(),hs=new aC;e0.exports={WebPushError:cC,supportedContentEncodings:lC.supportedContentEncodings,encrypt:oC.encrypt,getVapidHeaders:Qg.getVapidHeaders,generateVAPIDKeys:Qg.generateVAPIDKeys,setGCMAPIKey:hs.setGCMAPIKey,setVapidDetails:hs.setVapidDetails,generateRequestDetails:hs.generateRequestDetails,sendNotification:hs.sendNotification.bind(hs)}});var K0=C((SO,tu)=>{"use strict";var RC=Object.prototype.hasOwnProperty,tt="~";function bs(){}Object.create&&(bs.prototype=Object.create(null),new bs().__proto__||(tt=!1));function PC(i,e,t){this.fn=i,this.context=e,this.once=t||!1}function V0(i,e,t,n,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var r=new PC(t,n||i,s),o=tt?tt+e:e;return i._events[o]?i._events[o].fn?i._events[o]=[i._events[o],r]:i._events[o].push(r):(i._events[o]=r,i._eventsCount++),i}function Ao(i,e){--i._eventsCount===0?i._events=new bs:delete i._events[e]}function Xe(){this._events=new bs,this._eventsCount=0}Xe.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)RC.call(t,n)&&e.push(tt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Xe.prototype.listeners=function(e){var t=tt?tt+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,o=new Array(r);s<r;s++)o[s]=n[s].fn;return o};Xe.prototype.listenerCount=function(e){var t=tt?tt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};Xe.prototype.emit=function(e,t,n,s,r,o){var a=tt?tt+e:e;if(!this._events[a])return!1;var l=this._events[a],p=arguments.length,f,m;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),p){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,s),!0;case 5:return l.fn.call(l.context,t,n,s,r),!0;case 6:return l.fn.call(l.context,t,n,s,r,o),!0}for(m=1,f=new Array(p-1);m<p;m++)f[m-1]=arguments[m];l.fn.apply(l.context,f)}else{var _=l.length,E;for(m=0;m<_;m++)switch(l[m].once&&this.removeListener(e,l[m].fn,void 0,!0),p){case 1:l[m].fn.call(l[m].context);break;case 2:l[m].fn.call(l[m].context,t);break;case 3:l[m].fn.call(l[m].context,t,n);break;case 4:l[m].fn.call(l[m].context,t,n,s);break;default:if(!f)for(E=1,f=new Array(p-1);E<p;E++)f[E-1]=arguments[E];l[m].fn.apply(l[m].context,f)}}return!0};Xe.prototype.on=function(e,t,n){return V0(this,e,t,n,!1)};Xe.prototype.once=function(e,t,n){return V0(this,e,t,n,!0)};Xe.prototype.removeListener=function(e,t,n,s){var r=tt?tt+e:e;if(!this._events[r])return this;if(!t)return Ao(this,r),this;var o=this._events[r];if(o.fn)o.fn===t&&(!s||o.once)&&(!n||o.context===n)&&Ao(this,r);else{for(var a=0,l=[],p=o.length;a<p;a++)(o[a].fn!==t||s&&!o[a].once||n&&o[a].context!==n)&&l.push(o[a]);l.length?this._events[r]=l.length===1?l[0]:l:Ao(this,r)}return this};Xe.prototype.removeAllListeners=function(e){var t;return e?(t=tt?tt+e:e,this._events[t]&&Ao(this,t)):(this._events=new bs,this._eventsCount=0),this};Xe.prototype.off=Xe.prototype.removeListener;Xe.prototype.addListener=Xe.prototype.on;Xe.prefixed=tt;Xe.EventEmitter=Xe;typeof tu<"u"&&(tu.exports=Xe)});var Y0=C((EO,G0)=>{"use strict";G0.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 Ro=C(X0=>{var ni=X0,BC=require("url"),J0=require("util")._extend,jC=Y0(),NC=/(^|,)\s*upgrade\s*($|,)/i,iu=/^https|wss/;ni.isSSL=iu;ni.setupOutgoing=function(i,e,t,n){i.port=e[n||"target"].port||(iu.test(e[n||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(a){i[a]=e[n||"target"][a]}),i.method=e.method||t.method,i.headers=J0({},t.headers),e.headers&&J0(i.headers,e.headers),e.auth&&(i.auth=e.auth),e.ca&&(i.ca=e.ca),iu.test(e[n||"target"].protocol)&&(i.rejectUnauthorized=typeof e.secure>"u"?!0:e.secure),i.agent=e.agent||!1,i.localAddress=e.localAddress,i.agent||(i.headers=i.headers||{},(typeof i.headers.connection!="string"||!NC.test(i.headers.connection))&&(i.headers.connection="close"));var s=e[n||"target"],r=s&&e.prependPath!==!1&&s.path||"",o=e.toProxy?t.url:BC.parse(t.url).path||"";return o=e.ignorePath?"":o,i.path=ni.urlJoin(r,o),e.changeOrigin&&(i.headers.host=jC(i.port,e[n||"target"].protocol)&&!IC(i.host)?i.host+":"+i.port:i.host),i};ni.setupSocket=function(i){return i.setTimeout(0),i.setNoDelay(!0),i.setKeepAlive(!0,0),i};ni.getPort=function(i){var e=i.headers.host?i.headers.host.match(/:(\d+)/):"";return e?e[1]:ni.hasEncryptedConnection(i)?"443":"80"};ni.hasEncryptedConnection=function(i){return!!(i.connection.encrypted||i.connection.pair)};ni.urlJoin=function(){var i=Array.prototype.slice.call(arguments),e=i.length-1,t=i[e],n=t.split("?"),s;return i[e]=n.shift(),s=[i.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")],s.push.apply(s,n),s.join("?")};ni.rewriteCookieProperty=function i(e,t,n){return Array.isArray(e)?e.map(function(s){return i(s,t,n)}):e.replace(new RegExp("(;\\s*"+n+"=)([^;]+)","i"),function(s,r,o){var a;if(o in t)a=t[o];else if("*"in t)a=t["*"];else return s;return a?r+a:""})};function IC(i){return!!~i.indexOf(":")}});var tx=C((CO,ex)=>{var Z0=require("url"),Q0=Ro(),DC=/^201|30(1|2|7|8)$/;ex.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&&DC.test(n.statusCode)){var r=Z0.parse(s.target),o=Z0.parse(n.headers.location);if(r.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 r=s.cookieDomainRewrite,o=s.cookiePathRewrite,a=s.preserveHeaderKeyCase,l,p=function(_,E){E!=null&&(r&&_.toLowerCase()==="set-cookie"&&(E=Q0.rewriteCookieProperty(E,r,"domain")),o&&_.toLowerCase()==="set-cookie"&&(E=Q0.rewriteCookieProperty(E,o,"path")),t.setHeader(String(_).trim(),E))};if(typeof r=="string"&&(r={"*":r}),typeof o=="string"&&(o={"*":o}),a&&n.rawHeaders!=null){l={};for(var f=0;f<n.rawHeaders.length;f+=2){var m=n.rawHeaders[f];l[m.toLowerCase()]=m}}Object.keys(n.headers).forEach(function(_){var E=n.headers[_];a&&l&&(_=l[_]||_),p(_,E)})},writeStatusCode:function(e,t,n){n.statusMessage?(t.statusCode=n.statusCode,t.statusMessage=n.statusMessage):t.statusCode=n.statusCode}}});var nx=C((TO,ix)=>{var ws;ix.exports=function(){if(!ws){try{ws=se()("follow-redirects")}catch{}typeof ws!="function"&&(ws=function(){})}ws.apply(null,arguments)}});var cx=C((MO,hu)=>{var Ss=require("url"),_s=Ss.URL,qC=require("http"),LC=require("https"),au=require("stream").Writable,cu=require("assert"),sx=nx();(function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",n=Fi(Error.captureStackTrace);!e&&(t||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var lu=!1;try{cu(new _s(""))}catch(i){lu=i.code==="ERR_INVALID_URL"}var FC=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],uu=["abort","aborted","connect","error","socket","timeout"],pu=Object.create(null);uu.forEach(function(i){pu[i]=function(e,t,n){this._redirectable.emit(i,e,t,n)}});var su=Es("ERR_INVALID_URL","Invalid URL",TypeError),ru=Es("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),UC=Es("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",ru),HC=Es("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),zC=Es("ERR_STREAM_WRITE_AFTER_END","write after end"),$C=au.prototype.destroy||ox;function at(i,e){au.call(this),this._sanitizeOptions(i),this._options=i,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 ru?s:new ru({cause:s}))}},this._performRequest()}at.prototype=Object.create(au.prototype);at.prototype.abort=function(){fu(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};at.prototype.destroy=function(i){return fu(this._currentRequest,i),$C.call(this,i),this};at.prototype.write=function(i,e,t){if(this._ending)throw new zC;if(!Li(i)&&!KC(i))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Fi(e)&&(t=e,e=null),i.length===0){t&&t();return}this._requestBodyLength+i.length<=this._options.maxBodyLength?(this._requestBodyLength+=i.length,this._requestBodyBuffers.push({data:i,encoding:e}),this._currentRequest.write(i,e,t)):(this.emit("error",new HC),this.abort())};at.prototype.end=function(i,e,t){if(Fi(i)?(t=i,i=e=null):Fi(e)&&(t=e,e=null),!i)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var n=this,s=this._currentRequest;this.write(i,e,function(){n._ended=!0,s.end(null,null,t)}),this._ending=!0}};at.prototype.setHeader=function(i,e){this._options.headers[i]=e,this._currentRequest.setHeader(i,e)};at.prototype.removeHeader=function(i){delete this._options.headers[i],this._currentRequest.removeHeader(i)};at.prototype.setTimeout=function(i,e){var t=this;function n(o){o.setTimeout(i),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"),r()},i),n(o)}function r(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",r),t.removeListener("error",r),t.removeListener("response",r),t.removeListener("close",r),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",r),this.on("error",r),this.on("response",r),this.on("close",r),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(i){at.prototype[i]=function(e,t){return this._currentRequest[i](e,t)}});["aborted","connection","socket"].forEach(function(i){Object.defineProperty(at.prototype,i,{get:function(){return this._currentRequest[i]}})});at.prototype._sanitizeOptions=function(i){if(i.headers||(i.headers={}),i.host&&(i.hostname||(i.hostname=i.host),delete i.host),!i.pathname&&i.path){var e=i.path.indexOf("?");e<0?i.pathname=i.path:(i.pathname=i.path.substring(0,e),i.search=i.path.substring(e))}};at.prototype._performRequest=function(){var i=this._options.protocol,e=this._options.nativeProtocols[i];if(!e)throw new TypeError("Unsupported protocol "+i);if(this._options.agents){var t=i.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 uu)n.on(s,pu[s]);if(this._currentUrl=/^\//.test(this._options.path)?Ss.format(this._options):this._options.path,this._isRedirect){var r=0,o=this,a=this._requestBodyBuffers;(function l(p){if(n===o._currentRequest)if(p)o.emit("error",p);else if(r<a.length){var f=a[r++];n.finished||n.write(f.data,f.encoding,l)}else o._ended&&n.end()})()}};at.prototype._processResponse=function(i){var e=i.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:i.headers,statusCode:e});var t=i.headers.location;if(!t||this._options.followRedirects===!1||e<300||e>=400){i.responseUrl=this._currentUrl,i.redirects=this._redirects,this.emit("response",i),this._requestBodyBuffers=[];return}if(fu(this._currentRequest),i.destroy(),++this._redirectCount>this._options.maxRedirects)throw new UC;var n,s=this._options.beforeRedirect;s&&(n=Object.assign({Host:i.req.getHeader("host")},this._options.headers));var r=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=[],nu(/^content-/i,this._options.headers));var o=nu(/^host$/i,this._options.headers),a=du(this._currentUrl),l=o||a.host,p=/^\w+:/.test(t)?this._currentUrl:Ss.format(Object.assign(a,{host:l})),f=WC(t,p);if(sx("redirecting to",f.href),this._isRedirect=!0,ou(f,this._options),(f.protocol!==a.protocol&&f.protocol!=="https:"||f.host!==l&&!VC(f.host,l))&&nu(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),Fi(s)){var m={headers:i.headers,statusCode:e},_={url:p,method:r,headers:n};s(this._options,m,_),this._sanitizeOptions(this._options)}this._performRequest()};function rx(i){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(i).forEach(function(n){var s=n+":",r=t[s]=i[n],o=e[n]=Object.create(r);function a(p,f,m){return GC(p)?p=ou(p):Li(p)?p=ou(du(p)):(m=f,f=ax(p),p={protocol:s}),Fi(f)&&(m=f,f=null),f=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},p,f),f.nativeProtocols=t,!Li(f.host)&&!Li(f.hostname)&&(f.hostname="::1"),cu.equal(f.protocol,s,"protocol mismatch"),sx("options",f),new at(f,m)}function l(p,f,m){var _=o.request(p,f,m);return _.end(),_}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:l,configurable:!0,enumerable:!0,writable:!0}})}),e}function ox(){}function du(i){var e;if(lu)e=new _s(i);else if(e=ax(Ss.parse(i)),!Li(e.protocol))throw new su({input:i});return e}function WC(i,e){return lu?new _s(i,e):du(Ss.resolve(e,i))}function ax(i){if(/^\[/.test(i.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(i.hostname))throw new su({input:i.href||i});if(/^\[/.test(i.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(i.host))throw new su({input:i.href||i});return i}function ou(i,e){var t=e||{};for(var n of FC)t[n]=i[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 nu(i,e){var t;for(var n in e)i.test(n)&&(t=e[n],delete e[n]);return t===null||typeof t>"u"?void 0:String(t).trim()}function Es(i,e,t){function n(s){Fi(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,s||{}),this.code=i,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 ["+i+"]",enumerable:!1}}),n}function fu(i,e){for(var t of uu)i.removeListener(t,pu[t]);i.on("error",ox),i.destroy(e)}function VC(i,e){cu(Li(i)&&Li(e));var t=i.length-e.length-1;return t>0&&i[t]==="."&&i.endsWith(e)}function Li(i){return typeof i=="string"||i instanceof String}function Fi(i){return typeof i=="function"}function KC(i){return typeof i=="object"&&"length"in i}function GC(i){return _s&&i instanceof _s}hu.exports=rx({http:qC,https:LC});hu.exports.wrap=rx});var ux=C((OO,lx)=>{var YC=require("http"),JC=require("https"),ks=tx(),Po=Ro(),XC=cx();ks=Object.keys(ks).map(function(i){return ks[i]});var ZC={http:YC,https:JC};lx.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||Po.hasEncryptedConnection(e),r={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Po.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]?",":"")+r[o]}),e.headers["x-forwarded-host"]=e.headers["x-forwarded-host"]||e.headers.host||""}},stream:function(e,t,n,s,r,o){r.emit("start",e,t,n.target||n.forward);var a=n.followRedirects?XC:ZC,l=a.http,p=a.https;if(n.forward){var f=(n.forward.protocol==="https:"?p:l).request(Po.setupOutgoing(n.ssl||{},n,e,"forward")),m=k(f,n.forward);if(e.on("error",m),f.on("error",m),(n.buffer||e).pipe(f),!n.target)return t.end()}var _=(n.target.protocol==="https:"?p:l).request(Po.setupOutgoing(n.ssl||{},n,e));_.on("socket",function(T){r&&!_.getHeader("expect")&&r.emit("proxyReq",_,e,t,n)}),n.proxyTimeout&&_.setTimeout(n.proxyTimeout,function(){_.abort()}),e.on("aborted",function(){_.abort()});var E=k(_,n.target);e.on("error",E),_.on("error",E);function k(T,O){return function(A){if(e.socket.destroyed&&A.code==="ECONNRESET")return r.emit("econnreset",A,e,t,O),T.abort();o?o(A,e,t,O):r.emit("error",A,e,t,O)}}(n.buffer||e).pipe(_),_.on("response",function(T){if(r&&r.emit("proxyRes",T,e,t),!t.headersSent&&!n.selfHandleResponse)for(var O=0;O<ks.length&&!ks[O](e,t,T,n);O++);t.finished?r&&r.emit("end",e,t,T):(T.on("end",function(){r&&r.emit("end",e,t,T)}),n.selfHandleResponse||T.pipe(t))})}}});var dx=C((AO,px)=>{var QC=require("http"),e2=require("https"),Un=Ro();px.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:Un.getPort(e),proto:Un.hasEncryptedConnection(e)?"wss":"ws"};["for","port","proto"].forEach(function(r){e.headers["x-forwarded-"+r]=(e.headers["x-forwarded-"+r]||"")+(e.headers["x-forwarded-"+r]?",":"")+s[r]})}},stream:function(e,t,n,s,r,o){var a=function(f,m){return Object.keys(m).reduce(function(_,E){var k=m[E];if(!Array.isArray(k))return _.push(E+": "+k),_;for(var T=0;T<k.length;T++)_.push(E+": "+k[T]);return _},[f]).join(`\r
34
+ `;let l=(0,iC.parseProxyResponse)(s);s.write(`${a}\r
35
+ `);let{connect:p,buffered:f}=await l;if(e.emit("proxyConnect",p),this.emit("proxyConnect",p,e),p.statusCode===200)return e.once("socket",nC),t.secureEndpoint?(ds("Upgrading socket connection to TLS"),zg.connect({...Wg($g(t),"host","path","port"),socket:s})):s;s.destroy();let m=new xo.Socket({writable:!1});return m.readable=!0,e.once("socket",_=>{ds("Replaying proxy buffer for failed request"),(0,Zk.default)(_.listenerCount("data")>0),_.push(f),_.push(null)}),m}};yo.protocols=["http","https"];Mt.HttpsProxyAgent=yo;function nC(i){i.resume()}function Wg(i,...e){let t={},n;for(n in i)e.includes(n)||(t[n]=i[n]);return t}});var Qg=C((YM,Zg)=>{"use strict";var Jg=require("url"),Xg=require("https"),sC=Hl(),bo=ql(),rC=Ul(),ht=fo(),oC=Dl(),Yg=2419200,$l="",Wl;function fs(){}fs.prototype.setGCMAPIKey=function(i){if(i===null){$l=null;return}if(typeof i>"u"||typeof i!="string"||i.length===0)throw new Error("The GCM API Key should be a non-empty string or null.");$l=i};fs.prototype.setVapidDetails=function(i,e,t){if(arguments.length===1&&arguments[0]===null){Wl=null;return}bo.validateSubject(i),bo.validatePublicKey(e),bo.validatePrivateKey(t),Wl={subject:i,publicKey:e,privateKey:t}};fs.prototype.generateRequestDetails=function(i,e,t){if(!i||!i.endpoint)throw new Error("You must pass in a subscription with at least an endpoint.");if(typeof i.endpoint!="string"||i.endpoint.length===0)throw new Error("The subscription endpoint must be a string with a valid URL.");if(e&&(typeof i!="object"||!i.keys||!i.keys.p256dh||!i.keys.auth))throw new Error("To send a message with a payload, the subscription must have 'auth' and 'p256dh' keys.");let n=$l,s=Wl,r=Yg,o={},a=ht.supportedContentEncodings.AES_128_GCM,l=ht.supportedUrgency.NORMAL,p,f,m,_;if(t){let M=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],A=Object.keys(t);for(let D=0;D<A.length;D+=1){let U=A[D];if(!M.includes(U))throw new Error("'"+U+"' is an invalid option. The valid options are ['"+M.join("', '")+"'].")}if(t.headers){o=t.headers;let D=Object.keys(o).filter(function(U){return typeof t[U]<"u"});if(D.length>0)throw new Error("Duplicated headers defined ["+D.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&&(r=Number(t.TTL),r<0))throw new Error("TTL should be a number and should be at least 0");if(t.contentEncoding)if(t.contentEncoding===ht.supportedContentEncodings.AES_128_GCM||t.contentEncoding===ht.supportedContentEncodings.AES_GCM)a=t.contentEncoding;else throw new Error("Unsupported content encoding specified.");if(t.urgency)if(t.urgency===ht.supportedUrgency.VERY_LOW||t.urgency===ht.supportedUrgency.LOW||t.urgency===ht.supportedUrgency.NORMAL||t.urgency===ht.supportedUrgency.HIGH)l=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!oC.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");p=t.topic}t.proxy&&(typeof t.proxy=="string"||typeof t.proxy.host=="string"?f=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 Xg.Agent?(f&&console.warn("Agent option will be ignored because proxy option is defined."),m=t.agent):console.warn("Wrong type for the agent option, it should be an instance of https.Agent.")),typeof t.timeout=="number"&&(_=t.timeout)}typeof r>"u"&&(r=Yg);let E={method:"POST",headers:{TTL:r}};Object.keys(o).forEach(function(M){E.headers[M]=o[M]});let k=null;if(e){let M=rC.encrypt(i.keys.p256dh,i.keys.auth,e,a);E.headers["Content-Length"]=M.cipherText.length,E.headers["Content-Type"]="application/octet-stream",a===ht.supportedContentEncodings.AES_128_GCM?E.headers["Content-Encoding"]=ht.supportedContentEncodings.AES_128_GCM:a===ht.supportedContentEncodings.AES_GCM&&(E.headers["Content-Encoding"]=ht.supportedContentEncodings.AES_GCM,E.headers.Encryption="salt="+M.salt,E.headers["Crypto-Key"]="dh="+M.localPublicKey.toString("base64url")),k=M.cipherText}else E.headers["Content-Length"]=0;let T=i.endpoint.startsWith("https://android.googleapis.com/gcm/send"),O=i.endpoint.startsWith("https://fcm.googleapis.com/fcm/send");if(T)n?E.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=Jg.parse(i.endpoint),A=M.protocol+"//"+M.host,D=bo.getVapidHeaders(A,s.subject,s.publicKey,s.privateKey,a);E.headers.Authorization=D.Authorization,a===ht.supportedContentEncodings.AES_GCM&&(E.headers["Crypto-Key"]?E.headers["Crypto-Key"]+=";"+D["Crypto-Key"]:E.headers["Crypto-Key"]=D["Crypto-Key"])}else O&&n&&(E.headers.Authorization="key="+n);return E.headers.Urgency=l,p&&(E.headers.Topic=p),E.body=k,E.endpoint=i.endpoint,f&&(E.proxy=f),m&&(E.agent=m),_&&(E.timeout=_),E};fs.prototype.sendNotification=function(i,e,t){let n;try{n=this.generateRequestDetails(i,e,t)}catch(s){return Promise.reject(s)}return new Promise(function(s,r){let o={},a=Jg.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:p}=Gg();o.agent=new p(n.proxy)}let l=Xg.request(o,function(p){let f="";p.on("data",function(m){f+=m}),p.on("end",function(){p.statusCode<200||p.statusCode>299?r(new sC("Received unexpected response code",p.statusCode,p.headers,f,n.endpoint)):s({statusCode:p.statusCode,body:f,headers:p.headers})})});n.timeout&&l.on("timeout",function(){l.destroy(new Error("Socket timeout"))}),l.on("error",function(p){r(p)}),n.body&&l.write(n.body),l.end()})};Zg.exports=fs});var i0=C((JM,t0)=>{"use strict";var e0=ql(),aC=Ul(),cC=Qg(),lC=Hl(),uC=fo(),hs=new cC;t0.exports={WebPushError:lC,supportedContentEncodings:uC.supportedContentEncodings,encrypt:aC.encrypt,getVapidHeaders:e0.getVapidHeaders,generateVAPIDKeys:e0.generateVAPIDKeys,setGCMAPIKey:hs.setGCMAPIKey,setVapidDetails:hs.setVapidDetails,generateRequestDetails:hs.generateRequestDetails,sendNotification:hs.sendNotification.bind(hs)}});var G0=C((EO,tu)=>{"use strict";var PC=Object.prototype.hasOwnProperty,tt="~";function bs(){}Object.create&&(bs.prototype=Object.create(null),new bs().__proto__||(tt=!1));function BC(i,e,t){this.fn=i,this.context=e,this.once=t||!1}function K0(i,e,t,n,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var r=new BC(t,n||i,s),o=tt?tt+e:e;return i._events[o]?i._events[o].fn?i._events[o]=[i._events[o],r]:i._events[o].push(r):(i._events[o]=r,i._eventsCount++),i}function Ao(i,e){--i._eventsCount===0?i._events=new bs:delete i._events[e]}function Xe(){this._events=new bs,this._eventsCount=0}Xe.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)PC.call(t,n)&&e.push(tt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Xe.prototype.listeners=function(e){var t=tt?tt+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,o=new Array(r);s<r;s++)o[s]=n[s].fn;return o};Xe.prototype.listenerCount=function(e){var t=tt?tt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};Xe.prototype.emit=function(e,t,n,s,r,o){var a=tt?tt+e:e;if(!this._events[a])return!1;var l=this._events[a],p=arguments.length,f,m;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),p){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,s),!0;case 5:return l.fn.call(l.context,t,n,s,r),!0;case 6:return l.fn.call(l.context,t,n,s,r,o),!0}for(m=1,f=new Array(p-1);m<p;m++)f[m-1]=arguments[m];l.fn.apply(l.context,f)}else{var _=l.length,E;for(m=0;m<_;m++)switch(l[m].once&&this.removeListener(e,l[m].fn,void 0,!0),p){case 1:l[m].fn.call(l[m].context);break;case 2:l[m].fn.call(l[m].context,t);break;case 3:l[m].fn.call(l[m].context,t,n);break;case 4:l[m].fn.call(l[m].context,t,n,s);break;default:if(!f)for(E=1,f=new Array(p-1);E<p;E++)f[E-1]=arguments[E];l[m].fn.apply(l[m].context,f)}}return!0};Xe.prototype.on=function(e,t,n){return K0(this,e,t,n,!1)};Xe.prototype.once=function(e,t,n){return K0(this,e,t,n,!0)};Xe.prototype.removeListener=function(e,t,n,s){var r=tt?tt+e:e;if(!this._events[r])return this;if(!t)return Ao(this,r),this;var o=this._events[r];if(o.fn)o.fn===t&&(!s||o.once)&&(!n||o.context===n)&&Ao(this,r);else{for(var a=0,l=[],p=o.length;a<p;a++)(o[a].fn!==t||s&&!o[a].once||n&&o[a].context!==n)&&l.push(o[a]);l.length?this._events[r]=l.length===1?l[0]:l:Ao(this,r)}return this};Xe.prototype.removeAllListeners=function(e){var t;return e?(t=tt?tt+e:e,this._events[t]&&Ao(this,t)):(this._events=new bs,this._eventsCount=0),this};Xe.prototype.off=Xe.prototype.removeListener;Xe.prototype.addListener=Xe.prototype.on;Xe.prefixed=tt;Xe.EventEmitter=Xe;typeof tu<"u"&&(tu.exports=Xe)});var J0=C((kO,Y0)=>{"use strict";Y0.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 Ro=C(Z0=>{var ni=Z0,jC=require("url"),X0=require("util")._extend,NC=J0(),DC=/(^|,)\s*upgrade\s*($|,)/i,iu=/^https|wss/;ni.isSSL=iu;ni.setupOutgoing=function(i,e,t,n){i.port=e[n||"target"].port||(iu.test(e[n||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(a){i[a]=e[n||"target"][a]}),i.method=e.method||t.method,i.headers=X0({},t.headers),e.headers&&X0(i.headers,e.headers),e.auth&&(i.auth=e.auth),e.ca&&(i.ca=e.ca),iu.test(e[n||"target"].protocol)&&(i.rejectUnauthorized=typeof e.secure>"u"?!0:e.secure),i.agent=e.agent||!1,i.localAddress=e.localAddress,i.agent||(i.headers=i.headers||{},(typeof i.headers.connection!="string"||!DC.test(i.headers.connection))&&(i.headers.connection="close"));var s=e[n||"target"],r=s&&e.prependPath!==!1&&s.path||"",o=e.toProxy?t.url:jC.parse(t.url).path||"";return o=e.ignorePath?"":o,i.path=ni.urlJoin(r,o),e.changeOrigin&&(i.headers.host=NC(i.port,e[n||"target"].protocol)&&!IC(i.host)?i.host+":"+i.port:i.host),i};ni.setupSocket=function(i){return i.setTimeout(0),i.setNoDelay(!0),i.setKeepAlive(!0,0),i};ni.getPort=function(i){var e=i.headers.host?i.headers.host.match(/:(\d+)/):"";return e?e[1]:ni.hasEncryptedConnection(i)?"443":"80"};ni.hasEncryptedConnection=function(i){return!!(i.connection.encrypted||i.connection.pair)};ni.urlJoin=function(){var i=Array.prototype.slice.call(arguments),e=i.length-1,t=i[e],n=t.split("?"),s;return i[e]=n.shift(),s=[i.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")],s.push.apply(s,n),s.join("?")};ni.rewriteCookieProperty=function i(e,t,n){return Array.isArray(e)?e.map(function(s){return i(s,t,n)}):e.replace(new RegExp("(;\\s*"+n+"=)([^;]+)","i"),function(s,r,o){var a;if(o in t)a=t[o];else if("*"in t)a=t["*"];else return s;return a?r+a:""})};function IC(i){return!!~i.indexOf(":")}});var ix=C((TO,tx)=>{var Q0=require("url"),ex=Ro(),qC=/^201|30(1|2|7|8)$/;tx.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&&qC.test(n.statusCode)){var r=Q0.parse(s.target),o=Q0.parse(n.headers.location);if(r.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 r=s.cookieDomainRewrite,o=s.cookiePathRewrite,a=s.preserveHeaderKeyCase,l,p=function(_,E){E!=null&&(r&&_.toLowerCase()==="set-cookie"&&(E=ex.rewriteCookieProperty(E,r,"domain")),o&&_.toLowerCase()==="set-cookie"&&(E=ex.rewriteCookieProperty(E,o,"path")),t.setHeader(String(_).trim(),E))};if(typeof r=="string"&&(r={"*":r}),typeof o=="string"&&(o={"*":o}),a&&n.rawHeaders!=null){l={};for(var f=0;f<n.rawHeaders.length;f+=2){var m=n.rawHeaders[f];l[m.toLowerCase()]=m}}Object.keys(n.headers).forEach(function(_){var E=n.headers[_];a&&l&&(_=l[_]||_),p(_,E)})},writeStatusCode:function(e,t,n){n.statusMessage?(t.statusCode=n.statusCode,t.statusMessage=n.statusMessage):t.statusCode=n.statusCode}}});var sx=C((MO,nx)=>{var ws;nx.exports=function(){if(!ws){try{ws=se()("follow-redirects")}catch{}typeof ws!="function"&&(ws=function(){})}ws.apply(null,arguments)}});var lx=C((OO,hu)=>{var Ss=require("url"),_s=Ss.URL,LC=require("http"),FC=require("https"),au=require("stream").Writable,cu=require("assert"),rx=sx();(function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",n=Fi(Error.captureStackTrace);!e&&(t||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var lu=!1;try{cu(new _s(""))}catch(i){lu=i.code==="ERR_INVALID_URL"}var UC=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],uu=["abort","aborted","connect","error","socket","timeout"],pu=Object.create(null);uu.forEach(function(i){pu[i]=function(e,t,n){this._redirectable.emit(i,e,t,n)}});var su=Es("ERR_INVALID_URL","Invalid URL",TypeError),ru=Es("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),HC=Es("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",ru),zC=Es("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),$C=Es("ERR_STREAM_WRITE_AFTER_END","write after end"),WC=au.prototype.destroy||ax;function at(i,e){au.call(this),this._sanitizeOptions(i),this._options=i,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 ru?s:new ru({cause:s}))}},this._performRequest()}at.prototype=Object.create(au.prototype);at.prototype.abort=function(){fu(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};at.prototype.destroy=function(i){return fu(this._currentRequest,i),WC.call(this,i),this};at.prototype.write=function(i,e,t){if(this._ending)throw new $C;if(!Li(i)&&!GC(i))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Fi(e)&&(t=e,e=null),i.length===0){t&&t();return}this._requestBodyLength+i.length<=this._options.maxBodyLength?(this._requestBodyLength+=i.length,this._requestBodyBuffers.push({data:i,encoding:e}),this._currentRequest.write(i,e,t)):(this.emit("error",new zC),this.abort())};at.prototype.end=function(i,e,t){if(Fi(i)?(t=i,i=e=null):Fi(e)&&(t=e,e=null),!i)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var n=this,s=this._currentRequest;this.write(i,e,function(){n._ended=!0,s.end(null,null,t)}),this._ending=!0}};at.prototype.setHeader=function(i,e){this._options.headers[i]=e,this._currentRequest.setHeader(i,e)};at.prototype.removeHeader=function(i){delete this._options.headers[i],this._currentRequest.removeHeader(i)};at.prototype.setTimeout=function(i,e){var t=this;function n(o){o.setTimeout(i),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"),r()},i),n(o)}function r(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",r),t.removeListener("error",r),t.removeListener("response",r),t.removeListener("close",r),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",r),this.on("error",r),this.on("response",r),this.on("close",r),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(i){at.prototype[i]=function(e,t){return this._currentRequest[i](e,t)}});["aborted","connection","socket"].forEach(function(i){Object.defineProperty(at.prototype,i,{get:function(){return this._currentRequest[i]}})});at.prototype._sanitizeOptions=function(i){if(i.headers||(i.headers={}),i.host&&(i.hostname||(i.hostname=i.host),delete i.host),!i.pathname&&i.path){var e=i.path.indexOf("?");e<0?i.pathname=i.path:(i.pathname=i.path.substring(0,e),i.search=i.path.substring(e))}};at.prototype._performRequest=function(){var i=this._options.protocol,e=this._options.nativeProtocols[i];if(!e)throw new TypeError("Unsupported protocol "+i);if(this._options.agents){var t=i.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 uu)n.on(s,pu[s]);if(this._currentUrl=/^\//.test(this._options.path)?Ss.format(this._options):this._options.path,this._isRedirect){var r=0,o=this,a=this._requestBodyBuffers;(function l(p){if(n===o._currentRequest)if(p)o.emit("error",p);else if(r<a.length){var f=a[r++];n.finished||n.write(f.data,f.encoding,l)}else o._ended&&n.end()})()}};at.prototype._processResponse=function(i){var e=i.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:i.headers,statusCode:e});var t=i.headers.location;if(!t||this._options.followRedirects===!1||e<300||e>=400){i.responseUrl=this._currentUrl,i.redirects=this._redirects,this.emit("response",i),this._requestBodyBuffers=[];return}if(fu(this._currentRequest),i.destroy(),++this._redirectCount>this._options.maxRedirects)throw new HC;var n,s=this._options.beforeRedirect;s&&(n=Object.assign({Host:i.req.getHeader("host")},this._options.headers));var r=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=[],nu(/^content-/i,this._options.headers));var o=nu(/^host$/i,this._options.headers),a=du(this._currentUrl),l=o||a.host,p=/^\w+:/.test(t)?this._currentUrl:Ss.format(Object.assign(a,{host:l})),f=VC(t,p);if(rx("redirecting to",f.href),this._isRedirect=!0,ou(f,this._options),(f.protocol!==a.protocol&&f.protocol!=="https:"||f.host!==l&&!KC(f.host,l))&&nu(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),Fi(s)){var m={headers:i.headers,statusCode:e},_={url:p,method:r,headers:n};s(this._options,m,_),this._sanitizeOptions(this._options)}this._performRequest()};function ox(i){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(i).forEach(function(n){var s=n+":",r=t[s]=i[n],o=e[n]=Object.create(r);function a(p,f,m){return YC(p)?p=ou(p):Li(p)?p=ou(du(p)):(m=f,f=cx(p),p={protocol:s}),Fi(f)&&(m=f,f=null),f=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},p,f),f.nativeProtocols=t,!Li(f.host)&&!Li(f.hostname)&&(f.hostname="::1"),cu.equal(f.protocol,s,"protocol mismatch"),rx("options",f),new at(f,m)}function l(p,f,m){var _=o.request(p,f,m);return _.end(),_}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:l,configurable:!0,enumerable:!0,writable:!0}})}),e}function ax(){}function du(i){var e;if(lu)e=new _s(i);else if(e=cx(Ss.parse(i)),!Li(e.protocol))throw new su({input:i});return e}function VC(i,e){return lu?new _s(i,e):du(Ss.resolve(e,i))}function cx(i){if(/^\[/.test(i.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(i.hostname))throw new su({input:i.href||i});if(/^\[/.test(i.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(i.host))throw new su({input:i.href||i});return i}function ou(i,e){var t=e||{};for(var n of UC)t[n]=i[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 nu(i,e){var t;for(var n in e)i.test(n)&&(t=e[n],delete e[n]);return t===null||typeof t>"u"?void 0:String(t).trim()}function Es(i,e,t){function n(s){Fi(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,s||{}),this.code=i,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 ["+i+"]",enumerable:!1}}),n}function fu(i,e){for(var t of uu)i.removeListener(t,pu[t]);i.on("error",ax),i.destroy(e)}function KC(i,e){cu(Li(i)&&Li(e));var t=i.length-e.length-1;return t>0&&i[t]==="."&&i.endsWith(e)}function Li(i){return typeof i=="string"||i instanceof String}function Fi(i){return typeof i=="function"}function GC(i){return typeof i=="object"&&"length"in i}function YC(i){return _s&&i instanceof _s}hu.exports=ox({http:LC,https:FC});hu.exports.wrap=ox});var px=C((AO,ux)=>{var JC=require("http"),XC=require("https"),ks=ix(),Po=Ro(),ZC=lx();ks=Object.keys(ks).map(function(i){return ks[i]});var QC={http:JC,https:XC};ux.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||Po.hasEncryptedConnection(e),r={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Po.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]?",":"")+r[o]}),e.headers["x-forwarded-host"]=e.headers["x-forwarded-host"]||e.headers.host||""}},stream:function(e,t,n,s,r,o){r.emit("start",e,t,n.target||n.forward);var a=n.followRedirects?ZC:QC,l=a.http,p=a.https;if(n.forward){var f=(n.forward.protocol==="https:"?p:l).request(Po.setupOutgoing(n.ssl||{},n,e,"forward")),m=k(f,n.forward);if(e.on("error",m),f.on("error",m),(n.buffer||e).pipe(f),!n.target)return t.end()}var _=(n.target.protocol==="https:"?p:l).request(Po.setupOutgoing(n.ssl||{},n,e));_.on("socket",function(T){r&&!_.getHeader("expect")&&r.emit("proxyReq",_,e,t,n)}),n.proxyTimeout&&_.setTimeout(n.proxyTimeout,function(){_.abort()}),e.on("aborted",function(){_.abort()});var E=k(_,n.target);e.on("error",E),_.on("error",E);function k(T,O){return function(A){if(e.socket.destroyed&&A.code==="ECONNRESET")return r.emit("econnreset",A,e,t,O),T.abort();o?o(A,e,t,O):r.emit("error",A,e,t,O)}}(n.buffer||e).pipe(_),_.on("response",function(T){if(r&&r.emit("proxyRes",T,e,t),!t.headersSent&&!n.selfHandleResponse)for(var O=0;O<ks.length&&!ks[O](e,t,T,n);O++);t.finished?r&&r.emit("end",e,t,T):(T.on("end",function(){r&&r.emit("end",e,t,T)}),n.selfHandleResponse||T.pipe(t))})}}});var fx=C((RO,dx)=>{var e2=require("http"),t2=require("https"),Un=Ro();dx.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:Un.getPort(e),proto:Un.hasEncryptedConnection(e)?"wss":"ws"};["for","port","proto"].forEach(function(r){e.headers["x-forwarded-"+r]=(e.headers["x-forwarded-"+r]||"")+(e.headers["x-forwarded-"+r]?",":"")+s[r]})}},stream:function(e,t,n,s,r,o){var a=function(f,m){return Object.keys(m).reduce(function(_,E){var k=m[E];if(!Array.isArray(k))return _.push(E+": "+k),_;for(var T=0;T<k.length;T++)_.push(E+": "+k[T]);return _},[f]).join(`\r
36
36
  `)+`\r
37
37
  \r
38
- `};Un.setupSocket(t),s&&s.length&&t.unshift(s);var l=(Un.isSSL.test(n.target.protocol)?e2:QC).request(Un.setupOutgoing(n.ssl||{},n,e));return r&&r.emit("proxyReqWs",l,e,t,n,s),l.on("error",p),l.on("response",function(f){f.upgrade||(t.write(a("HTTP/"+f.httpVersion+" "+f.statusCode+" "+f.statusMessage,f.headers)),f.pipe(t))}),l.on("upgrade",function(f,m,_){m.on("error",p),m.on("end",function(){r.emit("close",f,m,_)}),t.on("error",function(){m.end()}),Un.setupSocket(m),_&&_.length&&m.unshift(_),t.write(a("HTTP/1.1 101 Switching Protocols",f.headers)),m.pipe(t).pipe(m),r.emit("open",m),r.emit("proxySocket",m)}),l.end();function p(f){o?o(f,e,t):r.emit("error",f,e,t),t.end()}}}});var yx=C((RO,xx)=>{var vx=xx.exports,fx=require("util")._extend,t2=require("url").parse,gx=K0(),i2=require("http"),n2=require("https"),hx=ux(),mx=dx();vx.Server=Ui;function mu(i){return function(e){return function(t,n){var s=i==="ws"?this.wsPasses:this.webPasses,r=[].slice.call(arguments),o=r.length-1,a,l;typeof r[o]=="function"&&(l=r[o],o--);var p=e;if(!(r[o]instanceof Buffer)&&r[o]!==n&&(p=fx({},e),fx(p,r[o]),o--),r[o]instanceof Buffer&&(a=r[o]),["target","forward"].forEach(function(m){typeof p[m]=="string"&&(p[m]=t2(p[m]))}),!p.target&&!p.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var f=0;f<s.length&&!s[f](t,n,p,a,this,l);f++);}}}vx.createRightProxy=mu;function Ui(i){gx.call(this),i=i||{},i.prependPath=i.prependPath!==!1,this.web=this.proxyRequest=mu("web")(i),this.ws=this.proxyWebsocketRequest=mu("ws")(i),this.options=i,this.webPasses=Object.keys(hx).map(function(e){return hx[e]}),this.wsPasses=Object.keys(mx).map(function(e){return mx[e]}),this.on("error",this.onError,this)}require("util").inherits(Ui,gx);Ui.prototype.onError=function(i){if(this.listeners("error").length===1)throw i};Ui.prototype.listen=function(i,e){var t=this,n=function(s,r){t.web(s,r)};return this._server=this.options.ssl?n2.createServer(this.options.ssl,n):i2.createServer(n),this.options.ws&&this._server.on("upgrade",function(s,r,o){t.ws(s,r,o)}),this._server.listen(i,e),this};Ui.prototype.close=function(i){var e=this;this._server&&this._server.close(t);function t(){e._server=null,i&&i.apply(null,arguments)}};Ui.prototype.before=function(i,e,t){if(i!=="ws"&&i!=="web")throw new Error("type must be `web` or `ws`");var n=i==="ws"?this.wsPasses:this.webPasses,s=!1;if(n.forEach(function(r,o){r.name===e&&(s=o)}),s===!1)throw new Error("No such pass");n.splice(s,0,t)};Ui.prototype.after=function(i,e,t){if(i!=="ws"&&i!=="web")throw new Error("type must be `web` or `ws`");var n=i==="ws"?this.wsPasses:this.webPasses,s=!1;if(n.forEach(function(r,o){r.name===e&&(s=o)}),s===!1)throw new Error("No such pass");n.splice(s++,0,t)}});var wx=C((PO,bx)=>{var Cs=yx().Server;function vu(i){return new Cs(i)}Cs.createProxyServer=vu;Cs.createServer=vu;Cs.createProxy=vu;bx.exports=Cs});var Sx=C((BO,_x)=>{_x.exports=wx()});var h2={};bi(h2,{startServer:()=>Lx});module.exports=Wx(h2);var Nx=require("http"),Ix=require("url"),Dx=require("child_process");var Ah=L(Oh(),1),{Server:Rh,Namespace:UT,Socket:HT}=Ah.default;var R0=require("fs"),P0=require("path"),B0=require("os");var Zl=L(require("node-pty"),1),w0=L(Zc(),1);var rm=L(require("node-datachannel"),1);Pi();var{PeerConnection:NS}=rm.default,{turnApiUrl:IS,turnRefreshInterval:DS,dcMaxMessageSize:qS,answerTimeout:LS}=Fe.webrtc,FS=[{hostname:"stun.cloudflare.com",port:3478,type:"Stun"}];async function US(i){try{let e=await fetch(IS,{headers:{"X-API-Key":i}});if(!e.ok)throw new Error(`HTTP ${e.status}`);let{iceServers:t}=await e.json(),n=[];for(let s of t)for(let r of s.urls)if(r.startsWith("stun:")){let o=r.replace("stun:","").split(":")[0],a=parseInt(r.split(":")[2]||"3478");n.push({hostname:o,port:a,type:"Stun"})}else if(r.startsWith("turn:")||r.startsWith("turns:")){let o=r.startsWith("turns:"),l=r.replace(/^turns?:/,"").split("?")[0],p=l.split(":")[0],f=parseInt(l.split(":")[1]||(o?"5349":"3478")),m=r.includes("transport=tcp")?"Tcp":"Udp";n.push({hostname:p,port:f,type:o?"Tls":"Turn",relayType:m,username:s.username,password:s.credential})}return n}catch(e){return console.error("[WebRTC] Failed to fetch TURN credentials:",e.message),null}}var Ir=class{constructor(){this.peers=new Map,this.iceServers=FS,this.apiKey=null,this._refreshTimer=null}async init(e){this.apiKey=e,await this._refreshTurnCredentials()}async _refreshTurnCredentials(){if(!this.apiKey)return;let e=await US(this.apiKey);e?.length&&(this.iceServers=e,console.log(`[WebRTC] TURN credentials loaded (${e.length} servers)`)),clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(()=>this._refreshTurnCredentials(),DS)}createPeer(e){this.closePeer(e);let t=new NS(`peer-${e}`,{iceServers:this.iceServers});return t.onDataChannel(n=>{n.onOpen(()=>{let s=this.peers.get(e);s&&(s.dc=n),console.log(`[WebRTC] DataChannel open [${e.slice(0,6)}]`)}),n.onClosed(()=>{let s=this.peers.get(e);s&&(s.dc=null)}),n.onError(s=>console.error(`[WebRTC] DC error [${e.slice(0,6)}]:`,s))}),this.peers.set(e,{pc:t,dc:null}),{pc:t}}async processOffer(e,t){let n=this.peers.get(e);if(!n)throw new Error("No peer for socket "+e);let{pc:s}=n;return new Promise((r,o)=>{s.onLocalDescription((a,l)=>{l==="answer"&&r(a)});try{s.setRemoteDescription(t,"offer"),s.setLocalDescription()}catch(a){o(a)}setTimeout(()=>o(new Error("Answer timeout")),LS)})}addIceCandidate(e,t,n){let s=this.peers.get(e);if(s)try{s.pc.addRemoteCandidate(t,n)}catch(r){console.error("[WebRTC] addRemoteCandidate error:",r.message)}}sendTile(e,t){let n=this.peers.get(e);if(!n?.dc)return!1;try{return t.length>qS?(console.warn(`[WebRTC] tile too large (${t.length}B), skipping DC \u2192 WS fallback`),!1):(n.dc.sendMessageBinary(t),!0)}catch(s){return console.error(`[WebRTC] sendTile error [${e.slice(0,6)}]:`,s.message),!1}}isReady(e){return!!this.peers.get(e)?.dc}closePeer(e){let t=this.peers.get(e);if(t){try{t.pc.close()}catch{}this.peers.delete(e)}}closeAll(){clearTimeout(this._refreshTimer);for(let e of this.peers.keys())this.closePeer(e)}};var Dr=class{constructor(e){this.webrtcManager=e}setupWebRTCHandlers(e){let{webrtcManager:t}=this;e.on("webrtc:offer",async({sdp:n})=>{try{let{pc:s}=t.createPeer(e.id);s.onLocalCandidate((o,a)=>{o&&e.emit("webrtc:ice-candidate",{candidate:o,mid:a})});let r=await t.processOffer(e.id,n);e.emit("webrtc:answer",{sdp:r})}catch(s){console.error("[WebRTC] offer error:",s.message),e.emit("webrtc:error",{message:s.message})}}),e.on("webrtc:ice-candidate",({candidate:n,mid:s})=>{t.addIceCandidate(e.id,n,s||"0")})}};Pi();var{enableWebRTC:Fr,enableTurn:WS}=Fe.webrtc,Bi=Fr?new Ir:null,fi=null;function VS(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function ym(){if(fi!==null)return fi;if(VS())return fi=!1,console.log("\u2705 Remote desktop not available (headless environment)"),fi;try{let i=await import("@hurdlegroup/robotjs");(i.default||i).getScreenSize(),fi=!0}catch{fi=!1,console.log("\u2705 Remote desktop not available (no display or robotjs not installed)")}return fi}function bm(){return fi===!0}async function wm(i,e){if(Fr&&Bi){let M=WS?e:null;Bi.init(M).catch(A=>console.error("[WebRTC] init error:",A.message))}let t=null,n=null,s=null,r=null,o=null,a=null,l=null,p=async()=>{if(t)return!0;try{let M=await import("@hurdlegroup/robotjs");t=M.default||M;let{TileManager:A}=await Promise.resolve().then(()=>(cm(),am)),{ResourceManager:I}=await Promise.resolve().then(()=>(um(),lm)),{ScreenUpdateHelper:U}=await Promise.resolve().then(()=>(dm(),pm)),{MouseHandler:ie}=await Promise.resolve().then(()=>(hm(),fm)),{KeyboardHandler:J}=await Promise.resolve().then(()=>(vm(),mm)),{ScreenHandler:ne}=await Promise.resolve().then(()=>(xm(),gm));return n=A,s=I,r=U,o=ie,a=J,l=ne,t.setMouseDelay(2),t.setKeyboardDelay(2),!0}catch(M){return console.error("\u274C Failed to load remote modules:",M.message),!1}},f=i.of("/remote"),m=null,_=null,E=null,k=null,T=null,O=Fr&&Bi?new Dr(Bi):null;f.on("connection",async M=>{let A=M.handshake.auth?.apiKey;if(!A){console.log("\u274C Remote connection rejected: no apiKey"),M.disconnect();return}if(console.log("\u{1F5A5}\uFE0F Remote client connected:",M.id),!await p()){M.emit("error",{message:"Remote desktop not available"}),M.disconnect();return}m||(m=new s,_=new r(m),E=new o(t,m),k=new a(t,m),T=new l(m,_,Bi),m.startResourceMonitoring()),M.isAuthenticated=!0;let U=new n(t);m.addClient(M.id,{tileManager:U,screenInterval:null,authenticated:!0,apiKey:A});let ie=J=>J;E.setupMouseHandlers(M,ie),k.setupKeyboardHandlers(M,ie),T.setupScreenHandlers(M,ie),O?.setupWebRTCHandlers(M),M.on("disconnect",()=>{console.log("\u{1F5A5}\uFE0F Remote client disconnected:",M.id),m.removeClient(M.id),Fr&&Bi&&Bi.closePeer(M.id)})})}var ol=L(require("net"),1),wt=L(require("fs"),1),ji=L(require("path"),1),Em=L(require("os"),1),km=require("child_process"),Cm=require("url"),zr=ji.default.dirname((0,Cm.fileURLToPath)(__importMetaUrl)),wn=ji.default.join(Em.default.homedir(),".9remote"),Ur=process.platform==="win32"?"\\\\.\\pipe\\9remote-pty":ji.default.join(wn,"pty-daemon.sock"),_m=ji.default.join(zr,"ptyDaemon.js"),Sm=ji.default.join(zr,"ptyDaemon.cjs"),Ut=null,bn=!1,hi=!1,rl="",KS=0,_n=new Map,Hr=new Map;function GS(){return++KS}function $r(i,e){Hr.has(i)||Hr.set(i,[]),Hr.get(i).push(e)}function rs(i,e){let t=Hr.get(i);if(t)for(let n of t)try{n(e)}catch(s){console.error(`[DaemonClient] Error in ${i} handler:`,s)}}function al(i){if(!Ut||!bn)return!1;try{return Ut.write(JSON.stringify(i)+`
39
- `),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function os(i,e=5e3){return new Promise((t,n)=>{let s=GS();i.requestId=s;let r=setTimeout(()=>{_n.delete(s),n(new Error("Request timeout"))},e);_n.set(s,{resolve:t,reject:n,timer:r}),al(i)||(clearTimeout(r),_n.delete(s),n(new Error("Not connected to daemon")))})}function YS(i){let{type:e,requestId:t,...n}=i;if(t&&_n.has(t)){let{resolve:s,timer:r}=_n.get(t);clearTimeout(r),_n.delete(t),s({type:e,...n});return}switch(e){case"output":rs("output",{sessionId:n.sessionId,data:Buffer.from(n.data,"base64")});break;case"sessionClosed":rs("sessionClosed",n.sessionId);break;case"sessionRenamed":rs("sessionRenamed",{sessionId:n.sessionId,name:n.name});break;case"pong":break;default:console.log("[DaemonClient] Unknown message:",e)}}function Tm(){return new Promise(i=>{let e=ol.default.connect(Ur),t=setTimeout(()=>{e.destroy(),i(!1)},1e3);e.on("connect",()=>{clearTimeout(t),e.destroy(),i(!0)}),e.on("error",()=>{if(clearTimeout(t),process.platform!=="win32"&&wt.default.existsSync(Ur))try{wt.default.unlinkSync(Ur)}catch{}i(!1)})})}function JS(){return wt.default.existsSync(wn)||wt.default.mkdirSync(wn,{recursive:!0}),wt.default.existsSync(_m)?{script:_m,cwd:zr}:wt.default.existsSync(Sm)?{script:Sm,cwd:zr}:(console.error("[DaemonClient] \u274C Daemon script not found"),null)}async function XS(){if(!wt.default.existsSync(wn))try{wt.default.mkdirSync(wn,{recursive:!0})}catch(o){return console.error("[DaemonClient] Failed to create socket directory:",o.message),!1}let i=JS();if(!i)return!1;let{script:e,cwd:t}=i,n=ji.default.join(wn,"daemon.log"),s;try{s=wt.default.openSync(n,"w")}catch(o){console.error("[DaemonClient] Failed to open log file:",o.message),s="ignore"}if((0,km.spawn)("node",[e],{detached:!0,stdio:["ignore",s,s],cwd:t}).unref(),typeof s=="number")try{wt.default.closeSync(s)}catch{}for(let o=0;o<20;o++)if(await new Promise(a=>setTimeout(a,100)),await Tm())return!0;console.error("[DaemonClient] \u274C Failed to start daemon");try{let o=wt.default.readFileSync(n,"utf8");o.trim()&&(console.error("[DaemonClient] Daemon log:"),console.error(o))}catch{}return!1}async function Mm(){if(!(bn||hi)){hi=!0;try{return!await Tm()&&!await XS()?(console.error("[DaemonClient] \u274C Failed to start daemon"),hi=!1,!1):new Promise(i=>{let e=setTimeout(()=>{console.error("[DaemonClient] \u274C Connection timeout after 5s"),Ut&&Ut.destroy(),hi=!1,i(!1)},5e3);Ut=ol.default.connect(Ur),Ut.on("connect",()=>{clearTimeout(e),bn=!0,hi=!1,rs("connected"),i(!0)}),Ut.on("data",t=>{rl+=t.toString();let n=rl.split(`
40
- `);rl=n.pop()||"";for(let s of n)if(s.trim())try{YS(JSON.parse(s))}catch{console.error("[DaemonClient] Invalid message:",s)}}),Ut.on("close",()=>{bn=!1,Ut=null,rs("disconnected"),setTimeout(()=>{!bn&&!hi&&Mm()},2e3)}),Ut.on("error",t=>{clearTimeout(e),console.error("[DaemonClient] \u274C Connection error:",t.message),console.error("[DaemonClient] Error code:",t.code),hi=!1,i(!1)})})}catch(i){return console.error("[DaemonClient] \u274C Connect error:",i),hi=!1,!1}}}async function Om(){return Mm()}function ti(){return bn}async function Am(){return(await os({type:"listSessions"})).sessions||[]}async function Rm(i,e=80,t=24){let n=`session-${Date.now()}`;return await os({type:"createSession",sessionId:n,name:i,cols:e,rows:t})}async function Pm(i){return await os({type:"joinSession",sessionId:i})}function cl(i,e){return al({type:"input",sessionId:i,data:e})}function Bm(i,e,t){return al({type:"resize",sessionId:i,cols:e,rows:t})}async function jm(i){return await os({type:"deleteSession",sessionId:i})}async function Nm(i,e){return await os({type:"renameSession",sessionId:i,name:e})}var Wr=L(require("os"),1),Ke=L(require("fs"),1),En=L(require("path"),1);function Vr(){return En.default.join(Wr.default.homedir(),".claude","settings.json")}function Kr(){return En.default.join(Wr.default.homedir(),".codex","config.toml")}function Gr(){return En.default.join(Wr.default.homedir(),".gemini","settings.json")}function Sn(i){try{if(Ke.default.existsSync(i))return JSON.parse(Ke.default.readFileSync(i,"utf8"))}catch{}return{}}function Yr(i,e){let t=En.default.dirname(i);Ke.default.existsSync(t)||Ke.default.mkdirSync(t,{recursive:!0}),Ke.default.writeFileSync(i,JSON.stringify(e,null,2),"utf8")}function QS(){let i=Vr(),e=Sn(i),t='curl -s "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=claude" > /dev/null 2>&1';return e.hooks={...e.hooks,Stop:[{matcher:"",hooks:[{type:"command",command:t}]}]},Yr(i,e),{success:!0}}function eE(){let i=Vr(),e=Sn(i);return e.hooks&&(delete e.hooks.Stop,delete e.hooks.Notification,Object.keys(e.hooks).length===0&&delete e.hooks),Yr(i,e),{success:!0}}function tE(){let i=Kr(),e=En.default.dirname(i);Ke.default.existsSync(e)||Ke.default.mkdirSync(e,{recursive:!0});let t='curl -s "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=codex" > /dev/null 2>&1',n="";return Ke.default.existsSync(i)&&(n=Ke.default.readFileSync(i,"utf8"),n=n.replace(/\n?# 9Remote notification\nnotify\s*=.*\n?/g,"")),n+=`
38
+ `};Un.setupSocket(t),s&&s.length&&t.unshift(s);var l=(Un.isSSL.test(n.target.protocol)?t2:e2).request(Un.setupOutgoing(n.ssl||{},n,e));return r&&r.emit("proxyReqWs",l,e,t,n,s),l.on("error",p),l.on("response",function(f){f.upgrade||(t.write(a("HTTP/"+f.httpVersion+" "+f.statusCode+" "+f.statusMessage,f.headers)),f.pipe(t))}),l.on("upgrade",function(f,m,_){m.on("error",p),m.on("end",function(){r.emit("close",f,m,_)}),t.on("error",function(){m.end()}),Un.setupSocket(m),_&&_.length&&m.unshift(_),t.write(a("HTTP/1.1 101 Switching Protocols",f.headers)),m.pipe(t).pipe(m),r.emit("open",m),r.emit("proxySocket",m)}),l.end();function p(f){o?o(f,e,t):r.emit("error",f,e,t),t.end()}}}});var bx=C((PO,yx)=>{var gx=yx.exports,hx=require("util")._extend,i2=require("url").parse,xx=G0(),n2=require("http"),s2=require("https"),mx=px(),vx=fx();gx.Server=Ui;function mu(i){return function(e){return function(t,n){var s=i==="ws"?this.wsPasses:this.webPasses,r=[].slice.call(arguments),o=r.length-1,a,l;typeof r[o]=="function"&&(l=r[o],o--);var p=e;if(!(r[o]instanceof Buffer)&&r[o]!==n&&(p=hx({},e),hx(p,r[o]),o--),r[o]instanceof Buffer&&(a=r[o]),["target","forward"].forEach(function(m){typeof p[m]=="string"&&(p[m]=i2(p[m]))}),!p.target&&!p.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var f=0;f<s.length&&!s[f](t,n,p,a,this,l);f++);}}}gx.createRightProxy=mu;function Ui(i){xx.call(this),i=i||{},i.prependPath=i.prependPath!==!1,this.web=this.proxyRequest=mu("web")(i),this.ws=this.proxyWebsocketRequest=mu("ws")(i),this.options=i,this.webPasses=Object.keys(mx).map(function(e){return mx[e]}),this.wsPasses=Object.keys(vx).map(function(e){return vx[e]}),this.on("error",this.onError,this)}require("util").inherits(Ui,xx);Ui.prototype.onError=function(i){if(this.listeners("error").length===1)throw i};Ui.prototype.listen=function(i,e){var t=this,n=function(s,r){t.web(s,r)};return this._server=this.options.ssl?s2.createServer(this.options.ssl,n):n2.createServer(n),this.options.ws&&this._server.on("upgrade",function(s,r,o){t.ws(s,r,o)}),this._server.listen(i,e),this};Ui.prototype.close=function(i){var e=this;this._server&&this._server.close(t);function t(){e._server=null,i&&i.apply(null,arguments)}};Ui.prototype.before=function(i,e,t){if(i!=="ws"&&i!=="web")throw new Error("type must be `web` or `ws`");var n=i==="ws"?this.wsPasses:this.webPasses,s=!1;if(n.forEach(function(r,o){r.name===e&&(s=o)}),s===!1)throw new Error("No such pass");n.splice(s,0,t)};Ui.prototype.after=function(i,e,t){if(i!=="ws"&&i!=="web")throw new Error("type must be `web` or `ws`");var n=i==="ws"?this.wsPasses:this.webPasses,s=!1;if(n.forEach(function(r,o){r.name===e&&(s=o)}),s===!1)throw new Error("No such pass");n.splice(s++,0,t)}});var _x=C((BO,wx)=>{var Cs=bx().Server;function vu(i){return new Cs(i)}Cs.createProxyServer=vu;Cs.createServer=vu;Cs.createProxy=vu;wx.exports=Cs});var Ex=C((jO,Sx)=>{Sx.exports=_x()});var m2={};bi(m2,{startServer:()=>Fx});module.exports=Vx(m2);var Dx=require("http"),Ix=require("url"),qx=require("child_process");var Ah=L(Oh(),1),{Server:Rh,Namespace:HT,Socket:zT}=Ah.default;var P0=require("fs"),B0=require("path"),j0=require("os");var Zl=L(require("node-pty"),1),_0=L(Zc(),1);var rm=L(require("node-datachannel"),1);Pi();var{PeerConnection:DS}=rm.default,{turnApiUrl:IS,turnRefreshInterval:qS,dcMaxMessageSize:LS,answerTimeout:FS}=Fe.webrtc,US=[{hostname:"stun.cloudflare.com",port:3478,type:"Stun"}];async function HS(i){try{let e=await fetch(IS,{headers:{"X-API-Key":i}});if(!e.ok)throw new Error(`HTTP ${e.status}`);let{iceServers:t}=await e.json(),n=[];for(let s of t)for(let r of s.urls)if(r.startsWith("stun:")){let o=r.replace("stun:","").split(":")[0],a=parseInt(r.split(":")[2]||"3478");n.push({hostname:o,port:a,type:"Stun"})}else if(r.startsWith("turn:")||r.startsWith("turns:")){let o=r.startsWith("turns:"),l=r.replace(/^turns?:/,"").split("?")[0],p=l.split(":")[0],f=parseInt(l.split(":")[1]||(o?"5349":"3478")),m=r.includes("transport=tcp")?"Tcp":"Udp";n.push({hostname:p,port:f,type:o?"Tls":"Turn",relayType:m,username:s.username,password:s.credential})}return n}catch(e){return console.error("[WebRTC] Failed to fetch TURN credentials:",e.message),null}}var Dr=class{constructor(){this.peers=new Map,this.iceServers=US,this.apiKey=null,this._refreshTimer=null}async init(e){this.apiKey=e,await this._refreshTurnCredentials()}async _refreshTurnCredentials(){if(!this.apiKey)return;let e=await HS(this.apiKey);e?.length&&(this.iceServers=e,console.log(`[WebRTC] TURN credentials loaded (${e.length} servers)`)),clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(()=>this._refreshTurnCredentials(),qS)}createPeer(e){this.closePeer(e);let t=new DS(`peer-${e}`,{iceServers:this.iceServers});return t.onDataChannel(n=>{n.onOpen(()=>{let s=this.peers.get(e);s&&(s.dc=n),console.log(`[WebRTC] DataChannel open [${e.slice(0,6)}]`)}),n.onClosed(()=>{let s=this.peers.get(e);s&&(s.dc=null)}),n.onError(s=>console.error(`[WebRTC] DC error [${e.slice(0,6)}]:`,s))}),this.peers.set(e,{pc:t,dc:null}),{pc:t}}async processOffer(e,t){let n=this.peers.get(e);if(!n)throw new Error("No peer for socket "+e);let{pc:s}=n;return new Promise((r,o)=>{s.onLocalDescription((a,l)=>{l==="answer"&&r(a)});try{s.setRemoteDescription(t,"offer"),s.setLocalDescription()}catch(a){o(a)}setTimeout(()=>o(new Error("Answer timeout")),FS)})}addIceCandidate(e,t,n){let s=this.peers.get(e);if(s)try{s.pc.addRemoteCandidate(t,n)}catch(r){console.error("[WebRTC] addRemoteCandidate error:",r.message)}}sendTile(e,t){let n=this.peers.get(e);if(!n?.dc)return!1;try{return t.length>LS?(console.warn(`[WebRTC] tile too large (${t.length}B), skipping DC \u2192 WS fallback`),!1):(n.dc.sendMessageBinary(t),!0)}catch(s){return console.error(`[WebRTC] sendTile error [${e.slice(0,6)}]:`,s.message),!1}}isReady(e){return!!this.peers.get(e)?.dc}closePeer(e){let t=this.peers.get(e);if(t){try{t.pc.close()}catch{}this.peers.delete(e)}}closeAll(){clearTimeout(this._refreshTimer);for(let e of this.peers.keys())this.closePeer(e)}};var Ir=class{constructor(e){this.webrtcManager=e}setupWebRTCHandlers(e){let{webrtcManager:t}=this;e.on("webrtc:offer",async({sdp:n})=>{try{let{pc:s}=t.createPeer(e.id);s.onLocalCandidate((o,a)=>{o&&e.emit("webrtc:ice-candidate",{candidate:o,mid:a})});let r=await t.processOffer(e.id,n);e.emit("webrtc:answer",{sdp:r})}catch(s){console.error("[WebRTC] offer error:",s.message),e.emit("webrtc:error",{message:s.message})}}),e.on("webrtc:ice-candidate",({candidate:n,mid:s})=>{t.addIceCandidate(e.id,n,s||"0")})}};Pi();var{enableWebRTC:Fr,enableTurn:VS}=Fe.webrtc,Bi=Fr?new Dr:null,fi=null;function KS(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function bm(){if(fi!==null)return fi;if(KS())return fi=!1,console.log("\u2705 Remote desktop not available (headless environment)"),fi;try{let i=await import("@hurdlegroup/robotjs");(i.default||i).getScreenSize(),fi=!0}catch{fi=!1,console.log("\u2705 Remote desktop not available (no display or robotjs not installed)")}return fi}function wm(){return fi===!0}async function _m(i,e){if(Fr&&Bi){let M=VS?e:null;Bi.init(M).catch(A=>console.error("[WebRTC] init error:",A.message))}let t=null,n=null,s=null,r=null,o=null,a=null,l=null,p=async()=>{if(t)return!0;try{let M=await import("@hurdlegroup/robotjs");t=M.default||M;let{TileManager:A}=await Promise.resolve().then(()=>(lm(),cm)),{ResourceManager:D}=await Promise.resolve().then(()=>(pm(),um)),{ScreenUpdateHelper:U}=await Promise.resolve().then(()=>(fm(),dm)),{MouseHandler:ie}=await Promise.resolve().then(()=>(mm(),hm)),{KeyboardHandler:J}=await Promise.resolve().then(()=>(gm(),vm)),{ScreenHandler:ne}=await Promise.resolve().then(()=>(ym(),xm));return n=A,s=D,r=U,o=ie,a=J,l=ne,t.setMouseDelay(2),t.setKeyboardDelay(2),!0}catch(M){return console.error("\u274C Failed to load remote modules:",M.message),!1}},f=i.of("/remote"),m=null,_=null,E=null,k=null,T=null,O=Fr&&Bi?new Ir(Bi):null;f.on("connection",async M=>{let A=M.handshake.auth?.apiKey;if(!A){console.log("\u274C Remote connection rejected: no apiKey"),M.disconnect();return}if(console.log("\u{1F5A5}\uFE0F Remote client connected:",M.id),!await p()){M.emit("error",{message:"Remote desktop not available"}),M.disconnect();return}m||(m=new s,_=new r(m),E=new o(t,m),k=new a(t,m),T=new l(m,_,Bi),m.startResourceMonitoring()),M.isAuthenticated=!0;let U=new n(t);m.addClient(M.id,{tileManager:U,screenInterval:null,authenticated:!0,apiKey:A});let ie=J=>J;E.setupMouseHandlers(M,ie),k.setupKeyboardHandlers(M,ie),T.setupScreenHandlers(M,ie),O?.setupWebRTCHandlers(M),M.on("disconnect",()=>{console.log("\u{1F5A5}\uFE0F Remote client disconnected:",M.id),m.removeClient(M.id),Fr&&Bi&&Bi.closePeer(M.id)})})}var ol=L(require("net"),1),wt=L(require("fs"),1),ji=L(require("path"),1),km=L(require("os"),1),Cm=require("child_process"),Tm=require("url"),zr=ji.default.dirname((0,Tm.fileURLToPath)(__importMetaUrl)),wn=ji.default.join(km.default.homedir(),".9remote"),Ur=process.platform==="win32"?"\\\\.\\pipe\\9remote-pty":ji.default.join(wn,"pty-daemon.sock"),Sm=ji.default.join(zr,"ptyDaemon.js"),Em=ji.default.join(zr,"ptyDaemon.cjs"),Ut=null,bn=!1,hi=!1,rl="",GS=0,_n=new Map,Hr=new Map;function YS(){return++GS}function $r(i,e){Hr.has(i)||Hr.set(i,[]),Hr.get(i).push(e)}function rs(i,e){let t=Hr.get(i);if(t)for(let n of t)try{n(e)}catch(s){console.error(`[DaemonClient] Error in ${i} handler:`,s)}}function al(i){if(!Ut||!bn)return!1;try{return Ut.write(JSON.stringify(i)+`
39
+ `),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function os(i,e=5e3){return new Promise((t,n)=>{let s=YS();i.requestId=s;let r=setTimeout(()=>{_n.delete(s),n(new Error("Request timeout"))},e);_n.set(s,{resolve:t,reject:n,timer:r}),al(i)||(clearTimeout(r),_n.delete(s),n(new Error("Not connected to daemon")))})}function JS(i){let{type:e,requestId:t,...n}=i;if(t&&_n.has(t)){let{resolve:s,timer:r}=_n.get(t);clearTimeout(r),_n.delete(t),s({type:e,...n});return}switch(e){case"output":rs("output",{sessionId:n.sessionId,data:Buffer.from(n.data,"base64")});break;case"sessionClosed":rs("sessionClosed",n.sessionId);break;case"sessionRenamed":rs("sessionRenamed",{sessionId:n.sessionId,name:n.name});break;case"pong":break;default:console.log("[DaemonClient] Unknown message:",e)}}function Mm(){return new Promise(i=>{let e=ol.default.connect(Ur),t=setTimeout(()=>{e.destroy(),i(!1)},1e3);e.on("connect",()=>{clearTimeout(t),e.destroy(),i(!0)}),e.on("error",()=>{if(clearTimeout(t),process.platform!=="win32"&&wt.default.existsSync(Ur))try{wt.default.unlinkSync(Ur)}catch{}i(!1)})})}function XS(){return wt.default.existsSync(wn)||wt.default.mkdirSync(wn,{recursive:!0}),wt.default.existsSync(Sm)?{script:Sm,cwd:zr}:wt.default.existsSync(Em)?{script:Em,cwd:zr}:(console.error("[DaemonClient] \u274C Daemon script not found"),null)}async function ZS(){if(!wt.default.existsSync(wn))try{wt.default.mkdirSync(wn,{recursive:!0})}catch(o){return console.error("[DaemonClient] Failed to create socket directory:",o.message),!1}let i=XS();if(!i)return!1;let{script:e,cwd:t}=i,n=ji.default.join(wn,"daemon.log"),s;try{s=wt.default.openSync(n,"w")}catch(o){console.error("[DaemonClient] Failed to open log file:",o.message),s="ignore"}if((0,Cm.spawn)("node",[e],{detached:!0,stdio:["ignore",s,s],cwd:t}).unref(),typeof s=="number")try{wt.default.closeSync(s)}catch{}for(let o=0;o<20;o++)if(await new Promise(a=>setTimeout(a,100)),await Mm())return!0;console.error("[DaemonClient] \u274C Failed to start daemon");try{let o=wt.default.readFileSync(n,"utf8");o.trim()&&(console.error("[DaemonClient] Daemon log:"),console.error(o))}catch{}return!1}async function Om(){if(!(bn||hi)){hi=!0;try{return!await Mm()&&!await ZS()?(console.error("[DaemonClient] \u274C Failed to start daemon"),hi=!1,!1):new Promise(i=>{let e=setTimeout(()=>{console.error("[DaemonClient] \u274C Connection timeout after 5s"),Ut&&Ut.destroy(),hi=!1,i(!1)},5e3);Ut=ol.default.connect(Ur),Ut.on("connect",()=>{clearTimeout(e),bn=!0,hi=!1,rs("connected"),i(!0)}),Ut.on("data",t=>{rl+=t.toString();let n=rl.split(`
40
+ `);rl=n.pop()||"";for(let s of n)if(s.trim())try{JS(JSON.parse(s))}catch{console.error("[DaemonClient] Invalid message:",s)}}),Ut.on("close",()=>{bn=!1,Ut=null,rs("disconnected"),setTimeout(()=>{!bn&&!hi&&Om()},2e3)}),Ut.on("error",t=>{clearTimeout(e),console.error("[DaemonClient] \u274C Connection error:",t.message),console.error("[DaemonClient] Error code:",t.code),hi=!1,i(!1)})})}catch(i){return console.error("[DaemonClient] \u274C Connect error:",i),hi=!1,!1}}}async function Am(){return Om()}function ti(){return bn}async function Rm(){return(await os({type:"listSessions"})).sessions||[]}async function Pm(i,e=80,t=24){let n=`session-${Date.now()}`;return await os({type:"createSession",sessionId:n,name:i,cols:e,rows:t})}async function Bm(i){return await os({type:"joinSession",sessionId:i})}function cl(i,e){return al({type:"input",sessionId:i,data:e})}function jm(i,e,t){return al({type:"resize",sessionId:i,cols:e,rows:t})}async function Nm(i){return await os({type:"deleteSession",sessionId:i})}async function Dm(i,e){return await os({type:"renameSession",sessionId:i,name:e})}var Wr=L(require("os"),1),Ke=L(require("fs"),1),En=L(require("path"),1);function Vr(){return En.default.join(Wr.default.homedir(),".claude","settings.json")}function Kr(){return En.default.join(Wr.default.homedir(),".codex","config.toml")}function Gr(){return En.default.join(Wr.default.homedir(),".gemini","settings.json")}function Sn(i){try{if(Ke.default.existsSync(i))return JSON.parse(Ke.default.readFileSync(i,"utf8"))}catch{}return{}}function Yr(i,e){let t=En.default.dirname(i);Ke.default.existsSync(t)||Ke.default.mkdirSync(t,{recursive:!0}),Ke.default.writeFileSync(i,JSON.stringify(e,null,2),"utf8")}function eE(){let i=Vr(),e=Sn(i),t='curl -s "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=claude" > /dev/null 2>&1',n='curl -s "http://localhost:2208/api/notify?type=notification&sessionId=$NINE_REMOTE_SESSION_ID&tool=claude" > /dev/null 2>&1';return e.hooks={...e.hooks,Stop:[{matcher:"",hooks:[{type:"command",command:t}]}],Notification:[{matcher:"permission_prompt|idle_prompt",hooks:[{type:"command",command:n}]}]},Yr(i,e),{success:!0}}function tE(){let i=Vr(),e=Sn(i);return e.hooks&&(delete e.hooks.Stop,delete e.hooks.Notification,Object.keys(e.hooks).length===0&&delete e.hooks),Yr(i,e),{success:!0}}function iE(){let i=Kr(),e=En.default.dirname(i);Ke.default.existsSync(e)||Ke.default.mkdirSync(e,{recursive:!0});let t='curl -s "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=codex" > /dev/null 2>&1',n="";return Ke.default.existsSync(i)&&(n=Ke.default.readFileSync(i,"utf8"),n=n.replace(/\n?# 9Remote notification\nnotify\s*=.*\n?/g,"")),n+=`
41
41
  # 9Remote notification
42
42
  notify = ["bash", "-c", "${t}"]
43
- `,Ke.default.writeFileSync(i,n,"utf8"),{success:!0}}function iE(){let i=Kr();if(!Ke.default.existsSync(i))return{success:!0};let e=Ke.default.readFileSync(i,"utf8");return e=e.replace(/\n?# 9Remote notification\nnotify\s*=.*\n?/g,""),Ke.default.writeFileSync(i,e,"utf8"),{success:!0}}function nE(){let i=Gr(),e=Sn(i),t='curl -s "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=gemini" > /dev/null 2>&1',n='curl -s "http://localhost:2208/api/notify?type=notification&sessionId=$NINE_REMOTE_SESSION_ID&tool=gemini" > /dev/null 2>&1';return e.hooks={...e.hooks,enabled:!0,AfterAgent:[{matcher:"",hooks:[{type:"command",command:t}]}],Notification:[{matcher:"",hooks:[{type:"command",command:n}]}]},e.tools||(e.tools={}),e.tools.enableHooks=!0,Yr(i,e),{success:!0}}function sE(){let i=Gr(),e=Sn(i);return e.hooks&&(delete e.hooks.AfterAgent,delete e.hooks.Notification,delete e.hooks.enabled,Object.keys(e.hooks).length===0&&delete e.hooks),Yr(i,e),{success:!0}}function rE(i){switch(i){case"claude":{let e=Sn(Vr());return!!(e.hooks?.Stop||e.hooks?.Notification)}case"codex":{let e=Kr();return Ke.default.existsSync(e)?Ke.default.readFileSync(e,"utf8").includes("# 9Remote notification"):!1}case"gemini":{let e=Sn(Gr());return!!(e.hooks?.AfterAgent||e.hooks?.Notification)}default:return!1}}function oE(i){let e={claude:Vr().replace("/settings.json",""),codex:Kr().replace("/config.toml",""),gemini:Gr().replace("/settings.json","")};return Ke.default.existsSync(e[i])}function Im(i){switch(i){case"claude":return QS();case"codex":return tE();case"gemini":return nE();default:return{success:!1,error:"Unknown tool"}}}function Dm(i){switch(i){case"claude":return eE();case"codex":return iE();case"gemini":return sE();default:return{success:!1,error:"Unknown tool"}}}function qm(){let i=["claude","codex","gemini"],e={};for(let t of i)e[t]={installed:oE(t),enabled:rE(t)};return e}var Vl=L(require("os"),1),It=L(require("fs"),1),ms=L(require("path"),1),wo=L(t0(),1),_o=ms.default.join(Vl.default.homedir(),".9remote","vapid.json"),So=ms.default.join(Vl.default.homedir(),".9remote","push-subscriptions.json"),JM=1800*1e3,ot=[];function uC(){try{if(It.default.existsSync(_o))return JSON.parse(It.default.readFileSync(_o,"utf8"))}catch{}return null}function pC(i){let e=ms.default.dirname(_o);It.default.existsSync(e)||It.default.mkdirSync(e,{recursive:!0}),It.default.writeFileSync(_o,JSON.stringify(i,null,2),"utf8")}function dC(){let i=uC();if(!i){let e=wo.default.generateVAPIDKeys();i={publicKey:e.publicKey,privateKey:e.privateKey},pC(i)}return wo.default.setVapidDetails("mailto:admin@9remote.cc",i.publicKey,i.privateKey),i}function fC(){try{It.default.existsSync(So)&&(ot=JSON.parse(It.default.readFileSync(So,"utf8")))}catch{ot=[]}}function vs(){try{let i=ms.default.dirname(So);It.default.existsSync(i)||It.default.mkdirSync(i,{recursive:!0}),It.default.writeFileSync(So,JSON.stringify(ot,null,2),"utf8")}catch(i){console.error("Failed to save push subscriptions:",i.message)}}function i0(i,e){ot=ot.filter(t=>t.endpoint!==i.endpoint),ot.push({...i,socketId:e,lastConnectedAt:Date.now()}),vs()}function n0(i){ot=ot.filter(e=>e.endpoint!==i),vs()}function s0(i){for(let e of ot)e.socketId===i&&(e.disconnectedAt=Date.now());vs()}function r0(i,e){for(let t of ot)t.endpoint===e&&(t.socketId=i,t.disconnectedAt=null,t.lastConnectedAt=Date.now());vs()}async function o0(i){let t={claude:"Claude",codex:"Codex",gemini:"Gemini"}[i.tool]||"AI";console.log(`\u{1F514} Sending push notification: ${i.type} ${t}`);let n=JSON.stringify({title:i.type==="stop"?`${t} \u2705`:`${t} \u{1F514}`,body:i.type==="stop"?`${t} completed the task`:`${t} needs your input`,data:{url:"/workspace",type:i.type}}),s=[],r=ot.reduce((a,l)=>(a?.lastConnectedAt??0)>=(l?.lastConnectedAt??0)?a:l,null),o=r?[r]:[];console.log(`\u{1F4E4} sendPush: total=${ot.length} target=${o.length>0?r.endpoint.slice(0,50)+"...":"none"}`);for(let a of o)try{await wo.default.sendNotification({endpoint:a.endpoint,keys:a.keys},n),console.log(` \u2705 Push sent to ${a.endpoint.slice(0,50)}...`)}catch(l){console.log(` \u274C Push failed: ${l.statusCode} ${l.message}`),(l.statusCode===410||l.statusCode===404)&&s.push(a.endpoint)}s.length>0&&(ot=ot.filter(a=>!s.includes(a.endpoint)),vs())}var hC=dC();fC();function a0(){return hC.publicKey}var gi=L(require("fs"),1),Kl=L(require("path"),1),Eo=0,gs=null,mC=6e4,vC={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function xi(){return process.env.CODESPACES==="true"}function c0(){return xi()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function l0(){Eo++,xi()&&Eo===1&&gC()}function u0(){Eo--,xi()&&Eo===0&&xC()}function gC(){gs||(gs=setInterval(()=>{process.memoryUsage()},mC))}function xC(){gs&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval(gs),gs=null)}function p0(i){return Kl.default.join(i,".devcontainer","devcontainer.json")}function d0(i){try{let e=p0(i);if(!gi.default.existsSync(e))return{enabled:!1,exists:!1};let t=JSON.parse(gi.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 f0(i,e){try{let t=Kl.default.join(i,".devcontainer"),n=p0(i);gi.default.existsSync(t)||gi.default.mkdirSync(t,{recursive:!0});let s={...vC};if(gi.default.existsSync(n))try{s={...JSON.parse(gi.default.readFileSync(n,"utf8"))}}catch{}return e?(s.postAttachCommand="9remote start",s.postCreateCommand||(s.postCreateCommand="npm install -g 9remote@latest")):delete s.postAttachCommand,gi.default.writeFileSync(n,JSON.stringify(s,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var qn=L(require("os"),1),Je=L(require("fs"),1),qi=L(require("path"),1),Ln=qi.default.join(qn.default.homedir(),".9remote","buffers"),ko=qi.default.join(qn.default.homedir(),".9remote","sessions.json"),Co="/tmp/9remote-uploads";Je.default.existsSync(Co)||Je.default.mkdirSync(Co,{recursive:!0});function To(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function Gl(i){return i?"/workspaces":qn.default.homedir()}function Yl(){let i=qn.default.homedir(),e=qn.default.userInfo().username,t=To(),n={...process.env};if(Object.assign(n,{HOME:i,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:i,OLDPWD:i,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 h0(){Je.default.existsSync(Ln)||Je.default.mkdirSync(Ln,{recursive:!0})}function xs(i,e,t){if(t==="buffer"){h0();try{Je.default.writeFileSync(qi.default.join(Ln,`${i}.buf`),e.join(""),"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to save buffer for ${i}:`,n.message)}}}function m0(i,e){if(e!=="buffer")return null;let t=qi.default.join(Ln,`${i}.buf`);try{if(Je.default.existsSync(t))return Je.default.readFileSync(t,"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to load buffer for ${i}:`,n.message)}return null}function Mo(i){let e=qi.default.join(Ln,`${i}.buf`);try{Je.default.existsSync(e)&&Je.default.unlinkSync(e)}catch{}}function v0(){h0();try{return Je.default.readdirSync(Ln).filter(i=>i.endsWith(".buf")).map(i=>i.replace(".buf",""))}catch{return[]}}function g0(){try{if(Je.default.existsSync(ko))return JSON.parse(Je.default.readFileSync(ko,"utf8"))}catch(i){console.log("\u26A0\uFE0F Failed to load session metadata:",i.message)}return{}}function Jl(i){try{let e={};for(let[n,s]of i)e[n]={name:s.name,createdAt:s.createdAt};let t=qi.default.dirname(ko);Je.default.existsSync(t)||Je.default.mkdirSync(t,{recursive:!0}),Je.default.writeFileSync(ko,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}var Xl={};function x0(i,e){Xl[i]=e}function y0(i){delete Xl[i]}function b0(){return{...Xl}}var _0=L(require("fs"),1),S0=L(require("path"),1),yC=w0.default.rgb(230,138,110),te=new Map,Ot="daemon";async function E0(){if(Ot==="daemon")if(!await Om())console.error("\u274C Failed to connect to PTY daemon, falling back to buffer mode");else{let n=await Am();for(let r of n)te.set(r.id,{daemon:!0,name:r.name,createdAt:r.createdAt});let s=n.length;console.log(yC(s>0?`\u2705 Connected to daemon with ${s} session(s)`:"\u2705 Connected to PTY daemon"));return}console.log("\u{1F4E6} Buffer persistence mode - scrollback enabled");let i=v0(),e=g0();for(let t of i){let n=e[t]||{};te.set(t,{pty:null,name:n.name||`Terminal ${te.size+1}`,createdAt:n.createdAt||Date.now(),buffer:[],needsRestore:!0}),console.log(`\u{1F504} Found saved session: ${t}`)}i.length>0&&console.log(`\u2705 Found ${i.length} saved session(s)`)}function k0(i){Ot==="daemon"&&($r("output",({sessionId:e,data:t})=>i.emit("output",{sessionId:e,data:t})),$r("sessionClosed",e=>{te.delete(e),i.emit("sessionClosed",e)}),$r("sessionRenamed",({sessionId:e,name:t})=>{let n=te.get(e);n&&(n.name=t),i.emit("session-renamed",{sessionId:e,name:t})})),i.on("connection",e=>{console.log(`\u{1F4DF} Terminal client connected: ${e.id}`),l0(),e.on("getNotificationState",()=>{e.emit("notificationState",b0())}),e.emit("serverInfo",{remoteAvailable:bm(),daemonMode:Ot==="daemon"&&ti(),platform:process.platform,...c0()}),e.on("getSessions",t=>{let n=[];for(let[s,r]of te)n.push({id:s,name:r.name,createdAt:r.createdAt,restored:r.restored||!1});t(n)}),e.on("createSession",async({name:t},n)=>{let s=`session-${Date.now()}`,r=Yl();r.NINE_REMOTE_SESSION_ID=s;let o=Gl(xi());try{if(Ot==="daemon"&&ti()){let E=await Rm(t,80,24);E.success?(te.set(E.sessionId,{daemon:!0,name:t||`Terminal ${te.size+1}`,createdAt:Date.now(),cwd:E.cwd}),n({success:!0,sessionId:E.sessionId})):n({success:!1,error:E.error});return}let a=To(),l=process.platform==="win32"?[]:["-l"],p=Zl.default.spawn(a,l,{name:"xterm-256color",cols:80,rows:24,cwd:o,env:r,useConpty:!1}),f={pty:p,name:t||`Terminal ${te.size+1}`,createdAt:Date.now(),buffer:[],cwd:o},m=50*1024,_=null;p.onData(E=>{f.buffer.push(E);let k=f.buffer.reduce((T,O)=>T+O.length,0);for(;k>m&&f.buffer.length>1;)k-=f.buffer.shift().length;i.emit("output",{sessionId:s,data:Buffer.from(E,"utf-8")}),Ot==="buffer"&&(_&&clearTimeout(_),_=setTimeout(()=>xs(s,f.buffer,Ot),2e3))}),p.onExit(({exitCode:E})=>{console.log(`PTY exited: sessionId=${s}, code=${E}`),Ot==="buffer"&&f.buffer.length>0&&xs(s,f.buffer,Ot),te.delete(s),Mo(s),i.emit("sessionClosed",s)}),console.log(`PTY created: sessionId=${s}, name=${t}`),te.set(s,f),n({success:!0,sessionId:s})}catch(a){console.error("Failed to create session:",a),n({success:!1,error:a.message})}}),e.on("joinSession",async(t,n)=>{let s=te.get(t);if(!s)return n({success:!1,error:"Session not found"});if(s.daemon&&ti()){try{let r=await Pm(t);n({success:r.success,name:r.name,cwd:r.cwd,error:r.error})}catch(r){n({success:!1,error:r.message})}return}if(s.needsRestore&&Ot==="buffer")try{let r=To(),o=process.platform==="win32"?[]:["-l"],a=Gl(xi()),l=Zl.default.spawn(r,o,{name:"xterm-256color",cols:80,rows:24,cwd:a,env:Yl(),useConpty:!1});s.pty=l,s.needsRestore=!1,s.cwd=a;let p=m0(t,Ot);p&&(s.buffer=[p]);let f=50*1024,m=null;l.onData(_=>{s.buffer.push(_);let E=s.buffer.reduce((k,T)=>k+T.length,0);for(;E>f&&s.buffer.length>1;)E-=s.buffer.shift().length;i.emit("output",{sessionId:t,data:Buffer.from(_,"utf-8")}),m&&clearTimeout(m),m=setTimeout(()=>xs(t,s.buffer,Ot),2e3)}),l.onExit(({exitCode:_})=>{console.log(`PTY exited: sessionId=${t}, code=${_}`),s.buffer.length>0&&xs(t,s.buffer,Ot),te.delete(t),Mo(t),i.emit("sessionClosed",t)}),console.log(`\u2705 Restored PTY session: ${t}`)}catch(r){return console.error("Failed to restore session:",r),n({success:!1,error:"Failed to restore session"})}s.buffer?.length>0&&e.emit("output",{sessionId:t,data:Buffer.from(s.buffer.join(""),"utf-8")}),n({success:!0,name:s.name,cwd:s.cwd})}),e.on("input",({sessionId:t,data:n})=>{if(!t)return;let s=te.get(t);if(s){if(s.daemon&&ti())return cl(t,n);s.pty&&s.pty.write(Buffer.isBuffer(n)?n.toString("utf-8"):n)}}),e.on("upload-file",({sessionId:t,filename:n,size:s,content:r})=>{if(!t)return;let o=te.get(t);if(o)try{let a=n.replace(/[^a-zA-Z0-9._-]/g,"_"),l=S0.default.join(Co,`${Date.now()}_${a}`);_0.default.writeFileSync(l,Buffer.from(r,"base64")),console.log(`\u{1F4CE} File uploaded: ${l} (${s} bytes)`),o.daemon&&ti()?cl(t,l):o.pty&&o.pty.write(l)}catch(a){console.error("File upload error:",a),e.emit("output",{sessionId:t,data:Buffer.from(`\r
43
+ `,Ke.default.writeFileSync(i,n,"utf8"),{success:!0}}function nE(){let i=Kr();if(!Ke.default.existsSync(i))return{success:!0};let e=Ke.default.readFileSync(i,"utf8");return e=e.replace(/\n?# 9Remote notification\nnotify\s*=.*\n?/g,""),Ke.default.writeFileSync(i,e,"utf8"),{success:!0}}function sE(){let i=Gr(),e=Sn(i),t='curl -s "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=gemini" > /dev/null 2>&1',n='curl -s "http://localhost:2208/api/notify?type=notification&sessionId=$NINE_REMOTE_SESSION_ID&tool=gemini" > /dev/null 2>&1';return e.hooks={...e.hooks,enabled:!0,AfterAgent:[{matcher:"",hooks:[{type:"command",command:t}]}],Notification:[{matcher:"",hooks:[{type:"command",command:n}]}]},e.tools||(e.tools={}),e.tools.enableHooks=!0,Yr(i,e),{success:!0}}function rE(){let i=Gr(),e=Sn(i);return e.hooks&&(delete e.hooks.AfterAgent,delete e.hooks.Notification,delete e.hooks.enabled,Object.keys(e.hooks).length===0&&delete e.hooks),Yr(i,e),{success:!0}}function oE(i){switch(i){case"claude":{let e=Sn(Vr());return!!(e.hooks?.Stop||e.hooks?.Notification)}case"codex":{let e=Kr();return Ke.default.existsSync(e)?Ke.default.readFileSync(e,"utf8").includes("# 9Remote notification"):!1}case"gemini":{let e=Sn(Gr());return!!(e.hooks?.AfterAgent||e.hooks?.Notification)}default:return!1}}function aE(i){let e={claude:Vr().replace("/settings.json",""),codex:Kr().replace("/config.toml",""),gemini:Gr().replace("/settings.json","")};return Ke.default.existsSync(e[i])}function Im(i){switch(i){case"claude":return eE();case"codex":return iE();case"gemini":return sE();default:return{success:!1,error:"Unknown tool"}}}function qm(i){switch(i){case"claude":return tE();case"codex":return nE();case"gemini":return rE();default:return{success:!1,error:"Unknown tool"}}}function Lm(){let i=["claude","codex","gemini"],e={};for(let t of i)e[t]={installed:aE(t),enabled:oE(t)};return e}var Vl=L(require("os"),1),Dt=L(require("fs"),1),ms=L(require("path"),1),wo=L(i0(),1),_o=ms.default.join(Vl.default.homedir(),".9remote","vapid.json"),So=ms.default.join(Vl.default.homedir(),".9remote","push-subscriptions.json"),XM=1800*1e3,ot=[];function pC(){try{if(Dt.default.existsSync(_o))return JSON.parse(Dt.default.readFileSync(_o,"utf8"))}catch{}return null}function dC(i){let e=ms.default.dirname(_o);Dt.default.existsSync(e)||Dt.default.mkdirSync(e,{recursive:!0}),Dt.default.writeFileSync(_o,JSON.stringify(i,null,2),"utf8")}function fC(){let i=pC();if(!i){let e=wo.default.generateVAPIDKeys();i={publicKey:e.publicKey,privateKey:e.privateKey},dC(i)}return wo.default.setVapidDetails("mailto:admin@9remote.cc",i.publicKey,i.privateKey),i}function hC(){try{Dt.default.existsSync(So)&&(ot=JSON.parse(Dt.default.readFileSync(So,"utf8")))}catch{ot=[]}}function vs(){try{let i=ms.default.dirname(So);Dt.default.existsSync(i)||Dt.default.mkdirSync(i,{recursive:!0}),Dt.default.writeFileSync(So,JSON.stringify(ot,null,2),"utf8")}catch(i){console.error("Failed to save push subscriptions:",i.message)}}function n0(i,e){ot=ot.filter(t=>t.endpoint!==i.endpoint),ot.push({...i,socketId:e,lastConnectedAt:Date.now()}),vs()}function s0(i){ot=ot.filter(e=>e.endpoint!==i),vs()}function r0(i){for(let e of ot)e.socketId===i&&(e.disconnectedAt=Date.now());vs()}function o0(i,e){for(let t of ot)t.endpoint===e&&(t.socketId=i,t.disconnectedAt=null,t.lastConnectedAt=Date.now());vs()}async function a0(i){let t={claude:"Claude",codex:"Codex",gemini:"Gemini"}[i.tool]||"AI";console.log(`\u{1F514} Sending push notification: ${i.type} ${t}`);let n=JSON.stringify({title:i.type==="stop"?`${t} \u2705`:`${t} \u{1F514}`,body:i.type==="stop"?`${t} completed the task`:`${t} needs your input`,data:{url:"/workspace",type:i.type}}),s=[],r=ot.reduce((a,l)=>(a?.lastConnectedAt??0)>=(l?.lastConnectedAt??0)?a:l,null),o=r?[r]:[];console.log(`\u{1F4E4} sendPush: total=${ot.length} target=${o.length>0?r.endpoint.slice(0,50)+"...":"none"}`);for(let a of o)try{await wo.default.sendNotification({endpoint:a.endpoint,keys:a.keys},n),console.log(` \u2705 Push sent to ${a.endpoint.slice(0,50)}...`)}catch(l){console.log(` \u274C Push failed: ${l.statusCode} ${l.message}`),(l.statusCode===410||l.statusCode===404)&&s.push(a.endpoint)}s.length>0&&(ot=ot.filter(a=>!s.includes(a.endpoint)),vs())}var mC=fC();hC();function c0(){return mC.publicKey}var gi=L(require("fs"),1),Kl=L(require("path"),1),Eo=0,gs=null,vC=6e4,gC={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function xi(){return process.env.CODESPACES==="true"}function l0(){return xi()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function u0(){Eo++,xi()&&Eo===1&&xC()}function p0(){Eo--,xi()&&Eo===0&&yC()}function xC(){gs||(gs=setInterval(()=>{process.memoryUsage()},vC))}function yC(){gs&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval(gs),gs=null)}function d0(i){return Kl.default.join(i,".devcontainer","devcontainer.json")}function f0(i){try{let e=d0(i);if(!gi.default.existsSync(e))return{enabled:!1,exists:!1};let t=JSON.parse(gi.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 h0(i,e){try{let t=Kl.default.join(i,".devcontainer"),n=d0(i);gi.default.existsSync(t)||gi.default.mkdirSync(t,{recursive:!0});let s={...gC};if(gi.default.existsSync(n))try{s={...JSON.parse(gi.default.readFileSync(n,"utf8"))}}catch{}return e?(s.postAttachCommand="9remote start",s.postCreateCommand||(s.postCreateCommand="npm install -g 9remote@latest")):delete s.postAttachCommand,gi.default.writeFileSync(n,JSON.stringify(s,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var qn=L(require("os"),1),Je=L(require("fs"),1),qi=L(require("path"),1),Ln=qi.default.join(qn.default.homedir(),".9remote","buffers"),ko=qi.default.join(qn.default.homedir(),".9remote","sessions.json"),Co="/tmp/9remote-uploads";Je.default.existsSync(Co)||Je.default.mkdirSync(Co,{recursive:!0});function To(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function Gl(i){return i?"/workspaces":qn.default.homedir()}function Yl(){let i=qn.default.homedir(),e=qn.default.userInfo().username,t=To(),n={...process.env};if(Object.assign(n,{HOME:i,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:i,OLDPWD:i,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 m0(){Je.default.existsSync(Ln)||Je.default.mkdirSync(Ln,{recursive:!0})}function xs(i,e,t){if(t==="buffer"){m0();try{Je.default.writeFileSync(qi.default.join(Ln,`${i}.buf`),e.join(""),"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to save buffer for ${i}:`,n.message)}}}function v0(i,e){if(e!=="buffer")return null;let t=qi.default.join(Ln,`${i}.buf`);try{if(Je.default.existsSync(t))return Je.default.readFileSync(t,"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to load buffer for ${i}:`,n.message)}return null}function Mo(i){let e=qi.default.join(Ln,`${i}.buf`);try{Je.default.existsSync(e)&&Je.default.unlinkSync(e)}catch{}}function g0(){m0();try{return Je.default.readdirSync(Ln).filter(i=>i.endsWith(".buf")).map(i=>i.replace(".buf",""))}catch{return[]}}function x0(){try{if(Je.default.existsSync(ko))return JSON.parse(Je.default.readFileSync(ko,"utf8"))}catch(i){console.log("\u26A0\uFE0F Failed to load session metadata:",i.message)}return{}}function Jl(i){try{let e={};for(let[n,s]of i)e[n]={name:s.name,createdAt:s.createdAt};let t=qi.default.dirname(ko);Je.default.existsSync(t)||Je.default.mkdirSync(t,{recursive:!0}),Je.default.writeFileSync(ko,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}var Xl={};function y0(i,e){Xl[i]=e}function b0(i){delete Xl[i]}function w0(){return{...Xl}}var S0=L(require("fs"),1),E0=L(require("path"),1),bC=_0.default.rgb(230,138,110),te=new Map,Ot="daemon";async function k0(){if(Ot==="daemon")if(!await Am())console.error("\u274C Failed to connect to PTY daemon, falling back to buffer mode");else{let n=await Rm();for(let r of n)te.set(r.id,{daemon:!0,name:r.name,createdAt:r.createdAt});let s=n.length;console.log(bC(s>0?`\u2705 Connected to daemon with ${s} session(s)`:"\u2705 Connected to PTY daemon"));return}console.log("\u{1F4E6} Buffer persistence mode - scrollback enabled");let i=g0(),e=x0();for(let t of i){let n=e[t]||{};te.set(t,{pty:null,name:n.name||`Terminal ${te.size+1}`,createdAt:n.createdAt||Date.now(),buffer:[],needsRestore:!0}),console.log(`\u{1F504} Found saved session: ${t}`)}i.length>0&&console.log(`\u2705 Found ${i.length} saved session(s)`)}function C0(i){Ot==="daemon"&&($r("output",({sessionId:e,data:t})=>i.emit("output",{sessionId:e,data:t})),$r("sessionClosed",e=>{te.delete(e),i.emit("sessionClosed",e)}),$r("sessionRenamed",({sessionId:e,name:t})=>{let n=te.get(e);n&&(n.name=t),i.emit("session-renamed",{sessionId:e,name:t})})),i.on("connection",e=>{console.log(`\u{1F4DF} Terminal client connected: ${e.id}`),u0(),e.on("getNotificationState",()=>{e.emit("notificationState",w0())}),e.emit("serverInfo",{remoteAvailable:wm(),daemonMode:Ot==="daemon"&&ti(),platform:process.platform,...l0()}),e.on("getSessions",t=>{let n=[];for(let[s,r]of te)n.push({id:s,name:r.name,createdAt:r.createdAt,restored:r.restored||!1});t(n)}),e.on("createSession",async({name:t},n)=>{let s=`session-${Date.now()}`,r=Yl();r.NINE_REMOTE_SESSION_ID=s;let o=Gl(xi());try{if(Ot==="daemon"&&ti()){let E=await Pm(t,80,24);E.success?(te.set(E.sessionId,{daemon:!0,name:t||`Terminal ${te.size+1}`,createdAt:Date.now(),cwd:E.cwd}),n({success:!0,sessionId:E.sessionId})):n({success:!1,error:E.error});return}let a=To(),l=process.platform==="win32"?[]:["-l"],p=Zl.default.spawn(a,l,{name:"xterm-256color",cols:80,rows:24,cwd:o,env:r,useConpty:!1}),f={pty:p,name:t||`Terminal ${te.size+1}`,createdAt:Date.now(),buffer:[],cwd:o},m=50*1024,_=null;p.onData(E=>{f.buffer.push(E);let k=f.buffer.reduce((T,O)=>T+O.length,0);for(;k>m&&f.buffer.length>1;)k-=f.buffer.shift().length;i.emit("output",{sessionId:s,data:Buffer.from(E,"utf-8")}),Ot==="buffer"&&(_&&clearTimeout(_),_=setTimeout(()=>xs(s,f.buffer,Ot),2e3))}),p.onExit(({exitCode:E})=>{console.log(`PTY exited: sessionId=${s}, code=${E}`),Ot==="buffer"&&f.buffer.length>0&&xs(s,f.buffer,Ot),te.delete(s),Mo(s),i.emit("sessionClosed",s)}),console.log(`PTY created: sessionId=${s}, name=${t}`),te.set(s,f),n({success:!0,sessionId:s})}catch(a){console.error("Failed to create session:",a),n({success:!1,error:a.message})}}),e.on("joinSession",async(t,n)=>{let s=te.get(t);if(!s)return n({success:!1,error:"Session not found"});if(s.daemon&&ti()){try{let r=await Bm(t);n({success:r.success,name:r.name,cwd:r.cwd,error:r.error})}catch(r){n({success:!1,error:r.message})}return}if(s.needsRestore&&Ot==="buffer")try{let r=To(),o=process.platform==="win32"?[]:["-l"],a=Gl(xi()),l=Zl.default.spawn(r,o,{name:"xterm-256color",cols:80,rows:24,cwd:a,env:Yl(),useConpty:!1});s.pty=l,s.needsRestore=!1,s.cwd=a;let p=v0(t,Ot);p&&(s.buffer=[p]);let f=50*1024,m=null;l.onData(_=>{s.buffer.push(_);let E=s.buffer.reduce((k,T)=>k+T.length,0);for(;E>f&&s.buffer.length>1;)E-=s.buffer.shift().length;i.emit("output",{sessionId:t,data:Buffer.from(_,"utf-8")}),m&&clearTimeout(m),m=setTimeout(()=>xs(t,s.buffer,Ot),2e3)}),l.onExit(({exitCode:_})=>{console.log(`PTY exited: sessionId=${t}, code=${_}`),s.buffer.length>0&&xs(t,s.buffer,Ot),te.delete(t),Mo(t),i.emit("sessionClosed",t)}),console.log(`\u2705 Restored PTY session: ${t}`)}catch(r){return console.error("Failed to restore session:",r),n({success:!1,error:"Failed to restore session"})}s.buffer?.length>0&&e.emit("output",{sessionId:t,data:Buffer.from(s.buffer.join(""),"utf-8")}),n({success:!0,name:s.name,cwd:s.cwd})}),e.on("input",({sessionId:t,data:n})=>{if(!t)return;let s=te.get(t);if(s){if(s.daemon&&ti())return cl(t,n);s.pty&&s.pty.write(Buffer.isBuffer(n)?n.toString("utf-8"):n)}}),e.on("upload-file",({sessionId:t,filename:n,size:s,content:r})=>{if(!t)return;let o=te.get(t);if(o)try{let a=n.replace(/[^a-zA-Z0-9._-]/g,"_"),l=E0.default.join(Co,`${Date.now()}_${a}`);S0.default.writeFileSync(l,Buffer.from(r,"base64")),console.log(`\u{1F4CE} File uploaded: ${l} (${s} bytes)`),o.daemon&&ti()?cl(t,l):o.pty&&o.pty.write(l)}catch(a){console.error("File upload error:",a),e.emit("output",{sessionId:t,data:Buffer.from(`\r
44
44
  Error uploading file: ${a.message}\r
45
- `,"utf-8")})}}),e.on("resize",({sessionId:t,cols:n,rows:s})=>{if(!t)return;let r=te.get(t);if(r){if(r.daemon&&ti())return Bm(t,n,s);if(r.pty)try{r.pty.resize(n,s)}catch(o){console.log(`Resize failed for ${t}: ${o.message}`)}}}),e.on("deleteSession",async(t,n)=>{let s=te.get(t);if(!s)return n({success:!1,error:"Session not found"});if(s.daemon&&ti()){try{await jm(t),te.delete(t),n({success:!0})}catch(r){n({success:!1,error:r.message})}return}s.pty&&s.pty.kill(),te.delete(t),Mo(t),i.emit("sessionClosed",t),Jl(te),n({success:!0})}),e.on("renameSession",async({sessionId:t,name:n},s)=>{let r=te.get(t);if(!r)return s({success:!1,error:"Session not found"});if(r.daemon&&ti()){try{await Nm(t,n),r.name=n,s({success:!0})}catch(o){s({success:!1,error:o.message})}return}r.name=n,i.emit("session-renamed",{sessionId:t,name:n}),Jl(te),s({success:!0})}),e.on("enableHook",async({tool:t},n)=>{try{n(await Im(t))}catch(s){n({success:!1,error:s.message})}}),e.on("disableHook",async({tool:t},n)=>{try{n(await Dm(t))}catch(s){n({success:!1,error:s.message})}}),e.on("getHookStatus",t=>t(qm())),e.on("getVapidKey",t=>t(a0())),e.on("pushSubscribe",t=>{t?.endpoint&&(r0(e.id,t.endpoint),i0(t,e.id))}),e.on("pushUnsubscribe",t=>{t&&n0(t)}),e.on("clearNotification",t=>{t&&(y0(t),e.broadcast.emit("notificationCleared",t))}),e.on("getAutoStartStatus",t=>{if(!xi())return t({success:!1,error:"Not in Codespaces"});let n=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();t({success:!0,...d0(n)})}),e.on("setAutoStart",({enabled:t},n)=>{if(!xi())return n({success:!1,error:"Not in Codespaces"});let s=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();n(f0(s,t))}),e.on("disconnect",()=>{console.log(`\u{1F4DF} Terminal client disconnected: ${e.id}`),s0(e.id),u0()})})}var F=L(require("fs"),1),Vt=L(require("path"),1),Fn=L(require("os"),1),Wt=require("child_process");var C0=["node_modules",".git"],T0=[".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"];function M0(i){return C0.includes(i)}function ys(i){let e=Vt.default.extname(i).toLowerCase();return T0.includes(e)}function bC(i,e){return i.isDirectory()?"folder":ys(e)?"binary":"file"}function Oo(i){return i<1024?`${i}B`:i<1024*1024?`${(i/1024).toFixed(1)}KB`:`${(i/(1024*1024)).toFixed(1)}MB`}function O0(i,e,t,n=50){if(!(t.length>=n))try{let s=F.default.readdirSync(i);for(let r of s){if(t.length>=n)return;if(r.startsWith(".")||M0(r))continue;let o=Vt.default.join(i,r);try{let a=F.default.statSync(o);a.isDirectory()?O0(o,e,t,n):r.toLowerCase().includes(e.toLowerCase())&&t.push({name:r,path:o,type:ys(r)?"binary":"file",size:a.size,sizeFormatted:Oo(a.size)})}catch{}}}catch{}}function wC(){if(process.platform!=="win32")return[];try{return(0,Wt.execSync)("wmic logicaldisk get name",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).split(/\r?\n/).map(t=>t.trim()).filter(t=>/^[A-Z]:$/.test(t)).map(t=>({letter:t[0],path:t+"\\"}))}catch{let i=[];for(let e of"CDEFGHIJ"){let t=`${e}:\\`;F.default.existsSync(t)&&i.push({letter:e,path:t})}return i}}function A0(i){i.on("connection",e=>{e.on("getSystemInfo",t=>{let n=process.platform,s=n==="win32";t({success:!0,platform:n,isWindows:s,drives:s?wC():[],homedir:Fn.default.homedir()})}),e.on("getFiles",({dirPath:t},n)=>{try{let s=t||Fn.default.homedir(),r=t?.startsWith("~")?t.replace("~",Fn.default.homedir()):s;if(!F.default.existsSync(r)){n({success:!1,error:"Directory not found"});return}let o=F.default.readdirSync(r),a=[];for(let l of o)if(!(l.startsWith(".")&&l!==".env"&&l!==".env.example")&&!M0(l))try{let p=Vt.default.join(r,l),f=F.default.statSync(p);a.push({name:l,path:p,type:bC(f,l),size:f.isFile()?f.size:null,sizeFormatted:f.isFile()?Oo(f.size):null,modified:f.mtime.getTime()})}catch{}a.sort((l,p)=>l.type==="folder"&&p.type!=="folder"?-1:l.type!=="folder"&&p.type==="folder"?1:l.name.localeCompare(p.name)),n({success:!0,files:a,currentPath:r,parentPath:Vt.default.dirname(r)})}catch(s){n({success:!1,error:s.message})}}),e.on("searchFiles",({workspace:t,query:n},s)=>{try{if(!n||n.length<2){s({success:!0,files:[]});return}let r=t?.startsWith("~")?t.replace("~",Fn.default.homedir()):t||Fn.default.homedir();if(!F.default.existsSync(r)){s({success:!1,error:"Workspace not found"});return}let o=[];O0(r,n,o,50),o.sort((a,l)=>{let p=a.name.toLowerCase()===n.toLowerCase(),f=l.name.toLowerCase()===n.toLowerCase();return p&&!f?-1:!p&&f?1:a.path.length-l.path.length}),s({success:!0,files:o})}catch(r){s({success:!1,error:r.message})}}),e.on("readFile",({filePath:t},n)=>{try{if(!F.default.existsSync(t)){n({success:!1,error:"File not found"});return}let s=F.default.statSync(t);if(s.size>512e3){n({success:!1,error:`File too large (${Oo(s.size)}). Max ${Oo(512e3)}`});return}if(ys(t)){n({success:!1,error:"Cannot open binary file"});return}let r=F.default.readFileSync(t,"utf-8");n({success:!0,content:r})}catch(s){n({success:!1,error:s.message})}}),e.on("writeFile",({filePath:t,content:n},s)=>{try{F.default.writeFileSync(t,n,"utf-8"),s({success:!0})}catch(r){s({success:!1,error:r.message})}}),e.on("createItem",({itemPath:t,type:n},s)=>{try{if(F.default.existsSync(t)){s({success:!1,error:"Item already exists"});return}n==="folder"?F.default.mkdirSync(t,{recursive:!0}):F.default.writeFileSync(t,"","utf-8"),s({success:!0})}catch(r){s({success:!1,error:r.message})}}),e.on("deleteItem",({itemPath:t},n)=>{try{if(!F.default.existsSync(t)){n({success:!1,error:"Item not found"});return}F.default.statSync(t).isDirectory()?F.default.rmSync(t,{recursive:!0}):F.default.unlinkSync(t),n({success:!0})}catch(s){n({success:!1,error:s.message})}}),e.on("renameItem",({oldPath:t,newPath:n},s)=>{try{if(!F.default.existsSync(t)){s({success:!1,error:"Item not found"});return}if(F.default.existsSync(n)){s({success:!1,error:"Target already exists"});return}F.default.renameSync(t,n),s({success:!0})}catch(r){s({success:!1,error:r.message})}}),e.on("gitStatus",({repoPath:t},n)=>{try{let r=(0,Wt.execSync)("git status --porcelain",{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim().split(`
45
+ `,"utf-8")})}}),e.on("resize",({sessionId:t,cols:n,rows:s})=>{if(!t)return;let r=te.get(t);if(r){if(r.daemon&&ti())return jm(t,n,s);if(r.pty)try{r.pty.resize(n,s)}catch(o){console.log(`Resize failed for ${t}: ${o.message}`)}}}),e.on("deleteSession",async(t,n)=>{let s=te.get(t);if(!s)return n({success:!1,error:"Session not found"});if(s.daemon&&ti()){try{await Nm(t),te.delete(t),n({success:!0})}catch(r){n({success:!1,error:r.message})}return}s.pty&&s.pty.kill(),te.delete(t),Mo(t),i.emit("sessionClosed",t),Jl(te),n({success:!0})}),e.on("renameSession",async({sessionId:t,name:n},s)=>{let r=te.get(t);if(!r)return s({success:!1,error:"Session not found"});if(r.daemon&&ti()){try{await Dm(t,n),r.name=n,s({success:!0})}catch(o){s({success:!1,error:o.message})}return}r.name=n,i.emit("session-renamed",{sessionId:t,name:n}),Jl(te),s({success:!0})}),e.on("enableHook",async({tool:t},n)=>{try{n(await Im(t))}catch(s){n({success:!1,error:s.message})}}),e.on("disableHook",async({tool:t},n)=>{try{n(await qm(t))}catch(s){n({success:!1,error:s.message})}}),e.on("getHookStatus",t=>t(Lm())),e.on("getVapidKey",t=>t(c0())),e.on("pushSubscribe",t=>{t?.endpoint&&(o0(e.id,t.endpoint),n0(t,e.id))}),e.on("pushUnsubscribe",t=>{t&&s0(t)}),e.on("clearNotification",t=>{t&&(b0(t),e.broadcast.emit("notificationCleared",t))}),e.on("getAutoStartStatus",t=>{if(!xi())return t({success:!1,error:"Not in Codespaces"});let n=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();t({success:!0,...f0(n)})}),e.on("setAutoStart",({enabled:t},n)=>{if(!xi())return n({success:!1,error:"Not in Codespaces"});let s=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();n(h0(s,t))}),e.on("disconnect",()=>{console.log(`\u{1F4DF} Terminal client disconnected: ${e.id}`),r0(e.id),p0()})})}var F=L(require("fs"),1),Vt=L(require("path"),1),Fn=L(require("os"),1),Wt=require("child_process");var T0=["node_modules",".git"],M0=[".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"];function O0(i){return T0.includes(i)}function ys(i){let e=Vt.default.extname(i).toLowerCase();return M0.includes(e)}function wC(i,e){return i.isDirectory()?"folder":ys(e)?"binary":"file"}function Oo(i){return i<1024?`${i}B`:i<1024*1024?`${(i/1024).toFixed(1)}KB`:`${(i/(1024*1024)).toFixed(1)}MB`}function A0(i,e,t,n=50){if(!(t.length>=n))try{let s=F.default.readdirSync(i);for(let r of s){if(t.length>=n)return;if(r.startsWith(".")||O0(r))continue;let o=Vt.default.join(i,r);try{let a=F.default.statSync(o);a.isDirectory()?A0(o,e,t,n):r.toLowerCase().includes(e.toLowerCase())&&t.push({name:r,path:o,type:ys(r)?"binary":"file",size:a.size,sizeFormatted:Oo(a.size)})}catch{}}}catch{}}function _C(){if(process.platform!=="win32")return[];try{return(0,Wt.execSync)("wmic logicaldisk get name",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).split(/\r?\n/).map(t=>t.trim()).filter(t=>/^[A-Z]:$/.test(t)).map(t=>({letter:t[0],path:t+"\\"}))}catch{let i=[];for(let e of"CDEFGHIJ"){let t=`${e}:\\`;F.default.existsSync(t)&&i.push({letter:e,path:t})}return i}}function R0(i){i.on("connection",e=>{e.on("getSystemInfo",t=>{let n=process.platform,s=n==="win32";t({success:!0,platform:n,isWindows:s,drives:s?_C():[],homedir:Fn.default.homedir()})}),e.on("getFiles",({dirPath:t},n)=>{try{let s=t||Fn.default.homedir(),r=t?.startsWith("~")?t.replace("~",Fn.default.homedir()):s;if(!F.default.existsSync(r)){n({success:!1,error:"Directory not found"});return}let o=F.default.readdirSync(r),a=[];for(let l of o)if(!(l.startsWith(".")&&l!==".env"&&l!==".env.example")&&!O0(l))try{let p=Vt.default.join(r,l),f=F.default.statSync(p);a.push({name:l,path:p,type:wC(f,l),size:f.isFile()?f.size:null,sizeFormatted:f.isFile()?Oo(f.size):null,modified:f.mtime.getTime()})}catch{}a.sort((l,p)=>l.type==="folder"&&p.type!=="folder"?-1:l.type!=="folder"&&p.type==="folder"?1:l.name.localeCompare(p.name)),n({success:!0,files:a,currentPath:r,parentPath:Vt.default.dirname(r)})}catch(s){n({success:!1,error:s.message})}}),e.on("searchFiles",({workspace:t,query:n},s)=>{try{if(!n||n.length<2){s({success:!0,files:[]});return}let r=t?.startsWith("~")?t.replace("~",Fn.default.homedir()):t||Fn.default.homedir();if(!F.default.existsSync(r)){s({success:!1,error:"Workspace not found"});return}let o=[];A0(r,n,o,50),o.sort((a,l)=>{let p=a.name.toLowerCase()===n.toLowerCase(),f=l.name.toLowerCase()===n.toLowerCase();return p&&!f?-1:!p&&f?1:a.path.length-l.path.length}),s({success:!0,files:o})}catch(r){s({success:!1,error:r.message})}}),e.on("readFile",({filePath:t},n)=>{try{if(!F.default.existsSync(t)){n({success:!1,error:"File not found"});return}let s=F.default.statSync(t);if(s.size>512e3){n({success:!1,error:`File too large (${Oo(s.size)}). Max ${Oo(512e3)}`});return}if(ys(t)){n({success:!1,error:"Cannot open binary file"});return}let r=F.default.readFileSync(t,"utf-8");n({success:!0,content:r})}catch(s){n({success:!1,error:s.message})}}),e.on("writeFile",({filePath:t,content:n},s)=>{try{F.default.writeFileSync(t,n,"utf-8"),s({success:!0})}catch(r){s({success:!1,error:r.message})}}),e.on("createItem",({itemPath:t,type:n},s)=>{try{if(F.default.existsSync(t)){s({success:!1,error:"Item already exists"});return}n==="folder"?F.default.mkdirSync(t,{recursive:!0}):F.default.writeFileSync(t,"","utf-8"),s({success:!0})}catch(r){s({success:!1,error:r.message})}}),e.on("deleteItem",({itemPath:t},n)=>{try{if(!F.default.existsSync(t)){n({success:!1,error:"Item not found"});return}F.default.statSync(t).isDirectory()?F.default.rmSync(t,{recursive:!0}):F.default.unlinkSync(t),n({success:!0})}catch(s){n({success:!1,error:s.message})}}),e.on("renameItem",({oldPath:t,newPath:n},s)=>{try{if(!F.default.existsSync(t)){s({success:!1,error:"Item not found"});return}if(F.default.existsSync(n)){s({success:!1,error:"Target already exists"});return}F.default.renameSync(t,n),s({success:!0})}catch(r){s({success:!1,error:r.message})}}),e.on("gitStatus",({repoPath:t},n)=>{try{let r=(0,Wt.execSync)("git status --porcelain",{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim().split(`
46
46
  `).filter(Boolean),o=[],a={};try{(0,Wt.execSync)("git diff HEAD --numstat",{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim().split(`
47
47
  `).filter(Boolean).forEach(p=>{let f=p.split(" ");if(f.length>=3){let m=f[0]==="-"?0:parseInt(f[0],10)||0,_=f[1]==="-"?0:parseInt(f[1],10)||0;a[f[2]]={added:m,deleted:_}}})}catch{}for(let l of r){let p=l.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!p)continue;let f=p[1],m=p[2];if(!m)continue;let _;f.includes("?")?_="?":f.includes("A")?_="A":f.includes("D")?_="D":f.includes("M")?_="M":f.includes("R")?_="R":_=f.trim()[0]||"?";let E=a[m]||{added:0,deleted:0};if(_==="?")try{let k=Vt.default.join(t,m);if(F.default.existsSync(k)&&!ys(m)){let T=F.default.readFileSync(k,"utf-8");E.added=T.split(`
48
48
  `).length,E.deleted=0}}catch{}o.push({status:_,path:m,added:E.added,deleted:E.deleted})}n({success:!0,files:o})}catch{n({success:!1,error:"Not a git repository or git not available"})}}),e.on("gitFileStatus",({repoPath:t,filePath:n},s)=>{try{let r=Vt.default.relative(t,n),a=(0,Wt.execSync)(`git status --porcelain -- "${r}"`,{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(!a){s({success:!0,status:null});return}let l=a.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!l){s({success:!0,status:null});return}let p=l[1],f;p.includes("?")?f="?":p.includes("A")?f="A":p.includes("D")?f="D":p.includes("M")?f="M":p.includes("R")?f="R":f=p.trim()[0]||"?",s({success:!0,status:f,file:r})}catch{s({success:!0,status:null})}}),e.on("gitDiff",({repoPath:t,file:n,status:s},r)=>{try{let o="";if(n&&s==="?"){let a=Vt.default.join(t,n);if(F.default.existsSync(a)){let p=F.default.readFileSync(a,"utf-8").split(`
@@ -61,8 +61,8 @@ new file mode 100644
61
61
  +++ b/${p}
62
62
  @@ -0,0 +1,${E.length} @@
63
63
  ${E.map(k=>`+${k}`).join(`
64
- `)}`}}catch{}}}r({success:!0,diff:o})}catch(o){r({success:!1,error:o.message})}}),e.on("gitDiscard",({repoPath:t,file:n,status:s},r)=>{try{if(!n){r({success:!1,error:"No file specified"});return}let o=Vt.default.join(t,n);s==="?"?F.default.existsSync(o)&&(F.default.statSync(o).isDirectory()?F.default.rmSync(o,{recursive:!0}):F.default.unlinkSync(o)):s==="A"?((0,Wt.execSync)(`git reset HEAD -- "${n}"`,{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),F.default.existsSync(o)&&F.default.unlinkSync(o)):(0,Wt.execSync)(`git checkout HEAD -- "${n}"`,{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),r({success:!0})}catch(o){r({success:!1,error:o.message})}})})}function _C(){try{let i=(0,P0.join)((0,B0.homedir)(),".9remote","keys.json");return JSON.parse((0,R0.readFileSync)(i,"utf8")).key||null}catch{return null}}var j0=null;function eu(){return j0}async function N0(i){let e=new Rh(i,{cors:{origin:"*",methods:["GET","POST"],credentials:!0,allowedHeaders:["*"]},transports:["websocket","polling"],allowEIO3:!0,allowUpgrades:!0,pingTimeout:6e4,pingInterval:25e3});return await ym(),k0(e),wm(e,_C()),A0(e),j0=e,e}var I0=L(require("http"),1),D0=L(require("https"),1),q0=require("child_process"),L0=require("util"),SC=(0,L0.promisify)(q0.exec);async function EC(){let i=process.platform,e=new Set([80,443]);try{let t;if(i==="win32")t="netstat -ano | findstr LISTENING";else{let r="/dev/null";t=`lsof -iTCP -sTCP:LISTEN -P -n 2>${r} || netstat -tlnp 2>${r}`}let{stdout:n}=await SC(t),s=n.split(`
65
- `);for(let r of s){let o=r.match(/[:\*\]](\d{2,5})(?:\s|$)/g);if(o)for(let a of o){let l=parseInt(a.replace(/[:\*\]\s]/g,""),10);l>0&&l<=65535&&(l===80||l===443||l>=1024)&&e.add(l)}}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 kC(i,e=2e3){return new Promise(t=>{let n=I0.default.request({host:"localhost",port:i,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 CC(i,e=2e3){return new Promise(t=>{let n=D0.default.request({host:"localhost",port:i,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 TC(i){let[e,t]=await Promise.all([kC(i),CC(i)]);return t.active?{port:i,...t}:e.active?{port:i,...e}:{port:i,active:!1}}async function F0(){let i=await EC();return(await Promise.all(i.map(t=>TC(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 U0=L(require("crypto"),1),MC=process.env.API_KEY_SECRET||"9remote-api-key-secret";function OC(i,e){return U0.default.createHmac("sha256",MC).update(i+e).digest("hex").slice(0,8)}function AC(i){if(!i||!i.startsWith("sk-"))return null;let e=i.split("-");if(e.length===4){let[,t,n,s]=e,r=OC(t,n);return s!==r?null:{machineId:t,keyId:n}}return null}function H0(i){return AC(i)!==null}async function z0(i,e){let t=i.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(!H0(n)){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Invalid API key"}));return}let s=await F0();e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify(s))}function $0(i){i.setHeader("Access-Control-Allow-Origin","*"),i.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS"),i.setHeader("Access-Control-Allow-Headers","*"),i.setHeader("Access-Control-Allow-Credentials","true")}function W0(i,e){return i.method==="OPTIONS"?(e.writeHead(200),e.end(),!0):!1}var Hn=require("zlib"),Tx=L(Sx(),1);var s2=["data:","javascript:","#","mailto:","blob:"],r2=["href","src","action","srcset","poster","data","formaction","data-src","data-href","data-url","data-background"];function Bo(i,e){return!i||s2.some(t=>i.startsWith(t))||i.startsWith("/proxy/")?i:i.startsWith(`http://localhost:${e}`)?i.replace(`http://localhost:${e}`,`/proxy/${e}`):i.startsWith("/")&&!i.startsWith("//")?`/proxy/${e}${i}`:i}function Ex(i,e){let t=`/proxy/${e}`,n=new RegExp(`(${r2.join("|")})=(["'])([^"']*?)\\2`,"gi");return i=i.replace(n,(s,r,o,a)=>{if(r.toLowerCase()==="srcset"){let l=a.split(",").map(p=>{let[f,...m]=p.trim().split(/\s+/),_=Bo(f,e);return m.length?`${_} ${m.join(" ")}`:_}).join(", ");return`${r}=${o}${l}${o}`}return`${r}=${o}${Bo(a,e)}${o}`}),i=i.replace(/url\(\s*(["']?)(\/_next\/[^)"']+)\1\s*\)/gi,(s,r,o)=>`url(${r}${t}${o}${r})`),i=i.replace(/"(\/_next\/[^"]+)"/g,(s,r)=>`"${t}${r}"`),i}function kx(i){let e=`/proxy/${i}`;return`
64
+ `)}`}}catch{}}}r({success:!0,diff:o})}catch(o){r({success:!1,error:o.message})}}),e.on("gitDiscard",({repoPath:t,file:n,status:s},r)=>{try{if(!n){r({success:!1,error:"No file specified"});return}let o=Vt.default.join(t,n);s==="?"?F.default.existsSync(o)&&(F.default.statSync(o).isDirectory()?F.default.rmSync(o,{recursive:!0}):F.default.unlinkSync(o)):s==="A"?((0,Wt.execSync)(`git reset HEAD -- "${n}"`,{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),F.default.existsSync(o)&&F.default.unlinkSync(o)):(0,Wt.execSync)(`git checkout HEAD -- "${n}"`,{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),r({success:!0})}catch(o){r({success:!1,error:o.message})}})})}function SC(){try{let i=(0,B0.join)((0,j0.homedir)(),".9remote","keys.json");return JSON.parse((0,P0.readFileSync)(i,"utf8")).key||null}catch{return null}}var N0=null;function eu(){return N0}async function D0(i){let e=new Rh(i,{cors:{origin:"*",methods:["GET","POST"],credentials:!0,allowedHeaders:["*"]},transports:["websocket","polling"],allowEIO3:!0,allowUpgrades:!0,pingTimeout:6e4,pingInterval:25e3});return await bm(),C0(e),_m(e,SC()),R0(e),N0=e,e}var I0=L(require("http"),1),q0=L(require("https"),1),L0=require("child_process"),F0=require("util"),EC=(0,F0.promisify)(L0.exec);async function kC(){let i=process.platform,e=new Set([80,443]);try{let t;if(i==="win32")t="netstat -ano | findstr LISTENING";else{let r="/dev/null";t=`lsof -iTCP -sTCP:LISTEN -P -n 2>${r} || netstat -tlnp 2>${r}`}let{stdout:n}=await EC(t),s=n.split(`
65
+ `);for(let r of s){let o=r.match(/[:\*\]](\d{2,5})(?:\s|$)/g);if(o)for(let a of o){let l=parseInt(a.replace(/[:\*\]\s]/g,""),10);l>0&&l<=65535&&(l===80||l===443||l>=1024)&&e.add(l)}}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 CC(i,e=2e3){return new Promise(t=>{let n=I0.default.request({host:"localhost",port:i,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 TC(i,e=2e3){return new Promise(t=>{let n=q0.default.request({host:"localhost",port:i,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 MC(i){let[e,t]=await Promise.all([CC(i),TC(i)]);return t.active?{port:i,...t}:e.active?{port:i,...e}:{port:i,active:!1}}async function U0(){let i=await kC();return(await Promise.all(i.map(t=>MC(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 H0=L(require("crypto"),1),OC=process.env.API_KEY_SECRET||"9remote-api-key-secret";function AC(i,e){return H0.default.createHmac("sha256",OC).update(i+e).digest("hex").slice(0,8)}function RC(i){if(!i||!i.startsWith("sk-"))return null;let e=i.split("-");if(e.length===4){let[,t,n,s]=e,r=AC(t,n);return s!==r?null:{machineId:t,keyId:n}}return null}function z0(i){return RC(i)!==null}async function $0(i,e){let t=i.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(!z0(n)){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Invalid API key"}));return}let s=await U0();e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify(s))}function W0(i){i.setHeader("Access-Control-Allow-Origin","*"),i.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS"),i.setHeader("Access-Control-Allow-Headers","*"),i.setHeader("Access-Control-Allow-Credentials","true")}function V0(i,e){return i.method==="OPTIONS"?(e.writeHead(200),e.end(),!0):!1}var Hn=require("zlib"),Mx=L(Ex(),1);var r2=["data:","javascript:","#","mailto:","blob:"],o2=["href","src","action","srcset","poster","data","formaction","data-src","data-href","data-url","data-background"];function Bo(i,e){return!i||r2.some(t=>i.startsWith(t))||i.startsWith("/proxy/")?i:i.startsWith(`http://localhost:${e}`)?i.replace(`http://localhost:${e}`,`/proxy/${e}`):i.startsWith("/")&&!i.startsWith("//")?`/proxy/${e}${i}`:i}function kx(i,e){let t=`/proxy/${e}`,n=new RegExp(`(${o2.join("|")})=(["'])([^"']*?)\\2`,"gi");return i=i.replace(n,(s,r,o,a)=>{if(r.toLowerCase()==="srcset"){let l=a.split(",").map(p=>{let[f,...m]=p.trim().split(/\s+/),_=Bo(f,e);return m.length?`${_} ${m.join(" ")}`:_}).join(", ");return`${r}=${o}${l}${o}`}return`${r}=${o}${Bo(a,e)}${o}`}),i=i.replace(/url\(\s*(["']?)(\/_next\/[^)"']+)\1\s*\)/gi,(s,r,o)=>`url(${r}${t}${o}${r})`),i=i.replace(/"(\/_next\/[^"]+)"/g,(s,r)=>`"${t}${r}"`),i}function Cx(i){let e=`/proxy/${i}`;return`
66
66
  // Service Worker for 9Remote Proxy - Port ${i}
67
67
  const PROXY_BASE = '${e}';
68
68
  const TARGET_PORT = ${i};
@@ -117,7 +117,7 @@ self.addEventListener('fetch', (event) => {
117
117
 
118
118
  event.respondWith(fetch(new Request(newUrl, requestInit)));
119
119
  });
120
- `}function Cx(i){return`
120
+ `}function Tx(i){return`
121
121
  <script data-proxy-injected="true">
122
122
  (function() {
123
123
  if (window.__proxySwRegistered) return;
@@ -159,7 +159,7 @@ self.addEventListener('fetch', (event) => {
159
159
  });
160
160
  }
161
161
  })();
162
- </script>`}var gu=new Set;function Mx(i){gu.add(String(i))}function Ox(i){gu.delete(String(i))}function o2(i){return gu.has(String(i))}function a2(i){switch(i){case"gzip":return(0,Hn.createGunzip)();case"deflate":return(0,Hn.createInflate)();case"br":return(0,Hn.createBrotliDecompress)();default:return null}}function c2(i,e){if(i.includes("<head>"))return i.replace("<head>","<head>"+e);if(i.includes("<HEAD>"))return i.replace("<HEAD>","<HEAD>"+e);let t=i.match(/<head[^>]*>/i);return t?i.replace(t[0],t[0]+e):e+i}function Ax(){let i=Tx.default.createProxyServer({selfHandleResponse:!0});return i.on("proxyRes",(e,t,n)=>{let s=t._proxyTargetPort,r=e.headers["content-type"]||"",o=e.headers["content-encoding"]||"",a=r.includes("text/html"),l={...e.headers};if(l.location&&(l.location=Bo(l.location,s)),r.includes("application/json")||r.includes("text/x-component")){n.writeHead(e.statusCode,l),e.pipe(n);return}if(r.includes("javascript")||r.includes("text/javascript")){n.writeHead(e.statusCode,l),e.pipe(n);return}if(!a){n.writeHead(e.statusCode,l),e.pipe(n);return}delete l["content-length"],delete l["content-encoding"];let m=a2(o),_=m?e.pipe(m):e,E=[];_.on("data",k=>E.push(k)),_.on("error",k=>{console.error("[Proxy] Decompress error:",k.message),n.writeHead(502),n.end("Bad Gateway: Decompression failed")}),_.on("end",()=>{let k=Buffer.concat(E).toString("utf8");k=Ex(k,s);let T=Cx(s);k=c2(k,T),n.writeHead(e.statusCode,l),n.end(k)})}),i}function Rx(i,e,t,n,s,r){if(s==="/sw.js"){let o=kx(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(!o2(n)){t.writeHead(401,{"Content-Type":"text/html"}),t.end(`
162
+ </script>`}var gu=new Set;function Ox(i){gu.add(String(i))}function Ax(i){gu.delete(String(i))}function a2(i){return gu.has(String(i))}function c2(i){switch(i){case"gzip":return(0,Hn.createGunzip)();case"deflate":return(0,Hn.createInflate)();case"br":return(0,Hn.createBrotliDecompress)();default:return null}}function l2(i,e){if(i.includes("<head>"))return i.replace("<head>","<head>"+e);if(i.includes("<HEAD>"))return i.replace("<HEAD>","<HEAD>"+e);let t=i.match(/<head[^>]*>/i);return t?i.replace(t[0],t[0]+e):e+i}function Rx(){let i=Mx.default.createProxyServer({selfHandleResponse:!0});return i.on("proxyRes",(e,t,n)=>{let s=t._proxyTargetPort,r=e.headers["content-type"]||"",o=e.headers["content-encoding"]||"",a=r.includes("text/html"),l={...e.headers};if(l.location&&(l.location=Bo(l.location,s)),r.includes("application/json")||r.includes("text/x-component")){n.writeHead(e.statusCode,l),e.pipe(n);return}if(r.includes("javascript")||r.includes("text/javascript")){n.writeHead(e.statusCode,l),e.pipe(n);return}if(!a){n.writeHead(e.statusCode,l),e.pipe(n);return}delete l["content-length"],delete l["content-encoding"];let m=c2(o),_=m?e.pipe(m):e,E=[];_.on("data",k=>E.push(k)),_.on("error",k=>{console.error("[Proxy] Decompress error:",k.message),n.writeHead(502),n.end("Bad Gateway: Decompression failed")}),_.on("end",()=>{let k=Buffer.concat(E).toString("utf8");k=kx(k,s);let T=Tx(s);k=l2(k,T),n.writeHead(e.statusCode,l),n.end(k)})}),i}function Px(i,e,t,n,s,r){if(s==="/sw.js"){let o=Cx(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(!a2(n)){t.writeHead(401,{"Content-Type":"text/html"}),t.end(`
163
163
  <!DOCTYPE html>
164
164
  <html>
165
165
  <head><title>Unauthorized</title></head>
@@ -170,7 +170,7 @@ self.addEventListener('fetch', (event) => {
170
170
  </div>
171
171
  </body>
172
172
  </html>
173
- `);return}e._proxyTargetPort=n,e.url=s+(r||""),i.web(e,t,{target:`http://localhost:${n}`,changeOrigin:!0},o=>{t.writeHead(502),t.end(`Bad Gateway: ${o.message}`)})}var qx=L(Zc(),1),l2=qx.default.rgb(230,138,110);function u2(){return process.env.CODESPACES==="true"}async function p2(i,e){if(i.method!=="POST"){e.writeHead(405),e.end(JSON.stringify({error:"Method not allowed"}));return}if(!u2()){e.writeHead(400),e.end(JSON.stringify({error:"Not running on Codespaces"}));return}let t=process.env.CODESPACE_NAME;if(!t){e.writeHead(400),e.end(JSON.stringify({error:"Codespace name not found"}));return}let n=eu();n&&n.emit("codespace:stopping"),e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify({success:!0,message:"Stopping codespace..."})),setTimeout(()=>{(0,Dx.exec)(`gh codespace stop -c ${t}`,s=>{s&&console.error("Failed to stop codespace:",s)})},500)}var d2="localhost",Px=parseInt(process.env.PORT||"2208",10),Bx={},f2=1e4;function jx(i,e,t,n){let s=Date.now(),r,o,a;if(n)r=n.type||"stop",o=n.sessionId||"",a=n.tool||"claude";else try{let p=JSON.parse(t||"{}");r=p.type||"stop",o=p.sessionId||"",a=p.tool||"claude"}catch{e.writeHead(400),e.end(JSON.stringify({error:"Invalid JSON"}));return}let l=eu();if(l){let p={type:r,sessionId:o,tool:a,timestamp:s};if(o&&o){x0(o,p),l.emit("chatNotification",p);let f=`${a}:${r}`;s-(Bx[f]||0)<f2||(Bx[f]=s,l.timeout(5e3).emit("chatNotificationAck",p,(_,E)=>{let k=l.sockets.sockets.size;!(!_&&E&&E.length>0)&&k===0&&o0(p)}))}}e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify({success:!0}))}async function Lx(){await E0();let i=Ax(),e=(0,Nx.createServer)(async(t,n)=>{if($0(n),!W0(t,n))try{let s=(0,Ix.parse)(t.url,!0),{pathname:r,search:o}=s;if(r==="/api/health"){n.setHeader("Content-Type","application/json"),n.writeHead(200),n.end(JSON.stringify({status:"ok",timestamp:Date.now()}));return}if(r==="/api/local-sites"){await z0(t,n);return}if(r==="/api/codespace/stop"){await p2(t,n);return}if(r==="/api/notify"&&t.method==="POST"){let a="";t.on("data",l=>a+=l),t.on("end",()=>{jx(t,n,a)});return}if(r==="/api/notify"&&t.method==="GET"){jx(t,n,null,s.query);return}if(r==="/api/proxy/start"&&t.method==="POST"){let a="";t.on("data",l=>a+=l),t.on("end",()=>{let{port:l}=JSON.parse(a||"{}");l?(Mx(l),n.setHeader("Content-Type","application/json"),n.writeHead(200),n.end(JSON.stringify({success:!0}))):(n.writeHead(400),n.end(JSON.stringify({error:"Port required"})))});return}if(r==="/api/proxy/end"&&t.method==="POST"){let a="";t.on("data",l=>a+=l),t.on("end",()=>{let{port:l}=JSON.parse(a||"{}");l?(Ox(l),n.setHeader("Content-Type","application/json"),n.writeHead(200),n.end(JSON.stringify({success:!0}))):(n.writeHead(400),n.end(JSON.stringify({error:"Port required"})))});return}if(r.startsWith("/proxy/")){let a=r.match(/^\/proxy\/(\d+)(\/.*)?$/);if(a){Rx(i,t,n,a[1],a[2]||"/",o);return}}n.writeHead(404),n.end(JSON.stringify({error:"Not found"}))}catch(s){console.error("Error:",t.url,s),n.statusCode=500,n.end("Internal server error")}});await N0(e),e.listen(Px,t=>{if(t)throw t;console.log(l2(`\u2705 Server ready on http://${d2}:${Px}`))})}Lx();0&&(module.exports={startServer});
173
+ `);return}e._proxyTargetPort=n,e.url=s+(r||""),i.web(e,t,{target:`http://localhost:${n}`,changeOrigin:!0},o=>{t.writeHead(502),t.end(`Bad Gateway: ${o.message}`)})}var Lx=L(Zc(),1),u2=Lx.default.rgb(230,138,110);function p2(){return process.env.CODESPACES==="true"}async function d2(i,e){if(i.method!=="POST"){e.writeHead(405),e.end(JSON.stringify({error:"Method not allowed"}));return}if(!p2()){e.writeHead(400),e.end(JSON.stringify({error:"Not running on Codespaces"}));return}let t=process.env.CODESPACE_NAME;if(!t){e.writeHead(400),e.end(JSON.stringify({error:"Codespace name not found"}));return}let n=eu();n&&n.emit("codespace:stopping"),e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify({success:!0,message:"Stopping codespace..."})),setTimeout(()=>{(0,qx.exec)(`gh codespace stop -c ${t}`,s=>{s&&console.error("Failed to stop codespace:",s)})},500)}var f2="localhost",Bx=parseInt(process.env.PORT||"2208",10),jx={},h2=1e4;function Nx(i,e,t,n){let s=Date.now(),r,o,a;if(n)r=n.type||"stop",o=n.sessionId||"",a=n.tool||"claude";else try{let p=JSON.parse(t||"{}");r=p.type||"stop",o=p.sessionId||"",a=p.tool||"claude"}catch{e.writeHead(400),e.end(JSON.stringify({error:"Invalid JSON"}));return}let l=eu();if(l){let p={type:r,sessionId:o,tool:a,timestamp:s};if(o&&o){y0(o,p),l.emit("chatNotification",p);let f=`${a}:${r}`;s-(jx[f]||0)<h2||(jx[f]=s,l.timeout(5e3).emit("chatNotificationAck",p,(_,E)=>{let k=l.sockets.sockets.size;!(!_&&E&&E.length>0)&&k===0&&a0(p)}))}}e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify({success:!0}))}async function Fx(){await k0();let i=Rx(),e=(0,Dx.createServer)(async(t,n)=>{if(W0(n),!V0(t,n))try{let s=(0,Ix.parse)(t.url,!0),{pathname:r,search:o}=s;if(r==="/api/health"){n.setHeader("Content-Type","application/json"),n.writeHead(200),n.end(JSON.stringify({status:"ok",timestamp:Date.now()}));return}if(r==="/api/local-sites"){await $0(t,n);return}if(r==="/api/codespace/stop"){await d2(t,n);return}if(r==="/api/notify"&&t.method==="POST"){let a="";t.on("data",l=>a+=l),t.on("end",()=>{Nx(t,n,a)});return}if(r==="/api/notify"&&t.method==="GET"){Nx(t,n,null,s.query);return}if(r==="/api/proxy/start"&&t.method==="POST"){let a="";t.on("data",l=>a+=l),t.on("end",()=>{let{port:l}=JSON.parse(a||"{}");l?(Ox(l),n.setHeader("Content-Type","application/json"),n.writeHead(200),n.end(JSON.stringify({success:!0}))):(n.writeHead(400),n.end(JSON.stringify({error:"Port required"})))});return}if(r==="/api/proxy/end"&&t.method==="POST"){let a="";t.on("data",l=>a+=l),t.on("end",()=>{let{port:l}=JSON.parse(a||"{}");l?(Ax(l),n.setHeader("Content-Type","application/json"),n.writeHead(200),n.end(JSON.stringify({success:!0}))):(n.writeHead(400),n.end(JSON.stringify({error:"Port required"})))});return}if(r.startsWith("/proxy/")){let a=r.match(/^\/proxy\/(\d+)(\/.*)?$/);if(a){Px(i,t,n,a[1],a[2]||"/",o);return}}n.writeHead(404),n.end(JSON.stringify({error:"Not found"}))}catch(s){console.error("Error:",t.url,s),n.statusCode=500,n.end("Internal server error")}});await D0(e),e.listen(Bx,t=>{if(t)throw t;console.log(u2(`\u2705 Server ready on http://${f2}:${Bx}`))})}Fx();0&&(module.exports={startServer});
174
174
  /*! Bundled license information:
175
175
 
176
176
  negotiator/index.js: