UNPKG

@awesome-message/sdk

Version:

Awesome Message SDK for admin, messaging, and notification services

14 lines (10 loc) 750 kB
'use strict'; var crypto = require('crypto'); function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } var crypto__default = /*#__PURE__*/_interopDefault(crypto); /** * @AwesomeMessage * Awesome Message SDK * © 2025 PurpleIO */ var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __reflectGet=Reflect.get;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:true,configurable:true,writable:true,value}):obj[key]=value;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true}),__require=(x=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(x,{get:(a,b)=>(typeof require<"u"?require:a)[b]}):x)(function(x){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+x+'" is not supported')});var __commonJS=(cb,mod)=>function(){return mod||(0, cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:true}):target,mod));var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value),__accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg),__privateIn=(member,obj)=>Object(obj)!==obj?__typeError('Cannot use the "in" operator on this value'):member.has(obj),__privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);var __superGet=(cls,obj,key)=>__reflectGet(__getProtoOf(cls),key,obj);var require_symbols=__commonJS({"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/core/symbols.js"(exports$1,module){module.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent")};}});var require_timers=__commonJS({"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/util/timers.js"(exports$1,module){var fastNow=0,RESOLUTION_MS=1e3,TICK_MS=(RESOLUTION_MS>>1)-1,fastNowTimeout,kFastTimer=Symbol("kFastTimer"),fastTimers=[],NOT_IN_LIST=-2,TO_BE_CLEARED=-1,PENDING=0,ACTIVE=1;function onTick(){fastNow+=TICK_MS;let idx=0,len=fastTimers.length;for(;idx<len;){let timer=fastTimers[idx];timer._state===PENDING?(timer._idleStart=fastNow-TICK_MS,timer._state=ACTIVE):timer._state===ACTIVE&&fastNow>=timer._idleStart+timer._idleTimeout&&(timer._state=TO_BE_CLEARED,timer._idleStart=-1,timer._onTimeout(timer._timerArg)),timer._state===TO_BE_CLEARED?(timer._state=NOT_IN_LIST,--len!==0&&(fastTimers[idx]=fastTimers[len])):++idx;}fastTimers.length=len,fastTimers.length!==0&&refreshTimeout();}__name(onTick,"onTick");function refreshTimeout(){fastNowTimeout?.refresh?fastNowTimeout.refresh():(clearTimeout(fastNowTimeout),fastNowTimeout=setTimeout(onTick,TICK_MS),fastNowTimeout?.unref());}__name(refreshTimeout,"refreshTimeout");var _a;_a=kFastTimer;var _FastTimer=class _FastTimer{constructor(callback,delay,arg){__publicField(this,_a,true);__publicField(this,"_state",NOT_IN_LIST);__publicField(this,"_idleTimeout",-1);__publicField(this,"_idleStart",-1);__publicField(this,"_onTimeout");__publicField(this,"_timerArg");this._onTimeout=callback,this._idleTimeout=delay,this._timerArg=arg,this.refresh();}refresh(){this._state===NOT_IN_LIST&&fastTimers.push(this),(!fastNowTimeout||fastTimers.length===1)&&refreshTimeout(),this._state=PENDING;}clear(){this._state=TO_BE_CLEARED,this._idleStart=-1;}};__name(_FastTimer,"FastTimer");var FastTimer=_FastTimer;module.exports={setTimeout(callback,delay,arg){return delay<=RESOLUTION_MS?setTimeout(callback,delay,arg):new FastTimer(callback,delay,arg)},clearTimeout(timeout){timeout[kFastTimer]?timeout.clear():clearTimeout(timeout);},setFastTimeout(callback,delay,arg){return new FastTimer(callback,delay,arg)},clearFastTimeout(timeout){timeout.clear();},now(){return fastNow},tick(delay=0){fastNow+=delay-RESOLUTION_MS+1,onTick(),onTick();},reset(){fastNow=0,fastTimers.length=0,clearTimeout(fastNowTimeout),fastNowTimeout=null;},kFastTimer};}});var require_errors=__commonJS({"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/core/errors.js"(exports$1,module){var kUndiciError=Symbol.for("undici.error.UND_ERR"),_UndiciError=class _UndiciError extends Error{constructor(message,options){super(message,options),this.name="UndiciError",this.code="UND_ERR";}static[Symbol.hasInstance](instance){return instance&&instance[kUndiciError]===true}get[kUndiciError](){return true}};__name(_UndiciError,"UndiciError");var UndiciError=_UndiciError,kConnectTimeoutError=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),_ConnectTimeoutError=class _ConnectTimeoutError extends UndiciError{constructor(message){super(message),this.name="ConnectTimeoutError",this.message=message||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT";}static[Symbol.hasInstance](instance){return instance&&instance[kConnectTimeoutError]===true}get[kConnectTimeoutError](){return true}};__name(_ConnectTimeoutError,"ConnectTimeoutError");var ConnectTimeoutError=_ConnectTimeoutError,kHeadersTimeoutError=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),_HeadersTimeoutError=class _HeadersTimeoutError extends UndiciError{constructor(message){super(message),this.name="HeadersTimeoutError",this.message=message||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT";}static[Symbol.hasInstance](instance){return instance&&instance[kHeadersTimeoutError]===true}get[kHeadersTimeoutError](){return true}};__name(_HeadersTimeoutError,"HeadersTimeoutError");var HeadersTimeoutError=_HeadersTimeoutError,kHeadersOverflowError=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),_HeadersOverflowError=class _HeadersOverflowError extends UndiciError{constructor(message){super(message),this.name="HeadersOverflowError",this.message=message||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW";}static[Symbol.hasInstance](instance){return instance&&instance[kHeadersOverflowError]===true}get[kHeadersOverflowError](){return true}};__name(_HeadersOverflowError,"HeadersOverflowError");var HeadersOverflowError=_HeadersOverflowError,kBodyTimeoutError=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),_BodyTimeoutError=class _BodyTimeoutError extends UndiciError{constructor(message){super(message),this.name="BodyTimeoutError",this.message=message||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT";}static[Symbol.hasInstance](instance){return instance&&instance[kBodyTimeoutError]===true}get[kBodyTimeoutError](){return true}};__name(_BodyTimeoutError,"BodyTimeoutError");var BodyTimeoutError=_BodyTimeoutError,kInvalidArgumentError=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),_InvalidArgumentError=class _InvalidArgumentError extends UndiciError{constructor(message){super(message),this.name="InvalidArgumentError",this.message=message||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG";}static[Symbol.hasInstance](instance){return instance&&instance[kInvalidArgumentError]===true}get[kInvalidArgumentError](){return true}};__name(_InvalidArgumentError,"InvalidArgumentError");var InvalidArgumentError=_InvalidArgumentError,kInvalidReturnValueError=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),_InvalidReturnValueError=class _InvalidReturnValueError extends UndiciError{constructor(message){super(message),this.name="InvalidReturnValueError",this.message=message||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE";}static[Symbol.hasInstance](instance){return instance&&instance[kInvalidReturnValueError]===true}get[kInvalidReturnValueError](){return true}};__name(_InvalidReturnValueError,"InvalidReturnValueError");var InvalidReturnValueError=_InvalidReturnValueError,kAbortError=Symbol.for("undici.error.UND_ERR_ABORT"),_AbortError=class _AbortError extends UndiciError{constructor(message){super(message),this.name="AbortError",this.message=message||"The operation was aborted",this.code="UND_ERR_ABORT";}static[Symbol.hasInstance](instance){return instance&&instance[kAbortError]===true}get[kAbortError](){return true}};__name(_AbortError,"AbortError");var AbortError=_AbortError,kRequestAbortedError=Symbol.for("undici.error.UND_ERR_ABORTED"),_RequestAbortedError=class _RequestAbortedError extends AbortError{constructor(message){super(message),this.name="AbortError",this.message=message||"Request aborted",this.code="UND_ERR_ABORTED";}static[Symbol.hasInstance](instance){return instance&&instance[kRequestAbortedError]===true}get[kRequestAbortedError](){return true}};__name(_RequestAbortedError,"RequestAbortedError");var RequestAbortedError=_RequestAbortedError,kInformationalError=Symbol.for("undici.error.UND_ERR_INFO"),_InformationalError=class _InformationalError extends UndiciError{constructor(message){super(message),this.name="InformationalError",this.message=message||"Request information",this.code="UND_ERR_INFO";}static[Symbol.hasInstance](instance){return instance&&instance[kInformationalError]===true}get[kInformationalError](){return true}};__name(_InformationalError,"InformationalError");var InformationalError=_InformationalError,kRequestContentLengthMismatchError=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),_RequestContentLengthMismatchError=class _RequestContentLengthMismatchError extends UndiciError{constructor(message){super(message),this.name="RequestContentLengthMismatchError",this.message=message||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH";}static[Symbol.hasInstance](instance){return instance&&instance[kRequestContentLengthMismatchError]===true}get[kRequestContentLengthMismatchError](){return true}};__name(_RequestContentLengthMismatchError,"RequestContentLengthMismatchError");var RequestContentLengthMismatchError=_RequestContentLengthMismatchError,kResponseContentLengthMismatchError=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),_ResponseContentLengthMismatchError=class _ResponseContentLengthMismatchError extends UndiciError{constructor(message){super(message),this.name="ResponseContentLengthMismatchError",this.message=message||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH";}static[Symbol.hasInstance](instance){return instance&&instance[kResponseContentLengthMismatchError]===true}get[kResponseContentLengthMismatchError](){return true}};__name(_ResponseContentLengthMismatchError,"ResponseContentLengthMismatchError");var ResponseContentLengthMismatchError=_ResponseContentLengthMismatchError,kClientDestroyedError=Symbol.for("undici.error.UND_ERR_DESTROYED"),_ClientDestroyedError=class _ClientDestroyedError extends UndiciError{constructor(message){super(message),this.name="ClientDestroyedError",this.message=message||"The client is destroyed",this.code="UND_ERR_DESTROYED";}static[Symbol.hasInstance](instance){return instance&&instance[kClientDestroyedError]===true}get[kClientDestroyedError](){return true}};__name(_ClientDestroyedError,"ClientDestroyedError");var ClientDestroyedError=_ClientDestroyedError,kClientClosedError=Symbol.for("undici.error.UND_ERR_CLOSED"),_ClientClosedError=class _ClientClosedError extends UndiciError{constructor(message){super(message),this.name="ClientClosedError",this.message=message||"The client is closed",this.code="UND_ERR_CLOSED";}static[Symbol.hasInstance](instance){return instance&&instance[kClientClosedError]===true}get[kClientClosedError](){return true}};__name(_ClientClosedError,"ClientClosedError");var ClientClosedError=_ClientClosedError,kSocketError=Symbol.for("undici.error.UND_ERR_SOCKET"),_SocketError=class _SocketError extends UndiciError{constructor(message,socket){super(message),this.name="SocketError",this.message=message||"Socket error",this.code="UND_ERR_SOCKET",this.socket=socket;}static[Symbol.hasInstance](instance){return instance&&instance[kSocketError]===true}get[kSocketError](){return true}};__name(_SocketError,"SocketError");var SocketError=_SocketError,kNotSupportedError=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),_NotSupportedError=class _NotSupportedError extends UndiciError{constructor(message){super(message),this.name="NotSupportedError",this.message=message||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED";}static[Symbol.hasInstance](instance){return instance&&instance[kNotSupportedError]===true}get[kNotSupportedError](){return true}};__name(_NotSupportedError,"NotSupportedError");var NotSupportedError=_NotSupportedError,kBalancedPoolMissingUpstreamError=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),_BalancedPoolMissingUpstreamError=class _BalancedPoolMissingUpstreamError extends UndiciError{constructor(message){super(message),this.name="MissingUpstreamError",this.message=message||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM";}static[Symbol.hasInstance](instance){return instance&&instance[kBalancedPoolMissingUpstreamError]===true}get[kBalancedPoolMissingUpstreamError](){return true}};__name(_BalancedPoolMissingUpstreamError,"BalancedPoolMissingUpstreamError");var BalancedPoolMissingUpstreamError=_BalancedPoolMissingUpstreamError,kHTTPParserError=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),_HTTPParserError=class _HTTPParserError extends Error{constructor(message,code,data){super(message),this.name="HTTPParserError",this.code=code?`HPE_${code}`:void 0,this.data=data?data.toString():void 0;}static[Symbol.hasInstance](instance){return instance&&instance[kHTTPParserError]===true}get[kHTTPParserError](){return true}};__name(_HTTPParserError,"HTTPParserError");var HTTPParserError=_HTTPParserError,kResponseExceededMaxSizeError=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),_ResponseExceededMaxSizeError=class _ResponseExceededMaxSizeError extends UndiciError{constructor(message){super(message),this.name="ResponseExceededMaxSizeError",this.message=message||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE";}static[Symbol.hasInstance](instance){return instance&&instance[kResponseExceededMaxSizeError]===true}get[kResponseExceededMaxSizeError](){return true}};__name(_ResponseExceededMaxSizeError,"ResponseExceededMaxSizeError");var ResponseExceededMaxSizeError=_ResponseExceededMaxSizeError,kRequestRetryError=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),_RequestRetryError=class _RequestRetryError extends UndiciError{constructor(message,code,{headers,data}){super(message),this.name="RequestRetryError",this.message=message||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=code,this.data=data,this.headers=headers;}static[Symbol.hasInstance](instance){return instance&&instance[kRequestRetryError]===true}get[kRequestRetryError](){return true}};__name(_RequestRetryError,"RequestRetryError");var RequestRetryError=_RequestRetryError,kResponseError=Symbol.for("undici.error.UND_ERR_RESPONSE"),_ResponseError=class _ResponseError extends UndiciError{constructor(message,code,{headers,body}){super(message),this.name="ResponseError",this.message=message||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=code,this.body=body,this.headers=headers;}static[Symbol.hasInstance](instance){return instance&&instance[kResponseError]===true}get[kResponseError](){return true}};__name(_ResponseError,"ResponseError");var ResponseError=_ResponseError,kSecureProxyConnectionError=Symbol.for("undici.error.UND_ERR_PRX_TLS"),_SecureProxyConnectionError=class _SecureProxyConnectionError extends UndiciError{constructor(cause,message,options={}){super(message,{cause,...options}),this.name="SecureProxyConnectionError",this.message=message||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=cause;}static[Symbol.hasInstance](instance){return instance&&instance[kSecureProxyConnectionError]===true}get[kSecureProxyConnectionError](){return true}};__name(_SecureProxyConnectionError,"SecureProxyConnectionError");var SecureProxyConnectionError=_SecureProxyConnectionError,kMaxOriginsReachedError=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED"),_MaxOriginsReachedError=class _MaxOriginsReachedError extends UndiciError{constructor(message){super(message),this.name="MaxOriginsReachedError",this.message=message||"Maximum allowed origins reached",this.code="UND_ERR_MAX_ORIGINS_REACHED";}static[Symbol.hasInstance](instance){return instance&&instance[kMaxOriginsReachedError]===true}get[kMaxOriginsReachedError](){return true}};__name(_MaxOriginsReachedError,"MaxOriginsReachedError");var MaxOriginsReachedError=_MaxOriginsReachedError;module.exports={AbortError,HTTPParserError,UndiciError,HeadersTimeoutError,HeadersOverflowError,BodyTimeoutError,RequestContentLengthMismatchError,ConnectTimeoutError,InvalidArgumentError,InvalidReturnValueError,RequestAbortedError,ClientDestroyedError,ClientClosedError,InformationalError,SocketError,NotSupportedError,ResponseContentLengthMismatchError,BalancedPoolMissingUpstreamError,ResponseExceededMaxSizeError,RequestRetryError,ResponseError,SecureProxyConnectionError,MaxOriginsReachedError};}});var require_constants=__commonJS({"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/core/constants.js"(exports$1,module){var wellknownHeaderNames=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"],headerNameLowerCasedRecord={};Object.setPrototypeOf(headerNameLowerCasedRecord,null);var wellknownHeaderNameBuffers={};Object.setPrototypeOf(wellknownHeaderNameBuffers,null);function getHeaderNameAsBuffer(header){let buffer=wellknownHeaderNameBuffers[header];return buffer===void 0&&(buffer=Buffer.from(header)),buffer}__name(getHeaderNameAsBuffer,"getHeaderNameAsBuffer");for(let i=0;i<wellknownHeaderNames.length;++i){let key=wellknownHeaderNames[i],lowerCasedKey=key.toLowerCase();headerNameLowerCasedRecord[key]=headerNameLowerCasedRecord[lowerCasedKey]=lowerCasedKey;}module.exports={wellknownHeaderNames,headerNameLowerCasedRecord,getHeaderNameAsBuffer};}});var require_tree=__commonJS({"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/core/tree.js"(exports$1,module){var{wellknownHeaderNames,headerNameLowerCasedRecord}=require_constants(),_TstNode=class _TstNode{constructor(key,value,index){__publicField(this,"value",null);__publicField(this,"left",null);__publicField(this,"middle",null);__publicField(this,"right",null);__publicField(this,"code");if(index===void 0||index>=key.length)throw new TypeError("Unreachable");if((this.code=key.charCodeAt(index))>127)throw new TypeError("key must be ascii string");key.length!==++index?this.middle=new _TstNode(key,value,index):this.value=value;}add(key,value){let length=key.length;if(length===0)throw new TypeError("Unreachable");let index=0,node=this;for(;;){let code=key.charCodeAt(index);if(code>127)throw new TypeError("key must be ascii string");if(node.code===code)if(length===++index){node.value=value;break}else if(node.middle!==null)node=node.middle;else {node.middle=new _TstNode(key,value,index);break}else if(node.code<code)if(node.left!==null)node=node.left;else {node.left=new _TstNode(key,value,index);break}else if(node.right!==null)node=node.right;else {node.right=new _TstNode(key,value,index);break}}}search(key){let keylength=key.length,index=0,node=this;for(;node!==null&&index<keylength;){let code=key[index];for(code<=90&&code>=65&&(code|=32);node!==null;){if(code===node.code){if(keylength===++index)return node;node=node.middle;break}node=node.code<code?node.left:node.right;}}return null}};__name(_TstNode,"TstNode");var TstNode=_TstNode,_TernarySearchTree=class _TernarySearchTree{constructor(){__publicField(this,"node",null);}insert(key,value){this.node===null?this.node=new TstNode(key,value,0):this.node.add(key,value);}lookup(key){return this.node?.search(key)?.value??null}};__name(_TernarySearchTree,"TernarySearchTree");var TernarySearchTree=_TernarySearchTree,tree=new TernarySearchTree;for(let i=0;i<wellknownHeaderNames.length;++i){let key=headerNameLowerCasedRecord[wellknownHeaderNames[i]];tree.insert(key,key);}module.exports={TernarySearchTree,tree};}});var require_util=__commonJS({"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/core/util.js"(exports$1,module){var assert=__require("assert"),{kDestroyed,kBodyUsed,kListeners,kBody}=require_symbols(),{IncomingMessage}=__require("http"),stream=__require("stream"),net=__require("net"),{stringify}=__require("querystring"),{EventEmitter:EE}=__require("events"),timers=require_timers(),{InvalidArgumentError,ConnectTimeoutError}=require_errors(),{headerNameLowerCasedRecord}=require_constants(),{tree}=require_tree(),[nodeMajor,nodeMinor]=process.versions.node.split(".",2).map(v=>Number(v)),_BodyAsyncIterable=class _BodyAsyncIterable{constructor(body){this[kBody]=body,this[kBodyUsed]=false;}async*[Symbol.asyncIterator](){assert(!this[kBodyUsed],"disturbed"),this[kBodyUsed]=true,yield*this[kBody];}};__name(_BodyAsyncIterable,"BodyAsyncIterable");var BodyAsyncIterable=_BodyAsyncIterable;function noop(){}__name(noop,"noop");function wrapRequestBody(body){return isStream(body)?(bodyLength(body)===0&&body.on("data",function(){assert(false);}),typeof body.readableDidRead!="boolean"&&(body[kBodyUsed]=false,EE.prototype.on.call(body,"data",function(){this[kBodyUsed]=true;})),body):body&&typeof body.pipeTo=="function"?new BodyAsyncIterable(body):body&&typeof body!="string"&&!ArrayBuffer.isView(body)&&isIterable(body)?new BodyAsyncIterable(body):body}__name(wrapRequestBody,"wrapRequestBody");function isStream(obj){return obj&&typeof obj=="object"&&typeof obj.pipe=="function"&&typeof obj.on=="function"}__name(isStream,"isStream");function isBlobLike(object){if(object===null)return false;if(object instanceof Blob)return true;if(typeof object!="object")return false;{let sTag=object[Symbol.toStringTag];return (sTag==="Blob"||sTag==="File")&&("stream"in object&&typeof object.stream=="function"||"arrayBuffer"in object&&typeof object.arrayBuffer=="function")}}__name(isBlobLike,"isBlobLike");function pathHasQueryOrFragment(url){return url.includes("?")||url.includes("#")}__name(pathHasQueryOrFragment,"pathHasQueryOrFragment");function serializePathWithQuery(url,queryParams){if(pathHasQueryOrFragment(url))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let stringified=stringify(queryParams);return stringified&&(url+="?"+stringified),url}__name(serializePathWithQuery,"serializePathWithQuery");function isValidPort(port){let value=parseInt(port,10);return value===Number(port)&&value>=0&&value<=65535}__name(isValidPort,"isValidPort");function isHttpOrHttpsPrefixed(value){return value!=null&&value[0]==="h"&&value[1]==="t"&&value[2]==="t"&&value[3]==="p"&&(value[4]===":"||value[4]==="s"&&value[5]===":")}__name(isHttpOrHttpsPrefixed,"isHttpOrHttpsPrefixed");function parseURL(url){if(typeof url=="string"){if(url=new URL(url),!isHttpOrHttpsPrefixed(url.origin||url.protocol))throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");return url}if(!url||typeof url!="object")throw new InvalidArgumentError("Invalid URL: The URL argument must be a non-null object.");if(!(url instanceof URL)){if(url.port!=null&&url.port!==""&&isValidPort(url.port)===false)throw new InvalidArgumentError("Invalid URL: port must be a valid integer or a string representation of an integer.");if(url.path!=null&&typeof url.path!="string")throw new InvalidArgumentError("Invalid URL path: the path must be a string or null/undefined.");if(url.pathname!=null&&typeof url.pathname!="string")throw new InvalidArgumentError("Invalid URL pathname: the pathname must be a string or null/undefined.");if(url.hostname!=null&&typeof url.hostname!="string")throw new InvalidArgumentError("Invalid URL hostname: the hostname must be a string or null/undefined.");if(url.origin!=null&&typeof url.origin!="string")throw new InvalidArgumentError("Invalid URL origin: the origin must be a string or null/undefined.");if(!isHttpOrHttpsPrefixed(url.origin||url.protocol))throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");let port=url.port!=null?url.port:url.protocol==="https:"?443:80,origin=url.origin!=null?url.origin:`${url.protocol||""}//${url.hostname||""}:${port}`,path=url.path!=null?url.path:`${url.pathname||""}${url.search||""}`;return origin[origin.length-1]==="/"&&(origin=origin.slice(0,origin.length-1)),path&&path[0]!=="/"&&(path=`/${path}`),new URL(`${origin}${path}`)}if(!isHttpOrHttpsPrefixed(url.origin||url.protocol))throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");return url}__name(parseURL,"parseURL");function parseOrigin(url){if(url=parseURL(url),url.pathname!=="/"||url.search||url.hash)throw new InvalidArgumentError("invalid url");return url}__name(parseOrigin,"parseOrigin");function getHostname(host){if(host[0]==="["){let idx2=host.indexOf("]");return assert(idx2!==-1),host.substring(1,idx2)}let idx=host.indexOf(":");return idx===-1?host:host.substring(0,idx)}__name(getHostname,"getHostname");function getServerName(host){if(!host)return null;assert(typeof host=="string");let servername=getHostname(host);return net.isIP(servername)?"":servername}__name(getServerName,"getServerName");function deepClone(obj){return JSON.parse(JSON.stringify(obj))}__name(deepClone,"deepClone");function isAsyncIterable(obj){return obj!=null&&typeof obj[Symbol.asyncIterator]=="function"}__name(isAsyncIterable,"isAsyncIterable");function isIterable(obj){return obj!=null&&(typeof obj[Symbol.iterator]=="function"||typeof obj[Symbol.asyncIterator]=="function")}__name(isIterable,"isIterable");function bodyLength(body){if(body==null)return 0;if(isStream(body)){let state=body._readableState;return state&&state.objectMode===false&&state.ended===true&&Number.isFinite(state.length)?state.length:null}else {if(isBlobLike(body))return body.size!=null?body.size:null;if(isBuffer(body))return body.byteLength}return null}__name(bodyLength,"bodyLength");function isDestroyed(body){return body&&!!(body.destroyed||body[kDestroyed]||stream.isDestroyed?.(body))}__name(isDestroyed,"isDestroyed");function destroy(stream2,err){stream2==null||!isStream(stream2)||isDestroyed(stream2)||(typeof stream2.destroy=="function"?(Object.getPrototypeOf(stream2).constructor===IncomingMessage&&(stream2.socket=null),stream2.destroy(err)):err&&queueMicrotask(()=>{stream2.emit("error",err);}),stream2.destroyed!==true&&(stream2[kDestroyed]=true));}__name(destroy,"destroy");var KEEPALIVE_TIMEOUT_EXPR=/timeout=(\d+)/;function parseKeepAliveTimeout(val){let m=val.match(KEEPALIVE_TIMEOUT_EXPR);return m?parseInt(m[1],10)*1e3:null}__name(parseKeepAliveTimeout,"parseKeepAliveTimeout");function headerNameToString(value){return typeof value=="string"?headerNameLowerCasedRecord[value]??value.toLowerCase():tree.lookup(value)??value.toString("latin1").toLowerCase()}__name(headerNameToString,"headerNameToString");function bufferToLowerCasedHeaderName(value){return tree.lookup(value)??value.toString("latin1").toLowerCase()}__name(bufferToLowerCasedHeaderName,"bufferToLowerCasedHeaderName");function parseHeaders(headers,obj){obj===void 0&&(obj={});for(let i=0;i<headers.length;i+=2){let key=headerNameToString(headers[i]),val=obj[key];if(val)typeof val=="string"&&(val=[val],obj[key]=val),val.push(headers[i+1].toString("utf8"));else {let headersValue=headers[i+1];typeof headersValue=="string"?obj[key]=headersValue:obj[key]=Array.isArray(headersValue)?headersValue.map(x=>x.toString("utf8")):headersValue.toString("utf8");}}return "content-length"in obj&&"content-disposition"in obj&&(obj["content-disposition"]=Buffer.from(obj["content-disposition"]).toString("latin1")),obj}__name(parseHeaders,"parseHeaders");function parseRawHeaders(headers){let headersLength=headers.length,ret=new Array(headersLength),hasContentLength=false,contentDispositionIdx=-1,key,val,kLen=0;for(let n=0;n<headersLength;n+=2)key=headers[n],val=headers[n+1],typeof key!="string"&&(key=key.toString()),typeof val!="string"&&(val=val.toString("utf8")),kLen=key.length,kLen===14&&key[7]==="-"&&(key==="content-length"||key.toLowerCase()==="content-length")?hasContentLength=true:kLen===19&&key[7]==="-"&&(key==="content-disposition"||key.toLowerCase()==="content-disposition")&&(contentDispositionIdx=n+1),ret[n]=key,ret[n+1]=val;return hasContentLength&&contentDispositionIdx!==-1&&(ret[contentDispositionIdx]=Buffer.from(ret[contentDispositionIdx]).toString("latin1")),ret}__name(parseRawHeaders,"parseRawHeaders");function encodeRawHeaders(headers){if(!Array.isArray(headers))throw new TypeError("expected headers to be an array");return headers.map(x=>Buffer.from(x))}__name(encodeRawHeaders,"encodeRawHeaders");function isBuffer(buffer){return buffer instanceof Uint8Array||Buffer.isBuffer(buffer)}__name(isBuffer,"isBuffer");function assertRequestHandler(handler,method,upgrade){if(!handler||typeof handler!="object")throw new InvalidArgumentError("handler must be an object");if(typeof handler.onRequestStart!="function"){if(typeof handler.onConnect!="function")throw new InvalidArgumentError("invalid onConnect method");if(typeof handler.onError!="function")throw new InvalidArgumentError("invalid onError method");if(typeof handler.onBodySent!="function"&&handler.onBodySent!==void 0)throw new InvalidArgumentError("invalid onBodySent method");if(upgrade||method==="CONNECT"){if(typeof handler.onUpgrade!="function")throw new InvalidArgumentError("invalid onUpgrade method")}else {if(typeof handler.onHeaders!="function")throw new InvalidArgumentError("invalid onHeaders method");if(typeof handler.onData!="function")throw new InvalidArgumentError("invalid onData method");if(typeof handler.onComplete!="function")throw new InvalidArgumentError("invalid onComplete method")}}}__name(assertRequestHandler,"assertRequestHandler");function isDisturbed(body){return !!(body&&(stream.isDisturbed(body)||body[kBodyUsed]))}__name(isDisturbed,"isDisturbed");function getSocketInfo(socket){return {localAddress:socket.localAddress,localPort:socket.localPort,remoteAddress:socket.remoteAddress,remotePort:socket.remotePort,remoteFamily:socket.remoteFamily,timeout:socket.timeout,bytesWritten:socket.bytesWritten,bytesRead:socket.bytesRead}}__name(getSocketInfo,"getSocketInfo");function ReadableStreamFrom(iterable){let iterator;return new ReadableStream({start(){iterator=iterable[Symbol.asyncIterator]();},pull(controller){return iterator.next().then(({done,value})=>{if(done)queueMicrotask(()=>{controller.close(),controller.byobRequest?.respond(0);});else {let buf=Buffer.isBuffer(value)?value:Buffer.from(value);if(buf.byteLength)controller.enqueue(new Uint8Array(buf));else return this.pull(controller)}})},cancel(){return iterator.return()},type:"bytes"})}__name(ReadableStreamFrom,"ReadableStreamFrom");function isFormDataLike(object){return object&&typeof object=="object"&&typeof object.append=="function"&&typeof object.delete=="function"&&typeof object.get=="function"&&typeof object.getAll=="function"&&typeof object.has=="function"&&typeof object.set=="function"&&object[Symbol.toStringTag]==="FormData"}__name(isFormDataLike,"isFormDataLike");function addAbortListener(signal,listener){return "addEventListener"in signal?(signal.addEventListener("abort",listener,{once:true}),()=>signal.removeEventListener("abort",listener)):(signal.once("abort",listener),()=>signal.removeListener("abort",listener))}__name(addAbortListener,"addAbortListener");function isTokenCharCode(c){switch(c){case 34:case 40:case 41:case 44:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 123:case 125:return false;default:return c>=33&&c<=126}}__name(isTokenCharCode,"isTokenCharCode");function isValidHTTPToken(characters){if(characters.length===0)return false;for(let i=0;i<characters.length;++i)if(!isTokenCharCode(characters.charCodeAt(i)))return false;return true}__name(isValidHTTPToken,"isValidHTTPToken");var headerCharRegex=/[^\t\x20-\x7e\x80-\xff]/;function isValidHeaderValue(characters){return !headerCharRegex.test(characters)}__name(isValidHeaderValue,"isValidHeaderValue");var rangeHeaderRegex=/^bytes (\d+)-(\d+)\/(\d+)?$/;function parseRangeHeader(range){if(range==null||range==="")return {start:0,end:null,size:null};let m=range?range.match(rangeHeaderRegex):null;return m?{start:parseInt(m[1]),end:m[2]?parseInt(m[2]):null,size:m[3]?parseInt(m[3]):null}:null}__name(parseRangeHeader,"parseRangeHeader");function addListener(obj,name,listener){return (obj[kListeners]??(obj[kListeners]=[])).push([name,listener]),obj.on(name,listener),obj}__name(addListener,"addListener");function removeAllListeners(obj){if(obj[kListeners]!=null){for(let[name,listener]of obj[kListeners])obj.removeListener(name,listener);obj[kListeners]=null;}return obj}__name(removeAllListeners,"removeAllListeners");function errorRequest(client,request2,err){try{request2.onError(err),assert(request2.aborted);}catch(err2){client.emit("error",err2);}}__name(errorRequest,"errorRequest");var setupConnectTimeout=process.platform==="win32"?(socketWeakRef,opts)=>{if(!opts.timeout)return noop;let s1=null,s2=null,fastTimer=timers.setFastTimeout(()=>{s1=setImmediate(()=>{s2=setImmediate(()=>onConnectTimeout(socketWeakRef.deref(),opts));});},opts.timeout);return ()=>{timers.clearFastTimeout(fastTimer),clearImmediate(s1),clearImmediate(s2);}}:(socketWeakRef,opts)=>{if(!opts.timeout)return noop;let s1=null,fastTimer=timers.setFastTimeout(()=>{s1=setImmediate(()=>{onConnectTimeout(socketWeakRef.deref(),opts);});},opts.timeout);return ()=>{timers.clearFastTimeout(fastTimer),clearImmediate(s1);}};function onConnectTimeout(socket,opts){if(socket==null)return;let message="Connect Timeout Error";Array.isArray(socket.autoSelectFamilyAttemptedAddresses)?message+=` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(", ")},`:message+=` (attempted address: ${opts.hostname}:${opts.port},`,message+=` timeout: ${opts.timeout}ms)`,destroy(socket,new ConnectTimeoutError(message));}__name(onConnectTimeout,"onConnectTimeout");function getProtocolFromUrlString(urlString){if(urlString[0]==="h"&&urlString[1]==="t"&&urlString[2]==="t"&&urlString[3]==="p")switch(urlString[4]){case ":":return "http:";case "s":if(urlString[5]===":")return "https:"}return urlString.slice(0,urlString.indexOf(":")+1)}__name(getProtocolFromUrlString,"getProtocolFromUrlString");var kEnumerableProperty=Object.create(null);kEnumerableProperty.enumerable=true;var normalizedMethodRecordsBase={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"},normalizedMethodRecords={...normalizedMethodRecordsBase,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(normalizedMethodRecordsBase,null);Object.setPrototypeOf(normalizedMethodRecords,null);module.exports={kEnumerableProperty,isDisturbed,isBlobLike,parseOrigin,parseURL,getServerName,isStream,isIterable,isAsyncIterable,isDestroyed,headerNameToString,bufferToLowerCasedHeaderName,addListener,removeAllListeners,errorRequest,parseRawHeaders,encodeRawHeaders,parseHeaders,parseKeepAliveTimeout,destroy,bodyLength,deepClone,ReadableStreamFrom,isBuffer,assertRequestHandler,getSocketInfo,isFormDataLike,pathHasQueryOrFragment,serializePathWithQuery,addAbortListener,isValidHTTPToken,isValidHeaderValue,isTokenCharCode,parseRangeHeader,normalizedMethodRecordsBase,normalizedMethodRecords,isValidPort,isHttpOrHttpsPrefixed,nodeMajor,nodeMinor,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody,setupConnectTimeout,getProtocolFromUrlString};}});var require_stats=__commonJS({"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/util/stats.js"(exports$1,module){var{kConnected,kPending,kRunning,kSize,kFree,kQueued}=require_symbols(),_ClientStats=class _ClientStats{constructor(client){this.connected=client[kConnected],this.pending=client[kPending],this.running=client[kRunning],this.size=client[kSize];}};__name(_ClientStats,"ClientStats");var ClientStats=_ClientStats,_PoolStats=class _PoolStats{constructor(pool){this.connected=pool[kConnected],this.free=pool[kFree],this.pending=pool[kPending],this.queued=pool[kQueued],this.running=pool[kRunning],this.size=pool[kSize];}};__name(_PoolStats,"PoolStats");var PoolStats=_PoolStats;module.exports={ClientStats,PoolStats};}});var require_diagnostics=__commonJS({"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/core/diagnostics.js"(exports$1,module){var diagnosticsChannel=__require("diagnostics_channel"),util=__require("util"),undiciDebugLog=util.debuglog("undici"),fetchDebuglog=util.debuglog("fetch"),websocketDebuglog=util.debuglog("websocket"),channels={beforeConnect:diagnosticsChannel.channel("undici:client:beforeConnect"),connected:diagnosticsChannel.channel("undici:client:connected"),connectError:diagnosticsChannel.channel("undici:client:connectError"),sendHeaders:diagnosticsChannel.channel("undici:client:sendHeaders"),create:diagnosticsChannel.channel("undici:request:create"),bodySent:diagnosticsChannel.channel("undici:request:bodySent"),bodyChunkSent:diagnosticsChannel.channel("undici:request:bodyChunkSent"),bodyChunkReceived:diagnosticsChannel.channel("undici:request:bodyChunkReceived"),headers:diagnosticsChannel.channel("undici:request:headers"),trailers:diagnosticsChannel.channel("undici:request:trailers"),error:diagnosticsChannel.channel("undici:request:error"),open:diagnosticsChannel.channel("undici:websocket:open"),close:diagnosticsChannel.channel("undici:websocket:close"),socketError:diagnosticsChannel.channel("undici:websocket:socket_error"),ping:diagnosticsChannel.channel("undici:websocket:ping"),pong:diagnosticsChannel.channel("undici:websocket:pong")},isTrackingClientEvents=false;function trackClientEvents(debugLog=undiciDebugLog){isTrackingClientEvents||(isTrackingClientEvents=true,diagnosticsChannel.subscribe("undici:client:beforeConnect",evt=>{let{connectParams:{version,protocol,port,host}}=evt;debugLog("connecting to %s%s using %s%s",host,port?`:${port}`:"",protocol,version);}),diagnosticsChannel.subscribe("undici:client:connected",evt=>{let{connectParams:{version,protocol,port,host}}=evt;debugLog("connected to %s%s using %s%s",host,port?`:${port}`:"",protocol,version);}),diagnosticsChannel.subscribe("undici:client:connectError",evt=>{let{connectParams:{version,protocol,port,host},error}=evt;debugLog("connection to %s%s using %s%s errored - %s",host,port?`:${port}`:"",protocol,version,error.message);}),diagnosticsChannel.subscribe("undici:client:sendHeaders",evt=>{let{request:{method,path,origin}}=evt;debugLog("sending request to %s %s%s",method,origin,path);}));}__name(trackClientEvents,"trackClientEvents");var isTrackingRequestEvents=false;function trackRequestEvents(debugLog=undiciDebugLog){isTrackingRequestEvents||(isTrackingRequestEvents=true,diagnosticsChannel.subscribe("undici:request:headers",evt=>{let{request:{method,path,origin},response:{statusCode}}=evt;debugLog("received response to %s %s%s - HTTP %d",method,origin,path,statusCode);}),diagnosticsChannel.subscribe("undici:request:trailers",evt=>{let{request:{method,path,origin}}=evt;debugLog("trailers received from %s %s%s",method,origin,path);}),diagnosticsChannel.subscribe("undici:request:error",evt=>{let{request:{method,path,origin},error}=evt;debugLog("request to %s %s%s errored - %s",method,origin,path,error.message);}));}__name(trackRequestEvents,"trackRequestEvents");var isTrackingWebSocketEvents=false;function trackWebSocketEvents(debugLog=websocketDebuglog){isTrackingWebSocketEvents||(isTrackingWebSocketEvents=true,diagnosticsChannel.subscribe("undici:websocket:open",evt=>{let{address:{address,port}}=evt;debugLog("connection opened %s%s",address,port?`:${port}`:"");}),diagnosticsChannel.subscribe("undici:websocket:close",evt=>{let{websocket,code,reason}=evt;debugLog("closed connection to %s - %s %s",websocket.url,code,reason);}),diagnosticsChannel.subscribe("undici:websocket:socket_error",err=>{debugLog("connection errored - %s",err.message);}),diagnosticsChannel.subscribe("undici:websocket:ping",evt=>{debugLog("ping received");}),diagnosticsChannel.subscribe("undici:websocket:pong",evt=>{debugLog("pong received");}));}__name(trackWebSocketEvents,"trackWebSocketEvents");(undiciDebugLog.enabled||fetchDebuglog.enabled)&&(trackClientEvents(fetchDebuglog.enabled?fetchDebuglog:undiciDebugLog),trackRequestEvents(fetchDebuglog.enabled?fetchDebuglog:undiciDebugLog));websocketDebuglog.enabled&&(trackClientEvents(undiciDebugLog.enabled?undiciDebugLog:websocketDebuglog),trackWebSocketEvents(websocketDebuglog));module.exports={channels};}});var require_request=__commonJS({"../node_modules/.pnpm/undici@7.16.0/node_modules/undici/lib/core/request.js"(exports$1,module){var{InvalidArgumentError,NotSupportedError}=require_errors(),assert=__require("assert"),{isValidHTTPToken,isValidHeaderValue,isStream,destroy,isBuffer,isFormDataLike,isIterable,isBlobLike,serializePathWithQuery,assertRequestHandler,getServerName,normalizedMethodRecords,getProtocolFromUrlString}=require_util(),{channels}=require_diagnostics(),{headerNameLowerCasedRecord}=require_constants(),invalidPathRegex=/[^\u0021-\u00ff]/,kHandler=Symbol("handler"),_Request=class _Request{constructor(origin,{path,method,body,headers,query,idempotent,blocking,upgrade,headersTimeout,bodyTimeout,reset,expectContinue,servername,throwOnError,maxRedirections},handler){if(typeof path!="string")throw new InvalidArgumentError("path must be a string");if(path[0]!=="/"&&!(path.startsWith("http://")||path.startsWith("https://"))&&method!=="CONNECT")throw new InvalidArgumentError("path must be an absolute URL or start with a slash");if(invalidPathRegex.test(path))throw new InvalidArgumentError("invalid request path");if(typeof method!="string")throw new InvalidArgumentError("method must be a string");if(normalizedMethodRecords[method]===void 0&&!isValidHTTPToken(method))throw new InvalidArgumentError("invalid request method");if(upgrade&&typeof upgrade!="string")throw new InvalidArgumentError("upgrade must be a string");if(headersTimeout!=null&&(!Number.isFinite(headersTimeout)||headersTimeout<0))throw new InvalidArgumentError("invalid headersTimeout");if(bodyTimeout!=null&&(!Number.isFinite(bodyTimeout)||bodyTimeout<0))throw new InvalidArgumentError("invalid bodyTimeout");if(reset!=null&&typeof reset!="boolean")throw new InvalidArgumentError("invalid reset");if(expectContinue!=null&&typeof expectContinue!="boolean")throw new InvalidArgumentError("invalid expectContinue");if(throwOnError!=null)throw new InvalidArgumentError("invalid throwOnError");if(maxRedirections!=null&&maxRedirections!==0)throw new InvalidArgumentError("maxRedirections is not supported, use the redirect interceptor");if(this.headersTimeout=headersTimeout,this.bodyTimeout=bodyTimeout,this.method=method,this.abort=null,body==null)this.body=null;else if(isStream(body)){this.body=body;let rState=this.body._readableState;(!rState||!rState.autoDestroy)&&(this.endHandler=__name(function(){destroy(this);},"autoDestroy"),this.body.on("end",this.endHandler)),this.errorHandler=err=>{this.abort?this.abort(err):this.error=err;},this.body.on("error",this.errorHandler);}else if(isBuffer(body))this.body=body.byteLength?body:null;else if(ArrayBuffer.isView(body))this.body=body.buffer.byteLength?Buffer.from(body.buffer,body.byteOffset,body.byteLength):null;else if(body instanceof ArrayBuffer)this.body=body.byteLength?Buffer.from(body):null;else if(typeof body=="string")this.body=body.length?Buffer.from(body):null;else if(isFormDataLike(body)||isIterable(body)||isBlobLike(body))this.body=body;else throw new InvalidArgumentError("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=false,this.aborted=false,this.upgrade=upgrade||null,this.path=query?serializePathWithQuery(path,query):path,this.origin=origin,this.protocol=getProtocolFromUrlString(origin),this.idempotent=idempotent??(method==="HEAD"||method==="GET"),this.blocking=blocking??this.method!=="HEAD",this.reset=reset??null,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=expectContinue??false,Array.isArray(headers)){if(headers.length%2!==0)throw new InvalidArgumentError("headers array must be even");for(let i=0;i<headers.length;i+=2)processHeader(this,headers[i],headers[i+1]);}else if(headers&&typeof headers=="object")if(headers[Symbol.iterator])for(let header of headers){if(!Array.isArray(header)||header.length!==2)throw new InvalidArgumentError("headers must be in key-value pair format");processHeader(this,header[0],header[1]);}else {let keys=Object.keys(headers);for(let i=0;i<keys.length;++i)processHeader(this,keys[i],headers[keys[i]]);}else if(headers!=null)throw new InvalidArgumentError("headers must be an object or an array");assertRequestHandler(handler,method,upgrade),this.servername=servername||getServerName(this.host)||null,this[kHandler]=handler,channels.create.hasSubscribers&&channels.create.publish({request:this});}onBodySent(chunk){if(channels.bodyChunkSent.hasSubscribers&&channels.bodyChunkSent.publish({request:this,chunk}),this[kHandler].onBodySent)try{return this[kHandler].onBodySent(chunk)}catch(err){this.abort(err);}}onRequest