nvim-lua.kickstart.nvim/debuggers/vscode-js-debug/js-debug/src/dapDebugServer.js
2025-01-19 11:54:28 +01:00

183 lines
794 KiB
JavaScript

"use strict";(()=>{var FO=Object.create;var mp=Object.defineProperty;var M_=Object.getOwnPropertyDescriptor;var UO=Object.getOwnPropertyNames;var WO=Object.getPrototypeOf,jO=Object.prototype.hasOwnProperty;var H=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var zs=(r,e)=>()=>(r&&(e=r(r=0)),e);var v=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),VO=(r,e)=>{for(var t in e)mp(r,t,{get:e[t],enumerable:!0})},qO=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of UO(e))!jO.call(r,i)&&i!==t&&mp(r,i,{get:()=>e[i],enumerable:!(n=M_(e,i))||n.enumerable});return r};var _=(r,e,t)=>(t=r!=null?FO(WO(r)):{},qO(e||!r||!r.__esModule?mp(t,"default",{value:r,enumerable:!0}):t,r));var E=(r,e,t,n)=>{for(var i=n>1?void 0:n?M_(e,t):e,o=r.length-1,s;o>=0;o--)(s=r[o])&&(i=(n?s(e,t,i):s(i))||i);return n&&i&&mp(e,t,i),i},g=(r,e)=>(t,n)=>e(t,n,r);var je=v((EJ,N_)=>{"use strict";var DH=Object.defineProperty,GO=Object.getOwnPropertyDescriptor,KO=Object.getOwnPropertyNames,XO=Object.prototype.hasOwnProperty,zO=(r,e)=>{for(var t in e)DH(r,t,{get:e[t],enumerable:!0})},JO=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of KO(e))!XO.call(r,i)&&i!==t&&DH(r,i,{get:()=>e[i],enumerable:!(n=GO(e,i))||n.enumerable});return r},YO=r=>JO(DH({},"__esModule",{value:!0}),r),k_={};zO(k_,{config:()=>rN,t:()=>O_});N_.exports=YO(k_);var QO=H("fs"),ZO=H("fs/promises");async function eN(r){if(r.protocol==="file:")return await(0,ZO.readFile)(r,"utf8");if(r.protocol==="http:"||r.protocol==="https:"){let e=await fetch(r.toString(),{headers:{"Accept-Encoding":"gzip, deflate",Accept:"application/json"},redirect:"follow"});if(!e.ok){let n=`Unexpected ${e.status} response while trying to read ${r}`;try{n+=`: ${await e.text()}`}catch{}throw new Error(n)}return await e.text()}throw new Error("Unsupported protocol")}function tN(r){return(0,QO.readFileSync)(r,"utf8")}var lu;function rN(r){if("contents"in r){typeof r.contents=="string"?lu=JSON.parse(r.contents):lu=r.contents;return}if("fsPath"in r){let e=tN(r.fsPath),t=JSON.parse(e);lu=R_(t)?t.contents.bundle:t;return}if(r.uri){let e=r.uri;return typeof r.uri=="string"&&(e=new URL(r.uri)),new Promise((t,n)=>{eN(e).then(i=>{try{let o=JSON.parse(i);lu=R_(o)?o.contents.bundle:o,t()}catch(o){n(o)}}).catch(i=>{n(i)})})}}function O_(...r){let e=r[0],t,n,i;if(typeof e=="string")t=e,n=e,r.splice(0,1),i=!r||typeof r[0]!="object"?r:r[0];else if(e instanceof Array){let s=r.slice(1);if(e.length!==s.length+1)throw new Error("expected a string as the first argument to l10n.t");let a=e[0];for(let c=1;c<e.length;c++)a+=`{${c-1}}`+e[c];return O_(a,...s)}else n=e.message,t=n,e.comment&&e.comment.length>0&&(t+=`/${Array.isArray(e.comment)?e.comment.join(""):e.comment}`),i=e.args??{};let o=lu?.[t];return o?typeof o=="string"?Hp(o,i):o.comment?Hp(o.message,i):Hp(n,i):Hp(n,i)}var nN=/{([^}]+)}/g;function Hp(r,e){return Object.keys(e).length===0?r:r.replace(nN,(t,n)=>e[n]??t)}function R_(r){return typeof r?.contents?.bundle=="object"&&typeof r?.version=="string"}});var TH=v(()=>{var B_;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:a(),n=i(r);typeof t.Reflect<"u"&&(n=i(t.Reflect,n)),e(n,t),typeof t.Reflect>"u"&&(t.Reflect=r);function i(c,u){return function(l,p){Object.defineProperty(c,l,{configurable:!0,writable:!0,value:p}),u&&u(l,p)}}function o(){try{return Function("return this;")()}catch{}}function s(){try{return(0,eval)("(function() { return this; })()")}catch{}}function a(){return o()||s()}})(function(e,t){var n=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",o=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",s=i&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",a=typeof Object.create=="function",c={__proto__:[]}instanceof Array,u=!a&&!c,l={create:a?function(){return CH(Object.create(null))}:c?function(){return CH({__proto__:null})}:function(){return CH({})},has:u?function(I,A){return n.call(I,A)}:function(I,A){return A in I},get:u?function(I,A){return n.call(I,A)?I[A]:void 0}:function(I,A){return I[A]}},p=Object.getPrototypeOf(Function),d=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:RO(),f=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:kO(),h=typeof WeakMap=="function"?WeakMap:OO(),m=i?Symbol.for("@reflect-metadata:registry"):void 0,y=DO(),w=TO(y);function D(I,A,L,M){if(ee(L)){if(!k(I))throw new TypeError;if(!Le(A))throw new TypeError;return Pe(I,A)}else{if(!k(I))throw new TypeError;if(!be(A))throw new TypeError;if(!be(M)&&!ee(M)&&!Ri(M))throw new TypeError;return Ri(M)&&(M=void 0),L=ae(L),_e(I,A,L,M)}}e("decorate",D);function j(I,A){function L(M,Q){if(!be(M))throw new TypeError;if(!ee(Q)&&!vt(Q))throw new TypeError;le(I,A,M,Q)}return L}e("metadata",j);function X(I,A,L,M){if(!be(L))throw new TypeError;return ee(M)||(M=ae(M)),le(I,A,L,M)}e("defineMetadata",X);function B(I,A,L){if(!be(A))throw new TypeError;return ee(L)||(L=ae(L)),Kr(I,A,L)}e("hasMetadata",B);function Z(I,A,L){if(!be(A))throw new TypeError;return ee(L)||(L=ae(L)),x(I,A,L)}e("hasOwnMetadata",Z);function O(I,A,L){if(!be(A))throw new TypeError;return ee(L)||(L=ae(L)),P(I,A,L)}e("getMetadata",O);function G(I,A,L){if(!be(A))throw new TypeError;return ee(L)||(L=ae(L)),pt(I,A,L)}e("getOwnMetadata",G);function re(I,A){if(!be(I))throw new TypeError;return ee(A)||(A=ae(A)),tr(I,A)}e("getMetadataKeys",re);function xe(I,A){if(!be(I))throw new TypeError;return ee(A)||(A=ae(A)),rr(I,A)}e("getOwnMetadataKeys",xe);function $(I,A,L){if(!be(A))throw new TypeError;if(ee(L)||(L=ae(L)),!be(A))throw new TypeError;ee(L)||(L=ae(L));var M=uu(A,L,!1);return ee(M)?!1:M.OrdinaryDeleteMetadata(I,A,L)}e("deleteMetadata",$);function Pe(I,A){for(var L=I.length-1;L>=0;--L){var M=I[L],Q=M(A);if(!ee(Q)&&!Ri(Q)){if(!Le(Q))throw new TypeError;A=Q}}return A}function _e(I,A,L,M){for(var Q=I.length-1;Q>=0;--Q){var Ge=I[Q],at=Ge(A,L,M);if(!ee(at)&&!Ri(at)){if(!be(at))throw new TypeError;M=at}}return M}function Kr(I,A,L){var M=x(I,A,L);if(M)return!0;var Q=$H(A);return Ri(Q)?!1:Kr(I,Q,L)}function x(I,A,L){var M=uu(A,L,!1);return ee(M)?!1:hp(M.OrdinaryHasOwnMetadata(I,A,L))}function P(I,A,L){var M=x(I,A,L);if(M)return pt(I,A,L);var Q=$H(A);if(!Ri(Q))return P(I,Q,L)}function pt(I,A,L){var M=uu(A,L,!1);if(!ee(M))return M.OrdinaryGetOwnMetadata(I,A,L)}function le(I,A,L,M){var Q=uu(L,M,!0);Q.OrdinaryDefineOwnMetadata(I,A,L,M)}function tr(I,A){var L=rr(I,A),M=$H(I);if(M===null)return L;var Q=tr(M,A);if(Q.length<=0)return L;if(L.length<=0)return Q;for(var Ge=new f,at=[],se=0,N=L;se<N.length;se++){var z=N[se],K=Ge.has(z);K||(Ge.add(z),at.push(z))}for(var Y=0,ce=Q;Y<ce.length;Y++){var z=ce[Y],K=Ge.has(z);K||(Ge.add(z),at.push(z))}return at}function rr(I,A){var L=uu(I,A,!1);return L?L.OrdinaryOwnMetadataKeys(I,A):[]}function St(I){if(I===null)return 1;switch(typeof I){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return I===null?1:6;default:return 6}}function ee(I){return I===void 0}function Ri(I){return I===null}function Gs(I){return typeof I=="symbol"}function be(I){return typeof I=="object"?I!==null:typeof I=="function"}function oe(I,A){switch(St(I)){case 0:return I;case 1:return I;case 2:return I;case 3:return I;case 4:return I;case 5:return I}var L=A===3?"string":A===5?"number":"default",M=Xs(I,o);if(M!==void 0){var Q=M.call(I,L);if(be(Q))throw new TypeError;return Q}return Ks(I,L==="default"?"number":L)}function Ks(I,A){if(A==="string"){var L=I.toString;if(te(L)){var M=L.call(I);if(!be(M))return M}var Q=I.valueOf;if(te(Q)){var M=Q.call(I);if(!be(M))return M}}else{var Q=I.valueOf;if(te(Q)){var M=Q.call(I);if(!be(M))return M}var Ge=I.toString;if(te(Ge)){var M=Ge.call(I);if(!be(M))return M}}throw new TypeError}function hp(I){return!!I}function F(I){return""+I}function ae(I){var A=oe(I,3);return Gs(A)?A:F(A)}function k(I){return Array.isArray?Array.isArray(I):I instanceof Object?I instanceof Array:Object.prototype.toString.call(I)==="[object Array]"}function te(I){return typeof I=="function"}function Le(I){return typeof I=="function"}function vt(I){switch(St(I)){case 3:return!0;case 4:return!0;default:return!1}}function Ue(I,A){return I===A||I!==I&&A!==A}function Xs(I,A){var L=I[A];if(L!=null){if(!te(L))throw new TypeError;return L}}function Mo(I){var A=Xs(I,s);if(!te(A))throw new TypeError;var L=A.call(I);if(!be(L))throw new TypeError;return L}function $_(I){return I.value}function C_(I){var A=I.next();return A.done?!1:A}function D_(I){var A=I.return;A&&A.call(I)}function $H(I){var A=Object.getPrototypeOf(I);if(typeof I!="function"||I===p||A!==p)return A;var L=I.prototype,M=L&&Object.getPrototypeOf(L);if(M==null||M===Object.prototype)return A;var Q=M.constructor;return typeof Q!="function"||Q===I?A:Q}function CO(){var I;!ee(m)&&typeof t.Reflect<"u"&&!(m in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(I=MO(t.Reflect));var A,L,M,Q=new h,Ge={registerProvider:at,getProvider:N,setProvider:K};return Ge;function at(Y){if(!Object.isExtensible(Ge))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case I===Y:break;case ee(A):A=Y;break;case A===Y:break;case ee(L):L=Y;break;case L===Y:break;default:M===void 0&&(M=new f),M.add(Y);break}}function se(Y,ce){if(!ee(A)){if(A.isProviderFor(Y,ce))return A;if(!ee(L)){if(L.isProviderFor(Y,ce))return A;if(!ee(M))for(var De=Mo(M);;){var Ke=C_(De);if(!Ke)return;var Xr=$_(Ke);if(Xr.isProviderFor(Y,ce))return D_(De),Xr}}}if(!ee(I)&&I.isProviderFor(Y,ce))return I}function N(Y,ce){var De=Q.get(Y),Ke;return ee(De)||(Ke=De.get(ce)),ee(Ke)&&(Ke=se(Y,ce),ee(Ke)||(ee(De)&&(De=new d,Q.set(Y,De)),De.set(ce,Ke))),Ke}function z(Y){if(ee(Y))throw new TypeError;return A===Y||L===Y||!ee(M)&&M.has(Y)}function K(Y,ce,De){if(!z(De))throw new Error("Metadata provider not registered.");var Ke=N(Y,ce);if(Ke!==De){if(!ee(Ke))return!1;var Xr=Q.get(Y);ee(Xr)&&(Xr=new d,Q.set(Y,Xr)),Xr.set(ce,De)}return!0}}function DO(){var I;return!ee(m)&&be(t.Reflect)&&Object.isExtensible(t.Reflect)&&(I=t.Reflect[m]),ee(I)&&(I=CO()),!ee(m)&&be(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,m,{enumerable:!1,configurable:!1,writable:!1,value:I}),I}function TO(I){var A=new h,L={isProviderFor:function(z,K){var Y=A.get(z);return ee(Y)?!1:Y.has(K)},OrdinaryDefineOwnMetadata:at,OrdinaryHasOwnMetadata:Q,OrdinaryGetOwnMetadata:Ge,OrdinaryOwnMetadataKeys:se,OrdinaryDeleteMetadata:N};return y.registerProvider(L),L;function M(z,K,Y){var ce=A.get(z),De=!1;if(ee(ce)){if(!Y)return;ce=new d,A.set(z,ce),De=!0}var Ke=ce.get(K);if(ee(Ke)){if(!Y)return;if(Ke=new d,ce.set(K,Ke),!I.setProvider(z,K,L))throw ce.delete(K),De&&A.delete(z),new Error("Wrong provider for target.")}return Ke}function Q(z,K,Y){var ce=M(K,Y,!1);return ee(ce)?!1:hp(ce.has(z))}function Ge(z,K,Y){var ce=M(K,Y,!1);if(!ee(ce))return ce.get(z)}function at(z,K,Y,ce){var De=M(Y,ce,!0);De.set(z,K)}function se(z,K){var Y=[],ce=M(z,K,!1);if(ee(ce))return Y;for(var De=ce.keys(),Ke=Mo(De),Xr=0;;){var T_=C_(Ke);if(!T_)return Y.length=Xr,Y;var NO=$_(T_);try{Y[Xr]=NO}catch(BO){try{D_(Ke)}finally{throw BO}}Xr++}}function N(z,K,Y){var ce=M(K,Y,!1);if(ee(ce)||!ce.delete(z))return!1;if(ce.size===0){var De=A.get(K);ee(De)||(De.delete(Y),De.size===0&&A.delete(De))}return!0}}function MO(I){var A=I.defineMetadata,L=I.hasOwnMetadata,M=I.getOwnMetadata,Q=I.getOwnMetadataKeys,Ge=I.deleteMetadata,at=new h,se={isProviderFor:function(N,z){var K=at.get(N);return ee(K)?Q(N,z).length?(ee(K)&&(K=new f,at.set(N,K)),K.add(z),!0):!1:K.has(z)},OrdinaryDefineOwnMetadata:A,OrdinaryHasOwnMetadata:L,OrdinaryGetOwnMetadata:M,OrdinaryOwnMetadataKeys:Q,OrdinaryDeleteMetadata:Ge};return se}function uu(I,A,L){var M=y.getProvider(I,A);if(!ee(M))return M;if(L){if(y.setProvider(I,A,w))return w;throw new Error("Illegal state.")}}function RO(){var I={},A=[],L=function(){function se(N,z,K){this._index=0,this._keys=N,this._values=z,this._selector=K}return se.prototype["@@iterator"]=function(){return this},se.prototype[s]=function(){return this},se.prototype.next=function(){var N=this._index;if(N>=0&&N<this._keys.length){var z=this._selector(this._keys[N],this._values[N]);return N+1>=this._keys.length?(this._index=-1,this._keys=A,this._values=A):this._index++,{value:z,done:!1}}return{value:void 0,done:!0}},se.prototype.throw=function(N){throw this._index>=0&&(this._index=-1,this._keys=A,this._values=A),N},se.prototype.return=function(N){return this._index>=0&&(this._index=-1,this._keys=A,this._values=A),{value:N,done:!0}},se}(),M=function(){function se(){this._keys=[],this._values=[],this._cacheKey=I,this._cacheIndex=-2}return Object.defineProperty(se.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),se.prototype.has=function(N){return this._find(N,!1)>=0},se.prototype.get=function(N){var z=this._find(N,!1);return z>=0?this._values[z]:void 0},se.prototype.set=function(N,z){var K=this._find(N,!0);return this._values[K]=z,this},se.prototype.delete=function(N){var z=this._find(N,!1);if(z>=0){for(var K=this._keys.length,Y=z+1;Y<K;Y++)this._keys[Y-1]=this._keys[Y],this._values[Y-1]=this._values[Y];return this._keys.length--,this._values.length--,Ue(N,this._cacheKey)&&(this._cacheKey=I,this._cacheIndex=-2),!0}return!1},se.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=I,this._cacheIndex=-2},se.prototype.keys=function(){return new L(this._keys,this._values,Q)},se.prototype.values=function(){return new L(this._keys,this._values,Ge)},se.prototype.entries=function(){return new L(this._keys,this._values,at)},se.prototype["@@iterator"]=function(){return this.entries()},se.prototype[s]=function(){return this.entries()},se.prototype._find=function(N,z){if(!Ue(this._cacheKey,N)){this._cacheIndex=-1;for(var K=0;K<this._keys.length;K++)if(Ue(this._keys[K],N)){this._cacheIndex=K;break}}return this._cacheIndex<0&&z&&(this._cacheIndex=this._keys.length,this._keys.push(N),this._values.push(void 0)),this._cacheIndex},se}();return M;function Q(se,N){return se}function Ge(se,N){return N}function at(se,N){return[se,N]}}function kO(){var I=function(){function A(){this._map=new d}return Object.defineProperty(A.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),A.prototype.has=function(L){return this._map.has(L)},A.prototype.add=function(L){return this._map.set(L,L),this},A.prototype.delete=function(L){return this._map.delete(L)},A.prototype.clear=function(){this._map.clear()},A.prototype.keys=function(){return this._map.keys()},A.prototype.values=function(){return this._map.keys()},A.prototype.entries=function(){return this._map.entries()},A.prototype["@@iterator"]=function(){return this.keys()},A.prototype[s]=function(){return this.keys()},A}();return I}function OO(){var I=16,A=l.create(),L=M();return function(){function N(){this._key=M()}return N.prototype.has=function(z){var K=Q(z,!1);return K!==void 0?l.has(K,this._key):!1},N.prototype.get=function(z){var K=Q(z,!1);return K!==void 0?l.get(K,this._key):void 0},N.prototype.set=function(z,K){var Y=Q(z,!0);return Y[this._key]=K,this},N.prototype.delete=function(z){var K=Q(z,!1);return K!==void 0?delete K[this._key]:!1},N.prototype.clear=function(){this._key=M()},N}();function M(){var N;do N="@@WeakMap@@"+se();while(l.has(A,N));return A[N]=!0,N}function Q(N,z){if(!n.call(N,L)){if(!z)return;Object.defineProperty(N,L,{value:l.create()})}return N[L]}function Ge(N,z){for(var K=0;K<z;++K)N[K]=Math.random()*255|0;return N}function at(N){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(N)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(N)):Ge(new Uint8Array(N),N):Ge(new Array(N),N)}function se(){var N=at(I);N[6]=N[6]&79|64,N[8]=N[8]&191|128;for(var z="",K=0;K<I;++K){var Y=N[K];(K===4||K===6||K===8)&&(z+="-"),Y<16&&(z+="0"),z+=Y.toString(16).toLowerCase()}return z}}function CH(I){return I.__=void 0,delete I.__,I}})})(B_||(B_={}))});var tt=v(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.NON_CUSTOM_TAG_KEYS=pe.PRE_DESTROY=pe.POST_CONSTRUCT=pe.DESIGN_PARAM_TYPES=pe.PARAM_TYPES=pe.TAGGED_PROP=pe.TAGGED=pe.MULTI_INJECT_TAG=pe.INJECT_TAG=pe.OPTIONAL_TAG=pe.UNMANAGED_TAG=pe.NAME_TAG=pe.NAMED_TAG=void 0;pe.NAMED_TAG="named";pe.NAME_TAG="name";pe.UNMANAGED_TAG="unmanaged";pe.OPTIONAL_TAG="optional";pe.INJECT_TAG="inject";pe.MULTI_INJECT_TAG="multi_inject";pe.TAGGED="inversify:tagged";pe.TAGGED_PROP="inversify:tagged_props";pe.PARAM_TYPES="inversify:paramtypes";pe.DESIGN_PARAM_TYPES="design:paramtypes";pe.POST_CONSTRUCT="post_construct";pe.PRE_DESTROY="pre_destroy";function cN(){return[pe.INJECT_TAG,pe.MULTI_INJECT_TAG,pe.NAME_TAG,pe.UNMANAGED_TAG,pe.NAMED_TAG,pe.OPTIONAL_TAG]}pe.NON_CUSTOM_TAG_KEYS=cN()});var Ir=v(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.TargetTypeEnum=ki.BindingTypeEnum=ki.BindingScopeEnum=void 0;var uN={Request:"Request",Singleton:"Singleton",Transient:"Transient"};ki.BindingScopeEnum=uN;var lN={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};ki.BindingTypeEnum=lN;var pN={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"};ki.TargetTypeEnum=pN});var Oi=v(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});_p.id=void 0;var dN=0;function fN(){return dN++}_p.id=fN});var rA=v(Ap=>{"use strict";Object.defineProperty(Ap,"__esModule",{value:!0});Ap.Binding=void 0;var tA=Ir(),hN=Oi(),mN=function(){function r(e,t){this.id=(0,hN.id)(),this.activated=!1,this.serviceIdentifier=e,this.scope=t,this.type=tA.BindingTypeEnum.Invalid,this.constraint=function(n){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}return r.prototype.clone=function(){var e=new r(this.serviceIdentifier,this.scope);return e.activated=e.scope===tA.BindingScopeEnum.Singleton?this.activated:!1,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.onDeactivation=this.onDeactivation,e.cache=this.cache,e},r}();Ap.Binding=mN});var Et=v(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.STACK_OVERFLOW=V.CIRCULAR_DEPENDENCY_IN_FACTORY=V.ON_DEACTIVATION_ERROR=V.PRE_DESTROY_ERROR=V.POST_CONSTRUCT_ERROR=V.ASYNC_UNBIND_REQUIRED=V.MULTIPLE_POST_CONSTRUCT_METHODS=V.MULTIPLE_PRE_DESTROY_METHODS=V.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=V.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=V.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=V.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=V.ARGUMENTS_LENGTH_MISMATCH=V.INVALID_DECORATOR_OPERATION=V.INVALID_TO_SELF_VALUE=V.LAZY_IN_SYNC=V.INVALID_FUNCTION_BINDING=V.INVALID_MIDDLEWARE_RETURN=V.NO_MORE_SNAPSHOTS_AVAILABLE=V.INVALID_BINDING_TYPE=V.NOT_IMPLEMENTED=V.CIRCULAR_DEPENDENCY=V.UNDEFINED_INJECT_ANNOTATION=V.MISSING_INJECT_ANNOTATION=V.MISSING_INJECTABLE_ANNOTATION=V.NOT_REGISTERED=V.CANNOT_UNBIND=V.AMBIGUOUS_MATCH=V.KEY_NOT_FOUND=V.NULL_ARGUMENT=V.DUPLICATED_METADATA=V.DUPLICATED_INJECTABLE_DECORATOR=void 0;V.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.";V.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:";V.NULL_ARGUMENT="NULL argument";V.KEY_NOT_FOUND="Key Not Found";V.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:";V.CANNOT_UNBIND="Could not unbind serviceIdentifier:";V.NOT_REGISTERED="No matching bindings found for serviceIdentifier:";V.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:";V.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:";var HN=function(r){return"@inject called with undefined this could mean that the class "+r+" has a circular dependency problem. You can use a LazyServiceIdentifier to overcome this limitation."};V.UNDEFINED_INJECT_ANNOTATION=HN;V.CIRCULAR_DEPENDENCY="Circular dependency found:";V.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.";V.INVALID_BINDING_TYPE="Invalid binding type:";V.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.";V.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!";V.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!";var gN=function(r){return"You are attempting to construct '"+r+`' in a synchronous way
but it has asynchronous dependencies.`};V.LAZY_IN_SYNC=gN;V.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier";V.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.";var yN=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return"The number of constructor arguments in the derived class "+(r[0]+" must be >= than the number of constructor arguments of its base class.")};V.ARGUMENTS_LENGTH_MISMATCH=yN;V.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.";V.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE='Invalid Container option. Default scope must be a string ("singleton" or "transient").';V.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean";V.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean";V.MULTIPLE_PRE_DESTROY_METHODS="Cannot apply @preDestroy decorator multiple times in the same class";V.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";V.ASYNC_UNBIND_REQUIRED="Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)";var bN=function(r,e){return"@postConstruct error in class "+r+": "+e};V.POST_CONSTRUCT_ERROR=bN;var vN=function(r,e){return"@preDestroy error in class "+r+": "+e};V.PRE_DESTROY_ERROR=vN;var IN=function(r,e){return"onDeactivation() error in class "+r+": "+e};V.ON_DEACTIVATION_ERROR=IN;var _N=function(r,e){return"It looks like there is a circular dependency in one of the '"+r+"' bindings. Please investigate bindings with "+("service identifier '"+e+"'.")};V.CIRCULAR_DEPENDENCY_IN_FACTORY=_N;V.STACK_OVERFLOW="Maximum call stack size exceeded"});var kH=v(hn=>{"use strict";var AN=hn&&hn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),wN=hn&&hn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),SN=hn&&hn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&AN(e,r,t);return wN(e,r),e};Object.defineProperty(hn,"__esModule",{value:!0});hn.MetadataReader=void 0;var RH=SN(tt()),EN=function(){function r(){}return r.prototype.getConstructorMetadata=function(e){var t=Reflect.getMetadata(RH.PARAM_TYPES,e),n=Reflect.getMetadata(RH.TAGGED,e);return{compilerGeneratedMetadata:t,userGeneratedMetadata:n||{}}},r.prototype.getPropertiesMetadata=function(e){var t=Reflect.getMetadata(RH.TAGGED_PROP,e)||[];return t},r}();hn.MetadataReader=EN});var nA=v(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.BindingCount=void 0;wp.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}});var OH=v(_r=>{"use strict";var xN=_r&&_r.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),PN=_r&&_r.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),LN=_r&&_r.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&xN(e,r,t);return PN(e,r),e};Object.defineProperty(_r,"__esModule",{value:!0});_r.tryAndThrowErrorIfStackOverflow=_r.isStackOverflowExeption=void 0;var $N=LN(Et());function iA(r){return r instanceof RangeError||r.message===$N.STACK_OVERFLOW}_r.isStackOverflowExeption=iA;var CN=function(r,e){try{return r()}catch(t){throw iA(t)&&(t=e()),t}};_r.tryAndThrowErrorIfStackOverflow=CN});var No=v(rt=>{"use strict";var DN=rt&&rt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),TN=rt&&rt.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),MN=rt&&rt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&DN(e,r,t);return TN(e,r),e};Object.defineProperty(rt,"__esModule",{value:!0});rt.getSymbolDescription=rt.circularDependencyToException=rt.listMetadataForTarget=rt.listRegisteredBindingsForServiceIdentifier=rt.getServiceIdentifierAsString=rt.getFunctionName=void 0;var RN=MN(Et());function oA(r){if(typeof r=="function"){var e=r;return e.name}else{if(typeof r=="symbol")return r.toString();var e=r;return e}}rt.getServiceIdentifierAsString=oA;function kN(r,e,t){var n="",i=t(r,e);return i.length!==0&&(n=`
Registered bindings:`,i.forEach(function(o){var s="Object";o.implementationType!==null&&(s=cA(o.implementationType)),n=n+`
`+s,o.constraint.metaData&&(n=n+" - "+o.constraint.metaData)})),n}rt.listRegisteredBindingsForServiceIdentifier=kN;function sA(r,e){return r.parentRequest===null?!1:r.parentRequest.serviceIdentifier===e?!0:sA(r.parentRequest,e)}function ON(r){function e(n,i){i===void 0&&(i=[]);var o=oA(n.serviceIdentifier);return i.push(o),n.parentRequest!==null?e(n.parentRequest,i):i}var t=e(r);return t.reverse().join(" --> ")}function aA(r){r.childRequests.forEach(function(e){if(sA(e,e.serviceIdentifier)){var t=ON(e);throw new Error(RN.CIRCULAR_DEPENDENCY+" "+t)}else aA(e)})}rt.circularDependencyToException=aA;function NN(r,e){if(e.isTagged()||e.isNamed()){var t="",n=e.getNamedTag(),i=e.getCustomTags();return n!==null&&(t+=n.toString()+`
`),i!==null&&i.forEach(function(o){t+=o.toString()+`
`})," "+r+`
`+r+" - "+t}else return" "+r}rt.listMetadataForTarget=NN;function cA(r){if(r.name)return r.name;var e=r.toString(),t=e.match(/^function\s*([^\s(]+)/);return t?t[1]:"Anonymous function: "+e}rt.getFunctionName=cA;function BN(r){return r.toString().slice(7,-1)}rt.getSymbolDescription=BN});var uA=v(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.Context=void 0;var FN=Oi(),UN=function(){function r(e){this.id=(0,FN.id)(),this.container=e}return r.prototype.addPlan=function(e){this.plan=e},r.prototype.setCurrentRequest=function(e){this.currentRequest=e},r}();Sp.Context=UN});var Jr=v(mn=>{"use strict";var WN=mn&&mn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),jN=mn&&mn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),VN=mn&&mn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&WN(e,r,t);return jN(e,r),e};Object.defineProperty(mn,"__esModule",{value:!0});mn.Metadata=void 0;var qN=VN(tt()),GN=function(){function r(e,t){this.key=e,this.value=t}return r.prototype.toString=function(){return this.key===qN.NAMED_TAG?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},r}();mn.Metadata=GN});var lA=v(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});Ep.Plan=void 0;var KN=function(){function r(e,t){this.parentContext=e,this.rootRequest=t}return r}();Ep.Plan=KN});var Pp=v(xp=>{"use strict";Object.defineProperty(xp,"__esModule",{value:!0});xp.LazyServiceIdentifier=void 0;var XN=function(){function r(e){this._cb=e}return r.prototype.unwrap=function(){return this._cb()},r}();xp.LazyServiceIdentifier=XN});var pA=v(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});Lp.QueryableString=void 0;var zN=function(){function r(e){this.str=e}return r.prototype.startsWith=function(e){return this.str.indexOf(e)===0},r.prototype.endsWith=function(e){var t="",n=e.split("").reverse().join("");return t=this.str.split("").reverse().join(""),this.startsWith.call({str:t},n)},r.prototype.contains=function(e){return this.str.indexOf(e)!==-1},r.prototype.equals=function(e){return this.str===e},r.prototype.value=function(){return this.str},r}();Lp.QueryableString=zN});var NH=v(Hn=>{"use strict";var JN=Hn&&Hn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),YN=Hn&&Hn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),QN=Hn&&Hn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&JN(e,r,t);return YN(e,r),e};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.Target=void 0;var ui=QN(tt()),ZN=Oi(),eB=No(),dA=Jr(),tB=pA(),rB=function(){function r(e,t,n,i){this.id=(0,ZN.id)(),this.type=e,this.serviceIdentifier=n;var o=typeof t=="symbol"?(0,eB.getSymbolDescription)(t):t;this.name=new tB.QueryableString(o||""),this.identifier=t,this.metadata=new Array;var s=null;typeof i=="string"?s=new dA.Metadata(ui.NAMED_TAG,i):i instanceof dA.Metadata&&(s=i),s!==null&&this.metadata.push(s)}return r.prototype.hasTag=function(e){for(var t=0,n=this.metadata;t<n.length;t++){var i=n[t];if(i.key===e)return!0}return!1},r.prototype.isArray=function(){return this.hasTag(ui.MULTI_INJECT_TAG)},r.prototype.matchesArray=function(e){return this.matchesTag(ui.MULTI_INJECT_TAG)(e)},r.prototype.isNamed=function(){return this.hasTag(ui.NAMED_TAG)},r.prototype.isTagged=function(){return this.metadata.some(function(e){return ui.NON_CUSTOM_TAG_KEYS.every(function(t){return e.key!==t})})},r.prototype.isOptional=function(){return this.matchesTag(ui.OPTIONAL_TAG)(!0)},r.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(e){return e.key===ui.NAMED_TAG})[0]:null},r.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(e){return ui.NON_CUSTOM_TAG_KEYS.every(function(t){return e.key!==t})}):null},r.prototype.matchesNamedTag=function(e){return this.matchesTag(ui.NAMED_TAG)(e)},r.prototype.matchesTag=function(e){var t=this;return function(n){for(var i=0,o=t.metadata;i<o.length;i++){var s=o[i];if(s.key===e&&s.value===n)return!0}return!1}},r}();Hn.Target=rB});var vA=v(xt=>{"use strict";var nB=xt&&xt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),iB=xt&&xt.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),fA=xt&&xt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&nB(e,r,t);return iB(e,r),e},$p=xt&&xt.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return r.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(xt,"__esModule",{value:!0});xt.getFunctionName=xt.getBaseClassDependencyCount=xt.getDependencies=void 0;var oB=Pp(),BH=fA(Et()),hA=Ir(),du=fA(tt()),FH=No();Object.defineProperty(xt,"getFunctionName",{enumerable:!0,get:function(){return FH.getFunctionName}});var mA=NH();function sB(r,e){var t=(0,FH.getFunctionName)(e);return HA(r,t,e,!1)}xt.getDependencies=sB;function HA(r,e,t,n){var i=r.getConstructorMetadata(t),o=i.compilerGeneratedMetadata;if(o===void 0){var s=BH.MISSING_INJECTABLE_ANNOTATION+" "+e+".";throw new Error(s)}var a=i.userGeneratedMetadata,c=Object.keys(a),u=t.length===0&&c.length>0,l=c.length>t.length,p=u||l?c.length:t.length,d=cB(n,e,o,a,p),f=gA(r,t,e),h=$p($p([],d,!0),f,!0);return h}function aB(r,e,t,n,i){var o=i[r.toString()]||[],s=bA(o),a=s.unmanaged!==!0,c=n[r],u=s.inject||s.multiInject;if(c=u||c,c instanceof oB.LazyServiceIdentifier&&(c=c.unwrap()),a){var l=c===Object,p=c===Function,d=c===void 0,f=l||p||d;if(!e&&f){var h=BH.MISSING_INJECT_ANNOTATION+" argument "+r+" in class "+t+".";throw new Error(h)}var m=new mA.Target(hA.TargetTypeEnum.ConstructorArgument,s.targetName,c);return m.metadata=o,m}return null}function cB(r,e,t,n,i){for(var o=[],s=0;s<i;s++){var a=s,c=aB(a,r,e,t,n);c!==null&&o.push(c)}return o}function uB(r,e,t,n){var i=r||e;if(i===void 0){var o=BH.MISSING_INJECTABLE_ANNOTATION+" for property "+String(t)+" in class "+n+".";throw new Error(o)}return i}function gA(r,e,t){for(var n=r.getPropertiesMetadata(e),i=[],o=Object.getOwnPropertySymbols(n),s=Object.keys(n),a=s.concat(o),c=0,u=a;c<u.length;c++){var l=u[c],p=n[l],d=bA(p),f=d.targetName||l,h=uB(d.inject,d.multiInject,l,t),m=new mA.Target(hA.TargetTypeEnum.ClassProperty,f,h);m.metadata=p,i.push(m)}var y=Object.getPrototypeOf(e.prototype).constructor;if(y!==Object){var w=gA(r,y,t);i=$p($p([],i,!0),w,!0)}return i}function yA(r,e){var t=Object.getPrototypeOf(e.prototype).constructor;if(t!==Object){var n=(0,FH.getFunctionName)(t),i=HA(r,n,t,!0),o=i.map(function(c){return c.metadata.filter(function(u){return u.key===du.UNMANAGED_TAG})}),s=[].concat.apply([],o).length,a=i.length-s;return a>0?a:yA(r,t)}else return 0}xt.getBaseClassDependencyCount=yA;function bA(r){var e={};return r.forEach(function(t){e[t.key.toString()]=t.value}),{inject:e[du.INJECT_TAG],multiInject:e[du.MULTI_INJECT_TAG],targetName:e[du.NAME_TAG],unmanaged:e[du.UNMANAGED_TAG]}}});var IA=v(Cp=>{"use strict";Object.defineProperty(Cp,"__esModule",{value:!0});Cp.Request=void 0;var lB=Oi(),pB=function(){function r(e,t,n,i,o){this.id=(0,lB.id)(),this.serviceIdentifier=e,this.parentContext=t,this.parentRequest=n,this.target=o,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=n===null?new Map:null}return r.prototype.addChildRequest=function(e,t,n){var i=new r(e,this.parentContext,this,t,n);return this.childRequests.push(i),i},r}();Cp.Request=pB});var qH=v(Kt=>{"use strict";var dB=Kt&&Kt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),fB=Kt&&Kt.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),wA=Kt&&Kt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&dB(e,r,t);return fB(e,r),e};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.getBindingDictionary=Kt.createMockRequest=Kt.plan=void 0;var Dp=nA(),WH=wA(Et()),SA=Ir(),_A=wA(tt()),hB=OH(),Zs=No(),EA=uA(),jH=Jr(),mB=lA(),UH=vA(),VH=IA(),xA=NH();function PA(r){return r._bindingDictionary}Kt.getBindingDictionary=PA;function HB(r,e,t,n,i,o){var s=r?_A.MULTI_INJECT_TAG:_A.INJECT_TAG,a=new jH.Metadata(s,t),c=new xA.Target(e,n,t,a);if(i!==void 0){var u=new jH.Metadata(i,o);c.metadata.push(u)}return c}function AA(r,e,t,n,i){var o=fu(t.container,i.serviceIdentifier),s=[];return o.length===Dp.BindingCount.NoBindingsAvailable&&t.container.options.autoBindInjectable&&typeof i.serviceIdentifier=="function"&&r.getConstructorMetadata(i.serviceIdentifier).compilerGeneratedMetadata&&(t.container.bind(i.serviceIdentifier).toSelf(),o=fu(t.container,i.serviceIdentifier)),e?s=o:s=o.filter(function(a){var c=new VH.Request(a.serviceIdentifier,t,n,a,i);return a.constraint(c)}),gB(i.serviceIdentifier,s,i,t.container),s}function gB(r,e,t,n){switch(e.length){case Dp.BindingCount.NoBindingsAvailable:if(t.isOptional())return e;var i=(0,Zs.getServiceIdentifierAsString)(r),o=WH.NOT_REGISTERED;throw o+=(0,Zs.listMetadataForTarget)(i,t),o+=(0,Zs.listRegisteredBindingsForServiceIdentifier)(n,i,fu),new Error(o);case Dp.BindingCount.OnlyOneBindingAvailable:return e;case Dp.BindingCount.MultipleBindingsAvailable:default:if(t.isArray())return e;var i=(0,Zs.getServiceIdentifierAsString)(r),o=WH.AMBIGUOUS_MATCH+" "+i;throw o+=(0,Zs.listRegisteredBindingsForServiceIdentifier)(n,i,fu),new Error(o)}}function LA(r,e,t,n,i,o){var s,a;if(i===null){s=AA(r,e,n,null,o),a=new VH.Request(t,n,null,s,o);var c=new mB.Plan(n,a);n.addPlan(c)}else s=AA(r,e,n,i,o),a=i.addChildRequest(o.serviceIdentifier,s,o);s.forEach(function(u){var l=null;if(o.isArray())l=a.addChildRequest(u.serviceIdentifier,u,o);else{if(u.cache)return;l=a}if(u.type===SA.BindingTypeEnum.Instance&&u.implementationType!==null){var p=(0,UH.getDependencies)(r,u.implementationType);if(!n.container.options.skipBaseClassChecks){var d=(0,UH.getBaseClassDependencyCount)(r,u.implementationType);if(p.length<d){var f=WH.ARGUMENTS_LENGTH_MISMATCH((0,UH.getFunctionName)(u.implementationType));throw new Error(f)}}p.forEach(function(h){LA(r,!1,h.serviceIdentifier,n,l,h)})}})}function fu(r,e){var t=[],n=PA(r);return n.hasKey(e)?t=n.get(e):r.parent!==null&&(t=fu(r.parent,e)),t}function yB(r,e,t,n,i,o,s,a){a===void 0&&(a=!1);var c=new EA.Context(e),u=HB(t,n,i,"",o,s);try{return LA(r,a,i,c,null,u),c}catch(l){throw(0,hB.isStackOverflowExeption)(l)&&(0,Zs.circularDependencyToException)(c.plan.rootRequest),l}}Kt.plan=yB;function bB(r,e,t,n){var i=new xA.Target(SA.TargetTypeEnum.Variable,"",e,new jH.Metadata(t,n)),o=new EA.Context(r),s=new VH.Request(e,o,null,[],i);return s}Kt.createMockRequest=bB});var hu=v(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.isPromiseOrContainsPromise=ea.isPromise=void 0;function GH(r){var e=typeof r=="object"&&r!==null||typeof r=="function";return e&&typeof r.then=="function"}ea.isPromise=GH;function vB(r){return GH(r)?!0:Array.isArray(r)&&r.some(GH)}ea.isPromiseOrContainsPromise=vB});var $A=v(gn=>{"use strict";var IB=gn&&gn.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})},_B=gn&&gn.__generator||function(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(l){u=[6,l],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(gn,"__esModule",{value:!0});gn.saveToScope=gn.tryGetFromScope=void 0;var Tp=Ir(),AB=hu(),wB=function(r,e){return e.scope===Tp.BindingScopeEnum.Singleton&&e.activated?e.cache:e.scope===Tp.BindingScopeEnum.Request&&r.has(e.id)?r.get(e.id):null};gn.tryGetFromScope=wB;var SB=function(r,e,t){e.scope===Tp.BindingScopeEnum.Singleton&&xB(e,t),e.scope===Tp.BindingScopeEnum.Request&&EB(r,e,t)};gn.saveToScope=SB;var EB=function(r,e,t){r.has(e.id)||r.set(e.id,t)},xB=function(r,e){r.cache=e,r.activated=!0,(0,AB.isPromise)(e)&&PB(r,e)},PB=function(r,e){return IB(void 0,void 0,void 0,function(){var t,n;return _B(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e];case 1:return t=i.sent(),r.cache=t,[3,3];case 2:throw n=i.sent(),r.cache=null,r.activated=!1,n;case 3:return[2]}})})}});var CA=v(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.FactoryType=void 0;var LB;(function(r){r.DynamicValue="toDynamicValue",r.Factory="toFactory",r.Provider="toProvider"})(LB=mu.FactoryType||(mu.FactoryType={}))});var XH=v(Xt=>{"use strict";var $B=Xt&&Xt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),CB=Xt&&Xt.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),DB=Xt&&Xt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&$B(e,r,t);return CB(e,r),e};Object.defineProperty(Xt,"__esModule",{value:!0});Xt.getFactoryDetails=Xt.ensureFullyBound=Xt.multiBindToService=void 0;var TB=No(),MB=DB(Et()),yn=Ir(),KH=CA(),RB=function(r){return function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.forEach(function(i){return r.bind(i).toService(e)})}}};Xt.multiBindToService=RB;var kB=function(r){var e=null;switch(r.type){case yn.BindingTypeEnum.ConstantValue:case yn.BindingTypeEnum.Function:e=r.cache;break;case yn.BindingTypeEnum.Constructor:case yn.BindingTypeEnum.Instance:e=r.implementationType;break;case yn.BindingTypeEnum.DynamicValue:e=r.dynamicValue;break;case yn.BindingTypeEnum.Provider:e=r.provider;break;case yn.BindingTypeEnum.Factory:e=r.factory;break}if(e===null){var t=(0,TB.getServiceIdentifierAsString)(r.serviceIdentifier);throw new Error(MB.INVALID_BINDING_TYPE+" "+t)}};Xt.ensureFullyBound=kB;var OB=function(r){switch(r.type){case yn.BindingTypeEnum.Factory:return{factory:r.factory,factoryType:KH.FactoryType.Factory};case yn.BindingTypeEnum.Provider:return{factory:r.provider,factoryType:KH.FactoryType.Provider};case yn.BindingTypeEnum.DynamicValue:return{factory:r.dynamicValue,factoryType:KH.FactoryType.DynamicValue};default:throw new Error("Unexpected factory type "+r.type)}};Xt.getFactoryDetails=OB});var OA=v(dt=>{"use strict";var ta=dt&&dt.__assign||function(){return ta=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},ta.apply(this,arguments)},NB=dt&&dt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),BB=dt&&dt.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),FB=dt&&dt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&NB(e,r,t);return BB(e,r),e},MA=dt&&dt.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})},RA=dt&&dt.__generator||function(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(l){u=[6,l],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},UB=dt&&dt.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return r.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(dt,"__esModule",{value:!0});dt.resolveInstance=void 0;var zH=Et(),YH=Ir(),JH=FB(tt()),QH=hu();function WB(r,e){return r.reduce(function(t,n){var i=e(n),o=n.target.type;return o===YH.TargetTypeEnum.ConstructorArgument?t.constructorInjections.push(i):(t.propertyRequests.push(n),t.propertyInjections.push(i)),t.isAsync||(t.isAsync=(0,QH.isPromiseOrContainsPromise)(i)),t},{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}function jB(r,e,t){var n;if(e.length>0){var i=WB(e,t),o=ta(ta({},i),{constr:r});i.isAsync?n=VB(o):n=kA(o)}else n=new r;return n}function kA(r){var e,t=new((e=r.constr).bind.apply(e,UB([void 0],r.constructorInjections,!1)));return r.propertyRequests.forEach(function(n,i){var o=n.target.identifier,s=r.propertyInjections[i];(!n.target.isOptional()||s!==void 0)&&(t[o]=s)}),t}function VB(r){return MA(this,void 0,void 0,function(){var e,t;return RA(this,function(n){switch(n.label){case 0:return[4,DA(r.constructorInjections)];case 1:return e=n.sent(),[4,DA(r.propertyInjections)];case 2:return t=n.sent(),[2,kA(ta(ta({},r),{constructorInjections:e,propertyInjections:t}))]}})})}function DA(r){return MA(this,void 0,void 0,function(){var e,t,n,i;return RA(this,function(o){for(e=[],t=0,n=r;t<n.length;t++)i=n[t],Array.isArray(i)?e.push(Promise.all(i)):e.push(i);return[2,Promise.all(e)]})})}function TA(r,e){var t=qB(r,e);return(0,QH.isPromise)(t)?t.then(function(){return e}):e}function qB(r,e){var t,n;if(Reflect.hasMetadata(JH.POST_CONSTRUCT,r)){var i=Reflect.getMetadata(JH.POST_CONSTRUCT,r);try{return(n=(t=e)[i.value])===null||n===void 0?void 0:n.call(t)}catch(o){if(o instanceof Error)throw new Error((0,zH.POST_CONSTRUCT_ERROR)(r.name,o.message))}}}function GB(r,e){r.scope!==YH.BindingScopeEnum.Singleton&&KB(r,e)}function KB(r,e){var t="Class cannot be instantiated in "+(r.scope===YH.BindingScopeEnum.Request?"request":"transient")+" scope.";if(typeof r.onDeactivation=="function")throw new Error((0,zH.ON_DEACTIVATION_ERROR)(e.name,t));if(Reflect.hasMetadata(JH.PRE_DESTROY,e))throw new Error((0,zH.PRE_DESTROY_ERROR)(e.name,t))}function XB(r,e,t,n){GB(r,e);var i=jB(e,t,n);return(0,QH.isPromise)(i)?i.then(function(o){return TA(e,o)}):TA(e,i)}dt.resolveInstance=XB});var WA=v(zt=>{"use strict";var zB=zt&&zt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),JB=zt&&zt.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),YB=zt&&zt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&zB(e,r,t);return JB(e,r),e},QB=zt&&zt.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})},ZB=zt&&zt.__generator||function(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(l){u=[6,l],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(zt,"__esModule",{value:!0});zt.resolve=void 0;var eF=YB(Et()),Mp=Ir(),tF=qH(),NA=$A(),ZH=hu(),FA=XH(),rF=OH(),nF=OA(),eg=function(r){return function(e){e.parentContext.setCurrentRequest(e);var t=e.bindings,n=e.childRequests,i=e.target&&e.target.isArray(),o=!e.parentRequest||!e.parentRequest.target||!e.target||!e.parentRequest.target.matchesArray(e.target.serviceIdentifier);if(i&&o)return n.map(function(a){var c=eg(r);return c(a)});if(e.target.isOptional()&&t.length===0)return;var s=t[0];return aF(r,e,s)}},iF=function(r,e){var t=(0,FA.getFactoryDetails)(r);return(0,rF.tryAndThrowErrorIfStackOverflow)(function(){return t.factory.bind(r)(e)},function(){return new Error(eF.CIRCULAR_DEPENDENCY_IN_FACTORY(t.factoryType,e.currentRequest.serviceIdentifier.toString()))})},oF=function(r,e,t){var n,i=e.childRequests;switch((0,FA.ensureFullyBound)(t),t.type){case Mp.BindingTypeEnum.ConstantValue:case Mp.BindingTypeEnum.Function:n=t.cache;break;case Mp.BindingTypeEnum.Constructor:n=t.implementationType;break;case Mp.BindingTypeEnum.Instance:n=(0,nF.resolveInstance)(t,t.implementationType,i,eg(r));break;default:n=iF(t,e.parentContext)}return n},sF=function(r,e,t){var n=(0,NA.tryGetFromScope)(r,e);return n!==null||(n=t(),(0,NA.saveToScope)(r,e,n)),n},aF=function(r,e,t){return sF(r,t,function(){var n=oF(r,e,t);return(0,ZH.isPromise)(n)?n=n.then(function(i){return BA(e,t,i)}):n=BA(e,t,n),n})};function BA(r,e,t){var n=cF(r.parentContext,e,t),i=pF(r.parentContext.container),o,s=i.next();do{o=s.value;var a=r.parentContext,c=r.serviceIdentifier,u=lF(o,c);(0,ZH.isPromise)(n)?n=UA(u,a,n):n=uF(u,a,n),s=i.next()}while(s.done!==!0&&!(0,tF.getBindingDictionary)(o).hasKey(r.serviceIdentifier));return n}var cF=function(r,e,t){var n;return typeof e.onActivation=="function"?n=e.onActivation(r,t):n=t,n},uF=function(r,e,t){for(var n=r.next();!n.done;){if(t=n.value(e,t),(0,ZH.isPromise)(t))return UA(r,e,t);n=r.next()}return t},UA=function(r,e,t){return QB(void 0,void 0,void 0,function(){var n,i;return ZB(this,function(o){switch(o.label){case 0:return[4,t];case 1:n=o.sent(),i=r.next(),o.label=2;case 2:return i.done?[3,4]:[4,i.value(e,n)];case 3:return n=o.sent(),i=r.next(),[3,2];case 4:return[2,n]}})})},lF=function(r,e){var t=r._activations;return t.hasKey(e)?t.get(e).values():[].values()},pF=function(r){for(var e=[r],t=r.parent;t!==null;)e.push(t),t=t.parent;var n=function(){var o=e.pop();return o!==void 0?{done:!1,value:o}:{done:!0,value:void 0}},i={next:n};return i};function dF(r){var e=eg(r.plan.rootRequest.requestScope);return e(r.plan.rootRequest)}zt.resolve=dF});var tg=v(Pt=>{"use strict";var fF=Pt&&Pt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),hF=Pt&&Pt.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),mF=Pt&&Pt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&fF(e,r,t);return hF(e,r),e};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.typeConstraint=Pt.namedConstraint=Pt.taggedConstraint=Pt.traverseAncerstors=void 0;var HF=mF(tt()),gF=Jr(),jA=function(r,e){var t=r.parentRequest;return t!==null?e(t)?!0:jA(t,e):!1};Pt.traverseAncerstors=jA;var VA=function(r){return function(e){var t=function(n){return n!==null&&n.target!==null&&n.target.matchesTag(r)(e)};return t.metaData=new gF.Metadata(r,e),t}};Pt.taggedConstraint=VA;var yF=VA(HF.NAMED_TAG);Pt.namedConstraint=yF;var bF=function(r){return function(e){var t=null;if(e!==null)if(t=e.bindings[0],typeof r=="string"){var n=t.serviceIdentifier;return n===r}else{var i=e.bindings[0].implementationType;return r===i}return!1}};Pt.typeConstraint=bF});var kp=v(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});Rp.BindingWhenSyntax=void 0;var Nt=Op(),ct=tg(),vF=function(){function r(e){this._binding=e}return r.prototype.when=function(e){return this._binding.constraint=e,new Nt.BindingOnSyntax(this._binding)},r.prototype.whenTargetNamed=function(e){return this._binding.constraint=(0,ct.namedConstraint)(e),new Nt.BindingOnSyntax(this._binding)},r.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(e){if(e===null)return!1;var t=e.target!==null&&!e.target.isNamed()&&!e.target.isTagged();return t},new Nt.BindingOnSyntax(this._binding)},r.prototype.whenTargetTagged=function(e,t){return this._binding.constraint=(0,ct.taggedConstraint)(e)(t),new Nt.BindingOnSyntax(this._binding)},r.prototype.whenInjectedInto=function(e){return this._binding.constraint=function(t){return t!==null&&(0,ct.typeConstraint)(e)(t.parentRequest)},new Nt.BindingOnSyntax(this._binding)},r.prototype.whenParentNamed=function(e){return this._binding.constraint=function(t){return t!==null&&(0,ct.namedConstraint)(e)(t.parentRequest)},new Nt.BindingOnSyntax(this._binding)},r.prototype.whenParentTagged=function(e,t){return this._binding.constraint=function(n){return n!==null&&(0,ct.taggedConstraint)(e)(t)(n.parentRequest)},new Nt.BindingOnSyntax(this._binding)},r.prototype.whenAnyAncestorIs=function(e){return this._binding.constraint=function(t){return t!==null&&(0,ct.traverseAncerstors)(t,(0,ct.typeConstraint)(e))},new Nt.BindingOnSyntax(this._binding)},r.prototype.whenNoAncestorIs=function(e){return this._binding.constraint=function(t){return t!==null&&!(0,ct.traverseAncerstors)(t,(0,ct.typeConstraint)(e))},new Nt.BindingOnSyntax(this._binding)},r.prototype.whenAnyAncestorNamed=function(e){return this._binding.constraint=function(t){return t!==null&&(0,ct.traverseAncerstors)(t,(0,ct.namedConstraint)(e))},new Nt.BindingOnSyntax(this._binding)},r.prototype.whenNoAncestorNamed=function(e){return this._binding.constraint=function(t){return t!==null&&!(0,ct.traverseAncerstors)(t,(0,ct.namedConstraint)(e))},new Nt.BindingOnSyntax(this._binding)},r.prototype.whenAnyAncestorTagged=function(e,t){return this._binding.constraint=function(n){return n!==null&&(0,ct.traverseAncerstors)(n,(0,ct.taggedConstraint)(e)(t))},new Nt.BindingOnSyntax(this._binding)},r.prototype.whenNoAncestorTagged=function(e,t){return this._binding.constraint=function(n){return n!==null&&!(0,ct.traverseAncerstors)(n,(0,ct.taggedConstraint)(e)(t))},new Nt.BindingOnSyntax(this._binding)},r.prototype.whenAnyAncestorMatches=function(e){return this._binding.constraint=function(t){return t!==null&&(0,ct.traverseAncerstors)(t,e)},new Nt.BindingOnSyntax(this._binding)},r.prototype.whenNoAncestorMatches=function(e){return this._binding.constraint=function(t){return t!==null&&!(0,ct.traverseAncerstors)(t,e)},new Nt.BindingOnSyntax(this._binding)},r}();Rp.BindingWhenSyntax=vF});var Op=v(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.BindingOnSyntax=void 0;var qA=kp(),IF=function(){function r(e){this._binding=e}return r.prototype.onActivation=function(e){return this._binding.onActivation=e,new qA.BindingWhenSyntax(this._binding)},r.prototype.onDeactivation=function(e){return this._binding.onDeactivation=e,new qA.BindingWhenSyntax(this._binding)},r}();Np.BindingOnSyntax=IF});var rg=v(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});Bp.BindingWhenOnSyntax=void 0;var _F=Op(),AF=kp(),wF=function(){function r(e){this._binding=e,this._bindingWhenSyntax=new AF.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new _F.BindingOnSyntax(this._binding)}return r.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},r.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},r.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},r.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},r.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},r.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},r.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},r.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},r.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},r.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},r.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},r.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},r.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},r.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},r.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},r.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},r.prototype.onDeactivation=function(e){return this._bindingOnSyntax.onDeactivation(e)},r}();Bp.BindingWhenOnSyntax=wF});var GA=v(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.BindingInSyntax=void 0;var ng=Ir(),ig=rg(),SF=function(){function r(e){this._binding=e}return r.prototype.inRequestScope=function(){return this._binding.scope=ng.BindingScopeEnum.Request,new ig.BindingWhenOnSyntax(this._binding)},r.prototype.inSingletonScope=function(){return this._binding.scope=ng.BindingScopeEnum.Singleton,new ig.BindingWhenOnSyntax(this._binding)},r.prototype.inTransientScope=function(){return this._binding.scope=ng.BindingScopeEnum.Transient,new ig.BindingWhenOnSyntax(this._binding)},r}();Fp.BindingInSyntax=SF});var KA=v(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});Up.BindingInWhenOnSyntax=void 0;var EF=GA(),xF=Op(),PF=kp(),LF=function(){function r(e){this._binding=e,this._bindingWhenSyntax=new PF.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new xF.BindingOnSyntax(this._binding),this._bindingInSyntax=new EF.BindingInSyntax(e)}return r.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},r.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},r.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},r.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},r.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},r.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},r.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},r.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},r.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},r.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},r.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},r.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},r.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},r.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},r.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},r.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},r.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},r.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},r.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},r.prototype.onDeactivation=function(e){return this._bindingOnSyntax.onDeactivation(e)},r}();Up.BindingInWhenOnSyntax=LF});var JA=v(bn=>{"use strict";var $F=bn&&bn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),CF=bn&&bn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),DF=bn&&bn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&$F(e,r,t);return CF(e,r),e};Object.defineProperty(bn,"__esModule",{value:!0});bn.BindingToSyntax=void 0;var XA=DF(Et()),Bt=Ir(),zA=KA(),ra=rg(),TF=function(){function r(e){this._binding=e}return r.prototype.to=function(e){return this._binding.type=Bt.BindingTypeEnum.Instance,this._binding.implementationType=e,new zA.BindingInWhenOnSyntax(this._binding)},r.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error(""+XA.INVALID_TO_SELF_VALUE);var e=this._binding.serviceIdentifier;return this.to(e)},r.prototype.toConstantValue=function(e){return this._binding.type=Bt.BindingTypeEnum.ConstantValue,this._binding.cache=e,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Bt.BindingScopeEnum.Singleton,new ra.BindingWhenOnSyntax(this._binding)},r.prototype.toDynamicValue=function(e){return this._binding.type=Bt.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=e,this._binding.implementationType=null,new zA.BindingInWhenOnSyntax(this._binding)},r.prototype.toConstructor=function(e){return this._binding.type=Bt.BindingTypeEnum.Constructor,this._binding.implementationType=e,this._binding.scope=Bt.BindingScopeEnum.Singleton,new ra.BindingWhenOnSyntax(this._binding)},r.prototype.toFactory=function(e){return this._binding.type=Bt.BindingTypeEnum.Factory,this._binding.factory=e,this._binding.scope=Bt.BindingScopeEnum.Singleton,new ra.BindingWhenOnSyntax(this._binding)},r.prototype.toFunction=function(e){if(typeof e!="function")throw new Error(XA.INVALID_FUNCTION_BINDING);var t=this.toConstantValue(e);return this._binding.type=Bt.BindingTypeEnum.Function,this._binding.scope=Bt.BindingScopeEnum.Singleton,t},r.prototype.toAutoFactory=function(e){return this._binding.type=Bt.BindingTypeEnum.Factory,this._binding.factory=function(t){var n=function(){return t.container.get(e)};return n},this._binding.scope=Bt.BindingScopeEnum.Singleton,new ra.BindingWhenOnSyntax(this._binding)},r.prototype.toAutoNamedFactory=function(e){return this._binding.type=Bt.BindingTypeEnum.Factory,this._binding.factory=function(t){return function(n){return t.container.getNamed(e,n)}},new ra.BindingWhenOnSyntax(this._binding)},r.prototype.toProvider=function(e){return this._binding.type=Bt.BindingTypeEnum.Provider,this._binding.provider=e,this._binding.scope=Bt.BindingScopeEnum.Singleton,new ra.BindingWhenOnSyntax(this._binding)},r.prototype.toService=function(e){this.toDynamicValue(function(t){return t.container.get(e)})},r}();bn.BindingToSyntax=TF});var YA=v(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});Wp.ContainerSnapshot=void 0;var MF=function(){function r(){}return r.of=function(e,t,n,i,o){var s=new r;return s.bindings=e,s.middleware=t,s.deactivations=i,s.activations=n,s.moduleActivationStore=o,s},r}();Wp.ContainerSnapshot=MF});var QA=v(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});jp.isClonable=void 0;function RF(r){return typeof r=="object"&&r!==null&&"clone"in r&&typeof r.clone=="function"}jp.isClonable=RF});var og=v(vn=>{"use strict";var kF=vn&&vn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),OF=vn&&vn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),NF=vn&&vn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&kF(e,r,t);return OF(e,r),e};Object.defineProperty(vn,"__esModule",{value:!0});vn.Lookup=void 0;var Bo=NF(Et()),BF=QA(),FF=function(){function r(){this._map=new Map}return r.prototype.getMap=function(){return this._map},r.prototype.add=function(e,t){if(e==null)throw new Error(Bo.NULL_ARGUMENT);if(t==null)throw new Error(Bo.NULL_ARGUMENT);var n=this._map.get(e);n!==void 0?n.push(t):this._map.set(e,[t])},r.prototype.get=function(e){if(e==null)throw new Error(Bo.NULL_ARGUMENT);var t=this._map.get(e);if(t!==void 0)return t;throw new Error(Bo.KEY_NOT_FOUND)},r.prototype.remove=function(e){if(e==null)throw new Error(Bo.NULL_ARGUMENT);if(!this._map.delete(e))throw new Error(Bo.KEY_NOT_FOUND)},r.prototype.removeIntersection=function(e){var t=this;this.traverse(function(n,i){var o=e.hasKey(n)?e.get(n):void 0;if(o!==void 0){var s=i.filter(function(a){return!o.some(function(c){return a===c})});t._setValue(n,s)}})},r.prototype.removeByCondition=function(e){var t=this,n=[];return this._map.forEach(function(i,o){for(var s=[],a=0,c=i;a<c.length;a++){var u=c[a],l=e(u);l?n.push(u):s.push(u)}t._setValue(o,s)}),n},r.prototype.hasKey=function(e){if(e==null)throw new Error(Bo.NULL_ARGUMENT);return this._map.has(e)},r.prototype.clone=function(){var e=new r;return this._map.forEach(function(t,n){t.forEach(function(i){return e.add(n,(0,BF.isClonable)(i)?i.clone():i)})}),e},r.prototype.traverse=function(e){this._map.forEach(function(t,n){e(n,t)})},r.prototype._setValue=function(e,t){t.length>0?this._map.set(e,t):this._map.delete(e)},r}();vn.Lookup=FF});var ew=v(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});Vp.ModuleActivationStore=void 0;var ZA=og(),UF=function(){function r(){this._map=new Map}return r.prototype.remove=function(e){if(this._map.has(e)){var t=this._map.get(e);return this._map.delete(e),t}return this._getEmptyHandlersStore()},r.prototype.addDeactivation=function(e,t,n){this._getModuleActivationHandlers(e).onDeactivations.add(t,n)},r.prototype.addActivation=function(e,t,n){this._getModuleActivationHandlers(e).onActivations.add(t,n)},r.prototype.clone=function(){var e=new r;return this._map.forEach(function(t,n){e._map.set(n,{onActivations:t.onActivations.clone(),onDeactivations:t.onDeactivations.clone()})}),e},r.prototype._getModuleActivationHandlers=function(e){var t=this._map.get(e);return t===void 0&&(t=this._getEmptyHandlersStore(),this._map.set(e,t)),t},r.prototype._getEmptyHandlersStore=function(){var e={onActivations:new ZA.Lookup,onDeactivations:new ZA.Lookup};return e},r}();Vp.ModuleActivationStore=UF});var rw=v(ft=>{"use strict";var Gp=ft&&ft.__assign||function(){return Gp=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Gp.apply(this,arguments)},WF=ft&&ft.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),jF=ft&&ft.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),tw=ft&&ft.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&WF(e,r,t);return jF(e,r),e},Ar=ft&&ft.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})},wr=ft&&ft.__generator||function(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(l){u=[6,l],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},VF=ft&&ft.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return r.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(ft,"__esModule",{value:!0});ft.Container=void 0;var qF=rA(),Yr=tw(Et()),na=Ir(),Fo=tw(tt()),GF=kH(),qp=qH(),KF=WA(),XF=JA(),Uo=hu(),zF=Oi(),JF=No(),YF=YA(),Hu=og(),QF=ew(),ZF=function(){function r(e){var t=e||{};if(typeof t!="object")throw new Error(""+Yr.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(t.defaultScope===void 0)t.defaultScope=na.BindingScopeEnum.Transient;else if(t.defaultScope!==na.BindingScopeEnum.Singleton&&t.defaultScope!==na.BindingScopeEnum.Transient&&t.defaultScope!==na.BindingScopeEnum.Request)throw new Error(""+Yr.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(t.autoBindInjectable===void 0)t.autoBindInjectable=!1;else if(typeof t.autoBindInjectable!="boolean")throw new Error(""+Yr.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(t.skipBaseClassChecks===void 0)t.skipBaseClassChecks=!1;else if(typeof t.skipBaseClassChecks!="boolean")throw new Error(""+Yr.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:t.autoBindInjectable,defaultScope:t.defaultScope,skipBaseClassChecks:t.skipBaseClassChecks},this.id=(0,zF.id)(),this._bindingDictionary=new Hu.Lookup,this._snapshots=[],this._middleware=null,this._activations=new Hu.Lookup,this._deactivations=new Hu.Lookup,this.parent=null,this._metadataReader=new GF.MetadataReader,this._moduleActivationStore=new QF.ModuleActivationStore}return r.merge=function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var o=new r,s=VF([e,t],n,!0).map(function(u){return(0,qp.getBindingDictionary)(u)}),a=(0,qp.getBindingDictionary)(o);function c(u,l){u.traverse(function(p,d){d.forEach(function(f){l.add(f.serviceIdentifier,f.clone())})})}return s.forEach(function(u){c(u,a)}),o},r.prototype.load=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=this._getContainerModuleHelpersFactory(),i=0,o=e;i<o.length;i++){var s=o[i],a=n(s.id);s.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction,a.unbindAsyncFunction,a.onActivationFunction,a.onDeactivationFunction)}},r.prototype.loadAsync=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ar(this,void 0,void 0,function(){var n,i,o,s,a;return wr(this,function(c){switch(c.label){case 0:n=this._getContainerModuleHelpersFactory(),i=0,o=e,c.label=1;case 1:return i<o.length?(s=o[i],a=n(s.id),[4,s.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction,a.unbindAsyncFunction,a.onActivationFunction,a.onDeactivationFunction)]):[3,4];case 2:c.sent(),c.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},r.prototype.unload=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];t.forEach(function(i){var o=e._removeModuleBindings(i.id);e._deactivateSingletons(o),e._removeModuleHandlers(i.id)})},r.prototype.unloadAsync=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ar(this,void 0,void 0,function(){var n,i,o,s;return wr(this,function(a){switch(a.label){case 0:n=0,i=e,a.label=1;case 1:return n<i.length?(o=i[n],s=this._removeModuleBindings(o.id),[4,this._deactivateSingletonsAsync(s)]):[3,4];case 2:a.sent(),this._removeModuleHandlers(o.id),a.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},r.prototype.bind=function(e){var t=this.options.defaultScope||na.BindingScopeEnum.Transient,n=new qF.Binding(e,t);return this._bindingDictionary.add(e,n),new XF.BindingToSyntax(n)},r.prototype.rebind=function(e){return this.unbind(e),this.bind(e)},r.prototype.rebindAsync=function(e){return Ar(this,void 0,void 0,function(){return wr(this,function(t){switch(t.label){case 0:return[4,this.unbindAsync(e)];case 1:return t.sent(),[2,this.bind(e)]}})})},r.prototype.unbind=function(e){if(this._bindingDictionary.hasKey(e)){var t=this._bindingDictionary.get(e);this._deactivateSingletons(t)}this._removeServiceFromDictionary(e)},r.prototype.unbindAsync=function(e){return Ar(this,void 0,void 0,function(){var t;return wr(this,function(n){switch(n.label){case 0:return this._bindingDictionary.hasKey(e)?(t=this._bindingDictionary.get(e),[4,this._deactivateSingletonsAsync(t)]):[3,2];case 1:n.sent(),n.label=2;case 2:return this._removeServiceFromDictionary(e),[2]}})})},r.prototype.unbindAll=function(){var e=this;this._bindingDictionary.traverse(function(t,n){e._deactivateSingletons(n)}),this._bindingDictionary=new Hu.Lookup},r.prototype.unbindAllAsync=function(){return Ar(this,void 0,void 0,function(){var e,t=this;return wr(this,function(n){switch(n.label){case 0:return e=[],this._bindingDictionary.traverse(function(i,o){e.push(t._deactivateSingletonsAsync(o))}),[4,Promise.all(e)];case 1:return n.sent(),this._bindingDictionary=new Hu.Lookup,[2]}})})},r.prototype.onActivation=function(e,t){this._activations.add(e,t)},r.prototype.onDeactivation=function(e,t){this._deactivations.add(e,t)},r.prototype.isBound=function(e){var t=this._bindingDictionary.hasKey(e);return!t&&this.parent&&(t=this.parent.isBound(e)),t},r.prototype.isCurrentBound=function(e){return this._bindingDictionary.hasKey(e)},r.prototype.isBoundNamed=function(e,t){return this.isBoundTagged(e,Fo.NAMED_TAG,t)},r.prototype.isBoundTagged=function(e,t,n){var i=!1;if(this._bindingDictionary.hasKey(e)){var o=this._bindingDictionary.get(e),s=(0,qp.createMockRequest)(this,e,t,n);i=o.some(function(a){return a.constraint(s)})}return!i&&this.parent&&(i=this.parent.isBoundTagged(e,t,n)),i},r.prototype.snapshot=function(){this._snapshots.push(YF.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},r.prototype.restore=function(){var e=this._snapshots.pop();if(e===void 0)throw new Error(Yr.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=e.bindings,this._activations=e.activations,this._deactivations=e.deactivations,this._middleware=e.middleware,this._moduleActivationStore=e.moduleActivationStore},r.prototype.createChild=function(e){var t=new r(e||this.options);return t.parent=this,t},r.prototype.applyMiddleware=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=e.reduce(function(i,o){return o(i)},n)},r.prototype.applyCustomMetadataReader=function(e){this._metadataReader=e},r.prototype.get=function(e){var t=this._getNotAllArgs(e,!1);return this._getButThrowIfAsync(t)},r.prototype.getAsync=function(e){return Ar(this,void 0,void 0,function(){var t;return wr(this,function(n){return t=this._getNotAllArgs(e,!1),[2,this._get(t)]})})},r.prototype.getTagged=function(e,t,n){var i=this._getNotAllArgs(e,!1,t,n);return this._getButThrowIfAsync(i)},r.prototype.getTaggedAsync=function(e,t,n){return Ar(this,void 0,void 0,function(){var i;return wr(this,function(o){return i=this._getNotAllArgs(e,!1,t,n),[2,this._get(i)]})})},r.prototype.getNamed=function(e,t){return this.getTagged(e,Fo.NAMED_TAG,t)},r.prototype.getNamedAsync=function(e,t){return this.getTaggedAsync(e,Fo.NAMED_TAG,t)},r.prototype.getAll=function(e){var t=this._getAllArgs(e);return this._getButThrowIfAsync(t)},r.prototype.getAllAsync=function(e){var t=this._getAllArgs(e);return this._getAll(t)},r.prototype.getAllTagged=function(e,t,n){var i=this._getNotAllArgs(e,!0,t,n);return this._getButThrowIfAsync(i)},r.prototype.getAllTaggedAsync=function(e,t,n){var i=this._getNotAllArgs(e,!0,t,n);return this._getAll(i)},r.prototype.getAllNamed=function(e,t){return this.getAllTagged(e,Fo.NAMED_TAG,t)},r.prototype.getAllNamedAsync=function(e,t){return this.getAllTaggedAsync(e,Fo.NAMED_TAG,t)},r.prototype.resolve=function(e){var t=this.isBound(e);t||this.bind(e).toSelf();var n=this.get(e);return t||this.unbind(e),n},r.prototype._preDestroy=function(e,t){var n,i;if(Reflect.hasMetadata(Fo.PRE_DESTROY,e)){var o=Reflect.getMetadata(Fo.PRE_DESTROY,e);return(i=(n=t)[o.value])===null||i===void 0?void 0:i.call(n)}},r.prototype._removeModuleHandlers=function(e){var t=this._moduleActivationStore.remove(e);this._activations.removeIntersection(t.onActivations),this._deactivations.removeIntersection(t.onDeactivations)},r.prototype._removeModuleBindings=function(e){return this._bindingDictionary.removeByCondition(function(t){return t.moduleId===e})},r.prototype._deactivate=function(e,t){var n=this,i=Object.getPrototypeOf(t).constructor;try{if(this._deactivations.hasKey(e.serviceIdentifier)){var o=this._deactivateContainer(t,this._deactivations.get(e.serviceIdentifier).values());if((0,Uo.isPromise)(o))return this._handleDeactivationError(o.then(function(){return n._propagateContainerDeactivationThenBindingAndPreDestroyAsync(e,t,i)}),i)}var s=this._propagateContainerDeactivationThenBindingAndPreDestroy(e,t,i);if((0,Uo.isPromise)(s))return this._handleDeactivationError(s,i)}catch(a){if(a instanceof Error)throw new Error(Yr.ON_DEACTIVATION_ERROR(i.name,a.message))}},r.prototype._handleDeactivationError=function(e,t){return Ar(this,void 0,void 0,function(){var n;return wr(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e];case 1:return i.sent(),[3,3];case 2:if(n=i.sent(),n instanceof Error)throw new Error(Yr.ON_DEACTIVATION_ERROR(t.name,n.message));return[3,3];case 3:return[2]}})})},r.prototype._deactivateContainer=function(e,t){for(var n=this,i=t.next();i.value;){var o=i.value(e);if((0,Uo.isPromise)(o))return o.then(function(){return n._deactivateContainerAsync(e,t)});i=t.next()}},r.prototype._deactivateContainerAsync=function(e,t){return Ar(this,void 0,void 0,function(){var n;return wr(this,function(i){switch(i.label){case 0:n=t.next(),i.label=1;case 1:return n.value?[4,n.value(e)]:[3,3];case 2:return i.sent(),n=t.next(),[3,1];case 3:return[2]}})})},r.prototype._getContainerModuleHelpersFactory=function(){var e=this,t=function(l,p){l._binding.moduleId=p},n=function(l){return function(p){var d=e.bind(p);return t(d,l),d}},i=function(){return function(l){return e.unbind(l)}},o=function(){return function(l){return e.unbindAsync(l)}},s=function(){return function(l){return e.isBound(l)}},a=function(l){return function(p){var d=e.rebind(p);return t(d,l),d}},c=function(l){return function(p,d){e._moduleActivationStore.addActivation(l,p,d),e.onActivation(p,d)}},u=function(l){return function(p,d){e._moduleActivationStore.addDeactivation(l,p,d),e.onDeactivation(p,d)}};return function(l){return{bindFunction:n(l),isboundFunction:s(),onActivationFunction:c(l),onDeactivationFunction:u(l),rebindFunction:a(l),unbindFunction:i(),unbindAsyncFunction:o()}}},r.prototype._getAll=function(e){return Promise.all(this._get(e))},r.prototype._get=function(e){var t=Gp(Gp({},e),{contextInterceptor:function(i){return i},targetType:na.TargetTypeEnum.Variable});if(this._middleware){var n=this._middleware(t);if(n==null)throw new Error(Yr.INVALID_MIDDLEWARE_RETURN);return n}return this._planAndResolve()(t)},r.prototype._getButThrowIfAsync=function(e){var t=this._get(e);if((0,Uo.isPromiseOrContainsPromise)(t))throw new Error(Yr.LAZY_IN_SYNC(e.serviceIdentifier));return t},r.prototype._getAllArgs=function(e){var t={avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:e};return t},r.prototype._getNotAllArgs=function(e,t,n,i){var o={avoidConstraints:!1,isMultiInject:t,serviceIdentifier:e,key:n,value:i};return o},r.prototype._planAndResolve=function(){var e=this;return function(t){var n=(0,qp.plan)(e._metadataReader,e,t.isMultiInject,t.targetType,t.serviceIdentifier,t.key,t.value,t.avoidConstraints);n=t.contextInterceptor(n);var i=(0,KF.resolve)(n);return i}},r.prototype._deactivateIfSingleton=function(e){var t=this;if(e.activated)return(0,Uo.isPromise)(e.cache)?e.cache.then(function(n){return t._deactivate(e,n)}):this._deactivate(e,e.cache)},r.prototype._deactivateSingletons=function(e){for(var t=0,n=e;t<n.length;t++){var i=n[t],o=this._deactivateIfSingleton(i);if((0,Uo.isPromise)(o))throw new Error(Yr.ASYNC_UNBIND_REQUIRED)}},r.prototype._deactivateSingletonsAsync=function(e){return Ar(this,void 0,void 0,function(){var t=this;return wr(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(i){return t._deactivateIfSingleton(i)}))];case 1:return n.sent(),[2]}})})},r.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(e,t,n){return this.parent?this._deactivate.bind(this.parent)(e,t):this._bindingDeactivationAndPreDestroy(e,t,n)},r.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(e,t,n){return Ar(this,void 0,void 0,function(){return wr(this,function(i){switch(i.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(e,t)]:[3,2];case 1:return i.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(e,t,n)];case 3:i.sent(),i.label=4;case 4:return[2]}})})},r.prototype._removeServiceFromDictionary=function(e){try{this._bindingDictionary.remove(e)}catch{throw new Error(Yr.CANNOT_UNBIND+" "+(0,JF.getServiceIdentifierAsString)(e))}},r.prototype._bindingDeactivationAndPreDestroy=function(e,t,n){var i=this;if(typeof e.onDeactivation=="function"){var o=e.onDeactivation(t);if((0,Uo.isPromise)(o))return o.then(function(){return i._preDestroy(n,t)})}return this._preDestroy(n,t)},r.prototype._bindingDeactivationAndPreDestroyAsync=function(e,t,n){return Ar(this,void 0,void 0,function(){return wr(this,function(i){switch(i.label){case 0:return typeof e.onDeactivation!="function"?[3,2]:[4,e.onDeactivation(t)];case 1:i.sent(),i.label=2;case 2:return[4,this._preDestroy(n,t)];case 3:return i.sent(),[2]}})})},r}();ft.Container=ZF});var iw=v(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.AsyncContainerModule=ia.ContainerModule=void 0;var nw=Oi(),e3=function(){function r(e){this.id=(0,nw.id)(),this.registry=e}return r}();ia.ContainerModule=e3;var t3=function(){function r(e){this.id=(0,nw.id)(),this.registry=e}return r}();ia.AsyncContainerModule=t3});var ow=v(Kp=>{"use strict";Object.defineProperty(Kp,"__esModule",{value:!0});Kp.getFirstArrayDuplicate=void 0;function r3(r){for(var e=new Set,t=0,n=r;t<n.length;t++){var i=n[t];if(e.has(i))return i;e.add(i)}}Kp.getFirstArrayDuplicate=r3});var li=v(Lt=>{"use strict";var n3=Lt&&Lt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),i3=Lt&&Lt.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),aw=Lt&&Lt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&n3(e,r,t);return i3(e,r),e};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.createTaggedDecorator=Lt.tagProperty=Lt.tagParameter=Lt.decorate=void 0;var Xp=aw(Et()),cw=aw(tt()),o3=ow();function s3(r){return r.prototype!==void 0}function a3(r){if(r!==void 0)throw new Error(Xp.INVALID_DECORATOR_OPERATION)}function uw(r,e,t,n){a3(e),pw(cw.TAGGED,r,t.toString(),n)}Lt.tagParameter=uw;function lw(r,e,t){if(s3(r))throw new Error(Xp.INVALID_DECORATOR_OPERATION);pw(cw.TAGGED_PROP,r.constructor,e,t)}Lt.tagProperty=lw;function c3(r){var e=[];if(Array.isArray(r)){e=r;var t=(0,o3.getFirstArrayDuplicate)(e.map(function(n){return n.key}));if(t!==void 0)throw new Error(Xp.DUPLICATED_METADATA+" "+t.toString())}else e=[r];return e}function pw(r,e,t,n){var i=c3(n),o={};Reflect.hasOwnMetadata(r,e)&&(o=Reflect.getMetadata(r,e));var s=o[t];if(s===void 0)s=[];else for(var a=function(p){if(i.some(function(d){return d.key===p.key}))throw new Error(Xp.DUPLICATED_METADATA+" "+p.key.toString())},c=0,u=s;c<u.length;c++){var l=u[c];a(l)}s.push.apply(s,i),o[t]=s,Reflect.defineMetadata(r,o,e)}function u3(r){return function(e,t,n){typeof n=="number"?uw(e,t,n,r):lw(e,t,r)}}Lt.createTaggedDecorator=u3;function sw(r,e){Reflect.decorate(r,e)}function l3(r,e){return function(t,n){e(t,n,r)}}function p3(r,e,t){typeof t=="number"?sw([l3(t,r)],e):typeof t=="string"?Reflect.decorate([r],e,t):sw([r],e)}Lt.decorate=p3});var fw=v(In=>{"use strict";var d3=In&&In.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),f3=In&&In.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),dw=In&&In.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&d3(e,r,t);return f3(e,r),e};Object.defineProperty(In,"__esModule",{value:!0});In.injectable=void 0;var h3=dw(Et()),sg=dw(tt());function m3(){return function(r){if(Reflect.hasOwnMetadata(sg.PARAM_TYPES,r))throw new Error(h3.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(sg.DESIGN_PARAM_TYPES,r)||[];return Reflect.defineMetadata(sg.PARAM_TYPES,e,r),r}}In.injectable=m3});var hw=v(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});zp.tagged=void 0;var H3=Jr(),g3=li();function y3(r,e){return(0,g3.createTaggedDecorator)(new H3.Metadata(r,e))}zp.tagged=y3});var mw=v(_n=>{"use strict";var b3=_n&&_n.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),v3=_n&&_n.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),I3=_n&&_n.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&b3(e,r,t);return v3(e,r),e};Object.defineProperty(_n,"__esModule",{value:!0});_n.named=void 0;var _3=I3(tt()),A3=Jr(),w3=li();function S3(r){return(0,w3.createTaggedDecorator)(new A3.Metadata(_3.NAMED_TAG,r))}_n.named=S3});var ag=v(Jp=>{"use strict";Object.defineProperty(Jp,"__esModule",{value:!0});Jp.injectBase=void 0;var E3=Et(),x3=Jr(),P3=li();function L3(r){return function(e){return function(t,n,i){if(e===void 0){var o=typeof t=="function"?t.name:t.constructor.name;throw new Error((0,E3.UNDEFINED_INJECT_ANNOTATION)(o))}return(0,P3.createTaggedDecorator)(new x3.Metadata(r,e))(t,n,i)}}}Jp.injectBase=L3});var Hw=v(An=>{"use strict";var $3=An&&An.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),C3=An&&An.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),D3=An&&An.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&$3(e,r,t);return C3(e,r),e};Object.defineProperty(An,"__esModule",{value:!0});An.inject=void 0;var T3=D3(tt()),M3=ag(),R3=(0,M3.injectBase)(T3.INJECT_TAG);An.inject=R3});var gw=v(wn=>{"use strict";var k3=wn&&wn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),O3=wn&&wn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),N3=wn&&wn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&k3(e,r,t);return O3(e,r),e};Object.defineProperty(wn,"__esModule",{value:!0});wn.optional=void 0;var B3=N3(tt()),F3=Jr(),U3=li();function W3(){return(0,U3.createTaggedDecorator)(new F3.Metadata(B3.OPTIONAL_TAG,!0))}wn.optional=W3});var yw=v(Sn=>{"use strict";var j3=Sn&&Sn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),V3=Sn&&Sn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),q3=Sn&&Sn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&j3(e,r,t);return V3(e,r),e};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.unmanaged=void 0;var G3=q3(tt()),K3=Jr(),X3=li();function z3(){return function(r,e,t){var n=new K3.Metadata(G3.UNMANAGED_TAG,!0);(0,X3.tagParameter)(r,e,t,n)}}Sn.unmanaged=z3});var bw=v(En=>{"use strict";var J3=En&&En.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Y3=En&&En.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Q3=En&&En.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&J3(e,r,t);return Y3(e,r),e};Object.defineProperty(En,"__esModule",{value:!0});En.multiInject=void 0;var Z3=Q3(tt()),eU=ag(),tU=(0,eU.injectBase)(Z3.MULTI_INJECT_TAG);En.multiInject=tU});var vw=v(xn=>{"use strict";var rU=xn&&xn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),nU=xn&&xn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),iU=xn&&xn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&rU(e,r,t);return nU(e,r),e};Object.defineProperty(xn,"__esModule",{value:!0});xn.targetName=void 0;var oU=iU(tt()),sU=Jr(),aU=li();function cU(r){return function(e,t,n){var i=new sU.Metadata(oU.NAME_TAG,r);(0,aU.tagParameter)(e,t,n,i)}}xn.targetName=cU});var cg=v(Yp=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});Yp.propertyEventDecorator=void 0;var uU=Jr();function lU(r,e){return function(){return function(t,n){var i=new uU.Metadata(r,n);if(Reflect.hasOwnMetadata(r,t.constructor))throw new Error(e);Reflect.defineMetadata(r,i,t.constructor)}}}Yp.propertyEventDecorator=lU});var _w=v(Pn=>{"use strict";var pU=Pn&&Pn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),dU=Pn&&Pn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Iw=Pn&&Pn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&pU(e,r,t);return dU(e,r),e};Object.defineProperty(Pn,"__esModule",{value:!0});Pn.postConstruct=void 0;var fU=Iw(Et()),hU=Iw(tt()),mU=cg(),HU=(0,mU.propertyEventDecorator)(hU.POST_CONSTRUCT,fU.MULTIPLE_POST_CONSTRUCT_METHODS);Pn.postConstruct=HU});var ww=v(Ln=>{"use strict";var gU=Ln&&Ln.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),yU=Ln&&Ln.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Aw=Ln&&Ln.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&gU(e,r,t);return yU(e,r),e};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.preDestroy=void 0;var bU=Aw(Et()),vU=Aw(tt()),IU=cg(),_U=(0,IU.propertyEventDecorator)(vU.PRE_DESTROY,bU.MULTIPLE_PRE_DESTROY_METHODS);Ln.preDestroy=_U});var Sw=v(Qp=>{"use strict";Object.defineProperty(Qp,"__esModule",{value:!0});Qp.interfaces=void 0;var ug;ug||(ug={});Qp.interfaces=ug});var q=v(W=>{"use strict";var AU=W&&W.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),wU=W&&W.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),SU=W&&W.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&AU(e,r,t);return wU(e,r),e};Object.defineProperty(W,"__esModule",{value:!0});W.multiBindToService=W.getServiceIdentifierAsString=W.typeConstraint=W.namedConstraint=W.taggedConstraint=W.traverseAncerstors=W.decorate=W.interfaces=W.id=W.MetadataReader=W.preDestroy=W.postConstruct=W.targetName=W.multiInject=W.unmanaged=W.optional=W.LazyServiceIdentifer=W.LazyServiceIdentifier=W.inject=W.named=W.tagged=W.injectable=W.createTaggedDecorator=W.ContainerModule=W.AsyncContainerModule=W.TargetTypeEnum=W.BindingTypeEnum=W.BindingScopeEnum=W.Container=W.METADATA_KEY=void 0;var EU=SU(tt());W.METADATA_KEY=EU;var xU=rw();Object.defineProperty(W,"Container",{enumerable:!0,get:function(){return xU.Container}});var lg=Ir();Object.defineProperty(W,"BindingScopeEnum",{enumerable:!0,get:function(){return lg.BindingScopeEnum}});Object.defineProperty(W,"BindingTypeEnum",{enumerable:!0,get:function(){return lg.BindingTypeEnum}});Object.defineProperty(W,"TargetTypeEnum",{enumerable:!0,get:function(){return lg.TargetTypeEnum}});var Ew=iw();Object.defineProperty(W,"AsyncContainerModule",{enumerable:!0,get:function(){return Ew.AsyncContainerModule}});Object.defineProperty(W,"ContainerModule",{enumerable:!0,get:function(){return Ew.ContainerModule}});var PU=li();Object.defineProperty(W,"createTaggedDecorator",{enumerable:!0,get:function(){return PU.createTaggedDecorator}});var LU=fw();Object.defineProperty(W,"injectable",{enumerable:!0,get:function(){return LU.injectable}});var $U=hw();Object.defineProperty(W,"tagged",{enumerable:!0,get:function(){return $U.tagged}});var CU=mw();Object.defineProperty(W,"named",{enumerable:!0,get:function(){return CU.named}});var DU=Hw();Object.defineProperty(W,"inject",{enumerable:!0,get:function(){return DU.inject}});var TU=Pp();Object.defineProperty(W,"LazyServiceIdentifier",{enumerable:!0,get:function(){return TU.LazyServiceIdentifier}});var MU=Pp();Object.defineProperty(W,"LazyServiceIdentifer",{enumerable:!0,get:function(){return MU.LazyServiceIdentifier}});var RU=gw();Object.defineProperty(W,"optional",{enumerable:!0,get:function(){return RU.optional}});var kU=yw();Object.defineProperty(W,"unmanaged",{enumerable:!0,get:function(){return kU.unmanaged}});var OU=bw();Object.defineProperty(W,"multiInject",{enumerable:!0,get:function(){return OU.multiInject}});var NU=vw();Object.defineProperty(W,"targetName",{enumerable:!0,get:function(){return NU.targetName}});var BU=_w();Object.defineProperty(W,"postConstruct",{enumerable:!0,get:function(){return BU.postConstruct}});var FU=ww();Object.defineProperty(W,"preDestroy",{enumerable:!0,get:function(){return FU.preDestroy}});var UU=kH();Object.defineProperty(W,"MetadataReader",{enumerable:!0,get:function(){return UU.MetadataReader}});var WU=Oi();Object.defineProperty(W,"id",{enumerable:!0,get:function(){return WU.id}});var jU=Sw();Object.defineProperty(W,"interfaces",{enumerable:!0,get:function(){return jU.interfaces}});var VU=li();Object.defineProperty(W,"decorate",{enumerable:!0,get:function(){return VU.decorate}});var Zp=tg();Object.defineProperty(W,"traverseAncerstors",{enumerable:!0,get:function(){return Zp.traverseAncerstors}});Object.defineProperty(W,"taggedConstraint",{enumerable:!0,get:function(){return Zp.taggedConstraint}});Object.defineProperty(W,"namedConstraint",{enumerable:!0,get:function(){return Zp.namedConstraint}});Object.defineProperty(W,"typeConstraint",{enumerable:!0,get:function(){return Zp.typeConstraint}});var qU=No();Object.defineProperty(W,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return qU.getServiceIdentifierAsString}});var GU=XH();Object.defineProperty(W,"multiBindToService",{enumerable:!0,get:function(){return GU.multiBindToService}})});var Tw=v((BY,Dw)=>{Dw.exports=Cw;Cw.sync=XU;var Lw=H("fs");function KU(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var n=0;n<t.length;n++){var i=t[n].toLowerCase();if(i&&r.substr(-i.length).toLowerCase()===i)return!0}return!1}function $w(r,e,t){return!r.isSymbolicLink()&&!r.isFile()?!1:KU(e,t)}function Cw(r,e,t){Lw.stat(r,function(n,i){t(n,n?!1:$w(i,r,e))})}function XU(r,e){return $w(Lw.statSync(r),r,e)}});var Nw=v((FY,Ow)=>{Ow.exports=Rw;Rw.sync=zU;var Mw=H("fs");function Rw(r,e,t){Mw.stat(r,function(n,i){t(n,n?!1:kw(i,e))})}function zU(r,e){return kw(Mw.statSync(r),e)}function kw(r,e){return r.isFile()&&JU(r,e)}function JU(r,e){var t=r.mode,n=r.uid,i=r.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),l=a|c,p=t&u||t&c&&i===s||t&a&&n===o||t&l&&o===0;return p}});var Fw=v((WY,Bw)=>{var UY=H("fs"),td;process.platform==="win32"||global.TESTING_WINDOWS?td=Tw():td=Nw();Bw.exports=dg;dg.sync=YU;function dg(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){dg(r,e||{},function(o,s){o?i(o):n(s)})})}td(r,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),t(n,i)})}function YU(r,e){try{return td.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var Kw=v((jY,Gw)=>{var sa=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Uw=H("path"),QU=sa?";":":",Ww=Fw(),jw=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),Vw=(r,e)=>{let t=e.colon||QU,n=r.match(/\//)||sa&&r.match(/\\/)?[""]:[...sa?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],i=sa?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=sa?i.split(t):[""];return sa&&r.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},qw=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=Vw(r,e),s=[],a=u=>new Promise((l,p)=>{if(u===n.length)return e.all&&s.length?l(s):p(jw(r));let d=n[u],f=/^".*"$/.test(d)?d.slice(1,-1):d,h=Uw.join(f,r),m=!f&&/^\.[\\\/]/.test(r)?r.slice(0,2)+h:h;l(c(m,u,0))}),c=(u,l,p)=>new Promise((d,f)=>{if(p===i.length)return d(a(l+1));let h=i[p];Ww(u+h,{pathExt:o},(m,y)=>{if(!m&&y)if(e.all)s.push(u+h);else return d(u+h);return d(c(u,l,p+1))})});return t?a(0).then(u=>t(null,u),t):a(0)},ZU=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:n,pathExtExe:i}=Vw(r,e),o=[];for(let s=0;s<t.length;s++){let a=t[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=Uw.join(c,r),l=!c&&/^\.[\\\/]/.test(r)?r.slice(0,2)+u:u;for(let p=0;p<n.length;p++){let d=l+n[p];try{if(Ww.sync(d,{pathExt:i}))if(e.all)o.push(d);else return d}catch{}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw jw(r)};Gw.exports=qw;qw.sync=ZU});var hg=v((VY,fg)=>{"use strict";var Xw=(r={})=>{let e=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};fg.exports=Xw;fg.exports.default=Xw});var Qw=v((qY,Yw)=>{"use strict";var zw=H("path"),eW=Kw(),tW=hg();function Jw(r,e){let t=r.options.env||process.env,n=process.cwd(),i=r.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(r.options.cwd)}catch{}let s;try{s=eW.sync(r.command,{path:t[tW({env:t})],pathExt:e?zw.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=zw.resolve(i?r.options.cwd:"",s)),s}function rW(r){return Jw(r)||Jw(r,!0)}Yw.exports=rW});var Zw=v((GY,Hg)=>{"use strict";var mg=/([()\][%!^"`<>&|;, *?])/g;function nW(r){return r=r.replace(mg,"^$1"),r}function iW(r,e){return r=`${r}`,r=r.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),r=r.replace(/(?=(\\+?)?)\1$/,"$1$1"),r=`"${r}"`,r=r.replace(mg,"^$1"),e&&(r=r.replace(mg,"^$1")),r}Hg.exports.command=nW;Hg.exports.argument=iW});var tS=v((KY,eS)=>{"use strict";eS.exports=/^#!(.*)/});var nS=v((XY,rS)=>{"use strict";var oW=tS();rS.exports=(r="")=>{let e=r.match(oW);if(!e)return null;let[t,n]=e[0].replace(/#! ?/,"").split(" "),i=t.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var oS=v((zY,iS)=>{"use strict";var gg=H("fs"),sW=nS();function aW(r){let t=Buffer.alloc(150),n;try{n=gg.openSync(r,"r"),gg.readSync(n,t,0,150,0),gg.closeSync(n)}catch{}return sW(t.toString())}iS.exports=aW});var uS=v((JY,cS)=>{"use strict";var cW=H("path"),sS=Qw(),aS=Zw(),uW=oS(),lW=process.platform==="win32",pW=/\.(?:com|exe)$/i,dW=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function fW(r){r.file=sS(r);let e=r.file&&uW(r.file);return e?(r.args.unshift(r.file),r.command=e,sS(r)):r.file}function hW(r){if(!lW)return r;let e=fW(r),t=!pW.test(e);if(r.options.forceShell||t){let n=dW.test(e);r.command=cW.normalize(r.command),r.command=aS.command(r.command),r.args=r.args.map(o=>aS.argument(o,n));let i=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${i}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function mW(r,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let n={command:r,args:e,options:t,file:void 0,original:{command:r,args:e}};return t.shell?n:hW(n)}cS.exports=mW});var dS=v((YY,pS)=>{"use strict";var yg=process.platform==="win32";function bg(r,e){return Object.assign(new Error(`${e} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${r.command}`,path:r.command,spawnargs:r.args})}function HW(r,e){if(!yg)return;let t=r.emit;r.emit=function(n,i){if(n==="exit"){let o=lS(i,e);if(o)return t.call(r,"error",o)}return t.apply(r,arguments)}}function lS(r,e){return yg&&r===1&&!e.file?bg(e.original,"spawn"):null}function gW(r,e){return yg&&r===1&&!e.file?bg(e.original,"spawnSync"):null}pS.exports={hookChildProcess:HW,verifyENOENT:lS,verifyENOENTSync:gW,notFoundError:bg}});var mS=v((QY,aa)=>{"use strict";var fS=H("child_process"),vg=uS(),Ig=dS();function hS(r,e,t){let n=vg(r,e,t),i=fS.spawn(n.command,n.args,n.options);return Ig.hookChildProcess(i,n),i}function yW(r,e,t){let n=vg(r,e,t),i=fS.spawnSync(n.command,n.args,n.options);return i.error=i.error||Ig.verifyENOENTSync(i.status,n),i}aa.exports=hS;aa.exports.spawn=hS;aa.exports.sync=yW;aa.exports._parse=vg;aa.exports._enoent=Ig});var gS=v((ZY,HS)=>{"use strict";HS.exports=r=>{let e=typeof r=="string"?`
`:10,t=typeof r=="string"?"\r":13;return r[r.length-1]===e&&(r=r.slice(0,r.length-1)),r[r.length-1]===t&&(r=r.slice(0,r.length-1)),r}});var vS=v((eQ,yu)=>{"use strict";var gu=H("path"),yS=hg(),bS=r=>{r={cwd:process.cwd(),path:process.env[yS()],execPath:process.execPath,...r};let e,t=gu.resolve(r.cwd),n=[];for(;e!==t;)n.push(gu.join(t,"node_modules/.bin")),e=t,t=gu.resolve(t,"..");let i=gu.resolve(r.cwd,r.execPath,"..");return n.push(i),n.concat(r.path).join(gu.delimiter)};yu.exports=bS;yu.exports.default=bS;yu.exports.env=r=>{r={env:process.env,...r};let e={...r.env},t=yS({env:e});return r.path=e[t],e[t]=yu.exports(r),e}});var _S=v((tQ,_g)=>{"use strict";var IS=(r,e)=>{for(let t of Reflect.ownKeys(e))Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t));return r};_g.exports=IS;_g.exports.default=IS});var wS=v((rQ,nd)=>{"use strict";var bW=_S(),rd=new WeakMap,AS=(r,e={})=>{if(typeof r!="function")throw new TypeError("Expected a function");let t,n=0,i=r.displayName||r.name||"<anonymous>",o=function(...s){if(rd.set(o,++n),n===1)t=r.apply(this,s),r=null;else if(e.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return t};return bW(o,r),rd.set(o,n),o};nd.exports=AS;nd.exports.default=AS;nd.exports.callCount=r=>{if(!rd.has(r))throw new Error(`The given function \`${r.name}\` is not wrapped by the \`onetime\` package`);return rd.get(r)}});var SS=v(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});id.SIGNALS=void 0;var vW=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];id.SIGNALS=vW});var Ag=v(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.SIGRTMAX=ca.getRealtimeSignals=void 0;var IW=function(){let r=xS-ES+1;return Array.from({length:r},_W)};ca.getRealtimeSignals=IW;var _W=function(r,e){return{name:`SIGRT${e+1}`,number:ES+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},ES=34,xS=64;ca.SIGRTMAX=xS});var PS=v(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.getSignals=void 0;var AW=H("os"),wW=SS(),SW=Ag(),EW=function(){let r=(0,SW.getRealtimeSignals)();return[...wW.SIGNALS,...r].map(xW)};od.getSignals=EW;var xW=function({name:r,number:e,description:t,action:n,forced:i=!1,standard:o}){let{signals:{[r]:s}}=AW.constants,a=s!==void 0;return{name:r,number:a?s:e,description:t,supported:a,action:n,forced:i,standard:o}}});var $S=v(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.signalsByNumber=ua.signalsByName=void 0;var PW=H("os"),LS=PS(),LW=Ag(),$W=function(){return(0,LS.getSignals)().reduce(CW,{})},CW=function(r,{name:e,number:t,description:n,supported:i,action:o,forced:s,standard:a}){return{...r,[e]:{name:e,number:t,description:n,supported:i,action:o,forced:s,standard:a}}},DW=$W();ua.signalsByName=DW;var TW=function(){let r=(0,LS.getSignals)(),e=LW.SIGRTMAX+1,t=Array.from({length:e},(n,i)=>MW(i,r));return Object.assign({},...t)},MW=function(r,e){let t=RW(r,e);if(t===void 0)return{};let{name:n,description:i,supported:o,action:s,forced:a,standard:c}=t;return{[r]:{name:n,number:r,description:i,supported:o,action:s,forced:a,standard:c}}},RW=function(r,e){let t=e.find(({name:n})=>PW.constants.signals[n]===r);return t!==void 0?t:e.find(n=>n.number===r)},kW=TW();ua.signalsByNumber=kW});var DS=v((aQ,CS)=>{"use strict";var{signalsByName:OW}=$S(),NW=({timedOut:r,timeout:e,errorCode:t,signal:n,signalDescription:i,exitCode:o,isCanceled:s})=>r?`timed out after ${e} milliseconds`:s?"was canceled":t!==void 0?`failed with ${t}`:n!==void 0?`was killed with ${n} (${i})`:o!==void 0?`failed with exit code ${o}`:"failed",BW=({stdout:r,stderr:e,all:t,error:n,signal:i,exitCode:o,command:s,escapedCommand:a,timedOut:c,isCanceled:u,killed:l,parsed:{options:{timeout:p}}})=>{o=o===null?void 0:o,i=i===null?void 0:i;let d=i===void 0?void 0:OW[i].description,f=n&&n.code,m=`Command ${NW({timedOut:c,timeout:p,errorCode:f,signal:i,signalDescription:d,exitCode:o,isCanceled:u})}: ${s}`,y=Object.prototype.toString.call(n)==="[object Error]",w=y?`${m}
${n.message}`:m,D=[w,e,r].filter(Boolean).join(`
`);return y?(n.originalMessage=n.message,n.message=D):n=new Error(D),n.shortMessage=w,n.command=s,n.escapedCommand=a,n.exitCode=o,n.signal=i,n.signalDescription=d,n.stdout=r,n.stderr=e,t!==void 0&&(n.all=t),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!c,n.isCanceled=u,n.killed=l&&!c,n};CS.exports=BW});var MS=v((cQ,wg)=>{"use strict";var sd=["stdin","stdout","stderr"],FW=r=>sd.some(e=>r[e]!==void 0),TS=r=>{if(!r)return;let{stdio:e}=r;if(e===void 0)return sd.map(n=>r[n]);if(FW(r))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${sd.map(n=>`\`${n}\``).join(", ")}`);if(typeof e=="string")return e;if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let t=Math.max(e.length,sd.length);return Array.from({length:t},(n,i)=>e[i])};wg.exports=TS;wg.exports.node=r=>{let e=TS(r);return e==="ipc"?"ipc":e===void 0||typeof e=="string"?[e,e,e,"ipc"]:e.includes("ipc")?e:[...e,"ipc"]}});var RS=v((uQ,ad)=>{ad.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&ad.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ad.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var NS=v((lQ,Iu)=>{var UW=H("assert"),bu=RS(),WW=/^win/i.test(process.platform),cd=H("events");typeof cd!="function"&&(cd=cd.EventEmitter);var _t;process.__signal_exit_emitter__?_t=process.__signal_exit_emitter__:(_t=process.__signal_exit_emitter__=new cd,_t.count=0,_t.emitted={});_t.infinite||(_t.setMaxListeners(1/0),_t.infinite=!0);Iu.exports=function(r,e){UW.equal(typeof r,"function","a callback must be provided for exit handler"),vu===!1&&kS();var t="exit";e&&e.alwaysLast&&(t="afterexit");var n=function(){_t.removeListener(t,r),_t.listeners("exit").length===0&&_t.listeners("afterexit").length===0&&Eg()};return _t.on(t,r),n};Iu.exports.unload=Eg;function Eg(){vu&&(vu=!1,bu.forEach(function(r){try{process.removeListener(r,xg[r])}catch{}}),process.emit=Sg,process.reallyExit=OS,_t.count-=1)}function la(r,e,t){_t.emitted[r]||(_t.emitted[r]=!0,_t.emit(r,e,t))}var xg={};bu.forEach(function(r){xg[r]=function(){var t=process.listeners(r);t.length===_t.count&&(Eg(),la("exit",null,r),la("afterexit",null,r),WW&&r==="SIGHUP"&&(r="SIGINT"),process.kill(process.pid,r))}});Iu.exports.signals=function(){return bu};Iu.exports.load=kS;var vu=!1;function kS(){vu||(vu=!0,_t.count+=1,bu=bu.filter(function(r){try{return process.on(r,xg[r]),!0}catch{return!1}}),process.emit=VW,process.reallyExit=jW)}var OS=process.reallyExit;function jW(r){process.exitCode=r||0,la("exit",process.exitCode,null),la("afterexit",process.exitCode,null),OS.call(process,process.exitCode)}var Sg=process.emit;function VW(r,e){if(r==="exit"){e!==void 0&&(process.exitCode=e);var t=Sg.apply(this,arguments);return la("exit",process.exitCode,null),la("afterexit",process.exitCode,null),t}else return Sg.apply(this,arguments)}});var FS=v((pQ,BS)=>{"use strict";var qW=H("os"),GW=NS(),KW=1e3*5,XW=(r,e="SIGTERM",t={})=>{let n=r(e);return zW(r,e,t,n),n},zW=(r,e,t,n)=>{if(!JW(e,t,n))return;let i=QW(t),o=setTimeout(()=>{r("SIGKILL")},i);o.unref&&o.unref()},JW=(r,{forceKillAfterTimeout:e},t)=>YW(r)&&e!==!1&&t,YW=r=>r===qW.constants.signals.SIGTERM||typeof r=="string"&&r.toUpperCase()==="SIGTERM",QW=({forceKillAfterTimeout:r=!0})=>{if(r===!0)return KW;if(!Number.isFinite(r)||r<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${r}\` (${typeof r})`);return r},ZW=(r,e)=>{r.kill()&&(e.isCanceled=!0)},e2=(r,e,t)=>{r.kill(e),t(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))},t2=(r,{timeout:e,killSignal:t="SIGTERM"},n)=>{if(e===0||e===void 0)return n;let i,o=new Promise((a,c)=>{i=setTimeout(()=>{e2(r,t,c)},e)}),s=n.finally(()=>{clearTimeout(i)});return Promise.race([o,s])},r2=({timeout:r})=>{if(r!==void 0&&(!Number.isFinite(r)||r<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${r}\` (${typeof r})`)},n2=async(r,{cleanup:e,detached:t},n)=>{if(!e||t)return n;let i=GW(()=>{r.kill()});return n.finally(()=>{i()})};BS.exports={spawnedKill:XW,spawnedCancel:ZW,setupTimeout:t2,validateTimeout:r2,setExitHandler:n2}});var WS=v((dQ,US)=>{"use strict";var $n=r=>r!==null&&typeof r=="object"&&typeof r.pipe=="function";$n.writable=r=>$n(r)&&r.writable!==!1&&typeof r._write=="function"&&typeof r._writableState=="object";$n.readable=r=>$n(r)&&r.readable!==!1&&typeof r._read=="function"&&typeof r._readableState=="object";$n.duplex=r=>$n.writable(r)&&$n.readable(r);$n.transform=r=>$n.duplex(r)&&typeof r._transform=="function"&&typeof r._transformState=="object";US.exports=$n});var VS=v((fQ,jS)=>{"use strict";var{PassThrough:i2}=H("stream");jS.exports=r=>{r={...r};let{array:e}=r,{encoding:t}=r,n=t==="buffer",i=!1;e?i=!(t||n):t=t||"utf8",n&&(t=null);let o=new i2({objectMode:i});t&&o.setEncoding(t);let s=0,a=[];return o.on("data",c=>{a.push(c),i?s=a.length:s+=c.length}),o.getBufferedValue=()=>e?a:n?Buffer.concat(a,s):a.join(""),o.getBufferedLength=()=>s,o}});var qS=v((hQ,_u)=>{"use strict";var{constants:o2}=H("buffer"),s2=H("stream"),{promisify:a2}=H("util"),c2=VS(),u2=a2(s2.pipeline),ud=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function Pg(r,e){if(!r)throw new Error("Expected a stream");e={maxBuffer:1/0,...e};let{maxBuffer:t}=e,n=c2(e);return await new Promise((i,o)=>{let s=a=>{a&&n.getBufferedLength()<=o2.MAX_LENGTH&&(a.bufferedData=n.getBufferedValue()),o(a)};(async()=>{try{await u2(r,n),i()}catch(a){s(a)}})(),n.on("data",()=>{n.getBufferedLength()>t&&s(new ud)})}),n.getBufferedValue()}_u.exports=Pg;_u.exports.buffer=(r,e)=>Pg(r,{...e,encoding:"buffer"});_u.exports.array=(r,e)=>Pg(r,{...e,array:!0});_u.exports.MaxBufferError=ud});var KS=v((mQ,GS)=>{"use strict";var{PassThrough:l2}=H("stream");GS.exports=function(){var r=[],e=new l2({objectMode:!0});return e.setMaxListeners(0),e.add=t,e.isEmpty=n,e.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(t),e;function t(o){return Array.isArray(o)?(o.forEach(t),this):(r.push(o),o.once("end",i.bind(null,o)),o.once("error",e.emit.bind(e,"error")),o.pipe(e,{end:!1}),this)}function n(){return r.length==0}function i(o){r=r.filter(function(s){return s!==o}),!r.length&&e.readable&&e.end()}}});var YS=v((HQ,JS)=>{"use strict";var zS=WS(),XS=qS(),p2=KS(),d2=(r,e)=>{e===void 0||r.stdin===void 0||(zS(e)?e.pipe(r.stdin):r.stdin.end(e))},f2=(r,{all:e})=>{if(!e||!r.stdout&&!r.stderr)return;let t=p2();return r.stdout&&t.add(r.stdout),r.stderr&&t.add(r.stderr),t},Lg=async(r,e)=>{if(r){r.destroy();try{return await e}catch(t){return t.bufferedData}}},$g=(r,{encoding:e,buffer:t,maxBuffer:n})=>{if(!(!r||!t))return e?XS(r,{encoding:e,maxBuffer:n}):XS.buffer(r,{maxBuffer:n})},h2=async({stdout:r,stderr:e,all:t},{encoding:n,buffer:i,maxBuffer:o},s)=>{let a=$g(r,{encoding:n,buffer:i,maxBuffer:o}),c=$g(e,{encoding:n,buffer:i,maxBuffer:o}),u=$g(t,{encoding:n,buffer:i,maxBuffer:o*2});try{return await Promise.all([s,a,c,u])}catch(l){return Promise.all([{error:l,signal:l.signal,timedOut:l.timedOut},Lg(r,a),Lg(e,c),Lg(t,u)])}},m2=({input:r})=>{if(zS(r))throw new TypeError("The `input` option cannot be a stream in sync mode")};JS.exports={handleInput:d2,makeAllStream:f2,getSpawnedResult:h2,validateInputSync:m2}});var ZS=v((gQ,QS)=>{"use strict";var H2=(async()=>{})().constructor.prototype,g2=["then","catch","finally"].map(r=>[r,Reflect.getOwnPropertyDescriptor(H2,r)]),y2=(r,e)=>{for(let[t,n]of g2){let i=typeof e=="function"?(...o)=>Reflect.apply(n.value,e(),o):n.value.bind(e);Reflect.defineProperty(r,t,{...n,value:i})}return r},b2=r=>new Promise((e,t)=>{r.on("exit",(n,i)=>{e({exitCode:n,signal:i})}),r.on("error",n=>{t(n)}),r.stdin&&r.stdin.on("error",n=>{t(n)})});QS.exports={mergePromise:y2,getSpawnedPromise:b2}});var rE=v((yQ,tE)=>{"use strict";var eE=(r,e=[])=>Array.isArray(e)?[r,...e]:[r],v2=/^[\w.-]+$/,I2=/"/g,_2=r=>typeof r!="string"||v2.test(r)?r:`"${r.replace(I2,'\\"')}"`,A2=(r,e)=>eE(r,e).join(" "),w2=(r,e)=>eE(r,e).map(t=>_2(t)).join(" "),S2=/ +/g,E2=r=>{let e=[];for(let t of r.trim().split(S2)){let n=e[e.length-1];n&&n.endsWith("\\")?e[e.length-1]=`${n.slice(0,-1)} ${t}`:e.push(t)}return e};tE.exports={joinCommand:A2,getEscapedCommand:w2,parseCommand:E2}});var Dg=v((bQ,pa)=>{"use strict";var x2=H("path"),Cg=H("child_process"),P2=mS(),L2=gS(),$2=vS(),C2=wS(),ld=DS(),iE=MS(),{spawnedKill:D2,spawnedCancel:T2,setupTimeout:M2,validateTimeout:R2,setExitHandler:k2}=FS(),{handleInput:O2,getSpawnedResult:N2,makeAllStream:B2,validateInputSync:F2}=YS(),{mergePromise:nE,getSpawnedPromise:U2}=ZS(),{joinCommand:oE,parseCommand:sE,getEscapedCommand:aE}=rE(),W2=1e3*1e3*100,j2=({env:r,extendEnv:e,preferLocal:t,localDir:n,execPath:i})=>{let o=e?{...process.env,...r}:r;return t?$2.env({env:o,cwd:n,execPath:i}):o},cE=(r,e,t={})=>{let n=P2._parse(r,e,t);return r=n.command,e=n.args,t=n.options,t={maxBuffer:W2,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:t.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...t},t.env=j2(t),t.stdio=iE(t),process.platform==="win32"&&x2.basename(r,".exe")==="cmd"&&e.unshift("/q"),{file:r,args:e,options:t,parsed:n}},Au=(r,e,t)=>typeof e!="string"&&!Buffer.isBuffer(e)?t===void 0?void 0:"":r.stripFinalNewline?L2(e):e,pd=(r,e,t)=>{let n=cE(r,e,t),i=oE(r,e),o=aE(r,e);R2(n.options);let s;try{s=Cg.spawn(n.file,n.args,n.options)}catch(f){let h=new Cg.ChildProcess,m=Promise.reject(ld({error:f,stdout:"",stderr:"",all:"",command:i,escapedCommand:o,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return nE(h,m)}let a=U2(s),c=M2(s,n.options,a),u=k2(s,n.options,c),l={isCanceled:!1};s.kill=D2.bind(null,s.kill.bind(s)),s.cancel=T2.bind(null,s,l);let d=C2(async()=>{let[{error:f,exitCode:h,signal:m,timedOut:y},w,D,j]=await N2(s,n.options,u),X=Au(n.options,w),B=Au(n.options,D),Z=Au(n.options,j);if(f||h!==0||m!==null){let O=ld({error:f,exitCode:h,signal:m,stdout:X,stderr:B,all:Z,command:i,escapedCommand:o,parsed:n,timedOut:y,isCanceled:l.isCanceled,killed:s.killed});if(!n.options.reject)return O;throw O}return{command:i,escapedCommand:o,exitCode:0,stdout:X,stderr:B,all:Z,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return O2(s,n.options.input),s.all=B2(s,n.options),nE(s,d)};pa.exports=pd;pa.exports.sync=(r,e,t)=>{let n=cE(r,e,t),i=oE(r,e),o=aE(r,e);F2(n.options);let s;try{s=Cg.spawnSync(n.file,n.args,n.options)}catch(u){throw ld({error:u,stdout:"",stderr:"",all:"",command:i,escapedCommand:o,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}let a=Au(n.options,s.stdout,s.error),c=Au(n.options,s.stderr,s.error);if(s.error||s.status!==0||s.signal!==null){let u=ld({stdout:a,stderr:c,error:s.error,signal:s.signal,exitCode:s.status,command:i,escapedCommand:o,parsed:n,timedOut:s.error&&s.error.code==="ETIMEDOUT",isCanceled:!1,killed:s.signal!==null});if(!n.options.reject)return u;throw u}return{command:i,escapedCommand:o,exitCode:0,stdout:a,stderr:c,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};pa.exports.command=(r,e)=>{let[t,...n]=sE(r);return pd(t,n,e)};pa.exports.commandSync=(r,e)=>{let[t,...n]=sE(r);return pd.sync(t,n,e)};pa.exports.node=(r,e,t={})=>{e&&!Array.isArray(e)&&typeof e=="object"&&(t=e,e=[]);let n=iE.node(t),i=process.execArgv.filter(a=>!a.startsWith("--inspect")),{nodePath:o=process.execPath,nodeOptions:s=i}=t;return pd(o,[...s,r,...Array.isArray(e)?e:[]],{...t,stdin:void 0,stdout:void 0,stderr:void 0,stdio:n,shell:!1})}});var vE=v((_Q,Eu)=>{var yE={};yE.__wbindgen_placeholder__=Eu.exports;var Zr,{TextDecoder:z2}=H("util"),bE=new z2("utf-8",{ignoreBOM:!0,fatal:!0});bE.decode();var hd=null;function Bg(){return(hd===null||hd.buffer!==Zr.memory.buffer)&&(hd=new Uint8Array(Zr.memory.buffer)),hd}function J2(r,e){return bE.decode(Bg().subarray(r,r+e))}var Og=0;function gE(r,e){let t=e(r.length*1);return Bg().set(r,t/1),Og=r.length,t}var Ng=class r{static __wrap(e){let t=Object.create(r.prototype);return t.ptr=e,t}__destroy_into_raw(){let e=this.ptr;return this.ptr=0,e}free(){let e=this.__destroy_into_raw();Zr.__wbg_hasher_free(e)}constructor(){var e=Zr.hasher_new();return r.__wrap(e)}update(e){var t=gE(e,Zr.__wbindgen_malloc),n=Og;Zr.hasher_update(this.ptr,t,n)}digest(e){try{var t=gE(e,Zr.__wbindgen_malloc),n=Og;Zr.hasher_digest(this.ptr,t,n)}finally{e.set(Bg().subarray(t/1,t/1+n)),Zr.__wbindgen_free(t,n*1)}}};Eu.exports.Hasher=Ng;Eu.exports.__wbindgen_throw=function(r,e){throw new Error(J2(r,e))};var Y2=H("path").join(__dirname,"chromehash_bg.wasm"),Q2=H("fs").readFileSync(Y2),Z2=new WebAssembly.Module(Q2),ej=new WebAssembly.Instance(Z2,yE);Zr=ej.exports;Eu.exports.__wasm=Zr});var EE=v(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.shaHashFile=Cn.hashFile=Cn.shaHash=Cn.hash=void 0;var AE=vE(),wE=H("fs"),IE=H("string_decoder"),SE=H("crypto"),Hd=Buffer.alloc(4*5),tj=r=>{let e=new AE.Hasher;return e.update(oj(r)),e.digest(Hd),e.free(),Hd.toString("hex")};Cn.hash=tj;var rj=r=>{let e=(0,SE.createHash)("sha256");return e.update(sj(r)),e.digest("hex")};Cn.shaHash=rj;var nj=async(r,e=4096)=>{e%2===1&&e++;let t=Buffer.alloc(e),n=new AE.Hasher,i;try{i=await wE.promises.open(r,"r");let o=await i.read(t,0,t.length,null),s=t.slice(0,o.bytesRead);if(yd(s))for(n.update(s.slice(2));o.bytesRead===t.length;)o=await i.read(t,0,t.length,null),n.update(t.slice(0,o.bytesRead));else if(bd(s))for(n.update(s.slice(2).swap16());o.bytesRead===t.length;)o=await i.read(t,0,t.length,null),n.update(t.slice(0,o.bytesRead).swap16());else if(gd(s)){let a=new IE.StringDecoder("utf8");for(n.update(Buffer.from(a.write(s.slice(3)),"utf16le"));o.bytesRead===t.length;)o=await i.read(t,0,t.length,null),n.update(Buffer.from(a.write(t.slice(0,o.bytesRead)),"utf16le"))}else{let a=new IE.StringDecoder("utf8");for(n.update(Buffer.from(a.write(s),"utf16le"));o.bytesRead===t.length;)o=await i.read(t,0,t.length,null),n.update(Buffer.from(a.write(t.slice(0,o.bytesRead)),"utf16le"))}return n.digest(Hd),Hd.toString("hex")}finally{n.free(),i!==void 0&&await i.close()}};Cn.hashFile=nj;var md={stream:!0},ij=async(r,e=4096)=>{e%2===1&&e++;let t=Buffer.alloc(e),n=(0,SE.createHash)("sha256"),i;try{i=await wE.promises.open(r,"r");let o=await i.read(t,0,t.length,null),s=t.slice(0,o.bytesRead);if(yd(s)){let a=new TextDecoder("utf-16le");for(n.update(a.decode(s.slice(2),md));o.bytesRead>0;)o=await i.read(t,0,t.length,null),n.update(a.decode(t.slice(0,o.bytesRead),md))}else if(bd(s)){let a=new TextDecoder("utf-16be");for(n.update(a.decode(s.slice(2),md));o.bytesRead>0;)o=await i.read(t,0,t.length,null),n.update(a.decode(t.slice(0,o.bytesRead),md))}else if(gd(s))for(n.update(s.slice(3));o.bytesRead>0;)o=await i.read(t,0,t.length,null),n.update(t.slice(0,o.bytesRead));else for(n.update(s);o.bytesRead>0;)o=await i.read(t,0,t.length,null),n.update(t.slice(0,o.bytesRead));return n.digest("hex")}finally{await i?.close()}};Cn.shaHashFile=ij;var gd=r=>r.length>=3&&r[0]===239&&r[1]===187&&r[2]===191,yd=r=>r.length>=2&&r[0]===255&&r[1]===254,bd=r=>r.length>=2&&r[0]===254&&r[1]===255,oj=r=>gd(r)?_E(r.slice(3)):yd(r)?r.slice(2):bd(r)?r.slice(2).swap16():_E(r),sj=r=>gd(r)?r.slice(3):yd(r)?new TextEncoder().encode(new TextDecoder("utf-16le").decode(r.slice(2))):bd(r)?new TextEncoder().encode(new TextDecoder("utf-16be").decode(r.slice(2))):r,_E=r=>Buffer.from(r.toString("utf8"),"utf16le")});var mf=v($r=>{"use strict";$r.isInteger=r=>typeof r=="number"?Number.isInteger(r):typeof r=="string"&&r.trim()!==""?Number.isInteger(Number(r)):!1;$r.find=(r,e)=>r.nodes.find(t=>t.type===e);$r.exceedsLimit=(r,e,t=1,n)=>n===!1||!$r.isInteger(r)||!$r.isInteger(e)?!1:(Number(e)-Number(r))/Number(t)>=n;$r.escapeNode=(r,e=0,t)=>{let n=r.nodes[e];n&&(t&&n.type===t||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};$r.encloseBrace=r=>r.type!=="brace"||r.commas>>0+r.ranges>>0?!1:(r.invalid=!0,!0);$r.isInvalidBrace=r=>r.type!=="brace"?!1:r.invalid===!0||r.dollar?!0:!(r.commas>>0+r.ranges>>0)||r.open!==!0||r.close!==!0?(r.invalid=!0,!0):!1;$r.isOpenOrClose=r=>r.type==="open"||r.type==="close"?!0:r.open===!0||r.close===!0;$r.reduce=r=>r.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);$r.flatten=(...r)=>{let e=[],t=n=>{for(let i=0;i<n.length;i++){let o=n[i];if(Array.isArray(o)){t(o);continue}o!==void 0&&e.push(o)}return e};return t(r),e}});var Hf=v((jte,Nx)=>{"use strict";var Ox=mf();Nx.exports=(r,e={})=>{let t=(n,i={})=>{let o=e.escapeInvalid&&Ox.isInvalidBrace(i),s=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(o||s)&&Ox.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=t(c);return a};return t(r)}});var Fx=v((Vte,Bx)=>{"use strict";Bx.exports=function(r){return typeof r=="number"?r-r===0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}});var zx=v((qte,Xx)=>{"use strict";var Ux=Fx(),ss=(r,e,t)=>{if(Ux(r)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||r===e)return String(r);if(Ux(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...t};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let i=String(n.relaxZeros),o=String(n.shorthand),s=String(n.capture),a=String(n.wrap),c=r+":"+e+"="+i+o+s+a;if(ss.cache.hasOwnProperty(c))return ss.cache[c].result;let u=Math.min(r,e),l=Math.max(r,e);if(Math.abs(u-l)===1){let m=r+"|"+e;return n.capture?`(${m})`:n.wrap===!1?m:`(?:${m})`}let p=Kx(r)||Kx(e),d={min:r,max:e,a:u,b:l},f=[],h=[];if(p&&(d.isPadded=p,d.maxLen=String(d.max).length),u<0){let m=l<0?Math.abs(l):1;h=Wx(m,Math.abs(u),d,n),u=d.a=0}return l>=0&&(f=Wx(u,l,d,n)),d.negatives=h,d.positives=f,d.result=rq(h,f,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&f.length+h.length>1&&(d.result=`(?:${d.result})`),ss.cache[c]=d,d.result};function rq(r,e,t){let n=$y(r,e,"-",!1,t)||[],i=$y(e,r,"",!1,t)||[],o=$y(r,e,"-?",!0,t)||[];return n.concat(o).concat(i).join("|")}function nq(r,e){let t=1,n=1,i=Vx(r,t),o=new Set([e]);for(;r<=i&&i<=e;)o.add(i),t+=1,i=Vx(r,t);for(i=qx(e+1,n)-1;r<i&&i<=e;)o.add(i),n+=1,i=qx(e+1,n)-1;return o=[...o],o.sort(sq),o}function iq(r,e,t){if(r===e)return{pattern:r,count:[],digits:0};let n=oq(r,e),i=n.length,o="",s=0;for(let a=0;a<i;a++){let[c,u]=n[a];c===u?o+=c:c!=="0"||u!=="9"?o+=aq(c,u,t):s++}return s&&(o+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:o,count:[s],digits:i}}function Wx(r,e,t,n){let i=nq(r,e),o=[],s=r,a;for(let c=0;c<i.length;c++){let u=i[c],l=iq(String(s),String(u),n),p="";if(!t.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+Gx(a.count),s=u+1;continue}t.isPadded&&(p=cq(u,t,n)),l.string=p+l.pattern+Gx(l.count),o.push(l),s=u+1,a=l}return o}function $y(r,e,t,n,i){let o=[];for(let s of r){let{string:a}=s;!n&&!jx(e,"string",a)&&o.push(t+a),n&&jx(e,"string",a)&&o.push(t+a)}return o}function oq(r,e){let t=[];for(let n=0;n<r.length;n++)t.push([r[n],e[n]]);return t}function sq(r,e){return r>e?1:e>r?-1:0}function jx(r,e,t){return r.some(n=>n[e]===t)}function Vx(r,e){return Number(String(r).slice(0,-e)+"9".repeat(e))}function qx(r,e){return r-r%Math.pow(10,e)}function Gx(r){let[e=0,t=""]=r;return t||e>1?`{${e+(t?","+t:"")}}`:""}function aq(r,e,t){return`[${r}${e-r===1?"":"-"}${e}]`}function Kx(r){return/^-?(0+)\d/.test(r)}function cq(r,e,t){if(!e.isPadded)return r;let n=Math.abs(e.maxLen-String(r).length),i=t.relaxZeros!==!1;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}ss.cache={};ss.clearCache=()=>ss.cache={};Xx.exports=ss});var Ty=v((Gte,rP)=>{"use strict";var uq=H("util"),Yx=zx(),Jx=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),lq=r=>e=>r===!0?Number(e):String(e),Cy=r=>typeof r=="number"||typeof r=="string"&&r!=="",Yu=r=>Number.isInteger(+r),Dy=r=>{let e=`${r}`,t=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++t]==="0";);return t>0},pq=(r,e,t)=>typeof r=="string"||typeof e=="string"?!0:t.stringify===!0,dq=(r,e,t)=>{if(e>0){let n=r[0]==="-"?"-":"";n&&(r=r.slice(1)),r=n+r.padStart(n?e-1:e,"0")}return t===!1?String(r):r},yf=(r,e)=>{let t=r[0]==="-"?"-":"";for(t&&(r=r.slice(1),e--);r.length<e;)r="0"+r;return t?"-"+r:r},fq=(r,e,t)=>{r.negatives.sort((a,c)=>a<c?-1:a>c?1:0),r.positives.sort((a,c)=>a<c?-1:a>c?1:0);let n=e.capture?"":"?:",i="",o="",s;return r.positives.length&&(i=r.positives.map(a=>yf(String(a),t)).join("|")),r.negatives.length&&(o=`-(${n}${r.negatives.map(a=>yf(String(a),t)).join("|")})`),i&&o?s=`${i}|${o}`:s=i||o,e.wrap?`(${n}${s})`:s},Qx=(r,e,t,n)=>{if(t)return Yx(r,e,{wrap:!1,...n});let i=String.fromCharCode(r);if(r===e)return i;let o=String.fromCharCode(e);return`[${i}-${o}]`},Zx=(r,e,t)=>{if(Array.isArray(r)){let n=t.wrap===!0,i=t.capture?"":"?:";return n?`(${i}${r.join("|")})`:r.join("|")}return Yx(r,e,t)},eP=(...r)=>new RangeError("Invalid range arguments: "+uq.inspect(...r)),tP=(r,e,t)=>{if(t.strictRanges===!0)throw eP([r,e]);return[]},hq=(r,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${r}" to be a number`);return[]},mq=(r,e,t=1,n={})=>{let i=Number(r),o=Number(e);if(!Number.isInteger(i)||!Number.isInteger(o)){if(n.strictRanges===!0)throw eP([r,e]);return[]}i===0&&(i=0),o===0&&(o=0);let s=i>o,a=String(r),c=String(e),u=String(t);t=Math.max(Math.abs(t),1);let l=Dy(a)||Dy(c)||Dy(u),p=l?Math.max(a.length,c.length,u.length):0,d=l===!1&&pq(r,e,n)===!1,f=n.transform||lq(d);if(n.toRegex&&t===1)return Qx(yf(r,p),yf(e,p),!0,n);let h={negatives:[],positives:[]},m=D=>h[D<0?"negatives":"positives"].push(Math.abs(D)),y=[],w=0;for(;s?i>=o:i<=o;)n.toRegex===!0&&t>1?m(i):y.push(dq(f(i,w),p,d)),i=s?i-t:i+t,w++;return n.toRegex===!0?t>1?fq(h,n,p):Zx(y,null,{wrap:!1,...n}):y},Hq=(r,e,t=1,n={})=>{if(!Yu(r)&&r.length>1||!Yu(e)&&e.length>1)return tP(r,e,n);let i=n.transform||(d=>String.fromCharCode(d)),o=`${r}`.charCodeAt(0),s=`${e}`.charCodeAt(0),a=o>s,c=Math.min(o,s),u=Math.max(o,s);if(n.toRegex&&t===1)return Qx(c,u,!1,n);let l=[],p=0;for(;a?o>=s:o<=s;)l.push(i(o,p)),o=a?o-t:o+t,p++;return n.toRegex===!0?Zx(l,null,{wrap:!1,options:n}):l},gf=(r,e,t,n={})=>{if(e==null&&Cy(r))return[r];if(!Cy(r)||!Cy(e))return tP(r,e,n);if(typeof t=="function")return gf(r,e,1,{transform:t});if(Jx(t))return gf(r,e,0,t);let i={...n};return i.capture===!0&&(i.wrap=!0),t=t||i.step||1,Yu(t)?Yu(r)&&Yu(e)?mq(r,e,t,i):Hq(r,e,Math.max(Math.abs(t),1),i):t!=null&&!Jx(t)?hq(t,i):gf(r,e,1,t)};rP.exports=gf});var oP=v((Kte,iP)=>{"use strict";var gq=Ty(),nP=mf(),yq=(r,e={})=>{let t=(n,i={})=>{let o=nP.isInvalidBrace(i),s=n.invalid===!0&&e.escapeInvalid===!0,a=o===!0||s===!0,c=e.escapeInvalid===!0?"\\":"",u="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=nP.reduce(n.nodes),p=gq(...l,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(p.length!==0)return l.length>1&&p.length>1?`(${p})`:p}if(n.nodes)for(let l of n.nodes)u+=t(l,n);return u};return t(r)};iP.exports=yq});var cP=v((Xte,aP)=>{"use strict";var bq=Ty(),sP=Hf(),Ua=mf(),as=(r="",e="",t=!1)=>{let n=[];if(r=[].concat(r),e=[].concat(e),!e.length)return r;if(!r.length)return t?Ua.flatten(e).map(i=>`{${i}}`):e;for(let i of r)if(Array.isArray(i))for(let o of i)n.push(as(o,e,t));else for(let o of e)t===!0&&typeof o=="string"&&(o=`{${o}}`),n.push(Array.isArray(o)?as(i,o,t):i+o);return Ua.flatten(n)},vq=(r,e={})=>{let t=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(i,o={})=>{i.queue=[];let s=o,a=o.queue;for(;s.type!=="brace"&&s.type!=="root"&&s.parent;)s=s.parent,a=s.queue;if(i.invalid||i.dollar){a.push(as(a.pop(),sP(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(as(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let p=Ua.reduce(i.nodes);if(Ua.exceedsLimit(...p,e.step,t))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let d=bq(...p,e);d.length===0&&(d=sP(i,e)),a.push(as(a.pop(),d)),i.nodes=[];return}let c=Ua.encloseBrace(i),u=i.queue,l=i;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,u=l.queue;for(let p=0;p<i.nodes.length;p++){let d=i.nodes[p];if(d.type==="comma"&&i.type==="brace"){p===1&&u.push(""),u.push("");continue}if(d.type==="close"){a.push(as(a.pop(),u,c));continue}if(d.value&&d.type!=="open"){u.push(as(u.pop(),d.value));continue}d.nodes&&n(d,i)}return u};return Ua.flatten(n(r))};aP.exports=vq});var lP=v((zte,uP)=>{"use strict";uP.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var mP=v((Jte,hP)=>{"use strict";var Iq=Hf(),{MAX_LENGTH:pP,CHAR_BACKSLASH:My,CHAR_BACKTICK:_q,CHAR_COMMA:Aq,CHAR_DOT:wq,CHAR_LEFT_PARENTHESES:Sq,CHAR_RIGHT_PARENTHESES:Eq,CHAR_LEFT_CURLY_BRACE:xq,CHAR_RIGHT_CURLY_BRACE:Pq,CHAR_LEFT_SQUARE_BRACKET:dP,CHAR_RIGHT_SQUARE_BRACKET:fP,CHAR_DOUBLE_QUOTE:Lq,CHAR_SINGLE_QUOTE:$q,CHAR_NO_BREAK_SPACE:Cq,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Dq}=lP(),Tq=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},n=typeof t.maxLength=="number"?Math.min(pP,t.maxLength):pP;if(r.length>n)throw new SyntaxError(`Input length (${r.length}), exceeds max characters (${n})`);let i={type:"root",input:r,nodes:[]},o=[i],s=i,a=i,c=0,u=r.length,l=0,p=0,d,f=()=>r[l++],h=m=>{if(m.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&m.type==="text"){a.value+=m.value;return}return s.nodes.push(m),m.parent=s,m.prev=a,a=m,m};for(h({type:"bos"});l<u;)if(s=o[o.length-1],d=f(),!(d===Dq||d===Cq)){if(d===My){h({type:"text",value:(e.keepEscaping?d:"")+f()});continue}if(d===fP){h({type:"text",value:"\\"+d});continue}if(d===dP){c++;let m;for(;l<u&&(m=f());){if(d+=m,m===dP){c++;continue}if(m===My){d+=f();continue}if(m===fP&&(c--,c===0))break}h({type:"text",value:d});continue}if(d===Sq){s=h({type:"paren",nodes:[]}),o.push(s),h({type:"text",value:d});continue}if(d===Eq){if(s.type!=="paren"){h({type:"text",value:d});continue}s=o.pop(),h({type:"text",value:d}),s=o[o.length-1];continue}if(d===Lq||d===$q||d===_q){let m=d,y;for(e.keepQuotes!==!0&&(d="");l<u&&(y=f());){if(y===My){d+=y+f();continue}if(y===m){e.keepQuotes===!0&&(d+=y);break}d+=y}h({type:"text",value:d});continue}if(d===xq){p++;let y={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||s.dollar===!0,depth:p,commas:0,ranges:0,nodes:[]};s=h(y),o.push(s),h({type:"open",value:d});continue}if(d===Pq){if(s.type!=="brace"){h({type:"text",value:d});continue}let m="close";s=o.pop(),s.close=!0,h({type:m,value:d}),p--,s=o[o.length-1];continue}if(d===Aq&&p>0){if(s.ranges>0){s.ranges=0;let m=s.nodes.shift();s.nodes=[m,{type:"text",value:Iq(s)}]}h({type:"comma",value:d}),s.commas++;continue}if(d===wq&&p>0&&s.commas===0){let m=s.nodes;if(p===0||m.length===0){h({type:"text",value:d});continue}if(a.type==="dot"){if(s.range=[],a.value+=d,a.type="range",s.nodes.length!==3&&s.nodes.length!==5){s.invalid=!0,s.ranges=0,a.type="text";continue}s.ranges++,s.args=[];continue}if(a.type==="range"){m.pop();let y=m[m.length-1];y.value+=a.value+d,a=y,s.ranges--;continue}h({type:"dot",value:d});continue}h({type:"text",value:d})}do if(s=o.pop(),s.type!=="root"){s.nodes.forEach(w=>{w.nodes||(w.type==="open"&&(w.isOpen=!0),w.type==="close"&&(w.isClose=!0),w.nodes||(w.type="text"),w.invalid=!0)});let m=o[o.length-1],y=m.nodes.indexOf(s);m.nodes.splice(y,1,...s.nodes)}while(o.length>0);return h({type:"eos"}),i};hP.exports=Tq});var yP=v((Yte,gP)=>{"use strict";var HP=Hf(),Mq=oP(),Rq=cP(),kq=mP(),ar=(r,e={})=>{let t=[];if(Array.isArray(r))for(let n of r){let i=ar.create(n,e);Array.isArray(i)?t.push(...i):t.push(i)}else t=[].concat(ar.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};ar.parse=(r,e={})=>kq(r,e);ar.stringify=(r,e={})=>HP(typeof r=="string"?ar.parse(r,e):r,e);ar.compile=(r,e={})=>(typeof r=="string"&&(r=ar.parse(r,e)),Mq(r,e));ar.expand=(r,e={})=>{typeof r=="string"&&(r=ar.parse(r,e));let t=Rq(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};ar.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?ar.compile(r,e):ar.expand(r,e);gP.exports=ar});var Qu=v((Qte,AP)=>{"use strict";var Oq=H("path"),Vn="\\\\/",bP=`[^${Vn}]`,bi="\\.",Nq="\\+",Bq="\\?",bf="\\/",Fq="(?=.)",vP="[^/]",Ry=`(?:${bf}|$)`,IP=`(?:^|${bf})`,ky=`${bi}{1,2}${Ry}`,Uq=`(?!${bi})`,Wq=`(?!${IP}${ky})`,jq=`(?!${bi}{0,1}${Ry})`,Vq=`(?!${ky})`,qq=`[^.${bf}]`,Gq=`${vP}*?`,_P={DOT_LITERAL:bi,PLUS_LITERAL:Nq,QMARK_LITERAL:Bq,SLASH_LITERAL:bf,ONE_CHAR:Fq,QMARK:vP,END_ANCHOR:Ry,DOTS_SLASH:ky,NO_DOT:Uq,NO_DOTS:Wq,NO_DOT_SLASH:jq,NO_DOTS_SLASH:Vq,QMARK_NO_DOT:qq,STAR:Gq,START_ANCHOR:IP},Kq={..._P,SLASH_LITERAL:`[${Vn}]`,QMARK:bP,STAR:`${bP}*?`,DOTS_SLASH:`${bi}{1,2}(?:[${Vn}]|$)`,NO_DOT:`(?!${bi})`,NO_DOTS:`(?!(?:^|[${Vn}])${bi}{1,2}(?:[${Vn}]|$))`,NO_DOT_SLASH:`(?!${bi}{0,1}(?:[${Vn}]|$))`,NO_DOTS_SLASH:`(?!${bi}{1,2}(?:[${Vn}]|$))`,QMARK_NO_DOT:`[^.${Vn}]`,START_ANCHOR:`(?:^|[${Vn}])`,END_ANCHOR:`(?:[${Vn}]|$)`},Xq={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};AP.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Xq,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Oq.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?Kq:_P}}});var Zu=v(Qt=>{"use strict";var zq=H("path"),Jq=process.platform==="win32",{REGEX_BACKSLASH:Yq,REGEX_REMOVE_BACKSLASH:Qq,REGEX_SPECIAL_CHARS:Zq,REGEX_SPECIAL_CHARS_GLOBAL:e8}=Qu();Qt.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);Qt.hasRegexChars=r=>Zq.test(r);Qt.isRegexChar=r=>r.length===1&&Qt.hasRegexChars(r);Qt.escapeRegex=r=>r.replace(e8,"\\$1");Qt.toPosixSlashes=r=>r.replace(Yq,"/");Qt.removeBackslashes=r=>r.replace(Qq,e=>e==="\\"?"":e);Qt.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};Qt.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:Jq===!0||zq.sep==="\\";Qt.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?Qt.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};Qt.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};Qt.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",i=t.contains?"":"$",o=`${n}(?:${r})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o}});var CP=v((ere,$P)=>{"use strict";var wP=Zu(),{CHAR_ASTERISK:Oy,CHAR_AT:t8,CHAR_BACKWARD_SLASH:el,CHAR_COMMA:r8,CHAR_DOT:Ny,CHAR_EXCLAMATION_MARK:By,CHAR_FORWARD_SLASH:LP,CHAR_LEFT_CURLY_BRACE:Fy,CHAR_LEFT_PARENTHESES:Uy,CHAR_LEFT_SQUARE_BRACKET:n8,CHAR_PLUS:i8,CHAR_QUESTION_MARK:SP,CHAR_RIGHT_CURLY_BRACE:o8,CHAR_RIGHT_PARENTHESES:EP,CHAR_RIGHT_SQUARE_BRACKET:s8}=Qu(),xP=r=>r===LP||r===el,PP=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},a8=(r,e)=>{let t=e||{},n=r.length-1,i=t.parts===!0||t.scanToEnd===!0,o=[],s=[],a=[],c=r,u=-1,l=0,p=0,d=!1,f=!1,h=!1,m=!1,y=!1,w=!1,D=!1,j=!1,X=!1,B=!1,Z=0,O,G,re={value:"",depth:0,isGlob:!1},xe=()=>u>=n,$=()=>c.charCodeAt(u+1),Pe=()=>(O=G,c.charCodeAt(++u));for(;u<n;){G=Pe();let pt;if(G===el){D=re.backslashes=!0,G=Pe(),G===Fy&&(w=!0);continue}if(w===!0||G===Fy){for(Z++;xe()!==!0&&(G=Pe());){if(G===el){D=re.backslashes=!0,Pe();continue}if(G===Fy){Z++;continue}if(w!==!0&&G===Ny&&(G=Pe())===Ny){if(d=re.isBrace=!0,h=re.isGlob=!0,B=!0,i===!0)continue;break}if(w!==!0&&G===r8){if(d=re.isBrace=!0,h=re.isGlob=!0,B=!0,i===!0)continue;break}if(G===o8&&(Z--,Z===0)){w=!1,d=re.isBrace=!0,B=!0;break}}if(i===!0)continue;break}if(G===LP){if(o.push(u),s.push(re),re={value:"",depth:0,isGlob:!1},B===!0)continue;if(O===Ny&&u===l+1){l+=2;continue}p=u+1;continue}if(t.noext!==!0&&(G===i8||G===t8||G===Oy||G===SP||G===By)===!0&&$()===Uy){if(h=re.isGlob=!0,m=re.isExtglob=!0,B=!0,G===By&&u===l&&(X=!0),i===!0){for(;xe()!==!0&&(G=Pe());){if(G===el){D=re.backslashes=!0,G=Pe();continue}if(G===EP){h=re.isGlob=!0,B=!0;break}}continue}break}if(G===Oy){if(O===Oy&&(y=re.isGlobstar=!0),h=re.isGlob=!0,B=!0,i===!0)continue;break}if(G===SP){if(h=re.isGlob=!0,B=!0,i===!0)continue;break}if(G===n8){for(;xe()!==!0&&(pt=Pe());){if(pt===el){D=re.backslashes=!0,Pe();continue}if(pt===s8){f=re.isBracket=!0,h=re.isGlob=!0,B=!0;break}}if(i===!0)continue;break}if(t.nonegate!==!0&&G===By&&u===l){j=re.negated=!0,l++;continue}if(t.noparen!==!0&&G===Uy){if(h=re.isGlob=!0,i===!0){for(;xe()!==!0&&(G=Pe());){if(G===Uy){D=re.backslashes=!0,G=Pe();continue}if(G===EP){B=!0;break}}continue}break}if(h===!0){if(B=!0,i===!0)continue;break}}t.noext===!0&&(m=!1,h=!1);let _e=c,Kr="",x="";l>0&&(Kr=c.slice(0,l),c=c.slice(l),p-=l),_e&&h===!0&&p>0?(_e=c.slice(0,p),x=c.slice(p)):h===!0?(_e="",x=c):_e=c,_e&&_e!==""&&_e!=="/"&&_e!==c&&xP(_e.charCodeAt(_e.length-1))&&(_e=_e.slice(0,-1)),t.unescape===!0&&(x&&(x=wP.removeBackslashes(x)),_e&&D===!0&&(_e=wP.removeBackslashes(_e)));let P={prefix:Kr,input:r,start:l,base:_e,glob:x,isBrace:d,isBracket:f,isGlob:h,isExtglob:m,isGlobstar:y,negated:j,negatedExtglob:X};if(t.tokens===!0&&(P.maxDepth=0,xP(G)||s.push(re),P.tokens=s),t.parts===!0||t.tokens===!0){let pt;for(let le=0;le<o.length;le++){let tr=pt?pt+1:l,rr=o[le],St=r.slice(tr,rr);t.tokens&&(le===0&&l!==0?(s[le].isPrefix=!0,s[le].value=Kr):s[le].value=St,PP(s[le]),P.maxDepth+=s[le].depth),(le!==0||St!=="")&&a.push(St),pt=rr}if(pt&&pt+1<r.length){let le=r.slice(pt+1);a.push(le),t.tokens&&(s[s.length-1].value=le,PP(s[s.length-1]),P.maxDepth+=s[s.length-1].depth)}P.slashes=o,P.parts=a}return P};$P.exports=a8});var MP=v((tre,TP)=>{"use strict";var vf=Qu(),cr=Zu(),{MAX_LENGTH:If,POSIX_REGEX_SOURCE:c8,REGEX_NON_SPECIAL_CHARS:u8,REGEX_SPECIAL_CHARS_BACKREF:l8,REPLACEMENTS:DP}=vf,p8=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch{return r.map(i=>cr.escapeRegex(i)).join("..")}return t},Wa=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,Wy=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=DP[r]||r;let t={...e},n=typeof t.maxLength=="number"?Math.min(If,t.maxLength):If,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:t.prepend||""},s=[o],a=t.capture?"":"?:",c=cr.isWindows(e),u=vf.globChars(c),l=vf.extglobChars(u),{DOT_LITERAL:p,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:h,DOTS_SLASH:m,NO_DOT:y,NO_DOT_SLASH:w,NO_DOTS_SLASH:D,QMARK:j,QMARK_NO_DOT:X,STAR:B,START_ANCHOR:Z}=u,O=F=>`(${a}(?:(?!${Z}${F.dot?m:p}).)*?)`,G=t.dot?"":y,re=t.dot?j:X,xe=t.bash===!0?O(t):B;t.capture&&(xe=`(${xe})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let $={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};r=cr.removePrefix(r,$),i=r.length;let Pe=[],_e=[],Kr=[],x=o,P,pt=()=>$.index===i-1,le=$.peek=(F=1)=>r[$.index+F],tr=$.advance=()=>r[++$.index]||"",rr=()=>r.slice($.index+1),St=(F="",ae=0)=>{$.consumed+=F,$.index+=ae},ee=F=>{$.output+=F.output!=null?F.output:F.value,St(F.value)},Ri=()=>{let F=1;for(;le()==="!"&&(le(2)!=="("||le(3)==="?");)tr(),$.start++,F++;return F%2===0?!1:($.negated=!0,$.start++,!0)},Gs=F=>{$[F]++,Kr.push(F)},be=F=>{$[F]--,Kr.pop()},oe=F=>{if(x.type==="globstar"){let ae=$.braces>0&&(F.type==="comma"||F.type==="brace"),k=F.extglob===!0||Pe.length&&(F.type==="pipe"||F.type==="paren");F.type!=="slash"&&F.type!=="paren"&&!ae&&!k&&($.output=$.output.slice(0,-x.output.length),x.type="star",x.value="*",x.output=xe,$.output+=x.output)}if(Pe.length&&F.type!=="paren"&&(Pe[Pe.length-1].inner+=F.value),(F.value||F.output)&&ee(F),x&&x.type==="text"&&F.type==="text"){x.output=(x.output||x.value)+F.value,x.value+=F.value;return}F.prev=x,s.push(F),x=F},Ks=(F,ae)=>{let k={...l[ae],conditions:1,inner:""};k.prev=x,k.parens=$.parens,k.output=$.output;let te=(t.capture?"(":"")+k.open;Gs("parens"),oe({type:F,value:ae,output:$.output?"":h}),oe({type:"paren",extglob:!0,value:tr(),output:te}),Pe.push(k)},hp=F=>{let ae=F.close+(t.capture?")":""),k;if(F.type==="negate"){let te=xe;if(F.inner&&F.inner.length>1&&F.inner.includes("/")&&(te=O(t)),(te!==xe||pt()||/^\)+$/.test(rr()))&&(ae=F.close=`)$))${te}`),F.inner.includes("*")&&(k=rr())&&/^\.[^\\/.]+$/.test(k)){let Le=Wy(k,{...e,fastpaths:!1}).output;ae=F.close=`)${Le})${te})`}F.prev.type==="bos"&&($.negatedExtglob=!0)}oe({type:"paren",extglob:!0,value:P,output:ae}),be("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let F=!1,ae=r.replace(l8,(k,te,Le,vt,Ue,Xs)=>vt==="\\"?(F=!0,k):vt==="?"?te?te+vt+(Ue?j.repeat(Ue.length):""):Xs===0?re+(Ue?j.repeat(Ue.length):""):j.repeat(Le.length):vt==="."?p.repeat(Le.length):vt==="*"?te?te+vt+(Ue?xe:""):xe:te?k:`\\${k}`);return F===!0&&(t.unescape===!0?ae=ae.replace(/\\/g,""):ae=ae.replace(/\\+/g,k=>k.length%2===0?"\\\\":k?"\\":"")),ae===r&&t.contains===!0?($.output=r,$):($.output=cr.wrapOutput(ae,$,e),$)}for(;!pt();){if(P=tr(),P==="\0")continue;if(P==="\\"){let k=le();if(k==="/"&&t.bash!==!0||k==="."||k===";")continue;if(!k){P+="\\",oe({type:"text",value:P});continue}let te=/^\\+/.exec(rr()),Le=0;if(te&&te[0].length>2&&(Le=te[0].length,$.index+=Le,Le%2!==0&&(P+="\\")),t.unescape===!0?P=tr():P+=tr(),$.brackets===0){oe({type:"text",value:P});continue}}if($.brackets>0&&(P!=="]"||x.value==="["||x.value==="[^")){if(t.posix!==!1&&P===":"){let k=x.value.slice(1);if(k.includes("[")&&(x.posix=!0,k.includes(":"))){let te=x.value.lastIndexOf("["),Le=x.value.slice(0,te),vt=x.value.slice(te+2),Ue=c8[vt];if(Ue){x.value=Le+Ue,$.backtrack=!0,tr(),!o.output&&s.indexOf(x)===1&&(o.output=h);continue}}}(P==="["&&le()!==":"||P==="-"&&le()==="]")&&(P=`\\${P}`),P==="]"&&(x.value==="["||x.value==="[^")&&(P=`\\${P}`),t.posix===!0&&P==="!"&&x.value==="["&&(P="^"),x.value+=P,ee({value:P});continue}if($.quotes===1&&P!=='"'){P=cr.escapeRegex(P),x.value+=P,ee({value:P});continue}if(P==='"'){$.quotes=$.quotes===1?0:1,t.keepQuotes===!0&&oe({type:"text",value:P});continue}if(P==="("){Gs("parens"),oe({type:"paren",value:P});continue}if(P===")"){if($.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Wa("opening","("));let k=Pe[Pe.length-1];if(k&&$.parens===k.parens+1){hp(Pe.pop());continue}oe({type:"paren",value:P,output:$.parens?")":"\\)"}),be("parens");continue}if(P==="["){if(t.nobracket===!0||!rr().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Wa("closing","]"));P=`\\${P}`}else Gs("brackets");oe({type:"bracket",value:P});continue}if(P==="]"){if(t.nobracket===!0||x&&x.type==="bracket"&&x.value.length===1){oe({type:"text",value:P,output:`\\${P}`});continue}if($.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Wa("opening","["));oe({type:"text",value:P,output:`\\${P}`});continue}be("brackets");let k=x.value.slice(1);if(x.posix!==!0&&k[0]==="^"&&!k.includes("/")&&(P=`/${P}`),x.value+=P,ee({value:P}),t.literalBrackets===!1||cr.hasRegexChars(k))continue;let te=cr.escapeRegex(x.value);if($.output=$.output.slice(0,-x.value.length),t.literalBrackets===!0){$.output+=te,x.value=te;continue}x.value=`(${a}${te}|${x.value})`,$.output+=x.value;continue}if(P==="{"&&t.nobrace!==!0){Gs("braces");let k={type:"brace",value:P,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};_e.push(k),oe(k);continue}if(P==="}"){let k=_e[_e.length-1];if(t.nobrace===!0||!k){oe({type:"text",value:P,output:P});continue}let te=")";if(k.dots===!0){let Le=s.slice(),vt=[];for(let Ue=Le.length-1;Ue>=0&&(s.pop(),Le[Ue].type!=="brace");Ue--)Le[Ue].type!=="dots"&&vt.unshift(Le[Ue].value);te=p8(vt,t),$.backtrack=!0}if(k.comma!==!0&&k.dots!==!0){let Le=$.output.slice(0,k.outputIndex),vt=$.tokens.slice(k.tokensIndex);k.value=k.output="\\{",P=te="\\}",$.output=Le;for(let Ue of vt)$.output+=Ue.output||Ue.value}oe({type:"brace",value:P,output:te}),be("braces"),_e.pop();continue}if(P==="|"){Pe.length>0&&Pe[Pe.length-1].conditions++,oe({type:"text",value:P});continue}if(P===","){let k=P,te=_e[_e.length-1];te&&Kr[Kr.length-1]==="braces"&&(te.comma=!0,k="|"),oe({type:"comma",value:P,output:k});continue}if(P==="/"){if(x.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",s.pop(),x=o;continue}oe({type:"slash",value:P,output:f});continue}if(P==="."){if($.braces>0&&x.type==="dot"){x.value==="."&&(x.output=p);let k=_e[_e.length-1];x.type="dots",x.output+=P,x.value+=P,k.dots=!0;continue}if($.braces+$.parens===0&&x.type!=="bos"&&x.type!=="slash"){oe({type:"text",value:P,output:p});continue}oe({type:"dot",value:P,output:p});continue}if(P==="?"){if(!(x&&x.value==="(")&&t.noextglob!==!0&&le()==="("&&le(2)!=="?"){Ks("qmark",P);continue}if(x&&x.type==="paren"){let te=le(),Le=P;if(te==="<"&&!cr.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(x.value==="("&&!/[!=<:]/.test(te)||te==="<"&&!/<([!=]|\w+>)/.test(rr()))&&(Le=`\\${P}`),oe({type:"text",value:P,output:Le});continue}if(t.dot!==!0&&(x.type==="slash"||x.type==="bos")){oe({type:"qmark",value:P,output:X});continue}oe({type:"qmark",value:P,output:j});continue}if(P==="!"){if(t.noextglob!==!0&&le()==="("&&(le(2)!=="?"||!/[!=<:]/.test(le(3)))){Ks("negate",P);continue}if(t.nonegate!==!0&&$.index===0){Ri();continue}}if(P==="+"){if(t.noextglob!==!0&&le()==="("&&le(2)!=="?"){Ks("plus",P);continue}if(x&&x.value==="("||t.regex===!1){oe({type:"plus",value:P,output:d});continue}if(x&&(x.type==="bracket"||x.type==="paren"||x.type==="brace")||$.parens>0){oe({type:"plus",value:P});continue}oe({type:"plus",value:d});continue}if(P==="@"){if(t.noextglob!==!0&&le()==="("&&le(2)!=="?"){oe({type:"at",extglob:!0,value:P,output:""});continue}oe({type:"text",value:P});continue}if(P!=="*"){(P==="$"||P==="^")&&(P=`\\${P}`);let k=u8.exec(rr());k&&(P+=k[0],$.index+=k[0].length),oe({type:"text",value:P});continue}if(x&&(x.type==="globstar"||x.star===!0)){x.type="star",x.star=!0,x.value+=P,x.output=xe,$.backtrack=!0,$.globstar=!0,St(P);continue}let F=rr();if(t.noextglob!==!0&&/^\([^?]/.test(F)){Ks("star",P);continue}if(x.type==="star"){if(t.noglobstar===!0){St(P);continue}let k=x.prev,te=k.prev,Le=k.type==="slash"||k.type==="bos",vt=te&&(te.type==="star"||te.type==="globstar");if(t.bash===!0&&(!Le||F[0]&&F[0]!=="/")){oe({type:"star",value:P,output:""});continue}let Ue=$.braces>0&&(k.type==="comma"||k.type==="brace"),Xs=Pe.length&&(k.type==="pipe"||k.type==="paren");if(!Le&&k.type!=="paren"&&!Ue&&!Xs){oe({type:"star",value:P,output:""});continue}for(;F.slice(0,3)==="/**";){let Mo=r[$.index+4];if(Mo&&Mo!=="/")break;F=F.slice(3),St("/**",3)}if(k.type==="bos"&&pt()){x.type="globstar",x.value+=P,x.output=O(t),$.output=x.output,$.globstar=!0,St(P);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&!vt&&pt()){$.output=$.output.slice(0,-(k.output+x.output).length),k.output=`(?:${k.output}`,x.type="globstar",x.output=O(t)+(t.strictSlashes?")":"|$)"),x.value+=P,$.globstar=!0,$.output+=k.output+x.output,St(P);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&F[0]==="/"){let Mo=F[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(k.output+x.output).length),k.output=`(?:${k.output}`,x.type="globstar",x.output=`${O(t)}${f}|${f}${Mo})`,x.value+=P,$.output+=k.output+x.output,$.globstar=!0,St(P+tr()),oe({type:"slash",value:"/",output:""});continue}if(k.type==="bos"&&F[0]==="/"){x.type="globstar",x.value+=P,x.output=`(?:^|${f}|${O(t)}${f})`,$.output=x.output,$.globstar=!0,St(P+tr()),oe({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-x.output.length),x.type="globstar",x.output=O(t),x.value+=P,$.output+=x.output,$.globstar=!0,St(P);continue}let ae={type:"star",value:P,output:xe};if(t.bash===!0){ae.output=".*?",(x.type==="bos"||x.type==="slash")&&(ae.output=G+ae.output),oe(ae);continue}if(x&&(x.type==="bracket"||x.type==="paren")&&t.regex===!0){ae.output=P,oe(ae);continue}($.index===$.start||x.type==="slash"||x.type==="dot")&&(x.type==="dot"?($.output+=w,x.output+=w):t.dot===!0?($.output+=D,x.output+=D):($.output+=G,x.output+=G),le()!=="*"&&($.output+=h,x.output+=h)),oe(ae)}for(;$.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Wa("closing","]"));$.output=cr.escapeLast($.output,"["),be("brackets")}for(;$.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Wa("closing",")"));$.output=cr.escapeLast($.output,"("),be("parens")}for(;$.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Wa("closing","}"));$.output=cr.escapeLast($.output,"{"),be("braces")}if(t.strictSlashes!==!0&&(x.type==="star"||x.type==="bracket")&&oe({type:"maybe_slash",value:"",output:`${f}?`}),$.backtrack===!0){$.output="";for(let F of $.tokens)$.output+=F.output!=null?F.output:F.value,F.suffix&&($.output+=F.suffix)}return $};Wy.fastpaths=(r,e)=>{let t={...e},n=typeof t.maxLength=="number"?Math.min(If,t.maxLength):If,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);r=DP[r]||r;let o=cr.isWindows(e),{DOT_LITERAL:s,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:l,NO_DOTS:p,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:h}=vf.globChars(o),m=t.dot?p:l,y=t.dot?d:l,w=t.capture?"":"?:",D={negated:!1,prefix:""},j=t.bash===!0?".*?":f;t.capture&&(j=`(${j})`);let X=G=>G.noglobstar===!0?j:`(${w}(?:(?!${h}${G.dot?u:s}).)*?)`,B=G=>{switch(G){case"*":return`${m}${c}${j}`;case".*":return`${s}${c}${j}`;case"*.*":return`${m}${j}${s}${c}${j}`;case"*/*":return`${m}${j}${a}${c}${y}${j}`;case"**":return m+X(t);case"**/*":return`(?:${m}${X(t)}${a})?${y}${c}${j}`;case"**/*.*":return`(?:${m}${X(t)}${a})?${y}${j}${s}${c}${j}`;case"**/.*":return`(?:${m}${X(t)}${a})?${s}${c}${j}`;default:{let re=/^(.*?)\.(\w+)$/.exec(G);if(!re)return;let xe=B(re[1]);return xe?xe+s+re[2]:void 0}}},Z=cr.removePrefix(r,D),O=B(Z);return O&&t.strictSlashes!==!0&&(O+=`${a}?`),O};TP.exports=Wy});var kP=v((rre,RP)=>{"use strict";var d8=H("path"),f8=CP(),jy=MP(),Vy=Zu(),h8=Qu(),m8=r=>r&&typeof r=="object"&&!Array.isArray(r),Qe=(r,e,t=!1)=>{if(Array.isArray(r)){let l=r.map(d=>Qe(d,e,t));return d=>{for(let f of l){let h=f(d);if(h)return h}return!1}}let n=m8(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=Vy.isWindows(e),s=n?Qe.compileRe(r,e):Qe.makeRe(r,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let l={...e,ignore:null,onMatch:null,onResult:null};c=Qe(i.ignore,l,t)}let u=(l,p=!1)=>{let{isMatch:d,match:f,output:h}=Qe.test(l,s,e,{glob:r,posix:o}),m={glob:r,state:a,regex:s,posix:o,input:l,output:h,match:f,isMatch:d};return typeof i.onResult=="function"&&i.onResult(m),d===!1?(m.isMatch=!1,p?m:!1):c(l)?(typeof i.onIgnore=="function"&&i.onIgnore(m),m.isMatch=!1,p?m:!1):(typeof i.onMatch=="function"&&i.onMatch(m),p?m:!0)};return t&&(u.state=a),u};Qe.test=(r,e,t,{glob:n,posix:i}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};let o=t||{},s=o.format||(i?Vy.toPosixSlashes:null),a=r===n,c=a&&s?s(r):r;return a===!1&&(c=s?s(r):r,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=Qe.matchBase(r,e,t,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Qe.matchBase=(r,e,t,n=Vy.isWindows(t))=>(e instanceof RegExp?e:Qe.makeRe(e,t)).test(d8.basename(r));Qe.isMatch=(r,e,t)=>Qe(e,t)(r);Qe.parse=(r,e)=>Array.isArray(r)?r.map(t=>Qe.parse(t,e)):jy(r,{...e,fastpaths:!1});Qe.scan=(r,e)=>f8(r,e);Qe.compileRe=(r,e,t=!1,n=!1)=>{if(t===!0)return r.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${r.output})${s}`;r&&r.negated===!0&&(a=`^(?!${a}).*$`);let c=Qe.toRegex(a,e);return n===!0&&(c.state=r),c};Qe.makeRe=(r,e={},t=!1,n=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(i.output=jy.fastpaths(r,e)),i.output||(i=jy(r,e)),Qe.compileRe(i,e,t,n)};Qe.toRegex=(r,e)=>{try{let t=e||{};return new RegExp(r,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};Qe.constants=h8;RP.exports=Qe});var qy=v((nre,OP)=>{"use strict";OP.exports=kP()});var tl=v((ire,WP)=>{"use strict";var BP=H("util"),FP=yP(),qn=qy(),Gy=Zu(),NP=r=>r===""||r==="./",UP=r=>{let e=r.indexOf("{");return e>-1&&r.indexOf("}",e)>-1},Te=(r,e,t)=>{e=[].concat(e),r=[].concat(r);let n=new Set,i=new Set,o=new Set,s=0,a=l=>{o.add(l.output),t&&t.onResult&&t.onResult(l)};for(let l=0;l<e.length;l++){let p=qn(String(e[l]),{...t,onResult:a},!0),d=p.state.negated||p.state.negatedExtglob;d&&s++;for(let f of r){let h=p(f,!0);(d?!h.isMatch:h.isMatch)&&(d?n.add(h.output):(n.delete(h.output),i.add(h.output)))}}let u=(s===e.length?[...o]:[...i]).filter(l=>!n.has(l));if(t&&u.length===0){if(t.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(t.nonull===!0||t.nullglob===!0)return t.unescape?e.map(l=>l.replace(/\\/g,"")):e}return u};Te.match=Te;Te.matcher=(r,e)=>qn(r,e);Te.isMatch=(r,e,t)=>qn(e,t)(r);Te.any=Te.isMatch;Te.not=(r,e,t={})=>{e=[].concat(e).map(String);let n=new Set,i=[],o=a=>{t.onResult&&t.onResult(a),i.push(a.output)},s=new Set(Te(r,e,{...t,onResult:o}));for(let a of i)s.has(a)||n.add(a);return[...n]};Te.contains=(r,e,t)=>{if(typeof r!="string")throw new TypeError(`Expected a string: "${BP.inspect(r)}"`);if(Array.isArray(e))return e.some(n=>Te.contains(r,n,t));if(typeof e=="string"){if(NP(r)||NP(e))return!1;if(r.includes(e)||r.startsWith("./")&&r.slice(2).includes(e))return!0}return Te.isMatch(r,e,{...t,contains:!0})};Te.matchKeys=(r,e,t)=>{if(!Gy.isObject(r))throw new TypeError("Expected the first argument to be an object");let n=Te(Object.keys(r),e,t),i={};for(let o of n)i[o]=r[o];return i};Te.some=(r,e,t)=>{let n=[].concat(r);for(let i of[].concat(e)){let o=qn(String(i),t);if(n.some(s=>o(s)))return!0}return!1};Te.every=(r,e,t)=>{let n=[].concat(r);for(let i of[].concat(e)){let o=qn(String(i),t);if(!n.every(s=>o(s)))return!1}return!0};Te.all=(r,e,t)=>{if(typeof r!="string")throw new TypeError(`Expected a string: "${BP.inspect(r)}"`);return[].concat(e).every(n=>qn(n,t)(r))};Te.capture=(r,e,t)=>{let n=Gy.isWindows(t),o=qn.makeRe(String(r),{...t,capture:!0}).exec(n?Gy.toPosixSlashes(e):e);if(o)return o.slice(1).map(s=>s===void 0?"":s)};Te.makeRe=(...r)=>qn.makeRe(...r);Te.scan=(...r)=>qn.scan(...r);Te.parse=(r,e)=>{let t=[];for(let n of[].concat(r||[]))for(let i of FP(String(n),e))t.push(qn.parse(i,e));return t};Te.braces=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!UP(r)?[r]:FP(r,e)};Te.braceExpand=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");return Te.braces(r,{...e,expand:!0})};Te.hasBraces=UP;WP.exports=Te});var pL=v((tie,lL)=>{"use strict";var{Duplex:E8}=H("stream");function cL(r){r.emit("close")}function x8(){!this.destroyed&&this._writableState.finished&&this.destroy()}function uL(r){this.removeListener("error",uL),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function P8(r,e){let t=!0,n=new E8({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(o,s){let a=!s&&n._readableState.objectMode?o.toString():o;n.push(a)||r.pause()}),r.once("error",function(o){n.destroyed||(t=!1,n.destroy(o))}),r.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,o){if(r.readyState===r.CLOSED){o(i),process.nextTick(cL,n);return}let s=!1;r.once("error",function(c){s=!0,o(c)}),r.once("close",function(){s||o(i),process.nextTick(cL,n)}),t&&r.terminate()},n._final=function(i){if(r.readyState===r.CONNECTING){r.once("open",function(){n._final(i)});return}r._socket!==null&&(r._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(r._socket.once("finish",function(){i()}),r.close()))},n._read=function(){r.isPaused&&r.resume()},n._write=function(i,o,s){if(r.readyState===r.CONNECTING){r.once("open",function(){n._write(i,o,s)});return}r.send(i,s)},n.on("end",x8),n.on("error",uL),n}lL.exports=P8});var Zi=v((rie,dL)=>{"use strict";dL.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var sl=v((nie,Lf)=>{"use strict";var{EMPTY_BUFFER:L8}=Zi(),Zy=Buffer[Symbol.species];function $8(r,e){if(r.length===0)return L8;if(r.length===1)return r[0];let t=Buffer.allocUnsafe(e),n=0;for(let i=0;i<r.length;i++){let o=r[i];t.set(o,n),n+=o.length}return n<e?new Zy(t.buffer,t.byteOffset,n):t}function fL(r,e,t,n,i){for(let o=0;o<i;o++)t[n+o]=r[o]^e[o&3]}function hL(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function C8(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function eb(r){if(eb.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new Zy(r):ArrayBuffer.isView(r)?e=new Zy(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),eb.readOnly=!1),e}Lf.exports={concat:$8,mask:fL,toArrayBuffer:C8,toBuffer:eb,unmask:hL};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=H("bufferutil");Lf.exports.mask=function(e,t,n,i,o){o<48?fL(e,t,n,i,o):r.mask(e,t,n,i,o)},Lf.exports.unmask=function(e,t){e.length<32?hL(e,t):r.unmask(e,t)}}catch{}});var gL=v((iie,HL)=>{"use strict";var mL=Symbol("kDone"),tb=Symbol("kRun"),rb=class{constructor(e){this[mL]=()=>{this.pending--,this[tb]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[tb]()}[tb](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[mL])}}};HL.exports=rb});var ul=v((oie,IL)=>{"use strict";var al=H("zlib"),yL=sl(),D8=gL(),{kStatusCode:bL}=Zi(),T8=Buffer[Symbol.species],M8=Buffer.from([0,0,255,255]),Df=Symbol("permessage-deflate"),vi=Symbol("total-length"),cl=Symbol("callback"),eo=Symbol("buffers"),Cf=Symbol("error"),$f,nb=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,!$f){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;$f=new D8(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[cl];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,n=e.find(i=>!(t.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>i.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(n=>{let i=t[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);t[n]=i})}),e}decompress(e,t,n){$f.add(i=>{this._decompress(e,t,(o,s)=>{i(),n(o,s)})})}compress(e,t,n){$f.add(i=>{this._compress(e,t,(o,s)=>{i(),n(o,s)})})}_decompress(e,t,n){let i=this._isServer?"client":"server";if(!this._inflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?al.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=al.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[Df]=this,this._inflate[vi]=0,this._inflate[eo]=[],this._inflate.on("error",k8),this._inflate.on("data",vL)}this._inflate[cl]=n,this._inflate.write(e),t&&this._inflate.write(M8),this._inflate.flush(()=>{let o=this._inflate[Cf];if(o){this._inflate.close(),this._inflate=null,n(o);return}let s=yL.concat(this._inflate[eo],this._inflate[vi]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[vi]=0,this._inflate[eo]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,s)})}_compress(e,t,n){let i=this._isServer?"server":"client";if(!this._deflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?al.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=al.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[vi]=0,this._deflate[eo]=[],this._deflate.on("data",R8)}this._deflate[cl]=n,this._deflate.write(e),this._deflate.flush(al.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=yL.concat(this._deflate[eo],this._deflate[vi]);t&&(o=new T8(o.buffer,o.byteOffset,o.length-4)),this._deflate[cl]=null,this._deflate[vi]=0,this._deflate[eo]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,o)})}};IL.exports=nb;function R8(r){this[eo].push(r),this[vi]+=r.length}function vL(r){if(this[vi]+=r.length,this[Df]._maxPayload<1||this[vi]<=this[Df]._maxPayload){this[eo].push(r);return}this[Cf]=new RangeError("Max payload size exceeded"),this[Cf].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Cf][bL]=1009,this.removeListener("data",vL),this.reset()}function k8(r){this[Df]._inflate=null,r[bL]=1007,this[cl](r)}});var ll=v((sie,Tf)=>{"use strict";var{isUtf8:_L}=H("buffer"),O8=[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 N8(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function ib(r){let e=r.length,t=0;for(;t<e;)if(!(r[t]&128))t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}Tf.exports={isValidStatusCode:N8,isValidUTF8:ib,tokenChars:O8};if(_L)Tf.exports.isValidUTF8=function(r){return r.length<24?ib(r):_L(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=H("utf-8-validate");Tf.exports.isValidUTF8=function(e){return e.length<32?ib(e):r(e)}}catch{}});var ub=v((aie,LL)=>{"use strict";var{Writable:B8}=H("stream"),AL=ul(),{BINARY_TYPES:F8,EMPTY_BUFFER:wL,kStatusCode:U8,kWebSocket:W8}=Zi(),{concat:ob,toArrayBuffer:j8,unmask:V8}=sl(),{isValidStatusCode:q8,isValidUTF8:SL}=ll(),Mf=Buffer[Symbol.species],Tr=0,EL=1,xL=2,PL=3,sb=4,ab=5,Rf=6,cb=class extends B8{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||F8[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[W8]=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=Tr}_write(e,t,n){if(this._opcode===8&&this._state==Tr)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 Mf(n.buffer,n.byteOffset+e,n.length-e),new Mf(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],i=t.length-e;e>=n.length?t.set(this._buffers.shift(),i):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),i),this._buffers[0]=new Mf(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 Tr:this.getInfo(e);break;case EL:this.getPayloadLength16(e);break;case xL:this.getPayloadLength64(e);break;case PL:this.getMask();break;case sb:this.getData(e);break;case ab:case Rf: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){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let n=(t[0]&64)===64;if(n&&!this._extensions[AL.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=EL:this._payloadLength===127?this._state=xL:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}this._payloadLength=n*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=PL:this._state=sb}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=sb}getData(e){let t=wL;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]&&V8(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=ab,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[AL.extensionName].decompress(e,this._fin,(i,o)=>{if(i)return t(i);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(s);return}this._fragments.push(o)}this.dataMessage(t),this._state===Tr&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=Tr;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=ob(n,t):this._binaryType==="arraybuffer"?i=j8(ob(n,t)):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=Tr):(this._state=Rf,setImmediate(()=>{this.emit("message",i,!0),this._state=Tr,this.startLoop(e)}))}else{let i=ob(n,t);if(!this._skipUTF8Validation&&!SL(i)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(o);return}this._state===ab||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=Tr):(this._state=Rf,setImmediate(()=>{this.emit("message",i,!1),this._state=Tr,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,wL),this.end();else{let n=e.readUInt16BE(0);if(!q8(n)){let o=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(o);return}let i=new Mf(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!SL(i)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(o);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=Tr;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=Tr):(this._state=Rf,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=Tr,this.startLoop(t)}))}createError(e,t,n,i,o){this._loop=!1,this._errored=!0;let s=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(s,this.createError),s.code=o,s[U8]=i,s}};LL.exports=cb});var pb=v((uie,DL)=>{"use strict";var{Duplex:cie}=H("stream"),{randomFillSync:G8}=H("crypto"),$L=ul(),{EMPTY_BUFFER:K8}=Zi(),{isValidStatusCode:X8}=ll(),{mask:CL,toBuffer:za}=sl(),sn=Symbol("kByteLength"),z8=Buffer.alloc(4),kf=8*1024,cs,Ja=kf,lb=class r{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){let n,i=!1,o=2,s=!1;t.mask&&(n=t.maskBuffer||z8,t.generateMask?t.generateMask(n):(Ja===kf&&(cs===void 0&&(cs=Buffer.alloc(kf)),G8(cs,0,kf),Ja=0),n[0]=cs[Ja++],n[1]=cs[Ja++],n[2]=cs[Ja++],n[3]=cs[Ja++]),s=(n[0]|n[1]|n[2]|n[3])===0,o=6);let a;typeof e=="string"?(!t.mask||s)&&t[sn]!==void 0?a=t[sn]:(e=Buffer.from(e),a=e.length):(a=e.length,i=t.mask&&t.readOnly&&!s);let c=a;a>=65536?(o+=8,c=127):a>125&&(o+=2,c=126);let u=Buffer.allocUnsafe(i?a+o:o);return u[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),t.mask?(u[1]|=128,u[o-4]=n[0],u[o-3]=n[1],u[o-2]=n[2],u[o-1]=n[3],s?[u,e]:i?(CL(e,n,u,o,a),[u]):(CL(e,n,e,0,a),[u,e])):[u,e]}close(e,t,n,i){let o;if(e===void 0)o=K8;else{if(typeof e!="number"||!X8(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");o=Buffer.allocUnsafe(2+a),o.writeUInt16BE(e,0),typeof t=="string"?o.write(t,2):o.set(t,2)}}let s={[sn]:o.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,o,!1,s,i]):this.sendFrame(r.frame(o,s),i)}ping(e,t,n){let i,o;if(typeof e=="string"?(i=Buffer.byteLength(e),o=!1):(e=za(e),i=e.length,o=za.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[sn]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,s,n]):this.sendFrame(r.frame(e,s),n)}pong(e,t,n){let i,o;if(typeof e=="string"?(i=Buffer.byteLength(e),o=!1):(e=za(e),i=e.length,o=za.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[sn]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,s,n]):this.sendFrame(r.frame(e,s),n)}send(e,t,n){let i=this._extensions[$L.extensionName],o=t.binary?2:1,s=t.compress,a,c;if(typeof e=="string"?(a=Buffer.byteLength(e),c=!1):(e=za(e),a=e.length,c=za.readOnly),this._firstFragment?(this._firstFragment=!1,s&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(s=a>=i._threshold),this._compress=s):(s=!1,o=0),t.fin&&(this._firstFragment=!0),i){let u={[sn]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:c,rsv1:s};this._deflating?this.enqueue([this.dispatch,e,this._compress,u,n]):this.dispatch(e,this._compress,u,n)}else this.sendFrame(r.frame(e,{[sn]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:c,rsv1:!1}),n)}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let o=this._extensions[$L.extensionName];this._bufferedBytes+=n[sn],this._deflating=!0,o.compress(e,n.fin,(s,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");typeof i=="function"&&i(c);for(let u=0;u<this._queue.length;u++){let l=this._queue[u],p=l[l.length-1];typeof p=="function"&&p(c)}return}this._bufferedBytes-=n[sn],this._deflating=!1,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][sn],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][sn],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)}};DL.exports=lb});var UL=v((lie,FL)=>{"use strict";var{kForOnEventAttribute:pl,kListener:db}=Zi(),TL=Symbol("kCode"),ML=Symbol("kData"),RL=Symbol("kError"),kL=Symbol("kMessage"),OL=Symbol("kReason"),Ya=Symbol("kTarget"),NL=Symbol("kType"),BL=Symbol("kWasClean"),Ii=class{constructor(e){this[Ya]=null,this[NL]=e}get target(){return this[Ya]}get type(){return this[NL]}};Object.defineProperty(Ii.prototype,"target",{enumerable:!0});Object.defineProperty(Ii.prototype,"type",{enumerable:!0});var us=class extends Ii{constructor(e,t={}){super(e),this[TL]=t.code===void 0?0:t.code,this[OL]=t.reason===void 0?"":t.reason,this[BL]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[TL]}get reason(){return this[OL]}get wasClean(){return this[BL]}};Object.defineProperty(us.prototype,"code",{enumerable:!0});Object.defineProperty(us.prototype,"reason",{enumerable:!0});Object.defineProperty(us.prototype,"wasClean",{enumerable:!0});var Qa=class extends Ii{constructor(e,t={}){super(e),this[RL]=t.error===void 0?null:t.error,this[kL]=t.message===void 0?"":t.message}get error(){return this[RL]}get message(){return this[kL]}};Object.defineProperty(Qa.prototype,"error",{enumerable:!0});Object.defineProperty(Qa.prototype,"message",{enumerable:!0});var dl=class extends Ii{constructor(e,t={}){super(e),this[ML]=t.data===void 0?null:t.data}get data(){return this[ML]}};Object.defineProperty(dl.prototype,"data",{enumerable:!0});var J8={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[pl]&&i[db]===e&&!i[pl])return;let n;if(r==="message")n=function(o,s){let a=new dl("message",{data:s?o:o.toString()});a[Ya]=this,Of(e,this,a)};else if(r==="close")n=function(o,s){let a=new us("close",{code:o,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Ya]=this,Of(e,this,a)};else if(r==="error")n=function(o){let s=new Qa("error",{error:o,message:o.message});s[Ya]=this,Of(e,this,s)};else if(r==="open")n=function(){let o=new Ii("open");o[Ya]=this,Of(e,this,o)};else return;n[pl]=!!t[pl],n[db]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[db]===e&&!t[pl]){this.removeListener(r,t);break}}};FL.exports={CloseEvent:us,ErrorEvent:Qa,Event:Ii,EventTarget:J8,MessageEvent:dl};function Of(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var fb=v((pie,WL)=>{"use strict";var{tokenChars:fl}=ll();function Yn(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function Y8(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,o=!1,s,a,c=-1,u=-1,l=-1,p=0;for(;p<r.length;p++)if(u=r.charCodeAt(p),s===void 0)if(l===-1&&fl[u]===1)c===-1&&(c=p);else if(p!==0&&(u===32||u===9))l===-1&&c!==-1&&(l=p);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);l===-1&&(l=p);let f=r.slice(c,l);u===44?(Yn(e,f,t),t=Object.create(null)):s=f,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(a===void 0)if(l===-1&&fl[u]===1)c===-1&&(c=p);else if(u===32||u===9)l===-1&&c!==-1&&(l=p);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);l===-1&&(l=p),Yn(t,r.slice(c,l),!0),u===44&&(Yn(e,s,t),t=Object.create(null),s=void 0),c=l=-1}else if(u===61&&c!==-1&&l===-1)a=r.slice(c,p),c=l=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(i){if(fl[u]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);c===-1?c=p:n||(n=!0),i=!1}else if(o)if(fl[u]===1)c===-1&&(c=p);else if(u===34&&c!==-1)o=!1,l=p;else if(u===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(u===34&&r.charCodeAt(p-1)===61)o=!0;else if(l===-1&&fl[u]===1)c===-1&&(c=p);else if(c!==-1&&(u===32||u===9))l===-1&&(l=p);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);l===-1&&(l=p);let f=r.slice(c,l);n&&(f=f.replace(/\\/g,""),n=!1),Yn(t,a,f),u===44&&(Yn(e,s,t),t=Object.create(null),s=void 0),a=void 0,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(c===-1||o||u===32||u===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=p);let d=r.slice(c,l);return s===void 0?Yn(e,d,t):(a===void 0?Yn(t,d,!0):n?Yn(t,a,d.replace(/\\/g,"")):Yn(t,a,d),Yn(e,s,t)),e}function Q8(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(i=>{let o=n[i];return Array.isArray(o)||(o=[o]),o.map(s=>s===!0?i:`${i}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}WL.exports={format:Q8,parse:Y8}});var yb=v((hie,ZL)=>{"use strict";var Z8=H("events"),eG=H("https"),tG=H("http"),qL=H("net"),rG=H("tls"),{randomBytes:nG,createHash:iG}=H("crypto"),{Duplex:die,Readable:fie}=H("stream"),{URL:hb}=H("url"),to=ul(),oG=ub(),sG=pb(),{BINARY_TYPES:jL,EMPTY_BUFFER:Nf,GUID:aG,kForOnEventAttribute:mb,kListener:cG,kStatusCode:uG,kWebSocket:Tt,NOOP:GL}=Zi(),{EventTarget:{addEventListener:lG,removeEventListener:pG}}=UL(),{format:dG,parse:fG}=fb(),{toBuffer:hG}=sl(),mG=30*1e3,KL=Symbol("kAborted"),Hb=[8,13],_i=["CONNECTING","OPEN","CLOSING","CLOSED"],HG=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Ze=class r extends Z8{constructor(e,t,n){super(),this._binaryType=jL[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Nf,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(n=t,t=[]):t=[t]),XL(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){jL.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,n){let i=new oG({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation});this._sender=new sG(e,this._extensions,n.generateMask),this._receiver=i,this._socket=e,i[Tt]=this,e[Tt]=this,i.on("conclude",bG),i.on("drain",vG),i.on("error",IG),i.on("message",_G),i.on("ping",AG),i.on("pong",wG),e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",JL),e.on("data",Ff),e.on("end",YL),e.on("error",QL),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[to.extensionName]&&this._extensions[to.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){ur(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),mG)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){gb(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||Nf,t,n)}pong(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){gb(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||Nf,t,n)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(n=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){gb(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[to.extensionName]||(i.compress=!1),this._sender.send(e||Nf,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){ur(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(Ze,"CONNECTING",{enumerable:!0,value:_i.indexOf("CONNECTING")});Object.defineProperty(Ze.prototype,"CONNECTING",{enumerable:!0,value:_i.indexOf("CONNECTING")});Object.defineProperty(Ze,"OPEN",{enumerable:!0,value:_i.indexOf("OPEN")});Object.defineProperty(Ze.prototype,"OPEN",{enumerable:!0,value:_i.indexOf("OPEN")});Object.defineProperty(Ze,"CLOSING",{enumerable:!0,value:_i.indexOf("CLOSING")});Object.defineProperty(Ze.prototype,"CLOSING",{enumerable:!0,value:_i.indexOf("CLOSING")});Object.defineProperty(Ze,"CLOSED",{enumerable:!0,value:_i.indexOf("CLOSED")});Object.defineProperty(Ze.prototype,"CLOSED",{enumerable:!0,value:_i.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(Ze.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(Ze.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[mb])return e[cG];return null},set(e){for(let t of this.listeners(r))if(t[mb]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[mb]:!0})}})});Ze.prototype.addEventListener=lG;Ze.prototype.removeEventListener=pG;ZL.exports=Ze;function XL(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Hb[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=i.autoPong,!Hb.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Hb.join(", ")})`);let o;if(e instanceof hb)o=e;else try{o=new hb(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),r._url=o.href;let s=o.protocol==="wss:",a=o.protocol==="ws+unix:",c;if(o.protocol!=="ws:"&&!s&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"`:a&&!o.pathname?c="The URL's pathname is empty":o.hash&&(c="The URL contains a fragment identifier"),c){let m=new SyntaxError(c);if(r._redirects===0)throw m;Bf(r,m);return}let u=s?443:80,l=nG(16).toString("base64"),p=s?eG.request:tG.request,d=new Set,f;if(i.createConnection=i.createConnection||(s?yG:gG),i.defaultPort=i.defaultPort||u,i.port=o.port||u,i.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},i.path=o.pathname+o.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(f=new to(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=dG({[to.extensionName]:f.offer()})),t.length){for(let m of t){if(typeof m!="string"||!HG.test(m)||d.has(m))throw new SyntaxError("An invalid or duplicated subprotocol was specified");d.add(m)}i.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(o.username||o.password)&&(i.auth=`${o.username}:${o.password}`),a){let m=i.path.split(":");i.socketPath=m[0],i.path=m[1]}let h;if(i.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=s,r._originalHostOrSocketPath=a?i.socketPath:o.host;let m=n&&n.headers;if(n={...n,headers:{}},m)for(let[y,w]of Object.entries(m))n.headers[y.toLowerCase()]=w}else if(r.listenerCount("redirect")===0){let m=a?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:o.host===r._originalHostOrSocketPath;(!m||r._originalSecure&&!s)&&(delete i.headers.authorization,delete i.headers.cookie,m||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),h=r._req=p(i),r._redirects&&r.emit("redirect",r.url,h)}else h=r._req=p(i);i.timeout&&h.on("timeout",()=>{ur(r,h,"Opening handshake has timed out")}),h.on("error",m=>{h===null||h[KL]||(h=r._req=null,Bf(r,m))}),h.on("response",m=>{let y=m.headers.location,w=m.statusCode;if(y&&i.followRedirects&&w>=300&&w<400){if(++r._redirects>i.maxRedirects){ur(r,h,"Maximum redirects exceeded");return}h.abort();let D;try{D=new hb(y,e)}catch{let X=new SyntaxError(`Invalid URL: ${y}`);Bf(r,X);return}XL(r,D,t,n)}else r.emit("unexpected-response",h,m)||ur(r,h,`Unexpected server response: ${m.statusCode}`)}),h.on("upgrade",(m,y,w)=>{if(r.emit("upgrade",m),r.readyState!==Ze.CONNECTING)return;h=r._req=null;let D=m.headers.upgrade;if(D===void 0||D.toLowerCase()!=="websocket"){ur(r,y,"Invalid Upgrade header");return}let j=iG("sha1").update(l+aG).digest("base64");if(m.headers["sec-websocket-accept"]!==j){ur(r,y,"Invalid Sec-WebSocket-Accept header");return}let X=m.headers["sec-websocket-protocol"],B;if(X!==void 0?d.size?d.has(X)||(B="Server sent an invalid subprotocol"):B="Server sent a subprotocol but none was requested":d.size&&(B="Server sent no subprotocol"),B){ur(r,y,B);return}X&&(r._protocol=X);let Z=m.headers["sec-websocket-extensions"];if(Z!==void 0){if(!f){ur(r,y,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let O;try{O=fG(Z)}catch{ur(r,y,"Invalid Sec-WebSocket-Extensions header");return}let G=Object.keys(O);if(G.length!==1||G[0]!==to.extensionName){ur(r,y,"Server indicated an extension that was not requested");return}try{f.accept(O[to.extensionName])}catch{ur(r,y,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[to.extensionName]=f}r.setSocket(y,w,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(h,r):h.end()}function Bf(r,e){r._readyState=Ze.CLOSING,r.emit("error",e),r.emitClose()}function gG(r){return r.path=r.socketPath,qL.connect(r)}function yG(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=qL.isIP(r.host)?"":r.host),rG.connect(r)}function ur(r,e,t){r._readyState=Ze.CLOSING;let n=new Error(t);Error.captureStackTrace(n,ur),e.setHeader?(e[KL]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Bf,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function gb(r,e,t){if(e){let n=hG(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${_i[r.readyState]})`);process.nextTick(t,n)}}function bG(r,e){let t=this[Tt];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[Tt]!==void 0&&(t._socket.removeListener("data",Ff),process.nextTick(zL,t._socket),r===1005?t.close():t.close(r,e))}function vG(){let r=this[Tt];r.isPaused||r._socket.resume()}function IG(r){let e=this[Tt];e._socket[Tt]!==void 0&&(e._socket.removeListener("data",Ff),process.nextTick(zL,e._socket),e.close(r[uG])),e.emit("error",r)}function VL(){this[Tt].emitClose()}function _G(r,e){this[Tt].emit("message",r,e)}function AG(r){let e=this[Tt];e._autoPong&&e.pong(r,!this._isServer,GL),e.emit("ping",r)}function wG(r){this[Tt].emit("pong",r)}function zL(r){r.resume()}function JL(){let r=this[Tt];this.removeListener("close",JL),this.removeListener("data",Ff),this.removeListener("end",YL),r._readyState=Ze.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[Tt]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",VL),r._receiver.on("finish",VL))}function Ff(r){this[Tt]._receiver.write(r)||this.pause()}function YL(){let r=this[Tt];r._readyState=Ze.CLOSING,r._receiver.end(),this.end()}function QL(){let r=this[Tt];this.removeListener("error",QL),this.on("error",GL),r&&(r._readyState=Ze.CLOSING,this.destroy())}});var t$=v((mie,e$)=>{"use strict";var{tokenChars:SG}=ll();function EG(r){let e=new Set,t=-1,n=-1,i=0;for(i;i<r.length;i++){let s=r.charCodeAt(i);if(n===-1&&SG[s]===1)t===-1&&(t=i);else if(i!==0&&(s===32||s===9))n===-1&&t!==-1&&(n=i);else if(s===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=r.slice(t,n);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let o=r.slice(t,i);if(e.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);return e.add(o),e}e$.exports={parse:EG}});var c$=v((gie,a$)=>{"use strict";var xG=H("events"),Uf=H("http"),{Duplex:Hie}=H("stream"),{createHash:PG}=H("crypto"),r$=fb(),ls=ul(),LG=t$(),$G=yb(),{GUID:CG,kWebSocket:DG}=Zi(),TG=/^[+/0-9A-Za-z]{22}==$/,n$=0,i$=1,s$=2,bb=class extends xG{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:$G,...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=Uf.createServer((n,i)=>{let o=Uf.STATUS_CODES[426];i.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),i.end(o)}),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=MG(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,o,s)=>{this.handleUpgrade(i,o,s,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=n$}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===s$){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(hl,this);return}if(e&&this.once("close",e),this._state!==i$)if(this._state=i$,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(hl,this):process.nextTick(hl,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{hl(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,i){t.on("error",o$);let o=e.headers["sec-websocket-key"],s=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){ps(this,e,t,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){ps(this,e,t,400,"Invalid Upgrade header");return}if(o===void 0||!TG.test(o)){ps(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==8&&a!==13){ps(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(e)){ml(t,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=LG.parse(c)}catch{ps(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let l=e.headers["sec-websocket-extensions"],p={};if(this.options.perMessageDeflate&&l!==void 0){let d=new ls(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let f=r$.parse(l);f[ls.extensionName]&&(d.accept(f[ls.extensionName]),p[ls.extensionName]=d)}catch{ps(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let d={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(d,(f,h,m,y)=>{if(!f)return ml(t,h||401,m,y);this.completeUpgrade(p,o,u,e,t,n,i)});return}if(!this.options.verifyClient(d))return ml(t,401)}this.completeUpgrade(p,o,u,e,t,n,i)}completeUpgrade(e,t,n,i,o,s,a){if(!o.readable||!o.writable)return o.destroy();if(o[DG])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>n$)return ml(o,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${PG("sha1").update(t+CG).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(n.size){let p=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;p&&(u.push(`Sec-WebSocket-Protocol: ${p}`),l._protocol=p)}if(e[ls.extensionName]){let p=e[ls.extensionName].params,d=r$.format({[ls.extensionName]:[p]});u.push(`Sec-WebSocket-Extensions: ${d}`),l._extensions=e}this.emit("headers",u,i),o.write(u.concat(`\r
`).join(`\r
`)),o.removeListener("error",o$),l.setSocket(o,s,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(l),l.on("close",()=>{this.clients.delete(l),this._shouldEmitClose&&!this.clients.size&&process.nextTick(hl,this)})),a(l,i)}};a$.exports=bb;function MG(r,e){for(let t of Object.keys(e))r.on(t,e[t]);return function(){for(let n of Object.keys(e))r.removeListener(n,e[n])}}function hl(r){r._state=s$,r.emit("close")}function o$(){this.destroy()}function ml(r,e,t,n){t=t||Uf.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${Uf.STATUS_CODES[e]}\r
`+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
`)+`\r
\r
`+t)}function ps(r,e,t,n,i){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,ps),r.emit("wsClientError",o,t,e)}else ml(t,n,i)}});var w$=v((roe,A$)=>{"use strict";A$.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 E$=v((noe,S$)=>{S$.exports=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")}});var L$=v((ioe,P$)=>{"use strict";var jG=E$(),VG=Array.prototype.concat,qG=Array.prototype.slice,x$=P$.exports=function(e){for(var t=[],n=0,i=e.length;n<i;n++){var o=e[n];jG(o)?t=VG.call(t,qG.call(o)):t.push(o)}return t};x$.wrap=function(r){return function(){return r(x$(arguments))}}});var T$=v((ooe,D$)=>{var yl=w$(),bl=L$(),$$=Object.hasOwnProperty,C$={};for(Kf in yl)$$.call(yl,Kf)&&(C$[yl[Kf]]=Kf);var Kf,lr=D$.exports={to:{},get:{}};lr.get=function(r){var e=r.substring(0,3).toLowerCase(),t,n;switch(e){case"hsl":t=lr.get.hsl(r),n="hsl";break;case"hwb":t=lr.get.hwb(r),n="hwb";break;default:t=lr.get.rgb(r),n="rgb";break}return t?{model:n,value:t}:null};lr.get.rgb=function(r){if(!r)return null;var e=/^#([a-f0-9]{3,4})$/i,t=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,n=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^(\w+)$/,s=[0,0,0,1],a,c,u;if(a=r.match(t)){for(u=a[2],a=a[1],c=0;c<3;c++){var l=c*2;s[c]=parseInt(a.slice(l,l+2),16)}u&&(s[3]=parseInt(u,16)/255)}else if(a=r.match(e)){for(a=a[1],u=a[3],c=0;c<3;c++)s[c]=parseInt(a[c]+a[c],16);u&&(s[3]=parseInt(u+u,16)/255)}else if(a=r.match(n)){for(c=0;c<3;c++)s[c]=parseInt(a[c+1],0);a[4]&&(a[5]?s[3]=parseFloat(a[4])*.01:s[3]=parseFloat(a[4]))}else if(a=r.match(i)){for(c=0;c<3;c++)s[c]=Math.round(parseFloat(a[c+1])*2.55);a[4]&&(a[5]?s[3]=parseFloat(a[4])*.01:s[3]=parseFloat(a[4]))}else return(a=r.match(o))?a[1]==="transparent"?[0,0,0,0]:$$.call(yl,a[1])?(s=yl[a[1]],s[3]=1,s):null:null;for(c=0;c<3;c++)s[c]=io(s[c],0,255);return s[3]=io(s[3],0,1),s};lr.get.hsl=function(r){if(!r)return null;var e=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=r.match(e);if(t){var n=parseFloat(t[4]),i=(parseFloat(t[1])%360+360)%360,o=io(parseFloat(t[2]),0,100),s=io(parseFloat(t[3]),0,100),a=io(isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};lr.get.hwb=function(r){if(!r)return null;var e=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=r.match(e);if(t){var n=parseFloat(t[4]),i=(parseFloat(t[1])%360+360)%360,o=io(parseFloat(t[2]),0,100),s=io(parseFloat(t[3]),0,100),a=io(isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};lr.to.hex=function(){var r=bl(arguments);return"#"+Xf(r[0])+Xf(r[1])+Xf(r[2])+(r[3]<1?Xf(Math.round(r[3]*255)):"")};lr.to.rgb=function(){var r=bl(arguments);return r.length<4||r[3]===1?"rgb("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+")":"rgba("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+", "+r[3]+")"};lr.to.rgb.percent=function(){var r=bl(arguments),e=Math.round(r[0]/255*100),t=Math.round(r[1]/255*100),n=Math.round(r[2]/255*100);return r.length<4||r[3]===1?"rgb("+e+"%, "+t+"%, "+n+"%)":"rgba("+e+"%, "+t+"%, "+n+"%, "+r[3]+")"};lr.to.hsl=function(){var r=bl(arguments);return r.length<4||r[3]===1?"hsl("+r[0]+", "+r[1]+"%, "+r[2]+"%)":"hsla("+r[0]+", "+r[1]+"%, "+r[2]+"%, "+r[3]+")"};lr.to.hwb=function(){var r=bl(arguments),e="";return r.length>=4&&r[3]!==1&&(e=", "+r[3]),"hwb("+r[0]+", "+r[1]+"%, "+r[2]+"%"+e+")"};lr.to.keyword=function(r){return C$[r.slice(0,3)]};function io(r,e,t){return Math.min(Math.max(e,r),t)}function Xf(r){var e=Math.round(r).toString(16).toUpperCase();return e.length<2?"0"+e:e}});var R$=v((soe,M$)=>{"use strict";M$.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 Sb=v((aoe,O$)=>{var vl=R$(),k$={};for(let r of Object.keys(vl))k$[vl[r]]=r;var J={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"]}};O$.exports=J;for(let r of Object.keys(J)){if(!("channels"in J[r]))throw new Error("missing channels property: "+r);if(!("labels"in J[r]))throw new Error("missing channel labels property: "+r);if(J[r].labels.length!==J[r].channels)throw new Error("channel and label counts mismatch: "+r);let{channels:e,labels:t}=J[r];delete J[r].channels,delete J[r].labels,Object.defineProperty(J[r],"channels",{value:e}),Object.defineProperty(J[r],"labels",{value:t})}J.rgb.hsl=function(r){let e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.min(e,t,n),o=Math.max(e,t,n),s=o-i,a,c;o===i?a=0:e===o?a=(t-n)/s:t===o?a=2+(n-e)/s:n===o&&(a=4+(e-t)/s),a=Math.min(a*60,360),a<0&&(a+=360);let u=(i+o)/2;return o===i?c=0:u<=.5?c=s/(o+i):c=s/(2-o-i),[a,c*100,u*100]};J.rgb.hsv=function(r){let e,t,n,i,o,s=r[0]/255,a=r[1]/255,c=r[2]/255,u=Math.max(s,a,c),l=u-Math.min(s,a,c),p=function(d){return(u-d)/6/l+1/2};return l===0?(i=0,o=0):(o=l/u,e=p(s),t=p(a),n=p(c),s===u?i=n-t:a===u?i=1/3+e-n:c===u&&(i=2/3+t-e),i<0?i+=1:i>1&&(i-=1)),[i*360,o*100,u*100]};J.rgb.hwb=function(r){let e=r[0],t=r[1],n=r[2],i=J.rgb.hsl(r)[0],o=1/255*Math.min(e,Math.min(t,n));return n=1-1/255*Math.max(e,Math.max(t,n)),[i,o*100,n*100]};J.rgb.cmyk=function(r){let e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.min(1-e,1-t,1-n),o=(1-e-i)/(1-i)||0,s=(1-t-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function GG(r,e){return(r[0]-e[0])**2+(r[1]-e[1])**2+(r[2]-e[2])**2}J.rgb.keyword=function(r){let e=k$[r];if(e)return e;let t=1/0,n;for(let i of Object.keys(vl)){let o=vl[i],s=GG(r,o);s<t&&(t=s,n=i)}return n};J.keyword.rgb=function(r){return vl[r]};J.rgb.xyz=function(r){let e=r[0]/255,t=r[1]/255,n=r[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 i=e*.4124+t*.3576+n*.1805,o=e*.2126+t*.7152+n*.0722,s=e*.0193+t*.1192+n*.9505;return[i*100,o*100,s*100]};J.rgb.lab=function(r){let e=J.rgb.xyz(r),t=e[0],n=e[1],i=e[2];t/=95.047,n/=100,i/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let o=116*n-16,s=500*(t-n),a=200*(n-i);return[o,s,a]};J.hsl.rgb=function(r){let e=r[0]/360,t=r[1]/100,n=r[2]/100,i,o,s;if(t===0)return s=n*255,[s,s,s];n<.5?i=n*(1+t):i=n+t-n*t;let a=2*n-i,c=[0,0,0];for(let u=0;u<3;u++)o=e+1/3*-(u-1),o<0&&o++,o>1&&o--,6*o<1?s=a+(i-a)*6*o:2*o<1?s=i:3*o<2?s=a+(i-a)*(2/3-o)*6:s=a,c[u]=s*255;return c};J.hsl.hsv=function(r){let e=r[0],t=r[1]/100,n=r[2]/100,i=t,o=Math.max(n,.01);n*=2,t*=n<=1?n:2-n,i*=o<=1?o:2-o;let s=(n+t)/2,a=n===0?2*i/(o+i):2*t/(n+t);return[e,a*100,s*100]};J.hsv.rgb=function(r){let e=r[0]/60,t=r[1]/100,n=r[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),s=255*n*(1-t),a=255*n*(1-t*o),c=255*n*(1-t*(1-o));switch(n*=255,i){case 0:return[n,c,s];case 1:return[a,n,s];case 2:return[s,n,c];case 3:return[s,a,n];case 4:return[c,s,n];case 5:return[n,s,a]}};J.hsv.hsl=function(r){let e=r[0],t=r[1]/100,n=r[2]/100,i=Math.max(n,.01),o,s;s=(2-t)*n;let a=(2-t)*i;return o=t*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};J.hwb.rgb=function(r){let e=r[0]/360,t=r[1]/100,n=r[2]/100,i=t+n,o;i>1&&(t/=i,n/=i);let s=Math.floor(6*e),a=1-n;o=6*e-s,s&1&&(o=1-o);let c=t+o*(a-t),u,l,p;switch(s){default:case 6:case 0:u=a,l=c,p=t;break;case 1:u=c,l=a,p=t;break;case 2:u=t,l=a,p=c;break;case 3:u=t,l=c,p=a;break;case 4:u=c,l=t,p=a;break;case 5:u=a,l=t,p=c;break}return[u*255,l*255,p*255]};J.cmyk.rgb=function(r){let e=r[0]/100,t=r[1]/100,n=r[2]/100,i=r[3]/100,o=1-Math.min(1,e*(1-i)+i),s=1-Math.min(1,t*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[o*255,s*255,a*255]};J.xyz.rgb=function(r){let e=r[0]/100,t=r[1]/100,n=r[2]/100,i,o,s;return i=e*3.2406+t*-1.5372+n*-.4986,o=e*-.9689+t*1.8758+n*.0415,s=e*.0557+t*-.204+n*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[i*255,o*255,s*255]};J.xyz.lab=function(r){let e=r[0],t=r[1],n=r[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 i=116*t-16,o=500*(e-t),s=200*(t-n);return[i,o,s]};J.lab.xyz=function(r){let e=r[0],t=r[1],n=r[2],i,o,s;o=(e+16)/116,i=t/500+o,s=o-n/200;let a=o**3,c=i**3,u=s**3;return o=a>.008856?a:(o-16/116)/7.787,i=c>.008856?c:(i-16/116)/7.787,s=u>.008856?u:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};J.lab.lch=function(r){let e=r[0],t=r[1],n=r[2],i;i=Math.atan2(n,t)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(t*t+n*n);return[e,s,i]};J.lch.lab=function(r){let e=r[0],t=r[1],i=r[2]/360*2*Math.PI,o=t*Math.cos(i),s=t*Math.sin(i);return[e,o,s]};J.rgb.ansi16=function(r,e=null){let[t,n,i]=r,o=e===null?J.rgb.hsv(r)[2]:e;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return o===2&&(s+=60),s};J.hsv.ansi16=function(r){return J.rgb.ansi16(J.hsv.rgb(r),r[2])};J.rgb.ansi256=function(r){let e=r[0],t=r[1],n=r[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)};J.ansi16.rgb=function(r){let e=r%10;if(e===0||e===7)return r>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let t=(~~(r>50)+1)*.5,n=(e&1)*t*255,i=(e>>1&1)*t*255,o=(e>>2&1)*t*255;return[n,i,o]};J.ansi256.rgb=function(r){if(r>=232){let o=(r-232)*10+8;return[o,o,o]}r-=16;let e,t=Math.floor(r/36)/5*255,n=Math.floor((e=r%36)/6)/5*255,i=e%6/5*255;return[t,n,i]};J.rgb.hex=function(r){let t=(((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t};J.hex.rgb=function(r){let e=r.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),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};J.rgb.hcg=function(r){let e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.max(Math.max(e,t),n),o=Math.min(Math.min(e,t),n),s=i-o,a,c;return s<1?a=o/(1-s):a=0,s<=0?c=0:i===e?c=(t-n)/s%6:i===t?c=2+(n-e)/s:c=4+(e-t)/s,c/=6,c%=1,[c*360,s*100,a*100]};J.hsl.hcg=function(r){let e=r[1]/100,t=r[2]/100,n=t<.5?2*e*t:2*e*(1-t),i=0;return n<1&&(i=(t-.5*n)/(1-n)),[r[0],n*100,i*100]};J.hsv.hcg=function(r){let e=r[1]/100,t=r[2]/100,n=e*t,i=0;return n<1&&(i=(t-n)/(1-n)),[r[0],n*100,i*100]};J.hcg.rgb=function(r){let e=r[0]/360,t=r[1]/100,n=r[2]/100;if(t===0)return[n*255,n*255,n*255];let i=[0,0,0],o=e%1*6,s=o%1,a=1-s,c=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return c=(1-t)*n,[(t*i[0]+c)*255,(t*i[1]+c)*255,(t*i[2]+c)*255]};J.hcg.hsv=function(r){let e=r[1]/100,t=r[2]/100,n=e+t*(1-e),i=0;return n>0&&(i=e/n),[r[0],i*100,n*100]};J.hcg.hsl=function(r){let e=r[1]/100,n=r[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[r[0],i*100,n*100]};J.hcg.hwb=function(r){let e=r[1]/100,t=r[2]/100,n=e+t*(1-e);return[r[0],(n-e)*100,(1-n)*100]};J.hwb.hcg=function(r){let e=r[1]/100,n=1-r[2]/100,i=n-e,o=0;return i<1&&(o=(n-i)/(1-i)),[r[0],i*100,o*100]};J.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};J.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};J.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};J.gray.hsl=function(r){return[0,0,r[0]]};J.gray.hsv=J.gray.hsl;J.gray.hwb=function(r){return[0,100,r[0]]};J.gray.cmyk=function(r){return[0,0,0,r[0]]};J.gray.lab=function(r){return[r[0],0,0]};J.gray.hex=function(r){let e=Math.round(r[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};J.rgb.gray=function(r){return[(r[0]+r[1]+r[2])/3/255*100]}});var B$=v((coe,N$)=>{var zf=Sb();function KG(){let r={},e=Object.keys(zf);for(let t=e.length,n=0;n<t;n++)r[e[n]]={distance:-1,parent:null};return r}function XG(r){let e=KG(),t=[r];for(e[r].distance=0;t.length;){let n=t.pop(),i=Object.keys(zf[n]);for(let o=i.length,s=0;s<o;s++){let a=i[s],c=e[a];c.distance===-1&&(c.distance=e[n].distance+1,c.parent=n,t.unshift(a))}}return e}function zG(r,e){return function(t){return e(r(t))}}function JG(r,e){let t=[e[r].parent,r],n=zf[e[r].parent][r],i=e[r].parent;for(;e[i].parent;)t.unshift(e[i].parent),n=zG(zf[e[i].parent][i],n),i=e[i].parent;return n.conversion=t,n}N$.exports=function(r){let e=XG(r),t={},n=Object.keys(e);for(let i=n.length,o=0;o<i;o++){let s=n[o];e[s].parent!==null&&(t[s]=JG(s,e))}return t}});var U$=v((uoe,F$)=>{var Eb=Sb(),YG=B$(),nc={},QG=Object.keys(Eb);function ZG(r){let e=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),r(t))};return"conversion"in r&&(e.conversion=r.conversion),e}function e4(r){let e=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let i=r(t);if(typeof i=="object")for(let o=i.length,s=0;s<o;s++)i[s]=Math.round(i[s]);return i};return"conversion"in r&&(e.conversion=r.conversion),e}QG.forEach(r=>{nc[r]={},Object.defineProperty(nc[r],"channels",{value:Eb[r].channels}),Object.defineProperty(nc[r],"labels",{value:Eb[r].labels});let e=YG(r);Object.keys(e).forEach(n=>{let i=e[n];nc[r][n]=e4(i),nc[r][n].raw=ZG(i)})});F$.exports=nc});var V$=v((loe,j$)=>{var ic=T$(),pr=U$(),W$=["keyword","gray","hex"],xb={};for(let r of Object.keys(pr))xb[[...pr[r].labels].sort().join("")]=r;var Jf={};function Ht(r,e){if(!(this instanceof Ht))return new Ht(r,e);if(e&&e in W$&&(e=null),e&&!(e in pr))throw new Error("Unknown model: "+e);let t,n;if(r==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(r instanceof Ht)this.model=r.model,this.color=[...r.color],this.valpha=r.valpha;else if(typeof r=="string"){let i=ic.get(r);if(i===null)throw new Error("Unable to parse color from string: "+r);this.model=i.model,n=pr[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]=="number"?i.value[n]:1}else if(r.length>0){this.model=e||"rgb",n=pr[this.model].channels;let i=Array.prototype.slice.call(r,0,n);this.color=Pb(i,n),this.valpha=typeof r[n]=="number"?r[n]:1}else if(typeof r=="number")this.model="rgb",this.color=[r>>16&255,r>>8&255,r&255],this.valpha=1;else{this.valpha=1;let i=Object.keys(r);"alpha"in r&&(i.splice(i.indexOf("alpha"),1),this.valpha=typeof r.alpha=="number"?r.alpha:0);let o=i.sort().join("");if(!(o in xb))throw new Error("Unable to parse color from object: "+JSON.stringify(r));this.model=xb[o];let{labels:s}=pr[this.model],a=[];for(t=0;t<s.length;t++)a.push(r[s[t]]);this.color=Pb(a)}if(Jf[this.model])for(n=pr[this.model].channels,t=0;t<n;t++){let i=Jf[this.model][t];i&&(this.color[t]=i(this.color[t]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Ht.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(r){let e=this.model in ic.to?this:this.rgb();e=e.round(typeof r=="number"?r:1);let t=e.valpha===1?e.color:[...e.color,this.valpha];return ic.to[e.model](t)},percentString(r){let e=this.rgb().round(typeof r=="number"?r:1),t=e.valpha===1?e.color:[...e.color,this.valpha];return ic.to.rgb.percent(t)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let r={},{channels:e}=pr[this.model],{labels:t}=pr[this.model];for(let n=0;n<e;n++)r[t[n]]=this.color[n];return this.valpha!==1&&(r.alpha=this.valpha),r},unitArray(){let r=this.rgb().color;return r[0]/=255,r[1]/=255,r[2]/=255,this.valpha!==1&&r.push(this.valpha),r},unitObject(){let r=this.rgb().object();return r.r/=255,r.g/=255,r.b/=255,this.valpha!==1&&(r.alpha=this.valpha),r},round(r){return r=Math.max(r||0,0),new Ht([...this.color.map(r4(r)),this.valpha],this.model)},alpha(r){return r!==void 0?new Ht([...this.color,Math.max(0,Math.min(1,r))],this.model):this.valpha},red:qe("rgb",0,lt(255)),green:qe("rgb",1,lt(255)),blue:qe("rgb",2,lt(255)),hue:qe(["hsl","hsv","hsl","hwb","hcg"],0,r=>(r%360+360)%360),saturationl:qe("hsl",1,lt(100)),lightness:qe("hsl",2,lt(100)),saturationv:qe("hsv",1,lt(100)),value:qe("hsv",2,lt(100)),chroma:qe("hcg",1,lt(100)),gray:qe("hcg",2,lt(100)),white:qe("hwb",1,lt(100)),wblack:qe("hwb",2,lt(100)),cyan:qe("cmyk",0,lt(100)),magenta:qe("cmyk",1,lt(100)),yellow:qe("cmyk",2,lt(100)),black:qe("cmyk",3,lt(100)),x:qe("xyz",0,lt(95.047)),y:qe("xyz",1,lt(100)),z:qe("xyz",2,lt(108.833)),l:qe("lab",0,lt(100)),a:qe("lab",1),b:qe("lab",2),keyword(r){return r!==void 0?new Ht(r):pr[this.model].keyword(this.color)},hex(r){return r!==void 0?new Ht(r):ic.to.hex(this.rgb().round().color)},hexa(r){if(r!==void 0)return new Ht(r);let e=this.rgb().round().color,t=Math.round(this.valpha*255).toString(16).toUpperCase();return t.length===1&&(t="0"+t),ic.to.hex(e)+t},rgbNumber(){let r=this.rgb().color;return(r[0]&255)<<16|(r[1]&255)<<8|r[2]&255},luminosity(){let r=this.rgb().color,e=[];for(let[t,n]of r.entries()){let i=n/255;e[t]=i<=.04045?i/12.92:((i+.055)/1.055)**2.4}return .2126*e[0]+.7152*e[1]+.0722*e[2]},contrast(r){let e=this.luminosity(),t=r.luminosity();return e>t?(e+.05)/(t+.05):(t+.05)/(e+.05)},level(r){let e=this.contrast(r);return e>=7?"AAA":e>=4.5?"AA":""},isDark(){let r=this.rgb().color;return(r[0]*2126+r[1]*7152+r[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let r=this.rgb();for(let e=0;e<3;e++)r.color[e]=255-r.color[e];return r},lighten(r){let e=this.hsl();return e.color[2]+=e.color[2]*r,e},darken(r){let e=this.hsl();return e.color[2]-=e.color[2]*r,e},saturate(r){let e=this.hsl();return e.color[1]+=e.color[1]*r,e},desaturate(r){let e=this.hsl();return e.color[1]-=e.color[1]*r,e},whiten(r){let e=this.hwb();return e.color[1]+=e.color[1]*r,e},blacken(r){let e=this.hwb();return e.color[2]+=e.color[2]*r,e},grayscale(){let r=this.rgb().color,e=r[0]*.3+r[1]*.59+r[2]*.11;return Ht.rgb(e,e,e)},fade(r){return this.alpha(this.valpha-this.valpha*r)},opaquer(r){return this.alpha(this.valpha+this.valpha*r)},rotate(r){let e=this.hsl(),t=e.color[0];return t=(t+r)%360,t=t<0?360+t:t,e.color[0]=t,e},mix(r,e){if(!r||!r.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof r);let t=r.rgb(),n=this.rgb(),i=e===void 0?.5:e,o=2*i-1,s=t.alpha()-n.alpha(),a=((o*s===-1?o:(o+s)/(1+o*s))+1)/2,c=1-a;return Ht.rgb(a*t.red()+c*n.red(),a*t.green()+c*n.green(),a*t.blue()+c*n.blue(),t.alpha()*i+n.alpha()*(1-i))}};for(let r of Object.keys(pr)){if(W$.includes(r))continue;let{channels:e}=pr[r];Ht.prototype[r]=function(...t){return this.model===r?new Ht(this):t.length>0?new Ht(t,r):new Ht([...n4(pr[this.model][r].raw(this.color)),this.valpha],r)},Ht[r]=function(...t){let n=t[0];return typeof n=="number"&&(n=Pb(t,e)),new Ht(n,r)}}function t4(r,e){return Number(r.toFixed(e))}function r4(r){return function(e){return t4(e,r)}}function qe(r,e,t){r=Array.isArray(r)?r:[r];for(let n of r)(Jf[n]||(Jf[n]=[]))[e]=t;return r=r[0],function(n){let i;return n!==void 0?(t&&(n=t(n)),i=this[r](),i.color[e]=n,i):(i=this[r]().color[e],t&&(i=t(i)),i)}}function lt(r){return function(e){return Math.max(0,Math.min(r,e))}}function n4(r){return Array.isArray(r)?r:[r]}function Pb(r,e){for(let t=0;t<e;t++)typeof r[t]!="number"&&(r[t]=0);return r}j$.exports=Ht});var Si=v(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.findWindowsCandidates=Rt.sort=Rt.preferredEdgePath=Rt.preferredFirefoxPath=Rt.preferredChromePath=Rt.escapeRegexSpecialChars=Rt.canAccess=void 0;var O4=H("path");async function Ll({access:r},e){if(!e)return!1;try{return await r(e),!0}catch{return!1}}Rt.canAccess=Ll;var N4="/\\.?*()^${}|[]+";function B4(r,e){let t=N4.split("").filter(i=>!e||e.indexOf(i)<0).join("").replace(/[\\\]]/g,"\\$&"),n=new RegExp(`[${t}]`,"g");return r.replace(n,"\\$&")}Rt.escapeRegexSpecialChars=B4;async function F4(r,e){if(await Ll(r,e.CHROME_PATH))return e.CHROME_PATH}Rt.preferredChromePath=F4;async function U4(r,e){if(await Ll(r,e.FIREFOX_PATH))return e.FIREFOX_PATH}Rt.preferredFirefoxPath=U4;async function W4(r,e){if(await Ll(r,e.EDGE_PATH))return e.EDGE_PATH}Rt.preferredEdgePath=W4;function j4(r,e){return[...r].filter(n=>!!n).map(n=>{let i=e.find(o=>o.regex.test(n));return i?{path:n,weight:i.weight,quality:i.quality}:{path:n,weight:10,quality:"dev"}}).sort((n,i)=>i.weight-n.weight).map(n=>({path:n.path,quality:n.quality}))}Rt.sort=j4;async function V4(r,e,t){let n=[r.LOCALAPPDATA,r.PROGRAMFILES,r["PROGRAMFILES(X86)"]].filter(o=>!!o),i=[];for(let o of n)for(let s of t){let a=O4.win32.join(o,s.name);i.push(Ll(e,a).then(c=>c?{path:a,quality:s.type}:void 0))}return(await Promise.all(i)).filter(o=>!!o)}Rt.findWindowsCandidates=V4});var Lh=v(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.DarwinFinderBase=void 0;var q4=H("path"),G4=H("fs"),pv=Si(),VC=/( \(0x[a-f0-9]+\))/,dv=class{constructor(e=process.env,t=G4.promises,n=n){this.env=e,this.fs=t,this.execa=n,this.lsRegisterCommand="/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump",this.wellKnownPaths=[]}async findWhere(e){for(let t of this.wellKnownPaths)if(e(t)&&await(0,pv.canAccess)(this.fs,t.path))return t;return(await this.findAll()).find(e)}findAll(){var e;return(e=this.foundAll)!==null&&e!==void 0||(this.foundAll=this.findAllInner()),this.foundAll}async findLaunchRegisteredApps(e,t,n){let{stdout:i}=await this.execa.command(`${this.lsRegisterCommand} | awk 'tolower($0) ~ /${e.toLowerCase()}${VC.source}?$/ { $1=""; print $0 }'`,{shell:!0,stdio:"pipe"}),o=[...t,...i.split(`
`).map(c=>c.trim().replace(VC,""))].filter(c=>!!c),s=this.getPreferredPath();s&&o.push(s);let a=new Set;for(let c of o)for(let u of n){let l=q4.posix.join(c.trim(),u);try{await this.fs.access(l),a.add(l)}catch{}}return a}createPriorities(e){let t=this.env.HOME&&(0,pv.escapeRegexSpecialChars)(this.env.HOME),n=this.getPreferredPath(),i=e.reduce((o,s)=>[...o,{regex:new RegExp(`^/Applications/.*${s.name}`),weight:s.weight+100,quality:s.quality},{regex:new RegExp(`^${t}/Applications/.*${s.name}`),weight:s.weight,quality:s.quality},{regex:new RegExp(`^/Volumes/.*${s.name}`),weight:s.weight-100,quality:s.quality}],[]);return n&&i.unshift({regex:new RegExp((0,pv.escapeRegexSpecialChars)(n)),weight:151,quality:"custom"}),i}};Ph.DarwinFinderBase=dv});var qC=v($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.DarwinChromeBrowserFinder=void 0;var K4=Si(),X4=Lh(),fv=class extends X4.DarwinFinderBase{constructor(){super(...arguments),this.wellKnownPaths=[{path:"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",quality:"stable"},{path:"/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary",quality:"canary"},{path:"/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta",quality:"beta"},{path:"/Applications/Google Chrome Dev.app/Contents/MacOS/Google Chrome Dev",quality:"dev"}]}async findAllInner(){let e=["/Contents/MacOS/Google Chrome Canary","/Contents/MacOS/Google Chrome Beta","/Contents/MacOS/Google Chrome Dev","/Contents/MacOS/Google Chrome"],t=["/Applications/Google Chrome.app","/Applications/Google Chrome Canary.app"],n=await this.findLaunchRegisteredApps("google chrome[A-Za-z() ]*.app",t,e);return(0,K4.sort)(n,this.createPriorities([{name:"Chrome.app",weight:0,quality:"stable"},{name:"Chrome Canary.app",weight:1,quality:"canary"},{name:"Chrome Beta.app",weight:2,quality:"beta"},{name:"Chrome Dev.app",weight:3,quality:"dev"}]))}getPreferredPath(){return this.env.CHROME_PATH}};$h.DarwinChromeBrowserFinder=fv});var GC=v(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.DarwinEdgeBrowserFinder=void 0;var z4=Si(),J4=Lh(),hv=class extends J4.DarwinFinderBase{constructor(){super(...arguments),this.wellKnownPaths=[{path:"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",quality:"stable"},{path:"/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary",quality:"canary"},{path:"/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta",quality:"beta"},{path:"/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev",quality:"dev"}]}async findAllInner(){let e=["/Contents/MacOS/Microsoft Edge Canary","/Contents/MacOS/Microsoft Edge Beta","/Contents/MacOS/Microsoft Edge Dev","/Contents/MacOS/Microsoft Edge"],t=["/Applications/Microsoft Edge.app"],n=await this.findLaunchRegisteredApps("Microsoft Edge[A-Za-z ]*.app",t,e);return(0,z4.sort)(n,this.createPriorities([{name:"Microsoft Edge.app",weight:0,quality:"stable"},{name:"Microsoft Edge Canary.app",weight:1,quality:"canary"},{name:"Microsoft Edge Beta.app",weight:2,quality:"beta"},{name:"Microsoft Edge Dev.app",weight:3,quality:"dev"}]))}getPreferredPath(){return this.env.EDGE_PATH}};Ch.DarwinEdgeBrowserFinder=hv});var KC=v(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});Dh.DarwinFirefoxBrowserFinder=void 0;var Y4=Si(),Q4=Lh(),mv=class extends Q4.DarwinFinderBase{constructor(){super(...arguments),this.wellKnownPaths=[{path:"/Applications/Firefox.app/Contents/MacOS/firefox",quality:"stable"},{path:"/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox",quality:"dev"},{path:"/Applications/Firefox Nightly.app/Contents/MacOS/firefox",quality:"canary"}]}async findAllInner(){let e=["/Contents/MacOS/firefox"],t=["/Applications/Firefox.app"],n=await this.findLaunchRegisteredApps("Firefox[A-Za-z ]*.app",t,e);return(0,Y4.sort)(n,this.createPriorities([{name:"Firefox.app",weight:0,quality:"stable"},{name:"Firefox Nightly.app",weight:1,quality:"canary"},{name:"Firefox Developer Edition.app",weight:2,quality:"dev"}]))}getPreferredPath(){return this.env.FIREFOX_PATH}};Dh.DarwinFirefoxBrowserFinder=mv});var Mh=v(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});Th.LinuxChromeBrowserFinder=void 0;var Z4=H("path"),hc=Si(),Hv=H("child_process"),e5=H("os"),t5=H("fs"),XC=/\r?\n/,gv=class{constructor(e=process.env,t=t5.promises){this.env=e,this.fs=t,this.pathEnvironmentVar="CHROME_PATH",this.priorities=[{regex:/chrome-wrapper$/,weight:54,quality:"custom"},{regex:/google-chrome-dev$/,weight:53,quality:"dev"},{regex:/google-chrome-canary$/,weight:52,quality:"canary"},{regex:/google-chrome-unstable$/,weight:51,quality:"canary"},{regex:/google-chrome-canary$/,weight:51,quality:"canary"},{regex:/google-chrome-stable$/,weight:50,quality:"stable"},{regex:/(google-)?chrome$/,weight:49,quality:"stable"},{regex:/chromium-browser$/,weight:48,quality:"custom"},{regex:/chromium$/,weight:47,quality:"custom"}],this.executablesOnPath=["google-chrome-unstable","google-chrome-dev","google-chrome-beta","google-chrome-canary","google-chrome-stable","google-chrome","chromium-browser","chromium"]}async findWhere(e){return(await this.findAll()).find(e)}async findAll(){let e=new Set,t=this.env[this.pathEnvironmentVar];t&&await(0,hc.canAccess)(this.fs,t)&&e.add(t),[Z4.posix.join((0,e5.homedir)(),".local/share/applications/"),"/usr/share/applications/","/usr/bin","/opt/google"].forEach(s=>{for(let a in this.findChromeExecutables(s))e.add(a)}),await Promise.all(this.executablesOnPath.map(async s=>{try{let a=(0,Hv.execFileSync)("which",[s],{stdio:"pipe"}).toString().split(XC)[0];await(0,hc.canAccess)(this.fs,a)&&e.add(a)}catch{}}));let o=t?[{regex:new RegExp((0,hc.escapeRegexSpecialChars)(t)),weight:101,quality:"custom"}].concat(this.priorities):this.priorities;return(0,hc.sort)(e,o)}async findChromeExecutables(e){let t=/(^[^ ]+).*/,n=`^Exec=/.*/(${this.executablesOnPath.join("|")})-.*`,i=[];if(await(0,hc.canAccess)(this.fs,e)){let o;try{o=(0,Hv.execSync)(`grep -ERI "${n}" ${e} | awk -F '=' '{print $2}'`)}catch{o=(0,Hv.execSync)(`grep -Er "${n}" ${e} | awk -F '=' '{print $2}'`)}let s=o.toString().split(XC).map(a=>a.replace(t,"$1"));await Promise.all(s.map(async a=>{await(0,hc.canAccess)(this.fs,a)&&i.push(a)}))}return i}};Th.LinuxChromeBrowserFinder=gv});var zC=v(Rh=>{"use strict";Object.defineProperty(Rh,"__esModule",{value:!0});Rh.LinuxEdgeBrowserFinder=void 0;var r5=Mh(),yv=class extends r5.LinuxChromeBrowserFinder{constructor(){super(...arguments),this.pathEnvironmentVar="EDGE_PATH",this.executablesOnPath=["microsoft-edge-dev","microsoft-edge-beta","microsoft-edge-stable","microsoft-edge"],this.priorities=[{regex:/microsoft-edge\-wrapper$/,weight:52,quality:"custom"},{regex:/microsoft-edge\-dev$/,weight:51,quality:"dev"},{regex:/microsoft-edge\-beta$/,weight:51,quality:"beta"},{regex:/microsoft-edge\-stable$/,weight:50,quality:"stable"},{regex:/microsoft-edge$/,weight:49,quality:"stable"}]}};Rh.LinuxEdgeBrowserFinder=yv});var JC=v(kh=>{"use strict";Object.defineProperty(kh,"__esModule",{value:!0});kh.LinuxFirefoxBrowserFinder=void 0;var n5=Mh(),bv=class extends n5.LinuxChromeBrowserFinder{constructor(){super(...arguments),this.pathEnvironmentVar="FIREFOX_PATH",this.executablesOnPath=["firefox-aurora","firefox-dev","firefox-developer","firefox-trunk","firefox-nightly","firefox"],this.priorities=[{regex:/firefox\-aurora$/,weight:51,quality:"dev"},{regex:/firefox\-dev$/,weight:51,quality:"dev"},{regex:/firefox\-developer$/,weight:51,quality:"dev"},{regex:/firefox\-trunk'$/,weight:50,quality:"canary"},{regex:/firefox\-nightly'$/,weight:50,quality:"canary"},{regex:/firefox$/,weight:49,quality:"stable"}]}};kh.LinuxFirefoxBrowserFinder=bv});var QC=v(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.WindowsChromeBrowserFinder=void 0;var i5=H("path"),YC=Si(),o5=H("fs"),vv=class{constructor(e=process.env,t=o5.promises){this.env=e,this.fs=t}async findWhere(e){return(await this.findAll()).find(e)}async findAll(){let e=i5.win32.sep,t=[{name:`${e}Google${e}Chrome Dev${e}Application${e}chrome.exe`,type:"dev"},{name:`${e}Google${e}Chrome SxS${e}Application${e}chrome.exe`,type:"canary"},{name:`${e}Google${e}Chrome Beta${e}Application${e}chrome.exe`,type:"beta"},{name:`${e}Google${e}Chrome${e}Application${e}chrome.exe`,type:"stable"}],n=await(0,YC.findWindowsCandidates)(this.env,this.fs,t),i=await(0,YC.preferredChromePath)(this.fs,this.env);return i&&n.unshift({path:i,quality:"custom"}),n}};Oh.WindowsChromeBrowserFinder=vv});var eD=v(Nh=>{"use strict";Object.defineProperty(Nh,"__esModule",{value:!0});Nh.WindowsEdgeBrowserFinder=void 0;var kt=H("path"),s5=H("fs"),ZC=Si(),Iv=class{constructor(e=process.env,t=s5.promises){this.env=e,this.fs=t}async findWhere(e){return(await this.findAll()).find(e)}async findAll(){let e=[{name:`${kt.sep}Microsoft${kt.sep}Edge SxS${kt.sep}Application${kt.sep}msedge.exe`,type:"canary"},{name:`${kt.sep}Microsoft${kt.sep}Edge Dev${kt.sep}Application${kt.sep}msedge.exe`,type:"dev"},{name:`${kt.sep}Microsoft${kt.sep}Edge Beta${kt.sep}Application${kt.sep}msedge.exe`,type:"beta"},{name:`${kt.sep}Microsoft${kt.sep}Edge${kt.sep}Application${kt.sep}msedge.exe`,type:"stable"}],t=await(0,ZC.findWindowsCandidates)(this.env,this.fs,e),n=await(0,ZC.preferredEdgePath)(this.fs,this.env);return n&&t.unshift({path:n,quality:"custom"}),t}};Nh.WindowsEdgeBrowserFinder=Iv});var rD=v(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});Bh.WindowsFirefoxBrowserFinder=void 0;var a5=H("path"),tD=Si(),c5=H("fs"),_v=class{constructor(e=process.env,t=c5.promises){this.env=e,this.fs=t}async findWhere(e){return(await this.findAll()).find(e)}async findAll(){let e=a5.win32.sep,t=[{name:`${e}Firefox Developer Edition${e}firefox.exe`,type:"dev"},{name:`${e}Firefox Nightly${e}firefox.exe`,type:"canary"},{name:`${e}Mozilla Firefox${e}firefox.exe`,type:"stable"}],n=await(0,tD.findWindowsCandidates)(this.env,this.fs,t),i=await(0,tD.preferredFirefoxPath)(this.fs,this.env);return i&&n.unshift({path:i,quality:"custom"}),n}};Bh.WindowsFirefoxBrowserFinder=_v});var Av=v(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.FirefoxBrowserFinder=mr.EdgeBrowserFinder=mr.ChromeBrowserFinder=mr.isQuality=mr.allQualities=void 0;var u5=qC(),l5=GC(),p5=KC(),d5=Mh(),f5=zC(),h5=JC(),m5=QC(),H5=eD(),g5=rD(),y5={canary:null,stable:null,beta:null,dev:null,custom:null};mr.allQualities=new Set(Object.keys(y5));var b5=r=>mr.allQualities.has(r);mr.isQuality=b5;mr.ChromeBrowserFinder=process.platform==="win32"?m5.WindowsChromeBrowserFinder:process.platform==="darwin"?u5.DarwinChromeBrowserFinder:d5.LinuxChromeBrowserFinder;mr.EdgeBrowserFinder=process.platform==="win32"?H5.WindowsEdgeBrowserFinder:process.platform==="darwin"?l5.DarwinEdgeBrowserFinder:f5.LinuxEdgeBrowserFinder;mr.FirefoxBrowserFinder=process.platform==="win32"?g5.WindowsFirefoxBrowserFinder:process.platform==="darwin"?p5.DarwinFirefoxBrowserFinder:h5.LinuxFirefoxBrowserFinder});var cD=v(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});jh.dataUriToBuffer=void 0;function I5(r){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=[];for(let o=0;o<r.length;o+=4){let s=e.indexOf(r.charAt(o)),a=e.indexOf(r.charAt(o+1)),c=r.charAt(o+2)==="="?0:e.indexOf(r.charAt(o+2)),u=r.charAt(o+3)==="="?0:e.indexOf(r.charAt(o+3)),l=s<<2|a>>4,p=(a&15)<<4|c>>2,d=(c&3)<<6|u;t.push(l),r.charAt(o+2)!=="="&&t.push(p),r.charAt(o+3)!=="="&&t.push(d)}let n=new ArrayBuffer(t.length);return new Uint8Array(n).set(t),n}function _5(r){let e=new ArrayBuffer(r.length),t=new Uint8Array(e);for(let n=0;n<r.length;n++)t[n]=r.charCodeAt(n);return e}function A5(r){if(r=String(r),!/^data:/i.test(r))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');r=r.replace(/\r?\n/g,"");let e=r.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let t=r.substring(5,e).split(";"),n="",i=!1,o=t[0]||"text/plain",s=o;for(let u=1;u<t.length;u++)t[u]==="base64"?i=!0:t[u]&&(s+=`;${t[u]}`,t[u].indexOf("charset=")===0&&(n=t[u].substring(8)));!t[0]&&!n.length&&(s+=";charset=US-ASCII",n="US-ASCII");let a=unescape(r.substring(e+1)),c=i?I5(a):_5(a);return{type:o,typeFull:s,charset:n,buffer:c}}jh.dataUriToBuffer=A5});var xi=v((Ei,Vh)=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});var uD=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function w5(r){return uD.includes(r)}var S5=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...uD];function E5(r){return S5.includes(r)}var x5=["null","undefined","string","number","bigint","boolean","symbol"];function P5(r){return x5.includes(r)}function gc(r){return e=>typeof e===r}var{toString:lD}=Object.prototype,Dl=r=>{let e=lD.call(r).slice(8,-1);if(/HTML\w+Element/.test(e)&&b.domElement(r))return"HTMLElement";if(E5(e))return e},Ee=r=>e=>Dl(e)===r;function b(r){if(r===null)return"null";switch(typeof r){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(b.observable(r))return"Observable";if(b.array(r))return"Array";if(b.buffer(r))return"Buffer";let e=Dl(r);if(e)return e;if(r instanceof String||r instanceof Boolean||r instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}b.undefined=gc("undefined");b.string=gc("string");var L5=gc("number");b.number=r=>L5(r)&&!b.nan(r);b.bigint=gc("bigint");b.function_=gc("function");b.null_=r=>r===null;b.class_=r=>b.function_(r)&&r.toString().startsWith("class ");b.boolean=r=>r===!0||r===!1;b.symbol=gc("symbol");b.numericString=r=>b.string(r)&&!b.emptyStringOrWhitespace(r)&&!Number.isNaN(Number(r));b.array=(r,e)=>Array.isArray(r)?b.function_(e)?r.every(e):!0:!1;b.buffer=r=>{var e,t,n,i;return(i=(n=(t=(e=r)===null||e===void 0?void 0:e.constructor)===null||t===void 0?void 0:t.isBuffer)===null||n===void 0?void 0:n.call(t,r))!==null&&i!==void 0?i:!1};b.blob=r=>Ee("Blob")(r);b.nullOrUndefined=r=>b.null_(r)||b.undefined(r);b.object=r=>!b.null_(r)&&(typeof r=="object"||b.function_(r));b.iterable=r=>{var e;return b.function_((e=r)===null||e===void 0?void 0:e[Symbol.iterator])};b.asyncIterable=r=>{var e;return b.function_((e=r)===null||e===void 0?void 0:e[Symbol.asyncIterator])};b.generator=r=>{var e,t;return b.iterable(r)&&b.function_((e=r)===null||e===void 0?void 0:e.next)&&b.function_((t=r)===null||t===void 0?void 0:t.throw)};b.asyncGenerator=r=>b.asyncIterable(r)&&b.function_(r.next)&&b.function_(r.throw);b.nativePromise=r=>Ee("Promise")(r);var $5=r=>{var e,t;return b.function_((e=r)===null||e===void 0?void 0:e.then)&&b.function_((t=r)===null||t===void 0?void 0:t.catch)};b.promise=r=>b.nativePromise(r)||$5(r);b.generatorFunction=Ee("GeneratorFunction");b.asyncGeneratorFunction=r=>Dl(r)==="AsyncGeneratorFunction";b.asyncFunction=r=>Dl(r)==="AsyncFunction";b.boundFunction=r=>b.function_(r)&&!r.hasOwnProperty("prototype");b.regExp=Ee("RegExp");b.date=Ee("Date");b.error=Ee("Error");b.map=r=>Ee("Map")(r);b.set=r=>Ee("Set")(r);b.weakMap=r=>Ee("WeakMap")(r);b.weakSet=r=>Ee("WeakSet")(r);b.int8Array=Ee("Int8Array");b.uint8Array=Ee("Uint8Array");b.uint8ClampedArray=Ee("Uint8ClampedArray");b.int16Array=Ee("Int16Array");b.uint16Array=Ee("Uint16Array");b.int32Array=Ee("Int32Array");b.uint32Array=Ee("Uint32Array");b.float32Array=Ee("Float32Array");b.float64Array=Ee("Float64Array");b.bigInt64Array=Ee("BigInt64Array");b.bigUint64Array=Ee("BigUint64Array");b.arrayBuffer=Ee("ArrayBuffer");b.sharedArrayBuffer=Ee("SharedArrayBuffer");b.dataView=Ee("DataView");b.enumCase=(r,e)=>Object.values(e).includes(r);b.directInstanceOf=(r,e)=>Object.getPrototypeOf(r)===e.prototype;b.urlInstance=r=>Ee("URL")(r);b.urlString=r=>{if(!b.string(r))return!1;try{return new URL(r),!0}catch{return!1}};b.truthy=r=>!!r;b.falsy=r=>!r;b.nan=r=>Number.isNaN(r);b.primitive=r=>b.null_(r)||P5(typeof r);b.integer=r=>Number.isInteger(r);b.safeInteger=r=>Number.isSafeInteger(r);b.plainObject=r=>{if(lD.call(r)!=="[object Object]")return!1;let e=Object.getPrototypeOf(r);return e===null||e===Object.getPrototypeOf({})};b.typedArray=r=>w5(Dl(r));var C5=r=>b.safeInteger(r)&&r>=0;b.arrayLike=r=>!b.nullOrUndefined(r)&&!b.function_(r)&&C5(r.length);b.inRange=(r,e)=>{if(b.number(e))return r>=Math.min(0,e)&&r<=Math.max(e,0);if(b.array(e)&&e.length===2)return r>=Math.min(...e)&&r<=Math.max(...e);throw new TypeError(`Invalid range: ${JSON.stringify(e)}`)};var D5=1,T5=["innerHTML","ownerDocument","style","attributes","nodeValue"];b.domElement=r=>b.object(r)&&r.nodeType===D5&&b.string(r.nodeName)&&!b.plainObject(r)&&T5.every(e=>e in r);b.observable=r=>{var e,t,n,i;return r?r===((t=(e=r)[Symbol.observable])===null||t===void 0?void 0:t.call(e))||r===((i=(n=r)["@@observable"])===null||i===void 0?void 0:i.call(n)):!1};b.nodeStream=r=>b.object(r)&&b.function_(r.pipe)&&!b.observable(r);b.infinite=r=>r===1/0||r===-1/0;var pD=r=>e=>b.integer(e)&&Math.abs(e%2)===r;b.evenInteger=pD(0);b.oddInteger=pD(1);b.emptyArray=r=>b.array(r)&&r.length===0;b.nonEmptyArray=r=>b.array(r)&&r.length>0;b.emptyString=r=>b.string(r)&&r.length===0;var M5=r=>b.string(r)&&!/\S/.test(r);b.emptyStringOrWhitespace=r=>b.emptyString(r)||M5(r);b.nonEmptyString=r=>b.string(r)&&r.length>0;b.nonEmptyStringAndNotWhitespace=r=>b.string(r)&&!b.emptyStringOrWhitespace(r);b.emptyObject=r=>b.object(r)&&!b.map(r)&&!b.set(r)&&Object.keys(r).length===0;b.nonEmptyObject=r=>b.object(r)&&!b.map(r)&&!b.set(r)&&Object.keys(r).length>0;b.emptySet=r=>b.set(r)&&r.size===0;b.nonEmptySet=r=>b.set(r)&&r.size>0;b.emptyMap=r=>b.map(r)&&r.size===0;b.nonEmptyMap=r=>b.map(r)&&r.size>0;b.propertyKey=r=>b.any([b.string,b.number,b.symbol],r);b.formData=r=>Ee("FormData")(r);b.urlSearchParams=r=>Ee("URLSearchParams")(r);var dD=(r,e,t)=>{if(!b.function_(e))throw new TypeError(`Invalid predicate: ${JSON.stringify(e)}`);if(t.length===0)throw new TypeError("Invalid number of values");return r.call(t,e)};b.any=(r,...e)=>(b.array(r)?r:[r]).some(n=>dD(Array.prototype.some,n,e));b.all=(r,...e)=>dD(Array.prototype.every,r,e);var R=(r,e,t,n={})=>{if(!r){let{multipleValues:i}=n,o=i?`received values of types ${[...new Set(t.map(s=>`\`${b(s)}\``))].join(", ")}`:`received value of type \`${b(t)}\``;throw new TypeError(`Expected value which is \`${e}\`, ${o}.`)}};Ei.assert={undefined:r=>R(b.undefined(r),"undefined",r),string:r=>R(b.string(r),"string",r),number:r=>R(b.number(r),"number",r),bigint:r=>R(b.bigint(r),"bigint",r),function_:r=>R(b.function_(r),"Function",r),null_:r=>R(b.null_(r),"null",r),class_:r=>R(b.class_(r),"Class",r),boolean:r=>R(b.boolean(r),"boolean",r),symbol:r=>R(b.symbol(r),"symbol",r),numericString:r=>R(b.numericString(r),"string with a number",r),array:(r,e)=>{R(b.array(r),"Array",r),e&&r.forEach(e)},buffer:r=>R(b.buffer(r),"Buffer",r),blob:r=>R(b.blob(r),"Blob",r),nullOrUndefined:r=>R(b.nullOrUndefined(r),"null or undefined",r),object:r=>R(b.object(r),"Object",r),iterable:r=>R(b.iterable(r),"Iterable",r),asyncIterable:r=>R(b.asyncIterable(r),"AsyncIterable",r),generator:r=>R(b.generator(r),"Generator",r),asyncGenerator:r=>R(b.asyncGenerator(r),"AsyncGenerator",r),nativePromise:r=>R(b.nativePromise(r),"native Promise",r),promise:r=>R(b.promise(r),"Promise",r),generatorFunction:r=>R(b.generatorFunction(r),"GeneratorFunction",r),asyncGeneratorFunction:r=>R(b.asyncGeneratorFunction(r),"AsyncGeneratorFunction",r),asyncFunction:r=>R(b.asyncFunction(r),"AsyncFunction",r),boundFunction:r=>R(b.boundFunction(r),"Function",r),regExp:r=>R(b.regExp(r),"RegExp",r),date:r=>R(b.date(r),"Date",r),error:r=>R(b.error(r),"Error",r),map:r=>R(b.map(r),"Map",r),set:r=>R(b.set(r),"Set",r),weakMap:r=>R(b.weakMap(r),"WeakMap",r),weakSet:r=>R(b.weakSet(r),"WeakSet",r),int8Array:r=>R(b.int8Array(r),"Int8Array",r),uint8Array:r=>R(b.uint8Array(r),"Uint8Array",r),uint8ClampedArray:r=>R(b.uint8ClampedArray(r),"Uint8ClampedArray",r),int16Array:r=>R(b.int16Array(r),"Int16Array",r),uint16Array:r=>R(b.uint16Array(r),"Uint16Array",r),int32Array:r=>R(b.int32Array(r),"Int32Array",r),uint32Array:r=>R(b.uint32Array(r),"Uint32Array",r),float32Array:r=>R(b.float32Array(r),"Float32Array",r),float64Array:r=>R(b.float64Array(r),"Float64Array",r),bigInt64Array:r=>R(b.bigInt64Array(r),"BigInt64Array",r),bigUint64Array:r=>R(b.bigUint64Array(r),"BigUint64Array",r),arrayBuffer:r=>R(b.arrayBuffer(r),"ArrayBuffer",r),sharedArrayBuffer:r=>R(b.sharedArrayBuffer(r),"SharedArrayBuffer",r),dataView:r=>R(b.dataView(r),"DataView",r),enumCase:(r,e)=>R(b.enumCase(r,e),"EnumCase",r),urlInstance:r=>R(b.urlInstance(r),"URL",r),urlString:r=>R(b.urlString(r),"string with a URL",r),truthy:r=>R(b.truthy(r),"truthy",r),falsy:r=>R(b.falsy(r),"falsy",r),nan:r=>R(b.nan(r),"NaN",r),primitive:r=>R(b.primitive(r),"primitive",r),integer:r=>R(b.integer(r),"integer",r),safeInteger:r=>R(b.safeInteger(r),"integer",r),plainObject:r=>R(b.plainObject(r),"plain object",r),typedArray:r=>R(b.typedArray(r),"TypedArray",r),arrayLike:r=>R(b.arrayLike(r),"array-like",r),domElement:r=>R(b.domElement(r),"HTMLElement",r),observable:r=>R(b.observable(r),"Observable",r),nodeStream:r=>R(b.nodeStream(r),"Node.js Stream",r),infinite:r=>R(b.infinite(r),"infinite number",r),emptyArray:r=>R(b.emptyArray(r),"empty array",r),nonEmptyArray:r=>R(b.nonEmptyArray(r),"non-empty array",r),emptyString:r=>R(b.emptyString(r),"empty string",r),emptyStringOrWhitespace:r=>R(b.emptyStringOrWhitespace(r),"empty string or whitespace",r),nonEmptyString:r=>R(b.nonEmptyString(r),"non-empty string",r),nonEmptyStringAndNotWhitespace:r=>R(b.nonEmptyStringAndNotWhitespace(r),"non-empty string and not whitespace",r),emptyObject:r=>R(b.emptyObject(r),"empty object",r),nonEmptyObject:r=>R(b.nonEmptyObject(r),"non-empty object",r),emptySet:r=>R(b.emptySet(r),"empty set",r),nonEmptySet:r=>R(b.nonEmptySet(r),"non-empty set",r),emptyMap:r=>R(b.emptyMap(r),"empty map",r),nonEmptyMap:r=>R(b.nonEmptyMap(r),"non-empty map",r),propertyKey:r=>R(b.propertyKey(r),"PropertyKey",r),formData:r=>R(b.formData(r),"FormData",r),urlSearchParams:r=>R(b.urlSearchParams(r),"URLSearchParams",r),evenInteger:r=>R(b.evenInteger(r),"even integer",r),oddInteger:r=>R(b.oddInteger(r),"odd integer",r),directInstanceOf:(r,e)=>R(b.directInstanceOf(r,e),"T",r),inRange:(r,e)=>R(b.inRange(r,e),"in range",r),any:(r,...e)=>R(b.any(r,...e),"predicate returns truthy for any value",e,{multipleValues:!0}),all:(r,...e)=>R(b.all(r,...e),"predicate returns truthy for all values",e,{multipleValues:!0})};Object.defineProperties(b,{class:{value:b.class_},function:{value:b.function_},null:{value:b.null_}});Object.defineProperties(Ei.assert,{class:{value:Ei.assert.class_},function:{value:Ei.assert.function_},null:{value:Ei.assert.null_}});Ei.default=b;Vh.exports=b;Vh.exports.default=b;Vh.exports.assert=Ei.assert});var fD=v((Fle,Sv)=>{"use strict";var qh=class extends Error{constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},Gh=class r{static fn(e){return(...t)=>new r((n,i,o)=>{t.push(o),e(...t).then(n,i)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((t,n)=>{this._reject=n;let i=a=>{(!this._isCanceled||!s.shouldReject)&&(this._isPending=!1,t(a))},o=a=>{this._isPending=!1,n(a)},s=a=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(a)};return Object.defineProperties(s,{shouldReject:{get:()=>this._rejectOnCancel,set:a=>{this._rejectOnCancel=a}}}),e(i,o,s)})}then(e,t){return this._promise.then(e,t)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!(!this._isPending||this._isCanceled)){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(let t of this._cancelHandlers)t()}catch(t){this._reject(t);return}this._rejectOnCancel&&this._reject(new qh(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(Gh.prototype,Promise.prototype);Sv.exports=Gh;Sv.exports.CancelError=qh});var hD=v((xv,Pv)=>{"use strict";Object.defineProperty(xv,"__esModule",{value:!0});function R5(r){return r.encrypted}var Ev=(r,e)=>{let t;typeof e=="function"?t={connect:e}:t=e;let n=typeof t.connect=="function",i=typeof t.secureConnect=="function",o=typeof t.close=="function",s=()=>{n&&t.connect(),R5(r)&&i&&(r.authorized?t.secureConnect():r.authorizationError||r.once("secureConnect",t.secureConnect)),o&&r.once("close",t.close)};r.writable&&!r.connecting?s():r.connecting?r.once("connect",s):r.destroyed&&o&&t.close(r._hadError)};xv.default=Ev;Pv.exports=Ev;Pv.exports.default=Ev});var mD=v(($v,Cv)=>{"use strict";Object.defineProperty($v,"__esModule",{value:!0});var k5=hD(),O5=H("util"),N5=Number(process.versions.node.split(".")[0]),Lv=r=>{if(r.timings)return r.timings;let e={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};r.timings=e;let t=a=>{let c=a.emit.bind(a);a.emit=(u,...l)=>(u==="error"&&(e.error=Date.now(),e.phases.total=e.error-e.start,a.emit=c),c(u,...l))};t(r);let n=()=>{e.abort=Date.now(),(!e.response||N5>=13)&&(e.phases.total=Date.now()-e.start)};r.prependOnceListener("abort",n);let i=a=>{if(e.socket=Date.now(),e.phases.wait=e.socket-e.start,O5.types.isProxy(a))return;let c=()=>{e.lookup=Date.now(),e.phases.dns=e.lookup-e.socket};a.prependOnceListener("lookup",c),k5.default(a,{connect:()=>{e.connect=Date.now(),e.lookup===void 0&&(a.removeListener("lookup",c),e.lookup=e.connect,e.phases.dns=e.lookup-e.socket),e.phases.tcp=e.connect-e.lookup},secureConnect:()=>{e.secureConnect=Date.now(),e.phases.tls=e.secureConnect-e.connect}})};r.socket?i(r.socket):r.prependOnceListener("socket",i);let o=()=>{var a;e.upload=Date.now(),e.phases.request=e.upload-((a=e.secureConnect)!==null&&a!==void 0?a:e.connect)};return(typeof r.writableFinished=="boolean"?r.writableFinished:r.finished&&r.outputSize===0&&(!r.socket||r.socket.writableLength===0))?o():r.prependOnceListener("finish",o),r.prependOnceListener("response",a=>{e.response=Date.now(),e.phases.firstByte=e.response-e.upload,a.timings=e,t(a),a.prependOnceListener("end",()=>{e.end=Date.now(),e.phases.download=e.end-e.response,e.phases.total=e.end-e.start}),a.prependOnceListener("aborted",n)}),e};$v.default=Lv;Cv.exports=Lv;Cv.exports.default=Lv});var _D=v((Ule,Mv)=>{"use strict";var{V4MAPPED:B5,ADDRCONFIG:F5,ALL:ID,promises:{Resolver:HD},lookup:U5}=H("dns"),{promisify:Dv}=H("util"),W5=H("os"),yc=Symbol("cacheableLookupCreateConnection"),Tv=Symbol("cacheableLookupInstance"),gD=Symbol("expires"),j5=typeof ID=="number",yD=r=>{if(!(r&&typeof r.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},V5=r=>{for(let e of r)e.family!==6&&(e.address=`::ffff:${e.address}`,e.family=6)},bD=()=>{let r=!1,e=!1;for(let t of Object.values(W5.networkInterfaces()))for(let n of t)if(!n.internal&&(n.family==="IPv6"?e=!0:r=!0,r&&e))return{has4:r,has6:e};return{has4:r,has6:e}},q5=r=>Symbol.iterator in r,vD={ttl:!0},G5={all:!0},Kh=class{constructor({cache:e=new Map,maxTtl:t=1/0,fallbackDuration:n=3600,errorTtl:i=.15,resolver:o=new HD,lookup:s=U5}={}){if(this.maxTtl=t,this.errorTtl=i,this._cache=e,this._resolver=o,this._dnsLookup=Dv(s),this._resolver instanceof HD?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=Dv(this._resolver.resolve4.bind(this._resolver)),this._resolve6=Dv(this._resolver.resolve6.bind(this._resolver))),this._iface=bD(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,n<1)this._fallback=!1;else{this._fallback=!0;let a=setInterval(()=>{this._hostnamesToFallback.clear()},n*1e3);a.unref&&a.unref()}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this.clear(),this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,t,n){if(typeof t=="function"?(n=t,t={}):typeof t=="number"&&(t={family:t}),!n)throw new Error("Callback must be a function.");this.lookupAsync(e,t).then(i=>{t.all?n(null,i):n(null,i.address,i.family,i.expires,i.ttl)},n)}async lookupAsync(e,t={}){typeof t=="number"&&(t={family:t});let n=await this.query(e);if(t.family===6){let i=n.filter(o=>o.family===6);t.hints&B5&&(j5&&t.hints&ID||i.length===0)?V5(n):n=i}else t.family===4&&(n=n.filter(i=>i.family===4));if(t.hints&F5){let{_iface:i}=this;n=n.filter(o=>o.family===6?i.has6:i.has4)}if(n.length===0){let i=new Error(`cacheableLookup ENOTFOUND ${e}`);throw i.code="ENOTFOUND",i.hostname=e,i}return t.all?n:n[0]}async query(e){let t=await this._cache.get(e);if(!t){let n=this._pending[e];if(n)t=await n;else{let i=this.queryAndCache(e);this._pending[e]=i;try{t=await i}finally{delete this._pending[e]}}}return t=t.map(n=>({...n})),t}async _resolve(e){let t=async u=>{try{return await u}catch(l){if(l.code==="ENODATA"||l.code==="ENOTFOUND")return[];throw l}},[n,i]=await Promise.all([this._resolve4(e,vD),this._resolve6(e,vD)].map(u=>t(u))),o=0,s=0,a=0,c=Date.now();for(let u of n)u.family=4,u.expires=c+u.ttl*1e3,o=Math.max(o,u.ttl);for(let u of i)u.family=6,u.expires=c+u.ttl*1e3,s=Math.max(s,u.ttl);return n.length>0?i.length>0?a=Math.min(o,s):a=o:a=s,{entries:[...n,...i],cacheTtl:a}}async _lookup(e){try{return{entries:await this._dnsLookup(e,{all:!0}),cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(e,t,n){if(this.maxTtl>0&&n>0){n=Math.min(n,this.maxTtl)*1e3,t[gD]=Date.now()+n;try{await this._cache.set(e,t,n)}catch(i){this.lookupAsync=async()=>{let o=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw o.cause=i,o}}q5(this._cache)&&this._tick(n)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,G5);let t=await this._resolve(e);t.entries.length===0&&this._fallback&&(t=await this._lookup(e),t.entries.length!==0&&this._hostnamesToFallback.add(e));let n=t.entries.length===0?this.errorTtl:t.cacheTtl;return await this._set(e,t.entries,n),t.entries}_tick(e){let t=this._nextRemovalTime;(!t||e<t)&&(clearTimeout(this._removalTimeout),this._nextRemovalTime=e,this._removalTimeout=setTimeout(()=>{this._nextRemovalTime=!1;let n=1/0,i=Date.now();for(let[o,s]of this._cache){let a=s[gD];i>=a?this._cache.delete(o):a<n&&(n=a)}n!==1/0&&this._tick(n-i)},e),this._removalTimeout.unref&&this._removalTimeout.unref())}install(e){if(yD(e),yc in e)throw new Error("CacheableLookup has been already installed");e[yc]=e.createConnection,e[Tv]=this,e.createConnection=(t,n)=>("lookup"in t||(t.lookup=this.lookup),e[yc](t,n))}uninstall(e){if(yD(e),e[yc]){if(e[Tv]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[yc],delete e[yc],delete e[Tv]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=bD(),(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6)&&this._cache.clear()}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}};Mv.exports=Kh;Mv.exports.default=Kh});var SD=v((Wle,wD)=>{"use strict";var K5="text/plain",X5="us-ascii",AD=(r,e)=>e.some(t=>t instanceof RegExp?t.test(r):t===r),z5=(r,{stripHash:e})=>{let t=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(r);if(!t)throw new Error(`Invalid URL: ${r}`);let{type:n,data:i,hash:o}=t.groups,s=n.split(";");o=e?"":o;let a=!1;s[s.length-1]==="base64"&&(s.pop(),a=!0);let c=(s.shift()||"").toLowerCase(),l=[...s.map(p=>{let[d,f=""]=p.split("=").map(h=>h.trim());return d==="charset"&&(f=f.toLowerCase(),f===X5)?"":`${d}${f?`=${f}`:""}`}).filter(Boolean)];return a&&l.push("base64"),(l.length!==0||c&&c!==K5)&&l.unshift(c),`data:${l.join(";")},${a?i.trim():i}${o?`#${o}`:""}`},J5=(r,e)=>{if(e={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},r=r.trim(),/^data:/i.test(r))return z5(r,e);if(/^view-source:/i.test(r))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let t=r.startsWith("//");!t&&/^\.*\//.test(r)||(r=r.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let i=new URL(r);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&i.protocol==="https:"&&(i.protocol="http:"),e.forceHttps&&i.protocol==="http:"&&(i.protocol="https:"),e.stripAuthentication&&(i.username="",i.password=""),e.stripHash?i.hash="":e.stripTextFragment&&(i.hash=i.hash.replace(/#?:~:text.*?$/i,"")),i.pathname&&(i.pathname=i.pathname.replace(/(?<!\b(?:[a-z][a-z\d+\-.]{1,50}:))\/{2,}/g,"/")),i.pathname)try{i.pathname=decodeURI(i.pathname)}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let s=i.pathname.split("/"),a=s[s.length-1];AD(a,e.removeDirectoryIndex)&&(s=s.slice(0,s.length-1),i.pathname=s.slice(1).join("/")+"/")}if(i.hostname&&(i.hostname=i.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)(?:[a-z\-\d]{1,63})\.(?:[a-z.\-\d]{2,63})$/.test(i.hostname)&&(i.hostname=i.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let s of[...i.searchParams.keys()])AD(s,e.removeQueryParameters)&&i.searchParams.delete(s);e.removeQueryParameters===!0&&(i.search=""),e.sortQueryParameters&&i.searchParams.sort(),e.removeTrailingSlash&&(i.pathname=i.pathname.replace(/\/$/,""));let o=r;return r=i.toString(),!e.removeSingleSlash&&i.pathname==="/"&&!o.endsWith("/")&&i.hash===""&&(r=r.replace(/\/$/,"")),(e.removeTrailingSlash||i.pathname==="/")&&i.hash===""&&e.removeSingleSlash&&(r=r.replace(/\/$/,"")),t&&!e.normalizeProtocol&&(r=r.replace(/^http:\/\//,"//")),e.stripProtocol&&(r=r.replace(/^(?:https?:)?\/\//,"")),r};wD.exports=J5});var PD=v((jle,xD)=>{xD.exports=ED;function ED(r,e){if(r&&e)return ED(r)(e);if(typeof r!="function")throw new TypeError("need wrapper function");return Object.keys(r).forEach(function(n){t[n]=r[n]}),t;function t(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var o=r.apply(this,n),s=n[n.length-1];return typeof o=="function"&&o!==s&&Object.keys(s).forEach(function(a){o[a]=s[a]}),o}}});var kv=v((Vle,Rv)=>{var LD=PD();Rv.exports=LD(Xh);Rv.exports.strict=LD($D);Xh.proto=Xh(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Xh(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return $D(this)},configurable:!0})});function Xh(r){var e=function(){return e.called?e.value:(e.called=!0,e.value=r.apply(this,arguments))};return e.called=!1,e}function $D(r){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=r.apply(this,arguments)},t=r.name||"Function wrapped with `once`";return e.onceError=t+" shouldn't be called more than once",e.called=!1,e}});var TD=v((qle,DD)=>{var Y5=kv(),Q5=function(){},Z5=function(r){return r.setHeader&&typeof r.abort=="function"},eK=function(r){return r.stdio&&Array.isArray(r.stdio)&&r.stdio.length===3},CD=function(r,e,t){if(typeof e=="function")return CD(r,null,e);e||(e={}),t=Y5(t||Q5);var n=r._writableState,i=r._readableState,o=e.readable||e.readable!==!1&&r.readable,s=e.writable||e.writable!==!1&&r.writable,a=!1,c=function(){r.writable||u()},u=function(){s=!1,o||t.call(r)},l=function(){o=!1,s||t.call(r)},p=function(y){t.call(r,y?new Error("exited with error code: "+y):null)},d=function(y){t.call(r,y)},f=function(){process.nextTick(h)},h=function(){if(!a){if(o&&!(i&&i.ended&&!i.destroyed))return t.call(r,new Error("premature close"));if(s&&!(n&&n.ended&&!n.destroyed))return t.call(r,new Error("premature close"))}},m=function(){r.req.on("finish",u)};return Z5(r)?(r.on("complete",u),r.on("abort",f),r.req?m():r.on("request",m)):s&&!n&&(r.on("end",c),r.on("close",c)),eK(r)&&r.on("exit",p),r.on("end",l),r.on("finish",u),e.error!==!1&&r.on("error",d),r.on("close",f),function(){a=!0,r.removeListener("complete",u),r.removeListener("abort",f),r.removeListener("request",m),r.req&&r.req.removeListener("finish",u),r.removeListener("end",c),r.removeListener("close",c),r.removeListener("finish",u),r.removeListener("exit",p),r.removeListener("end",l),r.removeListener("error",d),r.removeListener("close",f)}};DD.exports=CD});var kD=v((Gle,RD)=>{var tK=kv(),rK=TD(),Ov=H("fs"),Tl=function(){},nK=/^v?\.0/.test(process.version),zh=function(r){return typeof r=="function"},iK=function(r){return!nK||!Ov?!1:(r instanceof(Ov.ReadStream||Tl)||r instanceof(Ov.WriteStream||Tl))&&zh(r.close)},oK=function(r){return r.setHeader&&zh(r.abort)},sK=function(r,e,t,n){n=tK(n);var i=!1;r.on("close",function(){i=!0}),rK(r,{readable:e,writable:t},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,iK(r))return r.close(Tl);if(oK(r))return r.abort();if(zh(r.destroy))return r.destroy();n(s||new Error("stream was destroyed"))}}},MD=function(r){r()},aK=function(r,e){return r.pipe(e)},cK=function(){var r=Array.prototype.slice.call(arguments),e=zh(r[r.length-1]||Tl)&&r.pop()||Tl;if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new Error("pump requires two streams per minimum");var t,n=r.map(function(i,o){var s=o<r.length-1,a=o>0;return sK(i,s,a,function(c){t||(t=c),c&&n.forEach(MD),!s&&(n.forEach(MD),e(t))})});return r.reduce(aK)};RD.exports=cK});var ND=v((Kle,OD)=>{"use strict";var{PassThrough:uK}=H("stream");OD.exports=r=>{r={...r};let{array:e}=r,{encoding:t}=r,n=t==="buffer",i=!1;e?i=!(t||n):t=t||"utf8",n&&(t=null);let o=new uK({objectMode:i});t&&o.setEncoding(t);let s=0,a=[];return o.on("data",c=>{a.push(c),i?s=a.length:s+=c.length}),o.getBufferedValue=()=>e?a:n?Buffer.concat(a,s):a.join(""),o.getBufferedLength=()=>s,o}});var BD=v((Xle,bc)=>{"use strict";var{constants:lK}=H("buffer"),pK=kD(),dK=ND(),Jh=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function Yh(r,e){if(!r)return Promise.reject(new Error("Expected a stream"));e={maxBuffer:1/0,...e};let{maxBuffer:t}=e,n;return await new Promise((i,o)=>{let s=a=>{a&&n.getBufferedLength()<=lK.MAX_LENGTH&&(a.bufferedData=n.getBufferedValue()),o(a)};n=pK(r,dK(e),a=>{if(a){s(a);return}i()}),n.on("data",()=>{n.getBufferedLength()>t&&s(new Jh)})}),n.getBufferedValue()}bc.exports=Yh;bc.exports.default=Yh;bc.exports.buffer=(r,e)=>Yh(r,{...e,encoding:"buffer"});bc.exports.array=(r,e)=>Yh(r,{...e,array:!0});bc.exports.MaxBufferError=Jh});var UD=v((Jle,FD)=>{"use strict";var fK=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),hK=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),mK=new Set([500,502,503,504]),HK={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},gK={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function As(r){let e=parseInt(r,10);return isFinite(e)?e:0}function yK(r){return r?mK.has(r.status):!0}function Nv(r){let e={};if(!r)return e;let t=r.trim().split(/,/);for(let n of t){let[i,o]=n.split(/=/,2);e[i.trim()]=o===void 0?!0:o.trim().replace(/^"|"$/g,"")}return e}function bK(r){let e=[];for(let t in r){let n=r[t];e.push(n===!0?t:t+"="+n)}if(e.length)return e.join(", ")}FD.exports=class{constructor(e,t,{shared:n,cacheHeuristic:i,immutableMinTimeToLive:o,ignoreCargoCult:s,_fromObject:a}={}){if(a){this._fromObject(a);return}if(!t||!t.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=n!==!1,this._cacheHeuristic=i!==void 0?i:.1,this._immutableMinTtl=o!==void 0?o:24*3600*1e3,this._status="status"in t?t.status:200,this._resHeaders=t.headers,this._rescc=Nv(t.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=t.headers.vary?e.headers:null,this._reqcc=Nv(e.headers["cache-control"]),s&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":bK(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),t.headers["cache-control"]==null&&/no-cache/.test(t.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&hK.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||fK.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);let t=Nv(e.headers["cache-control"]);return t["no-cache"]||/no-cache/.test(e.headers.pragma)||t["max-age"]&&this.age()>t["max-age"]||t["min-fresh"]&&this.timeToLive()<1e3*t["min-fresh"]||this.stale()&&!(t["max-stale"]&&!this._rescc["must-revalidate"]&&(t["max-stale"]===!0||t["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(e,!1)}_requestMatches(e,t){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&e.method==="HEAD")&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let n of t)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){let t={};for(let n in e)HK[n]||(t[n]=e[n]);if(e.connection){let n=e.connection.trim().split(/\s*,\s*/);for(let i of n)delete t[i]}if(t.warning){let n=t.warning.split(/,/).filter(i=>!/^\s*1[0-9][0-9]/.test(i));n.length?t.warning=n.join(",").trim():delete t.warning}return t}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(t)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),t=(this.now()-this._responseTime)/1e3;return e+t}_ageValue(){return As(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return As(this._rescc["s-maxage"])}if(this._rescc["max-age"])return As(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){let n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||n<t?0:Math.max(e,(n-t)/1e3)}if(this._resHeaders["last-modified"]){let n=Date.parse(this._resHeaders["last-modified"]);if(isFinite(n)&&t>n)return Math.max(e,(t-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),t=e+As(this._rescc["stale-if-error"]),n=e+As(this._rescc["stale-while-revalidate"]);return Math.max(0,e,t,n)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+As(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+As(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let t=this._copyWithoutHopByHopHeaders(e.headers);if(delete t["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete t["if-none-match"],delete t["if-modified-since"],t;if(this._resHeaders.etag&&(t["if-none-match"]=t["if-none-match"]?`${t["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),t["accept-ranges"]||t["if-match"]||t["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete t["if-modified-since"],t["if-none-match"]){let i=t["if-none-match"].split(/,/).filter(o=>!/^\s*W\//.test(o));i.length?t["if-none-match"]=i.join(",").trim():delete t["if-none-match"]}}else this._resHeaders["last-modified"]&&!t["if-modified-since"]&&(t["if-modified-since"]=this._resHeaders["last-modified"]);return t}revalidatedPolicy(e,t){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&yK(t))return{modified:!1,matches:!1,policy:this};if(!t||!t.headers)throw Error("Response headers missing");let n=!1;if(t.status!==void 0&&t.status!=304?n=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?n=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?n=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?n=this._resHeaders["last-modified"]===t.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!t.headers.etag&&!t.headers["last-modified"]&&(n=!0),!n)return{policy:new this.constructor(e,t),modified:t.status!=304,matches:!1};let i={};for(let s in this._resHeaders)i[s]=s in t.headers&&!gK[s]?t.headers[s]:this._resHeaders[s];let o=Object.assign({},t,{status:this._status,method:this._method,headers:i});return{policy:new this.constructor(e,o,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}});var Qh=v((Yle,WD)=>{"use strict";WD.exports=r=>{let e={};for(let[t,n]of Object.entries(r))e[t.toLowerCase()]=n;return e}});var VD=v((Qle,jD)=>{"use strict";var vK=H("stream").Readable,IK=Qh(),Bv=class extends vK{constructor(e,t,n,i){if(typeof e!="number")throw new TypeError("Argument `statusCode` should be a number");if(typeof t!="object")throw new TypeError("Argument `headers` should be an object");if(!(n instanceof Buffer))throw new TypeError("Argument `body` should be a buffer");if(typeof i!="string")throw new TypeError("Argument `url` should be a string");super(),this.statusCode=e,this.headers=IK(t),this.body=n,this.url=i}_read(){this.push(this.body),this.push(null)}};jD.exports=Bv});var GD=v((Zle,qD)=>{"use strict";var _K=["destroy","setTimeout","socket","headers","trailers","rawHeaders","statusCode","httpVersion","httpVersionMinor","httpVersionMajor","rawTrailers","statusMessage"];qD.exports=(r,e)=>{let t=new Set(Object.keys(r).concat(_K));for(let n of t)n in e||(e[n]=typeof r[n]=="function"?r[n].bind(r):r[n])}});var XD=v((epe,KD)=>{"use strict";var AK=H("stream").PassThrough,wK=GD(),SK=r=>{if(!(r&&r.pipe))throw new TypeError("Parameter `response` must be a response stream.");let e=new AK;return wK(r,e),r.pipe(e)};KD.exports=SK});var zD=v(Fv=>{Fv.stringify=function r(e){if(typeof e>"u")return e;if(e&&Buffer.isBuffer(e))return JSON.stringify(":base64:"+e.toString("base64"));if(e&&e.toJSON&&(e=e.toJSON()),e&&typeof e=="object"){var t="",n=Array.isArray(e);t=n?"[":"{";var i=!0;for(var o in e){var s=typeof e[o]=="function"||!n&&typeof e[o]>"u";Object.hasOwnProperty.call(e,o)&&!s&&(i||(t+=","),i=!1,n?e[o]==null?t+="null":t+=r(e[o]):e[o]!==void 0&&(t+=r(o)+":"+r(e[o])))}return t+=n?"]":"}",t}else return typeof e=="string"?JSON.stringify(/^:/.test(e)?":"+e:e):typeof e>"u"?"null":JSON.stringify(e)};Fv.parse=function(r){return JSON.parse(r,function(e,t){return typeof t=="string"?/^:base64:/.test(t)?Buffer.from(t.substring(8),"base64"):/^:/.test(t)?t.substring(1):t:t})}});var ZD=v((rpe,QD)=>{"use strict";var EK=H("events"),JD=zD(),xK=r=>{let e={redis:"@keyv/redis",rediss:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd",offline:"@keyv/offline",tiered:"@keyv/tiered"};if(r.adapter||r.uri){let t=r.adapter||/^[^:+]*/.exec(r.uri)[0];return new(H(e[t]))(r)}return new Map},YD=["sqlite","postgres","mysql","mongo","redis","tiered"],Uv=class extends EK{constructor(e,{emitErrors:t=!0,...n}={}){if(super(),this.opts={namespace:"keyv",serialize:JD.stringify,deserialize:JD.parse,...typeof e=="string"?{uri:e}:e,...n},!this.opts.store){let o={...this.opts};this.opts.store=xK(o)}if(this.opts.compression){let o=this.opts.compression;this.opts.serialize=o.serialize.bind(o),this.opts.deserialize=o.deserialize.bind(o)}typeof this.opts.store.on=="function"&&t&&this.opts.store.on("error",o=>this.emit("error",o)),this.opts.store.namespace=this.opts.namespace;let i=o=>async function*(){for await(let[s,a]of typeof o=="function"?o(this.opts.store.namespace):o){let c=await this.opts.deserialize(a);if(!(this.opts.store.namespace&&!s.includes(this.opts.store.namespace))){if(typeof c.expires=="number"&&Date.now()>c.expires){this.delete(s);continue}yield[this._getKeyUnprefix(s),c.value]}}};typeof this.opts.store[Symbol.iterator]=="function"&&this.opts.store instanceof Map?this.iterator=i(this.opts.store):typeof this.opts.store.iterator=="function"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=i(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return YD.includes(this.opts.store.opts.dialect)||YD.findIndex(e=>this.opts.store.opts.url.includes(e))>=0}_getKeyPrefix(e){return`${this.opts.namespace}:${e}`}_getKeyPrefixArray(e){return e.map(t=>`${this.opts.namespace}:${t}`)}_getKeyUnprefix(e){return e.split(":").splice(1).join(":")}get(e,t){let{store:n}=this.opts,i=Array.isArray(e),o=i?this._getKeyPrefixArray(e):this._getKeyPrefix(e);if(i&&n.getMany===void 0){let s=[];for(let a of o)s.push(Promise.resolve().then(()=>n.get(a)).then(c=>typeof c=="string"?this.opts.deserialize(c):this.opts.compression?this.opts.deserialize(c):c).then(c=>{if(c!=null)return typeof c.expires=="number"&&Date.now()>c.expires?this.delete(a).then(()=>{}):t&&t.raw?c:c.value}));return Promise.allSettled(s).then(a=>{let c=[];for(let u of a)c.push(u.value);return c})}return Promise.resolve().then(()=>i?n.getMany(o):n.get(o)).then(s=>typeof s=="string"?this.opts.deserialize(s):this.opts.compression?this.opts.deserialize(s):s).then(s=>{if(s!=null)return i?s.map((a,c)=>{if(typeof a=="string"&&(a=this.opts.deserialize(a)),a!=null){if(typeof a.expires=="number"&&Date.now()>a.expires){this.delete(e[c]).then(()=>{});return}return t&&t.raw?a:a.value}}):typeof s.expires=="number"&&Date.now()>s.expires?this.delete(e).then(()=>{}):t&&t.raw?s:s.value})}set(e,t,n){let i=this._getKeyPrefix(e);typeof n>"u"&&(n=this.opts.ttl),n===0&&(n=void 0);let{store:o}=this.opts;return Promise.resolve().then(()=>{let s=typeof n=="number"?Date.now()+n:null;return typeof t=="symbol"&&this.emit("error","symbol cannot be serialized"),t={value:t,expires:s},this.opts.serialize(t)}).then(s=>o.set(i,s,n)).then(()=>!0)}delete(e){let{store:t}=this.opts;if(Array.isArray(e)){let i=this._getKeyPrefixArray(e);if(t.deleteMany===void 0){let o=[];for(let s of i)o.push(t.delete(s));return Promise.allSettled(o).then(s=>s.every(a=>a.value===!0))}return Promise.resolve().then(()=>t.deleteMany(i))}let n=this._getKeyPrefix(e);return Promise.resolve().then(()=>t.delete(n))}clear(){let{store:e}=this.opts;return Promise.resolve().then(()=>e.clear())}has(e){let t=this._getKeyPrefix(e),{store:n}=this.opts;return Promise.resolve().then(async()=>typeof n.has=="function"?n.has(t):await n.get(t)!==void 0)}disconnect(){let{store:e}=this.opts;if(typeof e.disconnect=="function")return e.disconnect()}};QD.exports=Uv});var rT=v((ipe,tT)=>{"use strict";var PK=H("events"),Zh=H("url"),LK=SD(),$K=BD(),Wv=UD(),eT=VD(),CK=Qh(),DK=XD(),TK=ZD(),Ml=class r{constructor(e,t){if(typeof e!="function")throw new TypeError("Parameter `request` must be a function");return this.cache=new TK({uri:typeof t=="string"&&t,store:typeof t!="string"&&t,namespace:"cacheable-request"}),this.createCacheableRequest(e)}createCacheableRequest(e){return(t,n)=>{let i;if(typeof t=="string")i=jv(Zh.parse(t)),t={};else if(t instanceof Zh.URL)i=jv(Zh.parse(t.toString())),t={};else{let[p,...d]=(t.path||"").split("?"),f=d.length>0?`?${d.join("?")}`:"";i=jv({...t,pathname:p,search:f})}t={headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1,...t,...MK(i)},t.headers=CK(t.headers);let o=new PK,s=LK(Zh.format(i),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),a=`${t.method}:${s}`,c=!1,u=!1,l=p=>{u=!0;let d=!1,f,h=new Promise(y=>{f=()=>{d||(d=!0,y())}}),m=y=>{if(c&&!p.forceRefresh){y.status=y.statusCode;let D=Wv.fromObject(c.cachePolicy).revalidatedPolicy(p,y);if(!D.modified){let j=D.policy.responseHeaders();y=new eT(c.statusCode,j,c.body,c.url),y.cachePolicy=D.policy,y.fromCache=!0}}y.fromCache||(y.cachePolicy=new Wv(p,y,p),y.fromCache=!1);let w;p.cache&&y.cachePolicy.storable()?(w=DK(y),(async()=>{try{let D=$K.buffer(y);if(await Promise.race([h,new Promise(Z=>y.once("end",Z))]),d)return;let j=await D,X={cachePolicy:y.cachePolicy.toObject(),url:y.url,statusCode:y.fromCache?c.statusCode:y.statusCode,body:j},B=p.strictTtl?y.cachePolicy.timeToLive():void 0;p.maxTtl&&(B=B?Math.min(B,p.maxTtl):p.maxTtl),await this.cache.set(a,X,B)}catch(D){o.emit("error",new r.CacheError(D))}})()):p.cache&&c&&(async()=>{try{await this.cache.delete(a)}catch(D){o.emit("error",new r.CacheError(D))}})(),o.emit("response",w||y),typeof n=="function"&&n(w||y)};try{let y=e(p,m);y.once("error",f),y.once("abort",f),o.emit("request",y)}catch(y){o.emit("error",new r.RequestError(y))}};return(async()=>{let p=async f=>{await Promise.resolve();let h=f.cache?await this.cache.get(a):void 0;if(typeof h>"u")return l(f);let m=Wv.fromObject(h.cachePolicy);if(m.satisfiesWithoutRevalidation(f)&&!f.forceRefresh){let y=m.responseHeaders(),w=new eT(h.statusCode,y,h.body,h.url);w.cachePolicy=m,w.fromCache=!0,o.emit("response",w),typeof n=="function"&&n(w)}else c=h,f.headers=m.revalidationHeaders(f),l(f)},d=f=>o.emit("error",new r.CacheError(f));this.cache.once("error",d),o.on("response",()=>this.cache.removeListener("error",d));try{await p(t)}catch(f){t.automaticFailover&&!u&&l(t),o.emit("error",new r.CacheError(f))}})(),o}}};function MK(r){let e={...r};return e.path=`${r.pathname||"/"}${r.search||""}`,delete e.pathname,delete e.search,e}function jv(r){return{protocol:r.protocol,auth:r.auth,hostname:r.hostname||r.host||"localhost",port:r.port,pathname:r.pathname,search:r.search}}Ml.RequestError=class extends Error{constructor(r){super(r.message),this.name="RequestError",Object.assign(this,r)}};Ml.CacheError=class extends Error{constructor(r){super(r.message),this.name="CacheError",Object.assign(this,r)}};tT.exports=Ml});var iT=v((ape,nT)=>{"use strict";var RK=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];nT.exports=(r,e)=>{if(e._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let t=new Set(Object.keys(r).concat(RK)),n={};for(let i of t)i in e||(n[i]={get(){let o=r[i];return typeof o=="function"?o.bind(r):o},set(o){r[i]=o},enumerable:!0,configurable:!1});return Object.defineProperties(e,n),r.once("aborted",()=>{e.destroy(),e.emit("aborted")}),r.once("close",()=>{r.complete&&e.readable?e.once("end",()=>{e.emit("close")}):e.emit("close")}),e}});var sT=v((cpe,oT)=>{"use strict";var{Transform:kK,PassThrough:OK}=H("stream"),Vv=H("zlib"),NK=iT();oT.exports=r=>{let e=(r.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(e))return r;let t=e==="br";if(t&&typeof Vv.createBrotliDecompress!="function")return r.destroy(new Error("Brotli is not supported on Node.js < 12")),r;let n=!0,i=new kK({transform(a,c,u){n=!1,u(null,a)},flush(a){a()}}),o=new OK({autoDestroy:!1,destroy(a,c){r.destroy(),c(a)}}),s=t?Vv.createBrotliDecompress():Vv.createUnzip();return s.once("error",a=>{if(n&&!r.readable){o.end();return}o.destroy(a)}),NK(r,o),r.pipe(i).pipe(s).pipe(o),o}});var Gv=v((upe,aT)=>{"use strict";var qv=class{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,t){if(this.cache.set(e,t),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[n,i]of this.oldCache.entries())this.onEviction(n,i);this.oldCache=this.cache,this.cache=new Map}}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){let t=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,t),t}}set(e,t){return this.cache.has(e)?this.cache.set(e,t):this._set(e,t),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e))return this.oldCache.get(e)}delete(e){let t=this.cache.delete(e);return t&&this._size--,this.oldCache.delete(e)||t}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache)yield e;for(let e of this.oldCache){let[t]=e;this.cache.has(t)||(yield e)}}get size(){let e=0;for(let t of this.oldCache.keys())this.cache.has(t)||e++;return Math.min(this._size+e,this.maxSize)}};aT.exports=qv});var Xv=v((lpe,pT)=>{"use strict";var BK=H("events"),FK=H("tls"),UK=H("http2"),WK=Gv(),Gt=Symbol("currentStreamsCount"),cT=Symbol("request"),Nr=Symbol("cachedOriginSet"),vc=Symbol("gracefullyClosing"),jK=["maxDeflateDynamicTableSize","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","localAddress","path","rejectUnauthorized","minDHSize","ca","cert","clientCertEngine","ciphers","key","pfx","servername","minVersion","maxVersion","secureProtocol","crl","honorCipherOrder","ecdhCurve","dhparam","secureOptions","sessionIdContext"],VK=(r,e,t)=>{let n=0,i=r.length;for(;n<i;){let o=n+i>>>1;t(r[o],e)?n=o+1:i=o}return n},qK=(r,e)=>r.remoteSettings.maxConcurrentStreams>e.remoteSettings.maxConcurrentStreams,Kv=(r,e)=>{for(let t of r)t[Nr].length<e[Nr].length&&t[Nr].every(n=>e[Nr].includes(n))&&t[Gt]+e[Gt]<=e.remoteSettings.maxConcurrentStreams&&lT(t)},GK=(r,e)=>{for(let t of r)e[Nr].length<t[Nr].length&&e[Nr].every(n=>t[Nr].includes(n))&&e[Gt]+t[Gt]<=t.remoteSettings.maxConcurrentStreams&&lT(e)},uT=({agent:r,isFree:e})=>{let t={};for(let n in r.sessions){let o=r.sessions[n].filter(s=>{let a=s[ws.kCurrentStreamsCount]<s.remoteSettings.maxConcurrentStreams;return e?a:!a});o.length!==0&&(t[n]=o)}return t},lT=r=>{r[vc]=!0,r[Gt]===0&&r.close()},ws=class r extends BK{constructor({timeout:e=6e4,maxSessions:t=1/0,maxFreeSessions:n=10,maxCachedTlsSessions:i=100}={}){super(),this.sessions={},this.queue={},this.timeout=e,this.maxSessions=t,this.maxFreeSessions=n,this._freeSessionsCount=0,this._sessionsCount=0,this.settings={enablePush:!1},this.tlsSessionCache=new WK({maxSize:i})}static normalizeOrigin(e,t){return typeof e=="string"&&(e=new URL(e)),t&&e.hostname!==t&&(e.hostname=t),e.origin}normalizeOptions(e){let t="";if(e)for(let n of jK)e[n]&&(t+=`:${e[n]}`);return t}_tryToCreateNewSession(e,t){if(!(e in this.queue)||!(t in this.queue[e]))return;let n=this.queue[e][t];this._sessionsCount<this.maxSessions&&!n.completed&&(n.completed=!0,n())}getSession(e,t,n){return new Promise((i,o)=>{Array.isArray(n)?(n=[...n],i()):n=[{resolve:i,reject:o}];let s=this.normalizeOptions(t),a=r.normalizeOrigin(e,t&&t.servername);if(a===void 0){for(let{reject:l}of n)l(new TypeError("The `origin` argument needs to be a string or an URL object"));return}if(s in this.sessions){let l=this.sessions[s],p=-1,d=-1,f;for(let h of l){let m=h.remoteSettings.maxConcurrentStreams;if(m<p)break;if(h[Nr].includes(a)){let y=h[Gt];if(y>=m||h[vc]||h.destroyed)continue;f||(p=m),y>d&&(f=h,d=y)}}if(f){if(n.length!==1){for(let{reject:h}of n){let m=new Error(`Expected the length of listeners to be 1, got ${n.length}.
Please report this to https://github.com/szmarczak/http2-wrapper/`);h(m)}return}n[0].resolve(f);return}}if(s in this.queue){if(a in this.queue[s]){this.queue[s][a].listeners.push(...n),this._tryToCreateNewSession(s,a);return}}else this.queue[s]={};let c=()=>{s in this.queue&&this.queue[s][a]===u&&(delete this.queue[s][a],Object.keys(this.queue[s]).length===0&&delete this.queue[s])},u=()=>{let l=`${a}:${s}`,p=!1;try{let d=UK.connect(e,{createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(l),...t});d[Gt]=0,d[vc]=!1;let f=()=>d[Gt]<d.remoteSettings.maxConcurrentStreams,h=!0;d.socket.once("session",y=>{this.tlsSessionCache.set(l,y)}),d.once("error",y=>{for(let{reject:w}of n)w(y);this.tlsSessionCache.delete(l)}),d.setTimeout(this.timeout,()=>{d.destroy()}),d.once("close",()=>{if(p){h&&this._freeSessionsCount--,this._sessionsCount--;let y=this.sessions[s];y.splice(y.indexOf(d),1),y.length===0&&delete this.sessions[s]}else{let y=new Error("Session closed without receiving a SETTINGS frame");y.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:w}of n)w(y);c()}this._tryToCreateNewSession(s,a)});let m=()=>{if(!(!(s in this.queue)||!f())){for(let y of d[Nr])if(y in this.queue[s]){let{listeners:w}=this.queue[s][y];for(;w.length!==0&&f();)w.shift().resolve(d);let D=this.queue[s];if(D[y].listeners.length===0&&(delete D[y],Object.keys(D).length===0)){delete this.queue[s];break}if(!f())break}}};d.on("origin",()=>{d[Nr]=d.originSet,f()&&(m(),Kv(this.sessions[s],d))}),d.once("remoteSettings",()=>{if(d.ref(),d.unref(),this._sessionsCount++,u.destroyed){let y=new Error("Agent has been destroyed");for(let w of n)w.reject(y);d.destroy();return}d[Nr]=d.originSet;{let y=this.sessions;if(s in y){let w=y[s];w.splice(VK(w,d,qK),0,d)}else y[s]=[d]}this._freeSessionsCount+=1,p=!0,this.emit("session",d),m(),c(),d[Gt]===0&&this._freeSessionsCount>this.maxFreeSessions&&d.close(),n.length!==0&&(this.getSession(a,t,n),n.length=0),d.on("remoteSettings",()=>{m(),Kv(this.sessions[s],d)})}),d[cT]=d.request,d.request=(y,w)=>{if(d[vc])throw new Error("The session is gracefully closing. No new streams are allowed.");let D=d[cT](y,w);return d.ref(),++d[Gt],d[Gt]===d.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,D.once("close",()=>{if(h=f(),--d[Gt],!d.destroyed&&!d.closed&&(GK(this.sessions[s],d),f()&&!d.closed)){h||(this._freeSessionsCount++,h=!0);let j=d[Gt]===0;j&&d.unref(),j&&(this._freeSessionsCount>this.maxFreeSessions||d[vc])?d.close():(Kv(this.sessions[s],d),m())}}),D}}catch(d){for(let f of n)f.reject(d);c()}};u.listeners=n,u.completed=!1,u.destroyed=!1,this.queue[s][a]=u,this._tryToCreateNewSession(s,a)})}request(e,t,n,i){return new Promise((o,s)=>{this.getSession(e,t,[{reject:s,resolve:a=>{try{o(a.request(n,i))}catch(c){s(c)}}}])})}createConnection(e,t){return r.connect(e,t)}static connect(e,t){t.ALPNProtocols=["h2"];let n=e.port||443,i=e.hostname||e.host;return typeof t.servername>"u"&&(t.servername=i),FK.connect(n,i,t)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let t of e)t[Gt]===0&&t.close()}destroy(e){for(let t of Object.values(this.sessions))for(let n of t)n.destroy(e);for(let t of Object.values(this.queue))for(let n of Object.values(t))n.destroyed=!0;this.queue={}}get freeSessions(){return uT({agent:this,isFree:!0})}get busySessions(){return uT({agent:this,isFree:!1})}};ws.kCurrentStreamsCount=Gt;ws.kGracefullyClosing=vc;pT.exports={Agent:ws,globalAgent:new ws}});var Jv=v((ppe,dT)=>{"use strict";var{Readable:KK}=H("stream"),zv=class extends KK{constructor(e,t){super({highWaterMark:t,autoDestroy:!1}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=e,this.connection=e,this._dumped=!1}_destroy(e){this.req._request.destroy(e)}setTimeout(e,t){return this.req.setTimeout(e,t),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};dT.exports=zv});var Yv=v((dpe,fT)=>{"use strict";fT.exports=r=>{let e={protocol:r.protocol,hostname:typeof r.hostname=="string"&&r.hostname.startsWith("[")?r.hostname.slice(1,-1):r.hostname,host:r.host,hash:r.hash,search:r.search,pathname:r.pathname,href:r.href,path:`${r.pathname||""}${r.search||""}`};return typeof r.port=="string"&&r.port.length!==0&&(e.port=Number(r.port)),(r.username||r.password)&&(e.auth=`${r.username||""}:${r.password||""}`),e}});var mT=v((fpe,hT)=>{"use strict";hT.exports=(r,e,t)=>{for(let n of t)r.on(n,(...i)=>e.emit(n,...i))}});var gT=v((hpe,HT)=>{"use strict";HT.exports=r=>{switch(r){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}});var bT=v((Hpe,yT)=>{"use strict";var Ic=(r,e,t)=>{yT.exports[e]=class extends r{constructor(...i){super(typeof t=="string"?t:t(i)),this.name=`${super.name} [${e}]`,this.code=e}}};Ic(TypeError,"ERR_INVALID_ARG_TYPE",r=>{let e=r[0].includes(".")?"property":"argument",t=r[1],n=Array.isArray(t);return n&&(t=`${t.slice(0,-1).join(", ")} or ${t.slice(-1)}`),`The "${r[0]}" ${e} must be ${n?"one of":"of"} type ${t}. Received ${typeof r[2]}`});Ic(TypeError,"ERR_INVALID_PROTOCOL",r=>`Protocol "${r[0]}" not supported. Expected "${r[1]}"`);Ic(Error,"ERR_HTTP_HEADERS_SENT",r=>`Cannot ${r[0]} headers after they are sent to the client`);Ic(TypeError,"ERR_INVALID_HTTP_TOKEN",r=>`${r[0]} must be a valid HTTP token [${r[1]}]`);Ic(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",r=>`Invalid value "${r[0]} for header "${r[1]}"`);Ic(TypeError,"ERR_INVALID_CHAR",r=>`Invalid character in ${r[0]} [${r[1]}]`)});var rI=v((gpe,ET)=>{"use strict";var XK=H("http2"),{Writable:zK}=H("stream"),{Agent:vT,globalAgent:JK}=Xv(),YK=Jv(),QK=Yv(),ZK=mT(),e9=gT(),{ERR_INVALID_ARG_TYPE:Qv,ERR_INVALID_PROTOCOL:t9,ERR_HTTP_HEADERS_SENT:IT,ERR_INVALID_HTTP_TOKEN:r9,ERR_HTTP_INVALID_HEADER_VALUE:n9,ERR_INVALID_CHAR:i9}=bT(),{HTTP2_HEADER_STATUS:_T,HTTP2_HEADER_METHOD:AT,HTTP2_HEADER_PATH:wT,HTTP2_METHOD_CONNECT:o9}=XK.constants,Ot=Symbol("headers"),Zv=Symbol("origin"),eI=Symbol("session"),ST=Symbol("options"),em=Symbol("flushedHeaders"),Rl=Symbol("jobs"),s9=/^[\^`\-\w!#$%&*+.|~]+$/,a9=/[^\t\u0020-\u007E\u0080-\u00FF]/,tI=class extends zK{constructor(e,t,n){super({autoDestroy:!1});let i=typeof e=="string"||e instanceof URL;if(i&&(e=QK(e instanceof URL?e:new URL(e))),typeof t=="function"||t===void 0?(n=t,t=i?e:{...e}):t={...e,...t},t.h2session)this[eI]=t.h2session;else if(t.agent===!1)this.agent=new vT({maxFreeSessions:0});else if(typeof t.agent>"u"||t.agent===null)typeof t.createConnection=="function"?(this.agent=new vT({maxFreeSessions:0}),this.agent.createConnection=t.createConnection):this.agent=JK;else if(typeof t.agent.request=="function")this.agent=t.agent;else throw new Qv("options.agent",["Agent-like Object","undefined","false"],t.agent);if(t.protocol&&t.protocol!=="https:")throw new t9(t.protocol,"https:");let o=t.port||t.defaultPort||this.agent&&this.agent.defaultPort||443,s=t.hostname||t.host||"localhost";delete t.hostname,delete t.host,delete t.port;let{timeout:a}=t;if(t.timeout=void 0,this[Ot]=Object.create(null),this[Rl]=[],this.socket=null,this.connection=null,this.method=t.method||"GET",this.path=t.path,this.res=null,this.aborted=!1,this.reusedSocket=!1,t.headers)for(let[c,u]of Object.entries(t.headers))this.setHeader(c,u);t.auth&&!("authorization"in this[Ot])&&(this[Ot].authorization="Basic "+Buffer.from(t.auth).toString("base64")),t.session=t.tlsSession,t.path=t.socketPath,this[ST]=t,o===443?(this[Zv]=`https://${s}`,":authority"in this[Ot]||(this[Ot][":authority"]=s)):(this[Zv]=`https://${s}:${o}`,":authority"in this[Ot]||(this[Ot][":authority"]=`${s}:${o}`)),a&&this.setTimeout(a),n&&this.once("response",n),this[em]=!1}get method(){return this[Ot][AT]}set method(e){e&&(this[Ot][AT]=e.toUpperCase())}get path(){return this[Ot][wT]}set path(e){e&&(this[Ot][wT]=e)}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(e,t,n){if(this._mustNotHaveABody){n(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let i=()=>this._request.write(e,t,n);this._request?i():this[Rl].push(i)}_final(e){if(this.destroyed)return;this.flushHeaders();let t=()=>{if(this._mustNotHaveABody){e();return}this._request.end(e)};this._request?t():this[Rl].push(t)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}_destroy(e,t){this.res&&this.res._dump(),this._request&&this._request.destroy(),t(e)}async flushHeaders(){if(this[em]||this.destroyed)return;this[em]=!0;let e=this.method===o9,t=n=>{if(this._request=n,this.destroyed){n.destroy();return}e||ZK(n,this,["timeout","continue","close","error"]);let i=s=>(...a)=>{!this.writable&&!this.destroyed?s(...a):this.once("finish",()=>{s(...a)})};n.once("response",i((s,a,c)=>{let u=new YK(this.socket,n.readableHighWaterMark);this.res=u,u.req=this,u.statusCode=s[_T],u.headers=s,u.rawHeaders=c,u.once("end",()=>{this.aborted?(u.aborted=!0,u.emit("aborted")):(u.complete=!0,u.socket=null,u.connection=null)}),e?(u.upgrade=!0,this.emit("connect",u,n,Buffer.alloc(0))?this.emit("close"):n.destroy()):(n.on("data",l=>{!u._dumped&&!u.push(l)&&n.pause()}),n.once("end",()=>{u.push(null)}),this.emit("response",u)||u._dump())})),n.once("headers",i(s=>this.emit("information",{statusCode:s[_T]}))),n.once("trailers",i((s,a,c)=>{let{res:u}=this;u.trailers=s,u.rawTrailers=c}));let{socket:o}=n.session;this.socket=o,this.connection=o;for(let s of this[Rl])s();this.emit("socket",this.socket)};if(this[eI])try{t(this[eI].request(this[Ot]))}catch(n){this.emit("error",n)}else{this.reusedSocket=!0;try{t(await this.agent.request(this[Zv],this[ST],this[Ot]))}catch(n){this.emit("error",n)}}}getHeader(e){if(typeof e!="string")throw new Qv("name","string",e);return this[Ot][e.toLowerCase()]}get headersSent(){return this[em]}removeHeader(e){if(typeof e!="string")throw new Qv("name","string",e);if(this.headersSent)throw new IT("remove");delete this[Ot][e.toLowerCase()]}setHeader(e,t){if(this.headersSent)throw new IT("set");if(typeof e!="string"||!s9.test(e)&&!e9(e))throw new r9("Header name",e);if(typeof t>"u")throw new n9(t,e);if(a9.test(t))throw new i9("header content",e);this[Ot][e.toLowerCase()]=t}setNoDelay(){}setSocketKeepAlive(){}setTimeout(e,t){let n=()=>this._request.setTimeout(e,t);return this._request?n():this[Rl].push(n),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(e){}};ET.exports=tI});var PT=v((ype,xT)=>{"use strict";var c9=H("tls");xT.exports=(r={},e=c9.connect)=>new Promise((t,n)=>{let i=!1,o,s=async()=>{await c,o.off("timeout",a),o.off("error",n),r.resolveSocket?(t({alpnProtocol:o.alpnProtocol,socket:o,timeout:i}),i&&(await Promise.resolve(),o.emit("timeout"))):(o.destroy(),t({alpnProtocol:o.alpnProtocol,timeout:i}))},a=async()=>{i=!0,s()},c=(async()=>{try{o=await e(r,s),o.on("error",n),o.once("timeout",a)}catch(u){n(u)}})()})});var $T=v((bpe,LT)=>{"use strict";var u9=H("net");LT.exports=r=>{let e=r.host,t=r.headers&&r.headers.host;return t&&(t.startsWith("[")?t.indexOf("]")===-1?e=t:e=t.slice(1,-1):e=t.split(":",1)[0]),u9.isIP(e)?"":e}});var TT=v((vpe,iI)=>{"use strict";var CT=H("http"),nI=H("https"),l9=PT(),p9=Gv(),d9=rI(),f9=$T(),h9=Yv(),tm=new p9({maxSize:100}),kl=new Map,DT=(r,e,t)=>{e._httpMessage={shouldKeepAlive:!0};let n=()=>{r.emit("free",e,t)};e.on("free",n);let i=()=>{r.removeSocket(e,t)};e.on("close",i);let o=()=>{r.removeSocket(e,t),e.off("close",i),e.off("free",n),e.off("agentRemove",o)};e.on("agentRemove",o),r.emit("free",e,t)},m9=async r=>{let e=`${r.host}:${r.port}:${r.ALPNProtocols.sort()}`;if(!tm.has(e)){if(kl.has(e))return(await kl.get(e)).alpnProtocol;let{path:t,agent:n}=r;r.path=r.socketPath;let i=l9(r);kl.set(e,i);try{let{socket:o,alpnProtocol:s}=await i;if(tm.set(e,s),r.path=t,s==="h2")o.destroy();else{let{globalAgent:a}=nI,c=nI.Agent.prototype.createConnection;n?n.createConnection===c?DT(n,o,r):o.destroy():a.createConnection===c?DT(a,o,r):o.destroy()}return kl.delete(e),s}catch(o){throw kl.delete(e),o}}return tm.get(e)};iI.exports=async(r,e,t)=>{if((typeof r=="string"||r instanceof URL)&&(r=h9(new URL(r))),typeof e=="function"&&(t=e,e=void 0),e={ALPNProtocols:["h2","http/1.1"],...r,...e,resolveSocket:!0},!Array.isArray(e.ALPNProtocols)||e.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");e.protocol=e.protocol||"https:";let n=e.protocol==="https:";e.host=e.hostname||e.host||"localhost",e.session=e.tlsSession,e.servername=e.servername||f9(e),e.port=e.port||(n?443:80),e._defaultAgent=n?nI.globalAgent:CT.globalAgent;let i=e.agent;if(i){if(i.addRequest)throw new Error("The `options.agent` object can contain only `http`, `https` or `http2` properties");e.agent=i[n?"https":"http"]}return n&&await m9(e)==="h2"?(i&&(e.agent=i.http2),new d9(e,t)):CT.request(e,t)};iI.exports.protocolCache=tm});var RT=v((Ipe,MT)=>{"use strict";var H9=H("http2"),g9=Xv(),oI=rI(),y9=Jv(),b9=TT(),v9=(r,e,t)=>new oI(r,e,t),I9=(r,e,t)=>{let n=new oI(r,e,t);return n.end(),n};MT.exports={...H9,ClientRequest:oI,IncomingMessage:y9,...g9,request:v9,get:I9,auto:b9}});var aI=v(sI=>{"use strict";Object.defineProperty(sI,"__esModule",{value:!0});var kT=xi();sI.default=r=>kT.default.nodeStream(r)&&kT.default.function_(r.getBoundary)});var FT=v(cI=>{"use strict";Object.defineProperty(cI,"__esModule",{value:!0});var NT=H("fs"),BT=H("util"),OT=xi(),_9=aI(),A9=BT.promisify(NT.stat);cI.default=async(r,e)=>{if(e&&"content-length"in e)return Number(e["content-length"]);if(!r)return 0;if(OT.default.string(r))return Buffer.byteLength(r);if(OT.default.buffer(r))return r.length;if(_9.default(r))return BT.promisify(r.getLength.bind(r))();if(r instanceof NT.ReadStream){let{size:t}=await A9(r.path);return t===0?void 0:t}}});var lI=v(uI=>{"use strict";Object.defineProperty(uI,"__esModule",{value:!0});function w9(r,e,t){let n={};for(let i of t)n[i]=(...o)=>{e.emit(i,...o)},r.on(i,n[i]);return()=>{for(let i of t)r.off(i,n[i])}}uI.default=w9});var UT=v(pI=>{"use strict";Object.defineProperty(pI,"__esModule",{value:!0});pI.default=()=>{let r=[];return{once(e,t,n){e.once(t,n),r.push({origin:e,event:t,fn:n})},unhandleAll(){for(let e of r){let{origin:t,event:n,fn:i}=e;t.removeListener(n,i)}r.length=0}}}});var jT=v(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.TimeoutError=void 0;var S9=H("net"),E9=UT(),WT=Symbol("reentry"),x9=()=>{},rm=class extends Error{constructor(e,t){super(`Timeout awaiting '${t}' for ${e}ms`),this.event=t,this.name="TimeoutError",this.code="ETIMEDOUT"}};Ol.TimeoutError=rm;Ol.default=(r,e,t)=>{if(WT in r)return x9;r[WT]=!0;let n=[],{once:i,unhandleAll:o}=E9.default(),s=(p,d,f)=>{var h;let m=setTimeout(d,p,p,f);(h=m.unref)===null||h===void 0||h.call(m);let y=()=>{clearTimeout(m)};return n.push(y),y},{host:a,hostname:c}=t,u=(p,d)=>{r.destroy(new rm(p,d))},l=()=>{for(let p of n)p();o()};if(r.once("error",p=>{if(l(),r.listenerCount("error")===0)throw p}),r.once("close",l),i(r,"response",p=>{i(p,"end",l)}),typeof e.request<"u"&&s(e.request,u,"request"),typeof e.socket<"u"){let p=()=>{u(e.socket,"socket")};r.setTimeout(e.socket,p),n.push(()=>{r.removeListener("timeout",p)})}return i(r,"socket",p=>{var d;let{socketPath:f}=r;if(p.connecting){let h=!!(f??S9.isIP((d=c??a)!==null&&d!==void 0?d:"")!==0);if(typeof e.lookup<"u"&&!h&&typeof p.address().address>"u"){let m=s(e.lookup,u,"lookup");i(p,"lookup",m)}if(typeof e.connect<"u"){let m=()=>s(e.connect,u,"connect");h?i(p,"connect",m()):i(p,"lookup",y=>{y===null&&i(p,"connect",m())})}typeof e.secureConnect<"u"&&t.protocol==="https:"&&i(p,"connect",()=>{let m=s(e.secureConnect,u,"secureConnect");i(p,"secureConnect",m)})}if(typeof e.send<"u"){let h=()=>s(e.send,u,"send");p.connecting?i(p,"connect",()=>{i(r,"upload-complete",h())}):i(r,"upload-complete",h())}}),typeof e.response<"u"&&i(r,"upload-complete",()=>{let p=s(e.response,u,"response");i(r,"response",p)}),l}});var qT=v(dI=>{"use strict";Object.defineProperty(dI,"__esModule",{value:!0});var VT=xi();dI.default=r=>{r=r;let e={protocol:r.protocol,hostname:VT.default.string(r.hostname)&&r.hostname.startsWith("[")?r.hostname.slice(1,-1):r.hostname,host:r.host,hash:r.hash,search:r.search,pathname:r.pathname,href:r.href,path:`${r.pathname||""}${r.search||""}`};return VT.default.string(r.port)&&r.port.length>0&&(e.port=Number(r.port)),(r.username||r.password)&&(e.auth=`${r.username||""}:${r.password||""}`),e}});var GT=v(fI=>{"use strict";Object.defineProperty(fI,"__esModule",{value:!0});var P9=H("url"),L9=["protocol","host","hostname","port","pathname","search"];fI.default=(r,e)=>{var t,n;if(e.path){if(e.pathname)throw new TypeError("Parameters `path` and `pathname` are mutually exclusive.");if(e.search)throw new TypeError("Parameters `path` and `search` are mutually exclusive.");if(e.searchParams)throw new TypeError("Parameters `path` and `searchParams` are mutually exclusive.")}if(e.search&&e.searchParams)throw new TypeError("Parameters `search` and `searchParams` are mutually exclusive.");if(!r){if(!e.protocol)throw new TypeError("No URL protocol specified");r=`${e.protocol}//${(n=(t=e.hostname)!==null&&t!==void 0?t:e.host)!==null&&n!==void 0?n:""}`}let i=new P9.URL(r);if(e.path){let o=e.path.indexOf("?");o===-1?e.pathname=e.path:(e.pathname=e.path.slice(0,o),e.search=e.path.slice(o+1)),delete e.path}for(let o of L9)e[o]&&(i[o]=e[o].toString());return i}});var KT=v(mI=>{"use strict";Object.defineProperty(mI,"__esModule",{value:!0});var hI=class{constructor(){this.weakMap=new WeakMap,this.map=new Map}set(e,t){typeof e=="object"?this.weakMap.set(e,t):this.map.set(e,t)}get(e){return typeof e=="object"?this.weakMap.get(e):this.map.get(e)}has(e){return typeof e=="object"?this.weakMap.has(e):this.map.has(e)}};mI.default=hI});var gI=v(HI=>{"use strict";Object.defineProperty(HI,"__esModule",{value:!0});var $9=async r=>{let e=[],t=0;for await(let n of r)e.push(n),t+=Buffer.byteLength(n);return Buffer.isBuffer(e[0])?Buffer.concat(e,t):Buffer.from(e.join(""))};HI.default=$9});var zT=v(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.dnsLookupIpVersionToFamily=Ss.isDnsLookupIpVersion=void 0;var XT={auto:0,ipv4:4,ipv6:6};Ss.isDnsLookupIpVersion=r=>r in XT;Ss.dnsLookupIpVersionToFamily=r=>{if(Ss.isDnsLookupIpVersion(r))return XT[r];throw new Error("Invalid DNS lookup IP version")}});var yI=v(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.isResponseOk=void 0;nm.isResponseOk=r=>{let{statusCode:e}=r,t=r.request.options.followRedirect?299:399;return e>=200&&e<=t||e===304}});var YT=v(bI=>{"use strict";Object.defineProperty(bI,"__esModule",{value:!0});var JT=new Set;bI.default=r=>{JT.has(r)||(JT.add(r),process.emitWarning(`Got: ${r}`,{type:"DeprecationWarning"}))}});var QT=v(vI=>{"use strict";Object.defineProperty(vI,"__esModule",{value:!0});var Re=xi(),C9=(r,e)=>{if(Re.default.null_(r.encoding))throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead");Re.assert.any([Re.default.string,Re.default.undefined],r.encoding),Re.assert.any([Re.default.boolean,Re.default.undefined],r.resolveBodyOnly),Re.assert.any([Re.default.boolean,Re.default.undefined],r.methodRewriting),Re.assert.any([Re.default.boolean,Re.default.undefined],r.isStream),Re.assert.any([Re.default.string,Re.default.undefined],r.responseType),r.responseType===void 0&&(r.responseType="text");let{retry:t}=r;if(e?r.retry={...e.retry}:r.retry={calculateDelay:n=>n.computedValue,limit:0,methods:[],statusCodes:[],errorCodes:[],maxRetryAfter:void 0},Re.default.object(t)?(r.retry={...r.retry,...t},r.retry.methods=[...new Set(r.retry.methods.map(n=>n.toUpperCase()))],r.retry.statusCodes=[...new Set(r.retry.statusCodes)],r.retry.errorCodes=[...new Set(r.retry.errorCodes)]):Re.default.number(t)&&(r.retry.limit=t),Re.default.undefined(r.retry.maxRetryAfter)&&(r.retry.maxRetryAfter=Math.min(...[r.timeout.request,r.timeout.connect].filter(Re.default.number))),Re.default.object(r.pagination)){e&&(r.pagination={...e.pagination,...r.pagination});let{pagination:n}=r;if(!Re.default.function_(n.transform))throw new Error("`options.pagination.transform` must be implemented");if(!Re.default.function_(n.shouldContinue))throw new Error("`options.pagination.shouldContinue` must be implemented");if(!Re.default.function_(n.filter))throw new TypeError("`options.pagination.filter` must be implemented");if(!Re.default.function_(n.paginate))throw new Error("`options.pagination.paginate` must be implemented")}return r.responseType==="json"&&r.headers.accept===void 0&&(r.headers.accept="application/json"),r};vI.default=C9});var ZT=v(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.retryAfterStatusCodes=void 0;Nl.retryAfterStatusCodes=new Set([413,429,503]);var D9=({attemptCount:r,retryOptions:e,error:t,retryAfter:n})=>{if(r>e.limit)return 0;let i=e.methods.includes(t.options.method),o=e.errorCodes.includes(t.code),s=t.response&&e.statusCodes.includes(t.response.statusCode);if(!i||!o&&!s)return 0;if(t.response){if(n)return e.maxRetryAfter===void 0||n>e.maxRetryAfter?0:n;if(t.response.statusCode===413)return 0}let a=Math.random()*100;return 2**(r-1)*1e3+a};Nl.default=D9});var Ul=v(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.UnsupportedProtocolError=me.ReadError=me.TimeoutError=me.UploadError=me.CacheError=me.HTTPError=me.MaxRedirectsError=me.RequestError=me.setNonEnumerableProperties=me.knownHookEvents=me.withoutBody=me.kIsNormalizedAlready=void 0;var eM=H("util"),tM=H("stream"),T9=H("fs"),fo=H("url"),rM=H("http"),II=H("http"),M9=H("https"),R9=mD(),k9=_D(),nM=rT(),O9=sT(),N9=RT(),B9=Qh(),S=xi(),F9=FT(),iM=aI(),U9=lI(),oM=jT(),W9=qT(),sM=GT(),j9=KT(),V9=gI(),aM=zT(),q9=yI(),ho=YT(),G9=QT(),K9=ZT(),_I,wt=Symbol("request"),sm=Symbol("response"),_c=Symbol("responseSize"),Ac=Symbol("downloadedSize"),wc=Symbol("bodySize"),Sc=Symbol("uploadedSize"),im=Symbol("serverResponsesPiped"),cM=Symbol("unproxyEvents"),uM=Symbol("isFromCache"),AI=Symbol("cancelTimeouts"),lM=Symbol("startedReading"),Ec=Symbol("stopReading"),om=Symbol("triggerRead"),mo=Symbol("body"),Bl=Symbol("jobs"),pM=Symbol("originalResponse"),dM=Symbol("retryTimeout");me.kIsNormalizedAlready=Symbol("isNormalizedAlready");var X9=S.default.string(process.versions.brotli);me.withoutBody=new Set(["GET","HEAD"]);me.knownHookEvents=["init","beforeRequest","beforeRedirect","beforeError","beforeRetry","afterResponse"];function z9(r){for(let e in r){let t=r[e];if(!S.default.string(t)&&!S.default.number(t)&&!S.default.boolean(t)&&!S.default.null_(t)&&!S.default.undefined(t))throw new TypeError(`The \`searchParams\` value '${String(t)}' must be a string, number, boolean or null`)}}function J9(r){return S.default.object(r)&&!("statusCode"in r)}var wI=new j9.default,Y9=async r=>new Promise((e,t)=>{let n=i=>{t(i)};r.pending||e(),r.once("error",n),r.once("ready",()=>{r.off("error",n),e()})}),Q9=new Set([300,301,302,303,304,307,308]),Z9=["context","body","json","form"];me.setNonEnumerableProperties=(r,e)=>{let t={};for(let n of r)if(n)for(let i of Z9)i in n&&(t[i]={writable:!0,configurable:!0,enumerable:!1,value:n[i]});Object.defineProperties(e,t)};var et=class extends Error{constructor(e,t,n){var i,o;if(super(e),Error.captureStackTrace(this,this.constructor),this.name="RequestError",this.code=(i=t.code)!==null&&i!==void 0?i:"ERR_GOT_REQUEST_ERROR",n instanceof fm?(Object.defineProperty(this,"request",{enumerable:!1,value:n}),Object.defineProperty(this,"response",{enumerable:!1,value:n[sm]}),Object.defineProperty(this,"options",{enumerable:!1,value:n.options})):Object.defineProperty(this,"options",{enumerable:!1,value:n}),this.timings=(o=this.request)===null||o===void 0?void 0:o.timings,S.default.string(t.stack)&&S.default.string(this.stack)){let s=this.stack.indexOf(this.message)+this.message.length,a=this.stack.slice(s).split(`
`).reverse(),c=t.stack.slice(t.stack.indexOf(t.message)+t.message.length).split(`
`).reverse();for(;c.length!==0&&c[0]===a[0];)a.shift();this.stack=`${this.stack.slice(0,s)}${a.reverse().join(`
`)}${c.reverse().join(`
`)}`}}};me.RequestError=et;var am=class extends et{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}};me.MaxRedirectsError=am;var cm=class extends et{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}};me.HTTPError=cm;var um=class extends et{constructor(e,t){super(e.message,e,t),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}};me.CacheError=um;var lm=class extends et{constructor(e,t){super(e.message,e,t),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}};me.UploadError=lm;var pm=class extends et{constructor(e,t,n){super(e.message,e,n),this.name="TimeoutError",this.event=e.event,this.timings=t}};me.TimeoutError=pm;var Fl=class extends et{constructor(e,t){super(e.message,e,t),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}};me.ReadError=Fl;var dm=class extends et{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e),this.name="UnsupportedProtocolError",this.code="ERR_UNSUPPORTED_PROTOCOL"}};me.UnsupportedProtocolError=dm;var eX=["socket","connect","continue","information","upgrade","timeout"],fm=class extends tM.Duplex{constructor(e,t={},n){super({autoDestroy:!1,highWaterMark:0}),this[Ac]=0,this[Sc]=0,this.requestInitialized=!1,this[im]=new Set,this.redirects=[],this[Ec]=!1,this[om]=!1,this[Bl]=[],this.retryCount=0,this._progressCallbacks=[];let i=()=>this._unlockWrite(),o=()=>this._lockWrite();this.on("pipe",u=>{u.prependListener("data",i),u.on("data",o),u.prependListener("end",i),u.on("end",o)}),this.on("unpipe",u=>{u.off("data",i),u.off("data",o),u.off("end",i),u.off("end",o)}),this.on("pipe",u=>{u instanceof II.IncomingMessage&&(this.options.headers={...u.headers,...this.options.headers})});let{json:s,body:a,form:c}=t;if((s||a||c)&&this._lockWrite(),me.kIsNormalizedAlready in t)this.options=t;else try{this.options=this.constructor.normalizeArguments(e,t,n)}catch(u){S.default.nodeStream(t.body)&&t.body.destroy(),this.destroy(u);return}(async()=>{var u;try{this.options.body instanceof T9.ReadStream&&await Y9(this.options.body);let{url:l}=this.options;if(!l)throw new TypeError("Missing `url` property");if(this.requestUrl=l.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(u=this[wt])===null||u===void 0||u.destroy();return}for(let p of this[Bl])p();this[Bl].length=0,this.requestInitialized=!0}catch(l){if(l instanceof et){this._beforeError(l);return}this.destroyed||this.destroy(l)}})()}static normalizeArguments(e,t,n){var i,o,s,a,c;let u=t;if(S.default.object(e)&&!S.default.urlInstance(e))t={...n,...e,...t};else{if(e&&t&&t.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");t={...n,...t},e!==void 0&&(t.url=e),S.default.urlInstance(t.url)&&(t.url=new fo.URL(t.url.toString()))}if(t.cache===!1&&(t.cache=void 0),t.dnsCache===!1&&(t.dnsCache=void 0),S.assert.any([S.default.string,S.default.undefined],t.method),S.assert.any([S.default.object,S.default.undefined],t.headers),S.assert.any([S.default.string,S.default.urlInstance,S.default.undefined],t.prefixUrl),S.assert.any([S.default.object,S.default.undefined],t.cookieJar),S.assert.any([S.default.object,S.default.string,S.default.undefined],t.searchParams),S.assert.any([S.default.object,S.default.string,S.default.undefined],t.cache),S.assert.any([S.default.object,S.default.number,S.default.undefined],t.timeout),S.assert.any([S.default.object,S.default.undefined],t.context),S.assert.any([S.default.object,S.default.undefined],t.hooks),S.assert.any([S.default.boolean,S.default.undefined],t.decompress),S.assert.any([S.default.boolean,S.default.undefined],t.ignoreInvalidCookies),S.assert.any([S.default.boolean,S.default.undefined],t.followRedirect),S.assert.any([S.default.number,S.default.undefined],t.maxRedirects),S.assert.any([S.default.boolean,S.default.undefined],t.throwHttpErrors),S.assert.any([S.default.boolean,S.default.undefined],t.http2),S.assert.any([S.default.boolean,S.default.undefined],t.allowGetBody),S.assert.any([S.default.string,S.default.undefined],t.localAddress),S.assert.any([aM.isDnsLookupIpVersion,S.default.undefined],t.dnsLookupIpVersion),S.assert.any([S.default.object,S.default.undefined],t.https),S.assert.any([S.default.boolean,S.default.undefined],t.rejectUnauthorized),t.https&&(S.assert.any([S.default.boolean,S.default.undefined],t.https.rejectUnauthorized),S.assert.any([S.default.function_,S.default.undefined],t.https.checkServerIdentity),S.assert.any([S.default.string,S.default.object,S.default.array,S.default.undefined],t.https.certificateAuthority),S.assert.any([S.default.string,S.default.object,S.default.array,S.default.undefined],t.https.key),S.assert.any([S.default.string,S.default.object,S.default.array,S.default.undefined],t.https.certificate),S.assert.any([S.default.string,S.default.undefined],t.https.passphrase),S.assert.any([S.default.string,S.default.buffer,S.default.array,S.default.undefined],t.https.pfx)),S.assert.any([S.default.object,S.default.undefined],t.cacheOptions),S.default.string(t.method)?t.method=t.method.toUpperCase():t.method="GET",t.headers===n?.headers?t.headers={...t.headers}:t.headers=B9({...n?.headers,...t.headers}),"slashes"in t)throw new TypeError("The legacy `url.Url` has been deprecated. Use `URL` instead.");if("auth"in t)throw new TypeError("Parameter `auth` is deprecated. Use `username` / `password` instead.");if("searchParams"in t&&t.searchParams&&t.searchParams!==n?.searchParams){let f;if(S.default.string(t.searchParams)||t.searchParams instanceof fo.URLSearchParams)f=new fo.URLSearchParams(t.searchParams);else{z9(t.searchParams),f=new fo.URLSearchParams;for(let h in t.searchParams){let m=t.searchParams[h];m===null?f.append(h,""):m!==void 0&&f.append(h,m)}}(i=n?.searchParams)===null||i===void 0||i.forEach((h,m)=>{f.has(m)||f.append(m,h)}),t.searchParams=f}if(t.username=(o=t.username)!==null&&o!==void 0?o:"",t.password=(s=t.password)!==null&&s!==void 0?s:"",S.default.undefined(t.prefixUrl)?t.prefixUrl=(a=n?.prefixUrl)!==null&&a!==void 0?a:"":(t.prefixUrl=t.prefixUrl.toString(),t.prefixUrl!==""&&!t.prefixUrl.endsWith("/")&&(t.prefixUrl+="/")),S.default.string(t.url)){if(t.url.startsWith("/"))throw new Error("`input` must not start with a slash when using `prefixUrl`");t.url=sM.default(t.prefixUrl+t.url,t)}else(S.default.undefined(t.url)&&t.prefixUrl!==""||t.protocol)&&(t.url=sM.default(t.prefixUrl,t));if(t.url){"port"in t&&delete t.port;let{prefixUrl:f}=t;Object.defineProperty(t,"prefixUrl",{set:m=>{let y=t.url;if(!y.href.startsWith(m))throw new Error(`Cannot change \`prefixUrl\` from ${f} to ${m}: ${y.href}`);t.url=new fo.URL(m+y.href.slice(f.length)),f=m},get:()=>f});let{protocol:h}=t.url;if(h==="unix:"&&(h="http:",t.url=new fo.URL(`http://unix${t.url.pathname}${t.url.search}`)),t.searchParams&&(t.url.search=t.searchParams.toString()),h!=="http:"&&h!=="https:")throw new dm(t);t.username===""?t.username=t.url.username:t.url.username=t.username,t.password===""?t.password=t.url.password:t.url.password=t.password}let{cookieJar:l}=t;if(l){let{setCookie:f,getCookieString:h}=l;S.assert.function_(f),S.assert.function_(h),f.length===4&&h.length===0&&(f=eM.promisify(f.bind(t.cookieJar)),h=eM.promisify(h.bind(t.cookieJar)),t.cookieJar={setCookie:f,getCookieString:h})}let{cache:p}=t;if(p&&(wI.has(p)||wI.set(p,new nM((f,h)=>{let m=f[wt](f,h);return S.default.promise(m)&&(m.once=(y,w)=>{if(y==="error")m.catch(w);else if(y==="abort")(async()=>{try{(await m).once("abort",w)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${y}`);return m}),m},p))),t.cacheOptions={...t.cacheOptions},t.dnsCache===!0)_I||(_I=new k9.default),t.dnsCache=_I;else if(!S.default.undefined(t.dnsCache)&&!t.dnsCache.lookup)throw new TypeError(`Parameter \`dnsCache\` must be a CacheableLookup instance or a boolean, got ${S.default(t.dnsCache)}`);S.default.number(t.timeout)?t.timeout={request:t.timeout}:n&&t.timeout!==n.timeout?t.timeout={...n.timeout,...t.timeout}:t.timeout={...t.timeout},t.context||(t.context={});let d=t.hooks===n?.hooks;t.hooks={...t.hooks};for(let f of me.knownHookEvents)if(f in t.hooks)if(S.default.array(t.hooks[f]))t.hooks[f]=[...t.hooks[f]];else throw new TypeError(`Parameter \`${f}\` must be an Array, got ${S.default(t.hooks[f])}`);else t.hooks[f]=[];if(n&&!d)for(let f of me.knownHookEvents)n.hooks[f].length>0&&(t.hooks[f]=[...n.hooks[f],...t.hooks[f]]);if("family"in t&&ho.default('"options.family" was never documented, please use "options.dnsLookupIpVersion"'),n?.https&&(t.https={...n.https,...t.https}),"rejectUnauthorized"in t&&ho.default('"options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"'),"checkServerIdentity"in t&&ho.default('"options.checkServerIdentity" was never documented, please use "options.https.checkServerIdentity"'),"ca"in t&&ho.default('"options.ca" was never documented, please use "options.https.certificateAuthority"'),"key"in t&&ho.default('"options.key" was never documented, please use "options.https.key"'),"cert"in t&&ho.default('"options.cert" was never documented, please use "options.https.certificate"'),"passphrase"in t&&ho.default('"options.passphrase" was never documented, please use "options.https.passphrase"'),"pfx"in t&&ho.default('"options.pfx" was never documented, please use "options.https.pfx"'),"followRedirects"in t)throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.");if(t.agent){for(let f in t.agent)if(f!=="http"&&f!=="https"&&f!=="http2")throw new TypeError(`Expected the \`options.agent\` properties to be \`http\`, \`https\` or \`http2\`, got \`${f}\``)}return t.maxRedirects=(c=t.maxRedirects)!==null&&c!==void 0?c:0,me.setNonEnumerableProperties([n,u],t),G9.default(t,n)}_lockWrite(){let e=()=>{throw new TypeError("The payload has been already provided")};this.write=e,this.end=e}_unlockWrite(){this.write=super.write,this.end=super.end}async _finalizeBody(){let{options:e}=this,{headers:t}=e,n=!S.default.undefined(e.form),i=!S.default.undefined(e.json),o=!S.default.undefined(e.body),s=n||i||o,a=me.withoutBody.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=a,s){if(a)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);if([o,n,i].filter(c=>c).length>1)throw new TypeError("The `body`, `json` and `form` options are mutually exclusive");if(o&&!(e.body instanceof tM.Readable)&&!S.default.string(e.body)&&!S.default.buffer(e.body)&&!iM.default(e.body))throw new TypeError("The `body` option must be a stream.Readable, string or Buffer");if(n&&!S.default.object(e.form))throw new TypeError("The `form` option must be an Object");{let c=!S.default.string(t["content-type"]);o?(iM.default(e.body)&&c&&(t["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`),this[mo]=e.body):n?(c&&(t["content-type"]="application/x-www-form-urlencoded"),this[mo]=new fo.URLSearchParams(e.form).toString()):(c&&(t["content-type"]="application/json"),this[mo]=e.stringifyJson(e.json));let u=await F9.default(this[mo],e.headers);S.default.undefined(t["content-length"])&&S.default.undefined(t["transfer-encoding"])&&!a&&!S.default.undefined(u)&&(t["content-length"]=String(u))}}else a?this._lockWrite():this._unlockWrite();this[wc]=Number(t["content-length"])||void 0}async _onResponseBase(e){let{options:t}=this,{url:n}=t;this[pM]=e,t.decompress&&(e=O9(e));let i=e.statusCode,o=e;o.statusMessage=o.statusMessage?o.statusMessage:rM.STATUS_CODES[i],o.url=t.url.toString(),o.requestUrl=this.requestUrl,o.redirectUrls=this.redirects,o.request=this,o.isFromCache=e.fromCache||!1,o.ip=this.ip,o.retryCount=this.retryCount,this[uM]=o.isFromCache,this[_c]=Number(e.headers["content-length"])||void 0,this[sm]=e,e.once("end",()=>{this[_c]=this[Ac],this.emit("downloadProgress",this.downloadProgress)}),e.once("error",a=>{e.destroy(),this._beforeError(new Fl(a,this))}),e.once("aborted",()=>{this._beforeError(new Fl({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let s=e.headers["set-cookie"];if(S.default.object(t.cookieJar)&&s){let a=s.map(async c=>t.cookieJar.setCookie(c,n.toString()));t.ignoreInvalidCookies&&(a=a.map(async c=>c.catch(()=>{})));try{await Promise.all(a)}catch(c){this._beforeError(c);return}}if(t.followRedirect&&e.headers.location&&Q9.has(i)){if(e.resume(),this[wt]&&(this[AI](),delete this[wt],this[cM]()),(i===303&&t.method!=="GET"&&t.method!=="HEAD"||!t.methodRewriting)&&(t.method="GET","body"in t&&delete t.body,"json"in t&&delete t.json,"form"in t&&delete t.form,this[mo]=void 0,delete t.headers["content-length"]),this.redirects.length>=t.maxRedirects){this._beforeError(new am(this));return}try{let p=function(d){return d.protocol==="unix:"||d.hostname==="unix"},c=Buffer.from(e.headers.location,"binary").toString(),u=new fo.URL(c,n),l=u.toString();if(decodeURI(l),!p(n)&&p(u)){this._beforeError(new et("Cannot redirect to UNIX socket",{},this));return}u.hostname!==n.hostname||u.port!==n.port?("host"in t.headers&&delete t.headers.host,"cookie"in t.headers&&delete t.headers.cookie,"authorization"in t.headers&&delete t.headers.authorization,(t.username||t.password)&&(t.username="",t.password="")):(u.username=t.username,u.password=t.password),this.redirects.push(l),t.url=u;for(let d of t.hooks.beforeRedirect)await d(t,o);this.emit("redirect",o,t),await this._makeRequest()}catch(c){this._beforeError(c);return}return}if(t.isStream&&t.throwHttpErrors&&!q9.isResponseOk(o)){this._beforeError(new cm(o));return}e.on("readable",()=>{this[om]&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this.emit("response",e);for(let a of this[im])if(!a.headersSent){for(let c in e.headers){let u=t.decompress?c!=="content-encoding":!0,l=e.headers[c];u&&a.setHeader(c,l)}a.statusCode=i}}async _onResponse(e){try{await this._onResponseBase(e)}catch(t){this._beforeError(t)}}_onRequest(e){let{options:t}=this,{timeout:n,url:i}=t;R9.default(e),this[AI]=oM.default(e,n,i);let o=t.cache?"cacheableResponse":"response";e.once(o,c=>{this._onResponse(c)}),e.once("error",c=>{var u;e.destroy(),(u=e.res)===null||u===void 0||u.removeAllListeners("end"),c=c instanceof oM.TimeoutError?new pm(c,this.timings,this):new et(c.message,c,this),this._beforeError(c)}),this[cM]=U9.default(e,this,eX),this[wt]=e,this.emit("uploadProgress",this.uploadProgress);let s=this[mo],a=this.redirects.length===0?this:e;S.default.nodeStream(s)?(s.pipe(a),s.once("error",c=>{this._beforeError(new lm(c,this))})):(this._unlockWrite(),S.default.undefined(s)?(this._cannotHaveBody||this._noPipe)&&(a.end(),this._lockWrite()):(this._writeRequest(s,void 0,()=>{}),a.end(),this._lockWrite())),this.emit("request",e)}async _createCacheableRequest(e,t){return new Promise((n,i)=>{Object.assign(t,W9.default(e)),delete t.url;let o,s=wI.get(t.cache)(t,async a=>{a._readableState.autoDestroy=!1,o&&(await o).emit("cacheableResponse",a),n(a)});t.url=e,s.once("error",i),s.once("request",async a=>{o=a,n(o)})})}async _makeRequest(){var e,t,n,i,o;let{options:s}=this,{headers:a}=s;for(let w in a)if(S.default.undefined(a[w]))delete a[w];else if(S.default.null_(a[w]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${w}\` header`);if(s.decompress&&S.default.undefined(a["accept-encoding"])&&(a["accept-encoding"]=X9?"gzip, deflate, br":"gzip, deflate"),s.cookieJar){let w=await s.cookieJar.getCookieString(s.url.toString());S.default.nonEmptyString(w)&&(s.headers.cookie=w)}for(let w of s.hooks.beforeRequest){let D=await w(s);if(!S.default.undefined(D)){s.request=()=>D;break}}s.body&&this[mo]!==s.body&&(this[mo]=s.body);let{agent:c,request:u,timeout:l,url:p}=s;if(s.dnsCache&&!("lookup"in s)&&(s.lookup=s.dnsCache.lookup),p.hostname==="unix"){let w=/(?<socketPath>.+?):(?<path>.+)/.exec(`${p.pathname}${p.search}`);if(w?.groups){let{socketPath:D,path:j}=w.groups;Object.assign(s,{socketPath:D,path:j,host:""})}}let d=p.protocol==="https:",f;s.http2?f=N9.auto:f=d?M9.request:rM.request;let h=(e=s.request)!==null&&e!==void 0?e:f,m=s.cache?this._createCacheableRequest:h;c&&!s.http2&&(s.agent=c[d?"https":"http"]),s[wt]=h,delete s.request,delete s.timeout;let y=s;if(y.shared=(t=s.cacheOptions)===null||t===void 0?void 0:t.shared,y.cacheHeuristic=(n=s.cacheOptions)===null||n===void 0?void 0:n.cacheHeuristic,y.immutableMinTimeToLive=(i=s.cacheOptions)===null||i===void 0?void 0:i.immutableMinTimeToLive,y.ignoreCargoCult=(o=s.cacheOptions)===null||o===void 0?void 0:o.ignoreCargoCult,s.dnsLookupIpVersion!==void 0)try{y.family=aM.dnsLookupIpVersionToFamily(s.dnsLookupIpVersion)}catch{throw new Error("Invalid `dnsLookupIpVersion` option value")}s.https&&("rejectUnauthorized"in s.https&&(y.rejectUnauthorized=s.https.rejectUnauthorized),s.https.checkServerIdentity&&(y.checkServerIdentity=s.https.checkServerIdentity),s.https.certificateAuthority&&(y.ca=s.https.certificateAuthority),s.https.certificate&&(y.cert=s.https.certificate),s.https.key&&(y.key=s.https.key),s.https.passphrase&&(y.passphrase=s.https.passphrase),s.https.pfx&&(y.pfx=s.https.pfx));try{let w=await m(p,y);S.default.undefined(w)&&(w=f(p,y)),s.request=u,s.timeout=l,s.agent=c,s.https&&("rejectUnauthorized"in s.https&&delete y.rejectUnauthorized,s.https.checkServerIdentity&&delete y.checkServerIdentity,s.https.certificateAuthority&&delete y.ca,s.https.certificate&&delete y.cert,s.https.key&&delete y.key,s.https.passphrase&&delete y.passphrase,s.https.pfx&&delete y.pfx),J9(w)?this._onRequest(w):this.writable?(this.once("finish",()=>{this._onResponse(w)}),this._unlockWrite(),this.end(),this._lockWrite()):this._onResponse(w)}catch(w){throw w instanceof nM.CacheError?new um(w,this):new et(w.message,w,this)}}async _error(e){try{for(let t of this.options.hooks.beforeError)e=await t(e)}catch(t){e=new et(t.message,t,this)}this.destroy(e)}_beforeError(e){if(this[Ec])return;let{options:t}=this,n=this.retryCount+1;this[Ec]=!0,e instanceof et||(e=new et(e.message,e,this));let i=e,{response:o}=i;(async()=>{if(o&&!o.body){o.setEncoding(this._readableState.encoding);try{o.rawBody=await V9.default(o),o.body=o.rawBody.toString()}catch{}}if(this.listenerCount("retry")!==0){let s;try{let a;o&&"retry-after"in o.headers&&(a=Number(o.headers["retry-after"]),Number.isNaN(a)?(a=Date.parse(o.headers["retry-after"])-Date.now(),a<=0&&(a=1)):a*=1e3),s=await t.retry.calculateDelay({attemptCount:n,retryOptions:t.retry,error:i,retryAfter:a,computedValue:K9.default({attemptCount:n,retryOptions:t.retry,error:i,retryAfter:a,computedValue:0})})}catch(a){this._error(new et(a.message,a,this));return}if(s){let a=async()=>{try{for(let c of this.options.hooks.beforeRetry)await c(this.options,i,n)}catch(c){this._error(new et(c.message,e,this));return}this.destroyed||(this.destroy(),this.emit("retry",n,e))};this[dM]=setTimeout(a,s);return}}this._error(i)})()}_read(){this[om]=!0;let e=this[sm];if(e&&!this[Ec]){e.readableLength&&(this[om]=!1);let t;for(;(t=e.read())!==null;){this[Ac]+=t.length,this[lM]=!0;let n=this.downloadProgress;n.percent<1&&this.emit("downloadProgress",n),this.push(t)}}}_write(e,t,n){let i=()=>{this._writeRequest(e,t,n)};this.requestInitialized?i():this[Bl].push(i)}_writeRequest(e,t,n){this[wt].destroyed||(this._progressCallbacks.push(()=>{this[Sc]+=Buffer.byteLength(e,t);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}),this[wt].write(e,t,i=>{!i&&this._progressCallbacks.length>0&&this._progressCallbacks.shift()(),n(i)}))}_final(e){let t=()=>{for(;this._progressCallbacks.length!==0;)this._progressCallbacks.shift()();if(!(wt in this)){e();return}if(this[wt].destroyed){e();return}this[wt].end(n=>{n||(this[wc]=this[Sc],this.emit("uploadProgress",this.uploadProgress),this[wt].emit("upload-complete")),e(n)})};this.requestInitialized?t():this[Bl].push(t)}_destroy(e,t){var n;this[Ec]=!0,clearTimeout(this[dM]),wt in this&&(this[AI](),!((n=this[sm])===null||n===void 0)&&n.complete||this[wt].destroy()),e!==null&&!S.default.undefined(e)&&!(e instanceof et)&&(e=new et(e.message,e,this)),t(e)}get _isAboutToError(){return this[Ec]}get ip(){var e;return(e=this.socket)===null||e===void 0?void 0:e.remoteAddress}get aborted(){var e,t,n;return((t=(e=this[wt])===null||e===void 0?void 0:e.destroyed)!==null&&t!==void 0?t:this.destroyed)&&!(!((n=this[pM])===null||n===void 0)&&n.complete)}get socket(){var e,t;return(t=(e=this[wt])===null||e===void 0?void 0:e.socket)!==null&&t!==void 0?t:void 0}get downloadProgress(){let e;return this[_c]?e=this[Ac]/this[_c]:this[_c]===this[Ac]?e=1:e=0,{percent:e,transferred:this[Ac],total:this[_c]}}get uploadProgress(){let e;return this[wc]?e=this[Sc]/this[wc]:this[wc]===this[Sc]?e=1:e=0,{percent:e,transferred:this[Sc],total:this[wc]}}get timings(){var e;return(e=this[wt])===null||e===void 0?void 0:e.timings}get isFromCache(){return this[uM]}pipe(e,t){if(this[lM])throw new Error("Failed to pipe. The response has been emitted already.");return e instanceof II.ServerResponse&&this[im].add(e),super.pipe(e,t)}unpipe(e){return e instanceof II.ServerResponse&&this[im].delete(e),super.unpipe(e),this}};me.default=fm});var Wl=v(an=>{"use strict";var tX=an&&an.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),rX=an&&an.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&tX(e,r,t)};Object.defineProperty(an,"__esModule",{value:!0});an.CancelError=an.ParseError=void 0;var fM=Ul(),SI=class extends fM.RequestError{constructor(e,t){let{options:n}=t.request;super(`${e.message} in "${n.url.toString()}"`,e,t.request),this.name="ParseError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_BODY_PARSE_FAILURE":this.code}};an.ParseError=SI;var EI=class extends fM.RequestError{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}};an.CancelError=EI;rX(Ul(),an)});var mM=v(xI=>{"use strict";Object.defineProperty(xI,"__esModule",{value:!0});var hM=Wl(),nX=(r,e,t,n)=>{let{rawBody:i}=r;try{if(e==="text")return i.toString(n);if(e==="json")return i.length===0?"":t(i.toString());if(e==="buffer")return i;throw new hM.ParseError({message:`Unknown body type '${e}'`,name:"Error"},r)}catch(o){throw new hM.ParseError(o,r)}};xI.default=nX});var PI=v(Ho=>{"use strict";var iX=Ho&&Ho.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),oX=Ho&&Ho.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&iX(e,r,t)};Object.defineProperty(Ho,"__esModule",{value:!0});var sX=H("events"),aX=xi(),cX=fD(),hm=Wl(),HM=mM(),gM=Ul(),uX=lI(),lX=gI(),yM=yI(),pX=["request","response","redirect","uploadProgress","downloadProgress"];function bM(r){let e,t,n=new sX.EventEmitter,i=new cX((s,a,c)=>{let u=l=>{let p=new gM.default(void 0,r);p.retryCount=l,p._noPipe=!0,c(()=>p.destroy()),c.shouldReject=!1,c(()=>a(new hm.CancelError(p))),e=p,p.once("response",async h=>{var m;if(h.retryCount=l,h.request.aborted)return;let y;try{y=await lX.default(p),h.rawBody=y}catch{return}if(p._isAboutToError)return;let w=((m=h.headers["content-encoding"])!==null&&m!==void 0?m:"").toLowerCase(),D=["gzip","deflate","br"].includes(w),{options:j}=p;if(D&&!j.decompress)h.body=y;else try{h.body=HM.default(h,j.responseType,j.parseJson,j.encoding)}catch(X){if(h.body=y.toString(),yM.isResponseOk(h)){p._beforeError(X);return}}try{for(let[X,B]of j.hooks.afterResponse.entries())h=await B(h,async Z=>{let O=gM.default.normalizeArguments(void 0,{...Z,retry:{calculateDelay:()=>0},throwHttpErrors:!1,resolveBodyOnly:!1},j);O.hooks.afterResponse=O.hooks.afterResponse.slice(0,X);for(let re of O.hooks.beforeRetry)await re(O);let G=bM(O);return c(()=>{G.catch(()=>{}),G.cancel()}),G})}catch(X){p._beforeError(new hm.RequestError(X.message,X,p));return}if(t=h,!yM.isResponseOk(h)){p._beforeError(new hm.HTTPError(h));return}p.destroy(),s(p.options.resolveBodyOnly?h.body:h)});let d=h=>{if(i.isCanceled)return;let{options:m}=p;if(h instanceof hm.HTTPError&&!m.throwHttpErrors){let{response:y}=h;s(p.options.resolveBodyOnly?y.body:y);return}a(h)};p.once("error",d);let f=p.options.body;p.once("retry",(h,m)=>{var y,w;if(f===((y=m.request)===null||y===void 0?void 0:y.options.body)&&aX.default.nodeStream((w=m.request)===null||w===void 0?void 0:w.options.body)){d(m);return}u(h)}),uX.default(p,n,pX)};u(0)});i.on=(s,a)=>(n.on(s,a),i);let o=s=>{let a=(async()=>{await i;let{options:c}=t.request;return HM.default(t,s,c.parseJson,c.encoding)})();return Object.defineProperties(a,Object.getOwnPropertyDescriptors(i)),a};return i.json=()=>{let{headers:s}=e.options;return!e.writableFinished&&s.accept===void 0&&(s.accept="application/json"),o("json")},i.buffer=()=>o("buffer"),i.text=()=>o("text"),i}Ho.default=bM;oX(Wl(),Ho)});var vM=v(LI=>{"use strict";Object.defineProperty(LI,"__esModule",{value:!0});var dX=Wl();function fX(r,...e){let t=(async()=>{if(r instanceof dX.RequestError)try{for(let i of e)if(i)for(let o of i)r=await o(r)}catch(i){r=i}throw r})(),n=()=>t;return t.json=n,t.text=n,t.buffer=n,t.on=n,t}LI.default=fX});var AM=v($I=>{"use strict";Object.defineProperty($I,"__esModule",{value:!0});var IM=xi();function _M(r){for(let e of Object.values(r))(IM.default.plainObject(e)||IM.default.array(e))&&_M(e);return Object.freeze(r)}$I.default=_M});var SM=v(wM=>{"use strict";Object.defineProperty(wM,"__esModule",{value:!0})});var CI=v(Fr=>{"use strict";var hX=Fr&&Fr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),mX=Fr&&Fr.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&hX(e,r,t)};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.defaultHandler=void 0;var EM=xi(),Br=PI(),HX=vM(),Hm=Ul(),gX=AM(),yX={RequestError:Br.RequestError,CacheError:Br.CacheError,ReadError:Br.ReadError,HTTPError:Br.HTTPError,MaxRedirectsError:Br.MaxRedirectsError,TimeoutError:Br.TimeoutError,ParseError:Br.ParseError,CancelError:Br.CancelError,UnsupportedProtocolError:Br.UnsupportedProtocolError,UploadError:Br.UploadError},bX=async r=>new Promise(e=>{setTimeout(e,r)}),{normalizeArguments:mm}=Hm.default,xM=(...r)=>{let e;for(let t of r)e=mm(void 0,t,e);return e},vX=r=>r.isStream?new Hm.default(void 0,r):Br.default(r),IX=r=>"defaults"in r&&"options"in r.defaults,_X=["get","post","put","patch","head","delete"];Fr.defaultHandler=(r,e)=>e(r);var PM=(r,e)=>{if(r)for(let t of r)t(e)},LM=r=>{r._rawHandlers=r.handlers,r.handlers=r.handlers.map(n=>(i,o)=>{let s,a=n(i,c=>(s=o(c),s));if(a!==s&&!i.isStream&&s){let c=a,{then:u,catch:l,finally:p}=c;Object.setPrototypeOf(c,Object.getPrototypeOf(s)),Object.defineProperties(c,Object.getOwnPropertyDescriptors(s)),c.then=u,c.catch=l,c.finally=p}return a});let e=(n,i={},o)=>{var s,a;let c=0,u=l=>r.handlers[c++](l,c===r.handlers.length?vX:u);if(EM.default.plainObject(n)){let l={...n,...i};Hm.setNonEnumerableProperties([n,i],l),i=l,n=void 0}try{let l;try{PM(r.options.hooks.init,i),PM((s=i.hooks)===null||s===void 0?void 0:s.init,i)}catch(d){l=d}let p=mm(n,i,o??r.options);if(p[Hm.kIsNormalizedAlready]=!0,l)throw new Br.RequestError(l.message,l,p);return u(p)}catch(l){if(i.isStream)throw l;return HX.default(l,r.options.hooks.beforeError,(a=i.hooks)===null||a===void 0?void 0:a.beforeError)}};e.extend=(...n)=>{let i=[r.options],o=[...r._rawHandlers],s;for(let a of n)IX(a)?(i.push(a.defaults.options),o.push(...a.defaults._rawHandlers),s=a.defaults.mutableDefaults):(i.push(a),"handlers"in a&&o.push(...a.handlers),s=a.mutableDefaults);return o=o.filter(a=>a!==Fr.defaultHandler),o.length===0&&o.push(Fr.defaultHandler),LM({options:xM(...i),handlers:o,mutableDefaults:!!s})};let t=async function*(n,i){let o=mm(n,i,r.options);o.resolveBodyOnly=!1;let s=o.pagination;if(!EM.default.object(s))throw new TypeError("`options.pagination` must be implemented");let a=[],{countLimit:c}=s,u=0;for(;u<s.requestLimit;){u!==0&&await bX(s.backoff);let l=await e(void 0,void 0,o),p=await s.transform(l),d=[];for(let h of p)if(s.filter(h,a,d)&&(!s.shouldContinue(h,a,d)||(yield h,s.stackAllItems&&a.push(h),d.push(h),--c<=0)))return;let f=s.paginate(l,a,d);if(f===!1)return;f===l.request.options?o=l.request.options:f!==void 0&&(o=mm(void 0,f,o)),u++}};e.paginate=t,e.paginate.all=async(n,i)=>{let o=[];for await(let s of t(n,i))o.push(s);return o},e.paginate.each=t,e.stream=(n,i)=>e(n,{...i,isStream:!0});for(let n of _X)e[n]=(i,o)=>e(i,{...o,method:n}),e.stream[n]=(i,o)=>e(i,{...o,method:n,isStream:!0});return Object.assign(e,yX),Object.defineProperty(e,"defaults",{value:r.mutableDefaults?r:gX.default(r),writable:r.mutableDefaults,configurable:r.mutableDefaults,enumerable:!0}),e.mergeOptions=xM,e};Fr.default=LM;mX(SM(),Fr)});var DM=v((Pi,gm)=>{"use strict";var AX=Pi&&Pi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),$M=Pi&&Pi.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&AX(e,r,t)};Object.defineProperty(Pi,"__esModule",{value:!0});var wX=H("url"),CM=CI(),SX={options:{method:"GET",retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:r})=>r},timeout:{},headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},hooks:{init:[],beforeRequest:[],beforeRedirect:[],beforeRetry:[],beforeError:[],afterResponse:[]},cache:void 0,dnsCache:void 0,decompress:!0,throwHttpErrors:!0,followRedirect:!0,isStream:!1,responseType:"text",resolveBodyOnly:!1,maxRedirects:10,prefixUrl:"",methodRewriting:!0,ignoreInvalidCookies:!1,context:{},http2:!1,allowGetBody:!1,https:void 0,pagination:{transform:r=>r.request.options.responseType==="json"?r.body:JSON.parse(r.body),paginate:r=>{if(!Reflect.has(r.headers,"link"))return!1;let e=r.headers.link.split(","),t;for(let n of e){let i=n.split(";");if(i[1].includes("next")){t=i[0].trimStart().trim(),t=t.slice(1,-1);break}}return t?{url:new wX.URL(t)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:1/0,backoff:0,requestLimit:1e4,stackAllItems:!0},parseJson:r=>JSON.parse(r),stringifyJson:r=>JSON.stringify(r),cacheOptions:{}},handlers:[CM.defaultHandler],mutableDefaults:!1},DI=CM.default(SX);Pi.default=DI;gm.exports=DI;gm.exports.default=DI;gm.exports.__esModule=!0;$M(CI(),Pi);$M(PI(),Pi)});async function TI(){if(WM.default.platform!=="darwin")throw new Error("macOS only");let{stdout:r}=await LX("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(r)?.groups.id??"com.apple.Safari"}var UM,WM,jM,LX,VM=zs(()=>{UM=H("node:util"),WM=_(H("node:process"),1),jM=H("node:child_process"),LX=(0,UM.promisify)(jM.execFile)});async function KM(r,{humanReadableOutput:e=!0}={}){if(qM.default.platform!=="darwin")throw new Error("macOS only");let t=e?[]:["-ss"],{stdout:n}=await $X("osascript",["-e",r,t]);return n.trim()}var qM,GM,MI,$X,XM=zs(()=>{qM=_(H("node:process"),1),GM=H("node:util"),MI=H("node:child_process"),$X=(0,GM.promisify)(MI.execFile)});async function RI(r){return KM(`tell application "Finder" to set app_path to application file id "${r}" as string
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var zM=zs(()=>{XM()});async function kI(r=CX){let{stdout:e}=await r("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),t=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(e);if(!t)throw new vm(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=t.groups,i=DX[n];if(!i)throw new vm(`Unknown browser ID: ${n}`);return i}var JM,YM,CX,DX,vm,QM=zs(()=>{JM=H("node:util"),YM=H("node:child_process"),CX=(0,JM.promisify)(YM.execFile),DX={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},vm=class extends Error{}});var rR={};VO(rR,{default:()=>tR});async function tR(){if(Im.default.platform==="darwin"){let r=await TI();return{name:await RI(r),id:r}}if(Im.default.platform==="linux"){let{stdout:r}=await TX("xdg-mime",["query","default","x-scheme-handler/http"]),e=r.trim();return{name:MX(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(Im.default.platform==="win32")return kI();throw new Error("Only macOS, Linux, and Windows are supported")}var ZM,Im,eR,TX,MX,nR=zs(()=>{ZM=H("node:util"),Im=_(H("node:process"),1),eR=H("node:child_process");VM();zM();QM();TX=(0,ZM.promisify)(eR.execFile),MX=r=>r.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var cR=v((gfe,aR)=>{"use strict";function kX(r){var e=new r,t=e;function n(){var o=e;return o.next?e=o.next:(e=new r,t=e),o.next=null,o}function i(o){t.next=o,t=o}return{get:n,release:i}}aR.exports=kX});var lR=v((yfe,NI)=>{"use strict";var OX=cR();function uR(r,e,t){if(typeof r=="function"&&(t=e,e=r,r=null),t<1)throw new Error("fastqueue concurrency must be greater than 1");var n=OX(NX),i=null,o=null,s=0,a=null,c={push:m,drain:jr,saturated:jr,pause:l,paused:!1,concurrency:t,running:u,resume:f,idle:h,length:p,getQueue:d,unshift:y,empty:jr,kill:D,killAndDrain:j,error:X};return c;function u(){return s}function l(){c.paused=!0}function p(){for(var B=i,Z=0;B;)B=B.next,Z++;return Z}function d(){for(var B=i,Z=[];B;)Z.push(B.value),B=B.next;return Z}function f(){if(c.paused){c.paused=!1;for(var B=0;B<c.concurrency;B++)s++,w()}}function h(){return s===0&&c.length()===0}function m(B,Z){var O=n.get();O.context=r,O.release=w,O.value=B,O.callback=Z||jr,O.errorHandler=a,s===c.concurrency||c.paused?o?(o.next=O,o=O):(i=O,o=O,c.saturated()):(s++,e.call(r,O.value,O.worked))}function y(B,Z){var O=n.get();O.context=r,O.release=w,O.value=B,O.callback=Z||jr,s===c.concurrency||c.paused?i?(O.next=i,i=O):(i=O,o=O,c.saturated()):(s++,e.call(r,O.value,O.worked))}function w(B){B&&n.release(B);var Z=i;Z?c.paused?s--:(o===i&&(o=null),i=Z.next,Z.next=null,e.call(r,Z.value,Z.worked),o===null&&c.empty()):--s===0&&c.drain()}function D(){i=null,o=null,c.drain=jr}function j(){i=null,o=null,c.drain(),c.drain=jr}function X(B){a=B}}function jr(){}function NX(){this.value=null,this.callback=jr,this.next=null,this.release=jr,this.context=null,this.errorHandler=null;var r=this;this.worked=function(t,n){var i=r.callback,o=r.errorHandler,s=r.value;r.value=null,r.callback=jr,r.errorHandler&&o(t,s),i.call(r.context,t,n),r.release(r)}}function BX(r,e,t){typeof r=="function"&&(t=e,e=r,r=null);function n(l,p){e.call(this,l).then(function(d){p(null,d)},p)}var i=uR(r,n,t),o=i.push,s=i.unshift;return i.push=a,i.unshift=c,i.drained=u,i;function a(l){var p=new Promise(function(d,f){o(l,function(h,m){if(h){f(h);return}d(m)})});return p.catch(jr),p}function c(l){var p=new Promise(function(d,f){s(l,function(h,m){if(h){f(h);return}d(m)})});return p.catch(jr),p}function u(){if(i.idle())return new Promise(function(d){d()});var l=i.drain,p=new Promise(function(d){i.drain=function(){l(),d()}});return p}}NI.exports=uR;NI.exports.promise=BX});var BI=v((bfe,pR)=>{pR.exports=function(r,e){if(typeof r!="string")throw new TypeError("expected path to be a string");if(r==="\\"||r==="/")return"/";var t=r.length;if(t<=1)return r;var n="";if(t>4&&r[3]==="\\"){var i=r[2];(i==="?"||i===".")&&r.slice(0,2)==="\\\\"&&(r=r.slice(2),n="//")}var o=r.split(/[/\\]+/);return e!==!1&&o[o.length-1]===""&&o.pop(),n+o.join("/")}});var gR=v((mR,HR)=>{"use strict";Object.defineProperty(mR,"__esModule",{value:!0});var hR=qy(),FX=BI(),dR="!",UX={returnIndex:!1},WX=r=>Array.isArray(r)?r:[r],jX=(r,e)=>{if(typeof r=="function")return r;if(typeof r=="string"){let t=hR(r,e);return n=>r===n||t(n)}return r instanceof RegExp?t=>r.test(t):t=>!1},fR=(r,e,t,n)=>{let i=Array.isArray(t),o=i?t[0]:t;if(!i&&typeof o!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(o));let s=FX(o,!1);for(let c=0;c<e.length;c++){let u=e[c];if(u(s))return n?-1:!1}let a=i&&[s].concat(t.slice(1));for(let c=0;c<r.length;c++){let u=r[c];if(i?u(...a):u(s))return n?c:!0}return n?-1:!1},FI=(r,e,t=UX)=>{if(r==null)throw new TypeError("anymatch: specify first argument");let n=typeof t=="boolean"?{returnIndex:t}:t,i=n.returnIndex||!1,o=WX(r),s=o.filter(c=>typeof c=="string"&&c.charAt(0)===dR).map(c=>c.slice(1)).map(c=>hR(c,n)),a=o.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==dR).map(c=>jX(c,n));return e==null?(c,u=!1)=>fR(a,s,c,typeof u=="boolean"?u:!1):fR(a,s,e,i)};FI.default=FI;HR.exports=FI});var bR=v((vfe,yR)=>{yR.exports=typeof queueMicrotask=="function"?queueMicrotask:r=>Promise.resolve().then(r)});var IR=v((Ife,vR)=>{vR.exports=typeof process<"u"&&typeof process.nextTick=="function"?process.nextTick.bind(process):bR()});var AR=v((Afe,_R)=>{_R.exports=class{constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}clear(){this.top=this.btm=0,this.next=null,this.buffer.fill(void 0)}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}peek(){return this.buffer[this.btm]}isEmpty(){return this.buffer[this.btm]===void 0}}});var ER=v((Sfe,SR)=>{var wR=AR();SR.exports=class{constructor(e){this.hwm=e||16,this.head=new wR(this.hwm),this.tail=this.head,this.length=0}clear(){this.head=this.tail,this.head.clear(),this.length=0}push(e){if(this.length++,!this.head.push(e)){let t=this.head;this.head=t.next=new wR(2*this.head.buffer.length),this.head.push(e)}}shift(){this.length!==0&&this.length--;let e=this.tail.shift();if(e===void 0&&this.tail.next){let t=this.tail.next;return this.tail.next=null,this.tail=t,this.tail.shift()}return e}peek(){let e=this.tail.peek();return e===void 0&&this.tail.next?this.tail.next.peek():e}isEmpty(){return this.length===0}}});var zR=v((Efe,XR)=>{var{EventEmitter:VX}=H("events"),Lm=new Error("Stream was destroyed"),UI=new Error("Premature close"),CR=IR(),DR=ER(),ot=(1<<27)-1,Ds=1,XI=2,Ls=4,Vl=8,TR=ot^Ds,qX=ot^XI,Yl=16,ql=32,Mc=64,bo=128,Gl=256,zI=512,$s=1024,WI=2048,JI=4096,YI=8192,cn=16384,$c=32768,$m=65536,MR=Gl|zI,GX=Yl|$m,KX=Mc|Yl,XX=JI|bo,zX=ot^Yl,JX=ot^Mc,YX=ot^(Mc|$m),QX=ot^$m,ZX=ot^Gl,ez=ot^(bo|YI),tz=ot^$s,xR=ot^MR,RR=ot^$c,rz=ot^ql,vo=1<<17,Dc=2<<17,Ql=4<<17,Cs=8<<17,Zl=16<<17,Ts=32<<17,jI=64<<17,Cc=128<<17,QI=256<<17,Tc=512<<17,kR=ot^(vo|QI),OR=ot^Ql,nz=ot^Tc,iz=ot^Zl,oz=ot^Cs,NR=ot^Cc,sz=ot^Dc,Kl=Yl|vo,BR=ot^Kl,ZI=cn|Ts,Li=Ls|Vl|XI,Hr=Li|Ds,FR=Li|ZI,az=OR&JX,e_=Cc|$c,cz=e_&BR,UR=Hr|cz,uz=Hr|$s|cn,PR=Hr|cn|bo,lz=Hr|$s|bo,pz=Hr|JI|bo|YI,dz=Hr|Yl|$s|cn|$m,fz=Li|$s|cn,hz=ql|Hr|$c|Mc,mz=Hr|Tc|Ts,Hz=Cs|Zl,WR=Cs|vo,gz=Cs|Zl|Hr|vo,LR=Hr|vo|Cs,yz=Ql|vo,bz=vo|QI,vz=Hr|Tc|WR|Ts,Iz=Zl|Li|Tc|Ts,_z=Dc|Hr|Cc|Ql,wm=Symbol.asyncIterator||Symbol("asyncIterator"),Sm=class{constructor(e,{highWaterMark:t=16384,map:n=null,mapWritable:i,byteLength:o,byteLengthWritable:s}={}){this.stream=e,this.queue=new DR,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.drains=null,this.byteLength=s||o||KR,this.map=i||n,this.afterWrite=Sz.bind(this),this.afterUpdateNextTick=Pz.bind(this)}get ended(){return(this.stream._duplexState&Ts)!==0}push(e){return this.map!==null&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),this.buffered<this.highWaterMark?(this.stream._duplexState|=Cs,!0):(this.stream._duplexState|=Hz,!1)}shift(){let e=this.queue.shift();return this.buffered-=this.byteLength(e),this.buffered===0&&(this.stream._duplexState&=oz),e}end(e){typeof e=="function"?this.stream.once("finish",e):e!=null&&this.push(e),this.stream._duplexState=(this.stream._duplexState|Tc)&OR}autoBatch(e,t){let n=[],i=this.stream;for(n.push(e);(i._duplexState&LR)===WR;)n.push(i._writableState.shift());if(i._duplexState&Hr)return t(null);i._writev(n,t)}update(){let e=this.stream;e._duplexState|=Dc;do{for(;(e._duplexState&LR)===Cs;){let t=this.shift();e._duplexState|=bz,e._write(t,this.afterWrite)}e._duplexState&yz||this.updateNonPrimary()}while(this.continueUpdate()===!0);e._duplexState&=sz}updateNonPrimary(){let e=this.stream;if((e._duplexState&vz)===Tc){e._duplexState=(e._duplexState|vo)&nz,e._final(wz.bind(this));return}if((e._duplexState&Li)===Ls){e._duplexState&e_||(e._duplexState|=Kl,e._destroy(jR.bind(this)));return}(e._duplexState&UR)===Ds&&(e._duplexState=(e._duplexState|Kl)&TR,e._open(VR.bind(this)))}continueUpdate(){return this.stream._duplexState&Cc?(this.stream._duplexState&=NR,!0):!1}updateCallback(){(this.stream._duplexState&_z)===Ql?this.update():this.updateNextTick()}updateNextTick(){this.stream._duplexState&Cc||(this.stream._duplexState|=Cc,this.stream._duplexState&Dc||CR(this.afterUpdateNextTick))}},VI=class{constructor(e,{highWaterMark:t=16384,map:n=null,mapReadable:i,byteLength:o,byteLengthReadable:s}={}){this.stream=e,this.queue=new DR,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.byteLength=s||o||KR,this.map=i||n,this.pipeTo=null,this.afterRead=Ez.bind(this),this.afterUpdateNextTick=xz.bind(this)}get ended(){return(this.stream._duplexState&cn)!==0}pipe(e,t){if(this.pipeTo!==null)throw new Error("Can only pipe to one destination");if(typeof t!="function"&&(t=null),this.stream._duplexState|=zI,this.pipeTo=e,this.pipeline=new GI(this.stream,e,t),t&&this.stream.on("error",$R),Jl(e))e._writableState.pipeline=this.pipeline,t&&e.on("error",$R),e.on("finish",this.pipeline.finished.bind(this.pipeline));else{let n=this.pipeline.done.bind(this.pipeline,e),i=this.pipeline.done.bind(this.pipeline,e,null);e.on("error",n),e.on("close",i),e.on("finish",this.pipeline.finished.bind(this.pipeline))}e.on("drain",Az.bind(this)),this.stream.emit("piping",e),e.emit("pipe",this.stream)}push(e){let t=this.stream;return e===null?(this.highWaterMark=0,t._duplexState=(t._duplexState|$s)&YX,!1):(this.map!==null&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),t._duplexState=(t._duplexState|bo)&QX,this.buffered<this.highWaterMark)}shift(){let e=this.queue.shift();return this.buffered-=this.byteLength(e),this.buffered===0&&(this.stream._duplexState&=ez),e}unshift(e){let t=[this.map!==null?this.map(e):e];for(;this.buffered>0;)t.push(this.shift());for(let n=0;n<t.length-1;n++){let i=t[n];this.buffered+=this.byteLength(i),this.queue.push(i)}this.push(t[t.length-1])}read(){let e=this.stream;if((e._duplexState&PR)===bo){let t=this.shift();return this.pipeTo!==null&&this.pipeTo.write(t)===!1&&(e._duplexState&=xR),e._duplexState&WI&&e.emit("data",t),t}return null}drain(){let e=this.stream;for(;(e._duplexState&PR)===bo&&e._duplexState&MR;){let t=this.shift();this.pipeTo!==null&&this.pipeTo.write(t)===!1&&(e._duplexState&=xR),e._duplexState&WI&&e.emit("data",t)}}update(){let e=this.stream;e._duplexState|=ql;do{for(this.drain();this.buffered<this.highWaterMark&&!(e._duplexState&dz);)e._duplexState|=GX,e._read(this.afterRead),this.drain();(e._duplexState&pz)===XX&&(e._duplexState|=YI,e.emit("readable")),e._duplexState&KX||this.updateNonPrimary()}while(this.continueUpdate()===!0);e._duplexState&=rz}updateNonPrimary(){let e=this.stream;if((e._duplexState&lz)===$s&&(e._duplexState=(e._duplexState|cn)&tz,e.emit("end"),(e._duplexState&FR)===ZI&&(e._duplexState|=Ls),this.pipeTo!==null&&this.pipeTo.end()),(e._duplexState&Li)===Ls){e._duplexState&e_||(e._duplexState|=Kl,e._destroy(jR.bind(this)));return}(e._duplexState&UR)===Ds&&(e._duplexState=(e._duplexState|Kl)&TR,e._open(VR.bind(this)))}continueUpdate(){return this.stream._duplexState&$c?(this.stream._duplexState&=RR,!0):!1}updateCallback(){(this.stream._duplexState&hz)===Mc?this.update():this.updateNextTick()}updateNextTick(){this.stream._duplexState&$c||(this.stream._duplexState|=$c,this.stream._duplexState&ql||CR(this.afterUpdateNextTick))}},qI=class{constructor(e){this.data=null,this.afterTransform=$z.bind(e),this.afterFinal=null}},GI=class{constructor(e,t,n){this.from=e,this.to=t,this.afterPipe=n,this.error=null,this.pipeToFinished=!1}finished(){this.pipeToFinished=!0}done(e,t){if(t&&(this.error=t),e===this.to&&(this.to=null,this.from!==null)){(!(this.from._duplexState&cn)||!this.pipeToFinished)&&this.from.destroy(this.error||new Error("Writable stream closed prematurely"));return}if(e===this.from&&(this.from=null,this.to!==null)){e._duplexState&cn||this.to.destroy(this.error||new Error("Readable stream closed before ending"));return}this.afterPipe!==null&&this.afterPipe(this.error),this.to=this.from=this.afterPipe=null}};function Az(){this.stream._duplexState|=zI,this.updateCallback()}function wz(r){let e=this.stream;r&&e.destroy(r),e._duplexState&Li||(e._duplexState|=Ts,e.emit("finish")),(e._duplexState&FR)===ZI&&(e._duplexState|=Ls),e._duplexState&=kR,e._duplexState&Dc?this.updateNextTick():this.update()}function jR(r){let e=this.stream;!r&&this.error!==Lm&&(r=this.error),r&&e.emit("error",r),e._duplexState|=Vl,e.emit("close");let t=e._readableState,n=e._writableState;if(t!==null&&t.pipeline!==null&&t.pipeline.done(e,r),n!==null){for(;n.drains!==null&&n.drains.length>0;)n.drains.shift().resolve(!1);n.pipeline!==null&&n.pipeline.done(e,r)}}function Sz(r){let e=this.stream;r&&e.destroy(r),e._duplexState&=kR,this.drains!==null&&Lz(this.drains),(e._duplexState&gz)===Zl&&(e._duplexState&=iz,(e._duplexState&jI)===jI&&e.emit("drain")),this.updateCallback()}function Ez(r){r&&this.stream.destroy(r),this.stream._duplexState&=zX,this.updateCallback()}function xz(){this.stream._duplexState&ql||(this.stream._duplexState&=RR,this.update())}function Pz(){this.stream._duplexState&Dc||(this.stream._duplexState&=NR,this.update())}function Lz(r){for(let e=0;e<r.length;e++)--r[e].writes===0&&(r.shift().resolve(!0),e--)}function VR(r){let e=this.stream;r&&e.destroy(r),e._duplexState&Ls||(e._duplexState&uz||(e._duplexState|=Mc),e._duplexState&mz||(e._duplexState|=Ql),e.emit("open")),e._duplexState&=BR,e._writableState!==null&&e._writableState.updateCallback(),e._readableState!==null&&e._readableState.updateCallback()}function $z(r,e){e!=null&&this.push(e),this._writableState.afterWrite(r)}function Cz(r){this._readableState!==null&&(r==="data"&&(this._duplexState|=WI|Gl,this._readableState.updateNextTick()),r==="readable"&&(this._duplexState|=JI,this._readableState.updateNextTick())),this._writableState!==null&&r==="drain"&&(this._duplexState|=jI,this._writableState.updateNextTick())}var Xl=class extends VX{constructor(e){super(),this._duplexState=0,this._readableState=null,this._writableState=null,e&&(e.open&&(this._open=e.open),e.destroy&&(this._destroy=e.destroy),e.predestroy&&(this._predestroy=e.predestroy),e.signal&&e.signal.addEventListener("abort",Oz.bind(this))),this.on("newListener",Cz)}_open(e){e(null)}_destroy(e){e(null)}_predestroy(){}get readable(){return this._readableState!==null?!0:void 0}get writable(){return this._writableState!==null?!0:void 0}get destroyed(){return(this._duplexState&Vl)!==0}get destroying(){return(this._duplexState&Li)!==0}destroy(e){this._duplexState&Li||(e||(e=Lm),this._duplexState=(this._duplexState|Ls)&az,this._readableState!==null&&(this._readableState.highWaterMark=0,this._readableState.error=e),this._writableState!==null&&(this._writableState.highWaterMark=0,this._writableState.error=e),this._duplexState|=XI,this._predestroy(),this._duplexState&=qX,this._readableState!==null&&this._readableState.updateNextTick(),this._writableState!==null&&this._writableState.updateNextTick())}},Em=class r extends Xl{constructor(e){super(e),this._duplexState|=Ds|Ts,this._readableState=new VI(this,e),e&&(e.read&&(this._read=e.read),e.eagerOpen&&this._readableState.updateNextTick())}_read(e){e(null)}pipe(e,t){return this._readableState.updateNextTick(),this._readableState.pipe(e,t),e}read(){return this._readableState.updateNextTick(),this._readableState.read()}push(e){return this._readableState.updateNextTick(),this._readableState.push(e)}unshift(e){return this._readableState.updateNextTick(),this._readableState.unshift(e)}resume(){return this._duplexState|=Gl,this._readableState.updateNextTick(),this}pause(){return this._duplexState&=ZX,this}static _fromAsyncIterator(e,t){let n,i=new r({...t,read(s){e.next().then(o).then(s.bind(null,null)).catch(s)},predestroy(){n=e.return()},destroy(s){if(!n)return s(null);n.then(s.bind(null,null)).catch(s)}});return i;function o(s){s.done?i.push(null):i.push(s.value)}}static from(e,t){if(Rz(e))return e;if(e[wm])return this._fromAsyncIterator(e[wm](),t);Array.isArray(e)||(e=e===void 0?[]:[e]);let n=0;return new r({...t,read(i){this.push(n===e.length?null:e[n++]),i(null)}})}static isBackpressured(e){return(e._duplexState&fz)!==0||e._readableState.buffered>=e._readableState.highWaterMark}static isPaused(e){return(e._duplexState&Gl)===0}[wm](){let e=this,t=null,n=null,i=null;return this.on("error",u=>{t=u}),this.on("readable",o),this.on("close",s),{[wm](){return this},next(){return new Promise(function(u,l){n=u,i=l;let p=e.read();p!==null?a(p):e._duplexState&Vl&&a(null)})},return(){return c(null)},throw(u){return c(u)}};function o(){n!==null&&a(e.read())}function s(){n!==null&&a(null)}function a(u){i!==null&&(t?i(t):u===null&&!(e._duplexState&cn)?i(Lm):n({value:u,done:u===null}),i=n=null)}function c(u){return e.destroy(u),new Promise((l,p)=>{if(e._duplexState&Vl)return l({value:void 0,done:!0});e.once("close",function(){u?p(u):l({value:void 0,done:!0})})})}}},xm=class extends Xl{constructor(e){super(e),this._duplexState|=Ds|cn,this._writableState=new Sm(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final),e.eagerOpen&&this._writableState.updateNextTick())}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}static isBackpressured(e){return(e._duplexState&Iz)!==0}static drained(e){if(e.destroyed)return Promise.resolve(!1);let t=e._writableState,i=(Nz(e)?Math.min(1,t.queue.length):t.queue.length)+(e._duplexState&QI?1:0);return i===0?Promise.resolve(!0):(t.drains===null&&(t.drains=[]),new Promise(o=>{t.drains.push({writes:i,resolve:o})}))}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}},zl=class extends Em{constructor(e){super(e),this._duplexState=Ds,this._writableState=new Sm(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final))}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}},Pm=class extends zl{constructor(e){super(e),this._transformState=new qI(this),e&&(e.transform&&(this._transform=e.transform),e.flush&&(this._flush=e.flush))}_write(e,t){this._readableState.buffered>=this._readableState.highWaterMark?this._transformState.data=e:this._transform(e,this._transformState.afterTransform)}_read(e){if(this._transformState.data!==null){let t=this._transformState.data;this._transformState.data=null,e(null),this._transform(t,this._transformState.afterTransform)}else e(null)}destroy(e){super.destroy(e),this._transformState.data!==null&&(this._transformState.data=null,this._transformState.afterTransform())}_transform(e,t){t(null,e)}_flush(e){e(null)}_final(e){this._transformState.afterFinal=e,this._flush(Dz.bind(this))}},KI=class extends Pm{};function Dz(r,e){let t=this._transformState.afterFinal;if(r)return t(r);e!=null&&this.push(e),this.push(null),t(null)}function Tz(...r){return new Promise((e,t)=>qR(...r,n=>{if(n)return t(n);e()}))}function qR(r,...e){let t=Array.isArray(r)?[...r,...e]:[r,...e],n=t.length&&typeof t[t.length-1]=="function"?t.pop():null;if(t.length<2)throw new Error("Pipeline requires at least 2 streams");let i=t[0],o=null,s=null;for(let u=1;u<t.length;u++)o=t[u],Jl(i)?i.pipe(o,c):(a(i,!0,u>1,c),i.pipe(o)),i=o;if(n){let u=!1,l=Jl(o)||!!(o._writableState&&o._writableState.autoDestroy);o.on("error",p=>{s===null&&(s=p)}),o.on("finish",()=>{u=!0,l||n(s)}),l&&o.on("close",()=>n(s||(u?null:UI)))}return o;function a(u,l,p,d){u.on("error",d),u.on("close",f);function f(){if(l&&u._readableState&&!u._readableState.ended||p&&u._writableState&&!u._writableState.ended)return d(UI)}}function c(u){if(!(!u||s)){s=u;for(let l of t)l.destroy(u)}}}function GR(r){return!!r._readableState||!!r._writableState}function Jl(r){return typeof r._duplexState=="number"&&GR(r)}function Mz(r){let e=r._readableState&&r._readableState.error||r._writableState&&r._writableState.error;return e===Lm?null:e}function Rz(r){return Jl(r)&&r.readable}function kz(r){return typeof r=="object"&&r!==null&&typeof r.byteLength=="number"}function KR(r){return kz(r)?r.byteLength:1024}function $R(){}function Oz(){this.destroy(new Error("Stream aborted."))}function Nz(r){return r._writev!==xm.prototype._writev&&r._writev!==zl.prototype._writev}XR.exports={pipeline:qR,pipelinePromise:Tz,isStream:GR,isStreamx:Jl,getStreamError:Mz,Stream:Xl,Writable:xm,Readable:Em,Duplex:zl,Transform:Pm,PassThrough:KI}});var YR=v((xfe,JR)=>{JR.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}});var t_=v((Pfe,ZR)=>{var Bz=YR(),QR={"{":"}","(":")","[":"]"},Fz=function(r){if(r[0]==="!")return!0;for(var e=0,t=-2,n=-2,i=-2,o=-2,s=-2;e<r.length;){if(r[e]==="*"||r[e+1]==="?"&&/[\].+)]/.test(r[e])||n!==-1&&r[e]==="["&&r[e+1]!=="]"&&(n<e&&(n=r.indexOf("]",e)),n>e&&(s===-1||s>n||(s=r.indexOf("\\",e),s===-1||s>n)))||i!==-1&&r[e]==="{"&&r[e+1]!=="}"&&(i=r.indexOf("}",e),i>e&&(s=r.indexOf("\\",e),s===-1||s>i))||o!==-1&&r[e]==="("&&r[e+1]==="?"&&/[:!=]/.test(r[e+2])&&r[e+3]!==")"&&(o=r.indexOf(")",e),o>e&&(s=r.indexOf("\\",e),s===-1||s>o))||t!==-1&&r[e]==="("&&r[e+1]!=="|"&&(t<e&&(t=r.indexOf("|",e)),t!==-1&&r[t+1]!==")"&&(o=r.indexOf(")",t),o>t&&(s=r.indexOf("\\",t),s===-1||s>o))))return!0;if(r[e]==="\\"){var a=r[e+1];e+=2;var c=QR[a];if(c){var u=r.indexOf(c,e);u!==-1&&(e=u+1)}if(r[e]==="!")return!0}else e++}return!1},Uz=function(r){if(r[0]==="!")return!0;for(var e=0;e<r.length;){if(/[*?{}()[\]]/.test(r[e]))return!0;if(r[e]==="\\"){var t=r[e+1];e+=2;var n=QR[t];if(n){var i=r.indexOf(n,e);i!==-1&&(e=i+1)}if(r[e]==="!")return!0}else e++}return!1};ZR.exports=function(e,t){if(typeof e!="string"||e==="")return!1;if(Bz(e))return!0;var n=Fz;return t&&t.strict===!1&&(n=Uz),n(e)}});var tk=v((Lfe,ek)=>{"use strict";var Wz=t_(),jz=H("path").posix.dirname,Vz=H("os").platform()==="win32",Cm="/",qz=/\\/g,Gz=/\\([!*?|[\](){}])/g;ek.exports=function(e,t){var n=Object.assign({flipBackslashes:!0},t);n.flipBackslashes&&Vz&&e.indexOf(Cm)<0&&(e=e.replace(qz,Cm)),Kz(e)&&(e+=Cm),e+="a";do e=jz(e);while(Xz(e));return e.replace(Gz,"$1")};function Kz(r){var e=r.slice(-1),t;switch(e){case"}":t="{";break;case"]":t="[";break;default:return!1}var n=r.indexOf(t);return n<0?!1:r.slice(n+1,-1).includes(Cm)}function Xz(r){return/\([^()]+$/.test(r)||r[0]==="{"||r[0]==="["||/[^\\][{[]/.test(r)?!0:Wz(r)}});var Dm=v(($fe,rk)=>{"use strict";rk.exports=function(r){if(typeof r!="string")throw new TypeError("expected a string");var e={negated:!1,pattern:r,original:r};return r.charAt(0)==="!"&&r.charAt(1)!=="("&&(e.negated=!0,e.pattern=r.slice(1)),e}});var ak=v((Cfe,sk)=>{"use strict";var Tm=H("path"),zz=Dm();sk.exports=function(r,e){var t=e||{},n=ik(t.cwd?t.cwd:process.cwd());n=Tm.resolve(n),n=r_(n),n=nk(n);var i=t.root;i&&(i=ik(i),i=r_(i),(process.platform==="win32"||!Tm.isAbsolute(i))&&(i=r_(Tm.resolve(i))),i=nk(i));var o=r.slice(-1),s=zz(r);return r=s.pattern,r.slice(0,2)==="./"&&(r=r.slice(2)),r.length===1&&r==="."&&(r=""),i&&r.charAt(0)==="/"?r=ok(i,r):(!Tm.isAbsolute(r)||r.slice(0,1)==="\\")&&(r=ok(n,r)),o==="/"&&r.slice(-1)!=="/"&&(r+="/"),s.negated?"!"+r:r};function nk(r){return r.replace(/([({[\]})*?!])/g,"\\$1")}function ik(r){return r.replace(/\\([({[\]})*?!])/g,"$1")}function r_(r){return r.replace(/\\/g,"/")}function ok(r,e){if(r.charAt(r.length-1)==="/"&&(r=r.slice(0,-1)),e.charAt(0)==="/"&&(e=e.slice(1)),!e)return r;for(;e.slice(0,3)==="../";)r=r.slice(0,r.lastIndexOf("/")),e=e.slice(3);return r+"/"+e}});var lk=v((Dfe,uk)=>{"use strict";var Jz=H("fs"),n_=H("path"),Yz=H("events"),Qz=lR(),Zz=gR(),e6=zR().Readable,t6=t_(),r6=tk(),ck=BI(),n6=Dm(),i6=ak(),o6="File not found with singular glob: ",s6=" (if this was purposeful, use `allowEmpty` option)";function a6(r){return t6(r)}function c6(){var r={withFileTypes:!0},e=new Yz,t=Qz(i,1);t.drain=function(){e.emit("end")},t.error(n);function n(o){o&&e.emit("error",o)}e.pause=function(){t.pause()},e.resume=function(){t.resume()},e.end=function(){t.kill()},e.walk=function(o){t.push(o)};function i(o,s){Jz.readdir(o,r,a);function a(u,l){if(u)return s(u);l.forEach(c),s()}function c(u){var l=n_.join(o,u.name);e.emit("path",l,u),u.isDirectory()&&t.push(l)}}return e}function u6(r){var e=!1;r.forEach(t);function t(n,i){if(typeof n!="string")throw new Error("Invalid glob at index "+i);var o=n6(n);o.negated===!1&&(e=!0)}if(e===!1)throw new Error("Missing positive glob")}function l6(r){if(typeof r.cwd!="string")throw new Error("The `cwd` option must be a string");if(typeof r.dot!="boolean")throw new Error("The `dot` option must be a boolean");if(typeof r.cwdbase!="boolean")throw new Error("The `cwdbase` option must be a boolean");if(typeof r.uniqueBy!="string"&&typeof r.uniqueBy!="function")throw new Error("The `uniqueBy` option must be a string or function");if(typeof r.allowEmpty!="boolean")throw new Error("The `allowEmpty` option must be a boolean");if(r.base&&typeof r.base!="string")throw new Error("The `base` option must be a string if specified");if(!Array.isArray(r.ignore))throw new Error("The `ignore` option must be a string or array")}function p6(r){var e=new Set;if(typeof r=="string")return n;return i;function t(o){return e.has(o)?!1:(e.add(o),!0)}function n(o){return t(o[r])}function i(o){return t(r(o))}}function d6(r,e){Array.isArray(r)||(r=[r]),u6(r);var t=Object.assign({},{cwd:process.cwd(),dot:!1,cwdbase:!1,uniqueBy:"path",allowEmpty:!1,ignore:[]},e);t.ignore=typeof t.ignore=="string"?[t.ignore]:t.ignore,l6(t),t.cwd=ck(n_.resolve(t.cwd),!0);var n=t.base;t.cwdbase&&(n=t.cwd);var i=c6(),o=new e6({highWaterMark:t.highWaterMark,read:l,predestroy:p}),s=r.map(d);t.ignore=t.ignore.map(d);var a=s.map(a6),c=Zz(s,null,t),u=p6(t.uniqueBy);i.on("path",f),i.once("end",h),i.once("error",m),i.walk(t.cwd);function l(y){i.resume(),y()}function p(){i.end()}function d(y){return i6(y,t)}function f(y,w){var D=c(y,!0);if(D===-1&&w.isDirectory()&&(D=c(y+n_.sep,!0)),D!==-1){a[D]=!0;var j=n||r6(s[D]),X={cwd:t.cwd,base:j,path:ck(y,!0)},B=u(X);if(B){var Z=o.push(X);Z||i.pause()}}}function h(){var y=!1;a.forEach(function(w,D){if(t.allowEmpty!==!0&&!w){y=!0;var j=new Error(o6+s[D]+s6);return o.destroy(j)}}),y===!1&&o.push(null)}function m(y){o.destroy(y)}return o}uk.exports=d6});var dk=v((Mfe,pk)=>{"use strict";pk.exports=function(){return/^[\\\/]{2,}[^\\\/]+[\\\/]+[^\\\/]+/}});var hk=v((Rfe,fk)=>{"use strict";var f6=dk()();fk.exports=function(r){if(typeof r!="string")throw new TypeError("expected a string");return f6.test(r)}});var Hk=v((kfe,mk)=>{"use strict";var h6=hk();mk.exports=function(e){if(typeof e!="string")throw new TypeError("expected filepath to be a string");return!h6(e)&&!/^([a-z]:)?[\\\/]/i.test(e)}});var gk=v((i_,o_)=>{(function(r){i_&&typeof i_=="object"&&typeof o_<"u"?o_.exports=r():typeof define=="function"&&define.amd?define([],r):typeof window<"u"?window.isWindows=r():typeof global<"u"?global.isWindows=r():typeof self<"u"?self.isWindows=r():this.isWindows=r()})(function(){"use strict";return function(){return process&&(process.platform==="win32"||/^(msys|cygwin)$/.test(process.env.OSTYPE))}})});var bk=v((Ofe,yk)=>{"use strict";var m6=Hk(),H6=gk();yk.exports=ep;function ep(r){if(typeof r!="string")throw new TypeError("isAbsolute expects a string.");return H6()?ep.win32(r):ep.posix(r)}ep.posix=function(e){return e.charAt(0)==="/"};ep.win32=function(e){return/[a-z]/i.test(e.charAt(0))&&e.charAt(1)===":"&&e.charAt(2)==="\\"||e.slice(0,2)==="\\\\"?!0:!m6(e)}});var Ek=v((Nfe,Sk)=>{"use strict";var vk=H("path"),g6=Dm(),Ik=bk();Sk.exports=function(r,e){var t=e||{},n=Ak(t.cwd?t.cwd:process.cwd());n=vk.resolve(n),n=s_(n),n=_k(n);var i=t.root;i&&(i=Ak(i),i=s_(i),(process.platform==="win32"||!Ik(i))&&(i=s_(vk.resolve(i))),i=_k(i)),r.slice(0,2)==="./"&&(r=r.slice(2)),r.length===1&&r==="."&&(r="");var o=r.slice(-1),s=g6(r);return r=s.pattern,i&&r.charAt(0)==="/"?r=wk(i,r):(!Ik(r)||r.slice(0,1)==="\\")&&(r=wk(n,r)),o==="/"&&r.slice(-1)!=="/"&&(r+="/"),s.negated?"!"+r:r};function _k(r){return r.replace(/([({[\]})*?!])/g,"\\$1")}function Ak(r){return r.replace(/\\([({[\]})*?!])/g,"$1")}function s_(r){return r.replace(/\\/g,"/")}function wk(r,e){return r.charAt(r.length-1)==="/"&&(r=r.slice(0,-1)),e.charAt(0)==="/"&&(e=e.slice(1)),e?r+"/"+e:r}});var i1,n1=zs(()=>{i1="./w32appcontainertokens-LVKSWXR7.node"});var s1=v((lge,o1)=>{n1();try{o1.exports=H(i1)}catch{}});var c1=v(Xm=>{"use strict";Object.defineProperty(Xm,"__esModule",{value:!0});Xm.getAppContainerProcessTokens=void 0;var P6=H("path"),a1,L6=()=>{if(process.platform==="win32")return a1??=s1(),a1},$6=r=>L6()?.getAppContainerProcessTokens().map(e=>(0,P6.join)(e,r));Xm.getAppContainerProcessTokens=$6});var S1=v((lbe,N6)=>{N6.exports={name:"dotenv",version:"16.4.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://github.com/motdotla/dotenv?sponsor=1",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3",decache:"^4.6.1",sinon:"^14.0.1",standard:"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0",tap:"^16.3.0",tar:"^6.1.11",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var P1=v((pbe,Mi)=>{var oH=H("fs"),v_=H("path"),B6=H("os"),F6=H("crypto"),U6=S1(),I_=U6.version,W6=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function j6(r){let e={},t=r.toString();t=t.replace(/\r\n?/mg,`
`);let n;for(;(n=W6.exec(t))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,`
`),o=o.replace(/\\r/g,"\r")),e[i]=o}return e}function V6(r){let e=x1(r),t=bt.configDotenv({path:e});if(!t.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=E1(r).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),c=K6(t,a);o=bt.decrypt(c.ciphertext,c.key);break}catch(a){if(s+1>=i)throw a}return bt.parse(o)}function q6(r){console.log(`[dotenv@${I_}][INFO] ${r}`)}function G6(r){console.log(`[dotenv@${I_}][WARN] ${r}`)}function sH(r){console.log(`[dotenv@${I_}][DEBUG] ${r}`)}function E1(r){return r&&r.DOTENV_KEY&&r.DOTENV_KEY.length>0?r.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function K6(r,e){let t;try{t=new URL(e)}catch(a){if(a.code==="ERR_INVALID_URL"){let c=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development");throw c.code="INVALID_DOTENV_KEY",c}throw a}let n=t.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=t.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=r.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function x1(r){let e=null;if(r&&r.path&&r.path.length>0)if(Array.isArray(r.path))for(let t of r.path)oH.existsSync(t)&&(e=t.endsWith(".vault")?t:`${t}.vault`);else e=r.path.endsWith(".vault")?r.path:`${r.path}.vault`;else e=v_.resolve(process.cwd(),".env.vault");return oH.existsSync(e)?e:null}function X6(r){return r[0]==="~"?v_.join(B6.homedir(),r.slice(1)):r}function z6(r){q6("Loading env from encrypted .env.vault");let e=bt._parseVault(r),t=process.env;return r&&r.processEnv!=null&&(t=r.processEnv),bt.populate(t,e,r),{parsed:e}}function J6(r){let e=v_.resolve(process.cwd(),".env"),t="utf8",n=!!(r&&r.debug);if(r){if(r.path!=null){let i=r.path;if(Array.isArray(i)){for(let o of r.path)if(oH.existsSync(o)){i=o;break}}e=X6(i)}r.encoding!=null?t=r.encoding:n&&sH("No encoding is specified. UTF-8 is used by default")}try{let i=bt.parse(oH.readFileSync(e,{encoding:t})),o=process.env;return r&&r.processEnv!=null&&(o=r.processEnv),bt.populate(o,i,r),{parsed:i}}catch(i){return n&&sH(`Failed to load ${e} ${i.message}`),{error:i}}}function Y6(r){if(E1(r).length===0)return bt.configDotenv(r);let e=x1(r);return e?bt._configVault(r):(G6(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),bt.configDotenv(r))}function Q6(r,e){let t=Buffer.from(e.slice(-64),"hex"),n=Buffer.from(r,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=F6.createDecipheriv("aes-256-gcm",t,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,c=s.message==="Invalid key length",u=s.message==="Unsupported state or unable to authenticate data";if(a||c){let l=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw l.code="INVALID_DOTENV_KEY",l}else if(u){let l=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw l.code="DECRYPTION_FAILED",l}else throw s}}function Z6(r,e,t={}){let n=!!(t&&t.debug),i=!!(t&&t.override);if(typeof e!="object"){let o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(let o of Object.keys(e))Object.prototype.hasOwnProperty.call(r,o)?(i===!0&&(r[o]=e[o]),n&&sH(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):r[o]=e[o]}var bt={configDotenv:J6,_configVault:z6,_parseVault:V6,config:Y6,decrypt:Q6,parse:j6,populate:Z6};Mi.exports.configDotenv=bt.configDotenv;Mi.exports._configVault=bt._configVault;Mi.exports._parseVault=bt._parseVault;Mi.exports.config=bt.config;Mi.exports.decrypt=bt.decrypt;Mi.exports.parse=bt.parse;Mi.exports.populate=bt.populate;Mi.exports=bt});var PH=_(je()),PO=_(H("fs")),LO=_(H("net")),$O=_(H("os")),LH=_(H("path")),lSe=_(TH());var Or=_(je());var It=r=>!!r,Js=r=>yp(r,e=>e!==null),F_=r=>yp(r,e=>e!==void 0),Ro=r=>e=>e instanceof r,gp=(r,e)=>{debugger;throw new Error(e.replace("{value}",JSON.stringify(r)))};function yp(r,e){let t={};for(let n of Object.keys(r)){let i=r[n];e(i,n)&&(t[n]=i)}return t}function ci(r,e){let t={};for(let n of Object.keys(r)){let i=r[n];t[n]=e(i,n)}return t}function U_(r,e){let t={};for(let n of Object.keys(r))e(n,r[n])&&(t[n]=r[n]);return t}function W_(...r){if(r.length===0)return{};let e={},t=Object.create(null);for(let n of r)if(n)for(let i of Object.keys(n)){let o=i.toLowerCase();t[o]?e[t[o]]=n[i]:(t[o]=i,e[i]=n[i])}return e}function j_(r,e){if(r.hasOwnProperty(e))return r[e];let t=e.toLowerCase();for(let n of Object.keys(r))if(n.toLowerCase()===t)return r[n]}var MH=Symbol("unset");function ne(r){let e=MH,t=(...n)=>(e===MH&&(t.value=e=r(...n)),e);return t.forget=()=>{e=MH,t.value=void 0},t.value=void 0,t}function ko(r){let e=new Map,t=n=>{if(e.has(n))return e.get(n);let i=r(n);return e.set(n,i),i};return t.clear=()=>e.clear(),t}function V_(r){let e,t=n=>(e?.arg===n||(e={arg:n,val:r(n)}),e.val);return t.clear=()=>e=void 0,t}function q_(r,e){let t,n=()=>{t!==void 0&&clearTimeout(t),t=setTimeout(()=>{t=void 0,e()},r)};return n.clear=()=>{t&&(clearTimeout(t),t=void 0)},n}function G_(r,e){let t,n=()=>{t===void 0&&(t=setTimeout(()=>{t=void 0,e()},r))};return n.queued=()=>!!t,n.clear=()=>{t&&(clearTimeout(t),t=void 0)},n}async function K_(r,e){let t=[],n=[];for(let i of r)await e(i)?t.push(i):n.push(i);return[t,n]}function Oo(r){let e=[];for(let t of r)e=e.concat(t);return e}var iN=2**31-1,bp=()=>{let r=0;return()=>r++&iN};var Ys={dispose:()=>{}},Ae=class{constructor(e){this.disposed=!1;this.items=[];e&&(this.items=e.slice())}get isDisposed(){return this.disposed}callback(...e){for(let t of e)this.push({dispose:t})}push(...e){return this.disposed?(e.forEach(t=>t.dispose()),e[0]):(this.items.push(...e),e[0])}disposeObject(e){this.items=this.items.filter(t=>t!==e),e.dispose()}clear(){let e=Promise.all(this.items.map(t=>t.dispose()));return this.items=[],e}dispose(){let e=Promise.all(this.items.map(t=>t.dispose()));return this.items=[],this.disposed=!0,e}};var z_=H("crypto"),J_=H("os"),Y_=_(H("path"));var pu=H("fs"),X_=H("path"),Ip=H("zlib"),oN=(r,e)=>e instanceof Error?{message:e.message,stack:e.stack}:typeof e=="bigint"?e.toString():e,vp=class{constructor(e,t){this.file=e;this.dap=t;try{(0,pu.mkdirSync)((0,X_.dirname)(e),{recursive:!0})}catch{}e.endsWith(".gz")?(this.stream=(0,Ip.createGzip)(),this.stream.pipe((0,pu.createWriteStream)(e))):this.stream=(0,pu.createWriteStream)(e)}async setup(){this.dap?.output({category:"console",output:`Verbose logs are written to:
${this.file}
`})}dispose(){this.stream&&(this.stream.end(),this.stream=void 0)}write(e){this.stream&&(this.stream.write(JSON.stringify(e,oN)+`
`),"flush"in this.stream&&typeof this.stream.flush=="function"&&this.stream.flush(Ip.constants.Z_SYNC_FLUSH))}};var sN={runtime:null,"runtime.sourcecreate":null,"runtime.assertion":null,"runtime.launch":null,"runtime.target":null,"runtime.welcome":null,"runtime.exception":null,"runtime.sourcemap":null,"runtime.breakpoints":null,"sourcemap.parsing":null,"perf.function":null,"cdp.send":null,"cdp.receive":null,"dap.send":null,"dap.receive":null,internal:null,proxyActivity:null},MJ=Object.keys(sN),U=Symbol("ILogger");function aN(r,e=(0,J_.tmpdir)()){if(r===!1)return{stdio:!1,logFile:null};let t={stdio:!0,logFile:Y_.join(e,`vscode-debugadapter-${(0,z_.randomBytes)(4).toString("hex")}.json.gz`)};return r===!0?t:{...t,...r}}function Q_(r,e){let t=aN(e),n={sinks:[]};return t.logFile&&n.sinks.push(new vp(t.logFile,r)),n}var Ve=class{constructor(e,t){this.lineNumber=e;this.columnNumber=t}get base0(){return this}get base1(){return new ke(this.lineNumber+1,this.columnNumber+1)}get base01(){return new zr(this.lineNumber,this.columnNumber+1)}compare(e){let t=e.base0;return this.lineNumber-t.lineNumber||this.columnNumber-t.columnNumber}},ke=class{constructor(e,t){this.lineNumber=e;this.columnNumber=t}get base0(){return new Ve(this.lineNumber-1,this.columnNumber-1)}get base1(){return this}get base01(){return new zr(this.lineNumber-1,this.columnNumber)}compare(e){let t=e.base1;return this.lineNumber-t.lineNumber||this.columnNumber-t.columnNumber||0}},zr=class{constructor(e,t){this.lineNumber=e;this.columnNumber=t}get base0(){return new Ve(this.lineNumber-1,this.columnNumber)}get base1(){return new ke(this.lineNumber,this.columnNumber+1)}get base01(){return this}compare(e){let t=e.base01;return this.lineNumber-t.lineNumber||this.columnNumber-t.columnNumber}},nr=class r{constructor(e,t){this.begin=e;this.end=t}static{this.ZERO=new r(new Ve(0,0),new Ve(0,0))}static{this.INFINITE=new r(new Ve(0,0),new Ve(1/0,1/0))}static simplify(e){if(e.length===0)return[];let t=e.slice().sort((o,s)=>o.begin.compare(s.begin)),n=[],i=t[0];for(let o=1;o<t.length;o++){let s=t[o];i.end.compare(s.begin)>=0?i=new r(i.begin,s.end):(n.push(i),i=s)}return n.push(i),n}contains(e){return e.compare(this.begin)>=0&&e.compare(this.end)<=0}toString(){let e=this.begin.base0,t=this.end.base0;return`Range[${e.lineNumber}:${e.columnNumber} -> ${t.lineNumber}:${t.columnNumber}]`}};var ue=r=>isFinite(r)?new Promise(e=>setTimeout(e,r)):new Promise(()=>{}),Z_=(r,e)=>{let t=setTimeout(r,e);return{dispose:()=>clearTimeout(t)}};function Qs(r){return new Promise((e,t)=>{let n=r.length;for(let i of r)i.then(o=>{o?(e(o),n=-1):--n===0&&e(void 0)}).catch(t)})}async function eA(r,e){for(let t=0;t<r.length;t++)if(await e(r[t]))return t;return-1}function ge(){let r=null,e=null,t=!1,n,i=new Promise((o,s)=>{r=a=>{t=!0,n=a,o(a)},e=a=>{t=!0,s(a)}});return{resolve:r,reject:e,promise:i,get settledValue(){return n},hasSettled:()=>t}}var Pa=_(q());var G0=_(je()),K0=H("path"),X0=H("url");var DE=H("fs");var pi=_(H("fs")),xw=_(H("util"));async function oa({access:r},e){if(!e)return!1;try{return await r(e),!0}catch{return!1}}async function Ni({stat:r},e){if(e)try{return await r(e)}catch{return}}function Pw(r){return new Promise(e=>{pi.readFile(r,"utf8",async(t,n)=>{e(t?"":n)})})}var OY=xw.promisify(pi.writeFile);var Jt=Symbol("FsUtils"),Qr=class{constructor(e){this.fs=e}realPath(e){return this.fs.realpath(e)}async exists(e){try{return await this.fs.access(e,pi.constants.F_OK),!0}catch{return!1}}readFile(e){return this.fs.readFile(e)}},pg=class{constructor(e){this.dap=e}async realPath(){throw new Error("not implemented")}async exists(e){try{let{doesExists:t}=await this.dap.remoteFileExistsRequest({localFilePath:e});return t}catch{return!1}}readFile(){throw new Error("not implemented")}},ed=class{constructor(e,t,n){this.remoteFilePrefix=e;this.localFsUtils=t;this.remoteFsUtils=n}static create(e,t,n){let i=new Qr(t);return e!==void 0?new this(e.toLowerCase(),i,new pg(n)):i}async exists(e){return this.selectFs(e).exists(e)}async readFile(e){return this.selectFs(e).readFile(e)}async realPath(e){return this.selectFs(e).realPath(e)}selectFs(e){return e.toLowerCase().startsWith(this.remoteFilePrefix)?this.remoteFsUtils:this.localFsUtils}};var uE=H("crypto"),lE=_(Dg()),pE=H("os"),fe=_(H("path"));var V2=process.platform==="win32"?"\\\\.\\pipe\\":(0,pE.tmpdir)(),q2=0,dE=()=>fe.join(V2,`node-cdp.${process.pid}-${(0,uE.randomBytes)(4).toString("hex")}-${q2++}.sock`);function G2(r){return process.platform!=="win32"?[""]:r.lookup("PATHEXT")?.split(";")||[".exe"]}async function dd(r,e,t){let n;if(process.platform==="win32"){let i=t.WINDIR||"C:\\Windows";n=fe.join(i,"System32","where.exe")}else n="/usr/bin/which";try{if(await Ni(r,n)){let o=(await(0,lE.default)(n,[e],{env:Js(t)})).stdout.split(/\r?\n/);if(process.platform==="win32"){let s=String(t.PATHEXT||".exe").toUpperCase().split(";");for(let a of o){let c=fe.extname(a).toUpperCase();if(c&&s.includes(c))return a}}else if(o.length>0)return o[0];return}return e}catch{}}async function Tg(r,e,t){if(e){if(process.platform==="win32"&&!fe.extname(e))for(let n of G2(t)){let i=e+n;if(await Ni(r,i))return i}if(await Ni(r,e))return e}}var fE=r=>r.includes(`.asar${fe.sep}`);function Bi(...r){return fe.posix.isAbsolute(r[0])?Oe(fe.posix.join(...r)):fe.win32.isAbsolute(r[0])?fe.win32.join(...r):fe.join(...r)}function ir(...r){return fe.posix.isAbsolute(r[0])?fe.posix.resolve(...r):fe.win32.isAbsolute(r[0])?fe.win32.resolve(...r):fe.resolve(...r)}function Su(r,e){return fe.posix.isAbsolute(r)?fe.posix.relative(r,e):fe.win32.isAbsolute(r)?fe.win32.relative(r,e):fe.relative(r,e)}var K2=/\/|\\/,wu="file:///",hE=r=>r.startsWith(wu)&&r[wu.length+1]===":",Mg=r=>r.split(K2);function Rg(r,e=!1){if(!r)return r;if(hE(r)){let t=wu.length;r=wu+r[t].toLowerCase()+r.substr(t+1)}else fd(r)&&(r=(e?r[0].toUpperCase():r[0].toLowerCase())+r.substr(1));return r}function Xe(r,e=!1){if(!r)return r;if(r=Rg(r,e),hE(r)){let t=wu.length;r=r.substr(0,t+1)+r.substr(t+1).replace(/\//g,"\\")}else fd(r)&&(r=r.replace(/\//g,"\\"));return r}function Oe(r){return r.replace(/\\\//g,"/").replace(/\\/g,"/")}var mE=(r,e)=>{let t=fe.relative(r,e);return t.length&&!fe.isAbsolute(t)&&!t.startsWith("..")},HE=(r,e)=>{let t=fe.relative(r,e);return!fe.isAbsolute(t)&&!t.startsWith("..")},kg=r=>r.startsWith("\\\\"),fd=r=>/^[A-Za-z]:/.test(r)||kg(r);var LE=H("path"),$E=H("worker_threads");var Wo=_(EE()),Fg=H("fs"),Ug=H("worker_threads");var aj=Buffer.from("(function (exports, require, module, __filename, __dirname) { "),cj=Buffer.from(`
});`),uj=Buffer.from("(function (exports, require, module, __filename, __dirname, process, global, Buffer) { return function (exports, require, module, __filename, __dirname) { "),lj=Buffer.from(`
}.call(this, exports, require, module, __filename, __dirname); });`),pj=Buffer.from("#!"),dj=Buffer.from("\r")[0],fj=Buffer.from(`
`)[0],hj=(r,e)=>r.slice(0,e.length).equals(e),xE=(r,e,t)=>{let n=e.length===64?Wo.shaHash:Wo.hash;if(n(r)===e)return!0;if(t){if(hj(r,pj)){let i=r.indexOf(fj);return r[i-1]===dj&&i--,n(r.slice(i))===e}if(n(Buffer.concat([aj,r,cj]))===e)return!0}return n(Buffer.concat([uj,r,lj]))===e},PE=r=>r instanceof Buffer?r:Buffer.from(r,"utf-8");async function mj(r){switch(r.type){case 0:try{let e=await Fg.promises.readFile(r.file);return{id:r.id,hash:r.mode===0?(0,Wo.hash)(e):(0,Wo.shaHash)(e)}}catch{return{id:r.id}}case 1:try{return{id:r.id,hash:(0,Wo.hash)(PE(r.data))}}catch{return{id:r.id}}case 2:try{let e=await Fg.promises.readFile(r.file);return{id:r.id,matches:xE(e,r.expected,r.checkNode)}}catch{return{id:r.id,matches:!1}}case 3:try{return{id:r.id,matches:xE(PE(r.data),r.expected,r.checkNode)}}catch{return{id:r.id,matches:!1}}}}function Hj(r){r.on("message",e=>{mj(e).then(t=>r.postMessage(t))})}Ug.parentPort&&Hj(Ug.parentPort);var vd=class{constructor(e=3,t=(0,LE.join)(__dirname,"hash.js")){this.maxFailures=e;this.hasherScriptPath=t;this.idCounter=0;this.failureCount=0;this.deferredMap=new Map;this.deferCleanup=q_(3e4,()=>this.cleanup())}async hashBytes(e,t){return(await this.send({type:1,data:t,mode:e,id:this.idCounter++})).hash}async hashFile(e,t){return(await this.send({type:0,file:t,mode:e,id:this.idCounter++})).hash}async verifyBytes(e,t,n){return(await this.send({type:3,data:e,id:this.idCounter++,expected:t,checkNode:n})).matches}async verifyFile(e,t,n){return(await this.send({type:2,file:e,id:this.idCounter++,expected:t,checkNode:n})).matches}dispose(){this.cleanup(),this.deferCleanup.clear()}send(e){let t=this.getProcess();if(!t)throw new Error("hash.js process unexpectedly exited");this.deferCleanup();let n=ge();return this.deferredMap.set(e.id,{deferred:n,request:e}),t.postMessage(e),n.promise}cleanup(){this.instance&&(this.instance.removeAllListeners("exit"),this.instance.terminate(),this.instance=void 0,this.failureCount=0)}getProcess(){if(this.instance)return this.instance;if(this.failureCount>this.maxFailures)return;let e=this.instance=new $E.Worker(this.hasherScriptPath);return e.setMaxListeners(1/0),e.on("message",t=>{let n=t,i=this.deferredMap.get(n.id);i&&(i.deferred.resolve(n),this.deferredMap.delete(n.id))}),e.on("exit",()=>{this.instance=void 0,this.failureCount++;let t=this.getProcess();if(t){this.deferCleanup();for(let{request:n}of this.deferredMap.values())t.postMessage(n)}else{for(let{deferred:n}of this.deferredMap.values())n.reject(new Error("hash.js process unexpectedly exited"));this.deferredMap.clear(),this.deferCleanup.clear()}}),e}};var CE=new vd;async function TE(r,e,t){return!r||fE(r)?void 0:e?(typeof t=="string"?await CE.verifyBytes(t,e,!0):await CE.verifyFile(r,e,!0))?r:void 0:await new Qr(DE.promises).exists(r)?r:void 0}var en="node:",di="<node_internals>";var ME,da,gj,xu=class{constructor(){this._indexes={__proto__:null},this.array=[]}};ME=(r,e)=>r._indexes[e],da=(r,e)=>{let t=ME(r,e);if(t!==void 0)return t;let{array:n,_indexes:i}=r;return i[e]=n.push(e)-1},gj=r=>{let{array:e,_indexes:t}=r;if(e.length===0)return;let n=e.pop();t[n]=void 0};var RE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",OE=new Uint8Array(64),NE=new Uint8Array(128);for(let r=0;r<RE.length;r++){let e=RE.charCodeAt(r);OE[r]=e,NE[e]=r}var Wg=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(r){return Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString()}}:{decode(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e}};function BE(r){let e=new Int32Array(5),t=[],n=0;do{let i=yj(r,n),o=[],s=!0,a=0;e[0]=0;for(let c=n;c<i;c++){let u;c=Pu(r,c,e,0);let l=e[0];l<a&&(s=!1),a=l,kE(r,c,i)?(c=Pu(r,c,e,1),c=Pu(r,c,e,2),c=Pu(r,c,e,3),kE(r,c,i)?(c=Pu(r,c,e,4),u=[l,e[1],e[2],e[3],e[4]]):u=[l,e[1],e[2],e[3]]):u=[l],o.push(u)}s||bj(o),t.push(o),n=i+1}while(n<=r.length);return t}function yj(r,e){let t=r.indexOf(";",e);return t===-1?r.length:t}function Pu(r,e,t,n){let i=0,o=0,s=0;do{let c=r.charCodeAt(e++);s=NE[c],i|=(s&31)<<o,o+=5}while(s&32);let a=i&1;return i>>>=1,a&&(i=-2147483648|-i),t[n]+=i,e}function kE(r,e,t){return e>=t?!1:r.charCodeAt(e)!==44}function bj(r){r.sort(vj)}function vj(r,e){return r[0]-e[0]}function Id(r){let e=new Int32Array(5),t=1024*16,n=t-36,i=new Uint8Array(t),o=i.subarray(0,n),s=0,a="";for(let c=0;c<r.length;c++){let u=r[c];if(c>0&&(s===t&&(a+=Wg.decode(i),s=0),i[s++]=59),u.length!==0){e[0]=0;for(let l=0;l<u.length;l++){let p=u[l];s>n&&(a+=Wg.decode(o),i.copyWithin(0,n,s),s-=n),l>0&&(i[s++]=44),s=Lu(i,s,e,p,0),p.length!==1&&(s=Lu(i,s,e,p,1),s=Lu(i,s,e,p,2),s=Lu(i,s,e,p,3),p.length!==4&&(s=Lu(i,s,e,p,4)))}}}return a+Wg.decode(i.subarray(0,s))}function Lu(r,e,t,n,i){let o=n[i],s=o-t[i];t[i]=o,s=s<0?-s<<1|1:s<<1;do{let a=s&31;s>>>=5,s>0&&(a|=32),r[e++]=OE[a]}while(s>0);return e}var Ij=/^[\w+.-]+:\/\//,_j=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,Aj=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i,ze;(function(r){r[r.Empty=1]="Empty",r[r.Hash=2]="Hash",r[r.Query=3]="Query",r[r.RelativePath=4]="RelativePath",r[r.AbsolutePath=5]="AbsolutePath",r[r.SchemeRelative=6]="SchemeRelative",r[r.Absolute=7]="Absolute"})(ze||(ze={}));function wj(r){return Ij.test(r)}function Sj(r){return r.startsWith("//")}function WE(r){return r.startsWith("/")}function Ej(r){return r.startsWith("file:")}function FE(r){return/^[.?#]/.test(r)}function _d(r){let e=_j.exec(r);return jE(e[1],e[2]||"",e[3],e[4]||"",e[5]||"/",e[6]||"",e[7]||"")}function xj(r){let e=Aj.exec(r),t=e[2];return jE("file:","",e[1]||"","",WE(t)?t:"/"+t,e[3]||"",e[4]||"")}function jE(r,e,t,n,i,o,s){return{scheme:r,user:e,host:t,port:n,path:i,query:o,hash:s,type:ze.Absolute}}function UE(r){if(Sj(r)){let t=_d("http:"+r);return t.scheme="",t.type=ze.SchemeRelative,t}if(WE(r)){let t=_d("http://foo.com"+r);return t.scheme="",t.host="",t.type=ze.AbsolutePath,t}if(Ej(r))return xj(r);if(wj(r))return _d(r);let e=_d("http://foo.com/"+r);return e.scheme="",e.host="",e.type=r?r.startsWith("?")?ze.Query:r.startsWith("#")?ze.Hash:ze.RelativePath:ze.Empty,e}function Pj(r){if(r.endsWith("/.."))return r;let e=r.lastIndexOf("/");return r.slice(0,e+1)}function Lj(r,e){VE(e,e.type),r.path==="/"?r.path=e.path:r.path=Pj(e.path)+r.path}function VE(r,e){let t=e<=ze.RelativePath,n=r.path.split("/"),i=1,o=0,s=!1;for(let c=1;c<n.length;c++){let u=n[c];if(!u){s=!0;continue}if(s=!1,u!=="."){if(u===".."){o?(s=!0,o--,i--):t&&(n[i++]=u);continue}n[i++]=u,o++}}let a="";for(let c=1;c<i;c++)a+="/"+n[c];(!a||s&&!a.endsWith("/.."))&&(a+="/"),r.path=a}function qE(r,e){if(!r&&!e)return"";let t=UE(r),n=t.type;if(e&&n!==ze.Absolute){let o=UE(e),s=o.type;switch(n){case ze.Empty:t.hash=o.hash;case ze.Hash:t.query=o.query;case ze.Query:case ze.RelativePath:Lj(t,o);case ze.AbsolutePath:t.user=o.user,t.host=o.host,t.port=o.port;case ze.SchemeRelative:t.scheme=o.scheme}s>n&&(n=s)}VE(t,n);let i=t.query+t.hash;switch(n){case ze.Hash:case ze.Query:return i;case ze.RelativePath:{let o=t.path.slice(1);return o?FE(e||r)&&!FE(o)?"./"+o+i:o+i:i||"."}case ze.AbsolutePath:return t.path+i;default:return t.scheme+"//"+t.user+t.host+t.port+t.path+i}}function GE(r,e){return e&&!e.endsWith("/")&&(e+="/"),qE(r,e)}function $j(r){if(!r)return"";let e=r.lastIndexOf("/");return r.slice(0,e+1)}var rn=0,qg=1,Gg=2,Kg=3,YE=4,QE=1,ZE=2;function Cj(r,e){let t=KE(r,0);if(t===r.length)return r;e||(r=r.slice());for(let n=t;n<r.length;n=KE(r,n+1))r[n]=Tj(r[n],e);return r}function KE(r,e){for(let t=e;t<r.length;t++)if(!Dj(r[t]))return t;return r.length}function Dj(r){for(let e=1;e<r.length;e++)if(r[e][rn]<r[e-1][rn])return!1;return!0}function Tj(r,e){return e||(r=r.slice()),r.sort(Mj)}function Mj(r,e){return r[rn]-e[rn]}var jo=!1;function Rj(r,e,t,n){for(;t<=n;){let i=t+(n-t>>1),o=r[i][rn]-e;if(o===0)return jo=!0,i;o<0?t=i+1:n=i-1}return jo=!1,t-1}function Xg(r,e,t){for(let n=t+1;n<r.length&&r[n][rn]===e;t=n++);return t}function e0(r,e,t){for(let n=t-1;n>=0&&r[n][rn]===e;t=n--);return t}function t0(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function r0(r,e,t,n){let{lastKey:i,lastNeedle:o,lastIndex:s}=t,a=0,c=r.length-1;if(n===i){if(e===o)return jo=s!==-1&&r[s][rn]===e,s;e>=o?a=s===-1?0:s:c=s}return t.lastKey=n,t.lastNeedle=e,t.lastIndex=Rj(r,e,a,c)}function kj(r,e){let t=e.map(Nj);for(let n=0;n<r.length;n++){let i=r[n];for(let o=0;o<i.length;o++){let s=i[o];if(s.length===1)continue;let a=s[qg],c=s[Gg],u=s[Kg],l=t[a],p=l[c]||(l[c]=[]),d=e[a],f=Xg(p,u,r0(p,u,d,c));Oj(p,d.lastIndex=f+1,[u,n,s[rn]])}}return t}function Oj(r,e,t){for(let n=r.length;n>e;n--)r[n]=r[n-1];r[e]=t}function Nj(){return{__proto__:null}}var Sd=function(r,e){let t=typeof r=="string"?JSON.parse(r):r;if(!("sections"in t))return new Vo(t,e);let n=[],i=[],o=[],s=[];n0(t,e,n,i,o,s,0,0,1/0,1/0);let a={version:3,file:t.file,names:s,sources:i,sourcesContent:o,mappings:n};return i0(a)};function n0(r,e,t,n,i,o,s,a,c,u){let{sections:l}=r;for(let p=0;p<l.length;p++){let{map:d,offset:f}=l[p],h=c,m=u;if(p+1<l.length){let y=l[p+1].offset;h=Math.min(c,s+y.line),h===c?m=Math.min(u,a+y.column):h<c&&(m=a+y.column)}Bj(d,e,t,n,i,o,s+f.line,a+f.column,h,m)}}function Bj(r,e,t,n,i,o,s,a,c,u){if("sections"in r)return n0(...arguments);let l=new Vo(r,e),p=n.length,d=o.length,f=tn(l),{resolvedSources:h,sourcesContent:m}=l;if(jg(n,h),jg(o,l.names),m)jg(i,m);else for(let y=0;y<h.length;y++)i.push(null);for(let y=0;y<f.length;y++){let w=s+y;if(w>c)return;let D=Fj(t,w),j=y===0?a:0,X=f[y];for(let B=0;B<X.length;B++){let Z=X[B],O=j+Z[rn];if(w===c&&O>=u)return;if(Z.length===1){D.push([O]);continue}let G=p+Z[qg],re=Z[Gg],xe=Z[Kg];D.push(Z.length===4?[O,G,re,xe]:[O,G,re,xe,d+Z[YE]])}}}function jg(r,e){for(let t=0;t<e.length;t++)r.push(e[t])}function Fj(r,e){for(let t=r.length;t<=e;t++)r[t]=[];return r[e]}var XE="`line` must be greater than 0 (lines start at line 1)",zE="`column` must be greater than or equal to 0 (columns start at column 0)",fa=-1,Dn=1,JE,tn,Uj,zg,Jg,Yg,Qg,Wj,i0,jj,Vj,Vo=class{constructor(e,t){let n=typeof e=="string";if(!n&&e._decodedMemo)return e;let i=n?JSON.parse(e):e,{version:o,file:s,names:a,sourceRoot:c,sources:u,sourcesContent:l}=i;this.version=o,this.file=s,this.names=a||[],this.sourceRoot=c,this.sources=u,this.sourcesContent=l;let p=GE(c||"",$j(t));this.resolvedSources=u.map(f=>GE(f||"",p));let{mappings:d}=i;typeof d=="string"?(this._encoded=d,this._decoded=void 0):(this._encoded=void 0,this._decoded=Cj(d,n)),this._decodedMemo=t0(),this._bySources=void 0,this._bySourceMemos=void 0}};(()=>{JE=e=>{var t;return(t=e._encoded)!==null&&t!==void 0?t:e._encoded=Id(e._decoded)},tn=e=>e._decoded||(e._decoded=BE(e._encoded)),Uj=(e,t,n)=>{let i=tn(e);if(t>=i.length)return null;let o=i[t],s=wd(o,e._decodedMemo,t,n,Dn);return s===-1?null:o[s]},zg=(e,{line:t,column:n,bias:i})=>{if(t--,t<0)throw new Error(XE);if(n<0)throw new Error(zE);let o=tn(e);if(t>=o.length)return Ad(null,null,null,null);let s=o[t],a=wd(s,e._decodedMemo,t,n,i||Dn);if(a===-1)return Ad(null,null,null,null);let c=s[a];if(c.length===1)return Ad(null,null,null,null);let{names:u,resolvedSources:l}=e;return Ad(l[c[qg]],c[Gg]+1,c[Kg],c.length===5?u[c[YE]]:null)},Yg=(e,{source:t,line:n,column:i,bias:o})=>r(e,t,n,i,o||fa,!0),Jg=(e,{source:t,line:n,column:i,bias:o})=>r(e,t,n,i,o||Dn,!1),Qg=(e,t)=>{let n=tn(e),{names:i,resolvedSources:o}=e;for(let s=0;s<n.length;s++){let a=n[s];for(let c=0;c<a.length;c++){let u=a[c],l=s+1,p=u[0],d=null,f=null,h=null,m=null;u.length!==1&&(d=o[u[1]],f=u[2]+1,h=u[3]),u.length===5&&(m=i[u[4]]),t({generatedLine:l,generatedColumn:p,source:d,originalLine:f,originalColumn:h,name:m})}}},Wj=(e,t)=>{let{sources:n,resolvedSources:i,sourcesContent:o}=e;if(o==null)return null;let s=n.indexOf(t);return s===-1&&(s=i.indexOf(t)),s===-1?null:o[s]},i0=(e,t)=>{let n=new Vo(Vg(e,[]),t);return n._decoded=e.mappings,n},jj=e=>Vg(e,tn(e)),Vj=e=>Vg(e,JE(e));function r(e,t,n,i,o,s){if(n--,n<0)throw new Error(XE);if(i<0)throw new Error(zE);let{sources:a,resolvedSources:c}=e,u=a.indexOf(t);if(u===-1&&(u=c.indexOf(t)),u===-1)return s?[]:$u(null,null);let p=(e._bySources||(e._bySources=kj(tn(e),e._bySourceMemos=a.map(t0))))[u][n];if(p==null)return s?[]:$u(null,null);let d=e._bySourceMemos[u];if(s)return qj(p,d,n,i,o);let f=wd(p,d,n,i,o);if(f===-1)return $u(null,null);let h=p[f];return $u(h[QE]+1,h[ZE])}})();function Vg(r,e){return{version:r.version,file:r.file,names:r.names,sourceRoot:r.sourceRoot,sources:r.sources,sourcesContent:r.sourcesContent,mappings:e}}function Ad(r,e,t,n){return{source:r,line:e,column:t,name:n}}function $u(r,e){return{line:r,column:e}}function wd(r,e,t,n,i){let o=r0(r,n,e,t);return jo?o=(i===fa?Xg:e0)(r,n,o):i===fa&&o++,o===-1||o===r.length?-1:o}function qj(r,e,t,n,i){let o=wd(r,e,t,n,Dn);if(!jo&&i===fa&&o++,o===-1||o===r.length)return[];let s=jo?n:r[o][rn];jo||(o=e0(r,s,o));let a=Xg(r,s,o),c=[];for(;o<=a;o++){let u=r[o];c.push($u(u[QE]+1,u[ZE]))}return c}var c0=0,u0=1,l0=2,p0=3,d0=4,f0=-1,Zg,Gj,Kj,Xj,ey,Ed,zj,Jj,Yj,Cu,Du=class{constructor({file:e,sourceRoot:t}={}){this._names=new xu,this._sources=new xu,this._sourcesContent=[],this._mappings=[],this.file=e,this.sourceRoot=t}};Zg=(r,e,t,n,i,o,s,a)=>Cu(!1,r,e,t,n,i,o,s,a),Kj=(r,e,t,n,i,o,s,a)=>Cu(!0,r,e,t,n,i,o,s,a),Gj=(r,e)=>a0(!1,r,e),Xj=(r,e)=>a0(!0,r,e),ey=(r,e,t)=>{let{_sources:n,_sourcesContent:i}=r;i[da(n,e)]=t},Ed=r=>{let{file:e,sourceRoot:t,_mappings:n,_sources:i,_sourcesContent:o,_names:s}=r;return eV(n),{version:3,file:e||void 0,names:s.array,sourceRoot:t||void 0,sources:i.array,sourcesContent:o,mappings:n}},zj=r=>{let e=Ed(r);return Object.assign(Object.assign({},e),{mappings:Id(e.mappings)})},Yj=r=>{let e=[],{_mappings:t,_sources:n,_names:i}=r;for(let o=0;o<t.length;o++){let s=t[o];for(let a=0;a<s.length;a++){let c=s[a],u={line:o+1,column:c[c0]},l,p,d;c.length!==1&&(l=n.array[c[u0]],p={line:c[l0]+1,column:c[p0]},c.length===5&&(d=i.array[c[d0]])),e.push({generated:u,source:l,original:p,name:d})}}return e},Jj=r=>{let e=new Vo(r),t=new Du({file:e.file,sourceRoot:e.sourceRoot});return s0(t._names,e.names),s0(t._sources,e.sources),t._sourcesContent=e.sourcesContent||e.sources.map(()=>null),t._mappings=tn(e),t},Cu=(r,e,t,n,i,o,s,a,c)=>{let{_mappings:u,_sources:l,_sourcesContent:p,_names:d}=e,f=Qj(u,t),h=Zj(f,n);if(!i)return r&&tV(f,h)?void 0:o0(f,h,[n]);let m=da(l,i),y=a?da(d,a):f0;if(m===p.length&&(p[m]=c??null),!(r&&rV(f,h,m,o,s,y)))return o0(f,h,a?[n,m,o,s,y]:[n,m,o,s])};function Qj(r,e){for(let t=r.length;t<=e;t++)r[t]=[];return r[e]}function Zj(r,e){let t=r.length;for(let n=t-1;n>=0;t=n--){let i=r[n];if(e>=i[c0])break}return t}function o0(r,e,t){for(let n=r.length;n>e;n--)r[n]=r[n-1];r[e]=t}function eV(r){let{length:e}=r,t=e;for(let n=t-1;n>=0&&!(r[n].length>0);t=n,n--);t<e&&(r.length=t)}function s0(r,e){for(let t=0;t<e.length;t++)da(r,e[t])}function tV(r,e){return e===0?!0:r[e-1].length===1}function rV(r,e,t,n,i,o){if(e===0)return!1;let s=r[e-1];return s.length===1?!1:t===s[u0]&&n===s[l0]&&i===s[p0]&&o===(s.length===5?s[d0]:f0)}function a0(r,e,t){let{generated:n,source:i,original:o,name:s,content:a}=t;if(!i)return Cu(r,e,n.line-1,n.column,null,null,null,null,null);let c=i;return Cu(r,e,n.line-1,n.column,c,o.line-1,o.column,s,a)}var Vd=H("./vendor/acorn.js");var{stringify:iV}=JSON;if(!String.prototype.repeat)throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");if(!String.prototype.endsWith)throw new Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation");var xd={"||":2,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},nn=17,oV={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:nn,ClassExpression:nn,FunctionExpression:nn,ObjectExpression:nn,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function ha(r,e){let{generator:t}=r;if(r.write("("),e!=null&&e.length>0){t[e[0].type](e[0],r);let{length:n}=e;for(let i=1;i<n;i++){let o=e[i];r.write(", "),t[o.type](o,r)}}r.write(")")}function v0(r,e,t,n){let i=r.expressionsPrecedence[e.type];if(i===nn)return!0;let o=r.expressionsPrecedence[t.type];return i!==o?!n&&i===15&&o===14&&t.operator==="**"||i<o:i!==13&&i!==14?!1:e.operator==="**"&&t.operator==="**"?!n:i===13&&o===13&&(e.operator==="??"||t.operator==="??")?!0:n?xd[e.operator]<=xd[t.operator]:xd[e.operator]<xd[t.operator]}function Pd(r,e,t,n){let{generator:i}=r;v0(r,e,t,n)?(r.write("("),i[e.type](e,r),r.write(")")):i[e.type](e,r)}function sV(r,e,t,n){let i=e.split(`
`),o=i.length-1;if(r.write(i[0].trim()),o>0){r.write(n);for(let s=1;s<o;s++)r.write(t+i[s].trim()+n);r.write(t+i[o].trim())}}function Ft(r,e,t,n){let{length:i}=e;for(let o=0;o<i;o++){let s=e[o];r.write(t),s.type[0]==="L"?r.write("// "+s.value.trim()+`
`,s):(r.write("/*"),sV(r,s.value,t,n),r.write("*/"+n))}}function aV(r){let e=r;for(;e!=null;){let{type:t}=e;if(t[0]==="C"&&t[1]==="a")return!0;if(t[0]==="M"&&t[1]==="e"&&t[2]==="m")e=e.object;else return!1}}function ty(r,e){let{generator:t}=r,{declarations:n}=e;r.write(e.kind+" ");let{length:i}=n;if(i>0){t.VariableDeclarator(n[0],r);for(let o=1;o<i;o++)r.write(", "),t.VariableDeclarator(n[o],r)}}var h0,m0,H0,g0,y0,b0,cV={Program(r,e){let t=e.indent.repeat(e.indentLevel),{lineEnd:n,writeComments:i}=e;i&&r.comments!=null&&Ft(e,r.comments,t,n);let o=r.body,{length:s}=o;for(let a=0;a<s;a++){let c=o[a];i&&c.comments!=null&&Ft(e,c.comments,t,n),e.write(t),this[c.type](c,e),e.write(n)}i&&r.trailingComments!=null&&Ft(e,r.trailingComments,t,n)},BlockStatement:b0=function(r,e){let t=e.indent.repeat(e.indentLevel++),{lineEnd:n,writeComments:i}=e,o=t+e.indent;e.write("{");let s=r.body;if(s!=null&&s.length>0){e.write(n),i&&r.comments!=null&&Ft(e,r.comments,o,n);let{length:a}=s;for(let c=0;c<a;c++){let u=s[c];i&&u.comments!=null&&Ft(e,u.comments,o,n),e.write(o),this[u.type](u,e),e.write(n)}e.write(t)}else i&&r.comments!=null&&(e.write(n),Ft(e,r.comments,o,n),e.write(t));i&&r.trailingComments!=null&&Ft(e,r.trailingComments,o,n),e.write("}"),e.indentLevel--},ClassBody:b0,StaticBlock(r,e){e.write("static "),this.BlockStatement(r,e)},EmptyStatement(r,e){e.write(";")},ExpressionStatement(r,e){let t=e.expressionsPrecedence[r.expression.type];t===nn||t===3&&r.expression.left.type[0]==="O"?(e.write("("),this[r.expression.type](r.expression,e),e.write(")")):this[r.expression.type](r.expression,e),e.write(";")},IfStatement(r,e){e.write("if ("),this[r.test.type](r.test,e),e.write(") "),this[r.consequent.type](r.consequent,e),r.alternate!=null&&(e.write(" else "),this[r.alternate.type](r.alternate,e))},LabeledStatement(r,e){this[r.label.type](r.label,e),e.write(": "),this[r.body.type](r.body,e)},BreakStatement(r,e){e.write("break"),r.label!=null&&(e.write(" "),this[r.label.type](r.label,e)),e.write(";")},ContinueStatement(r,e){e.write("continue"),r.label!=null&&(e.write(" "),this[r.label.type](r.label,e)),e.write(";")},WithStatement(r,e){e.write("with ("),this[r.object.type](r.object,e),e.write(") "),this[r.body.type](r.body,e)},SwitchStatement(r,e){let t=e.indent.repeat(e.indentLevel++),{lineEnd:n,writeComments:i}=e;e.indentLevel++;let o=t+e.indent,s=o+e.indent;e.write("switch ("),this[r.discriminant.type](r.discriminant,e),e.write(") {"+n);let{cases:a}=r,{length:c}=a;for(let u=0;u<c;u++){let l=a[u];i&&l.comments!=null&&Ft(e,l.comments,o,n),l.test?(e.write(o+"case "),this[l.test.type](l.test,e),e.write(":"+n)):e.write(o+"default:"+n);let{consequent:p}=l,{length:d}=p;for(let f=0;f<d;f++){let h=p[f];i&&h.comments!=null&&Ft(e,h.comments,s,n),e.write(s),this[h.type](h,e),e.write(n)}}e.indentLevel-=2,e.write(t+"}")},ReturnStatement(r,e){e.write("return"),r.argument&&(e.write(" "),this[r.argument.type](r.argument,e)),e.write(";")},ThrowStatement(r,e){e.write("throw "),this[r.argument.type](r.argument,e),e.write(";")},TryStatement(r,e){if(e.write("try "),this[r.block.type](r.block,e),r.handler){let{handler:t}=r;t.param==null?e.write(" catch "):(e.write(" catch ("),this[t.param.type](t.param,e),e.write(") ")),this[t.body.type](t.body,e)}r.finalizer&&(e.write(" finally "),this[r.finalizer.type](r.finalizer,e))},WhileStatement(r,e){e.write("while ("),this[r.test.type](r.test,e),e.write(") "),this[r.body.type](r.body,e)},DoWhileStatement(r,e){e.write("do "),this[r.body.type](r.body,e),e.write(" while ("),this[r.test.type](r.test,e),e.write(");")},ForStatement(r,e){if(e.write("for ("),r.init!=null){let{init:t}=r;t.type[0]==="V"?ty(e,t):this[t.type](t,e)}e.write("; "),r.test&&this[r.test.type](r.test,e),e.write("; "),r.update&&this[r.update.type](r.update,e),e.write(") "),this[r.body.type](r.body,e)},ForInStatement:h0=function(r,e){e.write(`for ${r.await?"await ":""}(`);let{left:t}=r;t.type[0]==="V"?ty(e,t):this[t.type](t,e),e.write(r.type[3]==="I"?" in ":" of "),this[r.right.type](r.right,e),e.write(") "),this[r.body.type](r.body,e)},ForOfStatement:h0,DebuggerStatement(r,e){e.write("debugger;",r)},FunctionDeclaration:m0=function(r,e){e.write((r.async?"async ":"")+(r.generator?"function* ":"function ")+(r.id?r.id.name:""),r),ha(e,r.params),e.write(" "),this[r.body.type](r.body,e)},FunctionExpression:m0,VariableDeclaration(r,e){ty(e,r),e.write(";")},VariableDeclarator(r,e){this[r.id.type](r.id,e),r.init!=null&&(e.write(" = "),this[r.init.type](r.init,e))},ClassDeclaration(r,e){if(e.write("class "+(r.id?`${r.id.name} `:""),r),r.superClass){e.write("extends ");let{superClass:t}=r,{type:n}=t,i=e.expressionsPrecedence[n];(n[0]!=="C"||n[1]!=="l"||n[5]!=="E")&&(i===nn||i<e.expressionsPrecedence.ClassExpression)?(e.write("("),this[r.superClass.type](t,e),e.write(")")):this[t.type](t,e),e.write(" ")}this.ClassBody(r.body,e)},ImportDeclaration(r,e){e.write("import ");let{specifiers:t}=r,{length:n}=t,i=0;if(n>0){for(;i<n;){i>0&&e.write(", ");let o=t[i],s=o.type[6];if(s==="D")e.write(o.local.name,o),i++;else if(s==="N")e.write("* as "+o.local.name,o),i++;else break}if(i<n){for(e.write("{");;){let o=t[i],{name:s}=o.imported;if(e.write(s,o),s!==o.local.name&&e.write(" as "+o.local.name),++i<n)e.write(", ");else break}e.write("}")}e.write(" from ")}this.Literal(r.source,e),e.write(";")},ImportExpression(r,e){e.write("import("),this[r.source.type](r.source,e),e.write(")")},ExportDefaultDeclaration(r,e){e.write("export default "),this[r.declaration.type](r.declaration,e),e.expressionsPrecedence[r.declaration.type]!=null&&r.declaration.type[0]!=="F"&&e.write(";")},ExportNamedDeclaration(r,e){if(e.write("export "),r.declaration)this[r.declaration.type](r.declaration,e);else{e.write("{");let{specifiers:t}=r,{length:n}=t;if(n>0)for(let i=0;;){let o=t[i],{name:s}=o.local;if(e.write(s,o),s!==o.exported.name&&e.write(" as "+o.exported.name),++i<n)e.write(", ");else break}e.write("}"),r.source&&(e.write(" from "),this.Literal(r.source,e)),e.write(";")}},ExportAllDeclaration(r,e){r.exported!=null?e.write("export * as "+r.exported.name+" from "):e.write("export * from "),this.Literal(r.source,e),e.write(";")},MethodDefinition(r,e){r.static&&e.write("static ");let t=r.kind[0];(t==="g"||t==="s")&&e.write(r.kind+" "),r.value.async&&e.write("async "),r.value.generator&&e.write("*"),r.computed?(e.write("["),this[r.key.type](r.key,e),e.write("]")):this[r.key.type](r.key,e),ha(e,r.value.params),e.write(" "),this[r.value.body.type](r.value.body,e)},ClassExpression(r,e){this.ClassDeclaration(r,e)},ArrowFunctionExpression(r,e){e.write(r.async?"async ":"",r);let{params:t}=r;t!=null&&(t.length===1&&t[0].type[0]==="I"?e.write(t[0].name,t[0]):ha(e,r.params)),e.write(" => "),r.body.type[0]==="O"?(e.write("("),this.ObjectExpression(r.body,e),e.write(")")):this[r.body.type](r.body,e)},ThisExpression(r,e){e.write("this",r)},Super(r,e){e.write("super",r)},RestElement:H0=function(r,e){e.write("..."),this[r.argument.type](r.argument,e)},SpreadElement:H0,YieldExpression(r,e){e.write(r.delegate?"yield*":"yield"),r.argument&&(e.write(" "),this[r.argument.type](r.argument,e))},AwaitExpression(r,e){e.write("await ",r),Pd(e,r.argument,r)},TemplateLiteral(r,e){let{quasis:t,expressions:n}=r;e.write("`");let{length:i}=n;for(let s=0;s<i;s++){let a=n[s],c=t[s];e.write(c.value.raw,c),e.write("${"),this[a.type](a,e),e.write("}")}let o=t[t.length-1];e.write(o.value.raw,o),e.write("`")},TemplateElement(r,e){e.write(r.value.raw,r)},TaggedTemplateExpression(r,e){Pd(e,r.tag,r),this[r.quasi.type](r.quasi,e)},ArrayExpression:y0=function(r,e){if(e.write("["),r.elements.length>0){let{elements:t}=r,{length:n}=t;for(let i=0;;){let o=t[i];if(o!=null&&this[o.type](o,e),++i<n)e.write(", ");else{o==null&&e.write(", ");break}}}e.write("]")},ArrayPattern:y0,ObjectExpression(r,e){let t=e.indent.repeat(e.indentLevel++),{lineEnd:n,writeComments:i}=e,o=t+e.indent;if(e.write("{"),r.properties.length>0){e.write(n),i&&r.comments!=null&&Ft(e,r.comments,o,n);let s=","+n,{properties:a}=r,{length:c}=a;for(let u=0;;){let l=a[u];if(i&&l.comments!=null&&Ft(e,l.comments,o,n),e.write(o),this[l.type](l,e),++u<c)e.write(s);else break}e.write(n),i&&r.trailingComments!=null&&Ft(e,r.trailingComments,o,n),e.write(t+"}")}else i?r.comments!=null?(e.write(n),Ft(e,r.comments,o,n),r.trailingComments!=null&&Ft(e,r.trailingComments,o,n),e.write(t+"}")):r.trailingComments!=null?(e.write(n),Ft(e,r.trailingComments,o,n),e.write(t+"}")):e.write("}"):e.write("}");e.indentLevel--},Property(r,e){r.method||r.kind[0]!=="i"?this.MethodDefinition(r,e):(r.shorthand||(r.computed?(e.write("["),this[r.key.type](r.key,e),e.write("]")):this[r.key.type](r.key,e),e.write(": ")),this[r.value.type](r.value,e))},PropertyDefinition(r,e){if(r.static&&e.write("static "),r.computed&&e.write("["),this[r.key.type](r.key,e),r.computed&&e.write("]"),r.value==null){r.key.type[0]!=="F"&&e.write(";");return}e.write(" = "),this[r.value.type](r.value,e),e.write(";")},ObjectPattern(r,e){if(e.write("{"),r.properties.length>0){let{properties:t}=r,{length:n}=t;for(let i=0;this[t[i].type](t[i],e),++i<n;)e.write(", ")}e.write("}")},SequenceExpression(r,e){ha(e,r.expressions)},UnaryExpression(r,e){if(r.prefix){let{operator:t,argument:n,argument:{type:i}}=r;e.write(t);let o=v0(e,n,r);!o&&(t.length>1||i[0]==="U"&&(i[1]==="n"||i[1]==="p")&&n.prefix&&n.operator[0]===t&&(t==="+"||t==="-"))&&e.write(" "),o?(e.write(t.length>1?" (":"("),this[i](n,e),e.write(")")):this[i](n,e)}else this[r.argument.type](r.argument,e),e.write(r.operator)},UpdateExpression(r,e){r.prefix?(e.write(r.operator),this[r.argument.type](r.argument,e)):(this[r.argument.type](r.argument,e),e.write(r.operator))},AssignmentExpression(r,e){this[r.left.type](r.left,e),e.write(" "+r.operator+" "),this[r.right.type](r.right,e)},AssignmentPattern(r,e){this[r.left.type](r.left,e),e.write(" = "),this[r.right.type](r.right,e)},BinaryExpression:g0=function(r,e){let t=r.operator==="in";t&&e.write("("),Pd(e,r.left,r,!1),e.write(" "+r.operator+" "),Pd(e,r.right,r,!0),t&&e.write(")")},LogicalExpression:g0,ConditionalExpression(r,e){let{test:t}=r,n=e.expressionsPrecedence[t.type];n===nn||n<=e.expressionsPrecedence.ConditionalExpression?(e.write("("),this[t.type](t,e),e.write(")")):this[t.type](t,e),e.write(" ? "),this[r.consequent.type](r.consequent,e),e.write(" : "),this[r.alternate.type](r.alternate,e)},NewExpression(r,e){e.write("new ");let t=e.expressionsPrecedence[r.callee.type];t===nn||t<e.expressionsPrecedence.CallExpression||aV(r.callee)?(e.write("("),this[r.callee.type](r.callee,e),e.write(")")):this[r.callee.type](r.callee,e),ha(e,r.arguments)},CallExpression(r,e){let t=e.expressionsPrecedence[r.callee.type];t===nn||t<e.expressionsPrecedence.CallExpression?(e.write("("),this[r.callee.type](r.callee,e),e.write(")")):this[r.callee.type](r.callee,e),r.optional&&e.write("?."),ha(e,r.arguments)},ChainExpression(r,e){this[r.expression.type](r.expression,e)},MemberExpression(r,e){let t=e.expressionsPrecedence[r.object.type];t===nn||t<e.expressionsPrecedence.MemberExpression?(e.write("("),this[r.object.type](r.object,e),e.write(")")):this[r.object.type](r.object,e),r.computed?(r.optional&&e.write("?."),e.write("["),this[r.property.type](r.property,e),e.write("]")):(r.optional?e.write("?."):e.write("."),this[r.property.type](r.property,e))},MetaProperty(r,e){e.write(r.meta.name+"."+r.property.name,r)},Identifier(r,e){e.write(r.name,r)},PrivateIdentifier(r,e){e.write(`#${r.name}`,r)},Literal(r,e){r.raw!=null?e.write(r.raw,r):r.regex!=null?this.RegExpLiteral(r,e):r.bigint!=null?e.write(r.bigint+"n",r):e.write(iV(r.value),r)},RegExpLiteral(r,e){let{regex:t}=r;e.write(`/${t.pattern}/${t.flags}`,r)}},uV={};var ry=class{constructor(e){let t=e??uV;this.output="",t.output!=null?(this.output=t.output,this.write=this.writeToStream):this.output="",this.generator=t.generator!=null?t.generator:cV,this.expressionsPrecedence=t.expressionsPrecedence!=null?t.expressionsPrecedence:oV,this.indent=t.indent!=null?t.indent:" ",this.lineEnd=t.lineEnd!=null?t.lineEnd:`
`,this.indentLevel=t.startingIndentLevel!=null?t.startingIndentLevel:0,this.writeComments=t.comments?t.comments:!1,t.sourceMap!=null&&(this.write=t.output==null?this.writeAndMap:this.writeToStreamAndMap,this.sourceMap=t.sourceMap,this.line=1,this.column=0,this.lineEndSize=this.lineEnd.split(`
`).length-1,this.mapping={original:null,generated:this,name:void 0,source:t.sourceMap.file||t.sourceMap._file})}write(e){this.output+=e}writeToStream(e){this.output.write(e)}writeAndMap(e,t){this.output+=e,this.map(e,t)}writeToStreamAndMap(e,t){this.output.write(e),this.map(e,t)}map(e,t){if(t!=null){let{type:o}=t;if(o[0]==="L"&&o[2]==="n"){this.column=0,this.line++;return}if(t.loc!=null){let{mapping:s}=this;s.original=t.loc.start,s.name=t.name,this.sourceMap.addMapping(s)}if(o[0]==="T"&&o[8]==="E"||o[0]==="L"&&o[1]==="i"&&typeof t.value=="string"){let{length:s}=e,{column:a,line:c}=this;for(let u=0;u<s;u++)e[u]===`
`?(a=0,c++):a++;this.column=a,this.line=c;return}}let{length:n}=e,{lineEnd:i}=this;n>0&&(this.lineEndSize>0&&(i.length===1?e[n-1]===i:e.endsWith(i))?(this.line+=this.lineEndSize,this.column=0):this.column+=n)}toString(){return this.output}};function fi(r,e){let t=new ry(e);return t.generator[r.type](r,t),t.output}var I0=H("./vendor/acorn.js"),Cd=H("./vendor/acorn-loose.js");var Ld={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ExportAllDeclaration:["exported","source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportExpression:["source"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXClosingFragment:[],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXFragment:["openingFragment","children","closingFragment"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXOpeningFragment:[],JSXSpreadAttribute:["argument"],JSXSpreadChild:["expression"],JSXText:[],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],StaticBlock:["body"],Super:[],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},lV=Object.keys(Ld);for(let r of lV)Object.freeze(Ld[r]);Object.freeze(Ld);var ny=Ld;var iy={ecmaVersion:"latest",locations:!0,allowAwaitOutsideFunction:!0,allowImportExportEverywhere:!0,allowReserved:!0,allowReturnOutsideFunction:!0},Fi=r=>r.start,oy=r=>r.end,_0=(r,e)=>r.slice(Fi(e),oy(e)),Tn=(r,e=!1)=>(e?I0.parse:Cd.parse)(r,iy),Tu=r=>{let e=Tn(r);for(let t of e.body)t.type==="FunctionDeclaration"&&t.id&&(0,Cd.isDummy)(t.id)&&(t.id=null);return e.body};function A0(r,e,t){return e.length>1||e[0].type!=="FunctionDeclaration"?E0(r,e,!0,t):w0(r,[{type:"ReturnStatement",argument:{type:"CallExpression",optional:!1,arguments:[{type:"ThisExpression"},...r.map(n=>({type:"Identifier",name:n}))],callee:{type:"MemberExpression",property:{type:"Identifier",name:"call"},computed:!1,optional:!1,object:{type:"FunctionExpression",params:e[0].params,body:e[0].body}}}}],!0,t)}var w0=(r,e,t,n)=>{let i={type:"Identifier",name:"e"},s=n?[{type:"TryStatement",block:{type:"BlockStatement",body:e},handler:{type:"CatchClause",param:i,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"LogicalExpression",left:{type:"LogicalExpression",left:{type:"MemberExpression",object:i,property:{type:"Identifier",name:"stack"},computed:!1,optional:!1},operator:"||",right:{type:"MemberExpression",object:i,property:{type:"Identifier",name:"message"},computed:!1,optional:!1}},operator:"||",right:{type:"CallExpression",callee:{type:"Identifier",name:"String"},arguments:[i],optional:!1}}}]}}}]:e;return t?{type:"FunctionExpression",id:{type:"Identifier",name:"_generatedCode"},params:r.map(a=>({type:"Identifier",name:a})),body:{type:"BlockStatement",body:s}}:{type:"ArrowFunctionExpression",params:r.map(a=>({type:"Identifier",name:a})),expression:!1,body:{type:"BlockStatement",body:s}}},dV=(r,e)=>({type:"CallExpression",arguments:r.map(t=>({type:"Identifier",name:t})),callee:e,optional:!1}),S0=(r,e,t)=>dV(r,E0(r,e,t,!0));function E0(r,e,t,n){let i=e[e.length-1];if(i.type!=="ReturnStatement"){let o=fV(i);o&&(e=[...e.slice(0,-1),{type:"ReturnStatement",argument:o}])}return w0(r,e,t,n)}function fV(r){switch(r.type){case"ExpressionStatement":return r.expression;case"BlockStatement":return{type:"CallExpression",arguments:[],callee:{type:"ArrowFunctionExpression",params:[],expression:!1,body:r},optional:!1};case"ReturnStatement":return r.argument||void 0;default:return}}var Ui=(r,e)=>{$d(r,e)},Dd=(r,e)=>{let t=$d(r,e);return t&&typeof t=="object"?t.replace:r},$d=(r,e,t)=>{if(!r)return;let n=e.enter(r,t);if(n===0)return 0;if(n&&typeof n=="object")return n;if(n===1)return;let i=ny[r.type];if(i)for(let o of i){let s=r[o];if(s instanceof Array)for(let[a,c]of s.entries()){let u=$d(c,e,r);if(u===0)return 0;u&&typeof u=="object"&&(s[a]=u.replace)}else if(s){let a=$d(s,e,r);if(a===0)return 0;a&&typeof a=="object"&&(r[o]=a.replace)}}e.leave?.(r)};var N0=H("dns"),sr=_(H("path")),kn=H("url");var $0=H("url");var C=class{constructor(){this._listeners=new Set;this.event=(e,t,n)=>{let i={listener:e,thisArg:t};this._listeners.add(i);let o={dispose:()=>{o.dispose=()=>{},this._listeners.delete(i)}};return n&&n.push(o),o}}get size(){return this._listeners.size}fire(e){let t=!this._deliveryQueue;this._deliveryQueue||(this._deliveryQueue=[]);for(let n of this._listeners)this._deliveryQueue.push({data:n,event:e});if(t){for(let n=0;n<this._deliveryQueue.length;n++){let{data:i,event:o}=this._deliveryQueue[n];i.listener.call(i.thisArg,o)}this._deliveryQueue=void 0}}dispose(){this._listeners.clear(),this._deliveryQueue&&(this._deliveryQueue=[])}},Mu=class{constructor(){this.map=new Map;this.listeners=this.map}listen(e,t){let n=this.map.get(e);n||(n=new C,this.map.set(e,n));let i=n.event(t);return{dispose:ne(()=>{i.dispose(),n?.size===0&&this.map.delete(e)})}}emit(e,t){this.listeners.get(e)?.fire(t)}};var x0=H("./vendor/acorn.js"),P0=H("crypto");var Ne=(r=sy())=>`
//# sourceURL=${r}
`,sy=()=>`eval-${(0,P0.randomBytes)(4).toString("hex")}.cdp`;function hi(r,e){return hV(""+r,e)}function hV(r,e){let t=(0,x0.parseExpressionAt)(r,0,{ecmaVersion:"latest",locations:!0});if(t.type!=="FunctionExpression")throw new Error(`Could not find function declaration for:
${r}`);let n=t.params.map(a=>{if(a.type!=="Identifier")throw new Error("Parameter must be identifier");return a.name}),{start:i,end:o}=t.body,s=a=>`
${a.map((c,u)=>`let ${n[u]} = ${c}`).join("; ")};
${r.slice(i+1,o-1)}
`;return{expr:(...a)=>`(()=>{${s(a)}})();
${Ne(e)}`,decl:(...a)=>`function(...runtimeArgs){${s(a)};
${Ne(e)}}`}}var qo=class extends Error{constructor(t){super(t.text);this.details=t}},Ru=class{constructor(e){this.objectId=e}};function nt(r,e){let t=""+r,n=t.lastIndexOf("}");t=t.slice(0,n)+Ne(e)+t.slice(n);let i=async({cdp:o,args:s,...a})=>{let c=await o.Runtime.callFunctionOn({functionDeclaration:t,arguments:s.map(u=>u instanceof Ru?{objectId:u.objectId}:{value:u}),...a});if(!c)throw new qo({exceptionId:0,text:"No response from CDP",lineNumber:0,columnNumber:0});if(c.exceptionDetails)throw new qo(c.exceptionDetails);return c.result};return i.source=t,i}var L0=()=>"globalThis.__jsDebugIsReady = true; "+Ne();var ku=new Set(["page","iframe","worker","service_worker"]),Md=new Set(["page","iframe"]),ay=new Set(["page","iframe"]),mV=ay,Rd=class r{constructor(e,t,n,i,o,s,a,c,u){this._manager=e;this._targetInfo=t;this.launchConfig=s;this.sessionId=a;this.logger=c;this._attached=!1;this._onNameChangedEmitter=new C;this.onNameChanged=this._onNameChangedEmitter.event;this.entryBreakpoint=void 0;this._children=new Map;this.sourcePathResolver=this._manager._sourcePathResolver;this._cdp=n,n.pause(),this.parentTarget=i,this._waitingForDebugger=o,this._updateFromInfo(t),this._ondispose=u}get targetInfo(){return this._targetInfo}get targetId(){return this._targetInfo.targetId}get independentLifeycle(){return ay.has(this.type())}get supplementalConfig(){let e=this.type();return{__browserTargetType:e,__usePerformanceFromParent:e!=="page"}}targetOrigin(){return this._manager._targetOrigin}id(){return this.sessionId}cdp(){return this._cdp}name(){return this._computeName()}fileName(){return this._targetInfo.url}type(){return this._targetInfo.type}afterBind(){return this._cdp.resume(),Promise.resolve()}initialize(){return Promise.resolve()}async runIfWaitingForDebugger(){await Promise.all([this._cdp.Runtime.runIfWaitingForDebugger({}),this._cdp.Runtime.evaluate({expression:L0()})])}parent(){return this.parentTarget&&!ku.has(this.parentTarget.type())?this.parentTarget.parentTarget:this.parentTarget}children(){let e=[];for(let t of this._children.values())ku.has(t.type())?e.push(t):e.push(...t.children());return e}canStop(){return mV.has(this.type())}stop(){if(this._manager.targetList().includes(this))if(this.type()==="service_worker"){if(this._manager.serviceWorkerModel.stopWorker(this.id()),!this.parentTarget)return;this._manager.serviceWorkerModel.stopWorker(this.parentTarget.id())}else this._cdp.Target.closeTarget({targetId:this._targetInfo.targetId})}canRestart(){return ay.has(this.type())}restart(){this._cdp.Page.reload({})}waitingForDebugger(){return this._waitingForDebugger}canAttach(){return!this._attached}async attach(){return this._waitingForDebugger=!1,this._attached=!0,Promise.resolve(this._cdp)}canDetach(){return this._attached}async detach(){this._attached=!1,this._manager._detachedFromTarget(this.sessionId)}executionContextName(e){let t=e.auxData,n=e.name;if(!t)return n;let i=t.frameId,o=i?this._manager.frameModel.frameForId(i):void 0;return o&&t.isDefault&&!o.parentFrame()?"top":o&&t.isDefault?o.displayName():o?`${n}`:n}supportsCustomBreakpoints(){return Md.has(this.type())}supportsXHRBreakpoints(){return Md.has(this.type())}scriptUrlToUrl(e){return Wi(this._targetInfo.url,e)||e}_updateFromInfo(e){this._targetInfo={...e,type:this._targetInfo.type},this._onNameChangedEmitter.fire()}setComputeNameFn(e){this._customNameComputeFn=e,this._onNameChangedEmitter.fire()}_computeName(){let e=this._customNameComputeFn?.(this);if(e)return e;if(this.type()==="service_worker"){let i=this._manager.serviceWorkerModel.version(this.id());if(i)return i.label()+" [Service Worker]"}let t=this._targetInfo.title;if(!(t&&this._manager.targetList().some(i=>i instanceof r&&i!==this&&i._targetInfo.title===this._targetInfo.title)))return t;try{let i=new $0.URL(this._targetInfo.url);i.protocol==="data:"?t=" <data>":i?t+=` (${this._targetInfo.url.replace(/^[a-z]+:\/\/|\/$/gi,"")})`:t+=` (${this._targetInfo.url})`}catch{t+=` (${this._targetInfo.url})`}return t}async _detached(){await this._manager.serviceWorkerModel.detached(this._cdp),this._ondispose(this)}};function Ou(r){return r instanceof Array?r:[r]}function C0(r,e,t){let n=0,i=r.length-1;for(;n<=i;){let o=(n+i)/2|0,s=t(r[o],e);if(s<0)n=o+1;else if(s>0)i=o-1;else return o}return n}function D0(r,e){let t=new Map;for(let n of r){let i=e(n),o=t.get(i);o?o.push(n):t.set(i,[n])}return t}function ma(r){return r.next().value}var kd=class{constructor(e,t){this.key=e;this.value=t}toString(){return`${this.key}: ${this.value}`}},Mn=class{constructor(e,t){this.projection=e;this.initialContents=t;let n=Array.from(t||[]).map(i=>[this.projection(i[0]),new kd(i[0],i[1])]);this.projectionToKeyAndValue=new Map(n)}clear(){this.projectionToKeyAndValue.clear()}delete(e){let t=this.projection(e);return this.projectionToKeyAndValue.delete(t)}forEach(e,t){this.projectionToKeyAndValue.forEach(n=>{e.call(t,n.value,n.key,this)},t)}get(e){let t=this.projection(e),n=this.projectionToKeyAndValue.get(t);return n?n.value:void 0}has(e){return this.projectionToKeyAndValue.has(this.projection(e))}set(e,t){return this.projectionToKeyAndValue.set(this.projection(e),new kd(e,t)),this}get size(){return this.projectionToKeyAndValue.size}*entries(){for(let e of this.projectionToKeyAndValue.values())yield[e.key,e.value]}*keys(){for(let e of this.projectionToKeyAndValue.values())yield e.key}*values(){for(let e of this.projectionToKeyAndValue.values())yield e.value}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return JSON.stringify(Array.from(this.entries()))}toString(){return`MapUsingProjection<${JSON.stringify([...this.entries()])}>`}};function Rn(r,e){return r.length<=e?r:r.substr(0,e-1)+"\u2026"}function Ha(r,e){if(r.length<=e)return r;let t=e>>1,n=e-t-1,i=r.codePointAt(r.length-n-1);i&&i>=65536&&(--n,++t);let o=r.codePointAt(t-1);return t>0&&o&&o>=65536&&--t,r.substr(0,t)+"\u2026"+r.substr(r.length-n,n)}var T0="/\\.?*()^${}|[]+",M0=r=>T0.includes(r);function Ut(r,e){let t=T0.split("").filter(i=>!e||e.indexOf(i)<0).join("").replace(/[\\\]]/g,"\\$&"),n=new RegExp(`[${t}]`,"g");return r.replace(n,"\\$&")}var ji=class{constructor(e){this.source=e;this.lines=[];this.lines.push(0);for(let t=e.indexOf(`
`);t!==-1;t=e.indexOf(`
`,t+1))this.lines.push(t+1)}getLineOffset(e){return e>=this.lines.length?this.source.length:this.lines[e]}convert(e){let t=e.base0;if(t.lineNumber>this.lines.length)return this.source.length;let n=this.lines[t.lineNumber],i=this.lines[t.lineNumber+1]??this.source.length+1;return n+Math.min(i-n-1,t.columnNumber)}};var Nd=process.platform!=="win32";function uy(){return Nd}function Bd(r){return Nd?r:r.toLowerCase()}function Fd(r,e){return Nd?r===e:r.toLowerCase()===e.toLowerCase()}function Go(){return uy()?new Map:new Mn(Bd)}var R0=process.platform==="win32"?process.env.PATHEXT?.toLowerCase().split(";"):void 0,B0=r=>{let e=Bd(sr.basename(r));if(R0){for(let t of R0)if(e.endsWith(t))return e.slice(0,-t.length)}return e},ly=async(r,e)=>{for(;;){let t=await e(r);if(t!==void 0)return t;let n=sr.dirname(r);if(n===r)return;r=n}},Ud=(r,e,t)=>ly(e,async n=>await r.exists(sr.join(n,t))?n:void 0),gV=new Set(["localhost","127.0.0.1","::1"]);var k0=r=>gV.has(r.toLowerCase()),yV=r=>{try{return new kn.URL(r).hostname.replace(/^\[|\]$/g,"")}catch{return r}};var ga=ko(async r=>{let e=yV(r);if(k0(e))return!0;try{let t=await N0.promises.lookup(e);return k0(t.address)}catch{return!1}});function Wi(r,e){try{return new kn.URL(e,r).href}catch{}}function py(r){try{return new kn.URL(r).pathname}catch{return}}function Wd(r,e){try{return new kn.URL(e),e}catch{}let t;try{t=new kn.URL(r||"")}catch{return e}let n=t.protocol+"//";return t.username&&(n+=t.username+":"+t.password+"@"),n+=t.host,n+=sr.dirname(t.pathname),n[n.length-1]!=="/"&&(n+="/"),n+=e,n}function jd(r){try{return new kn.URL(r),!0}catch{return!1}}function F0(r){return r.replace(/\/$/,"").replace(/\\$/,"")}var bV=/^https:\/\/([a-z0-9\-]+)\+\.vscode-resource\.vscode-(?:webview|cdn)\.net\/(.+)/i,O0="vscode-file://vscode-app/";function We(r){let e=bV.exec(r);if(e)r=`${e[1]}:///${e[2]}`;else if(r.startsWith("vscode-webview-resource://"))r=new kn.URL(r).pathname.replace(/%2F/gi,"/").replace(/^\/([a-z0-9\-]+)(\/{1,2})/i,(n,i,o)=>o.length===1?`${i}:///`:`${i}://`);else if(r.startsWith(O0))r=r.slice(O0.length);else if(!Er(r))return;return r=r.replace("file:///",""),r=decodeURIComponent(r),r.startsWith("/")&&process.platform==="win32"&&r[1]!=="/"&&(r="/"+r),r[0]!=="/"&&!r.match(/^[A-Za-z]:/)&&(r="/"+r),Xe(r)}function U0(r){return Er(r)&&(r=r.replace("file:///","\\\\"),r=r.replace(/\//g,"\\"),r=decodeURIComponent(r)),r}function He(r){return dy==="win32"?"file:///"+Vi(r):"file://"+Vi(r)}function ya(r){return r.startsWith("/")?"file://"+Vi(r):"file:///"+Vi(r)}function $t(r){return sr.posix.isAbsolute(r)||sr.win32.isAbsolute(r)}function At(r){return!!r&&r.startsWith("data:")}var cy=(r,e,t)=>{if(!t||r===":"){e.add(r);return}if(r==="/"){e.add(`\\${r}`);return}M0(r)?e.add(`\\${r}`):e.add(r);let n=encodeURIComponent(r);r!=="\\"&&n!==r&&e.add(n)},vV=r=>{switch(r.size){case 0:return"";case 1:return ma(r.values());default:let e=[...r];return e.some(t=>t.length>1)?`(?:${e.join("|")})`:`[${e.join("")}]`}},Nu=new Set;function Bu(r,e,t,n,i=Nd){let o="";for(let s of r.slice(e,t))i?cy(s,Nu,n):(cy(s.toLowerCase(),Nu,n),cy(s.toUpperCase(),Nu,n)),o+=vV(Nu),Nu.clear();return o}function Sr(r,[e,t]=[0,r.length]){if(t<=e)return r;let n=[],i=Bu(r,0,e,!1),o=Bu(r,t,r.length,!1),s=r.slice(e,t);for(let a of[decodeURIComponent(s),We(s)]){if(!a)continue;let c=Bu(a,0,a.length,!0);n.push(IV(`${i}${c}${o}`).concat("($|\\?)"))}return n.join("|")}var IV=r=>r.replace(/^(file:\\\/\\\/\\\/)?([a-z]):/i,(e,t="",n)=>`${t}[${n.toUpperCase()}${n.toLowerCase()}]:`);function Er(r){return r.startsWith("file:///")}var dy=process.platform;function Vi(r){return r=on(r),dy==="win32"?(kg(r)&&(r=r.slice(1)),r.split(/[\\//]/g).map((e,t)=>t>0?encodeURIComponent(e):e).join("/")):r.split("/").map(encodeURIComponent).join("/")}function on(r){return r&&dy==="win32"&&r[1]===":"?r[0].toUpperCase()+r.substring(1):r}var qi=(r,e=[])=>{let t=r.urlFilter||"file"in r&&r.file||r.url,n=t?AV(t,...e):void 0;return i=>!i.url.startsWith("devtools://")&&n?.(i.url)!==!1},ba=r=>e=>e.type==="page"&&!e.url.startsWith("edge://force-signin")&&r(e);function _V(r){return!!r&&!sr.isAbsolute(r)&&!!(0,kn.parse)(r).protocol}var AV=(...r)=>{let e=i=>{i=i.toLowerCase();let o=We(i);o?i=o:_V(i)&&i.includes("://")&&(i=i.substr(i.indexOf("://")+3)),i.endsWith("/")&&(i=i.substr(0,i.length-1));let s=i.indexOf("#");return s!==-1&&(i=i.slice(0,i[s-1]==="/"?s-1:s)),i},t=r.map(i=>Ut(e(i),"/*").replace(/(\/\*$)|\*/g,".*")),n=new RegExp("^("+t.join("|")+")$","g");return i=>(n.lastIndex=0,n.test(e(i)))};var va=class r{constructor(e,t,n,i,o){this.original=e;this.metadata=t;this.actualRoot=n;this.actualSources=i;this.hasNames=o;this.sourceActualToOriginal=new Map;this.sourceOriginalToActual=new Map;this.id=r.idCounter++;if(i.length!==e.sources.length)throw new Error("Expected actualSources.length === original.source.length");for(let s=0;s<i.length;s++){let a=i[s],c=e.sources[s];a!==null&&c!==null&&(this.sourceActualToOriginal.set(a,c),this.sourceOriginalToActual.set(c,a))}}static{this.idCounter=0}get sources(){return this.actualSources.slice()}get sourceRoot(){return this.actualRoot}computedSourceUrl(e){return Xe(Wd(At(this.metadata.sourceMapUrl)?this.metadata.compiledPath:this.metadata.sourceMapUrl,this.sourceRoot+e))}originalPositionFor(e){let t=zg(this.original,e);return t.source&&(t.source=this.sourceOriginalToActual.get(t.source)??t.source),t}generatedPositionFor(e){let t=this.sourceActualToOriginal.get(e.source)??e.source;if(!isFinite(e.line)){let n=e.bias||Dn;return this.getBestGeneratedForOriginal(t,(i,o)=>wV(i,o)*n)}return Jg(this.original,{...e,source:t})}allGeneratedPositionsFor(e){return Yg(this.original,{...e,source:this.sourceActualToOriginal.get(e.source)??e.source})}sourceContentFor(e){e=this.sourceActualToOriginal.get(e)??e;let t=this.original.sources.indexOf(e);return t===-1?null:this.original.sourcesContent?.[t]??null}eachMapping(e){Qg(this.original,e)}decodedMappings(){return tn(this.original)}names(){return this.original.names}getBestGeneratedForOriginal(e,t){let n;return this.eachMapping(i=>{i.source===e&&(!n||t(i,n)>0)&&(n=i)}),n?{column:n.generatedColumn,line:n.generatedLine}:{column:null,line:null}}},wV=({originalLine:r,originalColumn:e},{originalLine:t,originalColumn:n})=>(r||0)-(t||0)||(e||0)-(n||0);async function j0(r,e,t,n){let i=Vd.Parser.parse(e,{locations:!0,ecmaVersion:"latest"}),o=new Du({file:r}),s=fi(i,{sourceMap:{addMapping:a=>Zg(o,a.original.line-1,a.original.column,r,a.generated.line-1,a.generated.column)}});return ey(o,r,s),new va(new Sd(Ed(o)),{sourceMapUrl:n,compiledPath:t},"",[r],!1)}function V0(r){let e;try{e=Tn(r)}catch{return}let t=(c,u)=>({type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:c,right:u}}),n=!1,i=!1,o=Dd(e,{enter(c,u){switch(c.type){case"ClassDeclaration":return{replace:t(c.id||{type:"Identifier",name:"_default"},{...c,type:"ClassExpression"})};case"FunctionDeclaration":return{replace:t(c.id||{type:"Identifier",name:"_default"},{...c,type:"FunctionExpression"})};case"FunctionExpression":case"ArrowFunctionExpression":case"MethodDefinition":return 1;case"AwaitExpression":n=!0;return;case"ForOfStatement":c.await&&(n=!0);return;case"ReturnStatement":i=!0;return;case"VariableDeclaration":if(!u||!("body"in u)||!(u.body instanceof Array))return;let l=u.body,p=c.declarations.map(d=>({type:"ExpressionStatement",expression:{type:"UnaryExpression",operator:"void",prefix:!0,argument:{type:"AssignmentExpression",operator:"=",left:d.id,right:d.init||{type:"Identifier",name:"undefined"}}}}));l.splice(l.indexOf(c),1,...p)}}});if(!n||i)return;let s=e.body[e.body.length-1];s.type==="ExpressionStatement"&&(e.body[e.body.length-1]={type:"ReturnStatement",argument:s.expression});let a={type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"ArrowFunctionExpression",params:[],generator:!1,expression:!1,async:!0,body:{type:"BlockStatement",body:o.body}},arguments:[],optional:!1}};return fi(a)}function Fu(r){try{let e=(0,Vd.parseExpressionAt)(r,0,iy);return e.end<r.length||e.type!=="ObjectExpression"?r:`(${r})`}catch{return r}}function Ia(r){if(!r)return;let e="sourceMappingURL",t=r.length,n=e.length,i=t,o=0;for(;;){if(i=r.lastIndexOf(e,i),i===-1||i<4)return;if(i-=4,r[i]==="/"&&r[i+1]==="/"&&!(r[i+2]!=="#"&&r[i+2]!=="@")&&!(r[i+3]!==" "&&r[i+3]!==" ")&&(o=i+4+n,!(o<t&&r[o]!=="=")))break}let s=r.substring(o+1),a=s.indexOf(`
`);return a!==-1&&(s=s.substring(0,a)),s.trim()}function qd(r,e,t){let n=t.generatedPositionFor({source:r,line:e.lineNumber,column:e.columnNumber-1,bias:Dn}),i=a=>{if(a.line===null||a.column===null)return 1e11;let c=t.originalPositionFor(a);return c.line!==null?Math.abs(e.lineNumber-c.line):1e11},o=i(n),s=t.allGeneratedPositionsFor({source:r,line:e.lineNumber,column:e.columnNumber-1}).filter(a=>a.line!==null&&a.column!==null).sort((a,c)=>a.line!==c.line?a.line-c.line:a.column-c.column).map(a=>[a,i(a)]);return s.push([n,o]),s.sort(([a,c],[u,l])=>c-l||a.line-u.line||a.column-u.column),s[0][0]}var fy=(r,e)=>!!e&&((e.type==="FunctionExpression"||e.type==="FunctionDeclaration"||e.type==="ArrowFunctionExpression")&&e.params.includes(r)||(e.type==="ForInStatement"||e.type==="ForOfStatement")&&e.left===r||e.type==="VariableDeclarator"&&e.id===r||e.type==="AssignmentPattern"&&e.left===r||e.type==="CatchClause"&&e.param===r||"kind"in e&&e.kind==="init"&&e.value===r||e.type==="RestElement"&&e.argument===r||e.type==="AssignmentPattern"&&e.left===r);function Gi(r){try{new Function(r)}catch(e){return e}}function EV(r,e){let t=Tn(r),n,i;return Ui(t,{enter:o=>{let s=o;e>=s.start&&e<s.end&&(o.type==="CallExpression"||o.type==="NewExpression"?i=o:n=o)}}),i||n}var W0=/^[^()]+/g;function q0(r,e){try{let n=EV(r,e);if(n&&"callee"in n){let i=n.callee;return{text:`${r.slice(i.start,i.end)}(...)`,start:i.start,end:i.end}}else{let i=n;return{text:r.slice(i.start,i.end),start:i.start,end:i.end}}}catch{}W0.lastIndex=e-1;let t=W0.exec(r);if(t)return{text:t[0],start:e,end:e+t[0].length}}var Ko=class{constructor(e,t,n,i,o,s,a,c){this.url=t;this.inlineScriptOffset=s;this.runtimeScriptOffset=a;this.contentHash=c;this._scripts=[];this.hasBeenAnnounced=!1;this.sourceReference=e.getSourceReference(t),this._contentGetter=ne(i),this._container=e,this.absolutePath=n||"",this._fqname=this._fullyQualifiedName(),this._name=this._humanName(),this.setSourceMapUrl(o),this._existingAbsolutePath=this.checkContentHash(c)}get sendLazy(){return!this.url}checkContentHash(e){return TE(this.absolutePath,this.inlineScriptOffset||this.runtimeScriptOffset?void 0:e,this._container._fileContentOverridesForTest.get(this.absolutePath))}offsetScriptToSource(e){return this.runtimeScriptOffset?{...e,lineNumber:Math.max(1,e.lineNumber-this.runtimeScriptOffset.lineOffset),columnNumber:e.columnNumber-this.runtimeScriptOffset.columnOffset}:e}offsetSourceToScript(e){return this.runtimeScriptOffset?{...e,lineNumber:e.lineNumber+this.runtimeScriptOffset.lineOffset,columnNumber:e.columnNumber+this.runtimeScriptOffset.columnOffset}:e}async equalsDap(e){let t=await this._existingAbsolutePath;return t?!e.sourceReference&&t===e.path:e.sourceReference===this.sourceReference}setSourceMapUrl(e){if(!e){this.sourceMap=void 0;return}this.sourceMap={type:0,sourceByUrl:new Map,value:ge(),metadata:e}}addScript(e){this._scripts.push(e)}filterScripts(e){this._scripts=this._scripts.filter(e)}get scripts(){return this._scripts}get getSuggestedMimeType(){if(this.url.endsWith(".wat"))return"text/wat";if(!/\.[^/]+$/.test(this.url)||this.url.includes("?"))return"text/javascript"}async content(){let e=await this._contentGetter();return this.inlineScriptOffset?.lineOffset&&(e=`
`.repeat(this.inlineScriptOffset.lineOffset)+e),e}async prettyPrint(){if(!this._container)return;if(Xo(this)&&this.sourceMap.metadata.sourceMapUrl.endsWith("-pretty.map")){let c=this.sourceMap.value.settledValue;return c&&{map:c,source:[...this.sourceMap.sourceByUrl.values()][0]}}let e=await this.content();if(!e)return;let t=this.url||`eval://${this.sourceReference}.js`,n=t+"-pretty.map",o=t.split(/[\/\\]/).pop()+"-pretty.js",s=await j0(o,e,t,n);if(!s)return;this.setSourceMapUrl({compiledPath:this.absolutePath,sourceMapUrl:""}),this.sourceMap.value.resolve(s);let a=this;return await this._container._addSourceMapSources(a,s),{map:s,source:[...a.sourceMap.sourceByUrl.values()][0]}}async toDap(){let e=await this._existingAbsolutePath,t={name:this._name,path:this._fqname,sourceReference:this.sourceReference,presentationHint:this.blackboxed()?"deemphasize":void 0,origin:this.blackboxed()?G0.t("Skipped by skipFiles"):void 0};return e&&(t.sourceReference=0,t.path=e),this.hasBeenAnnounced||(this.hasBeenAnnounced=!0,this._container.emitLoadedSource(this)),t}existingAbsolutePath(){return this._existingAbsolutePath}async prettyName(){let e=await this._existingAbsolutePath;return e||this._fqname}_humanName(){if($t(this._fqname)){for(let e of this._container.rootPaths)if(mE(e,this._fqname))return Oe((0,K0.relative)(e,this._fqname))}return this._fqname}_fullyQualifiedName(){if(!this.url)return"<eval>/VM"+this.sourceReference;if(this.url.endsWith(".repl"))return"repl";if(this.url.startsWith(en))return di+"/"+this.url.slice(en.length);if(this.absolutePath.startsWith(di))return this.absolutePath;if($t(this.url))return this.url;let e=We(this.url);if(e)return e;let t=this.url;try{let n=[],i=new X0.URL(this.url);if(i.protocol==="data:")return"<eval>/VM"+this.sourceReference;i.hostname&&n.push(i.hostname),i.port&&n.push("\uA789"+i.port),i.pathname&&n.push(/^\/[a-z]:/.test(i.pathname)?i.pathname.slice(1):i.pathname);let o=i.searchParams?.toString();o&&n.push("?"+o),t=n.join("")}catch{}return t.endsWith("/")&&(t+="(index)"),this.inlineScriptOffset&&(t+=`\uA789${this.inlineScriptOffset.lineOffset+1}:${this.inlineScriptOffset.columnOffset+1}`),t}blackboxed(){return this._container.isSourceSkipped(this.url)}};var Uu;(n=>{async function r(i){return i.value.promise}n.waitForValue=r;function e(i,o){return i.type===0&&i.value.settledValue?Promise.resolve(i.value.settledValue):Promise.race([r(i),ue(o)])}n.waitForValueWithTimeout=e;async function t(i){return await r(i),i.sourceByUrl}n.waitForSources=t})(Uu||={});var Je=class extends Ko{constructor(){super(...arguments);this.compiledToSourceUrl=new Map}},Kd=class extends Ko{constructor(t,n,i){super(t,n.url,i,()=>Promise.resolve("Binary content not shown, see the decompiled WAT file"),void 0,void 0,void 0,void 0);this.event=n;this.sourceMap={type:1,value:ge(),sourceByUrl:new Map}}checkContentHash(){return Promise.resolve(void 0)}offsetScriptToSource(t){return t}offsetSourceToScript(t){return t}},Wt=r=>!!r&&r instanceof Ko&&!!r.sourceMap,Xo=r=>Wt(r)&&r.sourceMap.type===0,zo=r=>Wt(r)&&r.sourceMap.type===1,hy=r=>!!r&&typeof r.getDisassembly=="function";function z0(r,e){if(!e)return r;let{lineNumber:t,columnNumber:n}=r;return e&&(t+=e.lineOffset,t<=1&&(n+=e.columnOffset)),{...r,lineNumber:t,columnNumber:n}}function J0(r,e){if(!e)return r;let{lineNumber:t,columnNumber:n}=r;return e&&(t=Math.max(1,t-e.lineOffset),t<=1&&(n=Math.max(1,n-e.columnOffset))),{...r,lineNumber:t,columnNumber:n}}var Y0=r=>({lineNumber:r.lineNumber+1,columnNumber:r.columnNumber+1}),mi=r=>({lineNumber:r.lineNumber-1,columnNumber:r.columnNumber-1});var Q0=H("os");var xV={"pwa-extensionHost":null,"node-terminal":null,"pwa-node":null,"pwa-chrome":null,"pwa-msedge":null},PV={"extension.js-debug.addCustomBreakpoints":null,"extension.js-debug.addXHRBreakpoints":null,"extension.js-debug.editXHRBreakpoints":null,"extension.pwa-node-debug.attachNodeProcess":null,"extension.js-debug.clearAutoAttachVariables":null,"extension.js-debug.setAutoAttachVariables":null,"extension.js-debug.autoAttachToProcess":null,"extension.js-debug.createDebuggerTerminal":null,"extension.js-debug.createDiagnostics":null,"extension.js-debug.getDiagnosticLogs":null,"extension.js-debug.debugLink":null,"extension.js-debug.npmScript":null,"extension.js-debug.pickNodeProcess":null,"extension.js-debug.prettyPrint":null,"extension.js-debug.removeXHRBreakpoint":null,"extension.js-debug.removeAllCustomBreakpoints":null,"extension.js-debug.revealPage":null,"extension.js-debug.startProfile":null,"extension.js-debug.stopProfile":null,"extension.js-debug.toggleSkippingFile":null,"extension.node-debug.startWithStopOnEntry":null,"extension.js-debug.requestCDPProxy":null,"extension.js-debug.openEdgeDevTools":null,"extension.js-debug.callers.add":null,"extension.js-debug.callers.goToCaller":null,"extension.js-debug.callers.gotToTarget":null,"extension.js-debug.callers.remove":null,"extension.js-debug.callers.removeAll":null,"extension.js-debug.enableSourceMapStepping":null,"extension.js-debug.disableSourceMapStepping":null,"extension.js-debug.network.viewRequest":null,"extension.js-debug.network.copyUri":null,"extension.js-debug.network.openBody":null,"extension.js-debug.network.openBodyInHex":null,"extension.js-debug.network.replayXHR":null,"extension.js-debug.network.clear":null,"extension.js-debug.completion.nodeTool":null},j7=new Set(Object.keys(PV)),V7=new Set(Object.keys(xV));var de=Symbol("AnyLaunchConfiguration"),Z0={type:"",name:"",request:"",trace:!1,outputCapture:"console",timeout:1e4,timeouts:{},showAsyncStacks:!0,skipFiles:[],smartStep:!0,sourceMaps:!0,sourceMapRenames:!0,pauseForSourceMap:!0,resolveSourceMapLocations:null,rootPath:"${workspaceFolder}",outFiles:["${workspaceFolder}/**/*.(m|c|)js","!**/node_modules/**"],sourceMapPathOverrides:Hy("${workspaceFolder}"),enableContentValidation:!0,cascadeTerminateToConfigurations:[],enableDWARF:!0,__workspaceFolder:"",__remoteFilePrefix:void 0,__breakOnConditionalError:!1,customDescriptionGenerator:void 0,customPropertiesGenerator:void 0},ju={...Z0,cwd:"${workspaceFolder}",env:{},envFile:null,pauseForSourceMap:!1,sourceMaps:!0,localRoot:null,remoteRoot:null,resolveSourceMapLocations:["**","!**/node_modules/**"],autoAttachChildProcesses:!0,runtimeSourcemapPausePatterns:[],skipFiles:[`${di}/**`]},ex={...ju,showAsyncStacks:{onceBreakpointResolved:16},type:"node-terminal",request:"launch",name:"JavaScript Debug Terminal"},LV={...ju,type:"node-terminal",request:"attach",name:ex.name,showAsyncStacks:{onceBreakpointResolved:16},delegateId:-1},$V={...ju,type:"pwa-extensionHost",name:"Debug Extension",request:"launch",args:["--extensionDevelopmentPath=${workspaceFolder}"],outFiles:["${workspaceFolder}/out/**/*.js"],resolveSourceMapLocations:["${workspaceFolder}/**","!**/node_modules/**"],rendererDebugOptions:{},runtimeExecutable:"${execPath}",autoAttachChildProcesses:!1,debugWebviews:!1,debugWebWorkerHost:!1,__sessionId:""},CV={...ju,type:"pwa-node",request:"launch",program:"",cwd:"${workspaceFolder}",stopOnEntry:!1,console:"internalConsole",restart:!1,args:[],runtimeExecutable:"node",runtimeVersion:"default",runtimeArgs:[],profileStartup:!1,attachSimplePort:null,experimentalNetworking:"auto",killBehavior:"forceful"},my={...Z0,type:"pwa-chrome",request:"attach",address:"localhost",port:0,disableNetworkCache:!0,pathMapping:{},url:null,restart:!1,urlFilter:"",sourceMapPathOverrides:Hy("${webRoot}"),webRoot:"${workspaceFolder}",server:null,browserAttachLocation:"workspace",targetSelection:"automatic",vueComponentPaths:["${workspaceFolder}/**/*.vue","!**/node_modules/**"],perScriptSourcemaps:"auto"},DV={...my,type:"pwa-msedge",useWebView:!1},tx={...my,type:"pwa-chrome",request:"launch",cwd:null,file:null,env:{},urlFilter:"*",includeDefaultArgs:!0,includeLaunchArgs:!0,runtimeArgs:null,runtimeExecutable:"*",userDataDir:!0,browserLaunchLocation:"workspace",profileStartup:!1,cleanUp:"wholeBrowser"},TV={...tx,type:"pwa-msedge",useWebView:!1},MV={...ju,type:"pwa-node",attachExistingChildren:!0,address:"localhost",port:9229,restart:!1,request:"attach",continueOnAttach:!1};function Hy(r){return{"webpack:///./~/*":`${r}/node_modules/*`,"webpack:////*":"/*","webpack://@?:*/?:*/*":`${r}/*`,"webpack://?:*/*":`${r}/*`,"webpack:///([a-z]):/(.+)":"$1:/$2","meteor://\u{1F4BB}app/*":`${r}/*`,"turbopack://[project]/*":"${workspaceFolder}/*"}}var rx=r=>{!r.sourceMapPathOverrides&&r.cwd&&(r.sourceMapPathOverrides=Hy(r.cwd)),r.resolveSourceMapLocations===void 0&&(r.resolveSourceMapLocations=r.outFiles)};function RV({...r}){return rx(r),r.request==="attach"?{...MV,...r}:{...CV,...r}}function kV(r,e){return r.request==="attach"?{...my,browserAttachLocation:e,...r}:{...tx,browserLaunchLocation:e,...r}}function OV(r,e){return r.request==="attach"?{...DV,browserAttachLocation:e,...r}:{...TV,browserLaunchLocation:e,...r}}function NV(r){let e={...$V,...r};return e.skipFiles=[...e.skipFiles,"**/node_modules.asar/**","**/bootstrap-fork.js"],e}function BV(r){return rx(r),r.request==="launch"?{...ex,...r}:{...LV,...r}}function _a(r,e){let t,n=e==="remote"?"ui":"workspace";switch(r.type){case"pwa-node":t=RV(r);break;case"pwa-msedge":t=OV(r,n);break;case"pwa-chrome":t=kV(r,n);break;case"pwa-extensionHost":t=NV(r);break;case"node-terminal":t=BV(r);break;default:throw gp(r,"Unknown config: {value}")}return UV(t)}function FV(r){let e="${workspaceFolder}",t={...r,rootPath:void 0,outFiles:r.outFiles.filter(n=>!n.includes(e)),sourceMapPathOverrides:yp(r.sourceMapPathOverrides,n=>!n.includes("${workspaceFolder}"))};return"vueComponentPaths"in t&&(t.vueComponentPaths=t.vueComponentPaths.filter(n=>!n.includes(e))),"resolveSourceMapLocations"in t&&(t.resolveSourceMapLocations=t.resolveSourceMapLocations?.filter(n=>!n.includes(e))??null),"cwd"in t&&t.cwd?.includes(e)&&(t.cwd=t.request==="launch"&&t.type==="pwa-node"?(0,Q0.homedir)():void 0),"webRoot"in t&&t.webRoot?.includes(e)&&(t.webRoot="/"),t}function UV(r){return r.__workspaceFolder||(r=FV(r)),r=Wu(r,"workspaceFolder",r.__workspaceFolder),r=Wu(r,"webRoot","webRoot"in r?r.webRoot:r.__workspaceFolder),r}function Wu(r,e,t){let n;if(typeof r=="string")n=r.replace(new RegExp(`\\$\\{${e}\\}`,"g"),()=>{if(!t)throw new Error(`Unable to resolve \${${e}} in configuration (${JSON.stringify(e)})`);return t});else if(r instanceof Array)n=r.map(i=>Wu(i,e,t));else if(typeof r=="object"&&r){let i={};for(let[o,s]of Object.entries(r))i[Wu(o,e,t)]=Wu(s,e,t);n=i}else n=r;return n}var Xd="js-debug",Vu="1.96.0",WV="ms-vscode",nx=Xd.includes("nightly"),z7=`${WV}.${Xd}`;var ix=H("worker_threads");var Aa=H("worker_threads");function gy(r){let e=Tn(r),t=[],n=(s,{loc:a}=s,{loc:c}=s)=>{if(!a||!c)throw new Error("should include locations");t.push({start:a.start,end:c.end,depth:o.length}),o.push(s)},i=new Set,o=[];return Ui(e,{enter:s=>{switch(s.type){case"FunctionDeclaration":case"ArrowFunctionExpression":n(s,s.params[0]||s.body,s.body),i.add(s.body);break;case"Program":n(s);break;case"ForStatement":case"ForOfStatement":case"ForInStatement":n(s),i.add(s.body);break;case"BlockStatement":i.has(s)||n(s);break}},leave:s=>{s===o[o.length-1]&&o.pop()}}),t}Aa.isMainThread||Aa.parentPort?.postMessage(gy(Aa.workerData));var wa=class r{constructor(e){this.range=e}static hydrate(e,t){let n=new r(new nr(new zr(e[0].start.line,e[0].start.column),new zr(e[0].end.line,e[0].end.column))),i=[n],o=1;for(let s=1;s<e.length;s++){let a=e[s];for(;a.depth<o;)o--,i[o].data=t(i[o]);let c=new r(new nr(new zr(a.start.line,a.start.column),new zr(a.end.line,a.end.column))),u=i[o-1];u.children??=[],u.children.push(c),i[o++]=c}for(let s=o-1;s>=0;s--)i[s].data=t(i[s]);return n}search(e){if(this.range.contains(e)){if(!this.children)return this;for(let t of this.children){let n=t.search(e);if(n)return n}return this}}findDeepest(e,t){if(this.range.contains(e)){if(this.children)for(let n of this.children){let i=n.findDeepest(e,t);if(i!==void 0)return i}return t(this)}}filterHoist(e){if(this.children)for(let t=0;t<this.children.length;t++){let n=this.children[t];if(n.filterHoist(e),!e(n)){let i=n.children||[];this.children.splice(t,1,...i),t--}}}forEach(e){e(this),this.children?.forEach(t=>t.forEach(e))}forEachDepthFirst(e){this.children?.forEach(t=>t.forEach(e)),e(this)}toJSON(){return{range:this.range,children:this.children}}},jV=1024*512;function ox(r,e){return r.length<jV?wa.hydrate(gy(r),e):new Promise((t,n)=>{let i=new ix.Worker(`${__dirname}/renameWorker.js`,{workerData:r});i.on("message",o=>t(wa.hydrate(o,e))),i.on("error",n),i.on("exit",()=>n("rename worker exited"))})}var sx=/[$a-z_][$0-9A-Z_$]*/iy,ax=async(r,e)=>{let t=new ji(r),n=new Set,i=e.decodedMappings(),o=e.names(),s=(u,l,p)=>{let d=u*2147483647|l;if(n.has(d))return;n.add(d);let f=new Ve(u,l),h=t.convert(f);sx.lastIndex=h;let m=sx.exec(r);if(!m)return;let y=m[0];if(y!==p)return y},c=await ox(r,u=>{let l=u.range.begin.base0,p=u.range.end.base0,d;for(let f=l.lineNumber;f<=p.lineNumber;f++){let h=i[f];if(h)for(let m=0;m<h.length;m++){let y=h[m];if(y.length<=4)continue;let w=f,D=y[0];if(w===u.range.begin.base0.lineNumber&&u.range.begin.base0.columnNumber>D||w===u.range.end.base0.lineNumber&&u.range.end.base0.columnNumber<D)continue;let j=o[y[4]],X=s(w,D,j);X&&(d??=[],d.some(B=>B.compiled==X)||d.push({compiled:X,original:j}))}}return d});return c.filterHoist(u=>!!u.data),c};var On=_(q());var zd=class extends Error{constructor(t,n,i){super(`Unexpected ${t} response from ${n}: ${i??"<empty body>"}`);this.statusCode=t;this.url=n;this.body=i}},Jo=Symbol("IResourceProvider");var we=_(je());var T=class extends Error{get cause(){return this._cause}constructor(e){super("__errorMarker"in e?e.error.format:e.format),this._cause="__errorMarker"in e?e.error:e}};function cx(r,e){r.output({category:"console",output:e+`
`})}function ve(r,e=9222){return{__errorMarker:!0,error:{id:e,format:r,showUser:!1}}}function ye(r,e=9223){return{__errorMarker:!0,error:{id:e,format:r,showUser:!0}}}var yy=()=>ye(we.t("Attribute 'runtimeVersion' requires Node.js version manager 'nvs', 'nvm' or 'fnm' to be installed."),9224),ux=()=>ye(we.t("Attribute 'runtimeVersion' with a flavor/architecture requires 'nvs' to be installed."),9225),lx=()=>ye(we.t("Attribute 'runtimeVersion' requires Node.js version manager 'nvm-windows' or 'nvs'."),9226),by=(r,e)=>ye(we.t("Node.js version '{0}' not installed using version manager {1}.",r,e),9226),px=r=>ye(we.t("Cannot launch debug target in terminal ({0}).",r),9227),dx=r=>ye(we.t("Can't load environment variables from file ({0}).",r),9228),fx=r=>ye(we.t("The configured `cwd` {0} does not exist.",r),9245),vy=(r,e)=>ye(we.t(`Can't find Node.js binary "{0}": {1}. Make sure Node.js is installed and in your PATH, or set the "runtimeExecutable" in your launch.json`,r,e),9229),hx=(r,e)=>ye(we.t('The Node version in "{0}" is outdated (version {1}), we require at least Node 8.x.',e,r),9230),Iy=r=>ye(we.t('Invalid hit condition "{0}". Expected an expression like "> 42" or "== 2".',r),9231),Sa=()=>ye(we.t("An error occurred taking a profile from the target."),9235),mx=()=>ye(we.t("Please stop the running profile before starting a new one."),9236),Hx=r=>ve(r,9238),Jd=(r,e,t)=>ye(e==="*"&&!t.length?we.t('Unable to find an installation of the browser on your system. Try installing it, or providing an absolute path to the browser in the "runtimeExecutable" in your launch.json.'):we.t('Unable to find {0} version {1}. Available auto-discovered versions are: {2}. You can set the "runtimeExecutable" in your launch.json to one of these, or provide an absolute path to the browser executable.',r,e,JSON.stringify([...new Set(t)])),9233),_y=r=>ye(we.t('Unable to launch browser: "{0}"',r.message),9240),qu=r=>ye(r??we.t("Unable to attach to browser"),9242),Yd=()=>ye(we.t('Target page not found. You may need to update your "urlFilter" to match the page you want to debug.'),9241);var gx=()=>ve(we.t("Variables not available in async stacks"),9234),Ki=(r,e)=>ye(we.t("Syntax error setting breakpoint with condition {0} on line {1}: {2}",JSON.stringify(r.condition),r.line,e),9237),Ay=()=>ve(we.t("Thread not found"),9244),Qd=(r,e)=>ye(we.t("Could not read source map for {0}: {1}",r,e)),yx=()=>ye(we.t("UWP webview debugging is not available on your platform.")),bx=()=>ye(we.t("Networking not available.")),vx=()=>ye(we.t("Could not connect to any UWP Webview pipe. Make sure your webview is hosted in debug mode, and that the `pipeName` in your `launch.json` is correct.")),Gu=()=>ye(we.t("Could not find a location for the variable")),Ix=r=>typeof r=="object"&&!!r&&"__errorMarker"in r,_x=(r,e)=>r instanceof T&&r.cause.id===e,Ax=r=>ye(we.t("The browser process exited with code {0} before connecting to the debug server. Make sure the `runtimeExecutable` is configured correctly and that it can run without errors.",r));var wx=new WeakSet;var VV="Request",qV=r=>r.endsWith("Request"),Yt=Symbol("IDapApi"),Ea=Symbol("IRootDapApi"),Ku=class{constructor(e,t){this.transport=e;this.logger=t;this._pendingRequests=new Map;this._requestHandlers=new Map;this._eventListeners=new Map;this.disposables=[];this._initialized=ge();this.closed=!1;this._sequence=1,this.disposables.push(this.transport.messageReceived(n=>this._onMessage(n.message,n.receivedTime))),this._dap=this._createApi()}get initializedBlocker(){return this._initialized.promise}attachTelemetry(e){this.telemetryReporter=e,e.attachDap(this._dap)}dap(){return this._dap}_createApi(){return new Proxy({},{get:(e,t)=>{if(t!=="then")return t==="on"?(n,i)=>(this._requestHandlers.set(n,i),()=>this._requestHandlers.delete(n)):t==="off"?n=>this._requestHandlers.delete(n):n=>{if(qV(t))return this.enqueueRequest(t.slice(0,-VV.length),n);this._send({seq:0,type:"event",event:t,body:n})}}})}createTestApi(){let e=(i,o)=>{let s=this._eventListeners.get(i);s||(s=new Set,this._eventListeners.set(i,s)),s.add(o)},t=(i,o)=>{let s=this._eventListeners.get(i);s&&s.delete(o)},n=(i,o)=>new Promise(s=>{let a=c=>{o&&!o(c)||(t(i,a),s(c))};e(i,a)});return new Proxy({},{get:(i,o)=>o==="on"?e:o==="off"?t:o==="once"?n:s=>this.enqueueRequest(o,s)})}enqueueRequest(e,t){return new Promise(n=>{let i={seq:0,type:"request",command:e,arguments:t||{}};this._send(i),this._pendingRequests.set(i.seq,n)})}stop(){this.closed=!0,this.transport.close()}_send(e,t){if(this.closed)this.logger.warn("dap.send","Not sending message because the connection has ended",e),t?.();else{e.seq=this._sequence++;let n=e.type!=="event"||!wx.has(e.body);this.transport.send(e,n,t)}}async _onMessage(e,t){if(e.type==="request"){let n={seq:0,type:"response",request_seq:e.seq,command:e.command,success:!0};try{let i=this._requestHandlers.get(e.command);if(!i)console.error(`Unknown request: ${e.command}`);else{let o=await i(e.arguments);if(Ix(o))this._send({...n,success:!1,message:o.error.format,body:{error:o.error}});else{let s={...n,body:o};n.command==="initialize"?(this._send(s),this._initialized.resolve(this)):n.command==="disconnect"?this._send({...n,body:o},()=>{this.stop()}):this._send(s)}}this.telemetryReporter?.reportOperation("dapOperation",e.command,t.elapsed().ms)}catch(i){i instanceof T?this._send({...n,success:!1,body:{error:i.cause}}):(console.error(i),this._send({...n,success:!1,body:{error:{id:9221,format:`Error processing ${e.command}: ${i.stack||i.message}`,showUser:!1,sendTelemetry:!1}}})),this.telemetryReporter?.reportOperation("dapOperation",e.command,t.elapsed().ms,i)}}if(e.type==="event"){let n=this._eventListeners.get(e.event)||new Set;for(let i of n)i(e.body)}if(e.type==="response"){let n=this._pendingRequests.get(e.request_seq);if(!this.logger.assert(n,`Expected callback for request sequence ID ${e.request_seq}`))return;if(this._pendingRequests.delete(e.request_seq),e.success)n(e.body);else{let i=e.body?.error?.format;n(i||e.message||"Unknown error")}}}};var Se=Symbol("ISourcePathResolver");var Nn=Symbol("ISourceMapFactory"),wy=Symbol("IRootSourceMapFactory"),Yo=class{constructor(e,t){this.root=e;this.resourceProvider=t}load(e){return this.root.load(this.resourceProvider,e)}guardSourceMapFn(e,t,n){return this.root.guardSourceMapFn(e,t,n)}};Yo=E([(0,On.injectable)(),g(0,(0,On.inject)(wy)),g(1,(0,On.inject)(Jo))],Yo);var Xu=class{constructor(e,t,n){this.pathResolve=e;this.dap=t;this.logger=n;this.hasWarnedAboutMaps=new WeakSet}async load(e,t){let n=await this.parseSourceMap(e,t.sourceMapUrl),i;"sourceRoot"in n&&(i=n.sourceRoot,n.sourceRoot=void 0);let o=!1,s=[];if("sections"in n){s=[];let a=0;for(let c of n.sections){let u=c.map;s.push(...u.sources),u.sources=u.sources.map(()=>`source${a++}.js`),o||=!!u.names?.length}}else"sources"in n&&Array.isArray(n.sources)&&(s=n.sources,n.sources=n.sources.map((a,c)=>`source${c}.js`),o=!!n.names?.length);return new va(new Sd(n),t,i??"",s,o)}async parseSourceMap(e,t){let n;try{n=await this.parseSourceMapDirect(e,t)}catch(i){if(n=await this.parsePathMappedSourceMap(e,t),!n)throw i}if("sections"in n){let i=await Promise.all(n.sections.map((o,s)=>"url"in o?this.parseSourceMap(e,o.url).then(a=>({offset:o.offset,map:a})).catch(a=>{this.logger.warn("sourcemap.parsing",`Error parsing nested map ${s}: ${a}`)}):o));n.sections=i.filter(It)}return n}async parsePathMappedSourceMap(e,t){if(At(t))return;let n=await this.pathResolve.urlToAbsolutePath({url:t});if(n)try{return this.parseSourceMapDirect(e,n)}catch(i){this.logger.info("sourcemap.parsing","Parsing path mapped source map failed.",i)}}guardSourceMapFn(e,t,n){try{return t()}catch(i){if(!/error parsing/i.test(String(i.message)))throw i;if(!this.hasWarnedAboutMaps.has(e)){let o=Qd(e.metadata.compiledPath,i.message).error;this.dap.output({output:o.format+`
`,category:"stderr"}),this.hasWarnedAboutMaps.add(e)}return n()}}dispose(){}async parseSourceMapDirect(e,t){let n=We(t);n&&(n=this.pathResolve.rebaseRemoteToLocal(n));let i=await e.fetch(n||t);if(!i.ok)throw i.error;let o=i.body;return o.slice(0,3)===")]}"&&(o=o.substring(o.indexOf(`
`))),JSON.parse(o)}};Xu=E([(0,On.injectable)(),g(0,(0,On.inject)(Se)),g(1,(0,On.inject)(Ea)),g(2,(0,On.inject)(U))],Xu);var Xi=class extends Xu{constructor(){super(...arguments);this.knownMaps=new Mn(t=>t.toLowerCase())}load(t,n){let i=this.knownMaps.get(n.sourceMapUrl);if(!i)return this.loadNewSourceMap(t,n);let o=n.cacheKey,s=i.metadata.cacheKey;return i.reloadIfNoMtime?o&&s&&o===s?(i.reloadIfNoMtime=!1,i.prom):this.loadNewSourceMap(t,n):s&&o&&o!==s?this.loadNewSourceMap(t,n):i.prom}loadNewSourceMap(t,n){let i=super.load(t,n);return this.knownMaps.set(n.sourceMapUrl,{metadata:n,reloadIfNoMtime:!1,prom:i}),i}dispose(){this.knownMaps.clear()}invalidateCache(){for(let t of this.knownMaps.values())t.reloadIfNoMtime=!0}};Xi=E([(0,On.injectable)()],Xi);var zi=Symbol("IRenameProvider"),xa=class{constructor(e,t,n){this.logger=e;this.sourceMapFactory=t;this.launchConfig=n;this.renames=new Map}provideOnStackframe(e){if(!this.launchConfig.sourceMapRenames)return xr.None;let t=e.uiLocation();return t===void 0?xr.None:"then"in t?t.then(n=>this.provideForSource(n?.source)):this.provideForSource(t?.source)}provideForSource(e){if(!this.launchConfig.sourceMapRenames||!(e instanceof Je))return xr.None;let t=ma(e.compiledToSourceUrl.keys());if(!t)throw new Error("unreachable");if(!Xo(t))return xr.None;let n=this.renames.get(t.url);if(n)return n;let i=this.sourceMapFactory.load(t.sourceMap.metadata).then(async o=>{if(!o?.hasNames)return xr.None;let s=await t.content();return s?await this.createFromSourceMap(o,s):xr.None}).catch(()=>xr.None);return this.renames.set(t.url,i),i}async createFromSourceMap(e,t){let n=Date.now(),i;try{i=await ax(t,e)}catch(s){return this.logger.info("runtime",`Error parsing content for source tree: ${s}}`,{url:e.metadata.compiledPath}),xr.None}let o=Date.now();return this.logger.info("runtime",`renames calculated in ${o-n}ms`,{url:e.metadata.compiledPath}),new xr(i)}};xa=E([(0,Pa.injectable)(),g(0,(0,Pa.inject)(U)),g(1,(0,Pa.inject)(Nn)),g(2,(0,Pa.inject)(de))],xa);var xr=class r{constructor(e){this.renames=e}static{this.None=new r(new wa(nr.ZERO))}getOriginalName(e,t){return this.getClosestRename(t,n=>n.compiled===e)?.original}getCompiledName(e,t){return this.getClosestRename(t,n=>n.original===e)?.compiled}getClosestRename(e,t){return this.renames.findDeepest(e,n=>n.data?.find(t))}};var La=Symbol("IContainer"),Bn=Symbol("StoragePath"),Ct=Symbol("IInitializeParams"),Fn=Symbol("VSCodeApi"),Qo=Symbol("IsVSCode"),Sx=Symbol("ExtensionContext"),Ey=Symbol("ProcessEnv"),xy=Symbol("execa"),$e=Symbol("FS"),Hi="ExtensionLocation",Zo=Symbol("IBrowserFinder"),KZ=Symbol("DwarfDebugging"),Ex=Symbol("SessionSubStates"),Sy=new WeakMap,Ye=(r,e)=>{if(!(typeof e=="object"&&e&&"dispose"in e))return e;let t=e,n=Sy.get(r.container);return n?n.push(t):Sy.set(r.container,[t]),e},ef=r=>{Sy.get(r)?.forEach(e=>e.dispose())},XZ=Symbol("IExtensionContribution"),zZ=Symbol("IDebugTerminalOptionsProviders");var Dt=Symbol("ITelemetryReporter");var xx=_(q());var Ji=Symbol("IShutdownParticipants"),$a=class{constructor(){this.participants=[]}register(e,t){if(this.shutdownStage!==void 0&&this.shutdownStage>=e)return t(!0),Ys;for(;this.participants.length<=e;)this.participants.push(new Set);return this.participants[e].add(t),{dispose:()=>this.participants[e].delete(t)}}async shutdownContext(){(this.shutdownStage===void 0||this.shutdownStage<0)&&await Promise.all([...this.participants[0]].map(e=>e(!1)))}async shutdownAll(){for(this.shutdownStage=0;this.shutdownStage<this.participants.length;this.shutdownStage++)await Promise.all([...this.participants[this.shutdownStage]].map(e=>e(!0)))}};$a=E([(0,xx.injectable)()],$a);var Xn=_(q());var tf=class{constructor(e=!1,t=!1){this.verified=e;this.hit=t}},rf=class{constructor(){this._statisticsById=new Map}registerBreakpoints(e){e.forEach(t=>{t.id!==void 0&&!this._statisticsById.has(t.id)&&this._statisticsById.set(t.id,new tf(t.verified,!1))})}registerResolvedBreakpoint(e){this.getStatistics(e).verified=!0}registerBreakpointHit(e){this.getStatistics(e).hit=!0}getStatistics(e){let t=this._statisticsById.get(e);if(t!==void 0)return t;{let n=new tf;return this._statisticsById.set(e,n),n}}statistics(){let e=0,t=0,n=0;for(let i of this._statisticsById.values())e++,i.hit&&n++,i.verified&&t++;return{set:e,verified:t,hit:n}}};var nf=async(r,e,t,n={})=>{let i=Date.now();try{return await t()}finally{r.verbose("perf.function","",{method:e,duration:Date.now()-i,...n})}};var Ju=H("fs"),ht=_(q()),of=_(H("path"));var es=_(q()),zu=_(H("path"));var Ca=class{get empty(){return this.patterns.length===0}constructor({rootPath:e,patterns:t}){!e||!t?(this.rootPath="",this.patterns=[]):(this.rootPath=e,this.patterns=t.map(n=>{let i=n.startsWith("!");return{negated:i,pattern:n.slice(i?1:0)}}))}*explode(){for(let e=0;e<this.patterns.length;e++){let{negated:t,pattern:n}=this.patterns[e];if(t)continue;let i=zu.resolve(this.rootPath,n).split(/[\\/]/g),o=i.findIndex(c=>c.includes("*"));if(o===-1){yield{cwd:i.slice(0,-1).join("/"),pattern:i[i.length-1],negations:[]};continue}let s=i.slice(0,o).join("/"),a=[];for(let c=e+1;c<this.patterns.length;c++){let{negated:u,pattern:l}=this.patterns[c];if(u)if(l.startsWith("**"))a.push(Oe(l));else{let p=zu.relative(s,zu.resolve(this.rootPath,l));p.startsWith("..")||a.push(Oe(p))}}yield{cwd:s,negations:a,pattern:i.slice(o).join("/")}}}};Ca=E([(0,es.injectable)()],Ca);var Un=class extends Ca{constructor({rootPath:e,outFiles:t}){super({rootPath:e,patterns:t})}};Un=E([(0,es.injectable)(),g(0,(0,es.inject)(de))],Un);var gi=class extends Ca{constructor(e){super({rootPath:e.rootPath,patterns:"vueComponentPaths"in e?e.vueComponentPaths:[]})}};gi=E([(0,es.injectable)(),g(0,(0,es.inject)(de))],gi);var Px=H("path");var Da=Symbol("ISearchStrategy"),fee=Symbol("ISearchStrategyFallback"),Lx=async(r,e,t)=>{let n,o=`${(0,Px.basename)(r)}.map`;if(e.siblings.includes(o)&&(n=o),n||(typeof t>"u"&&(t=await Pw(r)),n=Ia(t)),!(!n||(At(n)||(n=Wi(He(r),n)),!n))&&!(!n.startsWith("data:")&&!n.startsWith("file://")))return{compiledPath:r,sourceMapUrl:n,cacheKey:e.mtime}};var Py=Symbol("InlineSourceMapUrl"),$x=10*1e3,ts=class{constructor(e){e.__workspaceCachePath&&(this.path=of.join(e.__workspaceCachePath,"bp-predict.json"))}async load(){if(this.value||!this.path)return this.value;try{this.value=JSON.parse(await Ju.promises.readFile(this.path,"utf-8"))}catch{}return this.value}async store(e){this.value=e,this.path&&(await Ju.promises.mkdir(of.dirname(this.path),{recursive:!0}),await Ju.promises.writeFile(this.path,JSON.stringify(e)))}};ts=E([(0,ht.injectable)(),g(0,(0,ht.inject)(de))],ts);var Wn=class{constructor(e,t,n,i,o,s){this.outFiles=e;this.repo=t;this.logger=n;this.sourceMapFactory=i;this.sourcePathResolver=o;this.state=s}async createMapping(e){if(this.outFiles.empty)return new Map;let t=Go(),n=await this.state.load();try{let{state:i}=await this.repo.streamChildrenWithSourcemaps({files:this.outFiles,processMap:async o=>{let s=[],a=await this.sourceMapFactory.load(o);for(let c of a.sources){if(c===null)continue;let u=this.sourcePathResolver?await this.sourcePathResolver.urlToAbsolutePath({url:c,map:a}):We(c);u&&s.push({...o,sourceMapUrl:At(o.sourceMapUrl)?{[Py]:o.sourceMapUrl}:o.sourceMapUrl,resolvedPath:u,sourceUrl:c})}return{discovered:s,compiledPath:Xe(o.compiledPath)}},onProcessedMap:({discovered:o})=>{for(let s of o){let a=t.get(s.resolvedPath);a||(a=new Set,t.set(s.resolvedPath,a)),a.add(s)}},lastState:n,...e});i&&this.state.store(i).catch(o=>this.logger.warn("runtime.exception","Error saving sourcemap cache",{error:o}))}catch(i){this.logger.warn("runtime.exception","Error reading sourcemaps from disk",{error:i})}return t}};Wn=E([(0,ht.injectable)(),g(0,(0,ht.inject)(Un)),g(1,(0,ht.inject)(Da)),g(2,(0,ht.inject)(U)),g(3,(0,ht.inject)(Nn)),g(4,(0,ht.inject)(Se)),g(5,(0,ht.inject)(ts))],Wn);var Ta=class extends Wn{async getMetadataForPaths(e){this.sourcePathToCompiled||(this.sourcePathToCompiled=this.createInitialMapping());let t=await this.sourcePathToCompiled;return e.map(n=>t.get(n))}async createInitialMapping(){return nf(this.logger,"BreakpointsPredictor.createInitialMapping",()=>this.createMapping())}};Ta=E([(0,ht.injectable)()],Ta);var Ma=class extends Wn{constructor(){super(...arguments);this.sourcePathToCompiled=new Map}async getMetadataForPaths(t){let n=t.map(s=>this.sourcePathToCompiled.get(s)),i=t.map((s,a)=>a).filter(s=>!n[s]);if(i.length){let s=new Set(i.map(c=>Xe(t[c]))),a=this.createMapping({filter:(c,u)=>!u||u.discovered.some(l=>s.has(l.resolvedPath))});for(let c of i)this.sourcePathToCompiled.set(t[c],a),n[c]=a}return await Promise.all(n.map(async(s,a)=>(await s).get(t[a])))}};Ma=E([(0,ht.injectable)()],Ma);var ns=Symbol("IBreakpointsPredictor"),rs=class{constructor(e,t,n,i){this.bpSearch=e;this.outFiles=t;this.logger=n;this.sourceMapFactory=i;this.predictedLocations=new Map;this.longParseEmitter=new C;this.targetedMode=!1;this.onLongParse=this.longParseEmitter.event}async predictBreakpoints(e){if(!e.source.path||!e.breakpoints?.length)return;let t=await this.getMetadataForPaths([e.source.path]).then(i=>i[0]);if(!t)return;let n=async(i,o,s)=>{let a=typeof s.sourceMapUrl=="string"?s.sourceMapUrl:s.sourceMapUrl.hasOwnProperty(Py)?s.sourceMapUrl[Py]:await Ju.promises.readFile(s.compiledPath,"utf8").then(Ia);if(!a)return[];let c=await this.sourceMapFactory.load({...s,sourceMapUrl:a}),u=this.sourceMapFactory.guardSourceMapFn(c,()=>qd(s.sourceUrl,{lineNumber:i,columnNumber:o||1},c),()=>null);if(!u||u.line===null)return[];let l=await this.getMetadataForPaths([s.compiledPath]).then(p=>p[0]);return l?(await Promise.all([...l].map(d=>n(u.line,u.column,d)))).flat():[{absolutePath:s.compiledPath,lineNumber:u.line||1,columnNumber:u.column?u.column+1:1}]};for(let i of e.breakpoints??[]){let o=`${e.source.path}:${i.line}:${i.column||1}`;if(this.predictedLocations.has(o))return;let s=[];this.predictedLocations.set(o,s);for(let a of t)s.push(...await n(i.line,i.column||0,a))}}async getPredictionForSource(e){return this.getMetadataForPaths([e]).then(t=>t[0])}async getMetadataForPaths(e){let t=setTimeout(()=>{this.longParseEmitter.fire(),this.logger.warn("runtime.sourcemap","Long breakpoint predictor runtime",{longPredictionWarning:$x,patterns:[...this.outFiles.explode()].join(", ")})},$x),n=await this.bpSearch.getMetadataForPaths(e);return clearTimeout(t),n}predictedResolvedLocations(e){let t=`${e.absolutePath}:${e.lineNumber}:${e.columnNumber||1}`;return this.predictedLocations.get(t)??[]}};rs=E([(0,ht.injectable)(),g(0,(0,ht.inject)(Wn)),g(1,(0,ht.inject)(Un)),g(2,(0,ht.inject)(U)),g(3,(0,ht.inject)(Nn))],rs);var Ba=_(q());var Dx=H("crypto"),ka=_(q());var GV=0,Be=Symbol("ICdpApi"),is=class extends Error{constructor(t){super("<<message>>");this.method=t}setCause(t,n){return this.cause={code:t,message:n},this.message=`CDP error ${t} calling method ${this.method}: ${n}`,this.stack=this.stack?.replace("<<message>>",this.message),this}},it=class{constructor(e,t,n){this.logger=t;this.telemetryReporter=n;this._connectionId=GV++;this._lastId=1e3;this._disposedSessions=new Map;this._onDisconnectedEmitter=new C;this.waitWrapper=XV();this.onDisconnected=this._onDisconnectedEmitter.event;this._transport=e,this._transport.onMessage(([i,o])=>this._onMessage(i,o)),this._transport.onEnd(()=>this._onTransportClose()),this._sessions=new Map,this._closed=!1,this._rootSession=new sf(this,"",this.logger),this._sessions.set("",this._rootSession)}rootSession(){return this._rootSession.cdp()}_send(e,t={},n){let i=++this._lastId,o={id:i,method:e,params:t};n&&(o.sessionId=n);let s=JSON.stringify(o);return this.logger.verbose("cdp.send",void 0,{connectionId:this._connectionId,message:o}),this._transport.send(s),i}_onMessage(e,t){let n=JSON.parse(e),i=n;n.result&&n.result.scriptSource?i={...n,result:{...n.result,scriptSource:"<script source>"}}:n.method==="Debugger.scriptParsed"&&n.params&&At(n.params.sourceMapURL)&&(i={...n,params:{...n.params,sourceMapURL:"<data source map url>"}}),this.logger.verbose("cdp.receive",void 0,{connectionId:this._connectionId,message:i});let o=this._sessions.get(n.sessionId||"");if(!o){let c=this._disposedSessions.get(n.sessionId);if(c){let u=(Date.now()-c.getTime())/1e3;this.logger.warn("internal",`Got message for a session disposed ${u} seconds ago`,{sessionId:n.sessionId,disposeOn:c});return}else throw new Error(`Unknown session id: ${n.sessionId} while processing: ${n.method}`)}let s=n.method,a;try{o._onMessage(n)}catch(c){a=c}s&&this.telemetryReporter.reportOperation("cdpOperation",s,t.elapsed().ms,a)}_onTransportClose(){if(!this._closed){this._closed=!0,this._transport.dispose(),this.logger.info("cdp.receive","Connection closed",{connectionId:this._connectionId});for(let e of this._sessions.values())e._onClose();this._sessions.clear(),this._onDisconnectedEmitter.fire()}}close(){this._onTransportClose()}isClosed(){return this._closed}createSession(e){let t=new sf(this,e,this.logger);return this._sessions.set(e,t),t.cdp()}disposeSession(e){let t=this._sessions.get(e);t&&(t._onClose(),this._disposedSessions.set(t.sessionId(),new Date),this._sessions.delete(t.sessionId()))}},KV=+process.version.substring(1).split(".")[0]<11,sf=class{constructor(e,t,n){this.logger=n;this._queue=[];this._prefixListeners=new Mu;this._directListeners=new Mu;this.paused=!1;this._callbacks=new Map,this._connection=e,this._sessionId=t,this._cdp=this._createApi()}pause(){this.paused=!0}resume(){if(!this.paused)return;this.paused=!1;let e=this._queue;this._queue=[],this.logger.verbose("cdp.receive","Dequeue messages",{message:e});for(let t of e)this._processResponse(t)}cdp(){return this._cdp}sessionId(){return this._sessionId}_createApi(){return new Proxy({},{get:(e,t)=>t==="pause"?()=>this.pause():t==="resume"?()=>this.resume():t==="session"?this:new Proxy({},{get:(n,i)=>{if(i!=="then")return i==="on"?(o,s)=>this.on(`${t}.${o}`,s):o=>this.send(`${t}.${i}`,o)}})})}on(e,t){return this._directListeners.listen(e,t)}onPrefix(e,t){return this._prefixListeners.listen(e,t)}send(e,t={}){return this.sendOrDie(e,t).catch(()=>{})}sendOrDie(e,t={}){if(!this._connection)return Promise.reject(new is(e).setCause(0,"Connection is closed"));let n=this._connection._send(e,t,this._sessionId);return new Promise((i,o)=>{this._callbacks.set(n,{resolve:i,reject:o,from:new is(e),method:e})})}_onMessage(e){if(this.paused&&e.id){this._processResponse(e);return}if(this._queue.length>0){this._queue.push(e);return}if(!KV&&!this.paused){this._processResponse(e);return}this._queue.push(e),this.paused||this._processQueue()}_processQueue(){this._connection?.waitWrapper(()=>{if(this.paused)return;let e=this._queue.shift();e&&(this._processResponse(e),this._queue.length&&this._processQueue())})}_processResponse(e){if(e.id===void 0){let n=e;this._directListeners.emit(n.method,n.params);for(let[i,o]of this._prefixListeners.listeners)n.method.startsWith(i)&&o.fire(n);return}let t=this._callbacks.get(e.id);t&&(this._callbacks.delete(e.id),"error"in e?t.reject(t.from.setCause(e.error.code,e.error.message)):"result"in e&&t.resolve(e.result))}async detach(){if(!this._connection)throw new Error("Session already detached. Most likely the target has been closed.");this._connection._send("Target.detachFromTarget",{},this._sessionId)}isClosed(){return!this._connection}_onClose(){for(let e of this._callbacks.values())e.reject(e.from.setCause(0,"Connection is closed"));this._callbacks.clear(),this._connection=void 0}};function XV(){if(parseInt(process.versions.node,10)>=11)return setImmediate;let r=!1,e=[],t=()=>{let n=e.shift();if(!n){r=!1;return}setImmediate(t),n()};return n=>{e.push(n),r||(r=!0,setImmediate(t))}}var yi="$returnValue",zV="__js_debug_hoisted_",Cx=()=>zV+(0,Dx.randomBytes)(8).toString("hex"),Pr=Symbol("IEvaluator"),Ra=class{constructor(e,t,n){this.cdp=e;this.renameProvider=t;this.logger=n}get hasReturnValue(){return!!this.returnValue}setReturnedValue(e){this.returnValue=e}prepare(e,{isInternalScript:t,hoist:n,renames:i}={}){t!==!1&&(e+=Ne());let o=new Map;o.set(yi,Cx());for(let c of n??[])o.set(c,Cx());let{transformed:s,hoisted:a}=this.replaceVariableInExpression(e,o,i);return a.size?{canEvaluateDirectly:!1,invoke:(c,u)=>Promise.all([...o].map(async([l,p])=>{await this.hoistValue(l===yi?this.returnValue:await u?.(l),p)||(s=s.replaceAll(p,l))})).then(()=>this.cdp.Debugger.evaluateOnCallFrame({...c,expression:s}))}:{canEvaluateDirectly:!0,invoke:c=>this.cdp.Debugger.evaluateOnCallFrame({...c,expression:s})}}async evaluate(e,t={}){if(!("callFrameId"in e))return this.cdp.Runtime.evaluate(e);let n={...t},{location:i,stackFrame:o}=t,s;if(i)await Promise.all([Promise.resolve(this.renameProvider.provideForSource(i.source)).then(a=>{n.renames={mapping:a,position:i.position}}),o&&this.setupShadowedVariableHoisting(i,o).then(a=>{a&&(s=a.doHoist,n.hoist=[...a.hoistable])})]);else if(o){let a=await this.renameProvider.provideOnStackframe(o);n.renames={mapping:a,position:o.rawPosition}}return this.prepare(e.expression,n).invoke(e,s)}async hoistValue(e,t){if(e===void 0)return!1;let n=e?.objectId,i=`setTimeout(() => { delete globalThis.${t} }, 0)`,o;return n?o=await this.cdp.Runtime.callFunctionOn({objectId:n,functionDeclaration:`function() { globalThis.${t} = this; ${i}; ${Ne()} }`}):o=await this.cdp.Runtime.evaluate({expression:`globalThis.${t} = ${JSON.stringify(e?.value)};${i};`+Ne()}),!!o&&!o.exceptionDetails}async setupShadowedVariableHoisting({position:e,source:t,variables:n},i){let{scopes:o}=await i.scopes(),s=await eA(o,async u=>u.source&&u.line&&u.endLine&&new nr(new ke(u.line,u.column||1),new ke(u.endLine,u.endColumn||1/0)).contains(e)&&await t.equalsDap(u.source));if(s===-1)return;this.logger.verbose("runtime",`Evaluating expression in scope ${o[s].name}`);let a=new Set;return await Promise.all(o.slice(0,s).map(async u=>{let l=await n.getVariableNames({variablesReference:u.variablesReference});for(let{name:p}of l)a.add(p)})),{hoistable:a,doHoist:async u=>{for(let l=s;l<o.length;l++)return(await n.getVariableNames({variablesReference:o[l].variablesReference})).find(d=>d.name===u)?.remoteObject}}}replaceVariableInExpression(e,t,n){let i=new Set,o=!1,s=(p,d)=>({type:"ConditionalExpression",test:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:!0,argument:{type:"Identifier",name:p}},operator:"!==",right:{type:"Literal",value:"undefined"}},consequent:{type:"Identifier",name:p},alternate:d}),a=[],c=Tn(e),u=Dd(c,{enter(p,d){let f=p;if(p.type!=="Identifier"||e[f.start-1]===".")return;let h=t.get(p.name);if(h)return i.add(p.name),o=!0,{replace:fy(p,d)?{type:"Identifier",name:h}:s(h,JV)};let m=n?.mapping.getCompiledName(p.name,n.position);if(m)return o=!0,{replace:fy(p,d)?{type:"Identifier",name:m}:s(m,p)}},leave:()=>{a.pop()}});if(!o)return{hoisted:i,transformed:e};let l=c.body[c.body.length-1].end;return{hoisted:i,transformed:fi(u)+e.slice(l)}}};Ra=E([(0,ka.injectable)(),g(0,(0,ka.inject)(Be)),g(1,(0,ka.inject)(zi)),g(2,(0,ka.inject)(U))],Ra);var JV={type:"Identifier",name:"undefined"};var af=class r{static parse(e,t,n,i){t=Ly(t,n);let o=t&&Gi(t);if(o)throw new T(Ki(e,o.message));let{canEvaluateDirectly:s,invoke:a}=i.prepare(t);return new r(s?t:a)}constructor(e){typeof e=="function"?this.invoke=e:this.breakCondition=e}async shouldStayPaused(e){return this.invoke?(await this.invoke({callFrameId:e.callFrames[0].callFrameId,returnByValue:!0}))?.result.value===!0:Promise.resolve(!0)}},Ly=(r,e)=>`(()=>{try{return ${r};}catch(e){console.error(\`Breakpoint condition error: \${e.message||e}\`);return ${!!e}}})()`;var YV=/^(>|>=|={1,3}|<|<=|%)?\s*([0-9]+)$/,Oa=class r{constructor(e){this.predicate=e;this.hits=0;this.breakCondition=void 0}shouldStayPaused(){return Promise.resolve(this.predicate(++this.hits))}static parse(e){let t=YV.exec(e);if(!t)throw new T(Iy(e));let[,n="=",i]=t;return new r(QV(e,n,Number(i)))}},QV=(r,e,t)=>{switch(e){case"=":case"==":case"===":return n=>n===t;case">":return n=>n>t;case">=":return n=>n>=t;case"<":return n=>n<t;case"<=":return n=>n<=t;case"%":return n=>n%t===0;default:throw new T(Iy(r))}};var Tx=H("crypto"),uf=_(q());var cf=class{constructor(e){this.invoke=e;this.breakCondition=void 0}async shouldStayPaused(e){return await this.invoke({callFrameId:e.callFrames[0].callFrameId}),!1}};var os=class{constructor(e,t){this.breakCondition=t;let n=t&&Gi(t);if(n)throw new T(Ki(e,n.message))}shouldStayPaused(){return Promise.resolve(!0)}};var Yi=class{constructor(e){this.evaluator=e}compile(e,t){let n=this.logMessageToExpression(t),i=Gi(n);if(i)throw new T(Ki(e,i.message));let{canEvaluateDirectly:o,invoke:s}=this.evaluator.prepare(n);return o?new os(e,this.logMessageToExpression(t)):new cf(s)}serializeLogStatements(e){return S0([],e,!1)}logMessageToExpression(e){let t=u=>u.replace(/%/g,"%%"),n=[],i=[],o=0;for(;;){let u=e.indexOf("{",o);if(u===-1){n.push(t(e.slice(o)));break}n.push(t(e.slice(o,u)));let[l]=Tu(e.slice(u));if(o=u+l.end,o-1===u+1||e[o-1]!=="}"){n.push(t(e.slice(u,o)));continue}if(l.type!=="BlockStatement")break;l.body.length===1&&l.body[0].type==="BlockStatement"&&(l.body=Tu(`(${e.slice(u+1,o-2)}})`)),i.push(fi(this.serializeLogStatements(l.body))),n.push("%O")}let a=`console.log(${[JSON.stringify(n.join("")),...i].join(", ")}), false`,c=(0,Tx.createHash)("sha256").update(a).digest("hex").slice(0,7);return a+`
//# sourceURL=logpoint-${c}.cdp`}};Yi=E([(0,uf.injectable)(),g(0,(0,uf.inject)(Pr))],Yi);var ZV=new os({line:0},void 0),vte=new os({line:0},"false"),lf=Symbol("IBreakpointConditionFactory"),Na=class{constructor(e,t,n){this.logPointCompiler=e;this.evaluator=t;this.breakOnError=n.__breakOnConditionalError}getConditionFor(e){return e.condition?af.parse(e,e.condition,this.breakOnError,this.evaluator):e.logMessage?this.logPointCompiler.compile(e,e.logMessage):e.hitCondition?Oa.parse(e.hitCondition):ZV}};Na=E([(0,Ba.injectable)(),g(0,(0,Ba.inject)(Yi)),g(1,(0,Ba.inject)(Pr)),g(2,(0,Ba.inject)(de))],Na);var ff=H("path");var pf=(r,e)=>r.lineNumber===e.lineNumber&&r.columnNumber===e.columnNumber;var df=r=>!("location"in r),Mx=r=>"location"in r,eq=(r,e)=>r.url&&e===r.url||r.urlRegex&&new RegExp(r.urlRegex).test(e),Fa=class{constructor(e,t,n){this._manager=e;this._source=t;this._originalPosition=n;this.isEnabled=!1;this.setInCdpScriptIds=new Set;this.cdpScriptIds=this.setInCdpScriptIds;this.cdpBreakpoints=[];this._cdpIds=new Set}get enabled(){return this.isEnabled}get cdpIds(){return this._cdpIds}get source(){return this._source}get originalPosition(){return this._originalPosition}async updateSourceLocation(e,t,n){this._source=t,this._originalPosition=n;let i=[];for(let o of this.cdpBreakpoints)o.state===1&&i.push(this.updateUiLocations(e,o.cdpId,o.locations));await Promise.all(i)}async refreshUiLocations(e){await Promise.all(this.cdpBreakpoints.filter(t=>t.state===1).map(t=>this.updateUiLocations(e,t.cdpId,t.locations)))}async enable(e){if(this.isEnabled)return;this.isEnabled=!0;let t=[this._setPredicted(e)],n=this._manager._sourceContainer.source(this.source);if((!n||!(n instanceof Je))&&t.push(this._setByPath(e,n?.offsetSourceToScript(this.originalPosition)||this.originalPosition)),await Promise.all(t),n&&this.isEnabled){let i=await this._manager._sourceContainer.currentSiblingUiLocations({lineNumber:this.originalPosition.lineNumber,columnNumber:this.originalPosition.columnNumber,source:n});await Promise.all(i.map(o=>this._setByUiLocation(e,n.offsetSourceToScript(o))))}}async updateUiLocations(e,t,n){this.updateExistingCdpRef(t,a=>({...a,locations:n}));let i=(await Promise.all(n.map(a=>e.rawLocationToUiLocation(e.rawLocation(a))))).find(a=>!!a);if(!i)return;let o=this._manager._sourceContainer.source(this.source);if(!o)return;let s=await this._manager._sourceContainer.currentSiblingUiLocations(i);this.updateExistingCdpRef(t,a=>{let c=s.filter(u=>u.source===o);return{...a,locations:n,uiLocations:c.length?c:s}})}compare(e){let t=this.originalPosition,n=e.originalPosition;return t.lineNumber!==n.lineNumber?t.lineNumber-n.lineNumber:t.columnNumber-n.columnNumber}async disable(){if(!this.isEnabled)return;this.isEnabled=!1;let e=this.cdpBreakpoints.map(t=>this.removeCdpBreakpoint(t));await Promise.all(e)}async updateForNewLocations(e,t){let n=this._manager._sourceContainer.source(this.source);if(!n)return[];let i=await this._manager._sourceContainer.currentSiblingUiLocations({lineNumber:this.originalPosition.lineNumber,columnNumber:this.originalPosition.columnNumber,source:n},await t.source);if(!i.length)return[];let o=[];for(let s of i)o.push(this._setForSpecific(e,t,n.offsetSourceToScript(s)));for(let s of this.cdpBreakpoints){if(!df(s.args)||!eq(s.args,t.url))continue;let a=s.args;i.some(c=>c.columnNumber-1===a.columnNumber&&c.lineNumber-1===a.lineNumber)||(this._manager.logger.verbose("runtime.sourcemap","Adjusted breakpoint due to overlaid sourcemap",{url:n.url}),o.push(this.removeCdpBreakpoint(s)))}return await Promise.all(o),i}executionContextWasCleared(){this.updateCdpRefs(e=>e.filter(t=>df(t.args)))}hasResolvedAt(e,t){let{lineNumber:n,columnNumber:i}=t.base0;return this.cdpBreakpoints.some(o=>o.state===1&&o.locations.some(s=>s.scriptId===e&&s.lineNumber===n&&(s.columnNumber===void 0||s.columnNumber===i)))}getBreakCondition(){}updateExistingCdpRef(e,t){this.updateCdpRefs(n=>n.map(i=>i.state!==1||i.cdpId!==e?i:t(i)))}updateCdpRefs(e){let t=this;t.cdpBreakpoints=e(this.cdpBreakpoints);let n=new Set;this.setInCdpScriptIds.clear();for(let i of this.cdpBreakpoints)if(i.state===1){n.add(i.cdpId);for(let o of i.locations)this.setInCdpScriptIds.add(o.scriptId)}this._cdpIds=n}async _setPredicted(e){if(!this.source.path||!this._manager._breakpointsPredictor)return;let t=this._manager._breakpointsPredictor.predictedResolvedLocations({absolutePath:this.source.path,lineNumber:this.originalPosition.lineNumber,columnNumber:this.originalPosition.columnNumber}),n=[];for(let i of t){let o=this._manager._sourceContainer.sourcePathResolver.absolutePathToUrlRegexp(i.absolutePath);o!==void 0&&(typeof o=="string"?n.push(this._setByUrlRegexp(e,o,i)):n.push(o.then(s=>s?this._setByUrlRegexp(e,s,i):void 0)))}await Promise.all(n)}async _setByUiLocation(e,t){await Promise.all(t.source.scripts.map(n=>this._setForSpecific(e,n,t)))}async _setByPath(e,t){let n=this._manager._sourceContainer.source({path:this.source.path});if(!(n instanceof Je&&[...n.compiledToSourceUrl.keys()].some(o=>o.absolutePath===this.source.path)))if(this.source.path){let i=await this._manager._sourceContainer.sourcePathResolver.absolutePathToUrlRegexp(this.source.path);if(!i)return;await this._setByUrlRegexp(e,i,t)}else{let o=this._manager._sourceContainer.source(this.source)?.url;if(!o)return;await this._setByUrl(e,o,t),this.source.path!==o&&this.source.path!==void 0&&await this._setByUrl(e,He(this.source.path),t)}}hasSetOnLocation(e,t){return this.cdpBreakpoints.find(n=>e.scriptId&&Mx(n.args)&&n.args.location.scriptId===e.scriptId&&pf(n.args.location,t)||e.url&&!e.hasSourceURL&&df(n.args)&&(n.args.urlRegex?new RegExp(n.args.urlRegex).test(e.url):e.url===n.args.url)&&pf(n.args,t))}hasSetOnLocationByUrl(e,t,n){return this.cdpBreakpoints.find(i=>{if(df(i.args))return pf(i.args,n)?e==="url"?i.args.urlRegex?new RegExp(i.args.urlRegex).test(t):i.args.url===t:e==="re"&&i.args.urlRegex===t:!1;let o=this._manager._sourceContainer.getScriptById(i.args.location.scriptId);if(o)return pf(i.args.location,n)&&e==="re"?new RegExp(t).test(o.url):o.url===t})}async _setForSpecific(e,t,n){return t.url&&!t.hasSourceURL&&(!t.embedderName||t.embedderName===t.url)?this._setByUrl(e,t.url,n):this._setByScriptId(e,t,n)}async _setByUrl(e,t,n){n=mi(n);let i=this.hasSetOnLocationByUrl("url",t,n);if(i){i.state===0&&await i.done;return}return this._setAny(e,{url:t,condition:this.getBreakCondition(),...n})}async _setByUrlRegexp(e,t,n){n=mi(n);let i=this.hasSetOnLocationByUrl("re",t,n);if(i){i.state===0&&await i.done;return}return this._setAny(e,{urlRegex:t,condition:this.getBreakCondition(),...n})}async _setByScriptId(e,t,n){n=mi(n);let i=this.hasSetOnLocation(t,n);if(i){i.state===0&&await i.done;return}return this._setAny(e,{condition:this.getBreakCondition(),location:{scriptId:t.scriptId,...n}})}async _setAny(e,t){if(!this.isEnabled)return;let n={state:0,args:t,deadletter:!1};n.done=(async()=>{let i=Mx(t)?await e.cdp().Debugger.setBreakpoint(t):await e.cdp().Debugger.setBreakpointByUrl(t);if(!i)return;if(n.deadletter){await e.cdp().Debugger.removeBreakpoint({breakpointId:i.breakpointId});return}let o="actualLocation"in i?[i.actualLocation]:i.locations;this._manager._resolvedBreakpoints.set(i.breakpointId,this);let s={state:1,cdpId:i.breakpointId,args:t,locations:o,uiLocations:[]};return this.updateCdpRefs(a=>a.map(c=>c===n?s:c)),await this.updateUiLocations(e,i.breakpointId,o),s})(),this.updateCdpRefs(i=>[...i,n]),await n.done}async removeCdpBreakpoint(e){this.updateCdpRefs(t=>t.filter(n=>n!==e)),e.state===0?(e.deadletter=!0,await e.done):(await this._manager._thread?.cdp().Debugger.removeBreakpoint({breakpointId:e.cdpId}),this._manager._resolvedBreakpoints.delete(e.cdpId))}};var jn=class r extends Fa{constructor(t,n,i){super(t,n,{lineNumber:1,columnNumber:1});this.mode=i}static getModeKeyForSource(t,n){return t===1?(0,ff.basename)(n,(0,ff.extname)(n)||void 0):n}_setPredicted(){return Promise.resolve()}_setByPath(t,n){if(!this.source.path)return Promise.resolve();let i=r.getModeKeyForSource(this.mode,this.source.path);return this.mode===1?super._setByUrlRegexp(t,Ut(i),n):super._setByPath(t,n)}};var kx=_(je());var Lr=class extends Fa{constructor(t,n,i,o,s){super(t,i,{lineNumber:o.line,columnNumber:o.column||1});this.dapId=n;this.dapParams=o;this.condition=s;this.completedSet=ge()}equivalentTo(t){return t.dapParams.column===this.dapParams.column&&t.dapParams.line===this.dapParams.line&&t.dapParams.hitCondition===this.dapParams.hitCondition&&t.dapParams.condition===this.dapParams.condition&&t.dapParams.logMessage===this.dapParams.logMessage}untilSetCompleted(){return this.completedSet.promise}markSetCompleted(){this.completedSet.resolve()}testHitCondition(t){return this.condition.shouldStayPaused(t)}async toDap(){let t=this.enabled&&this.getResolvedUiLocation();return t?{id:this.dapId,verified:!0,source:await t.source.toDap(),line:t.lineNumber,column:t.columnNumber}:{id:this.dapId,verified:!1,message:kx.t("Unbound breakpoint")}}diagnosticDump(){return{source:this.source,params:this.dapParams,cdp:this.cdpBreakpoints}}getBreakCondition(){return this.condition.breakCondition}updateCdpRefs(t){let n=this.getResolvedUiLocation();super.updateCdpRefs(t),this.getResolvedUiLocation()!==n&&this.notifyResolved()}getResolvedUiLocation(){for(let t of this.cdpBreakpoints)if(t.state===1&&t.uiLocations.length)return t.uiLocations[0]}async notifyResolved(){await this.completedSet.promise,await this._manager.notifyBreakpointChange(this,!0)}};var hf=class extends Lr{constructor(e,t,n,i){super(e,t,n,i,new Oa(()=>!1))}getResolvedUiLocation(){}};var jP=_(tl());var rl=class extends jn{constructor(t,n){super(t,{path:n},1);this.pattern=n}async enable(t){if(this.isEnabled)return;this.isEnabled=!0;let n=(0,jP.makeRe)(Oe(this.pattern),{contains:!0,lookbehinds:!1});await this._setAny(t,{urlRegex:n.source.replace(/([a-z]):/i,(i,o)=>`[${o.toLowerCase()}${o.toUpperCase()}]:`),lineNumber:0,columnNumber:0})}};var ja=_(q());var _f=Symbol("IExperimentationService");var H8=/\/node_modules\/|^node\:/,g8=2,VP=5e3,y8=VP/2,Fe=class{constructor(e,t,n){this.telemetry=t;this.experimentation=n;this.disposable=new Ae;this.hadBreakpoint=!1;this.didVerifyBreakpoint=!1;this.hadNonModuleSourcemap=!1;this.startedAt=Date.now();this.disposable.push(Fe.didVerifyEmitter.event(()=>{this.didVerifyBreakpoint=!0})),Fe.consecutiveQualifyingSessions>=g8&&this.disposable.push(Z_(async()=>{this.currentlyQualifying&&await this.experimentation.getTreatment("diagnosticPrompt",!0)&&(t.report("diagnosticPrompt",{event:"suggested"}),Fe.didSuggest=!0,e.suggestDiagnosticTool({}))},VP))}get currentlyQualifying(){return this.hadBreakpoint&&!this.didVerifyBreakpoint&&this.hadNonModuleSourcemap}notifyHadBreakpoint(){this.hadBreakpoint=!0}notifyVerifiedBreakpoint(){this.didVerifyBreakpoint||(Fe.didVerifyEmitter.fire(),Fe.didSuggest&&(Fe.didSuggest=!1,this.telemetry.report("diagnosticPrompt",{event:"resolved"})))}attach(e){if(!this.hadNonModuleSourcemap){let t=this.disposable.push(e.Debugger.on("scriptParsed",n=>{n.sourceMapURL&&!H8.test(n.url)&&(this.hadNonModuleSourcemap=!0,this.disposable.disposeObject(t))}))}}dispose(){this.currentlyQualifying&&Date.now()-y8>this.startedAt?Fe.consecutiveQualifyingSessions++:Fe.consecutiveQualifyingSessions=0,this.disposable.dispose()}};Fe.consecutiveQualifyingSessions=0,Fe.didVerifyEmitter=new C,Fe.didSuggest=!1,Fe=E([(0,ja.injectable)(),g(0,(0,ja.inject)(Ea)),g(1,(0,ja.inject)(Dt)),g(2,(0,ja.inject)(_f))],Fe);var Cr=_(q());function b8(r){let e=[];for(let t=0,n=r.length;t<n;++t){let i=r.charCodeAt(t);if(i<128)e.push(i);else if(i<2048)e.push(192|i>>6,128|i&63);else if(i<55296||i>=57344)e.push(224|i>>12,128|i>>6&63,128|i&63);else{let o=65536+((i&1023)<<10|r.charCodeAt(++t)&1023);e.push(240|o>>18&7,128|o>>12&63,128|o>>6&63,128|o&63)}}return new Uint8Array(e)}var qP=b8;var Va=2654435761,qa=2246822519,Af=3266489917,GP=668265263,KP=374761393;function Ky(r,e=0){r=typeof r=="string"?qP(r):r;let t=r,n=e+KP&4294967295,i=0;if(t.length>=16){let s=[e+Va+qa&4294967295,e+qa&4294967295,e+0&4294967295,e-Va&4294967295],a=r,c=a.length-16,u=0;for(i=0;(i&4294967280)<=c;i+=4){let l=i,p=a[l+0]+(a[l+1]<<8),d=a[l+2]+(a[l+3]<<8),f=p*qa+(d*qa<<16),h=s[u]+f&4294967295;h=h<<13|h>>>19;let m=h&65535,y=h>>>16;s[u]=m*Va+(y*Va<<16)&4294967295,u=u+1&3}n=(s[0]<<1|s[0]>>>31)+(s[1]<<7|s[1]>>>25)+(s[2]<<12|s[2]>>>20)+(s[3]<<18|s[3]>>>14)&4294967295}n=n+r.length&4294967295;let o=r.length-4;for(;i<=o;i+=4){let s=i,a=t[s+0]+(t[s+1]<<8),c=t[s+2]+(t[s+3]<<8),u=a*Af+(c*Af<<16);n=n+u&4294967295,n=n<<17|n>>>15,n=(n&65535)*GP+((n>>>16)*GP<<16)&4294967295}for(;i<t.length;++i){let s=t[i];n=n+s*KP,n=n<<11|n>>>21,n=(n&65535)*Va+((n>>>16)*Va<<16)&4294967295}return n=n^n>>>15,n=((n&65535)*qa&4294967295)+((n>>>16)*qa<<16),n=n^n>>>13,n=((n&65535)*Af&4294967295)+((n>>>16)*Af<<16),n=n^n>>>16,n<0?n+4294967296:n}var Sf=_(q());var XP=_(H("fs")),wf=_(H("path")),zP=r=>{let e={};f(e);function t(m,y){return r({category:"telemetry",output:m,data:y})}let n=m=>t("js-debug/dap/operation",{...e,...m}),i=m=>t("js-debug/cdp/operation",{...e,...m}),o=m=>t("js-debug/error",{...e,...m}),s=m=>t("blazor-debug/blazorDebugError",{...e,...m}),a=m=>{e.browser=(m.targetProject||m.targetProject)+"/"+m.targetVersion,t("js-debug/browserVersion",{...e,...m})},c=m=>t("js-debug/breakpointStats",{...e,...m}),u=m=>t("js-debug/statistics",{...e,...m}),l=m=>{e.nodeVersion=m.version,t("js-debug/nodeRuntime",{...e,...m})},p=m=>{t("js-debug/launch",{...e,...m,parameters:JSON.stringify(m.parameters)})},d=m=>{t("js-debug/diagnosticPrompt",{...e,...m})};function f(m){try{let y=wf.resolve(wf.dirname(__filename),"..","..",".gitcommit");m.jsDebugCommitId=XP.readFileSync(y,"utf8")}catch{}}return{breakpointStats:c,statistics:u,browserVersion:a,cdpOperation:i,dapOperation:n,error:o,launch:p,nodeRuntime:l,diagnosticPrompt:d,setGlobalMetric:(m,y)=>{e[m]=y},blazorDebugError:s}};var nl=class{constructor(e=!0){this.isVSCode=e;this.measurements=Object.create(null)}add(e,t,n){let i=this.measurements[e];i||(i=this.measurements[e]={times:[],errors:[]}),i.times.push(t),n&&i.errors.push(n)}flush(){let e={errors:[]};for(let t in this.measurements){let{times:n,errors:i}=this.measurements[t],o={operation:t,totalTime:0,max:0,avg:0,stddev:0,count:n.length,failed:i.length};for(let s of n)o.totalTime+=s,o.max=Math.max(o.max,s);o.avg=o.totalTime/o.count;for(let s of n)o.stddev+=(s-o.avg)**2;o.stddev=Math.sqrt(o.stddev/(n.length-1)),e[o.operation]=o,e[`!${o.operation}.errors`]=i,this.isVSCode||(e[`${o.operation}.errors`]=i)}return this.measurements=Object.create(null),e}};var Gn=class{constructor(e=!0){this.isVsCode=e;this.target=[];this.flushEmitter=new C;this.loggers=zP(e=>this.pushOutput(e));this.batchFlushTimeout={};this.batchers={dapOperation:new nl(this.isVsCode),cdpOperation:new nl(this.isVsCode)};this.onFlush=this.flushEmitter.event;this.setGlobalMetric=this.loggers.setGlobalMetric}report(e,...t){let n=this.loggers[e];n(...t)}reportOperation(e,t,n,i){this.batchers[e].add(t,n,i),this.batchFlushTimeout[e]===void 0&&(this.batchFlushTimeout[e]=setTimeout(()=>{this.report(e,this.batchers[e].flush()),this.batchFlushTimeout[e]=void 0},Gn.batchFlushInterval))}attachDap(e){this.target instanceof Array&&this.target.forEach(t=>e.output(t)),this.target=e}flush(){this.flushEmitter.fire();let e=Object.entries(this.batchFlushTimeout);for(let[t,n]of e){let i=this.batchers[t].flush();i.length&&this.report(t,i),this.batchFlushTimeout[t]=void 0,clearTimeout(n)}}dispose(){for(let e of Object.values(this.batchFlushTimeout))e&&clearTimeout(e)}pushOutput(e){e.data=Xy(e.data),this.target instanceof Array?this.target.push(e):this.target.output(e)}};Gn.batchFlushInterval=5e3,Gn=E([(0,Sf.injectable)(),g(0,(0,Sf.inject)(Qo))],Gn);var Xy=r=>typeof r=="number"?Number(r.toFixed(1)):typeof r!="object"||!r?r:r instanceof Error?zy(r):r instanceof Array?r.map(Xy):ci(r,Xy),JP=/(?:[A-z]:)?(?:[\\/][^:]*)+[\\/]([^:]*:)/g;function zy(r){let e=String(r.message),t=String(r.name);JP.lastIndex=0;let n=typeof r.stack=="string"?r.stack.replace(JP,"$1"):void 0;return{error:{message:e,name:t,stack:n}}}var QP=H("crypto"),Kn=_(q());var il=Symbol("IDwarfModuleProvider");var xf=Symbol("IWasmSymbolProvider"),Qy=Symbol("IWasmWorkerFactory"),Pf=r=>r.replace(/\.wasm$/i,"")+".wat",Ga=class{constructor(e,t){this.dwarf=e;this.launchConfig=t;this.cdpCounter=0;this.cdp=new Map;this.prompt=ne(()=>this.dwarf.prompt())}async spawn(e){if(!this.launchConfig.enableDWARF)return null;this.worker??=this.dwarf.load().then(i=>{if(!i)return null;let o=i.spawn({getWasmGlobal:(s,a)=>this.loadWasmValue(`globals[${s}]`,a),getWasmLocal:(s,a)=>this.loadWasmValue(`locals[${s}]`,a),getWasmOp:(s,a)=>this.loadWasmValue(`stack[${s}]`,a),getWasmLinearMemory:(s,a,c)=>this.loadWasmValue(`[].slice.call(new Uint8Array(memories[0].buffer, ${+s}, ${+a}))`,c).then(u=>new Uint8Array(u).buffer)});return o.rpc.sendMessage("hello",[],!1),o});let t=await this.worker;if(!t)return null;let n=this.cdpCounter++;return this.cdp.set(n,e),{rpc:t.rpc,getStopId:i=>`${n}:${i}`,dispose:()=>(this.cdp.delete(n),t.dispose())}}async dispose(){await this.worker?.then(e=>e?.dispose()),this.worker=Promise.resolve(null)}async loadWasmValue(e,t){let n=t,i=n.indexOf(":"),o=n.substring(0,i),s=n.substring(i+1),a=await this.cdp.get(+o)?.Debugger.evaluateOnCallFrame({callFrameId:s,expression:e+Ne(),silent:!0,returnByValue:!0,throwOnSideEffect:!0});if(!a||a.exceptionDetails)throw new Error(`evaluate failed: ${a?.exceptionDetails?.text||"unknown"}`);return a.result.value}};Ga=E([(0,Kn.injectable)(),g(0,(0,Kn.inject)(il)),g(1,(0,Kn.inject)(de))],Ga);var Ka=class{constructor(e,t,n,i){this.dwarf=e;this.cdp=t;this.logger=n;this.launchConfig=i;this.worker=ne(()=>this.dwarf.spawn(this.cdp))}async loadWasmSymbols(e){if(!this.launchConfig.enableDWARF)return this.defaultSymbols(e);let t=await this.worker();if(!t){let l=this.defaultSymbols(e);return l.onDidDisassemble=this.dwarf.prompt,l}let{rpc:n}=t,i=(0,QP.randomUUID)(),o;try{o=e.debugSymbols?.externalURL?new URL(e.debugSymbols?.externalURL):void 0}catch{}let s=new URL(e.url),a=s.hostname==="localhost"?["127.0.0.1","[::1]","localhost"]:[s.hostname],c=o?.hostname==="localhost",u;for(let l of a){s.hostname=l,o&&c&&(o.hostname=l);try{u=await n.sendMessage("addRawModule",i,o?.toString(),{url:s.toString(),code:!o&&s.protocol.startsWith("wasm:")?await this.getBytecode(e.scriptId):void 0});break}catch(p){this.logger.warn("sourcemap.parsing",`failed to load wasm symbols for ${s}`,{error:p})}}return u?!(u instanceof Array)||u.length===0?(n.sendMessage("removeRawModule",i),this.defaultSymbols(e)):(this.logger.info("sourcemap.parsing","parsed files from wasm",{files:u}),new Jy(e,this.cdp,i,t,u)):this.defaultSymbols(e)}async dispose(){await this.worker.value?.then(e=>e?.dispose())}defaultSymbols(e){return new Ef(e,this.cdp,[])}async getBytecode(e){let n=(await this.cdp.Debugger.getScriptSource({scriptId:e}))?.bytecode;return n?Buffer.from(n,"base64").buffer:void 0}};Ka=E([(0,Kn.injectable)(),g(0,(0,Kn.inject)(Qy)),g(1,(0,Kn.inject)(Be)),g(2,(0,Kn.inject)(U)),g(3,(0,Kn.inject)(de))],Ka);var Ef=class{constructor(e,t,n){this.event=e;this.cdp=t;this.doDisassemble=ne(async()=>{let e=[],t;for await(let n of this.getDisassembledStream()){e=e.concat(n.lines);let i;if(t){let o=new Uint32Array(t.length+n.lines.length);i=t.length,o.set(t),t=o}else t=new Uint32Array(n.lines.length),i=0;for(let o=0;o<n.lines.length;o++)t[i+o]=n.bytecodeOffsets[o]}return t??=new Uint32Array(0),{lines:e,byteOffsetsOfLines:t}});this.decompiledUrl=Pf(e.url),n.push(this.decompiledUrl),this.files=n}async getDisassembly(){let{lines:e}=await this.doDisassemble();return this.onDidDisassemble?.(),e.join(`
`)}originalPositionFor(e){return this.disassembledPositionFor(e)}async disassembledPositionFor(e){let{byteOffsetsOfLines:t}=await this.doDisassemble(),n=C0(t,e.base0.columnNumber,(i,o)=>i-o);if(n!==t.length)return{url:this.decompiledUrl,position:new Ve(n,0)}}async compiledPositionFor(e,t){if(e!==this.decompiledUrl)return[];let{byteOffsetsOfLines:n}=await this.doDisassemble(),{lineNumber:i}=t.base0;if(i>=n.length)return[];let o=n[t.base0.lineNumber];return[new Ve(0,o)]}dispose(){}async*getDisassembledStream(){let{scriptId:e}=this.event,t=await this.cdp.Debugger.disassembleWasmModule({scriptId:e});if(t)for(yield t.chunk;t.streamId;){let n=await this.cdp.Debugger.nextWasmDisassemblyChunk({streamId:t.streamId});if(!n)return;yield n.chunk}}},Jy=class extends Ef{constructor(t,n,i,o,s){super(t,n,s);this.moduleId=i;this.worker=o;this.mappedLines=new Map}get codeOffset(){return this.event.codeOffset||0}async originalPositionFor(t){let n=await this.worker.rpc.sendMessage("rawLocationToSourceLocation",{codeOffset:t.base0.columnNumber-this.codeOffset,inlineFrameIndex:t.base0.lineNumber,rawModuleId:this.moduleId});return n.length?{position:new Ve(n[0].lineNumber,n[0].columnNumber),url:n[0].sourceFileURL}:super.originalPositionFor(t)}async compiledPositionFor(t,n){if(t===this.decompiledUrl)return super.compiledPositionFor(t,n);let{lineNumber:i,columnNumber:o}=n.base0,s=await this.worker.rpc.sendMessage("sourceLocationToRawLocation",{lineNumber:i,columnNumber:o===0?-1:o,rawModuleId:this.moduleId,sourceFileURL:t});if(o===0&&s.length===0){let a=await this.getMappedLines(t),c=a.find(u=>u>i);if(!a.includes(i)&&c)return this.compiledPositionFor(t,new Ve(c,0))}return s.filter(a=>a.rawModuleId===this.moduleId).map(a=>new Ve(0,this.codeOffset+a.startOffset))}dispose(){return this.worker.rpc.sendMessage("removeRawModule",this.moduleId)}async getVariablesInScope(t,n){let i={codeOffset:n.base0.columnNumber-this.codeOffset,inlineFrameIndex:n.base0.lineNumber,rawModuleId:this.moduleId};return(await this.worker.rpc.sendMessage("listVariablesInScope",i)).map(s=>({name:s.name,scope:s.scope,type:s.type,evaluate:async()=>{let a=await this.worker.rpc.sendMessage("evaluate",s.name,i,this.worker.getStopId(t));return a?new Yy(a,this.worker.rpc):v8}}))}async getFunctionStack(t){let n=await this.worker.rpc.sendMessage("getFunctionInfo",{codeOffset:t.base0.columnNumber-this.codeOffset,inlineFrameIndex:t.base0.lineNumber,rawModuleId:this.moduleId});return"frames"in n?n.frames:[]}async getStepSkipList(t,n,i,o){if(i===this.decompiledUrl)return[];let s={codeOffset:n.base0.columnNumber-this.codeOffset,inlineFrameIndex:n.base0.lineNumber,rawModuleId:this.moduleId},a=()=>o&&i?this.worker.rpc.sendMessage("sourceLocationToRawLocation",{lineNumber:o.base0.lineNumber,columnNumber:-1,rawModuleId:this.moduleId,sourceFileURL:i}):[],c;switch(t){case 2:{c=await this.worker.rpc.sendMessage("getInlinedFunctionRanges",s);break}case 1:{let u=await Promise.all([this.worker.rpc.sendMessage("getInlinedCalleesRanges",s),a()]);c=Oo(u);break}case 0:c=await a();break;default:c=[];break}return c.map(u=>new nr(new Ve(0,u.startOffset+this.codeOffset),new Ve(0,u.endOffset+this.codeOffset)))}async evaluate(t,n,i){try{return await this.worker.rpc.sendMessage("evaluate",i,{codeOffset:n.base0.columnNumber-this.codeOffset,inlineFrameIndex:n.base0.lineNumber,rawModuleId:this.moduleId},this.worker.getStopId(t))??void 0}catch(o){throw new T(ve(o.message))}}getMappedLines(t){let n=this.mappedLines.get(t);if(n)return n;let i=(async()=>{try{let o=await this.worker.rpc.sendMessage("getMappedLines",this.moduleId,t);return new Uint32Array(o?.sort((s,a)=>s-a)||[])}catch{return new Uint32Array}})();return this.mappedLines.set(t,i),i}},v8={type:"null",description:"no properties"},Yy=class r{constructor(e,t){if(this.type=e.type,this.description=e.description,this.linearMemoryAddress=e.linearMemoryAddress,this.linearMemorySize=e.linearMemoryAddress,e.objectId&&e.hasChildren){let n=e.objectId;this.getChildren=ne(()=>this._getChildren(t,n))}}async _getChildren(e,t){return(await e.sendMessage("getProperties",t)).map(i=>({name:i.name,value:new r(i.value,e)}))}};var Qi=Symbol("IScriptSkipper");function ZP(r){return typeof r.lineNumber=="number"&&typeof r.columnNumber=="number"&&!!r.source}var eL=()=>({source:null,line:null,column:null,name:null,lastColumn:null,isSourceMapLoadFailure:!0}),I8=/\?t=[0-9]+$/,_8=r=>r.endsWith(".hot-update.js")||I8.test(r),A8={load:0,resolveLocation:2e3,sourceMapMinPause:1e3,output:1e3,sourceMapCumulativePause:1e4},tL=(r,e)=>e instanceof Je&&e.compiledToSourceUrl.has(r);var rL=2**31-1,mt=class{constructor(e,t,n,i,o,s,a,c,u){this.sourceMapFactory=t;this.logger=n;this.launchConfig=i;this.initializeConfig=o;this.sourcePathResolver=s;this.scriptSkipper=a;this.resourceProvider=c;this.wasmSymbols=u;this.rootPaths=[];this.scriptsById=new Map;this.onSourceMappedSteppingChangeEmitter=new C;this.onScriptEmitter=new C;this._sourceByOriginalUrl=new Mn(e=>e.toLowerCase());this._sourceByReference=new Map;this._sourceMapSourcesByUrl=new Map;this._sourceByAbsolutePath=Go();this._sourceMapTimeouts=A8;this._fileContentOverridesForTest=new Map;this._temporarilyDisabledSourceMaps=new Set;this._permanentlyDisabledSourceMaps=new Set;this.onScript=this.onScriptEmitter.event;this._statistics={fallbackSourceMapCount:0};this._doSourceMappedStepping=this.launchConfig.sourceMaps;this.onSourceMappedSteppingChange=this.onSourceMappedSteppingChangeEmitter.event;this._dap=e;let l="webRoot"in i?i.webRoot:i.rootPath;l&&(this.rootPaths=[l,ir(l,"..","ClientApp")]),a.setSourceContainer(this),this.setSourceMapTimeouts({...this.sourceMapTimeouts(),...i.timeouts})}get sources(){return this._sourceByReference.values()}statistics(){return this._statistics}get doSourceMappedStepping(){return this._doSourceMappedStepping}set doSourceMappedStepping(e){e!==this._doSourceMappedStepping&&(this._doSourceMappedStepping=e,this.onSourceMappedSteppingChangeEmitter.fire(e))}setSourceMapTimeouts(e){this._sourceMapTimeouts=e}sourceMapTimeouts(){return this._sourceMapTimeouts}setFileContentOverrideForTest(e,t){t===void 0?this._fileContentOverridesForTest.delete(e):this._fileContentOverridesForTest.set(e,t)}async loadedSources(){let e=[];for(let t of this._sourceByReference.values())e.push(t.toDap());return await Promise.all(e)}source(e){if(e.sourceReference)return this._sourceByReference.get(e.sourceReference);if(e.path)return this._sourceByAbsolutePath.get(e.path)}isSourceSkipped(e){return this.scriptSkipper.isScriptSkipped(e)}addScriptById(e){this.scriptsById.set(e.scriptId,e),"source"in e&&this.onScriptEmitter.fire(e)}getSourceScriptById(e){return this.scriptsById.get(e)}getScriptById(e){let t=this.scriptsById.get(e);return t&&"source"in t?t:void 0}getSourceByOriginalUrl(e){return this._sourceByOriginalUrl.get(e)}getSourceReference(e){let t=Ky(e)&rL;for(let n=0;n<65535;n++){if(!this._sourceByReference.has(t))return t;t===rL&&(t=0),t++}return this.logger.assert(!1,"Max iterations exceeding for source reference assignment"),t}async preferredUiLocation(e){let t=!1,n=4;for(;;){let i=await this._originalPositionFor(e);if(!ZP(i)){n=t?void 0:i;break}e=i,t=!0,n=void 0}return{...e,isMapped:t,unmappedReason:n}}async currentSiblingUiLocations(e,t){let n=await this._uiLocations(e);return t?n.filter(i=>i.source===t):n}clear(e){this.scriptsById.clear();for(let t of this._sourceByReference.values())this.removeSource(t,e);this._sourceByReference.clear(),this.sourceMapFactory instanceof Xi&&this.sourceMapFactory.invalidateCache()}async _uiLocations(e){let[t,n]=await Promise.all([this.getSourceMapUiLocations(e),this.getCompiledLocations(e)]);return[...t,e,...n]}async getSourceMapUiLocations(e){let t=await this._originalPositionFor(e);if(!ZP(t))return[];let n=await this.getSourceMapUiLocations(t);return n.push(t),n}async _originalPositionFor(e){if(!Wt(e.source))return 1;let t=await Uu.waitForValueWithTimeout(e.source.sourceMap,this._sourceMapTimeouts.resolveLocation);if(!t)return 2;if(this._doSourceMappedStepping)return this._originalPositionForMap(e,t);if(hy(t)){let n=await t.disassembledPositionFor(new ke(e.lineNumber,e.columnNumber)),i=n&&e.source.sourceMap.sourceByUrl.get(n.url);if(i)return i?{columnNumber:n.position.base1.lineNumber,lineNumber:n.position.base1.lineNumber,source:i}:3}return 0}async _originalPositionForMap(e,t){let n=e.source;if(!Wt(n))return 1;if(this._temporarilyDisabledSourceMaps.has(n)||this._permanentlyDisabledSourceMaps.has(n))return 0;let i=await this.getOptiminalOriginalPosition(t,J0(e,n.inlineScriptOffset));if(!i)return 3;let o=n.sourceMap.sourceByUrl.get(i.url);if(!o)return 3;let s=i.position.base1;return{lineNumber:s.lineNumber,columnNumber:s.columnNumber,source:o}}async getCompiledLocations(e){if(!(e.source instanceof Je))return[];let t=[];for(let[n,i]of e.source.compiledToSourceUrl){let o=await Uu.waitForValueWithTimeout(n.sourceMap,this._sourceMapTimeouts.resolveLocation);if(!o)continue;let s;if("decompiledUrl"in o){let a=await o.compiledPositionFor(i,new ke(e.lineNumber,e.columnNumber));if(!a)continue;s=a.map(c=>({lineNumber:c.base1.lineNumber,columnNumber:c.base1.columnNumber,source:n}))}else{let a=this.sourceMapFactory.guardSourceMapFn(o,()=>qd(i,e,o),eL);if(!a||a.line===null)continue;let{lineNumber:c,columnNumber:u}=z0({lineNumber:a.line||1,columnNumber:(a.column||0)+1},n.inlineScriptOffset),l={lineNumber:c,columnNumber:u,source:n};s=[l,...await this.getCompiledLocations(l)]}t=t.concat(s)}return t}async getOptiminalOriginalPosition(e,t){if(hy(e))return await e.originalPositionFor(new ke(t.lineNumber,t.columnNumber));let n=this.sourceMapFactory.guardSourceMapFn(e,()=>{let i=e.originalPositionFor({line:t.lineNumber,column:t.columnNumber-1,bias:Dn});return i.line!==null?i:e.originalPositionFor({line:t.lineNumber,column:t.columnNumber-1,bias:fa})},eL);if(!(n.column===null||n.line===null||n.source===null))return{position:new zr(n.line,n.column),url:n.source}}async addSource(e,t,n,i,o,s){let a=await this.sourcePathResolver.urlToAbsolutePath({url:e.url});this.logger.verbose("runtime.sourcecreate","Creating source from url",{inputUrl:e.url,absolutePath:a});let c;return e.scriptLanguage==="WebAssembly"?c=new Kd(this,e,a):c=new Ko(this,e.url,a,t,n&&this.sourcePathResolver.shouldResolveSourceMap({sourceMapUrl:n,compiledPath:a||e.url})?{sourceMapUrl:n,compiledPath:a||e.url,cacheKey:e.hash}:void 0,i,o,s),this._addSource(c),c}async _addSource(e){let t=e.url&&this._sourceByOriginalUrl.get(e.url);t&&!tL(t,e)&&this.removeSource(t,!0),this._sourceByOriginalUrl.set(e.url,e),this._sourceByReference.set(e.sourceReference,e),e instanceof Je&&this._sourceMapSourcesByUrl.set(e.url,e);let n=this._sourceByAbsolutePath.get(e.absolutePath);(n===void 0||n.url.length>=e.url.length||tL(n,e))&&this._sourceByAbsolutePath.set(e.absolutePath,e),this.scriptSkipper.initializeSkippingValueForSource(e),e.sendLazy||this.emitLoadedSource(e),Xo(e)?this._finishAddSourceWithSourceMap(e):zo(e)&&this._finishAddSourceWithWasm(e)}async _finishAddSourceWithWasm(e){let t=await this.wasmSymbols.loadWasmSymbols(e.event),n=[];for(let i of t.files){let o,s,a;i===t.decompiledUrl?(o=Pf(e.absolutePath),s=Pf(e.url),a=()=>t.getDisassembly()):(o=await this.sourcePathResolver.urlToAbsolutePath({url:i}),s=o?He(o):i,a=()=>this.resourceProvider.fetch(s).then(u=>u.body)),this.logger.verbose("runtime.sourcecreate","Creating wasm source from source map",{inputUrl:i,absolutePath:o,resolvedUrl:s});let c=new Je(this,s,o,a);c.compiledToSourceUrl.set(e,i),e.sourceMap.sourceByUrl.set(i,c),n.push(this._addSource(c))}await Promise.all(n),e.sourceMap.value.resolve(t)}async _finishAddSourceWithSourceMap(e){let t=e.sourceMap.value,n;try{n=await this.sourceMapFactory.load(e.sourceMap.metadata)}catch(i){if(this.initializeConfig.clientID==="visualstudio"){let o=e.sourceMap.metadata.sourceMapUrl;try{let s=await this.sourcePathResolver.urlToAbsolutePath({url:o});s&&(e.sourceMap.metadata.sourceMapUrl=He(s)),n=await this.sourceMapFactory.load(e.sourceMap.metadata),this._statistics.fallbackSourceMapCount++,this.logger.info("sourcemap.parsing","Failed to process original source-map; falling back to storage source-map",{fallbackSourceMapUrl:e.sourceMap.metadata.sourceMapUrl,originalSourceMapUrl:o,originalSourceMapError:zy(i)})}catch{}}if(n===void 0)return this._dap.output({output:Qd(e.url,i.message).error.format+`
`,category:"stderr"}),t.resolve(void 0)}if(this._sourceByReference.get(e.sourceReference)!==e)return t.resolve(void 0);this.logger.verbose("sourcemap.parsing","Creating sources from source map",{sourceMapId:n.id,metadata:n.metadata});try{await this._addSourceMapSources(e,n)}finally{t.resolve(n)}this.scriptSkipper.initializeSkippingValueForSource(e)}removeSource(e,t=!1){let n=this._sourceByReference.get(e.sourceReference);if(n!==void 0){if(this.logger.assert(e===n,"Expected source to be the same as the existing reference"),this._sourceByReference.delete(e.sourceReference),this._sourceByOriginalUrl.get(e.url)===e&&this._sourceByOriginalUrl.delete(e.url),e instanceof Je){this._sourceMapSourcesByUrl.delete(e.url);for(let[i,o]of e.compiledToSourceUrl)i.sourceMap.sourceByUrl.delete(o)}this._sourceByAbsolutePath.delete(e.absolutePath),Wt(e)&&(this._permanentlyDisabledSourceMaps.delete(e),this._temporarilyDisabledSourceMaps.delete(e)),!t&&e.hasBeenAnnounced&&e.toDap().then(i=>this._dap.loadedSource({reason:"removed",source:i})),zo(e)&&e.sourceMap.value.promise.then(i=>i?.dispose()),Wt(e)&&this._removeSourceMapSources(e,t)}}emitLoadedSource(e){return e.hasBeenAnnounced=!0,e.toDap().then(t=>this._dap.loadedSource({reason:"new",source:t}))}async _addSourceMapSources(e,t){let n=[];for(let i of t.sources){if(i===null)continue;let o=await this.sourcePathResolver.urlToAbsolutePath({url:i,map:t}),s=o?He(o):t.computedSourceUrl(i),a=this._sourceMapSourcesByUrl.get(s);if(e===a)continue;if(a)if(_8(e.url))this.removeSource(a);else{a.compiledToSourceUrl.set(e,i),e.sourceMap.sourceByUrl.set(i,a);continue}this.logger.verbose("runtime.sourcecreate","Creating source from source map",{inputUrl:i,sourceMapId:t.id,absolutePath:o,resolvedUrl:s});let c=o&&He(o),u=this.sourceMapFactory.guardSourceMapFn(t,()=>t.sourceContentFor(i),()=>null),l;if(u){let d=Ia(u);if(d&&(!At(d)&&o?l=Wi(o?He(o):i,d):l=d),o&&l){let f={sourceMapUrl:l,compiledPath:o};this.sourcePathResolver.shouldResolveSourceMap(f)||(l=void 0)}}let p=new Je(this,s,o,u!==null?()=>Promise.resolve(u):c?()=>this.resourceProvider.fetch(c).then(d=>d.body):()=>e.content(),l?{compiledPath:o||s,sourceMapUrl:l,cacheKey:t.metadata.cacheKey}:void 0,void 0,e.runtimeScriptOffset);p.compiledToSourceUrl.set(e,i),e.sourceMap.sourceByUrl.set(i,p),n.push(this._addSource(p))}await Promise.all(n)}_removeSourceMapSources(e,t){for(let n of e.sourceMap.sourceByUrl.keys()){let i=e.sourceMap.sourceByUrl.get(n);i&&(e.sourceMap.sourceByUrl.delete(n),i.compiledToSourceUrl.delete(e),!i.compiledToSourceUrl.size&&this.removeSource(i,t))}}async waitForSourceMapSources(e){return Wt(e)?[...(await Uu.waitForSources(e.sourceMap)).values()]:[]}async revealUiLocation(e){this._dap.revealLocationRequested({source:await e.source.toDap(),line:e.lineNumber,column:e.columnNumber})}disableSourceMapForSource(e,t=!1){t?this._permanentlyDisabledSourceMaps.add(e):this._temporarilyDisabledSourceMaps.add(e)}clearDisabledSourceMaps(e){e?this._temporarilyDisabledSourceMaps.delete(e):this._temporarilyDisabledSourceMaps.clear()}};mt=E([(0,Cr.injectable)(),g(0,(0,Cr.inject)(Yt)),g(1,(0,Cr.inject)(Nn)),g(2,(0,Cr.inject)(U)),g(3,(0,Cr.inject)(de)),g(4,(0,Cr.inject)(Ct)),g(5,(0,Cr.inject)(Se)),g(6,(0,Cr.inject)(Qi)),g(7,(0,Cr.inject)(Jo)),g(8,(0,Cr.inject)(xf))],mt);var nL=r=>r.originalPosition.columnNumber===1&&r.originalPosition.lineNumber===1,iL=500,oL=Symbol("DontCompare");var Dr=class{constructor(e,t,n,i,o,s,a){this.logger=n;this.launchConfig=i;this.conditionFactory=o;this.suggester=s;this._breakpointsPredictor=a;this._resolvedBreakpoints=new Map;this._totalBreakpointsCount=0;this._launchBlocker=new Set;this._predictorDisabledForTest=!1;this._breakpointsStatisticsCalculator=new rf;this.entryBreakpointMode=0;this._enabledFilter=()=>!0;this._byDapId=new Map;this._byPath=Go();this._byRef=new Map;this.moduleEntryBreakpoints=Go();this._dap=e,this._sourceContainer=t,a?.onLongParse(()=>e.longPrediction({})),t.onScript(c=>{c.source.then(u=>{let l=this._thread;l&&this._byRef.get(u.sourceReference)?.forEach(p=>p.updateForNewLocations(l,c))})}),t.onSourceMappedSteppingChange(()=>{if(this._thread)for(let c of this._byDapId.values())c.refreshUiLocations(this._thread)}),this._scriptSourceMapHandler=async(c,u)=>{if(!n.assert(this._thread,"Expected thread to be set for the breakpoint source map handler"))return[];let l=[],p=[u];for(let d=0;d<p.length;d++)for(let f of p[d]){let h=f.absolutePath,m=h?this._byPath.get(h):void 0;for(let w of m||[])l.push(w.updateForNewLocations(this._thread,c));let y=this._byRef.get(f.sourceReference);for(let w of y||[])l.push(w.updateForNewLocations(this._thread,c));f.sourceMap&&p.push(f.sourceMap.sourceByUrl.values())}return Oo(await Promise.all(l))}}get appliedByPath(){return this._byPath}get appliedByRef(){return this._byRef}hasAtLocation(e){let t=this._byPath.get(e.source.absolutePath)||[],n=this._byRef.get(e.source.sourceReference)||[];return t.concat(n).some(i=>i.originalPosition.columnNumber===e.columnNumber&&i.originalPosition.lineNumber===e.lineNumber)}async moveBreakpoints(e,t,n,i){let o=l=>K_(l,async p=>{let d=await this._sourceContainer.getOptiminalOriginalPosition(n,p.originalPosition);if(!d)return!1;let f=d.position.base1;return p.updateSourceLocation(e,{path:i.absolutePath,sourceReference:i.sourceReference},{lineNumber:f.lineNumber,columnNumber:f.columnNumber,source:i}),!1}),s=t.absolutePath,a=i.absolutePath,c=s?this._byPath.get(s):void 0;if(c&&a){let[l,p]=await o(c);this._byPath.set(s,l),this._byPath.set(a,p)}let u=this._byRef.get(t.sourceReference);if(u){let[l,p]=await o(u);this._byRef.set(t.sourceReference,l),this._byRef.set(i.sourceReference,p)}}async updateEntryBreakpointMode(e,t){if(t===this.entryBreakpointMode)return;let n=[...this.moduleEntryBreakpoints.values()];this.moduleEntryBreakpoints.clear(),this.entryBreakpointMode=t,await Promise.all(n.map(i=>this.ensureModuleEntryBreakpoint(e,i.source)))}async applyEnabledFilter(e,t=oL){if(t!==oL&&this._enabledFilter!==t)return;this._enabledFilter=e||(()=>!0);let n=this._thread;n&&await Promise.all([...this._byDapId.values()].map(i=>this._enabledFilter(i)?i.enable(n):i.disable()))}async getBreakpointLocations(e,t,n,i){let o=n.base1,s=i.base1,[a,c]=await Promise.all([this._sourceContainer.currentSiblingUiLocations({source:t,lineNumber:o.lineNumber,columnNumber:o.columnNumber}),this._sourceContainer.currentSiblingUiLocations({source:t,lineNumber:s.lineNumber,columnNumber:s.columnNumber})]);if(a.length!==c.length)return this.logger.warn("internal","Expected to have the same number of start and end locations"),[];let u=[],l=[];for(let p=0;p<a.length;p++){let d=a[p],f=c[p];if(d.source!==f.source){this.logger.warn("internal","Expected to have the same number of start and end scripts");continue}let h=d.source;if(!h.scripts.length)continue;let{scriptId:m}=h.scripts[h.scripts.length-1];u.push(e.cdp().Debugger.getPossibleBreakpoints({restrictToFunction:!1,start:{scriptId:m,...h.offsetSourceToScript(mi(d))},end:{scriptId:m,...h.offsetSourceToScript(mi(f))}}).then(y=>{if(y?.locations)return Promise.all(y.locations.map(async w=>{let{lineNumber:D,columnNumber:j=0}=w,X=await this._sourceContainer.currentSiblingUiLocations({source:h,...h.offsetScriptToSource(Y0({lineNumber:D,columnNumber:j}))});l.push({breakLocation:w,uiLocations:X})}))}))}return await Promise.all(u),l}setThread(e){this._thread=e,this._thread.cdp().Debugger.on("breakpointResolved",t=>{let n=this._resolvedBreakpoints.get(t.breakpointId);n&&n.updateUiLocations(e,t.breakpointId,[t.location])}),this._thread.setSourceMapDisabler(t=>{let n=[];for(let i of t){let o=this._resolvedBreakpoints.get(i);if(o){let s=this._sourceContainer.source(o.source);Wt(s)&&n.push(s)}}return n});for(let t of this._byPath.values())t.forEach(n=>this._setBreakpoint(n,e)),this.ensureModuleEntryBreakpoint(e,t[0]?.source);for(let t of this._byRef.values())t.forEach(n=>this._setBreakpoint(n,e));"runtimeSourcemapPausePatterns"in this.launchConfig&&this.launchConfig.runtimeSourcemapPausePatterns.length&&this.setRuntimeSourcemapPausePatterns(e,this.launchConfig.runtimeSourcemapPausePatterns),this._byDapId.size>0&&this._installSourceMapHandler(this._thread)}async launchBlocker(){nf(this.logger,"BreakpointManager.launchBlocker",async()=>{this._predictorDisabledForTest||await Promise.all([...this._launchBlocker])})}setRuntimeSourcemapPausePatterns(e,t){return Promise.all(t.map(n=>this._setBreakpoint(new rl(this,n),e)))}addLaunchBlocker(...e){for(let t of e)this._launchBlocker.add(t),t.finally(()=>this._launchBlocker.delete(t))}setPredictorDisabledForTest(e){this._predictorDisabledForTest=e}_installSourceMapHandler(e){let t=this.launchConfig.perScriptSourcemaps==="yes",n;t?n=Promise.all([this.updateEntryBreakpointMode(e,1),e.setScriptSourceMapHandler(!1,this._scriptSourceMapHandler)]).then(()=>!0):this._breakpointsPredictor&&!this.launchConfig.pauseForSourceMap?n=e.setScriptSourceMapHandler(!1,this._scriptSourceMapHandler):n=e.setScriptSourceMapHandler(!0,this._scriptSourceMapHandler),this._sourceMapHandlerInstalled={entryBpSet:n}}async _uninstallSourceMapHandler(e){e.setScriptSourceMapHandler(!1),this._sourceMapHandlerInstalled=void 0}_setBreakpoint(e,t){this._enabledFilter(e)&&this.addLaunchBlocker(Promise.race([ue(iL),e.enable(t)]))}async setBreakpoints(e,t){!this._sourceMapHandlerInstalled&&this._thread&&e.breakpoints?.length&&this._installSourceMapHandler(this._thread);let n=await this._sourceMapHandlerInstalled?.entryBpSet;e.source.path=on(e.source.path);let i=this._sourceContainer.source(e.source);if(!n&&this._breakpointsPredictor&&!i){let l=this._breakpointsPredictor.predictBreakpoints(e);this.addLaunchBlocker(l),await l}let o=this._thread;if(o?.debuggerReady.hasSettled()===!1){let l=o.debuggerReady.promise;this.addLaunchBlocker(l),await l}let s=l=>{let p={unbound:l.slice(),new:[],list:[]};if(!e.breakpoints)return p;for(let d=0;d<e.breakpoints.length;d++){let f=e.breakpoints[d],h;try{h=new Lr(this,t[d],e.source,f,this.conditionFactory.getConditionFor(f))}catch(w){if(!(w instanceof T))throw w;this._dap.output({category:"stderr",output:w.message}),h=new hf(this,t[d],e.source,f)}let m=p.unbound.findIndex(w=>w.equivalentTo(h)),y=p.unbound[m];y?.equivalentTo?.(h)?(p.list.push(y),p.unbound.splice(m,1)):(p.new.push(h),p.list.push(h),this._byDapId.set(h.dapId,h))}return p},a=()=>e.source.sourceReference?this._byRef.get(e.source.sourceReference):e.source.path?this._byPath.get(e.source.path):void 0,c=s(a()??[]);if(e.source.sourceReference)this._byRef.set(e.source.sourceReference,c.list);else if(e.source.path)this._byPath.set(e.source.path,c.list);else return{breakpoints:[]};if(c.unbound.length===0&&c.new.length===0)return{breakpoints:[]};if(this._totalBreakpointsCount-=c.unbound.length,await Promise.all(c.unbound.map(l=>(this._byDapId.delete(l.dapId),l.disable()))),this._totalBreakpointsCount+=c.new.length,this._thread&&(this._totalBreakpointsCount===0&&this._sourceMapHandlerInstalled?this._uninstallSourceMapHandler(this._thread):this._totalBreakpointsCount>0&&!this._sourceMapHandlerInstalled&&this._installSourceMapHandler(this._thread)),o&&c.new.length){this.ensureModuleEntryBreakpoint(o,e.source);let l=a(),p=Promise.all(c.new.filter(this._enabledFilter).filter(d=>l?.includes(d)).map(d=>d.enable(o)));this.addLaunchBlocker(Promise.race([ue(iL),p])),await p}let u=await Promise.all(c.list.map(l=>l.toDap()));return this._breakpointsStatisticsCalculator.registerBreakpoints(u),ue(0).then(()=>c.new.forEach(l=>l.markSetCompleted())),{breakpoints:u}}async notifyBreakpointChange(e,t){if(!this._byDapId.has(e.dapId))return;let n=await e.toDap();n.verified&&(this._breakpointsStatisticsCalculator.registerResolvedBreakpoint(e.dapId),this.suggester.notifyVerifiedBreakpoint()),t&&this._dap.breakpoint({reason:"changed",breakpoint:n})}isEntrypointBreak(e,t){return[...this.moduleEntryBreakpoints.values()].some(i=>i.enabled&&i.cdpScriptIds.has(t))?!0:e.some(i=>{let o=this._resolvedBreakpoints.get(i);return o&&(o instanceof jn||nL(o))})}async disableEntrypointBreaks(e){await Promise.all([...this.moduleEntryBreakpoints.values()].map(t=>{if(t.enabled&&t.cdpScriptIds.has(e))return t.disable()}))}isEntrypointCdpBreak(e){return this._resolvedBreakpoints.get(e)instanceof jn}async shouldPauseAt(e,t,n,i=!1){if(!t.length)return e.reason!=="instrumentation";let o=0,s=i?1:0;return await Promise.all(t.map(async a=>{if(n?.cdpId===a){o++;return}let c=this._resolvedBreakpoints.get(a);if(c instanceof jn){this.entryBreakpointMode===0&&!(c instanceof rl)&&c.disable(),s++;return}c instanceof Lr&&(await c.testHitCondition(e)?o++:s++)})),o>0||s===0}registerBreakpointsHit(e){for(let t of e){let n=this._resolvedBreakpoints.get(t);n instanceof Lr&&this._breakpointsStatisticsCalculator.registerBreakpointHit(n.dapId)}}statisticsForTelemetry(){return this._breakpointsStatisticsCalculator.statistics()}ensureModuleEntryBreakpoint(e,t){if(!t.path||(this._byPath.get(t.path)??[]).some(nL))return;let i=jn.getModeKeyForSource(this.entryBreakpointMode,t.path);if(!t.path||this.moduleEntryBreakpoints.has(i))return;let o=new jn(this,t,this.entryBreakpointMode);this.moduleEntryBreakpoints.set(t.path,o),this._setBreakpoint(o,e)}executionContextWasCleared(){for(let e of this._byDapId.values())e.executionContextWasCleared()}async reapply(){let e=[...this._byDapId.values()];if(await Promise.all(e.map(t=>t.disable())),this._thread){let t=this._thread;await Promise.all(e.map(n=>n.enable(t)))}}};Dr=E([(0,Xn.injectable)(),g(0,(0,Xn.inject)(Yt)),g(1,(0,Xn.inject)(mt)),g(2,(0,Xn.inject)(U)),g(3,(0,Xn.inject)(de)),g(4,(0,Xn.inject)(lf)),g(5,(0,Xn.inject)(Fe)),g(6,(0,Xn.inject)(ns))],Dr);var g$=H("crypto"),tc=_(q());var Ce=class r{static{this.Undefined=new r(void 0)}constructor(e){this.element=e,this.next=r.Undefined,this.prev=r.Undefined}},ol=class{constructor(){this._first=Ce.Undefined;this._last=Ce.Undefined;this._size=0}get size(){return this._size}isEmpty(){return this._first===Ce.Undefined}clear(){let e=this._first;for(;e!==Ce.Undefined;){let t=e.next;e.prev=Ce.Undefined,e.next=Ce.Undefined,e=t}this._first=Ce.Undefined,this._last=Ce.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new Ce(e);if(this._first===Ce.Undefined)this._first=n,this._last=n;else if(t){let o=this._last;this._last=n,n.prev=o,o.next=n}else{let o=this._first;this._first=n,n.next=o,o.prev=n}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(n))}}shift(){if(this._first!==Ce.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ce.Undefined){let e=this._last.element;return this._remove(this._last),e}}applyFilter(e){let t=this._first;for(;t!==Ce.Undefined;){let n=t.next;e(t.element)||this._remove(t),t=n}}_remove(e){if(e.prev!==Ce.Undefined&&e.next!==Ce.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Ce.Undefined&&e.next===Ce.Undefined?(this._first=Ce.Undefined,this._last=Ce.Undefined):e.next===Ce.Undefined?(this._last=this._last.prev,this._last.next=Ce.Undefined):e.prev===Ce.Undefined&&(this._first=this._first.next,this._first.prev=Ce.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ce.Undefined;)yield e.element,e=e.next}};var jf=_(q());var zn=class extends T{constructor(e){super({id:9243,format:e,showUser:!0}),this._cause={id:9243,format:e,showUser:!0}}};function Jn(r,e,t){if(e.isCancellationRequested)return Promise.reject(new zn(t||"Task cancelled"));let n=ge(),i=e.onCancellationRequested(n.resolve);return Promise.race([n.promise.then(()=>{throw new zn(t||"Task cancelled")}),r.then(o=>(i.dispose(),o)).catch(o=>{throw i.dispose(),o})])}function sL(r,e){let t=new ut(e),n=r.map(async i=>{try{return await i(t.token)}finally{t.cancel()}});return Promise.race(n)}var aL=Object.freeze(function(r,e){let t=setTimeout(r.bind(e),0);return{dispose(){clearTimeout(t)}}}),Vt=Object.freeze({isCancellationRequested:!1,onCancellationRequested:()=>({dispose:()=>{}})}),S8=Object.freeze({isCancellationRequested:!0,onCancellationRequested:aL}),ut=class r{constructor(e){this._token=void 0;this._parentListener=void 0;this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}static withTimeout(e,t){let n=new r(t),i=n._token=new Xa,o=setTimeout(()=>i.cancel(),e);return i.onCancellationRequested(()=>clearTimeout(o)),n}get token(){return this._token||(this._token=new Xa),this._token}cancel(){this._token?this._token instanceof Xa&&this._token.cancel():this._token=S8}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof Xa&&this._token.dispose():this._token=Vt}},Xa=class{constructor(){this._isCancelled=!1;this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?aL:(this._emitter||(this._emitter=new C),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};var d$=_(H("net"));var RG=_(pL(),1),kG=_(ub(),1),OG=_(pb(),1),u$=_(yb(),1),vb=_(c$(),1);var l$=u$.default;var p$=(r,e)=>r+Math.floor(Math.random()*(e-r));async function Wf({min:r=53e3,max:e=54e3,attempts:t=1e3,tester:n=BG}={},i=Vt){let o=p$(r,e);for(let s=Math.min(t,e-r);;s--)try{return await n(o,i)}catch(a){if(s===0||a instanceof zn)throw a;o=o===e-1?r:o+1}}function BG(r,e=Vt){let t;return new Promise((n,i)=>{let o=d$.createServer();o.listen(r,"127.0.0.1",()=>{let s=o.address();o.close(()=>n(s.port))}),o.on("error",i),t=e.onCancellationRequested(()=>{o.close(),i(new zn("Port open lookup cancelled"))})}).finally(()=>t?.dispose())}var f$=r=>(e,t)=>h$(new vb.default({host:"127.0.0.1",...r,port:e}),t),h$=(r,e)=>{let t;return new Promise((n,i)=>{r.on("error",i),r.on("listening",()=>n(r)),t=e.onCancellationRequested(()=>{r.close(),i(new zn("Port open lookup cancelled"))})}).finally(()=>t?.dispose())};var Vf=async(r,e,t)=>{let n=await Wf({tester:f$(e)},t),i=r.register(n.address().port);return n.on("close",()=>i.dispose()),n.on("error",()=>i.dispose()),n},Mr=Symbol("IPortLeaseTracker"),Za=class{constructor(e){this.usedPorts=new Set;this.onRegistered=new C;this.isMandated=e==="remote"}register(e){return this.usedPorts.add(e),this.onRegistered.fire(e),{dispose:()=>this.usedPorts.delete(e)}}isRegistered(e,t=2e3){return this.usedPorts.has(e)?Promise.resolve(!0):e<53e3||e>=54e3?Promise.resolve(!1):sL([()=>ue(t).then(()=>!1),n=>new Promise(i=>{let o=this.onRegistered.event(s=>{s===e&&i(!0)});n.onCancellationRequested(()=>o.dispose())})])}};Za=E([(0,jf.injectable)(),g(0,(0,jf.inject)(Hi))],Za);var m$="JsDebug",H$="*";var Ib=class{constructor(){this.replays=new Map}addReplay(e,t,n){let i=this.replays.get(e);return i||(i=new ol,this.replays.set(e,i)),i.push({event:`${e}.${t}`,params:n})}capture(e,t,n,i){let o=e[t];if(i===0)o.on(n,s=>this.addReplay(t,n,s));else if(i===2){let s;o.on(n,a=>{s?.(),s=this.addReplay(t,n,a)})}else{let s=new ol;o.on(n,a=>{s.size===i.cap&&s.shift()?.(),s.push(this.addReplay(t,n,a))})}}filter(e,t){let n=this.replays.get(e);n&&n.applyFilter(t)}clearEvent(e,t){let n=`${e}.${t}`;this.filter(e,i=>i.event!==n)}clearDomain(e){this.replays.delete(e)}read(e){return this.replays.get(e)??[]}},qf=Symbol("ICdpProxyProvider"),ec=class{constructor(e,t,n){this.cdp=e;this.portTracker=t;this.logger=n;this.disposables=new Ae;this.replay=new Ib;this.jsDebugApi={subscribe:(e,{events:t})=>{for(let n of t)n.endsWith(H$)?e.pushDisposable(this.cdp.session.onPrefix(n.slice(0,-H$.length),i=>e.send({method:i.method,params:i.params}))):e.pushDisposable(this.cdp.session.on(n,i=>e.send({method:n,params:i})));return{}}};this.replay.capture(e,"CSS","styleSheetAdded",0),this.replay.capture(e,"Debugger","paused",2),this.replay.capture(e,"Runtime","executionContextCreated",{cap:50,type:1}),this.replay.capture(e,"Runtime","consoleAPICalled",{cap:50,type:1}),e.Debugger.on("resumed",()=>{this.replay.clearEvent("Debugger","paused")}),e.CSS.on("fontsUpdated",i=>{i.font&&this.replay.addReplay("CSS","fontsUpdated",i)}),e.CSS.on("styleSheetRemoved",i=>this.replay.filter("CSS",o=>o.params.styleSheetId!==i.styleSheetId))}async proxy(){this.server||(this.server=this.createServer());let{server:e,path:t}=await this.server,n=e.address();return{host:n.address,port:n.port,path:t}}async createServer(){let e=`/${(0,g$.randomBytes)(20).toString("hex")}`,t=await Vf(this.portTracker,{perMessageDeflate:!0,path:e});return this.logger.info("proxyActivity","activated cdp proxy"),t.on("connection",n=>{let i=new _b(n,this.logger);this.logger.info("proxyActivity","accepted proxy connection",{id:i.id}),n.on("close",()=>{this.logger.verbose("proxyActivity","closed proxy connection",{id:i.id}),this.disposables.disposeObject(i)}),n.on("message",async o=>{let s;try{s=JSON.parse(o.toString())}catch(d){return i.send({id:0,error:{code:-32700,message:d.message}})}this.logger.verbose("proxyActivity","received proxy message",s);let{method:a,params:c,id:u=0}=s,[l,p]=a.split(".");try{let d=l===m$?await this.invokeJsDebugDomainMethod(i,p,c):await this.invokeCdpMethod(i,l,p,c);i.send({id:u,result:d})}catch(d){let f=d instanceof is&&d.cause?d.cause:{code:0,message:d.message};i.send({id:u,error:f})}})}),{server:t,path:e}}dispose(){this.disposables.dispose(),this.server?.then(e=>e.server.close()),this.server=void 0}invokeCdpMethod(e,t,n,i){let o=this.cdp.session.sendOrDie(`${t}.${n}`,i);switch(n){case"enable":for(let s of this.replay.read(t))e.send({method:s.event,params:s.params});break;case"disable":this.replay.clearDomain(t);break;default:}return o}invokeJsDebugDomainMethod(e,t,n){if(!this.jsDebugApi.hasOwnProperty(t))throw new is(t).setCause(-32601,`${m$}.${t} not found`);return this.jsDebugApi[t](e,n)}};ec=E([(0,tc.injectable)(),g(0,(0,tc.inject)(Be)),g(1,(0,tc.inject)(Mr)),g(2,(0,tc.inject)(U))],ec);var FG=0,_b=class{constructor(e,t){this.webSocket=e;this.logger=t;this.disposables=new Ae;this.id=FG++}pushDisposable(e){this.disposables.push(e)}dispose(){this.disposables.dispose(),this.webSocket.close()}send(e){this.logger.verbose("proxyActivity","send proxy message",e),this.webSocket.send(JSON.stringify(e))}};var y$=_(q());var Hl=Symbol("IClientCapabilies"),ro=class{};ro=E([(0,y$.injectable)()],ro);var v$=H("./vendor/acorn-loose.js"),gl=_(q());var Ab=nt(function(r,e,t){let n=t?"variable":"property",i=(l,p,d)=>{if(p!=="function")return n;if(l==="constructor")return"class";let f=String(d);return f.startsWith("class ")||f.includes("[native code]")&&/^[A-Z]/.test(l)?"class":t?"function":"method"},o=l=>{switch(typeof l){case"number":case"boolean":return`${l}`;case"object":return l===null?"null":l.constructor.name||"object";case"function":return`fn(${new Array(l.length).fill("?").join(", ")})`;default:return typeof l}},s=[],a=new Set,c="~",u=r===void 0?this:r;for(;u!=null;u=u.__proto__){c+="~";let l=Object.getOwnPropertyNames(u).filter(p=>p.startsWith(e)&&!p.match(/^\d+$/));for(let p of l){if(a.has(p))continue;a.add(p);let d=Object.getOwnPropertyDescriptor(u,p),f=n,h;try{let m=u[p];f=i(p,typeof d?.value,m),h=o(m)}catch{}s.push({label:p,sortText:c+p.replace(/^_+/,m=>"{".repeat(m.length)),type:f,detail:h})}t=!1}return{result:s,isArray:this instanceof Array}}),b$=hi(Ab.source);var UG=r=>{switch(r.type){case"ClassDeclaration":case"ClassExpression":return{type:"class",id:r.id};case"MethodDefinition":return{type:r.key?.type==="Identifier"&&r.key.name==="constructor"?"constructor":"method",id:r.key};case"VariableDeclarator":return{type:r.init?.type==="FunctionExpression"||r.init?.type==="ArrowFunctionExpression"?"function":"variable",id:r.id}}};function WG(r){let e=!1;return Ui(r,{enter(t){if(t.type==="CallExpression"||t.type==="NewExpression"||t.type==="UnaryExpression"&&t.operator==="delete"||t.type==="ClassBody")return e=!0,0}}),e}var Gf=Symbol("ICompletions"),rc=class{constructor(e,t){this.evaluator=e;this.cdp=t}async completions(e){let t=Tn(e.expression),n=new ji(e.expression).convert(e.position),i=()=>Promise.resolve([]);return Ui(t,{enter:(o,s)=>{let a=o;if(a.start<n&&n<=a.end){if(o.type==="MemberExpression"||o.type==="Identifier"&&s?.type==="MemberExpression"&&!s.computed&&s.object!==o){let c=o.type==="MemberExpression"?o:s;i=c.computed?()=>this.elementAccessCompleter(e,c,n):()=>this.propertyAccessCompleter(e,c,n)}else o.type==="Identifier"&&(i=()=>this.identifierCompleter(e,t,o,n));s=o}}}),i().then(o=>o.sort((s,a)=>s.sortText>a.sortText?1:-1))}async elementAccessCompleter(e,t,n){if(t.property.type!=="Literal"||typeof t.property.value!="string")return[];let i=e.expression.slice(Fi(t.property)+1,n);return(await this.defaultCompletions(e,i)).filter(s=>s.sortText!=="~~[").map(s=>({...s,text:JSON.stringify(s.text??s.label)+"]",start:Fi(t.property),length:oy(t.property)-Fi(t.property)}))}async identifierCompleter(e,t,n,i){let o=[];Ui(t,{enter(c){let u=UG(c);u?.id?.type==="Identifier"&&o.push({label:u.id.name,type:u.type,sortText:u.id.name})}});let s=e.expression.slice(Fi(n),i),a=[...o,...await this.defaultCompletions(e,s)];return this.evaluator.hasReturnValue&&e.executionContextId!==void 0&&yi.startsWith(s)&&a.push({sortText:`~${yi}`,label:yi,type:"variable"}),a}async propertyAccessCompleter(e,t,n){let{result:i,isArray:o}=await this.completePropertyAccess({executionContextId:e.executionContextId,stackFrame:e.stackFrame,expression:_0(e.expression,t.object),prefix:(0,v$.isDummy)(t.property)?"":e.expression.slice(Fi(t.property),n),throwOnSideEffect:WG(t)}),s=Fi(t.property)-1,a=/^[$a-z_][0-9a-z_$]*$/i;for(let c of i)a.test(c.label)||(c.text=`[${JSON.stringify(c.label)}]`,c.start=s,c.length=1);if(o){let c="index";i.unshift({label:`[${c}]`,text:`[${c}]`,type:"property",sortText:"~~[",start:s,selectionStart:1,selectionLength:c.length,length:1})}return i}async completePropertyAccess({executionContextId:e,stackFrame:t,expression:n,prefix:i,isInGlobalScope:o=!1,throwOnSideEffect:s=!1}){let a={expression:`(${n})`,objectGroup:"console",silent:!0,throwOnSideEffect:s},c=t&&t.callFrameId(),u=await this.evaluator.evaluate(c?{...a,callFrameId:c}:{...a,contextId:e},{stackFrame:t});if(!u||u.exceptionDetails)return{result:[],isArray:!1};if(!u.result.objectId){let l={...a,returnByValue:!0,throwOnSideEffect:!1,expression:b$.expr(`(${n})`,JSON.stringify(i),JSON.stringify(o))},p=await this.evaluator.evaluate(c?{...l,callFrameId:c}:{...l,contextId:e});return!p||p.exceptionDetails?{result:[],isArray:!1}:p.result.value}try{return(await Ab({cdp:this.cdp,args:[void 0,i,o],objectId:u.result.objectId,returnByValue:!0})).value}catch{return{result:[],isArray:!1}}finally{this.cdp.Runtime.releaseObject({objectId:u.result.objectId})}}async defaultCompletions(e,t=""){for(let n of["self","global","this"]){let{result:i}=await this.completePropertyAccess({executionContextId:e.executionContextId,stackFrame:e.stackFrame,expression:n,prefix:t,isInGlobalScope:!0});if(e.stackFrame){let o=t.toLowerCase(),s=new Set(i.map(a=>a.label));for(let a of await e.stackFrame.completions())s.has(a.label)||!a.label.toLowerCase().includes(o)||(s.add(a.label),i.push(a))}return i.push(...this.syntheticCompletions(e,t)),i}return this.syntheticCompletions(e,t)}syntheticCompletions(e,t){return this.evaluator.hasReturnValue&&yi.startsWith(t)?[{sortText:`~${yi}`,label:yi,type:"variable"}]:[]}};rc=E([(0,gl.injectable)(),g(0,(0,gl.inject)(Pr)),g(1,(0,gl.inject)(Be))],rc);var I$=/^(\W*at .*\()(.*):(\d+):(\d+)(\))$/,_$=/^(\W*at )(.*):(\d+):(\d+)$/,no=class{constructor(e){this.stack=e}static isStackLike(e){return I$.test(e)||_$.test(e)}*[Symbol.iterator](){for(let e of this.stack.split(`
`)){let t=I$.exec(e)||_$.exec(e);if(!t){yield e+`
`;continue}let[,n,i,o,s,a]=t;n&&(yield n),yield new wb(i,new ke(Number(o),Number(s))),a&&(yield a),yield`
`}}},wb=class{constructor(e,t){this.path=e;this.position=t}toString(){return`${this.path}:${this.position.lineNumber}:${this.position.columnNumber}`}};var Qn=class{constructor(e,t){this._tokens=[];this._separator=t||"",this._budget=e-1-this._separator.length}append(e){if(e.length>this.budget()){this.appendEllipsis();return}this._append(e)}_append(e){this._tokens.length&&(this._budget-=this._separator.length),this._tokens.push(e),this._budget-=e.length}appendEllipsis(){this._tokens[this._tokens.length-1]!=="\u2026"&&this._append("\u2026")}checkBudget(){return this._budget<=0&&this.appendEllipsis(),this._budget>0}budget(){return this._budget-(this._tokens.length?this._separator.length:0)}build(){return this._tokens.join(this._separator)}isEmpty(){return!this._tokens.length}};var G$=_(V$());var i4=1e4;function o4(r,e){if(!r.includes("%"))return[{type:"string",value:r}];let t=[];function n(c){if(!c)return;let u=t[t.length-1];u?.type==="string"?u.value+=c:t.push({type:"string",value:c})}function i(c,u,l){t.push({type:"specifier",specifier:c,precision:u,substitutionIndex:l})}let o=0,s=0,a=new RegExp(`%%|%(?:(\\d+)\\$)?(?:\\.(\\d*))?([${e.join("")}])`,"g");for(let c=a.exec(r);c;c=a.exec(r)){let u=c.index;if(u>o&&n(r.substring(o,u)),c[0]==="%%")n("%");else{let[,l,p,d]=c;l&&Number(l)>0&&(s=Number(l)-1);let f=p?Number(p):void 0;i(d,f,s),++s}o=u+c[0].length}return n(r.substring(o)),t}function Lb(r,e,t){let n=o4(r,Array.from(t.keys())),i=new Set,o=t.get("");if(!o)throw new Error("Expected to hav a default formatter");let s=new Qn(i4),a=!1;for(let c=0;s.checkBudget()&&c<n.length;++c){let u=n[c];if(u.type==="string"){s.append(u.value);continue}let l=u.substitutionIndex;if(l>=e.length){s.append("%"+(u.precision||"")+u.specifier);continue}i.add(l),u.specifier==="c"&&(a=!0);let p=t.get(u.specifier)||o;s.append(p(e[l],{budget:s.budget(),quoted:!1,ansi:!0}))}a&&s.append("\x1B[0m");for(let c=0;s.checkBudget()&&c<e.length;++c)i.has(c)||(i.add(c),(r||c)&&s.append(" "),s.append(o(e[c],{budget:s.budget(),quoted:!1,ansi:!0})));return{result:s.build(),usedAllSubs:i.size===e.length}}function q$(r){try{return new G$.default(r).ansi256().object().ansi256}catch{}}function K$(r){let e=/\s*(.*?)\s*:\s*(.*?)\s*(?:;|$)/g,t="\x1B[0m",n=e.exec(r);for(;n!==null;){if(n.length===3)switch(n[1]){case"color":let i=q$(n[2]);i&&(t+=`\x1B[38;5;${i}m`);break;case"background":case"background-color":let o=q$(n[2]);o&&(t+=`\x1B[48;5;${o}m`);break;case"font-weight":n[2]==="bold"&&(t+="\x1B[1m");break;case"font-style":n[2]==="italic"&&(t+="\x1B[3m");break;case"text-decoration":n[2]==="underline"&&(t+="\x1B[4m");break;default:}n=e.exec(r)}return t}var z$=r=>r.replace(/\n/gm,"\\n").replace(/\r/gm,"\\r").replace(/\t/gm,"\\t"),a4={budget:1e5,quoted:!0},X$={budget:1e3,quoted:!0,postProcess:z$},c4={budget:1/0,quoted:!1},u4={budget:1e3,quoted:!0,postProcess:z$},l4={budget:1e5,quoted:!0},Yf=r=>{switch(r){case"repl":return a4;case"hover":return X$;case"propertyValue":return X$;case"watch":return u4;case"copy":case"clipboard":return c4;default:return l4}};var p4=30,d4=100,$b=20,f4=1e4,h4=3,J$=120,Cb=new Set(["null","regexp","date"]);function ds(r){return r.type==="function"||r.type==="object"&&!Cb.has(r.subtype)}function Db(r){return r.subtype==="array"||r.subtype==="typedarray"}function fs(r,e,t){let n=Yf(e),i=Qf(r,n,t);return r.preview?.subtype==="regexp"?i:n.postProcess?.(i)??i}function Qf(r,e,t){return r.type==="function"?r.description?rC(r.description,e.budget):"<function>":r.type==="object"&&r.subtype==="node"?r.description:"preview"in r&&r.preview?Zf(r.preview,e.budget,t):tC(r,e,t)}function Zf(r,e,t){return Db(r)?m4(r,e):r.subtype==="internal#entry"?Rn(r.description||"",e):r.type==="function"?rC(r.description,e):ds(r)?H4(r,e,t):y4(r,e,t)}function m4(r,e){let t=new Qn(e),n=r.description,i=n.match(/[^(]*\(([\d]+)\)/);if(!i)return n;let o=parseInt(i[1],10);n.startsWith("Array(")&&(n=n.substring(5)),t.append(Rn(n,t.budget())),t.append(" ");let s=new Qn(t.budget()-2,", "),a=-1;for(let c of r.properties){if(!s.checkBudget())break;if(isNaN(c.name))continue;let u=parseInt(c.name,10);u>a+1&&s.appendEllipsis(),a=u,s.append(Il(c,s.budget()))}o>a+1&&s.appendEllipsis();for(let c of r.properties){if(!s.checkBudget())break;isNaN(c.name)&&s.append(Il(c,s.budget(),c.name))}return r.overflow&&s.appendEllipsis(),t.append("["+s.build()+"]"),t.build()}function H4(r,e,t){let n=new Qn(e," ");r.description!=="Object"&&n.append(Rn(r.description,n.budget()));let i=new Map,o=r.properties||[];for(let d of o)i.set(d.name,d);let s=i.get("[[PrimitiveValue]]");if(s)return n.append(`(${Il(s,n.budget()-2)})`),n.build();let a=i.get("[[PromiseStatus]]"),c=i.get("[[PromiseValue]]");if(a&&c)return a.value==="pending"?n.append(`{<${a.value}>}`):n.append(`{${Il(c,n.budget()-2,`<${a.value}>`)}}`),n.build();let u=i.get("[[GeneratorStatus]]");if(u)return n.append(`{<${u.value}>}`),n.build();let l=new Qn(n.budget()-2,", ");for(let d of o){if(!l.checkBudget())break;l.append(Il(d,l.budget(),d.name))}for(let d of r.entries||[]){if(!l.checkBudget())break;if(d.key){let f=Zf(d.key,Math.min($b,l.budget()),t),h=Zf(d.value,Math.min($b,l.budget()-f.length-4),t);l.append(oc(f," => ",h,l.budget()))}else l.append(Zf(d.value,Math.min($b,l.budget()),t))}r.overflow&&l.appendEllipsis();let p=l.build();return p?n.append("{"+p+"}"):n.isEmpty()&&n.append("{}"),n.build()}function Y$(r,e){return r.length<=e?r:"\u2026"}function g4(r,e){return r.length>=e?r.slice(0,e-1)+"\u2026":r}function y4(r,e,t){if(r.type==="object"&&r.subtype==="null")return Y$("null",e);if(r.type==="undefined")return Y$("undefined",e);if(r.type==="string"){let n=r.description??r.value;return t?.hex&&(n=Buffer.from(n,"utf8").toString("hex")),Ha(n,e)}return r.type==="number"||r.type==="bigint"?_l(r,!1,e,t):g4(r.description||"",e)}function oc(r,e,t,n){return r===void 0?Ha(t,n):r.length+e.length>n?Rn(r,n):Z$(`${r}${e}${Ha(t,n-r.length-e.length)}`)}function Il(r,e,t){return e=Math.min(e,d4),r.type==="function"?oc(t,": ","\u0192",e):r.type==="object"&&r.value==="Object"?oc(t,": ","{\u2026}",e):typeof r.value>"u"?oc(t,": ",`<${r.type}>`,e):r.type==="string"?oc(t,": ",eC(r.value),e):oc(t,": ",r.value??"unknown",e)}function Z$(r){return r.replaceAll("\x1B","\\x1b")}function eC(r){let e=r.includes("'")?r.includes('"')?r.includes("`")?"'":"`":'"':"'",t=new RegExp(`[${e}\\\\]`,"g");return`${e}${r.replace(t,"\\$&")}${e}`}function tC(r,{budget:e,quoted:t,ansi:n},i){if(r.type==="string"){let o=r.value||(r.description?r.description:"");i?.hex&&(o=Buffer.from(o,"utf8").toString("hex"),t=!1);let s=Ha(o,t?e-2:e);return t&&(s=eC(s)),n?s:Z$(s)}return r.type==="undefined"?"undefined":r.subtype==="null"?"null":r.type==="bigint"||r.type==="number"?_l(r,!1,e,i):r.description?Rn(r.description,Math.max(e,1e5)):Rn(String("value"in r?r.value:r.description),e)}function rC(r,e){let t=new Qn(e),n=r.replace(/^function [gs]et /,"function ").replace(/^function [gs]et\(/,"function(").replace(/^[gs]et /,""),i=n.match(/^(async\s+function)/),o=n.startsWith("function*"),s=n.startsWith("*"),a=!o&&n.startsWith("function"),c=n.startsWith("class ")||n.startsWith("class{"),u=n.indexOf("=>"),l=!i&&!o&&!a&&!c&&u>0,p;if(c){p=n.substring(5);let h=/^[^{\s]+/.exec(p.trim()),m="";h&&(m=h[0].trim()||""),f("class",p,m)}else if(i)p=n.substring(i[1].length),f("async \u0192",p,d(p));else if(o)p=n.substring(9),f("\u0192*",p,d(p));else if(s)p=n.substring(1),f("\u0192*",p,d(p));else if(a)p=n.substring(8),f("\u0192",p,d(p));else if(l){let h=n;n.length>p4&&(h=n.substring(0,u+2)+" {\u2026}"),f("",n,h)}else f("\u0192",n,d(n));return t.build();function d(h){let m=h.indexOf("("),y=h.match(/\)\s*{/),w=y&&y.index||0;if(m!==-1&&y&&w>m){let D=h.substring(0,m).trim()||"",j=h.substring(m,w+1);return D+j}return"()"}function f(h,m,y){t.checkBudget()&&(h.length&&t.append(h+" "),m=m.trim(),m.endsWith(" { [native code] }")&&(m=m.substring(0,m.length-18)),t.budget()>=m.length?t.append(m):t.append(y.replace(/\n/g," ")))}}function hs(r){let e=r;if(e.type!=="object"||e.subtype==="null")return{title:tC(e,{budget:f4,quoted:!1},void 0)};let t=e.description??e.className??"Error",n=/^\s+at\s/m.exec(t);if(!n){let i=t.lastIndexOf(`
`);return i===-1?{title:t}:{title:t.substring(0,i)}}return{title:t.substring(0,n.index-1),stackTrace:t.substring(n.index+2)}}function _l(r,e,t,n){if(r.type==="number"){if("unserializableValue"in r)return r.unserializableValue;let s=r.value!==void 0?r.value:+r.description;return n?.hex?s.toString(16):String(s)}if(r.type==="bigint"){let s=r.unserializableValue||r.description;return n?.hex?BigInt(s.slice(0,-1)).toString(16):s}let i=r,o=typeof i.value=="number"?i.value:+String(i.description);return Rn(String(e?Math.floor(o):o),t)}function b4(r,e){return Ha(String(typeof r.value<"u"?r.value:r.description),e)}function nC(r){let e=[],t=new Set([void 0]),n=new Map;for(let l of r.properties.filter(p=>p.valuePreview)){let p=new Map;p.set(void 0,l.name),n.set(void 0,Math.max(n.get(void 0)||0,l.name.length)),e.push(p),l.valuePreview?.properties.map(d=>{d.value&&(t.add(d.name),p.set(d.name,d.value),n.set(d.name,Math.max(n.get(d.name)||0,d.value.length)))})}for(let l of t.values())l&&n.set(l,Math.max(n.get(l)||0,l.length));let i=Array.from(n.values()).reduce((l,p)=>l+p,0),o=J$-4-(t.size-1)*3;if(i>o){let l=o/i;for(let p of n.keys()){let d=Math.max(h4,n.get(p)*l|0);n.set(p,d)}}let s=[];for(let l of t.values())s.push("-".repeat(n.get(l)));let a="[-"+s.join("-|-")+"-]",c=[];c.push(a.replace("[","\u256D").replace(/\|/g,"\u252C").replace("]","\u256E").replace(/-/g,"\u2504"));let u=[];for(let l of t.values())u.push(Q$(l||"",n.get(l)));c.push("\u250A "+u.join(" \u250A ")+" \u250A"),c.push(a.replace("[","\u251C").replace(/\|/g,"\u253C").replace("]","\u2524").replace(/-/g,"\u2504"));for(let l of e){let p=[];for(let d of t.values())p.push(Q$(l.get(d)||"",n.get(d)));c.push("\u250A "+p.join(" \u250A ")+" \u250A")}return c.push(a.replace("[","\u2570").replace(/\|/g,"\u2534").replace("]","\u256F").replace(/-/g,"\u2504")),c.map(l=>Rn(l,J$)).join(`
`)}var Tb=new Map([["",(r,e)=>Qf(r,e)],["s",(r,e)=>b4(r,e.budget)],["i",(r,e)=>_l(r,!0,e.budget,void 0)],["d",(r,e)=>_l(r,!0,e.budget,void 0)],["f",(r,e)=>_l(r,!1,e.budget,void 0)],["c",r=>K$(r.value)],["o",(r,e)=>Qf(r,e)],["O",(r,e)=>Qf(r,e)]]);function Q$(r,e){return r.length===e?r:r.length<e?r+" ".repeat(e-r.length):Rn(r,e)}var Zt=_(je());var Al=_(q());async function Mb(r){let e=await r.uiLocation();return e?e.source.blackboxed()?2:Wt(e.source)&&!e.isMapped&&e.unmappedReason===3?1:0:0}var v4=new Set(["breakpoint","exception","entry"]),I4=256,oo=class{constructor(e,t){this.launchConfig=e;this.logger=t;this._smartStepCount=0}resetSmartStepCount(){this._smartStepCount>0&&(this.logger.verbose("internal",`smartStep: skipped ${this._smartStepCount} steps`),this._smartStepCount=0)}async getSmartStepDirection(e,t){if(!this.launchConfig.smartStep||v4.has(e.reason))return;let n=(await e.stackTrace.loadFrames(1)).find(Ro(Mt));if((n&&await Mb(n))===0){this.resetSmartStepCount();return}return this._smartStepCount++>I4?2:t?.reason==="step"?t.direction:0}};oo=E([(0,Al.injectable)(),g(0,(0,Al.inject)(de)),g(1,(0,Al.inject)(U))],oo);var oC=nt(function(){return[Symbol.for("debug.description"),Symbol.for("nodejs.util.inspect.custom")]}),sC=hi(function(r,e){let t={},n="<<default preview>>";if(typeof this!="object"||!this)return t;for(let[i,o]of Object.entries(this)){if(e)try{let s=e.call(o,n);if(s!==n){t[i]=String(s);continue}}catch(s){t[i]=`<<indescribable>>${JSON.stringify([String(s),i])}`;continue}if(typeof o=="object"&&o){let s;for(let a of runtimeArgs[0])if(typeof o[a]=="function")try{s=o[a](2);break}catch{}!s&&!String(o.toString).includes("[native code]")&&(s=String(o)),s&&!s.startsWith("[object ")&&(t[i]=s.length>=r?s.slice(0,r)+"\u2026":s)}}return t}),eh=hi(function(r,e){if(e)try{let t="<<default preview>>",n=e.call(this,t);if(n!==t)return String(n)}catch(t){return`<<indescribable>>${JSON.stringify([String(t),"object"])}`}if(typeof this=="object"&&this){let t;for(let n of[Symbol.for("debug.description"),Symbol.for("nodejs.util.inspect.custom")])if(typeof this[n]=="function")try{t=this[n](2);break}catch{}if(!t&&!String(this.toString).includes("[native code]")&&(t=String(this)),t&&!t.startsWith("[object "))return t.length>=r?t.slice(0,r)+"\u2026":t}});var he=_(je()),AC=H("crypto");var Rr=class r{constructor(e=process.hrtime()){this.value=e}get ms(){return this.s*1e3}get s(){return this.value[0]+this.value[1]/1e9}elapsed(){return new r().subtract(this)}subtract(e){let t=this.value[1]-e.value[1],n=this.value[0]-e.value[0];return t<0&&(t+=1e9,n--),new r([n,t])}};var sc=class{constructor(e,t,n,i,o,s){this.launchConfig=e;this.targetInfo=t;this.parentTarget=n;this.targetOriginValue=i;this.cdp=o;this.logger=s;this.onNameChanged=new C().event;this.attached=!1;this.isWaitingForDebugger=!0;o.pause()}id(){return this.targetInfo.targetId}name(){return this.targetInfo.title}fileName(){return this.targetInfo.url}type(){return"node"}parent(){return this.parentTarget}children(){return[]}canStop(){return!1}stop(){}canRestart(){return!1}restart(){}canAttach(){return!this.attached}async attach(){return await this.cdp.Runtime.enable({}),this.launchConfig.noDebug||await this.cdp.Debugger.enable({}),this.attached=!0,this.cdp}canDetach(){return this.attached}async detach(){await this.cdp.Debugger.resume({}),await this.cdp.NodeWorker.detach({sessionId:this.targetInfo.targetId}),this.attached=!1}targetOrigin(){return this.targetOriginValue}afterBind(){return this.cdp.resume(),Promise.resolve()}async runIfWaitingForDebugger(){this.isWaitingForDebugger=!1,await this.cdp.Runtime.runIfWaitingForDebugger({})}initialize(){return Promise.resolve()}waitingForDebugger(){return this.isWaitingForDebugger}supportsCustomBreakpoints(){return!1}supportsXHRBreakpoints(){return!1}scriptUrlToUrl(e){return e[0]==="/"||process.platform==="win32"&&e[1]===":"&&e[2]==="\\"?He(e):e}executionContextName(){return this.targetInfo.title}};var Me=_(je()),th=new Map;function rh(){if(th.size)return th;function r(o,s){for(let a of s)a.group=o,th.set(a.id,a)}function e(o,s){let a=s||o;return{id:"instrumentation:"+o,title:a,group:"",details:c=>{if(o==="webglErrorFired"){let u=c.webglErrorName;return u=u.replace(/^.*(0x[0-9a-f]+).*$/i,"$1"),{short:u,long:Me.t('Paused on WebGL Error instrumentation breakpoint, error "{0}"',u)}}return o==="scriptBlockedByCSP"&&c.directiveText?{short:Me.t('CSP violation "{0}"',c.directiveText),long:Me.t('Paused on Content Security Policy violation instrumentation breakpoint, directive "{0}"',c.directiveText)}:{short:a,long:Me.t('Paused on instrumentation breakpoint "{0}"',a)}},apply:async(c,u)=>(u?await c.EventBreakpoints.setInstrumentationBreakpoint({eventName:o}):await c.EventBreakpoints.removeInstrumentationBreakpoint({eventName:o}))?!0:!!(u?await c.DOMDebugger.setInstrumentationBreakpoint({eventName:o}):await c.DOMDebugger.removeInstrumentationBreakpoint({eventName:o}))}}function t(o,s,a){let c=s===void 0?"*":typeof s=="string"?[s]:s;return{id:"listener:"+o,title:a||o,group:"",details:u=>{let l=(u.targetName||"*").toLowerCase();return{short:l+"."+o,long:Me.t('Paused on event listener breakpoint "{0}", triggered on "{1}"',o,l)}},apply:async(u,l)=>{let p=!0;for(let d of c)l?p=p&&!!await u.DOMDebugger.setEventListenerBreakpoint({eventName:o,targetName:d}):p=p&&!!await u.DOMDebugger.removeEventListenerBreakpoint({eventName:o,targetName:d});return p}}}r("Ad Auction Worklet",[e("beforeBidderWorkletBiddingStart",Me.t("Bidder Bidding Phase Start")),e("beforeBidderWorkletReportingStart",Me.t("Bidder Reporting Phase Start")),e("beforeSellerWorkletScoringStart",Me.t("Seller Scoring Phase Start")),e("beforeSellerWorkletReportingStart",Me.t("Seller Reporting Phase Start"))]),r("Animation",[e("requestAnimationFrame",Me.t("Request Animation Frame")),e("cancelAnimationFrame",Me.t("Cancel Animation Frame")),e("requestAnimationFrame.callback",Me.t("Animation Frame Fired"))]),r("Canvas",[e("canvasContextCreated",Me.t("Create canvas context")),e("webglErrorFired",Me.t("WebGL Error Fired")),e("webglWarningFired",Me.t("WebGL Warning Fired"))]),r("Clipboard",[t("copy"),t("cut"),t("paste"),t("beforecopy"),t("beforecut"),t("beforepaste")]),r("Control",[t("resize"),t("scroll"),t("scrollend"),t("zoom"),t("focus"),t("blur"),t("select"),t("change"),t("submit"),t("reset")]),r("Device",[t("deviceorientation"),t("devicemotion")]),r("DOM Mutation",[t("DOMActivate"),t("DOMFocusIn"),t("DOMFocusOut"),t("DOMAttrModified"),t("DOMCharacterDataModified"),t("DOMNodeInserted"),t("DOMNodeInsertedIntoDocument"),t("DOMNodeRemoved"),t("DOMNodeRemovedFromDocument"),t("DOMSubtreeModified"),t("DOMContentLoaded")]),r("Drag / Drop",[t("drag"),t("dragstart"),t("dragend"),t("dragenter"),t("dragover"),t("dragleave"),t("drop")]),r("Geolocation",[e("Geolocation.getCurrentPosition","getCurrentPosition"),e("Geolocation.watchPosition","watchPosition")]),r("Keyboard",[t("keydown"),t("keyup"),t("keypress"),t("input")]),r("Load",[t("load"),t("beforeunload"),t("unload"),t("abort"),t("error"),t("hashchange"),t("popstate"),t("navigate"),t("navigatesuccess"),t("navigateerror"),t("currentchange"),t("nagivateto"),t("navigatefrom"),t("finish"),t("dispose")]);let n=["audio","video"];r("Media",[t("play",n),t("pause",n),t("playing",n),t("canplay",n),t("canplaythrough",n),t("seeking",n),t("seeked",n),t("timeupdate",n),t("ended",n),t("ratechange",n),t("durationchange",n),t("volumechange",n),t("loadstart",n),t("progress",n),t("suspend",n),t("abort",n),t("error",n),t("emptied",n),t("stalled",n),t("loadedmetadata",n),t("loadeddata",n),t("waiting",n)]),r("Mouse",[t("auxclick"),t("click"),t("dblclick"),t("mousedown"),t("mouseup"),t("mouseover"),t("mousemove"),t("mouseout"),t("mouseenter"),t("mouseleave"),t("mousewheel"),t("wheel"),t("contextmenu")]),r("Notification",[e("Notification.requestPermission","requestPermission")]),r("Parse",[e("Element.setInnerHTML",Me.t("Set innerHTML")),e("Document.write","document.write")]),r("Picture-in-Picture",[t("enterpictureinpicture","video"),t("leavepictureinpicture","video"),t("resize","PictureInPictureWindow"),t("enter","documentPictureInPicture")]),r("Pointer",[t("pointerover"),t("pointerout"),t("pointerenter"),t("pointerleave"),t("pointerdown"),t("pointerup"),t("pointermove"),t("pointercancel"),t("gotpointercapture"),t("lostpointercapture"),t("pointerrawupdate")]),r("Script",[e("scriptFirstStatement",Me.t("Script First Statement")),e("scriptBlockedByCSP",Me.t("Script Blocked by Content Security Policy"))]),r("Timer",[e("setTimeout"),e("clearTimeout"),e("setInterval"),e("clearInterval"),e("setTimeout.callback",Me.t("setTimeout fired")),e("setInterval.callback",Me.t("setInterval fired"))]),r("Touch",[t("touchstart"),t("touchmove"),t("touchend"),t("touchcancel")]),r("WebAudio",[e("audioContextCreated",Me.t("Create AudioContext")),e("audioContextClosed",Me.t("Close AudioContext")),e("audioContextResumed",Me.t("Resume AudioContext")),e("audioContextSuspended",Me.t("Suspend AudioContext"))]),r("Window",[e("DOMWindow.close","window.close")]),r("Worker",[t("message"),t("messageerror")]);let i=["xmlhttprequest","xmlhttprequestupload"];return r("XHR",[t("readystatechange",i),t("load",i),t("loadstart",i),t("loadend",i),t("abort",i),t("error",i),t("progress",i),t("timeout",i)]),th}var Rb=sy(),aC=hi(function(){let r=["instantiate","instantiateStreaming","compile","compileStreaming"];for(let e of r){let t=WebAssembly[e];WebAssembly[e]=function(...n){return t.apply(this,n).then(i=>{if(!(n[0]instanceof WebAssembly.Module))debugger;return i})}}},Rb);var kb=hi(function(r,e){let t=" ".repeat(e),n=`
`;function i(s){if(s instanceof Uint8Array)return Uint8Array;if(s instanceof Uint8ClampedArray)return Uint8ClampedArray;if(s instanceof Uint16Array)return Uint16Array;if(s instanceof Uint32Array)return Uint32Array;if(s instanceof BigUint64Array)return BigUint64Array;if(s instanceof Int8Array)return Int8Array;if(s instanceof Int32Array)return Int32Array;if(s instanceof BigInt64Array)return BigInt64Array;if(s instanceof Float32Array)return Float32Array;if(s instanceof Float64Array)return Float64Array}function o(s,a=0,c=[]){switch(typeof s){case"bigint":return`${s}n`;case"boolean":return s.toString();case"function":{let p=s.toString().replace(/^[^\s]+\(/,"function(").split(/\r?\n/g),d=/^$/;for(let f of p){let h=/^[ \t]+/.exec(f);if(h){d=new RegExp(`^[ \\t]{0,${h[0].length}}`);break}}return p.map((f,h)=>h===0?f:(f=f.replace(d,""),h===p.length-1?t.repeat(a)+f:t.repeat(a+1)+f)).join(n)}case"number":return`${s}`;case"object":if(s===null)return"null";if(c.includes(s))return"[Circular]";if(s instanceof Date)return`"${s.toISOString()}"`;if(typeof Node<"u"&&r instanceof Node)return r.outerHTML;let u=i(s);if(u)return`new ${u.name}([${s.join(", ")}])`;if(s instanceof ArrayBuffer)return`new Uint8Array([${new Uint8Array(s).join(", ")}]).buffer`;if(s instanceof Array)return["[",...s.map(p=>t.repeat(a+1)+o(p,a+1,[...c,s])+","),t.repeat(a)+"]"].join(n);let l=s;return["{",...Object.keys(l).map(p=>t.repeat(a+1)+(/^[$a-z_][0-9a-z_$]*$/i.test(p)?p:JSON.stringify(p))+": "+o(l[p],a+1,[...c,s])+","),t.repeat(a)+"}"].join(n);case"string":return JSON.stringify(s);case"symbol":return s.toString();case"undefined":return"undefined";default:return String(s)}}try{return o(r)}catch{return""+r}}),cC=nt(`
function(spaces2) {
const result = ${kb.expr("this","spaces2")};
return result;
}
`);var kr=_(je());var so=_(q());var uC=nt(function(){let r={__proto__:this.__proto__},e=Object.getOwnPropertyNames(this);for(let t=0;t<e.length;++t){let n=e[t],i=n>>>0;if(String(i>>>0)===n&&i>>>0!==4294967295)continue;let o=Object.getOwnPropertyDescriptor(this,n);o&&Object.defineProperty(r,n,o)}return r});var lC=nt(function(r,e){let t={},n=r===-1?0:r,i=e===-1?this.length:r+e;for(let o=n;o<i&&o<this.length;++o){let s=Object.getOwnPropertyDescriptor(this,o);s&&Object.defineProperty(t,o,s)}return t});var pC=nt(function(r,e){let t={},n=r===-1?0:r,i=e===-1?this.childNodes.length:r+e;for(let o=n;o<i&&o<this.childNodes.length;++o){let s=this.childNodes[o];s.nodeName==="#comment"?t[o]=`<!-- ${s.textContent} -->`:s.nodeName==="#text"?t[o]=s.textContent||"":t[o]=s}return t});var dC=nt(function(r){return r.call(this)});var Ob=nt(function(r,e){let{buffer:t,byteLength:n,byteOffset:i}=this instanceof ArrayBuffer?new DataView(this):this instanceof WebAssembly.Memory?new DataView(this.buffer):this,o=i+Math.min(r,n),s=Math.max(0,Math.min(e,n-r));return a(new Uint8Array(t,o,s));function a(c){let u="0123456789abcdef",l="";for(let p=0;p<c.length;p++){let d=c[p];l+=u[d>>>4]+u[d&15]}return l}});var Nb=nt(function(r,e){let t=c(e),{buffer:n,byteLength:i,byteOffset:o}=this instanceof ArrayBuffer?new DataView(this):this instanceof WebAssembly.Memory?new DataView(this.buffer):this,s=o+Math.min(r,i),a=Math.max(0,Math.min(t.length,i-r));return new Uint8Array(n,s,a).set(t.subarray(0,a)),a;function c(u){let l=new Uint8Array(u.length>>>1);for(let p=0;p<u.length;p+=2)l[p>>>1]=parseInt(u.slice(p,p+2),16);return l}});var cc=(()=>{let r=0,e=2147483646;return()=>r++%e+1})(),Qb=r=>{if(typeof r=="string")return{value:r};let e=r;return e.objectId?{objectId:e.objectId}:e.unserializableValue?{unserializableValue:e.unserializableValue}:{value:e.value}},A4=new Set(["typedarray","dataview","arraybuffer","webassemblymemory"]);var yC=1024,w4=/^[$a-z_][0-9a-z_$]*$/i,S4=/^#[0-9a-z_$]+$/i,E4=r=>r.hasOwnProperty("configurable"),fC=(r,e,t)=>{let n=A0(r,Tu(e),t);return fi(n)},hC="<<indescribable>>",bC=r=>{if(!r.startsWith(hC))return r;let e,t;try{[e,t]=JSON.parse(r.slice(hC.length))}catch{return r}return kr.t("{0} (couldn't describe: {1})",e,t)},Bb=r=>!!r&&typeof r=="object"&&"readMemory"in r&&"writeMemory"in r,mC={PARAMETER:{name:kr.t("Parameters"),sortOrder:-10},LOCAL:{name:kr.t("Locals"),sortOrder:-9},GLOBAL:{name:kr.t("Globals"),sortOrder:-8}},wl=class r{constructor(e,t,n,i,o,s,a,c){this.cdp=e;this.parent=t;this.vars=i;this.locationProvider=o;this.currentRef=s;this.settings=a;this.clientCapabilities=c;this.name=n.name,this.presentationHint=n.presentationHint,this.sortOrder=n.sortOrder||0}get customDescriptionGenerator(){return this.settings.customDescriptionGenerator}createVariable(e,t,...n){let i=new e(new r(this.cdp,this.currentRef?.(),t,this.vars,this.locationProvider,()=>i,this.settings,this.clientCapabilities),...n);return i.id>0&&this.vars.add(i),i}createVariableByType(e,t,n){if(Db(t))return this.createVariable(sh,e,t);if(t.objectId){if(t.type==="function")return this.createVariable(qb,e,t,n);if(t.subtype==="map"||t.subtype==="set")return this.createVariable(Gb,e,t,n);if(t.subtype==="node")return this.createVariable(Vb,e,t,n);if(!Cb.has(t.subtype))return this.createVariable(ms,e,t,n)}return this.createVariable(dr,e,t)}async getDescriptionSymbols(e){return this.settings.descriptionSymbols??=oC({cdp:this.cdp,args:[],objectId:e}).then(t=>({objectId:t.objectId}),()=>({value:[]})),await this.settings.descriptionSymbols}async createObjectPropertyVars(e,t){let n=[];if(this.settings.customPropertiesGenerator){let{result:u,errorDescription:l}=await this.evaluateCodeForObject(e,this.settings.customPropertiesGenerator,[]);u&&u.type!=="undefined"?e=u:n.push([this.createVariable(Wb,{name:"",sortOrder:-1},u,u?.description||l||kr.t("Unknown error"))])}if(!e.objectId)return[];t&&this.cdp.DotnetDebugger.setEvaluationOptions({options:t,type:"variable"});let[i,o,s]=await Promise.all([this.cdp.Runtime.getProperties({objectId:e.objectId,accessorPropertiesOnly:!0,ownProperties:!1,generatePreview:!0}),this.cdp.Runtime.getProperties({objectId:e.objectId,ownProperties:!0,generatePreview:!0}),this.cdp.Runtime.callFunctionOn({functionDeclaration:sC.decl(`${yC}`,this.settings.customDescriptionGenerator||"null"),arguments:[await this.getDescriptionSymbols(e.objectId)],objectId:e.objectId,throwOnSideEffect:!0,returnByValue:!0}).then(u=>u?.result.value||{}).catch(()=>({}))]);if(!i||!o)return[];let a=new Map,c=[];for(let u of i.result){if(u.symbol){c.push(u);continue}u.name==="__proto__"&&o.internalProperties?.some(l=>l.name==="[[Prototype]]")||a.set(u.name,u)}for(let u of o.result)u.get||u.set||(u.symbol?c.push(u):a.set(u.name,u));for(let u of[a.values(),c.values()])for(let l of u)n.push(this.createPropertyVar(l,e,s?.hasOwnProperty(l.name)?bC(s[l.name]):void 0));for(let u of o.privateProperties??[])n.push(this.createPropertyVar(u,e,void 0,{presentationHint:{visibility:"private"},sortOrder:1}));for(let u of o.internalProperties||[]){if(u.name==="[[StableObjectId]]")continue;let l;IC(u)?l=this.createFunctionLocationVariable(u):u.value!==void 0&&(l=this.createVariableByType({name:u.name,presentationHint:{visibility:"internal"},sortOrder:2},u.value)),l&&n.push([l])}return Oo(await Promise.all(n))}createFunctionLocationVariable(e){return this.createVariable(ih,{name:e.name,presentationHint:{visibility:"internal",attributes:["readOnly"]},sortOrder:2},e.value)}async createPropertyVar(e,t,n,i){let o=[],s=e.get&&e.get.type!=="undefined",a=e.set&&e.set.type!=="undefined",c={name:e.name,presentationHint:{},sortOrder:0,...i};return i||(E4(e)?(e.enumerable===!1&&!s&&(c.presentationHint.visibility="internal",c.sortOrder=1),(e.writable===!1||s&&!a)&&(c.presentationHint.attributes=["readOnly"])):(c.presentationHint.visibility="private",c.sortOrder=1)),"value"in e&&e.value&&o.push(this.createVariableByType(c,e.value,n)),s?o.push(this.createVariable(zb,c,e.get,t)):a&&o.push(this.createVariable(Xb,c,e.set)),o}async evaluateCodeForObject(e,t,n){try{let i=await this.cdp.Runtime.callFunctionOn({objectId:e.objectId,functionDeclaration:t,arguments:n.map(Qb)});if(i){if(i.exceptionDetails===void 0)return{result:i.result};if(i&&i.result.description)return{errorDescription:i.result.description}}return{errorDescription:kr.t("Unknown error")}}catch(i){return{errorDescription:i.stack||i.message||String(i)}}}},x4=r=>typeof r=="number"||/^[0-9]+$/.test(r),dr=class r{constructor(e,t){this.context=e;this.remoteObject=t;this.id=cc()}get name(){return this.context.name}get sortOrder(){return this.context.sortOrder}get accessor(){let{parent:e,name:t}=this.context;if(e instanceof Sl)return e.accessor;if(!(e instanceof r))return this.context.name;let n=e.context.parent;if(n instanceof r){if(this.remoteObject.subtype==="internal#entry")return`[...${n.accessor}.entries()][${+t}]`;if(e.remoteObject.subtype==="internal#entry")return`${e.accessor}[${this.name==="key"?0:1}]`}return x4(t)?`${e.accessor}[${t}]`:w4.test(t)?`${e.accessor}.${t}`:e.accessor==="this"&&S4.test(t)?`${e.accessor}.${t}`:`${e.accessor}[${JSON.stringify(t)}]`}async toDap(e,t){let n=this.context.name;return this.context.parent instanceof ac&&(n=await this.context.parent.getRename(n)),Promise.resolve({name:n,value:fs(this.remoteObject,e,t),evaluateName:this.accessor,type:this.remoteObject.type,variablesReference:0,presentationHint:this.context.presentationHint})}async setProperty(e,t){let n=await this.context.cdp.Runtime.callFunctionOn({objectId:this.remoteObject.objectId,functionDeclaration:`function(a) { return this[a] = ${t}; ${Ne()} }`,arguments:[Qb(e)],silent:!0});if(!n)throw new T(ve(kr.t("Unable to set variable value")));if(n.exceptionDetails)throw new T(vC(n.exceptionDetails));return this.context.createVariableByType({name:e},n.result)}async getChildren(e){return Promise.resolve([])}},nh=class{constructor(e){this.child=e;this.id=cc()}getChildren(){return Promise.resolve([this.child])}},Fb=class extends dr{constructor(t,n,i,o){super(t,{type:i[0]?.type??"string"});this.value=n;this.args=i;this.stackTrace=o}toDap(){return Promise.resolve({name:this.context.name,value:this.value,variablesReference:this.stackTrace||this.args.some(ds)?this.id:0})}getChildren(t){let n=[],{args:i,stackTrace:o}=this;for(let s=0;s<i.length;++s)ds(i[s])&&n.push(this.context.createVariableByType({name:`arg${s}`,sortOrder:s},i[s]));return o&&n.push(this.context.createVariable(Ub,{name:"",sortOrder:Number.MAX_SAFE_INTEGER},this.remoteObject,o)),Promise.resolve(n)}},Ub=class extends dr{constructor(t,n,i){super(t,n);this.stacktrace=i}async toDap(){return{name:"",value:await this.stacktrace.format(),variablesReference:0}}},ih=class extends dr{constructor(e,t){super(e,t),this.location=t.value}async toDap(){return{name:this.context.name,value:await this.context.locationProvider.renderDebuggerLocation(this.location),variablesReference:0,presentationHint:{visibility:"internal"}}}},Wb=class extends dr{constructor(t,n,i){super(t,n);this.message=i}get accessor(){if(!(this.context.parent instanceof dr))throw new Error("ErrorVariable must have a parent Variable");return this.context.parent.accessor}toDap(){return Promise.resolve({name:this.context.name,value:this.message,variablesReference:0})}},oh=Symbol("NoStringRepr"),ms=class extends dr{constructor(t,n,i){super(t,n);this.customStringRepr=i}async toDap(t,n){let[i,o]=await Promise.all([await super.toDap(t,n),await this.getValueRepresentation(t)]);return{...i,type:this.remoteObject.className||this.remoteObject.subtype||this.remoteObject.type,variablesReference:this.id,memoryReference:A4.has(this.remoteObject.subtype)?String(this.id):void 0,value:o}}async getValueRepresentation(t){if(typeof this.customStringRepr=="string")return this.customStringRepr;if(!this.context.parent&&this.remoteObject.objectId&&this.customStringRepr!==oh)try{let n=await this.context.cdp.Runtime.callFunctionOn({functionDeclaration:eh.decl(`${yC}`,this.context.customDescriptionGenerator||"null"),objectId:this.remoteObject.objectId,returnByValue:!0});if(n?.result.value)return this.customStringRepr=bC(n.result.value)}catch{this.customStringRepr=oh}return this.context.name==="__proto__"&&this.remoteObject.description||fs(this.remoteObject,t)}async readMemory(t,n){let i=await Ob({cdp:this.context.cdp,args:[t,n],objectId:this.remoteObject.objectId,returnByValue:!0});return Buffer.from(i.value,"hex")}async writeMemory(t,n){return(await Nb({cdp:this.context.cdp,args:[t,n.toString("hex")],objectId:this.remoteObject.objectId,returnByValue:!0})).value}getChildren(t){return this.context.createObjectPropertyVars(this.remoteObject,t.evaluationOptions)}},jb=class extends ms{constructor(){super(...arguments);this.id=cc()}get accessor(){return this.context.parent.accessor}async toDap(t,n){return Promise.resolve({...await super.toDap(t,n),value:"..."})}},Vb=class extends dr{constructor(){super(...arguments);this.description=ne(()=>this.context.cdp.DOM.describeNode({objectId:this.remoteObject.objectId}))}async toDap(t,n){let o=(await this.description())?.node?.childNodeCount||0;return{...await super.toDap(t,n),value:await this.getValuePreview(t),variablesReference:this.id,indexedVariables:o>100?o:void 0,namedVariables:o>100?1:void 0}}async getChildren(t){switch(t?.filter){case"indexed":return this.getNodeChildren(t.start,t.count);case"named":return[this.getAttributesVar()];default:return[this.getAttributesVar(),...await this.getNodeChildren()]}}getAttributesVar(){return this.context.createVariable(jb,{name:kr.t("Node Attributes"),presentationHint:{visibility:"internal"},sortOrder:Number.MAX_SAFE_INTEGER},this.remoteObject,void 0)}async getNodeChildren(t=-1,n=-1){let i;try{i=await pC({cdp:this.context.cdp,generatePreview:!1,args:[t,n],objectId:this.remoteObject.objectId})}catch{return[]}let o=await this.context.createObjectPropertyVars(i);return i.objectId&&await this.context.cdp.Runtime.releaseObject({objectId:i.objectId}),o}async getValuePreview(t){let n=await this.description();if(!n?.node)return"";let{localName:i,attributes:o,childNodeCount:s}=n.node,a=this.context.clientCapabilities.value?.supportsANSIStyling?!0:"",c=(a&&"\x1B[34m")+`<${i}`;if(o)for(let u=0;u<o.length;u+=2){let l=o[u],p=o[u+1];c+=` ${a&&"\x1B[34;1m"}${l}${a&&"\x1B[2m"}=${a&&"\x1B[33m"}${JSON.stringify(p)}`}return c+=(a&&"\x1B[34m")+">",s&&(c+=`${a&&"\x1B[2m"}...${a&&"\x1B[34m"}`),c+=`</${i}>${a&&"\x1B[0m"}`,c}},qb=class extends ms{async toDap(e){let[t,n]=await Promise.all([super.toDap(e),this.context.cdp.Runtime.getProperties({objectId:this.remoteObject.objectId,ownProperties:!0,nonIndexedPropertiesOnly:!0})]),i=n?.internalProperties?.find(IC);return i&&(t.valueLocationReference=this.context.createFunctionLocationVariable(i).id),t}},HC="[[Entries]]",Gb=class extends ms{constructor(t,n){super(t,n,oh);this.baseChildren=ne(()=>super.getChildren({variablesReference:this.id}));this.isMap=n.subtype==="map";let i=n.preview;this.size=Number(i?.properties.find(o=>o.name==="size")?.value)??void 0}async toDap(t){let n=await super.toDap(t);return this.size&&this.size>100&&(n.indexedVariables=this.size),n}async getChildren(t){let n=await this.baseChildren();return[...(await n.find(o=>o.name===HC)?.getChildren(t)||[]).filter(o=>o.sortOrder===0),...n.filter(o=>o.name!==HC)]}},sh=class extends ms{constructor(t,n){super(t,n,oh);this.length=0;let i=String(n.description).match(/\(([0-9]+)\)/);this.length=i?+i[1]:0}async toDap(t){return{...await super.toDap(t),indexedVariables:this.length>100?this.length:void 0,namedVariables:this.length>100?1:void 0}}async getChildren(t){switch(t?.filter){case"indexed":return this.getArraySlots(t);case"named":return this.getArrayProperties();default:return Promise.all([this.getArrayProperties(),this.getArraySlots()]).then(Oo)}}async getArrayProperties(){try{let t=await uC({cdp:this.context.cdp,args:[],objectId:this.remoteObject.objectId,generatePreview:!0});return this.context.createObjectPropertyVars(t)}catch{return[]}}async getArraySlots(t){let n=t&&typeof t.start<"u"?t.start:-1,i=t&&typeof t.count<"u"?t.count:-1,o;try{o=await lC({cdp:this.context.cdp,generatePreview:!1,args:[n,i],objectId:this.remoteObject.objectId})}catch{return[]}let s=await this.context.createObjectPropertyVars(o);return o.objectId&&await this.context.cdp.Runtime.releaseObject({objectId:o.objectId}),s}},Kb=class extends sh{async toDap(e){return this.remoteObject.preview?{...await super.toDap(e),name:nC(this.remoteObject.preview)}:super.toDap(e)}},Sl=class extends dr{constructor(e,t){super(e,t)}getChildren(e){return this.context.createObjectPropertyVars(this.remoteObject)}},Xb=class extends Sl{async toDap(e,t){return{...await super.toDap(e,t),value:"write-only",variablesReference:this.id}}},zb=class extends Sl{constructor(t,n,i){super(t,n);this.parentObject=i}async toDap(t,n){let i=await super.toDap(t,n);return i.variablesReference=this.id,i.presentationHint={...i.presentationHint,lazy:!0},i}async getChildren(t){try{let n=await dC({cdp:this.context.cdp,objectId:this.parentObject.objectId,args:[new Ru(this.remoteObject.objectId)]});return[this.context.createVariableByType({name:this.name,presentationHint:this.context.presentationHint},n)]}catch(n){if(!(n instanceof qo))throw n}return super.getChildren(t)}},ah=class r{constructor(e,t,n){this.context=e;this.variable=t;this.scopeRef=n;this.id=cc();this.sortOrder=0}static{this.presentationHint={attributes:["readOnly"]}}toDap(){return Promise.resolve({name:this.context.name,value:this.variable.description||"",variablesReference:this.variable.getChildren?this.id:0,memoryReference:this.variable.linearMemoryAddress?String(this.id):void 0,presentationHint:this.context.presentationHint})}async getChildren(){return(await this.variable.getChildren?.()||[]).map(t=>this.context.createVariable(r,{name:t.name,presentationHint:r.presentationHint},t.value,this.scopeRef))}async readMemory(e,t){let n=this.variable.linearMemoryAddress;if(n===void 0)return;let i=await this.context.cdp.Debugger.evaluateOnCallFrame({callFrameId:this.scopeRef.callFrameId,expression:`(${Ob.source}).call(memories[0].buffer, ${+n+e}, ${+t}) ${Ne()}`,returnByValue:!0});if(!i)throw new qo({exceptionId:0,text:"No response from CDP",lineNumber:0,columnNumber:0});return Buffer.from(i.result.value,"hex")}async writeMemory(e,t){let n=this.variable.linearMemoryAddress;return n===void 0?0:(await this.context.cdp.Debugger.evaluateOnCallFrame({callFrameId:this.scopeRef.callFrameId,expression:`(${Nb.source}).call(memories[0].buffer, ${+n+e}, ${JSON.stringify(t.toString("hex"))}) ${Ne()}`,returnByValue:!0}))?.result.value||0}},Jb=class{constructor(e,t,n,i){this.context=e;this.kind=t;this.variables=n;this.scopeRef=i;this.id=cc();this.sortOrder=mC[this.kind]?.sortOrder||0}toDap(){return Promise.resolve({name:mC[this.kind]?.name||this.kind,value:"",variablesReference:this.id})}getChildren(){return Promise.all(this.variables.map(async e=>{let t=await e.evaluate();return this.context.createVariable(ah,{name:e.name,presentationHint:ah.presentationHint},t,this.scopeRef)}))}},ac=class{constructor(e,t,n,i,o){this.remoteObject=e;this.context=t;this.ref=n;this.extraProperties=i;this.renameProvider=o;this.id=cc()}async getChildren(e){let t=await this.context.createObjectPropertyVars(this.remoteObject),n=new Set(t.map(i=>i.name));for(let i of this.extraProperties)n.has(i.name)||t.push(this.context.createVariableByType({name:i.name},i.value));return t}async getRename(e){return(await this.renameProvider.provideOnStackframe(this.ref.stackFrame)).getOriginalName(e,this.ref.stackFrame.rawPosition)||e}async setProperty(e,t){let n=await this.context.cdp.Debugger.evaluateOnCallFrame({expression:`${t} ${Ne()}`,callFrameId:this.ref.callFrameId});if(!n)throw new T(ye(kr.t("Invalid expression")));if(n.exceptionDetails)throw new T(vC(n.exceptionDetails));return await this.context.cdp.Debugger.setVariableValue({callFrameId:this.ref.callFrameId,scopeNumber:this.ref.scopeNumber,variableName:e,newValue:Qb(n.result)}),this.context.createVariableByType({name:e},n.result)}},Yb=class{constructor(){this.value=new Map}get(e){return this.value.get(e)}add(e){this.value.set(e.id,e)}clear(){this.value.clear()}},ao=class{constructor(e,t,n,i,o,s){this.renameProvider=e;this.cdp=t;this.dap=n;this.launchConfig=i;this.clientCapabilities=o;this.locationProvider=s;this.vars=new Yb;this.contextSettings={customDescriptionGenerator:i.customDescriptionGenerator&&fC(["defaultValue"],i.customDescriptionGenerator,!1),customPropertiesGenerator:i.customPropertiesGenerator&&fC([],i.customPropertiesGenerator,!1)}}createDetached(){return new ao(this.renameProvider,this.cdp,this.dap,this.launchConfig,this.clientCapabilities,this.locationProvider)}clear(){this.vars.clear()}createFloatingVariable(e,t){return this.createFloatingContext().createVariableByType({name:e},t)}createVariableForOutput(e,t,n,i){let o=this.createFloatingContext(),s=t.length===1&&i==="table"?o.createVariable(Kb,{name:""},t[0]):t.length===1&&ds(t[0])&&!n?o.createVariableByType({name:""},t[0]):o.createVariable(Fb,{name:""},e,t,n),a=new nh(s);return this.vars.add(a),a}createScope(e,t,n){let i=new ac(e,new wl(this.cdp,void 0,{name:""},this.vars,this.locationProvider,()=>i,this.contextSettings,this.clientCapabilities),t,n,this.renameProvider);return this.vars.add(i),i}createWasmScope(e,t,n){let i=new Jb(new wl(this.cdp,void 0,{name:""},this.vars,this.locationProvider,()=>i,this.contextSettings,this.clientCapabilities),e,t,n);return this.vars.add(i),i}hasVariable(e){return!!this.vars.get(e)}hasMemory(e){return Bb(this.vars.get(Number(e)))}async readMemory(e,t,n){let i=this.vars.get(Number(e));return Bb(i)?i.readMemory(t,n):void 0}async writeMemory(e,t,n){let i=this.vars.get(Number(e)),o=Bb(i)?await i.writeMemory(t,n):0;return o>0&&this.dap.invalidated({areas:["variables"]}),o}async getVariableNames(e){let t=this.vars.get(e.variablesReference);return t?(await t.getChildren(e)).filter(Ro(dr)):[]}async getVariables(e){let t=this.vars.get(e.variablesReference);if(!t)return[];let n=await t.getChildren(e);return(await Promise.all(n.map(o=>o.toDap(t instanceof ac||t instanceof nh?"repl":"propertyValue",e.format).then(s=>({v:o,dap:s}))))).sort((o,s)=>o.v.sortOrder-s.v.sortOrder||+o.dap.name-+s.dap.name||o.dap.name.localeCompare(s.dap.name)).map(o=>o.dap)}async getLocations(e){let t=this.vars.get(e);if(!t||!(t instanceof ih))throw Gu();return t.location}async setVariable(e){let t=this.vars.get(e.variablesReference);if(!e.value)throw new T(ye(kr.t("Cannot set an empty value")));if(t instanceof ac||t instanceof dr)return await(await t.setProperty(e.name,e.value)).toDap("propertyValue",e.format);throw new T(ve(kr.t("Variable not found")))}createFloatingContext(){return new wl(this.cdp,void 0,{name:"<unnamed>"},this.vars,this.locationProvider,void 0,this.contextSettings,this.clientCapabilities)}};ao=E([(0,so.injectable)(),g(0,(0,so.inject)(zi)),g(1,(0,so.inject)(Be)),g(2,(0,so.inject)(Yt)),g(3,(0,so.inject)(de)),g(4,(0,so.inject)(ro))],ao);function vC(r){let e=r.exception&&hs(r.exception).title||r.text;return ye(e)}function IC(r){return r.name==="[[FunctionLocation]]"&&!!r.value&&r.value.subtype==="internal#location"}var Zb=class{constructor(e){this.description=e;this.sourceMapLoads=new Map;this.scripts=[]}get isDefault(){return this.description.auxData&&this.description.auxData.isDefault}async remove(e){await Promise.all(this.scripts.map(async t=>{let n=await t.source;n.filterScripts(i=>i.executionContextId!==this.description.id),n.scripts.length||e.removeSource(n)}))}},ev=class{constructor(e){this._obj=e;this._dapDeferred=ge()}resolve(){this._dapDeferred.resolve(this._obj)}with(e){return this._dapDeferred.hasSettled()?e(this._obj):this._dapDeferred.promise.then(t=>e(t))}},L4=50,_C=(r,e)=>r.sourceReference===e.sourceReference&&Fd(r.path||"",e.path||""),$4=()=>`
//# sourceURL=eval-${(0,AC.randomBytes)(4).toString("hex")}.repl
`,tv=class{async enqueue(e,t){if(this.queue?.operation===e&&await new Promise(n=>setTimeout(n)),!this.queue||this.queue.operation!==e){let n=this.queue?.result.then(t,t)??t(),i=this.queue={operation:e,result:n.finally(()=>{this.queue===i&&(this.queue=void 0)})}}return this.queue.result}};var uc=class r{constructor(e,t,n,i,o,s,a,c,u,l,p,d,f,h,m){this.target=i;this.logger=s;this.evaluator=a;this.completer=c;this.launchConfig=u;this._breakpointManager=l;this.console=p;this.exceptionPause=d;this._smartStepper=f;this.shutdown=h;this._executionContexts=new Map;this._excludedCallers=[];this.stateQueue=new tv;this._onPausedEmitter=new C;this.disposed=!1;this.debuggerReady=ge();this.onPaused=this._onPausedEmitter.event;this._dap=new ev(n),this._sourceContainer=e,this._cdp=t,this.id=r._lastThreadId++,this.replVariables=new ao(o,this._cdp,n,u,m,this),e.onSourceMappedSteppingChange(()=>this.refreshStackTrace()),this._initialize()}static{this._lastThreadId=0}static{this._allThreadsByDebuggerId=new Map}setExcludedCallers(e){this._excludedCallers=e}cdp(){return this._cdp}name(){return this.target.name()}pausedDetails(){return this._pausedDetails}pausedVariables(){return this._pausedVariables}defaultExecutionContext(){for(let e of this._executionContexts.values())if(e.isDefault)return e}resume(){return this.stateQueue.enqueue("resume",async()=>(this._sourceContainer.clearDisabledSourceMaps(),!await this._cdp.Debugger.resume({})&&this._pausedDetails!==void 0?ve(he.t("Unable to resume")):{allThreadsContinued:!1}))}pause(){return this.stateQueue.enqueue("pause",async()=>(this._expectedPauseReason={reason:"pause"},await this._cdp.Debugger.pause({})?{}:ve(he.t("Unable to pause"))))}stepOver(){return this.stateQueue.enqueue("stepOver",async()=>{this._expectedPauseReason={reason:"step",direction:1};let e=await this.getCurrentSkipList(1);return await this._cdp.Debugger.stepOver({skipList:e})?{}:ve(he.t("Unable to step next"))})}stepInto(e){return this.stateQueue.enqueue("stepInto",async()=>{this._waitingForStepIn={lastDetails:this._pausedDetails},this._expectedPauseReason={reason:"step",direction:0};let t=this._pausedDetails?.stepInTargets?.[e];if(t){let n=await this._cdp.Debugger.setBreakpoint({location:t.breakLocation});if(this._waitingForStepIn.intoTargetBreakpoint=n?.breakpointId,await this._cdp.Debugger.resume({}))return{}}else{let n=await this.getCurrentSkipList(0);if(await this._cdp.Debugger.stepInto({breakOnAsyncCall:!0,skipList:n}))return{}}return ve(he.t("Unable to step in"))})}stepOut(){return this.stateQueue.enqueue("stepOut",async()=>(this._expectedPauseReason={reason:"step",direction:2},await this._cdp.Debugger.stepOut({})?{}:ve(he.t("Unable to step out"))))}async getCurrentSkipList(e){if(!this._pausedDetails)return;let[t]=await this._pausedDetails.stackTrace.loadFrames(1);if(!t||!wC(t))return;let n=await t.getStepSkipList(e);if(n)return nr.simplify(n).map(i=>({start:i.begin.base0,end:i.end.base0,scriptId:t.root.scriptId}))}_stackFrameNotFoundError(){return ve(he.t("Stack frame not found"))}_evaluateOnAsyncFrameError(){return ve(he.t("Unable to evaluate on async stack frame"))}async restartFrame(e){let t=this._pausedDetails?.stackTrace.frame(e.frameId)?.root;if(!t)return this._stackFrameNotFoundError();let n=t.callFrameId();return n?await this._cdp.Debugger.restartFrame({callFrameId:n,mode:"StepInto"})?(this._expectedPauseReason={reason:"frame_entry",description:he.t("Paused on frame entry")},t.canExplicitlyBeRestarted||await this._cdp.Debugger.stepInto({}),{}):ye(he.t("Frame could not be restarted")):ye(he.t("Cannot restart asynchronous frame"))}async stackTrace(e){return this._pausedDetails?this._pausedDetails.stackTrace.toDap(e):ve(he.t("Thread is not paused"))}async scopes(e){let t=this._pausedDetails?this._pausedDetails.stackTrace.frame(e.frameId):void 0;return t?t.scopes():this._stackFrameNotFoundError()}async exceptionInfo(){let e=this._pausedDetails&&this._pausedDetails.exception;if(!e)return ve(he.t("Thread is not paused on exception"));let t=hs(e);return{exceptionId:t.title,breakMode:"all",details:{stackTrace:t.stackTrace,evaluateName:void 0}}}async revealPage(){return this._cdp.Page.bringToFront({}),{}}async completions(e){let t;if(e.frameId!==void 0){if(t=this._pausedDetails?this._pausedDetails.stackTrace.frame(e.frameId)?.root:void 0,!t)return this._stackFrameNotFoundError();if(!t.callFrameId())return this._evaluateOnAsyncFrameError()}if(e.line===1&&e.text.startsWith("cd "))return{targets:this.getExecutionContextCompletions(e)};let n=await this.completer.completions({executionContextId:this._selectedContext?this._selectedContext.description.id:void 0,stackFrame:t,expression:e.text,position:new ke(e.line||1,e.column)});return{targets:[...this.getExecutionContextCompletions(e),...n]}}getExecutionContextCompletions(e){if(e.line&&e.line>1)return[];let t=e.text.slice(0,e.column).trim();return[...this._executionContexts.values()].map(n=>`cd ${this.target.executionContextName(n.description)}`).filter(n=>n.startsWith(t)).map(n=>({label:n,start:0,length:e.text.length}))}async _evaluteWasm(e,t,n){if(!e)return;let i=e.root,o=i.callFrameId(),s=await i.scriptSource?.source;if(!zo(s)||!o)return;let a=await s.sourceMap.value.promise;if(!a.evaluate)return;let c=new Ve(e instanceof xl?e.inlineFrameIndex:0,i.rawPosition.base0.columnNumber),u=await a.evaluate(o,c,t.expression);if(u)return await n.createFloatingVariable(t.expression,u).toDap(t.context,t.format)}async _evaluteJs(e,t,n){let i=t.context==="clipboard"?{expression:kb.expr(t.expression,"2"),includeCommandLineAPI:!0,returnByValue:!0,objectGroup:"console"}:{expression:t.expression,includeCommandLineAPI:!0,objectGroup:"console",generatePreview:!0,timeout:t.context==="hover"?this.getHoverEvalTimeout():void 0};if(t.context==="repl"){if(i.expression=Fu(i.expression),i.expression.indexOf("await")!==-1){let u=V0(i.expression);u&&(i.expression=u,i.awaitPromise=!0)}i.expression+=$4()}t.evaluationOptions&&this.cdp().DotnetDebugger.setEvaluationOptions({options:t.evaluationOptions,type:"evaluation"});let o;if(t.source&&t.line&&t.column){let u=this._pausedVariables,l=this._sourceContainer.source(t.source);l&&u&&(o={source:l,position:new ke(t.line,t.column),variables:u})}let s=e?.root.callFrameId(),a=this.evaluator.evaluate(s?{...i,callFrameId:s}:{...i,contextId:this._selectedContext?this._selectedContext.description.id:void 0},{isInternalScript:!1,stackFrame:e?.root,location:o});if(t.context==="repl")return await this._evaluateRepl(t,a,t.format);let c=await a;if(!c)throw new T(ve(he.t("Unable to evaluate")));if(c.exceptionDetails){let u=c.exceptionDetails.exception?hs(c.exceptionDetails.exception).title:c.exceptionDetails.text;throw u.startsWith("Uncaught")||(u="Uncaught "+u),new T(ve(u))}return n.createFloatingVariable(i.expression,c.result).toDap(t.context,t.format)}async evaluate(e){let t,n;if(e.frameId!==void 0){if(n=this._pausedDetails?this._pausedDetails.stackTrace.frame(e.frameId):void 0,!n)throw new T(this._stackFrameNotFoundError());if(t=n.root.callFrameId(),!t)throw new T(this._evaluateOnAsyncFrameError())}if(e.context==="repl"&&e.expression.startsWith("cd ")){let s=e.expression.substring(3).trim();for(let a of this._executionContexts.values())if(this.target.executionContextName(a.description)===s)return this._selectedContext=a,{result:`[${s}]`,variablesReference:0}}let i=t?this._pausedVariables:this.replVariables;if(!i)throw new T(ve(he.t("Unable to evaluate")));let o=await this._evaluteWasm(n,e,i)??await this._evaluteJs(n,e,i);return{type:o.type,result:o.value,variablesReference:o.variablesReference,namedVariables:o.namedVariables,indexedVariables:o.indexedVariables,memoryReference:o.memoryReference,valueLocationReference:o.valueLocationReference}}getHoverEvalTimeout(){let e=this.launchConfig.timeouts?.hoverEvaluation;if(e===void 0)return 500;if(!(e<=0))return e}async _evaluateRepl(e,t,n){let i=await t;if(!i)return{name:e.expression,value:"",variablesReference:0};if(i.exceptionDetails){let c=await new El(i.exceptionDetails).toDap(this);throw new T(Hx(c.output))}let o=this._selectedContext&&this.defaultExecutionContext()!==this._selectedContext?`\x1B[33m[${this.target.executionContextName(this._selectedContext.description)}] `:"",s=await this.replVariables.createFloatingVariable(e.expression,i.result).toDap("repl",n),a=Yf("repl").budget;return s.variablesReference===0&&s.value.length===a&&setImmediate(()=>this.console.enqueue(this,{toDap:()=>({output:he.t("Output has been truncated to the first {0} characters. Run `{1}` to copy the full output.",a,`copy(${e.expression.trim()})`),category:"stdout"})})),{...s,value:`${o}${s.value}`}}_initialize(){this._cdp.Runtime.on("executionContextCreated",e=>{this._executionContextCreated(e.context)}),this._cdp.Runtime.on("executionContextDestroyed",e=>{this._executionContextDestroyed(e.executionContextId)}),this._cdp.Runtime.on("executionContextsCleared",()=>{this._ensureDebuggerEnabledAndRefreshDebuggerId(),this.replVariables.clear(),this._executionContextsCleared()}),this._cdp.Inspector.on("targetReloadedAfterCrash",()=>{this._breakpointManager.reapply()}),this.launchConfig.outputCapture==="console"&&(this._cdp.Runtime.on("consoleAPICalled",e=>{this.console.dispatch(this,e)}),this._cdp.Runtime.on("exceptionThrown",e=>{this.console.enqueue(this,new El(e.exceptionDetails))})),this._cdp.Runtime.on("inspectRequested",e=>{e.hints.copyToClipboard?this._copyObjectToClipboard(e.object):e.hints.queryObjects?this.console.enqueue(this,new ch(e.object,this.cdp())):this._revealObject(e.object)}),this._cdp.Debugger.on("paused",async e=>this._onPaused(e)),this._cdp.Debugger.on("resumed",()=>this.onResumed()),this._cdp.Debugger.on("scriptParsed",e=>this._onScriptParsed(e)),this._cdp.Debugger.on("scriptFailedToParse",e=>this._onScriptParsed(e)),this._cdp.Runtime.enable({}),this._cdp.Profiler.enable({}),this._ensureDebuggerEnabledAndRefreshDebuggerId(),this.launchConfig.noDebug&&this.logger.info("runtime.launch","Running with noDebug, so debug domains are disabled"),this.target.initialize(),this._dap.with(e=>e.thread({reason:"started",threadId:this.id}))}dapInitialized(){this._dap.resolve()}async enableNetworking({mirrorEvents:e}){if(!await this._cdp.Network.enable({}))throw bx();return this._dap.with(n=>{for(let i of e)this._cdp.Network.on(i,o=>n.networkEvent({data:o,event:i}))}),{}}async getStepInTargets(e){let t=this._pausedDetails;if(!t)return[];let n=t.stackTrace.frames.find(l=>l.frameId===e);if(!(n instanceof Mt))return[];let i=await n.uiLocation();if(!i)return[];let o=t.event.callFrames[0].location,[s,a]=await Promise.all([this._breakpointManager.getBreakpointLocations(this,i.source,new ke(i.lineNumber,1),new ke(i.lineNumber+1,1)).then(l=>l.filter(p=>p.breakLocation.lineNumber!==o.lineNumber||p.breakLocation.columnNumber!==o.columnNumber)),i.source.content()]),c=t.stepInTargets?.length||0;t.stepInTargets=t.stepInTargets?.concat(s)||s;let u=a&&new ji(a);return s.map((l,p)=>{let d=l.uiLocations.find(h=>h.source===i.source);if(!d)return;if(!u)return{id:c+p,label:`Column ${d}`,line:d.lineNumber,column:d.columnNumber};let f=q0(a.slice(u.getLineOffset(d.lineNumber-1),u.getLineOffset(d.lineNumber)),d.columnNumber-1);if(f)return{id:c+p,label:f.text,line:d.lineNumber,column:f.start+1,endLine:d.lineNumber,endColumn:f.end+1}}).filter(It)}async refreshStackTrace(){this._pausedDetails&&(this._pausedDetails=await this._createPausedDetails(this._pausedDetails.event),this._onThreadResumed(),await this._onThreadPaused(this._pausedDetails))}_executionContextCreated(e){let t=new Zb(e);return this._executionContexts.set(e.id,t),this._scriptWithSourceMapHandler&&this._installWasmPauseHandler(e.id),t}_installWasmPauseHandler(e){return this._cdp.Runtime.evaluate({expression:aC.expr(),silent:!0,contextId:e})}async _executionContextDestroyed(e){let t=this._executionContexts.get(e);t&&(this._executionContexts.delete(e),await this.shutdown.shutdownContext(),t.remove(this._sourceContainer))}async _executionContextsCleared(){let e=[...this._executionContexts.values()],t=this._pausedDetails;this._executionContexts.clear(),await this.shutdown.shutdownContext();for(let n of e)n.remove(this._sourceContainer);this._breakpointManager.executionContextWasCleared(),t&&t===this._pausedDetails&&this.onResumed()}_ensureDebuggerEnabledAndRefreshDebuggerId(){if(this.launchConfig.noDebug)return this.debuggerReady.resolve();this._cdp.Debugger.enable({}).then(e=>{this.debuggerReady.resolve(),e&&r._allThreadsByDebuggerId.set(e.debuggerId,this)}),this.exceptionPause.apply(this._cdp)}async _onPaused(e){let t=e.hitBreakpoints??[],n=e.reason==="Break on start"||e.reason==="debugCommand",i=e.callFrames[0]?.location,o=e.data?.scriptId||i?.scriptId,s=o&&this._sourceContainer.getSourceScriptById(o)?.url===Rb,a=o&&(e.reason==="instrumentation"||this._breakpointManager.isEntrypointBreak(t,o)||t.some(p=>this._pauseOnSourceMapBreakpointIds?.includes(p))||s);if(this.evaluator.setReturnedValue(e.callFrames[0]?.returnValue),a){this.launchConfig.perScriptSourcemaps==="auto"&&this._shouldEnablePerScriptSms(e)&&await this._enablePerScriptSourcemaps(),e.data&&!n&&(e.data.__rewriteAs="breakpoint");let p=this._expectedPauseReason;if(s){let d=this._lastParsedWasmScriptIds;return this._lastParsedWasmScriptIds=void 0,d&&await Promise.all(d.map(f=>this._handleSourceMapPause(f,i))),this.resume()}else if(!(o&&await this._handleSourceMapPause(o,i))){if(!n){if(await this.isCrossThreadStep(e))e.data={...e.data,__rewriteAs:"step"};else if(!await this._breakpointManager.shouldPauseAt(e,t,this.target.entryBreakpoint,!0))if(p?.reason==="step"){if(p.direction!==0)return this._cdp.Debugger.resume({})}else return this.resume()}}}else if(!(e.reason==="exception"||e.reason==="promiseRejection"?await this.exceptionPause.shouldPauseAt(e):await this._breakpointManager.shouldPauseAt(e,t,this.target.entryBreakpoint,!1)))return this.resume();let c=this._waitingForStepIn?.intoTargetBreakpoint;if(c){e.hitBreakpoints?.includes(c)?(this._waitingForStepIn.intoTargetBreakpoint=void 0,await this._cdp.Debugger.removeBreakpoint({breakpointId:c}),await this._cdp.Debugger.stepInto({breakOnAsyncCall:!1})):this.resume();return}if(n&&("continueOnAttach"in this.launchConfig&&this.launchConfig.continueOnAttach||this.launchConfig.type==="pwa-extensionHost"||this.target instanceof sc)){this.resume();return}let u=this._pausedDetails=await this._createPausedDetails(e);if(this._excludedCallers.length&&await this._matchesExcludedCaller(this._pausedDetails.stackTrace)){this.logger.info("runtime","Skipping pause due to excluded caller"),this.resume();return}let l=await this._smartStepper.getSmartStepDirection(u,this._expectedPauseReason);if(this._pausedDetails===u){switch(l){case 0:return this.stepInto();case 2:return this.stepOut();case 1:return this.stepOver();default:}this._waitingForStepIn=void 0,this._pausedVariables=this.replVariables.createDetached(),await this._onThreadPaused(u)}}async _matchesExcludedCaller(e){if(!this._excludedCallers.length)return!1;let t=e.frames[0],n=t instanceof Mt&&await t.uiLocation();if(!n)return!1;let i,o,s=[];for(let{caller:a,target:c}of this._excludedCallers)if(!(c.line!==n.lineNumber||c.column!==n.columnNumber)&&(i??=await n.source.toDap(),!!_C(i,c.source))){o||(o=await e.loadFrames(L4).then(l=>Promise.all(l.slice(1).filter(Ro(Mt)).map(p=>p.uiLocation()))));for(let u=0;u<o.length;u++){let l=o[u];if(!l||l.lineNumber!==a.line||l.columnNumber!==a.column)continue;let p=s[u]??=await l.source.toDap();if(_C(p,a.source))return!0}}return!1}onResumed(){this._pausedDetails=void 0,this._pausedVariables=void 0,this.evaluator.setReturnedValue(void 0),this._onThreadResumed()}async dispose(){await this.shutdown.shutdownAll(),this.disposed=!0;for(let[e,t]of r._allThreadsByDebuggerId)t===this&&r._allThreadsByDebuggerId.delete(e);this._removeAllScripts(!0),this._executionContextsCleared(),await this._dap.with(e=>e.thread({reason:"exited",threadId:this.id}))}rawLocation(e){if("location"in e){let t=e;return{lineNumber:Math.max(0,t.location.lineNumber)+1,columnNumber:Math.max(0,t.location.columnNumber||0)+1,scriptId:t.location.scriptId}}return{lineNumber:Math.max(0,e.lineNumber)+1,columnNumber:Math.max(0,e.columnNumber||0)+1,scriptId:e.scriptId}}rawLocationToUiLocation(e){if(!e.scriptId||this.disposed||this.launchConfig.noDebug)return;let t=this._sourceContainer.getScriptById(e.scriptId);return t?t.resolvedSource?this._sourceContainer.preferredUiLocation({...t.resolvedSource.offsetScriptToSource(e),source:t.resolvedSource}):t.source.then(n=>this._sourceContainer.preferredUiLocation({...n.offsetSourceToScript(e),source:n})):this.rawLocationToUiLocationWithWaiting(e)}async rawLocationToUiLocationWithWaiting(e){let t=e.scriptId?await this.getScriptByIdOrWait(e.scriptId):void 0;if(!t)return;let n=await t.source;return this._sourceContainer.preferredUiLocation({...n.offsetScriptToSource(e),source:n})}getScriptById(e){return this._sourceContainer.getScriptById(e)}getScriptByIdOrWait(e,t=500){return this._sourceContainer.getScriptById(e)||this.waitForScriptId(e,t)}waitForScriptId(e,t){return new Promise(n=>{let i=this._sourceContainer.onScript(s=>{s.scriptId===e&&(n(s),i.dispose(),clearTimeout(o))}),o=setTimeout(()=>{n(void 0),i.dispose()},t)})}async renderDebuggerLocation(e){let t=this.rawLocation(e),n=await this.rawLocationToUiLocation(t);return n?`@ ${await n.source.prettyName()}:${n.lineNumber}`:`@ VM${t.scriptId||"XX"}:${t.lineNumber}`}async updateCustomBreakpoints(e,t){if(!this.target.supportsCustomBreakpoints())return;this._enabledCustomBreakpoints??=new Set;let n=new Set;for(let o of e)n.add("x"+o);for(let o of t)n.add("e"+o);let i=[];for(let o of n)if(!this._enabledCustomBreakpoints.has(o)){let s=o.slice(1);i.push(o.startsWith("x")?this._cdp.DOMDebugger.setXHRBreakpoint({url:s}):rh().get(s)?.apply(this._cdp,!0))}for(let o of this._enabledCustomBreakpoints)if(!n.has(o)){let s=o.slice(1);i.push(o.startsWith("x")?this._cdp.DOMDebugger.removeXHRBreakpoint({url:s}):rh().get(s)?.apply(this._cdp,!1))}this._enabledCustomBreakpoints=n,await Promise.all(i)}async _createPausedDetails(e){let t=e.reason==="assert"||e.reason==="exception"||e.reason==="promiseRejection"||e.reason==="other"||e.reason==="ambiguous",n=e.hitBreakpoints?.filter(o=>!this._breakpointManager.isEntrypointCdpBreak(o))||[];if((n.length||!t)&&this._sourceContainer.clearDisabledSourceMaps(),e.hitBreakpoints&&this._sourceMapDisabler)for(let o of this._sourceMapDisabler(e.hitBreakpoints))this._sourceContainer.disableSourceMapForSource(o);let i=Ai.fromDebugger(this,e.callFrames,e.asyncStackTrace,e.asyncStackTraceId);if(e.data?.__rewriteAs==="breakpoint")return{thread:this,event:e,stackTrace:i,reason:"breakpoint",description:he.t("Paused on breakpoint")};if(e.data?.__rewriteAs==="step")return{thread:this,event:e,stackTrace:i,reason:"step",description:he.t("Paused")};switch(e.reason){case"assert":return{thread:this,event:e,stackTrace:i,reason:"exception",description:he.t("Paused on assert")};case"debugCommand":return{thread:this,event:e,stackTrace:i,reason:"pause",description:he.t("Paused on debug() call")};case"DOM":return{thread:this,event:e,stackTrace:i,reason:"data breakpoint",description:he.t("Paused on DOM breakpoint")};case"EventListener":return this._resolveEventListenerBreakpointDetails(i,e);case"exception":return{thread:this,event:e,stackTrace:i,reason:"exception",description:he.t("Paused on exception"),exception:e.data};case"promiseRejection":return{thread:this,event:e,stackTrace:i,reason:"exception",description:he.t("Paused on {0}","promise rejection"),exception:e.data};case"instrumentation":return e.data&&e.data.scriptId?{thread:this,event:e,stackTrace:i,reason:"step",description:he.t("Paused")}:{thread:this,event:e,stackTrace:i,reason:"function breakpoint",description:he.t("Paused on instrumentation breakpoint")};case"XHR":return{thread:this,event:e,stackTrace:i,reason:"data breakpoint",description:he.t("Paused on XMLHttpRequest or fetch")};case"OOM":return{thread:this,event:e,stackTrace:i,reason:"exception",description:he.t("Paused before Out Of Memory exception")};default:if(n.length){let o=!1,s=this.target.entryBreakpoint;if(s&&n.includes(s.cdpId)){o=!0;let a=this._sourceContainer.source({path:We(s.path)});a!==void 0&&(o=!(await this._sourceContainer.currentSiblingUiLocations({lineNumber:e.callFrames[0].location.lineNumber+1,columnNumber:(e.callFrames[0].location.columnNumber||0)+1,source:a}))?.some(u=>this._breakpointManager.hasAtLocation(u)))}return o||this._breakpointManager.registerBreakpointsHit(n),{thread:this,event:e,stackTrace:i,hitBreakpoints:e.hitBreakpoints,reason:o?"entry":"breakpoint",description:he.t("Paused on breakpoint")}}return this._expectedPauseReason?{thread:this,event:e,stackTrace:i,description:he.t("Paused"),...this._expectedPauseReason}:{thread:this,event:e,stackTrace:i,reason:"pause",description:he.t("Paused on debugger statement")}}}_resolveEventListenerBreakpointDetails(e,t){let n=t.data,i=n&&n.eventName||"",o=rh().get(i);if(o){let s=o.details(n);return{thread:this,event:t,stackTrace:e,reason:"function breakpoint",description:s.short,text:s.long}}return{thread:this,event:t,stackTrace:e,reason:"function breakpoint",description:he.t("Paused on event listener")}}_clearDebuggerConsole(){return{category:"console",output:"\x1B[2J"}}_removeAllScripts(e=!1){this._sourceContainer.clear(e)}_onScriptParsed(e){let t={url:e.url,hasSourceURL:!!e.hasSourceURL,embedderName:e.embedderName,scriptId:e.scriptId,executionContextId:e.executionContextId};$t(e.url)&&(e.url=He(e.url));let n=this._sourceContainer.getScriptById(e.scriptId);if(n&&this._executionContexts.has(n.executionContextId))return;if(e.url.endsWith(".cdp")){this._sourceContainer.addScriptById(t);return}e.url&&(e.url=this.target.scriptUrlToUrl(e.url));let i=this._executionContexts.get(e.executionContextId);i||(this.logger.info("internal","Creating missing execution context id",e),i=this._executionContextCreated({id:e.executionContextId,name:"<autofilled>",origin:"",uniqueId:String(e.executionContextId)}));let s={...t,source:(async()=>{let a=this._sourceContainer.getSourceByOriginalUrl(e.url);if(e.hash&&a?.contentHash===e.hash)return a.addScript({scriptId:e.scriptId,url:e.url,embedderName:e.embedderName,hasSourceURL:!!e.hasSourceURL,executionContextId:e.executionContextId}),a;let c=async()=>{let f=await this._cdp.Debugger.getScriptSource({scriptId:e.scriptId});return f?f.scriptSource:void 0},u=e.startLine||e.startColumn?{lineOffset:e.startLine,columnOffset:e.startColumn}:void 0,l=e.url.endsWith("#vscode-extension")?{lineOffset:2,columnOffset:0}:void 0,p;e.sourceMapURL&&(p=At(e.sourceMapURL)?e.sourceMapURL:e.url&&Wi(e.url,e.sourceMapURL)||e.url,p||this._dap.with(f=>cx(f,`Could not load source map from ${e.sourceMapURL}`))),e.scriptLanguage==="WebAssembly"&&(this._lastParsedWasmScriptIds??=[],this._lastParsedWasmScriptIds.push(e.scriptId));let d=await this._sourceContainer.addSource(e,c,p,u,l,!e.hasSourceURL&&this.launchConfig.enableContentValidation?e.hash:void 0);return d.addScript({scriptId:e.scriptId,url:e.url,embedderName:e.embedderName,hasSourceURL:!!e.hasSourceURL,executionContextId:e.executionContextId}),d})()};s.source.then(a=>s.resolvedSource=a),i.scripts.push(s),this._sourceContainer.addScriptById(s),(e.sourceMapURL||e.scriptLanguage==="WebAssembly")&&this._getOrStartLoadingSourceMaps(s)}async _handleSourceMapPause(e,t){this._pausedForSourceMapScriptId=e;let n=this._sourceContainer.sourceMapTimeouts().sourceMapMinPause,i=n+this._sourceContainer.sourceMapTimeouts().sourceMapCumulativePause,o=this._sourceContainer.getScriptById(e);if(!o)return this._pausedForSourceMapScriptId=void 0,!1;let s=new Rr,a=this._breakpointManager.disableEntrypointBreaks(e),c=await Promise.race([this._getOrStartLoadingSourceMaps(o),ue(i)]),u=s.elapsed().ms,l=this._sourceContainer.sourceMapTimeouts().sourceMapCumulativePause-Math.max(u-n,0);this._sourceContainer.setSourceMapTimeouts({...this._sourceContainer.sourceMapTimeouts(),sourceMapCumulativePause:l}),this.logger.verbose("internal","Blocked execution waiting for source-map",{timeSpentWallClockInMs:u,sourceMapCumulativePause:l}),c||this._dap.with(f=>f.output({category:"stderr",output:he.t("WARNING: Processing source-maps of {0} took longer than {1} ms so we continued execution without waiting for all the breakpoints for the script to be set.",o.url||o.scriptId,i)})),console.assert(this._pausedForSourceMapScriptId===e),this._pausedForSourceMapScriptId=void 0,await a;let p=t?.lineNumber||0,d=t?.columnNumber;return!!c?.map(mi).some(f=>f.lineNumber===p&&(d===void 0||d===f.columnNumber))}_getOrStartLoadingSourceMaps(e){let t=this._executionContexts.get(e.executionContextId);if(!t)return Promise.resolve([]);let n=t.sourceMapLoads.get(e.scriptId);if(n)return n;let i=e.source.then(o=>this._sourceContainer.waitForSourceMapSources(o)).then(o=>o.length&&this._scriptWithSourceMapHandler?this._scriptWithSourceMapHandler(e,o):[]);return t.sourceMapLoads.set(e.scriptId,i),i}async _revealObject(e){if(e.type!=="function"||e.objectId===void 0)return;let t=await this._cdp.Runtime.getProperties({objectId:e.objectId,ownProperties:!0});if(t)for(let n of t.internalProperties||[]){if(n.name!=="[[FunctionLocation]]"||!n.value||n.value.subtype!=="internal#location")continue;let i=await this.rawLocationToUiLocation(this.rawLocation(n.value.value));i&&this._sourceContainer.revealUiLocation(i);break}}async _copyObjectToClipboard(e){if(!e.objectId){this._dap.with(t=>t.copyRequested({text:fs(e,"copy")}));return}try{let t=await cC({cdp:this.cdp(),objectId:e.objectId,args:[2],silent:!0,returnByValue:!0});this._dap.with(n=>n.copyRequested({text:t.value}))}catch{}finally{this.cdp().Runtime.releaseObject({objectId:e.objectId}).catch(()=>{})}}async _onThreadPaused(e){this._expectedPauseReason=void 0,this._onPausedEmitter.fire(e);let t;e.hitBreakpoints&&(t=await Promise.race([ue(1e3).then(()=>{}),Promise.all(e.hitBreakpoints.map(n=>this._breakpointManager._resolvedBreakpoints.get(n)).filter(Ro(Lr)).map(n=>n.untilSetCompleted().then(()=>n.dapId)))])),await ue(0),this._dap.with(n=>n.stopped({reason:e.reason,description:e.description,threadId:this.id,text:e.text,hitBreakpointIds:t,allThreadsStopped:!1}))}_onThreadResumed(){this._dap.with(e=>e.continued({threadId:this.id,allThreadsContinued:!1}))}isCrossThreadStep(e){if(!e.asyncStackTraceId||!e.asyncStackTraceId.debuggerId)return!1;let t=r.threadForDebuggerId(e.asyncStackTraceId.debuggerId);if(!t||!t._waitingForStepIn?.lastDetails)return!1;let n=t._waitingForStepIn.lastDetails.stackTrace;return t._cdp.Debugger.getStackTrace({stackTraceId:e.asyncStackTraceId}).then(i=>!i||!i.stackTrace.callFrames.length||!Mt.fromRuntime(t,i.stackTrace.callFrames[0],!1).equivalentTo(n.frames[0])?!1:(t._waitingForStepIn=void 0,!0))}async setScriptSourceMapHandler(e,t){this._scriptWithSourceMapHandler=t;let n=e&&this._sourceContainer.sourceMapTimeouts().sourceMapMinPause&&t;if(n&&!this._pauseOnSourceMapBreakpointIds?.length){await this.debuggerReady.promise;let i=await Promise.all([this._cdp.Debugger.setInstrumentationBreakpoint({instrumentation:"beforeScriptWithSourceMapExecution"})]);this._pauseOnSourceMapBreakpointIds=i.map(o=>o?.breakpointId).filter(It)}else if(!n&&this._pauseOnSourceMapBreakpointIds?.length){let i=this._pauseOnSourceMapBreakpointIds;this._pauseOnSourceMapBreakpointIds=void 0,await Promise.all(i.map(o=>this._cdp.Debugger.removeBreakpoint({breakpointId:o})))}if(t){let i=Promise.all([...this._executionContexts.keys()].map(o=>this._installWasmPauseHandler(o)));await Promise.race([i,ue(100)])}return!!this._pauseOnSourceMapBreakpointIds?.length}async _enablePerScriptSourcemaps(){await this._breakpointManager.updateEntryBreakpointMode(this,1),await this.setScriptSourceMapHandler(!1,this._scriptWithSourceMapHandler)}_shouldEnablePerScriptSms(e){let t=this._sourceContainer.getScriptById(e.callFrames[0]?.location.scriptId);return t?t.url.includes("@vite/client")?!0:e.reason!=="instrumentation"||!At(e.data?.sourceMapURL)?!1:t.url.startsWith("webpack")||t.url.startsWith("ng:"):!1}setSourceMapDisabler(e){this._sourceMapDisabler=e}static threadForDebuggerId(e){return r._allThreadsByDebuggerId.get(e)}async replacePathsInStackTrace(e){let t=[];for(let i of new no(e)){if(typeof i=="string"){t.push(i);continue}let o=this._sourceContainer.getSourceByOriginalUrl(He(i.path))||this._sourceContainer.getSourceByOriginalUrl(i.path);if(!o){t.push(i.toString());continue}t.push(this._sourceContainer.preferredUiLocation({columnNumber:i.position.base1.columnNumber,lineNumber:i.position.base1.lineNumber,source:o}).then(({source:s,lineNumber:a,columnNumber:c})=>`${s.absolutePath}:${a}:${c}`))}return(await Promise.all(t)).join("")}};var wC=r=>typeof r.uiLocation=="function",Ai=class r{constructor(e){this.thread=e;this.frames=[];this._frameById=new Map;this._lastInlineWasmExpanded=Promise.resolve(0);this._lastFrameThread=e}static fromRuntime(e,t){let n=new r(e);for(let i of t.callFrames)i.url.endsWith(".cdp")||n.frames.push(Mt.fromRuntime(e,i,!1));return t.parentId?(n._asyncStackTraceId=t.parentId,console.assert(!t.parent)):n._appendStackTrace(e,t.parent),n}static fromDebugger(e,t,n,i){let o=new r(e);for(let s of t)o._appendFrame(Mt.fromDebugger(e,s));return i?(o._asyncStackTraceId=i,console.assert(!n)):o._appendStackTrace(e,n),o}async loadFrames(e,t){return await this.expandAsyncStack(e,t),await this.expandWasmFrames(),this.frames}async expandAsyncStack(e,t){for(;this.frames.length<e&&this._asyncStackTraceId;){if(this._asyncStackTraceId.debuggerId&&(this._lastFrameThread=uc.threadForDebuggerId(this._asyncStackTraceId.debuggerId)),!this._lastFrameThread){this._asyncStackTraceId=void 0;break}t&&this._lastFrameThread.cdp().DotnetDebugger.setEvaluationOptions({options:{noFuncEval:t},type:"stackFrame"});let n=await this._lastFrameThread.cdp().Debugger.getStackTrace({stackTraceId:this._asyncStackTraceId});this._asyncStackTraceId=void 0,n&&this._appendStackTrace(this._lastFrameThread,n.stackTrace)}}expandWasmFrames(){return this._lastInlineWasmExpanded=this._lastInlineWasmExpanded.then(async e=>{for(;e<this.frames.length;e++){let t=this.frames[e];if(!(t instanceof Mt))continue;let n=t.scriptSource?.resolvedSource;if(!zo(n))continue;let i=await n.sourceMap.value.promise;if(!i.getFunctionStack)continue;let o=await i.getFunctionStack(t.rawPosition);if(o.length===0)continue;let s=[];for(let a=0;a<o.length;a++){let c=new xl({source:n,thread:this.thread,inlineFrameIndex:a,name:o[a].name,root:t});this._frameById.set(c.frameId,c),s.push(c)}this._spliceFrames(e,1,...s),e+=o.length-1}return e})}frame(e){return this._frameById.get(e)}_appendStackTrace(e,t){for(console.assert(!t||!this._asyncStackTraceId);t;){if(t.description==="async function"&&t.callFrames.length&&t.callFrames.shift(),t.callFrames.length){this._appendFrame(new uh(t.description||"async"));for(let n of t.callFrames)this._appendFrame(Mt.fromRuntime(e,n,!0))}t.parentId&&(this._asyncStackTraceId=t.parentId,console.assert(!t.parent)),t=t.parent}}_spliceFrames(e,t,...n){this.frames.splice(e,t,...n);for(let i of n)i instanceof uh||this._frameById.set(i.frameId,i)}_appendFrame(e){this._spliceFrames(this.frames.length,0,e)}async formatAsNative(){return await this.formatWithMapper(e=>e.formatAsNative())}async format(){return await this.formatWithMapper(e=>e.format())}async formatWithMapper(e){let t=await this.loadFrames(50);for(let i=t.length-1;i>=0;i--){let o=t[i];if(o instanceof Mt&&o.isReplEval){t=t.slice(0,i+1);break}}let n=t.map(e);return(await Promise.all(n)).join(`
`)+`
`}async toDap(e){let t=e.startFrame||0,n=(e.levels||50)+t,i=await this.loadFrames(n,e.noFuncEval);n=Math.min(i.length,e.levels?n:i.length);let o=[];for(let s=t;s<n;s++)o.push(i[s].toDap(e.format));return{stackFrames:await Promise.all(o),totalFrames:this._asyncStackTraceId?1e6:i.length}}},nv=bp(),uh=class{constructor(e="async"){this.label=e;this.frameId=nv()}async toDap(){return{name:this.label,id:0,line:0,column:0,presentationHint:"label"}}async formatAsNative(){return` --- ${this.label} ---`}async format(){return`\u25C0 ${this.label} \u25B6`}},SC="<anonymous>",C4=/^class\s+(.+) {($|\n)/;async function D4(r,e,t){if(!e.functionName)return SC;if(e.functionName.includes("."))return e.functionName;let n;if(e.this.objectId&&t&&(n=(await r.cdp().Runtime.callFunctionOn({functionDeclaration:eh.decl("64","null"),objectId:e.this.objectId,returnByValue:!0}))?.result.value),!n&&e.this.description){n=e.this.description;let s=C4.exec(n);s&&(n=s[1])}if(!n)return e.functionName;let i=n.indexOf(`
`);i!==-1&&(n=n.slice(0,i).trim());let o=e.functionName;return n===o?`${n}.constructor`:n?`${n}.${o}`:o}function T4(r){return r.functionName||SC}var Mt=class r{constructor(e,t,n,i=!1){this.callFrame=t;this.isAsync=i;this.frameId=nv();this.root=this;this.getLocationInfo=ne(async()=>{let e=this.uiLocation(),t=await Mb(this),n=this.overrideName||("this"in this.callFrame?await D4(this._thread,this.callFrame,t===0):T4(this.callFrame));return{isSmartStepped:t,name:n,uiLocation:await e}});this.completions=ne(async()=>{if(!this._scope)return[];let e=this._thread.pausedVariables();if(!e)return[];let t=[];for(let i=0;i<this._scope.chain.length;i++){let o=this._scopeVariable(i,this._scope);o&&t.push(e.getVariableNames({variablesReference:o.id}).then(s=>s.map(({name:a})=>({label:a,type:"property"}))))}let n=await Promise.all(t);return[].concat(...n)});this._rawLocation=n,this.uiLocation=ne(()=>e.rawLocationToUiLocation(n)),this._thread=e;let o=n.scriptId?e.getScriptById(n.scriptId):void 0;this.isReplEval=o?o.url.endsWith(".repl"):!1}get rawPosition(){return new ke(this._rawLocation.lineNumber,this._rawLocation.columnNumber)}get rawScopeChain(){return this._scope?.chain||[]}static fromRuntime(e,t,n){return new r(e,t,e.rawLocation(t),n)}static fromDebugger(e,t){let n=new r(e,t,e.rawLocation(t));return n._scope={chain:t.scopeChain,thisObject:t.this,returnValue:t.returnValue,variables:new Array(t.scopeChain.length).fill(void 0),callFrameId:t.callFrameId},n}get scriptId(){return"scriptId"in this.callFrame?this.callFrame.scriptId:this.callFrame.location.scriptId}get scriptSource(){return this._thread._sourceContainer.getScriptById(this.scriptId)}get canExplicitlyBeRestarted(){return!!this.callFrame.canBeRestarted}equivalentTo(e){return e instanceof r&&e._rawLocation.columnNumber===this._rawLocation.columnNumber&&e._rawLocation.lineNumber===this._rawLocation.lineNumber&&e._rawLocation.scriptId===this._rawLocation.scriptId}callFrameId(){return this._scope?this._scope.callFrameId:void 0}async scopes(){let e=this._scope;if(!e)throw new T(gx());return{scopes:(await Promise.all(e.chain.map(async(n,i)=>{let o="",s;switch(n.type){case"global":o=Zt.t("Global");break;case"local":o=Zt.t("Local"),s="locals";break;case"with":o=Zt.t("With Block"),s="locals";break;case"closure":o=Zt.t("Closure"),s="arguments";break;case"catch":o=Zt.t("Catch Block"),s="locals";break;case"block":o=Zt.t("Block"),s="locals";break;case"script":o=Zt.t("Script");break;case"eval":o=Zt.t("Eval");break;case"module":o=Zt.t("Module");break;default:o=n.type.substr(0,1).toUpperCase()+n.type.substr(1);break}n.name&&n.type==="closure"?o=Zt.t("Closure ({0})",n.name):n.name&&(o=`${o}: ${n.name}`);let a=this._scopeVariable(i,e);if(!a)return;let c={name:o,presentationHint:s,expensive:n.type==="global",variablesReference:a.id};if(n.startLocation){let u=this._thread.rawLocation(n.startLocation),l=await this._thread.rawLocationToUiLocation(u);if(c.line=(l||u).lineNumber,c.column=(l||u).columnNumber,l&&(c.source=await l.source.toDap()),n.endLocation){let p=this._thread.rawLocation(n.endLocation),d=await this._thread.rawLocationToUiLocation(p);c.endLine=(d||p).lineNumber,c.endColumn=(d||p).columnNumber}}return c}))).filter(It)}}getStepSkipList(e){return Promise.resolve(void 0)}async toDap(e){let{isSmartStepped:t,name:n,uiLocation:i}=await this.getLocationInfo(),o=i?await i.source.toDap():void 0,s=t?"deemphasize":"normal";t&&o&&(o.origin=t===1?Zt.t("Skipped by smartStep"):Zt.t("Skipped by skipFiles"));let a=(i||this._rawLocation).lineNumber,c=(i||this._rawLocation).columnNumber,u=n;return o&&e&&(e.module&&(u+=` [${o.name}]`),e.line&&(u+=` Line ${a}`)),{id:this.frameId,name:u,line:a,column:c,source:o,presentationHint:s,canRestart:this.callFrame.canBeRestarted??!this.isAsync}}async formatAsNative(){let{name:e,uiLocation:t}=await this.getLocationInfo(),n=await t?.source.existingAbsolutePath()||await t?.source.prettyName()||this.callFrame.url,{lineNumber:i,columnNumber:o}=t||this._rawLocation;return` at ${e} (${n}:${i}:${o})`}async format(){let{name:e,uiLocation:t}=await this.getLocationInfo(),n=await t?.source.prettyName()||"<unknown>",i=t||this._rawLocation,o=`${e} @ ${n}:${i.lineNumber}`;return i.columnNumber>1&&(o+=`:${i.columnNumber}`),o}_scopeVariable(e,t){let n=t.variables[e];if(n)return n;let i={stackFrame:this,callFrameId:t.callFrameId,scopeNumber:e},o=[];e===0&&(t.thisObject&&o.push({name:"this",value:t.thisObject}),t.returnValue&&o.push({name:Zt.t("Return value"),value:t.returnValue}));let s=this._thread.pausedVariables();if(!s)return;let a=s.createScope(t.chain[e].object,i,o);return t.variables[e]=a}},rv={scopes:[]},xl=class{constructor(e){this.frameId=nv();this.name=e.name,this.root=e.root,this.thread=e.thread,this.source=e.source,this.inlineFrameIndex=e.inlineFrameIndex,this.wasmPosition=new Ve(this.inlineFrameIndex,this.root.rawPosition.base0.columnNumber),this.uiLocation=ne(()=>e.thread._sourceContainer.preferredUiLocation({columnNumber:e.root.rawPosition.base1.columnNumber,lineNumber:e.inlineFrameIndex+1,source:e.source}))}async formatAsNative(){let{columnNumber:e,lineNumber:t,source:n}=await this.uiLocation();return` at ${this.name} (${n.url}:${t}:${e})`}async format(){let{columnNumber:e,lineNumber:t,source:n}=await this.uiLocation(),i=await n.prettyName()||"<unknown>";return`${this.name} @ ${i}:${t}:${e}`}async toDap(){let{columnNumber:e,lineNumber:t,source:n}=await this.uiLocation();return Promise.resolve({id:this.frameId,name:this.name,column:e,line:t,source:await n.toDap()})}async getStepSkipList(e){let t=this.source.sourceMap.value.settledValue;if(!t?.getStepSkipList)return;let n=await this.uiLocation();return n?t.getStepSkipList(e,this.wasmPosition,n.source.compiledToSourceUrl.get(this.source),new ke(n.lineNumber,n.columnNumber)):t.getStepSkipList(e,this.root.rawPosition)}async scopes(){let e=this.source.sourceMap.value.settledValue,t=this.root.callFrameId();if(!e||!t)return rv;let n=await e.getVariablesInScope?.(t,this.wasmPosition);if(!n)return rv;let i=this.thread.pausedVariables();if(!i)return rv;let o={stackFrame:this.root,callFrameId:t,scopeNumber:0};return{scopes:await Promise.all([...D0(n,s=>s.scope)].map(([s,a])=>i.createWasmScope(s,a,o).toDap("propertyValue").then(c=>({name:c.name,variablesReference:c.variablesReference,expensive:s!=="LOCAL"}))))}}};var EC=_(je());var Hs=class{constructor(e){this.event=e;this.stackTrace=ne(e=>this.event.stackTrace?Ai.fromRuntime(e,this.event.stackTrace):void 0);this.getUiLocation=ne(async e=>{let t=this.stackTrace(e);if(!t)return;let n;for(let i of t.frames){if(!(i instanceof Mt))continue;let o=await i.uiLocation();if(o&&(n||(n=o),!o.source.blackboxed()))return{source:await o.source.toDap(),line:o.lineNumber,column:o.columnNumber}}if(n)return{source:await n.source.toDap(),line:n.lineNumber,column:n.columnNumber}})}formatDefaultString(e,t,n=!1){let o=t.length>1&&t[0].type==="string"?Lb(t[0].value,t.slice(1),Tb):Lb("",t,Tb),s=o.result+`
`;return o.usedAllSubs&&!t.some(ds)?{output:s}:this.formatComplexStringOutput(e,s,t,n)}async formatComplexStringOutput(e,t,n,i){(n.some(s=>s.subtype==="error")||no.isStackLike(t))&&(await this.getUiLocation(e),t=await e.replacePathsInStackTrace(t),i=!0);let o=e.replVariables.createVariableForOutput(t,n,i?this.stackTrace(e):void 0);return{output:t,variablesReference:o.id}}},lh=class extends Hs{async toDap(e){return this.event.args[0]?.value==="console.assert"&&(this.event.args[0].value=EC.t("Assertion failed")),{category:"stderr",...await this.formatDefaultString(e,this.event.args,!0),...await this.getUiLocation(e)}}},gs=class extends Hs{constructor(t,n,i){super(t);this.includeStack=n;this.category=i}async toDap(t){return{category:this.category,...await this.formatDefaultString(t,this.event.args,this.includeStack),...await this.getUiLocation(t)}}},co=class extends gs{constructor(e){super(e,!1,"stdout")}},ph=class extends gs{constructor(e){super(e,!0,"stdout")}},dh=class extends gs{constructor(e){super(e,!0,"stderr")}},fh=class extends gs{constructor(e){super(e,!0,"stderr")}},hh=class extends Hs{async toDap(e){return{category:"stdout",group:this.event.type==="startGroupCollapsed"?"startCollapsed":"start",...await this.formatDefaultString(e,this.event.args),...await this.getUiLocation(e)}}},mh=class extends gs{constructor(e){super(e,!1,"stdout")}async toDap(e){return this.event.args[0]?.preview?{category:"stdout",output:"",variablesReference:e.replVariables.createVariableForOutput("",this.event.args,void 0,this.event.type).id,...await this.getUiLocation(e)}:super.toDap(e)}};var El=class extends Hs{constructor(){super(...arguments);this.stackTrace=ne(t=>{if(this.event.stackTrace)return Ai.fromRuntime(t,this.event.stackTrace);if(this.event.scriptId)return Ai.fromRuntime(t,{callFrames:[{functionName:"(program)",lineNumber:this.event.lineNumber,columnNumber:this.event.columnNumber,scriptId:this.event.scriptId,url:this.event.url||""}]})})}async toDap(t){let n=this.event.exception?hs(this.event.exception):{title:""},i=n.title;i.startsWith("Uncaught")||(i=`Uncaught ${this.event.exception?.className??"Error"} `+i);let o=this.stackTrace(t),s=this.event.exception&&!n.stackTrace?[this.event.exception]:[];return no.isStackLike(i)?i=await t.replacePathsInStackTrace(i):o&&(i+=`
`+await o.formatAsNative()),{category:"stderr",output:i,variablesReference:o||s.length?t.replVariables.createVariableForOutput(i,s,o).id:void 0,...await this.getUiLocation(t)}}};var Hh=_(je());var xC=nt(function(){return this});var ch=class{constructor(e,t){this.protoObj=e;this.cdp=t}async toDap(e){if(!this.protoObj.objectId)return{category:"stderr",output:Hh.t("Only objects can be queried")};let t=await this.cdp.Runtime.queryObjects({prototypeObjectId:this.protoObj.objectId,objectGroup:"console"});if(await this.cdp.Runtime.releaseObject({objectId:this.protoObj.objectId}),!t)return{category:"stderr",output:Hh.t("Could not query the provided object")};let n;try{n=await xC({cdp:this.cdp,args:[],objectId:t.objects.objectId,objectGroup:"console",generatePreview:!0})}catch(s){return{category:"stderr",output:Hh.t(s.message)}}let i="\x1B[32mobjects: "+fs(n,"repl")+"\x1B[0m";return{category:"stdout",output:"",variablesReference:e.replVariables.createVariableForOutput(i,[n]).id}}};var gh=Symbol("IConsole");var ys=_(q()),$C=H("os"),CC=H("path");var iv=H("path"),PC=(0,iv.join)(__dirname,"diagnosticTool.js"),LC=(0,iv.join)(__dirname,"diagnosticTool.css");var Zn=Symbol("ITarget"),qt=Symbol("ILauncher");var uo=class{constructor(e,t,n,i){this.fs=e;this.sources=t;this.breakpoints=n;this.target=i}async generateObject(){let[e]=await Promise.all([this.dumpSources()]);return{breakpoints:this.dumpBreakpoints(),sources:e,config:this.target.launchConfig}}async generateHtml(e=(0,CC.join)((0,$C.tmpdir)(),"js-debug-diagnostics.html")){return await this.fs.writeFile(e,`<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>${await this.fs.readFile(LC,"utf-8")}<</style>
</head>
<body>
<script>window.DUMP=${JSON.stringify(await this.generateObject())}</script>
<script>${await this.fs.readFile(PC,"utf-8")}</script>
</body>
</html>`),e}dumpBreakpoints(){let e=[];for(let t of[this.breakpoints.appliedByPath,this.breakpoints.appliedByRef])for(let n of t.values())for(let i of n){let o=i.diagnosticDump();e.push({source:o.source,params:o.params,cdp:o.cdp.map(s=>s.state===1?{...s,uiLocations:s.uiLocations.map(a=>this.dumpUiLocation(a))}:{...s,done:void 0})})}return e}dumpSources(){let e=[],t=0;for(let n of this.sources.sources)e.push((async()=>({uniqueId:t++,url:n.url,sourceReference:n.sourceReference,absolutePath:n.absolutePath,actualAbsolutePath:await n.existingAbsolutePath(),scriptIds:n.scripts.map(i=>i.scriptId),prettyName:await n.prettyName(),compiledSourceRefToUrl:n instanceof Je?[...n.compiledToSourceUrl.entries()].map(([i,o])=>[i.sourceReference,o]):void 0,sourceMap:Xo(n)?{url:n.sourceMap.metadata.sourceMapUrl,metadata:n.sourceMap.metadata,sources:ci(Object.fromEntries(n.sourceMap.sourceByUrl),i=>i.sourceReference)}:void 0}))());return Promise.all(e)}dumpUiLocation(e){return{lineNumber:e.lineNumber,columnNumber:e.columnNumber,sourceReference:e.source.sourceReference}}};uo=E([(0,ys.injectable)(),g(0,(0,ys.inject)($e)),g(1,(0,ys.inject)(mt)),g(2,(0,ys.inject)(Dr)),g(3,(0,ys.inject)(Zn))],uo);var lo=_(q());var pc=Symbol("IExceptionPauseService");var lc=class{constructor(e,t,n,i,o){this.evaluator=e;this.scriptSkipper=t;this.dap=n;this.sourceContainer=o;this.state={cdp:"none"};this.blocker=ge();this.noDebug=!!i.noDebug,this.breakOnError=i.__breakOnConditionalError,this.blocker.resolve()}get launchBlocker(){return this.blocker.promise}async setBreakpoints(e){if(!this.noDebug){try{this.state=this.parseBreakpointRequest(e)}catch(t){if(!(t instanceof T))throw t;this.dap.output({category:"stderr",output:t.message});return}this.cdp?await this.sendToCdp(this.cdp):this.state.cdp!=="none"&&this.blocker.hasSettled()&&(this.blocker=ge())}}async shouldPauseAt(e){if(e.reason!=="exception"&&e.reason!=="promiseRejection"||this.state.cdp==="none"||e.callFrames.some(n=>this.sourceContainer.getSourceScriptById(n.location.scriptId)?.url.endsWith(".cdp"))||this.shouldScriptSkip(e))return!1;let t=this.state.condition;if(e.data?.uncaught){if(t.uncaught&&!await this.evalCondition(e,t.uncaught))return!1}else if(t.caught&&!await this.evalCondition(e,t.caught))return!1;return!0}async apply(e){this.cdp=e,this.state.cdp!=="none"&&await this.sendToCdp(e)}async sendToCdp(e){await e.Debugger.setPauseOnExceptions({state:this.state.cdp}),this.blocker.resolve()}async evalCondition(e,t){return!!(await t({callFrameId:e.callFrames[0].callFrameId},i=>i==="error"?e.data:void 0))?.result.value}shouldScriptSkip(e){if(e.data?.uncaught||!e.callFrames.length)return!1;let t=this.sourceContainer.getScriptById(e.callFrames[0].location.scriptId);return!!t&&this.scriptSkipper.isScriptSkipped(t.url)}parseBreakpointRequest(e){let t=(e.filterOptions??[]).concat(e.filters.map(a=>({filterId:a}))),n="none",i=[],o=[];for(let{filterId:a,condition:c}of t)a==="all"?(n="all",c&&i.push(a)):a==="uncaught"&&(n==="none"&&(n="uncaught"),c&&o.push(a));let s=a=>{if(a.length===0)return;let c="!!("+t.map(p=>p.condition).filter(It).join(") || !!(")+")",u=Gi(c);if(u)throw new T(Ki({line:0,condition:c},u.message));let l=Ly(c,this.breakOnError);return this.evaluator.prepare(l,{hoist:["error"]}).invoke};return n==="none"?{cdp:n}:{cdp:n,condition:{caught:s(i),uncaught:s(o)}}}};lc=E([(0,lo.injectable)(),g(0,(0,lo.inject)(Pr)),g(1,(0,lo.inject)(Qi)),g(2,(0,lo.inject)(Yt)),g(3,(0,lo.inject)(de)),g(4,(0,lo.inject)(mt))],lc);var vh=_(q());var yh=class{constructor(){this.didEnable=new WeakSet}async retrieve(e){this.didEnable.has(e)||(this.didEnable.add(e),await e.Performance.enable({}));let t=await e.Performance.getMetrics({});if(!t)return{error:"Error in CDP"};let n={};for(let i of t.metrics)n[i.name]=i.value;return{metrics:n}}};var bh=class{async retrieve(e){let t=await e.Runtime.evaluate({expression:`({
memory: process.memoryUsage(),
cpu: process.cpuUsage(),
timestamp: Date.now(),
resourceUsage: process.resourceUsage && process.resourceUsage(),
})${Ne()}`,returnByValue:!0});return t?t.exceptionDetails?{error:t.exceptionDetails.text}:{metrics:t.result.value}:{error:"No response from CDP"}}};var Ih=Symbol("IPerformanceProvider"),bs=class{constructor(e){this.target=e}create(){return this.target.type()==="node"?new bh:new yh}};bs=E([(0,vh.injectable)(),g(0,(0,vh.inject)(Zn))],bs);var lv=_(je()),RC=H("crypto"),po=_(q()),kC=H("os"),OC=H("path");var wh=_(q());var ov=_(je()),vs=_(q()),_h=H("path");var dc=class{constructor(e){this.sources=e;this.locationIdCounter=0;this.locationsByRef=new Map}getLocationIdFor(e){let t=[e.functionName,e.url,e.scriptId,e.lineNumber,e.columnNumber].join(":"),n=this.locationsByRef.get(t);if(n)return n.id;let i=this.locationIdCounter++;return this.locationsByRef.set(t,{id:i,callFrame:e,locations:(async()=>{let o=await this.sources.getScriptById(e.scriptId)?.source;if(!o)return[];let s=await this.sources.currentSiblingUiLocations({lineNumber:e.lineNumber+1,columnNumber:e.columnNumber+1,source:o});return Promise.all(s.map(async a=>({...a,source:await a.source.toDap()})))})()}),i}getLocations(){return Promise.all([...this.locationsByRef.values()].sort((e,t)=>e.id-t.id).map(async e=>({callFrame:e.callFrame,locations:await e.locations})))}};var gt=class{constructor(e,t,n,i){this.cdp=e;this.fs=t;this.sources=n;this.launchConfig=i}static canApplyTo(){return!0}async start(e,t){if(!await this.cdp.Profiler.start({}))throw new T(Sa());return new sv(this.cdp,this.fs,this.sources,this.launchConfig.__workspaceFolder,t)}async save(e,t){let n=await DC(e,this.sources,this.launchConfig.__workspaceFolder);(0,_h.isAbsolute)(t)||(t=(0,_h.join)(this.launchConfig.__workspaceFolder,t)),await this.fs.writeFile(t,JSON.stringify(n))}};gt.type="cpu",gt.extension=".cpuprofile",gt.label=ov.t("CPU Profile"),gt.description=ov.t("Generates a .cpuprofile file you can open in VS Code or the Edge/Chrome devtools"),gt.editable=!0,gt=E([(0,vs.injectable)(),g(0,(0,vs.inject)(Be)),g(1,(0,vs.inject)($e)),g(2,(0,vs.inject)(mt)),g(3,(0,vs.inject)(de))],gt);var sv=class{constructor(e,t,n,i,o){this.cdp=e;this.fs=t;this.sources=n;this.workspaceFolder=i;this.file=o;this.stopEmitter=new C;this.disposed=!1;this.onUpdate=new C().event;this.onStop=this.stopEmitter.event}async dispose(){this.disposed||(this.disposed=!0,this.stopEmitter.fire())}async stop(){let e=await this.cdp.Profiler.stop({});if(!e)throw new T(Sa());await this.dispose();let t=await DC(e.profile,this.sources,this.workspaceFolder);await this.fs.writeFile(this.file,JSON.stringify(t))}};async function DC(r,e,t){let n=new dc(e),i=r.nodes.map(o=>({...o,locationId:n.getLocationIdFor(o.callFrame),positionTicks:o.positionTicks?.map(s=>({...s,startLocationId:n.getLocationIdFor({...o.callFrame,lineNumber:s.line-1,columnNumber:0}),endLocationId:n.getLocationIdFor({...o.callFrame,lineNumber:s.line,columnNumber:0})}))}));return{...r,nodes:i,$vscode:{rootPath:t,locations:await n.getLocations()}}}var av=_(je()),Is=_(q());var fr=class{constructor(e,t,n,i){this.cdp=e;this.fs=t;this.sources=n;this.launchConfig=i}static canApplyTo(){return!0}async start(e,t){if(await this.cdp.HeapProfiler.enable({}),!await this.cdp.HeapProfiler.startSampling({}))throw new T(Sa());return new cv(this.cdp,this.fs,this.sources,this.launchConfig.__workspaceFolder,t)}};fr.type="heap",fr.extension=".heapprofile",fr.label=av.t("Heap Profile"),fr.description=av.t("Generates a .heapprofile file you can open in VS Code or the Edge/Chrome devtools"),fr.editable=!0,fr=E([(0,Is.injectable)(),g(0,(0,Is.inject)(Be)),g(1,(0,Is.inject)($e)),g(2,(0,Is.inject)(mt)),g(3,(0,Is.inject)(de))],fr);var cv=class{constructor(e,t,n,i,o){this.cdp=e;this.fs=t;this.sources=n;this.workspaceFolder=i;this.file=o;this.stopEmitter=new C;this.disposed=!1;this.onUpdate=new C().event;this.onStop=this.stopEmitter.event}async dispose(){this.disposed||(this.disposed=!0,await this.cdp.HeapProfiler.disable({}),this.stopEmitter.fire())}async stop(){let e=await this.cdp.HeapProfiler.stopSampling({});if(!e)throw new T(Sa());await this.dispose();let t=await this.annotateSources(e.profile);await this.fs.writeFile(this.file,JSON.stringify(t))}async annotateSources(e){let t=new dc(this.sources),n=(o,s)=>{s.locationId=t.getLocationIdFor(o.callFrame);for(let a of o.children){let c={...a,children:[]};s.children.push(c),n(a,c)}},i={...e.head,children:[]};return n(e.head,i),{...e,head:i,$vscode:{rootPath:this.workspaceFolder,locations:await t.getLocations()}}}};var uv=_(je()),TC=H("fs"),Ah=_(q());var hr=class{constructor(e){this.cdp=e;this.cdp.HeapProfiler.on("addHeapSnapshotChunk",({chunk:t})=>this.currentWriter?.stream.write(t))}static canApplyTo(){return!0}async start(e,t){return{onStop:new C().event,onUpdate:new C().event,dispose:()=>{},stop:async()=>{await this.cdp.HeapProfiler.enable({}),await this.dumpToFile(t),await this.cdp.HeapProfiler.disable({})}}}async dumpToFile(e){let{stream:t,promise:n}=this.currentWriter={stream:(0,TC.createWriteStream)(e),promise:this.cdp.HeapProfiler.takeHeapSnapshot({})};await n,t.end(),this.currentWriter=void 0}};hr.type="memory",hr.extension=".heapsnapshot",hr.label=uv.t("Heap Snapshot"),hr.description=uv.t("Generates a .heapsnapshot file you can open in VS Code or the Edge/Chrome devtools"),hr.instant=!0,hr=E([(0,Ah.injectable)(),g(0,(0,Ah.inject)(Be))],hr);var Sh=Symbol("IProfilerFactory"),MC=()=>{let r=new Date;return["vscode-profile",r.getFullYear(),r.getMonth()+1,r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds()].map(e=>String(e).padStart(2,"0")).join("-")},wi=class{constructor(e){this.container=e}get(e){let t=wi.ctors.find(n=>n.type===e);if(!t)throw new Error(`Invalid profilter type ${e}`);return this.container.get(t)}};wi.ctors=[gt,fr,hr],wi=E([(0,wh.injectable)(),g(0,(0,wh.inject)(La))],wi);var Eh=Symbol("IProfileController"),fc=class{constructor(e,t,n,i,o){this.cdp=e;this.factory=t;this.basicCpuProfiler=n;this.breakpoints=i;this.shutdown=o;this.seenConsoleProfileNames=Object.create(null)}connect(e,t){e.on("startProfile",async n=>(await this.start(e,t,n),{})),e.on("stopProfile",()=>this.stopProfiling(e)),this.cdp.Profiler.on("consoleProfileStarted",()=>{e.output({output:lv.t("Console profile started")+`
`,category:"console"})}),this.cdp.Profiler.on("consoleProfileFinished",async n=>{let i=this.saveConsoleProfile(e,n),o=this.shutdown.register(0,()=>i);await i,o.dispose()}),t.onPaused(()=>this.stopProfiling(e))}async start(e,t,n){if(this.profile)throw new T(mx());this.profile=this.startProfileInner(e,t,n).catch(i=>{throw this.profile=void 0,i}),await this.profile}async saveConsoleProfile(e,t){let n;if(t.title){n=t.title.replace(/[\/\\]/g,"-");let i=this.seenConsoleProfileNames[t.title]||0;this.seenConsoleProfileNames[t.title]=i+1,i>0&&(n+=`-${i}`)}else n=MC();n+=gt.extension,await this.basicCpuProfiler.save(t.profile,n),e.output({output:lv.t('CPU profile saved as "{0}" in your workspace folder',n)+`
`,category:"console"})}async startProfileInner(e,t,n){let i=!1,o;if(n.stopAtBreakpoint?.length){let l=new Set(n.stopAtBreakpoint);i=!0,o=p=>!(p instanceof Lr)||l.has(p.dapId)}else o=()=>!1;await this.breakpoints.applyEnabledFilter(o);let s=(0,OC.join)((0,kC.tmpdir)(),`vscode-js-profile-${(0,RC.randomBytes)(4).toString("hex")}`),a=await this.factory.get(n.type).start(n,s),c={file:s,profile:a,enableFilter:o,keptDebuggerOn:i};a.onUpdate(l=>e.profilerStateUpdate({label:l,running:!0})),a.onStop(()=>this.disposeProfile(c));let u=!!t.pausedDetails();return i?await t.resume():u&&(await this.cdp.Debugger.disable({}),u&&t.onResumed()),e.profileStarted({file:c.file,type:n.type}),c}async stopProfiling(e){let t=await this.profile?.catch(()=>{});return!t||!this.profile?{}:(this.profile=void 0,await t?.profile.stop(),e.profilerStateUpdate({label:"",running:!1}),{})}async disposeProfile({profile:e,enableFilter:t,keptDebuggerOn:n}){n||await this.cdp.Debugger.enable({}),await this.breakpoints.applyEnabledFilter(void 0,t),e.dispose()}};fc=E([(0,po.injectable)(),g(0,(0,po.inject)(Be)),g(1,(0,po.inject)(Sh)),g(2,(0,po.inject)(gt)),g(3,(0,po.inject)(Dr)),g(4,(0,po.inject)(Ji))],fc);var _s=class r{constructor(e,t,n,i){this.asyncStackPolicy=t;this.launchConfig=n;this._services=i;this._disposables=new Ae;this._customBreakpoints=[];this._xhrBreakpoints=[];this._threadDeferred=ge();this.breakpointIdCounter=bp();this._cdpProxyProvider=this._services.get(qf);this._configurationDoneDeferred=ge(),this.sourceContainer=i.get(mt),this.breakpointManager=i.get(Dr);let o=i.get(Ih),s=i.get(Dt);s.onFlush(()=>{s.report("breakpointStats",this.breakpointManager.statisticsForTelemetry()),s.report("statistics",this.sourceContainer.statistics())}),this.dap=e,this.dap.on("initialize",a=>this.onInitialize(a)),this.dap.on("setBreakpoints",a=>this._onSetBreakpoints(a)),this.dap.on("setExceptionBreakpoints",a=>this.setExceptionBreakpoints(a)),this.dap.on("configurationDone",()=>this.configurationDone()),this.dap.on("loadedSources",()=>this._onLoadedSources()),this.dap.on("disableSourcemap",a=>this._onDisableSourcemap(a)),this.dap.on("source",a=>this._onSource(a)),this.dap.on("threads",()=>this._onThreads()),this.dap.on("stackTrace",a=>this._withThread(c=>c.stackTrace(a))),this.dap.on("variables",a=>this._onVariables(a)),this.dap.on("readMemory",a=>this._onReadMemory(a)),this.dap.on("writeMemory",a=>this._onWriteMemory(a)),this.dap.on("setVariable",a=>this._onSetVariable(a)),this.dap.on("setExpression",a=>this._onSetExpression(a)),this.dap.on("continue",()=>this._withThread(a=>a.resume())),this.dap.on("pause",()=>this._withThread(a=>a.pause())),this.dap.on("next",()=>this._withThread(a=>a.stepOver())),this.dap.on("stepIn",a=>this._withThread(c=>c.stepInto(a.targetId))),this.dap.on("stepOut",()=>this._withThread(a=>a.stepOut())),this.dap.on("restartFrame",a=>this._withThread(c=>c.restartFrame(a))),this.dap.on("scopes",a=>this._withThread(c=>c.scopes(a))),this.dap.on("evaluate",a=>this.onEvaluate(a)),this.dap.on("completions",a=>this._withThread(c=>c.completions(a))),this.dap.on("exceptionInfo",()=>this._withThread(a=>a.exceptionInfo())),this.dap.on("setCustomBreakpoints",a=>this.setCustomBreakpoints(a)),this.dap.on("toggleSkipFileStatus",a=>this._toggleSkipFileStatus(a)),this.dap.on("toggleSkipFileStatus",a=>this._toggleSkipFileStatus(a)),this.dap.on("prettyPrintSource",a=>this._prettyPrintSource(a)),this.dap.on("locations",a=>this._onLocations(a)),this.dap.on("revealPage",()=>this._withThread(a=>a.revealPage())),this.dap.on("getPerformance",()=>this._withThread(a=>o.retrieve(a.cdp()))),this.dap.on("breakpointLocations",a=>this._breakpointLocations(a)),this.dap.on("createDiagnostics",a=>this._dumpDiagnostics(a)),this.dap.on("requestCDPProxy",()=>this._requestCDPProxy()),this.dap.on("setExcludedCallers",a=>this._onSetExcludedCallers(a)),this.dap.on("saveDiagnosticLogs",({toFile:a})=>this._saveDiagnosticLogs(a)),this.dap.on("setSourceMapStepping",a=>this._setSourceMapStepping(a)),this.dap.on("stepInTargets",a=>this._stepInTargets(a)),this.dap.on("setDebuggerProperty",a=>this._setDebuggerProperty(a)),this.dap.on("setSymbolOptions",a=>this._setSymbolOptions(a)),this.dap.on("networkCall",a=>this._doNetworkCall(a)),this.dap.on("enableNetworking",a=>this._withThread(c=>c.enableNetworking(a))),this.dap.on("getPreferredUILocation",a=>this._getPreferredUILocation(a))}async _getPreferredUILocation(e){let t=this.sourceContainer.source(e.source);if(!t)return e;let n=await this.sourceContainer.preferredUiLocation({columnNumber:e.column+1,lineNumber:e.line+1,source:t});return{column:n.columnNumber-1,line:n.lineNumber-1,source:await n.source.toDap()}}async _doNetworkCall({method:e,params:t}){return this._thread?this._thread.cdp().Network[e](t):Promise.resolve({})}_setDebuggerProperty(e){return this._thread?.cdp().DotnetDebugger.setDebuggerProperty(e),Promise.resolve({})}_setSymbolOptions(e){return this._thread?.cdp().DotnetDebugger.setSymbolOptions(e),Promise.resolve({})}_breakpointLocations(e){return this._withThread(async t=>{let n=this.sourceContainer.source(e.source);return n?{breakpoints:(await this.breakpointManager.getBreakpointLocations(t,n,new ke(e.line,e.column||1),new ke(e.endLine||e.line+1,e.endColumn||e.column||1))).map(o=>o.uiLocations.find(s=>s.source===n)).filter(It).map(o=>({line:o.lineNumber,column:o.columnNumber}))}:{breakpoints:[]}})}_stepInTargets(e){return this._withThread(async t=>({targets:await t.getStepInTargets(e.frameId)}))}_setSourceMapStepping({enabled:e}){return this.sourceContainer.doSourceMappedStepping=e,Promise.resolve({})}async _saveDiagnosticLogs(e){let t=this._services.get(U).getRecentLogs();return await this._services.get($e).writeFile(e,t.map(n=>JSON.stringify(n)).join(`
`)),{}}async launchBlocker(){await this._configurationDoneDeferred.promise,await this._thread?.debuggerReady.promise,await this._services.get(pc).launchBlocker,await this.breakpointManager.launchBlocker()}async _onSetExcludedCallers({callers:e}){return(await this._threadDeferred.promise).setExcludedCallers(e),{}}async onInitialize(e){console.assert(e.linesStartAt1),console.assert(e.columnsStartAt1),this._services.get(Hl).value=e;let t=r.capabilities(!0);return setTimeout(()=>this.dap.initialized({}),0),setTimeout(()=>this._thread?.dapInitialized(),0),t}static capabilities(e=!1){return{supportsConfigurationDoneRequest:!0,supportsFunctionBreakpoints:!1,supportsConditionalBreakpoints:!0,supportsHitConditionalBreakpoints:!0,supportsEvaluateForHovers:!0,supportsReadMemoryRequest:!0,supportsWriteMemoryRequest:!0,exceptionBreakpointFilters:[{filter:"all",label:Or.t("Caught Exceptions"),default:!1,supportsCondition:!0,description:Or.t("Breaks on all throw errors, even if they're caught later."),conditionDescription:'error.name == "MyError"'},{filter:"uncaught",label:Or.t("Uncaught Exceptions"),default:!1,supportsCondition:!0,description:Or.t("Breaks only on errors or promise rejections that are not handled."),conditionDescription:'error.name == "MyError"'}],supportsStepBack:!1,supportsSetVariable:!0,supportsRestartFrame:!0,supportsGotoTargetsRequest:!1,supportsStepInTargetsRequest:!0,supportsCompletionsRequest:!0,supportsModulesRequest:!1,additionalModuleColumns:[],supportedChecksumAlgorithms:[],supportsRestartRequest:!0,supportsExceptionOptions:!1,supportsValueFormattingOptions:!0,supportsExceptionInfoRequest:!0,supportTerminateDebuggee:!0,supportsDelayedStackTraceLoading:!0,supportsLoadedSourcesRequest:!0,supportsLogPoints:!0,supportsTerminateThreadsRequest:!1,supportsSetExpression:!0,supportsTerminateRequest:!1,completionTriggerCharacters:[".","[",'"',"'"],supportsBreakpointLocationsRequest:!0,supportsClipboardContext:!0,supportsExceptionFilterOptions:!0,supportsEvaluationOptions:!!e,supportsDebuggerProperties:!!e,supportsSetSymbolOptions:!!e,supportsANSIStyling:!0}}async _onSetBreakpoints(e){return this.breakpointManager.setBreakpoints(e,e.breakpoints?.map(()=>this.breakpointIdCounter())??[])}async setExceptionBreakpoints(e){return await this._services.get(pc).setBreakpoints(e),{}}async configurationDone(){return this._configurationDoneDeferred.resolve(),{}}async _onLoadedSources(){return{sources:await this.sourceContainer.loadedSources()}}async _onDisableSourcemap(e){let t=this.sourceContainer.source(e.source);if(!t)return ve(Or.t("Source not found"));if(!(t instanceof Je))return ve(Or.t("Source not a source map"));for(let n of t.compiledToSourceUrl.keys())this.sourceContainer.disableSourceMapForSource(n,!0);return await this._thread?.refreshStackTrace(),{}}async _onSource(e){e.source||(e.source={sourceReference:e.sourceReference}),e.source.path=on(e.source.path);let t=this.sourceContainer.source(e.source);if(!t)return ve(Or.t("Source not found"));let n=await t.content();return n===void 0?(t instanceof Je&&this.dap.suggestDisableSourcemap({source:e.source}),ve(Or.t("Unable to retrieve source content"))):{content:n,mimeType:t.getSuggestedMimeType}}async _onThreads(){let e=[];return this._thread&&e.push({id:this._thread.id,name:this._thread.name()}),{threads:e}}findVariableStore(e){if(!this._thread)return;let t=this._thread.pausedVariables();if(t&&e(t))return t;if(e(this._thread.replVariables))return this._thread.replVariables}async _onLocations(e){let t=this.findVariableStore(o=>o.hasVariable(e.locationReference));if(!t||!this._thread)throw Gu();let n=await t.getLocations(e.locationReference),i=await this._thread.rawLocationToUiLocationWithWaiting(this._thread.rawLocation(n));if(!i)throw Gu();return{source:await i.source.toDap(),line:i.lineNumber,column:i.columnNumber}}async _onVariables(e){return{variables:await this.findVariableStore(n=>n.hasVariable(e.variablesReference))?.getVariables(e)??[]}}async _onReadMemory(e){let t=e.memoryReference,n=await this.findVariableStore(i=>i.hasMemory(t))?.readMemory(t,e.offset??0,e.count);return n?{address:"0",data:n.toString("base64"),unreadableBytes:e.count-n.length}:{address:"0",unreadableBytes:e.count}}async _onWriteMemory(e){let t=e.memoryReference;return{bytesWritten:await this.findVariableStore(i=>i.hasMemory(t))?.writeMemory(t,e.offset??0,Buffer.from(e.data,"base64"))}}async _onSetExpression(e){if(!this._thread)throw new T(Ay());let t=await this._thread.evaluate({expression:`${e.expression} = ${Fu(e.value)}`,context:"repl",frameId:e.frameId});return{value:t.result,variablesReference:t.variablesReference,indexedVariables:t.indexedVariables,namedVariables:t.namedVariables,presentationHint:t.presentationHint,type:t.type,memoryReference:t.memoryReference,valueLocationReference:t.valueLocationReference}}async _onSetVariable(e){let t=this.findVariableStore(n=>n.hasVariable(e.variablesReference));return t?(e.value=Fu(e.value.trim()),t.setVariable(e)):ve(Or.t("Variable not found"))}_withThread(e){if(!this._thread)throw new T(Ay());return e(this._thread)}async _refreshStackTrace(){if(!this._thread)return;this._thread.pausedDetails()&&await this._thread.refreshStackTrace()}createThread(e,t){this._thread=new uc(this.sourceContainer,e,this.dap,t,this._services.get(zi),this._services.get(U),this._services.get(Pr),this._services.get(Gf),this.launchConfig,this.breakpointManager,this._services.get(gh),this._services.get(pc),this._services.get(oo),this._services.get(Ji),this._services.get(Hl));let n=this._services.get(Eh);return n.connect(this.dap,this._thread),"profileStartup"in this.launchConfig&&this.launchConfig.profileStartup&&n.start(this.dap,this._thread,{type:gt.type}),this._thread.updateCustomBreakpoints(this._xhrBreakpoints,this._customBreakpoints),this.asyncStackPolicy.connect(e).then(i=>this._disposables.push(i)).catch(i=>this._services.get(U).error("internal","Error enabling async stacks",i)),this.breakpointManager.setThread(this._thread),this._services.get(Fe).attach(e),this._threadDeferred.resolve(this._thread),this._thread}async setCustomBreakpoints({ids:e,xhr:t}){return await this._thread?.updateCustomBreakpoints(t,e),this._customBreakpoints=e,this._xhrBreakpoints=t,{}}async _toggleSkipFileStatus(e){return await this._services.get(Qi).toggleSkippingFile(e),await this._refreshStackTrace(),{}}async _prettyPrintSource(e){if(!e.source||!this._thread)return{canPrettyPrint:!1};e.source.path=on(e.source.path);let t=this.sourceContainer.source(e.source);if(!t)return ve(Or.t("Source not found"));let n=await t.prettyPrint();if(!n)return ve(Or.t("Unable to pretty print"));let{map:i,source:o}=n;return await this.breakpointManager.moveBreakpoints(this._thread,t,i,o),this.sourceContainer.clearDisabledSourceMaps(t),await this._refreshStackTrace(),{}}onEvaluate(e){return e.expression===".scripts"?this._dumpDiagnostics({fromSuggestion:!1}).then(this.dap.openDiagnosticTool).then(()=>({result:"Opening diagnostic tool...",variablesReference:0})):this._withThread(t=>t.evaluate(e))}async _dumpDiagnostics(e){let t={file:await this._services.get(uo).generateHtml()};return e.fromSuggestion&&this._services.get(Dt).report("diagnosticPrompt",{event:"opened"}),t}async _requestCDPProxy(){return await this._cdpProxyProvider.proxy()}dispose(){this._disposables.dispose(),ef(this._services)}};var wO=_(je()),EH=_(H("os"));var R4={connect:async()=>Ys},BC=r=>({async connect(e){return await e.Debugger.setAsyncCallStackDepth({maxDepth:r}),Ys}}),k4=r=>{let e=new C,t=!1,n=()=>{t||(t=!0,e.fire())};return{async connect(i){if(t)return await i.Debugger.setAsyncCallStackDepth({maxDepth:r}),Ys;let o=new Ae;return o.push(e.event(()=>{o.dispose(),i.Debugger.setAsyncCallStackDepth({maxDepth:r})}),i.Debugger.on("breakpointResolved",n),i.Debugger.on("paused",s=>{s.reason!=="instrumentation"&&n()})),o}}},NC=BC(32),FC=r=>r===!1?R4:r===!0?NC:"onAttach"in r?BC(r.onAttach):"onceBreakpointResolved"in r?k4(r.onceBreakpointResolved):NC;var UC=H("fs"),WC=H("inspector"),xh=class{constructor(e){this.file=e;this.session=new WC.Session;this.session.connect()}async start(){try{await this.post("Profiler.enable")}catch{}await this.post("Profiler.start")}async stop(){let{profile:e}=await this.post("Profiler.stop");await UC.promises.writeFile(this.file,JSON.stringify(e))}dispose(){this.session.disconnect()}post(e,t){return new Promise((n,i)=>this.session.post(e,t,(o,s)=>{o?i(o):n(s)}))}};var Pl=Symbol("MutableLaunchConfig"),jC=r=>{let e=new C;return new Proxy({},{ownKeys(){return Object.keys(r)},get(t,n){switch(n){case"update":return i=>{r=i,e.fire()};case"onChange":return e.event;default:return r[n]}}})};var _H=_(Av()),mO=_(Dg()),IH=H("fs"),AH=_(q()),aAe=_(TH());var Cl=_(q());var $l=class{toDap(){return{category:"console",output:"\x1B[2J"}}},Fh=class{toDap(){return{category:"stdout",output:"",group:"end"}}};var Uh=class{constructor(e){this.sink=e;this.q=[];this.disposed=!1;this.onDrainedEmitter=new C;this.onDrained=this.onDrainedEmitter.event}get length(){return this.q.length}enqueue(e){this.disposed||(this.q.push(new wv(e)),this.q.length===1&&this.process())}dispose(){this.disposed=!0,this.q=[]}async process(){let e=this.q.findIndex(t=>t.value===iD);e===0?await this.q[0].wait:e===-1?(this.sink(nD(this.q)),this.q=[]):(this.sink(nD(this.q.slice(0,e))),this.q=this.q.slice(e)),this.q.length?this.process():this.onDrainedEmitter.fire()}},nD=r=>r.map(e=>e.value).filter(e=>e!==oD),iD=Symbol("unsettled"),oD=Symbol("unsettled"),wv=class{constructor(e){this.value=iD;e instanceof Promise?this.wait=e.then(t=>{this.value=t},()=>{this.value=oD}):(this.value=e,this.wait=Promise.resolve())}};var v5=new Set(["group","assert","count"]),mc=class{constructor(e,t){this.dap=e;this.isDirty=!1;this.queue=new Uh(e=>{for(let t of e)this.dap.output(t)});this.onDrained=this.queue.onDrained;t.register(0,async n=>{this.length&&await new Promise(i=>this.onDrained(i)),n&&this.dispose()})}get length(){return this.queue.length}dispose(){this.queue.dispose()}dispatch(e,t){let n=this.parse(t);n&&this.enqueue(e,n)}enqueue(e,t){if(!(t instanceof $l))this.isDirty=!0;else if(this.isDirty)this.isDirty=!1;else return;this.queue.enqueue(t.toDap(e))}parse(e){if(e.type==="log"){let t=e.stackTrace?.callFrames[0];if(t&&t.url==="internal/console/constructor.js"&&v5.has(t.functionName))return}switch(e.type){case"clear":return new $l;case"endGroup":return new Fh;case"assert":return new lh(e);case"table":return new mh(e);case"startGroup":case"startGroupCollapsed":return new hh(e);case"debug":case"log":case"info":return new co(e);case"trace":return new ph(e);case"error":return new fh(e);case"warning":return new dh(e);case"dir":case"dirxml":return new co(e);case"count":return new co(e);case"profile":case"profileEnd":return new co(e);case"timeEnd":return new co(e);default:try{gp(e.type,"unknown console message type")}catch{}}}};mc=E([(0,Cl.injectable)(),g(0,(0,Cl.inject)(Yt)),g(1,(0,Cl.inject)(Ji))],mc);var aD=_(je()),Wh=_(q());var sD="@vscode/dwarf-debugging",Hc=class{constructor(e){this.dap=e;this.didPrompt=!1}async load(){try{return await import(sD)}catch{return}}prompt(){this.didPrompt||(this.didPrompt=!0,this.dap.output({output:aD.t("You may install the `{}` module via npm for enhanced WebAssembly debugging",sD),category:"console"}))}};Hc=E([(0,Wh.injectable)(),g(0,(0,Wh.inject)(Yt))],Hc);var Ur=_(q());var TM=_(cD()),MM=H("dns"),bm=_(DM()),Es=_(q());var ym=Symbol("IRequestOptionsProvider");var go=class{constructor(e,t){this.fs=e;this.options=t;this.autoLocalhostPortFallbacks={}}async fetch(e,t=Vt,n){try{let o=(0,TM.dataUriToBuffer)(e);return{ok:!0,url:e,body:new TextDecoder().decode(o.buffer),statusCode:200}}catch{}let i=$t(e)?e:We(e);if(i)try{return{ok:!0,url:e,body:await this.fs.readFile(i,"utf-8"),statusCode:200}}catch(o){return{ok:!1,url:e,error:o,statusCode:200}}return this.fetchHttp(e,t,n)}async fetchJson(e,t,n){let i=await this.fetch(e,t,{Accept:"application/json",...n});if(!i.ok)return i;try{return{...i,body:JSON.parse(i.body)}}catch(o){return{...i,ok:!1,url:e,error:o}}}async fetchHttp(e,t,n){let i=new URL(e),o=i.protocol!=="http:",s=Number(i.port)??(o?443:80),a={headers:n,followRedirect:!0};o&&await ga(e)&&(a.rejectUnauthorized=!1),this.options?.provideOptions(a,e);let c=i.hostname==="localhost";if(c&&this.autoLocalhostPortFallbacks[s]){let p=await this.requestHttp(i.toString(),a,t);return p.statusCode!==503?p:(delete this.autoLocalhostPortFallbacks[s],this.requestHttp(e,a,t))}let l=await this.requestHttp(e,a,t);if(l.statusCode===503&&c){let p;try{p=await MM.promises.lookup(i.hostname)}catch{return l}i.hostname=p.family===6?"127.0.0.1":"[::1]",l=await this.requestHttp(i.toString(),a,t),l.statusCode!==503&&(this.autoLocalhostPortFallbacks[s]=i.hostname)}return l}async requestHttp(e,t,n){this.options?.provideOptions(t,e);let i=new Ae;try{let o=(0,bm.default)(e,t);i.push(n.onCancellationRequested(()=>o.cancel()));let s=await o;return{ok:!0,url:e,body:s.body,statusCode:s.statusCode}}catch(o){if(!(o instanceof bm.RequestError))throw o;let s=o.response?String(o.response?.body):o.message,a=o.response?.statusCode??503;return{ok:!1,body:s,statusCode:a,url:e,error:new zd(a,e,s)}}finally{i.dispose()}}};go=E([(0,Es.injectable)(),g(0,(0,Es.inject)($e)),g(1,(0,Es.optional)()),g(1,(0,Es.inject)(ym))],go);var xs=class extends go{constructor(t,n,i,o,s){super(t,s);this.logger=n;this.target=i;this.cdp=o;this.disposables=new Ae}dispose(){this.disposables.dispose()}async fetchHttp(t,n,i={}){let o=await super.fetchHttp(t,n,i);return o.ok?o:(this.logger.info("runtime","Network load failed, falling back to CDP",{url:t,res:o}),this.fetchOverBrowserNetwork(t,o))}async fetchOverBrowserNetwork(t,n){if(!this.cdp)return n;let i=await this.cdp.Network.loadNetworkResource({frameId:this.target?.targetInfo.targetId,url:t,options:{includeCredentials:!0,disableCache:!0}});if(!i||!i.resource.success||!i.resource.httpStatusCode||i.resource.httpStatusCode>=400||!i.resource.stream)return n;let o=Number(i.resource.headers?.["Content-Length"]);isNaN(o)&&(o=1/0);let s=[],a=0;for(;;){let c=await this.cdp.IO.read({handle:i.resource.stream,offset:a});if(!c)return this.logger.info("runtime","Stream error encountered in middle, falling back",{url:t}),n;let u=c.base64Encoded?Buffer.from(c.data,"base64").toString():c.data;if(a+=Buffer.byteLength(u,"utf-8"),s.push(u),a>=o){this.cdp.IO.close({handle:i.resource.stream});break}if(c.eof)break}return{ok:!0,body:s.join(""),statusCode:i.resource.httpStatusCode,url:t}}};xs=E([(0,Ur.injectable)(),g(0,(0,Ur.inject)($e)),g(1,(0,Ur.inject)(U)),g(2,(0,Ur.optional)()),g(2,(0,Ur.inject)(Zn)),g(3,(0,Ur.optional)()),g(3,(0,Ur.inject)(Be)),g(4,(0,Ur.optional)()),g(4,(0,Ur.inject)(ym))],xs);var yo=_(q()),OM=_(tl());function kM(r,e=Ut){let t=[];for(let n=0;n<r.length;n++){let i=r[n];if(i.startsWith("!")){let o=RM(i.slice(1),e);for(let s=0;s<t.length;s++)t[s]=`^(?!${o.slice(1)})${t[s].slice(1)}`}else t.push(RM(i,e))}return t.map(n=>new RegExp(n,"i"))}function RM(r,e=Ut){let t=r.split("/"),n=[];for(let i=0;i<t.length;i++){let o=t[i];if(o==="**")i===0?n.push("(.+/)?"):i===t.length-1||n.push(".*/");else{if(o.includes("*")){let s=o.split("*");n.push(s.map(a=>e(a)).join("[^\\/]*"))}else n.push(e(o));n.push(i<t.length-1?"\\/":"$")}}return`^${n.join("")}`}function EX(r){let e=/^<node_internals>[\/\\](.*)$/,t=r.map(n=>{n=n.trim();let i=e.exec(n);return i?i[1]:null}).filter(It);return t.length>0?t:void 0}function xX(r,e){return e.filter(n=>!n.includes(di)).map(n=>$t(n)?ya(r.rebaseLocalToRemote(n)):Oe(n)).map(Bd)}var ei=class{constructor({skipFiles:e},t,n,i,o){this.logger=n;this.cdp=i;this._regexForAuthored=V_(e=>kM(e,t=>Bu(t,0,t.length,!0,!0)));this._scriptsWithSkipping=new Set;this._targetId=o.id(),this._rootTargetId=NM(o).id(),this._isUrlFromSourceMapSkipped=new Mn(s=>this._normalizeUrl(s)),this._authoredGlobs=xX(t,e),this._nodeInternalsGlobs=EX(e),this._initNodeInternals(o),this._updateSkippedDebounce=G_(500,()=>this._updateGeneratedSkippedSources()),e.length&&this._updateGeneratedSkippedSources(),ei.sharedSkipsEmitter.event(s=>{s.rootTargetId===this._rootTargetId&&s.targetId!==this._targetId&&this._toggleSkippingFile(s.params)})}setSourceContainer(e){this._sourceContainer=e}_testSkipNodeInternal(e){return this._nodeInternalsGlobs?(e.startsWith(en)&&(e=e.slice(en.length)),(0,OM.default)([e],this._nodeInternalsGlobs).length>0):!1}_testSkipAuthored(e){return this._regexForAuthored(this._authoredGlobs).some(t=>t.test(e))}_isNodeInternal(e,t){return e.startsWith(en)?!0:t?.has(e)||/^internal\/.+\.js$/.test(e)}async _updateGeneratedSkippedSources(){let e=this._regexForAuthored(this._authoredGlobs).map(n=>n.source),t=this._allNodeInternals?.settledValue;if(t){e.push(`^(${en})?internal\\/`);for(let n of t)this._testSkipNodeInternal(n)&&e.push(`^(${en})?${Ut(n)}$`)}await this.cdp.Debugger.setBlackboxPatterns({patterns:e})}_normalizeUrl(e){return Oe(e.toLowerCase())}isScriptSkipped(e){return this._isNodeInternal(e,this._allNodeInternals?.settledValue)?this._testSkipNodeInternal(e):(e=this._normalizeUrl(e),this._isUrlFromSourceMapSkipped.get(e)===!0?!0:this._testSkipAuthored(e))}async _updateSourceWithSkippedSourceMappedSources(e,t){let n=this.isScriptSkipped(e.url),i=[],o=n;for(let a of e.sourceMap.sourceByUrl.values()){let c=this.isScriptSkipped(a.url);if(typeof c>"u"&&(c=n),c!==o){let[[u],[l]]=await Promise.all([this._sourceContainer.currentSiblingUiLocations({source:a,lineNumber:1,columnNumber:1},e),this._sourceContainer.currentSiblingUiLocations({source:a,lineNumber:1/0,columnNumber:1},e)]);u&&l?(i.push({lineNumber:u.lineNumber-1,columnNumber:u.columnNumber-1},{lineNumber:l.lineNumber-1,columnNumber:l.columnNumber-1}),o=!o):this.logger.error("internal","Could not map script beginning for "+a.sourceReference)}}let s=t;i.length||(s=s.filter(a=>this._scriptsWithSkipping.has(a.scriptId)),s.forEach(a=>this._scriptsWithSkipping.delete(a.scriptId))),s.map(({scriptId:a})=>this.cdp.Debugger.setBlackboxedRanges({scriptId:a,positions:i}))}initializeSkippingValueForSource(e){this._initializeSkippingValueForSource(e)}_initializeSkippingValueForSource(e,t=e.scripts){let n=e.url,i=this.isScriptSkipped(n);if(!i&&e.absolutePath&&this._testSkipAuthored(He(e.absolutePath))&&(this.setIsUrlBlackboxSkipped(n,!0),i=!0,this._updateSkippedDebounce()),Wt(e)){if(i)for(let o of e.sourceMap.sourceByUrl.values())this._isUrlFromSourceMapSkipped.set(o.url,!0);for(let o of e.sourceMap.sourceByUrl.values())this._initializeSkippingValueForSource(o,t);this._updateSourceWithSkippedSourceMappedSources(e,t)}}async _initNodeInternals(e){if(e.type()!=="node"||!this._nodeInternalsGlobs||this._allNodeInternals)return;let t=this._allNodeInternals=ge(),n=await this.cdp.Runtime.evaluate({expression:"require('module').builtinModules"+Ne(),returnByValue:!0,includeCommandLineAPI:!0});n&&!n.exceptionDetails?t.resolve(new Set(n.result.value.map(i=>i+".js"))):t.resolve(new Set),await this._updateGeneratedSkippedSources()}async _toggleSkippingFile(e){let t;e.resource&&$t(e.resource)&&(t=e.resource);let n={path:t,sourceReference:e.sourceReference},i=this._sourceContainer.source(n);if(!i)return{};let o=!this.isScriptSkipped(i.url);if(i instanceof Je){this._isUrlFromSourceMapSkipped.set(i.url,o);let s=Array.from(i.compiledToSourceUrl.keys());await Promise.all(s.map(a=>this._updateSourceWithSkippedSourceMappedSources(a,a.scripts)))}else{if(Wt(i))for(let s of i.sourceMap.sourceByUrl.values())this._isUrlFromSourceMapSkipped.set(s.url,o);this.setIsUrlBlackboxSkipped(i.url,o),await this._updateGeneratedSkippedSources()}return{}}setIsUrlBlackboxSkipped(e,t){let n=e,i=`!${n}`,o=this._authoredGlobs.filter(s=>s!==n&&s!==i);this._regexForAuthored(o).some(s=>s.test(e))!==t&&(o.push(t?n:i),this._regexForAuthored.clear()),this._authoredGlobs=o}async toggleSkippingFile(e){let t=await this._toggleSkippingFile(e);return ei.sharedSkipsEmitter.fire({params:e,rootTargetId:this._rootTargetId,targetId:this._targetId}),t}};ei.sharedSkipsEmitter=new C,ei=E([(0,yo.injectable)(),g(0,(0,yo.inject)(de)),g(1,(0,yo.inject)(Se)),g(2,(0,yo.inject)(U)),g(3,(0,yo.inject)(Be)),g(4,(0,yo.inject)(Zn))],ei);function NM(r){let e=r.parent();return e?NM(e):r}var jl=_(q()),FM=H("path");var BM=/^webpack:\/{3}([^/]+?\.vue)(\?[0-9a-z]*)?$/i,PX=/^webpack:\/{3}\.\/.+\.vue\?[0-9a-z]+$/i,Pc=Symbol("IVueFileMapper");var xc=class{constructor(e,t){this.files=e;this.search=t;this.getMapping=ne(async()=>{let e=new Map;return await this.search.streamAllChildren(this.files,t=>e.set((0,FM.basename)(t),t)),e})}async lookup(e){let t=BM.exec(e);return t?(await this.getMapping()).get(t[1]):void 0}getVueHandling(e){return this.files.empty?0:BM.test(e)?1:PX.test(e)?2:0}};xc=E([(0,jl.injectable)(),g(0,(0,jl.inject)(gi)),g(1,(0,jl.inject)(Da))],xc);var ti=class{constructor(){this.changeEmitter=new C;this.addEmitter=new C;this.removeEmitter=new C;this.targetMap=new Map;this.onChanged=this.changeEmitter.event;this.onAdd=this.addEmitter.event;this.onRemove=this.removeEmitter.event}get size(){return this.targetMap.size}add(e,t){this.targetMap.set(e,t),this.addEmitter.fire([e,t]),this.changeEmitter.fire()}get(e){return this.targetMap.get(e)}remove(e){let t=this.targetMap.get(e);return t===void 0?!1:(this.targetMap.delete(e),this.removeEmitter.fire([e,t]),this.changeEmitter.fire(),!0)}value(){return this.targetMap.values()}};var Ps=_(q());var iR=Symbol("IDefaultBrowserProvider"),Lc=class{constructor(e,t){this.location=e;this.vscode=t;this.lookup=ne(async()=>{let e;return this.location==="remote"&&this.vscode?e=await this.vscode.commands.executeCommand("js-debug-companion.defaultBrowser"):e=(await Promise.resolve().then(()=>(nR(),rR)).then(n=>n.default())).name,["chrome","edge"].find(n=>e.toLowerCase().includes(n))??"other"})}};Lc=E([(0,Ps.injectable)(),g(0,(0,Ps.inject)(Hi)),g(1,(0,Ps.optional)()),g(1,(0,Ps.inject)(Fn))],Lc);var sR=_(q()),Am=_(H("os"));var _m=class{async setup(){}dispose(){}write(e){if(e.level>2)throw new Error(e.message);console.log(JSON.stringify(e))}};var OI=class{constructor(e=512){this.size=e;this.items=[];this.i=0}write(e){this.items[this.i]=e,this.i=(this.i+1)%this.size}read(){return this.items.slice(this.i).concat(this.items.slice(0,this.i))}},Wr=class{constructor(){this.logTarget={queue:[]};this.logBuffer=new OI}static async test(){let e=new Wr;return e.setup({sinks:[new _m],showWelcome:!1}),e}info(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:1})}verbose(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:0})}warn(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:2})}error(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:3})}fatal(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:4})}assert(e,t){if(e===!1||e===void 0||e===null){if(this.error("runtime.assertion",t,{error:new Error("Assertion failed")}),process.env.JS_DEBUG_THROW_ASSERTIONS)throw new Error(t);debugger;return!1}return!0}log(e){if(this.logBuffer.write(e),"queue"in this.logTarget){this.logTarget.queue.push(e);return}for(let t of this.logTarget.sinks)t.write(e)}getRecentLogs(){return this.logBuffer.read()}dispose(){if("sinks"in this.logTarget){for(let e of this.logTarget.sinks)e.dispose();this.logTarget={queue:[]}}}forTarget(){return this}async setup(e){if(await Promise.all(e.sinks.map(n=>n.setup())),e.showWelcome!==!1){let n=RX();for(let i of e.sinks)i.write(n)}let t=this.logTarget;this.logTarget={sinks:e.sinks.slice()},"sinks"in t?t.sinks.forEach(n=>n.dispose()):t.queue.forEach(n=>this.log(n))}};Wr.null=(()=>{let e=new Wr;return e.setup({sinks:[]}),e})(),Wr=E([(0,sR.injectable)()],Wr);var RX=()=>({timestamp:Date.now(),tag:"runtime.welcome",level:1,message:`${Xd} v${Vu} started`,metadata:{os:`${Am.platform()} ${Am.arch()}`,nodeVersion:process.version,adapterVersion:Vu}});var Pk=_(lk()),Rm=_(q());var Ms=Symbol("touched"),Io;(c=>{function r(){return{children:{},[Ms]:1}}c.root=r;function e(u,l){return u[Ms]=1,a(u,s(l),0)}c.getPath=e;function t(u){u[Ms]=1}c.touch=t;function n(u){u[Ms]=2}c.touchAll=n;function i(u,l){let p=u.children[l]??={children:{}};return p[Ms]=1,p}c.getOrMakeChild=i;function o(u){if(u[Ms]){for(let[l,p]of Object.entries(u.children))switch(p[Ms]){case 1:o(p);break;case 2:break;default:delete u.children[l]}return u}}c.prune=o;function s(u){let l=u.split(/\/|\\/);return l[0]===""&&l.unshift(),l}function a(u,l,p){let d=i(u,l[p]);return p===l.length-1?d:a(d,l,p+1)}})(Io||={});var a_=H("fs"),c_=_(tl()),Rs=H("path"),xk=_(Ek());var y6=/\//g,Mm=class{constructor(e){this.stat=ko(e=>a_.promises.lstat(e));this.readdir=ko(e=>a_.promises.readdir(e,{withFileTypes:!0}));this.alreadyProcessedFiles=new Set;this.fileEmitter=new C;this.onFile=this.fileEmitter.event;this.errorEmitter=new C;this.onError=this.errorEmitter.event;this.processor=e.fileProcessor,this.filter=e.filter,this.ignore=e.ignore.map(i=>c_.default.matcher((0,xk.default)(Oe(i),{cwd:e.cwd})));let t=(0,Rs.isAbsolute)(e.pattern)?(0,Rs.relative)(e.cwd,e.pattern):e.pattern,n=c_.default.parse(Oe(t),{ignore:e.ignore,cwd:e.cwd,expand:!0});this.done=Promise.all(n.map(i=>{let o=[];for(let u=1;u<i.tokens.length;){let l=u+1;for(;l<i.tokens.length&&i.tokens[l].type!=="slash";)l++;let p=i.tokens[u];p.type==="globstar"?o.push("**"):l===u+1&&p.type==="text"?o.push(p.value):o.push(new RegExp("^"+i.tokens.slice(u,l).map(d=>d.output||d.value).join("")+"$")),u=l+1}let s=o[0]==="**"?[0,1]:[0],a=Io.getPath(e.cache,e.cwd),c={elements:o,seen:new Set};return Promise.all(s.map(u=>this.readSomething(c,u,e.cwd,[],a)))})).then(()=>{})}async readSomething(e,t,n,i,o){if(this.alreadyProcessedFiles.has(o))return;let s=`${t}:${n}`;if(e.seen.has(s))return;e.seen.add(s);let a;try{a=await this.stat(n)}catch(u){this.errorEmitter.fire({path:n,error:u});return}if(this.alreadyProcessedFiles.has(o))return;let c=o.data;if(c&&a.mtimeMs===c.mtime){if(c.type===0){let u=[],p=Object.entries(o.children).filter(([,d])=>d.data?.type!==0).map(([d])=>d);for(let[d,f]of Object.entries(o.children))u.push(f.data!==void 0?this.handleDirectoryEntry(e,t,n,{name:d,type:f.data.type},p,o):this.stat(n).then(h=>this.handleDirectoryEntry(e,t,n,{name:d,type:h.isFile()?1:0},p,o),()=>{}));await Promise.all(u)}else c.type===1&&(this.alreadyProcessedFiles.add(o),this.fileEmitter.fire(c.extracted));return}a.isDirectory()?await this.handleDir(e,t,a.mtimeMs,n,o):(this.alreadyProcessedFiles.add(o),await this.handleFile(a.mtimeMs,n,i,o))}applyFilterToFile(e,t,n){let i=n.children[e];if(this.alreadyProcessedFiles.has(i))return!1;if(!this.filter)return!0;let o=i.data?.type===1?i.data.extracted:void 0;return Io.touch(i),this.filter(t,o)}handleDirectoryEntry(e,t,n,i,o,s){let a=n+"/"+i.name,c=this.getDirectoryReadDescends(e,t,n,i);if(c===void 0)return;let u=Io.getOrMakeChild(s,i.name);if(!(i.type===1&&!this.applyFilterToFile(i.name,a,s)))return typeof c=="number"?this.readSomething(e,t+c,a,o,u):Promise.all(c.map(l=>this.readSomething(e,t+l,a,o,u)))}getDirectoryReadDescends(e,t,n,i){let o=n+"/"+i.name;if(this.ignore.some(c=>c(o)))return;let s=t===e.elements.length-1,a=e.elements[t];if(a==="**")return i.type===1?s?0:this.getDirectoryReadDescends(e,t+1,n,i):s?0:[0,1];if((a instanceof RegExp&&a.test(i.name)||a===i.name)&&(i.type===0?!s:s))return 1}async handleFile(e,t,n,i){let o=Rs.sep==="/"?t:t.replace(y6,Rs.sep),s;try{s=await this.processor(o,{siblings:n,mtime:e})}catch(a){this.errorEmitter.fire({path:o,error:a});return}i.data={type:1,mtime:e,extracted:s},this.fileEmitter.fire(s)}async handleDir(e,t,n,i,o){let s;try{s=await this.readdir(i)}catch(u){this.errorEmitter.fire({path:i,error:u});return}let a=[],c=s.filter(u=>u.isFile()).map(u=>u.name);for(let u of s){if(u.name.startsWith("."))continue;let l;if(u.isDirectory())l=0;else if(u.isFile())l=1;else continue;a.push(this.handleDirectoryEntry(e,t,i,{name:u.name,type:l},c,o))}await Promise.all(a),o.data={type:0,mtime:n}}};var Rc=class{constructor(e){this.logger=e}async streamAllChildren(e,t){let n=[];return await this.globForFiles(e,o=>n.push(t(Xe(o.path)))),(await Promise.all(n)).filter(o=>o!==void 0)}async streamChildrenWithSourcemaps(e){let t=[],n=e.lastState||{},i={};return await Promise.all([...e.files.explode()].map(async s=>{let a=JSON.stringify(s),c=n[a]||Io.root();await this._streamChildrenWithSourcemaps(c,e,t,s);let u=Io.prune(c);u&&(i[a]=u)})),this.logger.info("sourcemap.parsing",`turboGlobStream search found ${t.length} files`),{values:(await Promise.all(t)).filter(It),state:i}}async _streamChildrenWithSourcemaps(e,t,n,i){let o=new Mm({pattern:i.pattern,ignore:i.negations,cwd:i.cwd,cache:e,filter:t.filter,fileProcessor:(s,a)=>Lx(s,a).then(c=>c&&t.processMap(c))});o.onError(({path:s,error:a})=>{this.logger.warn("sourcemap.parsing","Error parsing source map",{error:a,path:s})}),o.onFile(s=>s&&n.push(t.onProcessedMap(s))),await o.done}async globForFiles(e,t){await Promise.all([...e.explode()].map(n=>new Promise((i,o)=>(0,Pk.default)([n.pattern,"!**/*.asar/**"],{ignore:n.negations,cwd:n.cwd}).on("data",t).on("end",i).on("error",o))))}};Rc=E([(0,Rm.injectable)(),g(0,(0,Rm.inject)(U))],Rc);var Gm=_(je()),So=_(q());var Lk=_(H("path")),$k=H("url");var km=class{constructor(){this._onFrameAddedEmitter=new C;this._onFrameRemovedEmitter=new C;this._onFrameNavigatedEmitter=new C;this.onFrameAdded=this._onFrameAddedEmitter.event;this.onFrameRemoved=this._onFrameRemovedEmitter.event;this.onFrameNavigated=this._onFrameNavigatedEmitter.event;this._frames=new Map}attached(e,t){e.Page.enable({}),e.Page.getResourceTree({}).then(n=>{this._processCachedResources(e,n?n.frameTree:void 0,t)})}mainFrame(){return this._mainFrame}_processCachedResources(e,t,n){t&&this._addFramesRecursively(e,t,t.frame.parentId,n),e.Page.on("frameAttached",i=>{this._frameAttached(e,n,i.frameId,i.parentFrameId)}),e.Page.on("frameNavigated",i=>{this._frameNavigated(e,n,i.frame)}),e.Page.on("frameDetached",i=>{this._frameDetached(e,n,i.frameId)})}_addFrame(e,t,n){let i=new l_(this,e,t,n);return this._frames.set(i.id,i),i.isMainFrame()&&(this._mainFrame=i),this._onFrameAddedEmitter.fire(i),i}_frameAttached(e,t,n,i){let o=this._frames.get(n);return o||(o=this._addFrame(e,n,i)),o._ref(t),o}_frameNavigated(e,t,n){let i=this._frames.get(n.id);i||(i=this._frameAttached(e,t,n.id,n.parentId)),i._navigate(n,t),this._onFrameNavigatedEmitter.fire(i)}_frameDetached(e,t,n){let i=this._frames.get(n);i&&i._unref(t)}frameForId(e){return this._frames.get(e)}frames(){return Array.from(this._frames.values())}_addFramesRecursively(e,t,n,i){let o=t.frame,s=this._frames.get(o.id);s?(s._navigate(o,i),this._onFrameNavigatedEmitter.fire(s)):(s=this._addFrame(e,o.id,n),s._navigate(o,i));for(let a=0;t.childFrames&&a<t.childFrames.length;++a)this._addFramesRecursively(e,t.childFrames[a],s.id,i)}},l_=class{constructor(e,t,n,i){this._targets=new Set;this.cdp=t,this.model=e,this._parentFrameId=i,this.id=n,this._url=""}_ref(e){this._targets.add(e)}_navigate(e,t){this._name=e.name,this._url=e.url,this._securityOrigin=e.securityOrigin,this._unreachableUrl=e.unreachableUrl||"",this._ref(t),this._unrefChildFrames(t)}name(){return this._name||""}url(){return this._url}securityOrigin(){return this._securityOrigin}unreachableUrl(){return this._unreachableUrl}isMainFrame(){return!this._parentFrameId}parentFrame(){return this._parentFrameId?this.model.frameForId(this._parentFrameId):void 0}childFrames(){return this.model.frames().filter(e=>e._parentFrameId===this.id)}_unrefChildFrames(e){for(let t of this.childFrames())t._unref(e)}_unref(e){this._targets.delete(e),!this._targets.size&&(this._unrefChildFrames(e),this.model._frames.delete(this.id),this.model._onFrameRemovedEmitter.fire(this))}displayName(){return this._name?this._name:b6(this._url)||`<iframe ${this.id}>`}};function u_(r,e){return r.length<=e?r:r.substr(0,e-1)+"\u2026"}function b6(r){let e;try{e=new $k.URL(r)}catch{return u_(r,20)}if(e.protocol==="data")return u_(r,20);if(e.protocol==="blob"||r==="about:blank")return r;let t=Lk.basename(e.pathname);return t||(t=(e.host||"")+"/"),t==="/"&&(t=u_(r,20)),t}var Ck=H("url");var p_=class{constructor(e){this.versions=new Map;this.id=e.registrationId,this.scopeURL=e.scopeURL}},d_=class{constructor(e,t){this.revisions=[];this.registration=e,this.id=t.versionId,this.scriptURL=t.scriptURL,this._targetId=t.targetId,this._status=t.status,this._runningStatus=t.runningStatus}addRevision(e){this._targetId&&e.targetId&&this._targetId!==e.targetId&&console.error(`${this._targetId} !== ${e.targetId}`),e.targetId&&(this._targetId=e.targetId),this._status=e.status,this._runningStatus=e.runningStatus,this.revisions.unshift(e)}status(){return this._status}runningStatus(){return this._runningStatus}targetId(){return this._targetId}label(){let e=new Ck.URL(this.registration.scopeURL),t=e.pathname.substr(1);t.endsWith("/")&&(t=t.substring(0,t.length-1));let n=t||`${e.host}`,i=this._status==="activated"?"":` ${this._status}`,o=this._runningStatus==="running"?"":` ${this._runningStatus}`;return`${n} #${this.id}${i}${o}`}},Om=class r{constructor(e){this._registrations=new Map;this._versions=new Map;this._onDidChangeUpdater=new C;this.onDidChange=this._onDidChangeUpdater.event;this._targets=new Set;this._frameModel=e,r._instances.add(this)}static{this._instances=new Set}dispose(){r._instances.delete(this)}attached(e){this._targets.add(e),!this._cdp&&(this._cdp=e,e.ServiceWorker.enable({}),e.ServiceWorker.on("workerRegistrationUpdated",t=>this._workerRegistrationsUpdated(t.registrations)),e.ServiceWorker.on("workerVersionUpdated",t=>this._workerVersionsUpdated(t.versions)),r._mode!=="normal"&&this.setMode(r._mode))}async detached(e){this._targets.delete(e)}version(e){return this._versions.get(e)}registrations(){let e=[],t=this._frameModel.frames().map(n=>n.url());for(let n of this._registrations.values())for(let i of t)if(i.startsWith(n.scopeURL)){e.push(n);break}return e}registration(e){return this._registrations.get(e)}_workerVersionsUpdated(e){for(let t of e){let n=this._registrations.get(t.registrationId);if(!n)continue;let i=n.versions.get(t.versionId);i||(i=new d_(n,t),n.versions.set(t.versionId,i)),t.targetId&&this._versions.set(t.targetId,i),i.addRevision(t),i.status()==="redundant"&&i.runningStatus()==="stopped"&&(t.targetId&&this._versions.delete(t.targetId),n.versions.delete(i.id))}this._onDidChangeUpdater.fire()}_workerRegistrationsUpdated(e){for(let t of e)if(t.isDeleted){if(!this._registrations.has(t.registrationId))debugger;this._registrations.delete(t.registrationId)}else{if(this._registrations.has(t.registrationId))return;this._registrations.set(t.registrationId,new p_(t))}this._onDidChangeUpdater.fire()}static setModeForAll(e){r._mode=e;for(let t of r._instances)t.setMode(e)}setMode(e){if(this._cdp){this._cdp.ServiceWorker.setForceUpdateOnPageLoad({forceUpdateOnPageLoad:e==="force"});for(let t of this._targets.values())e==="bypass"?(t.Network.enable({}),t.Network.setBypassServiceWorker({bypass:!0})):t.Network.disable({})}}async stopWorker(e){if(!this._cdp)return;let t=this.version(e);t&&await this._cdp.ServiceWorker.stopWorker({versionId:t.id})}};var _o=class{constructor(e,t,n,i,o,s,a,c){this.process=t;this.logger=o;this.telemetry=s;this.launchParams=a;this._targets=new Map;this._detachedTargets=new Set;this.frameModel=new km;this.serviceWorkerModel=new Om(this.frameModel);this._lifecycleQueue=Promise.resolve();this._onTargetAddedEmitter=new C;this._onTargetRemovedEmitter=new C;this.onTargetAdded=this._onTargetAddedEmitter.event;this.onTargetRemoved=this._onTargetRemovedEmitter.event;this._connection=e,this._sourcePathResolver=i,this._browser=n,this._targetOrigin=c,this.serviceWorkerModel.onDidChange(()=>{for(let u of this._targets.values())u.type()==="service_worker"&&u._onNameChangedEmitter.fire()})}static async connect(e,t,n,i,o,s,a){let u=await e.rootSession().Target.attachToBrowserTarget({});if(!u)return;let l=e.createSession(u.sessionId);return new this(e,t,l,n,o,s,i,a)}dispose(){this.serviceWorkerModel.dispose()}targetList(){return Array.from(this._targets.values()).filter(e=>ku.has(e.type()))}async getCandiateInfo(e){let t=await this._browser.Target.getTargets({});return t?e?t.targetInfos.filter(e):t.targetInfos:[]}async closeBrowser(){if(this.launchParams.request==="launch"){if(this.launchParams.cleanUp==="wholeBrowser")await this._browser.Browser.close({}),this.process?.kill();else for(let e of this._targets.values())await this._browser.Target.closeTarget({targetId:e.targetId}),this._connection.close();this.process=void 0}}waitForMainTarget(e){let t,n=new Promise(o=>t=o),i=async o=>{if([...this._targets.values()].some(c=>c.targetId===o.targetId)||this._detachedTargets.has(o.targetId)||e&&!e(o))return;let s=this._browser.Target.on("targetInfoChanged",c=>{c.targetInfo.targetId===o.targetId&&(o=c.targetInfo)}),a;try{a=await this._browser.Target.attachToTarget({targetId:o.targetId,flatten:!0})}finally{s.dispose()}if(!a){t(void 0);return}t(this.attachedToTarget(o,a.sessionId,!0))};return this._browser.Target.setDiscoverTargets({discover:!0}),this._browser.Target.on("targetCreated",this.enqueueLifecycleFn(o=>i(o.targetInfo))),this._browser.Target.on("targetInfoChanged",o=>this._targetInfoChanged(o.targetInfo,this.enqueueLifecycleFn(i))),this._browser.Target.on("detachedFromTarget",this.enqueueLifecycleFn(async o=>{o.targetId&&await this._detachedFromTarget(o.sessionId,!1)})),n}enqueueLifecycleFn(e){return t=>this._lifecycleQueue=this._lifecycleQueue.then(()=>e(t))}attachedToTarget(e,t,n,i,o=!0){let s=this._targets.get(t);if(s)return s;let a=this._connection.createSession(t),c=new Rd(this,e,a,i,n,this.launchParams,t,this.logger,()=>{this._connection.disposeSession(t),this._detachedFromTarget(t)});this._targets.set(t,c),i&&i._children.set(e.targetId,c),a.Target.on("attachedToTarget",async l=>{this.attachedToTarget(l.targetInfo,l.sessionId,l.waitingForDebugger,c)}),a.Target.on("detachedFromTarget",async l=>{l.targetId&&this._detachedFromTarget(l.sessionId,!1)}),a.Target.setAutoAttach({autoAttach:!0,waitForDebuggerOnStart:o,flatten:!0}),a.Network.setCacheDisabled({cacheDisabled:this.launchParams.disableNetworkCache}).catch(l=>this.logger.info("runtime.target","Error setting network cache state",l)),i||this.retrieveBrowserTelemetry(a);let u=e.type;return Md.has(u)&&this.frameModel.attached(a,e.targetId),this.serviceWorkerModel.attached(a),this._onTargetAddedEmitter.fire(c),!ku.has(u)||u==="service_worker"?c.runIfWaitingForDebugger():u==="page"&&o&&a.Page.waitForDebugger({}),c}async retrieveBrowserTelemetry(e){try{let t=await e.Browser.getVersion({});if(!t)throw new Error("Undefined return from getVersion()");let n={targetCRDPVersion:t.protocolVersion,targetRevision:t.revision,targetUserAgent:t.userAgent,targetV8:t.jsVersion,targetVersion:"",targetProject:"",targetProduct:""};this.logger.verbose("runtime.target","Retrieved browser information",t);let i=(t.product||"").split("/");i.length===2?(n.targetProject=i[0],n.targetVersion=i[1]):n.targetProduct=t.product,this.telemetry.report("browserVersion",n)}catch(t){this.logger.warn("runtime.target","Error getting browser telemetry",t)}}async _detachedFromTarget(e,t=!0){let n=this._targets.get(e);if(n){this._targets.delete(e),n.parentTarget?._children.delete(e);try{await n._detached()}catch{}if(this._onTargetRemovedEmitter.fire(n),t&&(this._detachedTargets.add(n.targetId),await this._browser.Target.detachFromTarget({sessionId:e})),!this._targets.size&&this.launchParams.request==="launch")try{this.launchParams.cleanUp==="wholeBrowser"?await this._browser.Browser.close({}):(await this._browser.Target.closeTarget({targetId:n.id()}),this._connection.close())}catch{}}}async _targetInfoChanged(e,t){let n=[...this._targets.values()].filter(i=>i.targetId===e.targetId);if(!e.attached||!n.length)return n.length&&await Promise.all(n.map(i=>this._detachedFromTarget(i.sessionId,!1))),t(e);for(let i of n)i._updateFromInfo(e);for(let i of this._targets.values())i.targetId!==e.targetId&&i._onNameChangedEmitter.fire()}};var qk=_(H("child_process")),Gk=H("fs");var v6=50,gr=class r{constructor(e){this.messageEmitter=new C;this.endEmitter=new C;this.onMessage=this.messageEmitter.event;this.onEnd=this.endEmitter.event;this._ws=e,this._ws.addEventListener("message",t=>{this.messageEmitter.fire([t.data.toString("utf-8"),new Rr])}),this._ws.addEventListener("close",()=>{this.endEmitter.fire(),this._ws=void 0}),this._ws.addEventListener("error",()=>{})}static async create(e,t,n){let i=!e.startsWith("ws://"),o=await ga(e);for(;;){let s=Date.now()+v6;try{let a={headers:{host:n??"localhost"},perMessageDeflate:!1,maxPayload:268435456,rejectUnauthorized:!(i&&o),followRedirects:!0},c=new l$(e,[],a);return await Jn(new Promise((u,l)=>{c.addEventListener("open",()=>u(new r(c))),c.addEventListener("error",p=>{let d=e===c.url?e:c.url.replace(/^http(s?):/,"ws$1:");if(d===e){l(p.error);return}this.create(d,t,n).then(u,l)})}),ut.withTimeout(2e3,t).token,`Could not open ${e}`).catch(u=>{throw c.close(),u})}catch(a){if(t.isCancellationRequested)throw a;let c=s-Date.now();c>0&&await ue(c)}}}send(e){this._ws?.send(e)}dispose(){return new Promise(e=>{if(!this._ws)return e();this._ws.addEventListener("close",()=>e()),this._ws.close()})}};var Nm=_(H("path"));function I6(r){let e=[/^APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL$/i,/^ELECTRON_.+$/i,/^GOOGLE_API_KEY$/i,/^VSCODE_.+$/i,/^SNAP(|_.*)$/i,/^GDK_PIXBUF_.+$/i];return new yt(r).map((t,n)=>e.some(i=>i.test(t))?void 0:n)}var yt=class r{constructor(e){this.defined=ne(()=>Js(this.value));this.value=e?F_(e):{}}static{this.platform=process.platform}static{this.empty=new r({})}static{this.processEnv=ne(()=>I6(process.env))}lookup(e){return r.platform==="win32"?j_(this.value,e):this.value[e]}addToPath(e,t="append",n=!1){let i=r.platform==="win32"?"Path":"PATH",o=r.platform==="win32"?Nm.win32.delimiter:Nm.posix.delimiter,s=this.lookup(i);return n&&!s&&(s=`\${env:${i}}`),s?t==="append"?s=s+o+e:s=e+o+s:s=e,this.update(i,s)}addNodeOption(e){let t=this.lookup("NODE_OPTIONS");return this.update("NODE_OPTIONS",t?`${t} ${e}`:e)}update(e,t){return r.merge(this,{[e]:t})}merge(...e){return r.merge(this,...e)}map(e){return new r(ci(this.value,(t,n)=>e(n,t)))}static merge(...e){let t=e.map(i=>i instanceof r?i.value:i),n=r.platform==="win32"?W_(...t):Object.assign({},...t);return new r(n)}};var Dk=H("child_process");var tp=class r extends Error{constructor(t,n,i,o,s){super(`${t} exited with code ${o||-1}: ${n}`);this.command=t;this.stderr=n;this.stdout=i;this.code=o;this.innerError=s}static fromExeca(t){return new r(t.command,t.stderr.toString(),t.stdout.toString(),t.exitCode)}};function Bm(r,e,t){return new Promise((n,i)=>{let o=rp(r,e,t?.cwd),s=(0,Dk.spawn)(o.executable,o.args,{...t,cwd:o.cwd,shell:o.shell,stdio:"pipe"}),a=[],c=[];s.stderr.on("data",l=>a.push(l)),s.stdout.on("data",l=>c.push(l));let u=(l,p)=>i(new tp(r,Buffer.concat(a).toString(),Buffer.concat(c).toString(),l,p));s.on("error",l=>u(void 0,l)),s.on("close",l=>l?u(l):n({stdout:Buffer.concat(c).toString(),stderr:Buffer.concat(a).toString()}))})}var _6=/\.(bat|cmd)$/i,rp=(r,e,t)=>(process.platform==="win32"&&(r=on(r),t&&(t=on(t.toString())),r.endsWith(".ps1")&&(e=["-File",r,...e],r="powershell.exe")),process.platform!=="win32"||!_6.test(r)?{executable:r,args:e,shell:!1,cwd:t}:{executable:`"${r}"`,args:e.map(n=>n.includes(" ")?`"${n}"`:n),shell:!0,cwd:t});var Tk=r=>{let e={};for(let t of r){let n=t.indexOf("=");n===-1?e[t]=null:e[t.slice(0,n)]=t.slice(n+1)}return e},np=r=>{let e=[];for(let t of Object.keys(r)){let n=r[t];n!==void 0&&e.push(n===null?t:`${t}=${n}`)}return e},Fm=class r{constructor(e=[]){this.args=e;this.argMap=ne(()=>Tk(this.args))}add(e,t=null){return this.newThis(np({...this.argMap(),[e]:t}))}get(e){let t=this.argMap();return t.hasOwnProperty(e)?t[e]:void 0}remove(e){return this.newThis(np({...this.argMap(),[e]:void 0}))}merge(e){return this.newThis(np({...this.argMap(),...e instanceof r?e.argMap():Tk(e)}))}filter(e){let t=this.argMap(),n=[];for(let i of Object.keys(t)){let o=t[i];e(i,o)&&n.push(o===null?i:`${i}=${o}`)}return this.newThis(n)}toArray(){return this.args.slice()}newThis(e){return new this.constructor(e)}};var Mk="--remote-debugging-port",Rk="--remote-debugging-pipe",Ao=class r extends Fm{static{this.default=new r(["--disable-background-networking","--disable-background-timer-throttling","--disable-backgrounding-occluded-windows","--disable-breakpad","--disable-client-side-phishing-detection","--disable-default-apps","--disable-dev-shm-usage","--disable-renderer-backgrounding","--disable-sync","--metrics-recording-only","--no-first-run","--no-default-browser-check"])}setConnection(e){return new r(np({...this.argMap(),[Rk]:e==="pipe"?null:void 0,[Mk]:e!=="pipe"?String(e):void 0}))}getSuggestedConnection(){let e=this.argMap();if(e.hasOwnProperty(Rk))return"pipe";let t=e[Mk];if(t!==void 0)return t&&Number(t)||0}};var f_=H("url");function Um(r,e,t){let n=ko(s=>{if(s)return new f_.URL(s);throw new Error(`A valid url wasn't supplied: <${s}>`)}),i={"url.hostname":()=>n(e).hostname,"url.port":()=>n(e).port,browserInspectUri:()=>encodeURIComponent(t),browserInspectUriPath:()=>new f_.URL(t).pathname,wsProtocol:()=>n(e).protocol==="https:"?"wss":"ws"};return r.replace(/{([^\}]+)}/g,(s,a)=>i.hasOwnProperty(a)?i[a]():s)}var Uk=_(H("readline"));var kk=H("stream"),wo=class extends kk.Transform{constructor(t){super();this.prefix=[];this.splitSuffix=Buffer.alloc(0);if(typeof t=="string"&&t.length===1)this.splitter=t.charCodeAt(0);else if(typeof t=="number")this.splitter=t;else throw new Error("not implemented here")}_transform(t,n,i){let o=0;for(;o<t.length;){let s=t.indexOf(this.splitter,o);if(s===-1)break;let a=t.subarray(o,s),c=this.prefix.length||this.splitSuffix.length?Buffer.concat([...this.prefix,a,this.splitSuffix]):a;this.push(c),this.prefix.length=0,o=s+1}o<t.length&&this.prefix.push(t.subarray(o)),i()}_flush(t){this.prefix.length&&this.push(Buffer.concat([...this.prefix,this.splitSuffix])),t()}};var Vr=class{constructor(e,t,n){this.logger=e;this.pipeWrite=t;this.pipeRead=n;this.messageEmitter=new C;this.endEmitter=new C;this.onMessage=this.messageEmitter.event;this.onEnd=this.endEmitter.event;this.onceEnded=ne(()=>{this.streams&&(this.beforeClose(),this.streams.read.removeAllListeners(),this.pipeRead?.destroy(),this.streams.write.removeListener("end",this.onceEnded),this.streams.write.removeListener("error",this.onWriteError),this.streams.write.on("error",()=>{}),this.streams.write.end(),this.streams=void 0,this.endEmitter.fire())});this.onWriteError=e=>{this.logger.error("internal","pipeWrite error",{error:e})};let i=n||t;this.streams={read:i.on("error",o=>this.logger.error("internal","pipeRead error",{error:o})).pipe(new wo(0)).on("data",o=>this.messageEmitter.fire([o.toString(),new Rr])).on("end",this.onceEnded),write:t.on("end",this.onceEnded).on("error",this.onWriteError)}}send(e){this.streams?.write.write(e+"\0")}dispose(){this.onceEnded()}beforeClose(){}};var Wm=H("child_process"),h_=H("path");function un(r,e,t="forceful"){if(t==="none")return!0;if(process.platform==="win32"){let n=process.env.WINDIR||"C:\\Windows",i=(0,h_.join)(n,"System32","taskkill.exe");try{return(0,Wm.execSync)(`${i} ${t==="forceful"?"/F":""} /T /PID ${r}`,{stdio:"pipe"}),!0}catch(o){return e.error("runtime.exception","Error running taskkill.exe",o),!1}}else try{let n=(0,h_.join)(__dirname,"./targets/node/terminateProcess.sh"),i=(0,Wm.spawnSync)("sh",[n,r.toString(),t==="forceful"?"9":"15"]);return i.stderr&&i.status?(e.error("runtime.exception","Error running terminateProcess",i),!1):!0}catch(n){return e.error("runtime.exception","Error running terminateProcess",n),!1}}var Bk=H("fs");async function m_(r,e,t,n,i){let o=new go(Bk.promises),[s,a]=await Promise.all([Ok(o,new URL("/json/version",r),e,i),n?Ok(o,new URL("/json/list",r),e,i):Promise.resolve(void 0)]);if(!s.ok)t.verbose("runtime.launch","Error looking up /json/version",s);else if(s.body.webSocketDebuggerUrl){let c=Nk(s.url,s.body.webSocketDebuggerUrl);return t.verbose("runtime.launch","Discovered target URL from /json/version",{url:s.body.webSocketDebuggerUrl,fixed:c}),c}if(a)if(!a.ok)t.verbose("runtime.launch","Error looking up /json/list",a);else{let c=Nk(a.url,a.body[0].webSocketDebuggerUrl);return t.verbose("runtime.launch","Discovered target URL from /json/list",{url:a.body[0].webSocketDebuggerUrl,fixed:c}),c}throw new Error("Could not find any debuggable target")}async function Ok(r,e,t,n){if(e.hostname!=="localhost")return r.fetchJson(e.toString(),t,{host:n??"localhost"});e.hostname="127.0.0.1";let i=e.toString();e.hostname="[::1]";let o=e.toString(),s=new ut(t);try{let a;return await Qs([i,o].map(async u=>(a=await r.fetchJson(u,s.token),a.ok&&a)))||a}finally{s.cancel()}}var Fk=r=>async(e,t,n,i)=>{for(;;)try{return await m_(e,t,n,r,i)}catch(o){if(t.isCancellationRequested)throw new Error(`Could not connect to debug target at ${e}: ${o.message}`);await ue(200)}},kc=Fk(!0),jm=Fk(!1);function Nk(r,e){let t=new URL(r),n=new URL(e);return n.host=t.host,n.toString()}var Wk=async(r,e,t,n)=>{let i=t.connection===0?await w6(e,n):await jm(`http://localhost:${t.connection}`,n,r),o=t.inspectUri?Um(t.inspectUri,t.url,i):i;for(;;)try{return await gr.create(o,n)}catch(s){if(n.isCancellationRequested)throw s;await ue(200)}},Vm=class{constructor(e){this.logger=e;this.pid=void 0;this.onExit=new C().event;this.onError=new C().event}async transport(e,t){return Wk(this.logger,this,e,t)}kill(){}},qm=class{constructor(e,t){this.cp=e;this.logger=t;this.pid=void 0;this.exitEmitter=new C;this.onExit=this.exitEmitter.event;this.errorEmitter=new C;this.onError=this.errorEmitter.event;e.on("exit",n=>this.exitEmitter.fire(n||0)),e.on("error",n=>this.errorEmitter.fire(n))}get stderr(){return this.cp.stderr}get stdio(){return this.cp.stdio}async transport(e,t){return e.connection==="pipe"?new Vr(this.logger,this.cp.stdio[3],this.cp.stdio[4]):Wk(this.logger,this,e,t)}kill(){un(this.cp.pid,this.logger)}};function w6(r,e){if(!r.stderr)throw new Error("Cannot wait for a websocket for a target that lacks stderr");return new Promise((t,n)=>{let i=Uk.createInterface({input:r.stderr}),o="",s=()=>u();i.on("line",l),i.on("close",s);let a=new Ae([r.onExit(()=>u()),r.onError(u)]),c=e.onCancellationRequested(()=>{p(),n(new zn(`Timed out after ${c} ms while trying to connect to the browser!`))});function u(d){p(),n(new Error(["Failed to launch browser!"+(d?" "+d.message:""),o,"","TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md",""].join(`
`)))}function l(d){o+=d+`
`;let f=d.match(/^DevTools listening on (ws:\/\/.*)$/);f&&(p(),t(f[1]))}function p(){c.dispose(),i.removeListener("line",l),i.removeListener("close",s),a.dispose()}})}async function jk(r,e,t,n){let i=r.launchUnelevatedRequest({process:e,args:t});await Jn(i,n,"Could not launch browser unelevated")}var Vk=()=>{};async function Kk(r,e,t,n,i,o,s={}){let{onStderr:a=Vk,onStdout:c=Vk,args:u=[],dumpio:l=!1,cwd:p=process.cwd(),env:d=yt.empty,connection:f="pipe",cleanUp:h="wholeBrowser",url:m,inspectUri:y}=s,w=new Ao(u),D=w.getSuggestedConnection();s.includeLaunchArgs!==!1?(w=H_(w,s),D===void 0&&(w=w.setConnection(f),D=f)):D===void 0&&(D="pipe");let j=["pipe","pipe","pipe"];D==="pipe"&&(l?j=["ignore","pipe","pipe","pipe","pipe"]:j=["ignore","ignore","ignore","pipe","pipe"]);let X;if(!!(i.supportsLaunchUnelevatedProcessRequest&&s.launchUnelevated)&&typeof D=="number"&&D!==0)await jk(r,e,w.toArray(),o),X=new Vm(t);else{t.info("runtime.launch",`Launching Chrome from ${e}`);let O=rp(e,w.toArray(),await oa(Gk.promises,p)?p:process.cwd()),G=qk.spawn(O.executable,O.args,{detached:!0,env:d.defined(),shell:O.shell,cwd:O.cwd,stdio:j});if(G.pid===void 0)throw await Promise.race([ue(1e3).then(()=>new Error("Unable to launch the executable (undefined pid)")),new Promise(re=>G.once("error",re))]);X=new qm(G,t)}l?(X.stderr?.on("data",O=>a(O.toString())),X.stdout?.on("data",O=>c(O.toString()))):(X.stderr?.resume(),X.stdout?.resume());let Z=()=>{h==="wholeBrowser"&&X.kill()};process.on("exit",Z),X.onExit(()=>process.removeListener("exit",Z));try{if(s.promisedPort){let O;D=await Promise.race([s.promisedPort,new Promise((G,re)=>{O=X.onExit(xe=>{re(new T(Ax(xe)))})})]).finally(()=>O.dispose())}return{process:X,canReconnect:typeof D=="number",createConnection:async O=>{let G=await X.transport({connection:D,inspectUri:y||void 0,url:m||void 0},O);return new it(G,t,n)}}}catch(O){throw X.kill(),O}}function H_(r,e={}){let{userDataDir:t=null,ignoreDefaultArgs:n=!1}=e,i=n===!0?new Ao:Ao.default;return n instanceof Array&&(i=i.filter(o=>!n.includes(o))),t&&(i=i.add("--user-data-dir",t)),i=i.merge(r),r.toArray().every(o=>o.startsWith("-"))&&e.hasUserNavigation&&(i=i.add("about:blank")),i}async function Xk(r,e,t,n){let{browserWSEndpoint:i,browserURL:o}=r;if(i){let s=await gr.create(i,e);return new it(s,t,n)}else if(o){let s=await jm(o,e,t),a=r.inspectUri?Um(r.inspectUri,r.pageURL,s):s,c=await gr.create(a,e);return new it(c,t,n)}throw new Error("Either browserURL or browserWSEndpoint needs to be specified")}var qr=class{constructor(e,t,n){this.logger=e;this.pathResolver=t;this.vscode=n;this._disposables=[];this._onTerminatedEmitter=new C;this.onTerminated=this._onTerminatedEmitter.event;this._onTargetListChangedEmitter=new C;this.onTargetListChanged=this._onTargetListChangedEmitter.event}dispose(){for(let e of this._disposables)e.dispose();this._disposables=[],this._attemptTimer&&clearTimeout(this._attemptTimer),this._targetManager&&this._targetManager.dispose()}resolveParams(e){return e.request==="attach"&&(e.type==="pwa-chrome"||e.type==="pwa-msedge"&&typeof e.useWebView!="object")&&e.browserAttachLocation==="workspace"}async launch(e,t){return this.resolveParams(e)?(this._lastLaunchParams={...e,timeout:1/0},await this.attemptToAttach(this._lastLaunchParams,t),{blockSessionTermination:!0}):{blockSessionTermination:!1}}_scheduleAttach(e,t){this._attemptTimer=setTimeout(()=>{this._attemptTimer=void 0,this.attemptToAttach(e,{...t,cancellationToken:Vt})},1e3)}createTargetManager(e,t,n){return _o.connect(e,void 0,this.pathResolver,t,this.logger,n.telemetryReporter,n.targetOrigin)}async attemptToAttach(e,t){let n=await this.acquireConnectionForBrowser(t,e);this._connection=n,n.onDisconnected(()=>{this._connection=void 0,this._targetManager&&(this._targetManager.dispose(),this._targetManager=void 0,this._onTargetListChangedEmitter.fire()),this._lastLaunchParams===e&&e.restart?this._scheduleAttach(e,t):this._onTerminatedEmitter.fire({killed:!0,code:0})},void 0,this._disposables);let i=this._targetManager=await this.createTargetManager(n,e,t);if(!i)return;i.serviceWorkerModel.onDidChange(()=>this._onTargetListChangedEmitter.fire()),i.frameModel.onFrameNavigated(()=>this._onTargetListChangedEmitter.fire()),i.onTargetAdded(()=>{this._onTargetListChangedEmitter.fire()}),i.onTargetRemoved(()=>{this._onTargetListChangedEmitter.fire(),i.targetList().length||(this._onTerminatedEmitter.fire({killed:!0,code:0}),this._connection?.close())});let o=await Promise.race([i.waitForMainTarget(await this.getTargetFilter(i,e)),ue(e.timeout).then(()=>{throw new T(Yd())})]);return typeof o=="string"?o:void 0}async getTargetFilter(e,t){let n=qi(t),i=ba(n);if(t.targetSelection!=="pick")return i;let o=await e.getCandiateInfo(i);if(o.length===0)return i;if(o.length===1||!this.vscode)return c=>c.targetId===o[0].targetId;let s=Gm.t("Select a tab"),a=await this.vscode.window.showQuickPick(o.map(c=>({label:c.title,detail:c.url,targetId:c.targetId})),{matchOnDescription:!0,matchOnDetail:!0,placeHolder:s});return a?c=>c.targetId===a.targetId:i}async acquireConnectionForBrowser({telemetryReporter:e,cancellationToken:t},n){for(;this._lastLaunchParams===n;)try{return await this.acquireConnectionInner(e,n,t)}catch(i){if(t.isCancellationRequested)throw new T(qu(Gm.t("Cannot connect to the target at {0}: {1}",`${n.address}:${n.port}`,i.message)));await ue(1e3)}throw new T(qu(Gm.t("Cannot connect to the target at {0}: {1}",`${n.address}:${n.port}`,"Cancelled")))}async acquireConnectionInner(e,t,n){let i=`http://${t.address}:${t.port}`;return await Xk({browserURL:i,inspectUri:t.inspectUri,pageURL:t.url},n,this.logger,e)}async terminate(){this._lastLaunchParams=void 0,this._connection?.close()}async restart(){if(this._targetManager)for(let e of this._targetManager.targetList())e.type()==="page"&&!e.name().startsWith("devtools://")&&e.restart()}targetList(){let e=this._targetManager;return e?e.targetList():[]}};qr=E([(0,So.injectable)(),g(0,(0,So.inject)(U)),g(1,(0,So.inject)(Se)),g(2,(0,So.optional)()),g(2,(0,So.inject)(Fn))],qr);var ln=_(q());var Jk=_(Av()),Yk=_(je()),ip=_(H("fs")),Eo=_(q()),Oc=_(H("path"));var ri=class{constructor(e,t,n,i,o){this.storagePath=e;this.logger=t;this.pathResolver=n;this.initializeParams=i;this.fs=o;this._disposables=new Ae;this._onTerminatedEmitter=new C;this.onTerminated=this._onTerminatedEmitter.event;this._onTargetListChangedEmitter=new C;this.onTargetListChanged=this._onTargetListChangedEmitter.event;this._terminatedCts=new ut}dispose(){this._disposables.dispose()}async launchBrowser({runtimeExecutable:e,trace:t,includeDefaultArgs:n,includeLaunchArgs:i,runtimeArgs:o,userDataDir:s,env:a,cwd:c,port:u,url:l,file:p,inspectUri:d,webRoot:f,cleanUp:h,launchUnelevated:m},y,w,D,j){let X=await this.findBrowserPath(e||"stable"),B;return typeof s=="string"?B=Oc.resolve(s):s&&(B=Oc.resolve(Oc.join(this.storagePath,o?.includes("--headless")?".headless-profile":".profile"))),ip.mkdirSync(this.storagePath,{recursive:!0}),B&&(ip.mkdirSync(B,{recursive:!0}),B=ip.realpathSync(B)),await Kk(y,X,this.logger,D,this.initializeParams,w,{onStdout:Z=>y.output({category:"stdout",output:Z}),onStderr:Z=>y.output({category:"stderr",output:Z}),dumpio:typeof t=="boolean"?t:t.stdio,cleanUp:h,hasUserNavigation:!!(l||p),cwd:c||f||void 0,env:yt.merge(yt.processEnv(),a),args:o||[],userDataDir:B,connection:u||(d?0:"pipe"),launchUnelevated:m,ignoreDefaultArgs:!n,includeLaunchArgs:i,url:l,inspectUri:d,promisedPort:j})}getFilterForTarget(e){return ba(qi(e,["about:blank"]))}async doLaunch(e,t){let n;try{n=await this.launchBrowser(e,t.dap,t.cancellationToken,t.telemetryReporter)}catch(u){throw new T(_y(u))}let i=new ut(this._terminatedCts.token);n.process.onExit(()=>this.fireTerminatedEvent());let o=()=>n.canReconnect&&!i.token.isCancellationRequested,s=async u=>{if(this._targetManager?.dispose(),this._targetManager=void 0,this._onTargetListChangedEmitter.fire(),o()&&(await ue(1e3),o())){t.dap.output({category:"stderr",output:Yk.t("Browser connection failed, will retry: {0}",u?.message||"Connection closed")});try{return await ue(2e3),await a()}catch{}}n.process.kill(),this.fireTerminatedEvent()},a=async()=>{if(!i.token.isCancellationRequested)try{let u=await n.createConnection(i.token),l=await this.launchCdp(e,n,u,{...t,cancellationToken:i.token});await this.finishLaunch(l,e),u.onDisconnected(()=>s())}catch(u){if(o())return s(u);throw n.process.kill(),new T(_y(u))}},c=t.cancellationToken.onCancellationRequested(()=>i.cancel());try{await a()}finally{c.dispose()}}async launchCdp(e,t,n,i){if(this._connectionForTest=n,this._targetManager=await _o.connect(n,t.process,this.pathResolver,e,this.logger,i.telemetryReporter,i.targetOrigin),!this._targetManager)throw new T(qu());this._targetManager.serviceWorkerModel.onDidChange(()=>this._onTargetListChangedEmitter.fire()),this._targetManager.frameModel.onFrameNavigated(()=>this._onTargetListChangedEmitter.fire()),this._disposables.push(this._targetManager),this._targetManager.onTargetAdded(()=>{this._onTargetListChangedEmitter.fire()}),this._targetManager.onTargetRemoved(()=>{this._onTargetListChangedEmitter.fire()});let o=this.getFilterForTarget(e),s=await Jn(this._targetManager.waitForMainTarget(o),i.cancellationToken,"Could not attach to main target");if(!s)throw new T(Yd());return s}async finishLaunch(e,t){if("skipNavigateForTest"in t)return;let n;if(t.file){let i=Oc.resolve(t.webRoot||t.rootPath||"",t.file),o=Math.min(i.includes("#")?i.indexOf("#"):1/0,i.includes("?")?i.indexOf("?"):1/0);isFinite(o)&&!await Ni(this.fs,i)?n=He(i.slice(0,o))+i.slice(o):n=He(i)}else n=t.url;n&&await e.cdp().Page.navigate({url:n})}async launch(e,t){let n=this.resolveParams(e);return n?(await this.doLaunch(n,t),{blockSessionTermination:!0}):{blockSessionTermination:!1}}async terminate(){this._targetManager?await this._targetManager.closeBrowser():this.fireTerminatedEvent()}async restart(){for(let e of this.targetList())e.type()==="page"&&e.restart()}async findBrowserByExe(e,t){return t==="*"?(await e.findWhere(i=>i.quality==="stable")||(await e.findAll())[0])?.path:(0,Jk.isQuality)(t)?(await e.findWhere(n=>n.quality===t))?.path:t}targetList(){let e=this._targetManager;return e?e.targetList():[]}connectionForTest(){return this._connectionForTest}fireTerminatedEvent(){this._terminatedCts.token.isCancellationRequested||(this._terminatedCts.cancel(),this._onTerminatedEmitter.fire({code:0,killed:!0}))}};ri=E([(0,Eo.injectable)(),g(0,(0,Eo.inject)(Bn)),g(1,(0,Eo.inject)(U)),g(2,(0,Eo.inject)(Se)),g(3,(0,Eo.inject)(Ct)),g(4,(0,Eo.inject)($e))],ri);var ks=class extends ri{constructor(t,n,i,o,s,a){super(t,n,s,a,o);this.browserFinder=i}resolveParams(t){return t.type==="pwa-chrome"&&t.request==="launch"&&t.browserLaunchLocation==="workspace"?t:void 0}async findBrowserPath(t){let n=await this.findBrowserByExe(this.browserFinder,t);if(!n||!await oa(this.fs,n))throw new T(Jd("Chrome",t,(await this.browserFinder.findAll()).map(i=>i.quality)));return n}};ks=E([(0,ln.injectable)(),g(0,(0,ln.inject)(Bn)),g(1,(0,ln.inject)(U)),g(2,(0,ln.inject)(Zo)),g(2,(0,ln.tagged)("browser","chrome")),g(3,(0,ln.inject)($e)),g(4,(0,ln.inject)(Se)),g(5,(0,ln.inject)(Ct))],ks);var Qk=H("crypto"),pn=_(q()),Zk=H("net"),e1=H("os"),t1=H("path");var S6=["--do-not-de-elevate"],Nc=class extends ri{constructor(t,n,i,o,s,a){super(t,n,s,a,o);this.browserFinder=i}resolveParams(t){return t.type==="pwa-msedge"&&t.request==="launch"&&t.browserLaunchLocation==="workspace"?t:void 0}launchBrowser(t,n,i,o){return super.launchBrowser({...t,runtimeArgs:t.runtimeArgs??S6},n,i,o,t.useWebView?this.getWebviewPort(t,o):void 0)}getFilterForTarget(t){return t.useWebView&&t.urlFilter?ba(qi(t)):super.getFilterForTarget(t)}async getWebviewPort(t,n){let i=ge();if(!t.runtimeExecutable)return i.resolve(t.port),i.promise;let o=t.runtimeExecutable.split(/\\|\//).pop(),s=`VSCode_${(0,Qk.randomBytes)(12).toString("base64")}`,a=`\\\\.\\pipe\\WebView2\\Debugger\\${o}\\${s}`,c=(0,Zk.createServer)(u=>{u.on("data",async l=>{let p=JSON.parse(l.toString()),d=p.devtoolsActivePort||"",f=parseInt(d.split(`
`).shift()||""),h=t.port||f;i.resolve(h);let m=`ws://${t.address}:${h}/devtools/${p.type}/${p.id}`,y=await gr.create(m,Vt),w=new it(y,this.logger,n);await w.rootSession().Runtime.runIfWaitingForDebugger({}),w.close()})});return c.on("error",i.reject),c.on("close",()=>i.resolve(t.port)),c.listen(a),t.userDataDir=t.userDataDir||(0,t1.join)((0,e1.tmpdir)(),`vscode-js-debug-userdatadir_${t.port}`),t.env=t.env||{},t.env.WEBVIEW2_USER_DATA_FOLDER=t.userDataDir.toString(),t.env.WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=`--remote-debugging-port=${t.port}`,t.env.WEBVIEW2_WAIT_FOR_SCRIPT_DEBUGGER="true",t.env.WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER=s,i.promise}async findBrowserPath(t){let n=await this.findBrowserByExe(this.browserFinder,t);if(!n||!await oa(this.fs,n))throw new T(Jd("Edge",t,(await this.browserFinder.findAll()).map(i=>i.quality)));return n}};Nc=E([(0,pn.injectable)(),g(0,(0,pn.inject)(Bn)),g(1,(0,pn.inject)(U)),g(2,(0,pn.inject)(Zo)),g(2,(0,pn.tagged)("browser","edge")),g(3,(0,pn.inject)($e)),g(4,(0,pn.inject)(Se)),g(5,(0,pn.inject)(Ct))],Nc);var $i=_(q());var r1=H("crypto"),Km=_(q());var E6=0,ni=class{constructor(e){this.portLeaseTracker=e;this.teardown=new WeakMap}async launch(e,t,n){this.server&&this.server.close();let i=`/${(0,r1.randomBytes)(20).toString("hex")}`,o=this.server=await Vf(this.portLeaseTracker,{perMessageDeflate:!0,host:"127.0.0.1",path:i}),s=++E6;e.launchBrowserInCompanion({...n,serverPort:o.address().port,path:i,launchId:s});let a=await Jn(new Promise((u,l)=>{o.once("connection",u),o.once("error",l)}),t,"Timed out waiting for browser connection"),c=new gr(a);return this.teardown.set(c,()=>e.killCompanionBrowser({launchId:s})),c}close(e){this.teardown.get(e)?.()}dispose(){this.server?.close(),this.server=void 0}};ni=E([(0,Km.injectable)(),g(0,(0,Km.inject)(Mr))],ni);var Bc=class extends qr{constructor(t,n,i,o){super(n,i,o);this.helper=t}resolveParams(t){return t.request==="attach"&&(t.type==="pwa-chrome"||t.type==="pwa-msedge")&&t.browserAttachLocation==="ui"}async acquireConnectionForBrowser(t,n){let i=await this.helper.launch(t.dap,t.cancellationToken,{type:n.type==="pwa-chrome"?"chrome":"edge",params:n,attach:{host:n.address,port:n.port}});return new it(i,this.logger,t.telemetryReporter)}};Bc=E([(0,$i.injectable)(),g(0,(0,$i.inject)(ni)),g(1,(0,$i.inject)(U)),g(2,(0,$i.inject)(Se)),g(3,(0,$i.optional)()),g(3,(0,$i.inject)(Fn))],Bc);var Ci=_(q());var Fc=class extends ri{constructor(t,n,i,o,s,a){super(t,n,i,o,s);this.helper=a}resolveParams(t){return(t.type==="pwa-chrome"||t.type==="pwa-msedge")&&t.request==="launch"&&t.browserLaunchLocation==="ui"?t:void 0}async launchBrowser(t,n,i,o){let s=await this.helper.launch(n,i,{type:t.type==="pwa-chrome"?"chrome":"edge",browserArgs:H_(new Ao(t.runtimeArgs||[]),{hasUserNavigation:!!t.url,ignoreDefaultArgs:!t.includeDefaultArgs}).setConnection(t.port||"pipe").toArray(),params:t});return{canReconnect:!1,createConnection:()=>Promise.resolve(new it(s,this.logger,o)),process:{onExit:new C().event,onError:new C().event,transport:()=>Promise.resolve(s),kill:()=>this.helper.close(s)}}}async findBrowserPath(){throw new Error("not implemented")}};Fc=E([(0,Ci.injectable)(),g(0,(0,Ci.inject)(Bn)),g(1,(0,Ci.inject)(U)),g(2,(0,Ci.inject)(Se)),g(3,(0,Ci.inject)(Ct)),g(4,(0,Ci.inject)($e)),g(5,(0,Ci.inject)(ni))],Fc);var xo=_(q()),u1=H("net");var Uc=class extends qr{constructor(e,t,n){super(e,t,n)}resolveParams(e){return e.request==="attach"&&e.type==="pwa-msedge"&&typeof e.useWebView=="object"}async acquireConnectionForBrowser(e,t){let{getAppContainerProcessTokens:n}=await Promise.resolve().then(()=>_(c1())),i=n(t.useWebView.pipeName);if(!i)throw new T(yx());let o=i.map(c=>(0,u1.connect)(c)),s;try{s=await Jn(Qs(o.map(c=>new Promise(u=>c.on("error",()=>u(void 0)).on("connect",()=>u(c))))),e.cancellationToken)}finally{for(let c of o)c!==s&&c.destroy()}if(!s)throw new T(vx());let a=new Vr(this.logger,s);return new it(a,this.logger,e.telemetryReporter)}};Uc=E([(0,xo.injectable)(),g(0,(0,xo.inject)(U)),g(1,(0,xo.inject)(Se)),g(2,(0,xo.optional)()),g(2,(0,xo.inject)(Fn))],Uc);var qc=_(q()),_1=H("net");var yr=_(q());var g_=Symbol("ILinkedBreakpointLocation");var H1=_(H("path"));var sp=_(q()),$o=_(H("path")),m1=H("url");var l1=H("fs"),Di=_(H("path"));function zm(r,e){return r?(r.endsWith("/")||(r+="/"),r+e):e}async function Jm(r,e,t,n,i){e=We(e)||e;let o;if(r){if(Er(r))o=We(r);else if($t(r))o=await n(r,t,i)||r;else if(Di.isAbsolute(e))o=T6(e,r);else{let s=py(e)||"/",a=await n(s,t,i),c=Di.dirname(a);o=Bi(c,r)}i.verbose("sourcemap.parsing","resolved sourceRoot",{sourceRoot:r,absSourceRoot:o})}else if(Di.isAbsolute(e))o=Di.dirname(e),i.verbose("sourcemap.parsing","no sourceRoot specified, using script dirname",{absSourceRoot:o});else{let s=py(e)||"/placeholder.js",a=await n(s,t,i);o=a?Di.dirname(a):"",i.verbose("sourcemap.parsing","no sourceRoot specified, using webRoot + script path dirname",{absSourceRoot:o})}return o=F0(o),o=Xe(o),o}var op=async(r,e,t)=>{if(!r||!r.startsWith("/"))return"";let n=Object.keys(e).sort((i,o)=>o.length-i.length);for(let i of n){if(!i)continue;let o=e[i];if(i[0]!=="/"&&(t.verbose("sourcemap.parsing",`Keys should be absolute: ${i}`),i="/"+i),C6(i,r))return D6(i,o,r)}return""},p1=(r,e)=>async(t,n,i)=>{if(process.platform==="win32"&&/^[a-z]:/i.test(t))return t;let o=await Ud(r,Di.dirname(e),"package.json");if(!o)return op(t,n,i);let s=await op(t,U_(n,a=>a.length>=o.length),i);return process.platform!=="win32"&&t!=="/"&&!s&&(await l1.promises.stat(t).catch(()=>{}))?.isDirectory()?t:s||o};function C6(r,e){return r===e?!0:(r.endsWith("/")||(r+="/"),e.startsWith(r))}function D6(r,e,t){let n=decodeURIComponent(t.substring(r.length));return n?Bi(e,n):e}function T6(r,e){return ir(Di.dirname(r),e)}var h1=_(tl()),Po=_(H("path"));var Zm="*",d1=new RegExp(Ut(Zm),"g"),Ym="?:"+Zm,M6=new RegExp(Ut(Ym),"g"),y_=(r,e)=>{let t=e.match(r);return r.lastIndex=0,t?t.length:0},f1=new RegExp(`${Ut(Ym)}|${Ut(Zm)}`,"g"),Qm=class{constructor(e,t){this.logger=t;this.replacers=[];let n=Object.keys(e).sort((i,o)=>o.replace(Ym,"*").length-i.replace(Ym,"*").length);for(let i of n){let o=e[i];if(!o.includes("*")&&/\$[0-9'`&]/.test(o)){this.replacers.push([new RegExp(`^${i}$`,"i"),o]);continue}let s=Oe(i),a=`"${s}": "${o}"`,c=y_(d1,s)-y_(M6,s);if(c>1){t.warn("runtime.sourcemap",`Warning: only one asterisk allowed in a sourceMapPathOverrides entry - ${a}`);continue}if(y_(d1,o)>c){t.warn("runtime.sourcemap",`The right side of a sourceMapPathOverrides entry must have 0 or 1 asterisks - ${a}}`);continue}let u="^",l=0;for(f1.lastIndex=0;;){let p=f1.exec(s);if(u+=Ut(s.slice(l,p?.index),"/"),!p)break;p[0]===Zm?u+="(.*?)":u+=".*?",l=p.index+p[0].length}c===0&&(u+="([\\/\\\\].*)?",o+="*"),this.replacers.push([new RegExp(u+"$","i"),o.replace(/\$/g,"$$$$").replace(/\*/,"$1")])}}apply(e){let t=Oe(e);for(let[n,i]of this.replacers){let o=t.replace(n,i);if(o!==t)return this.logger.verbose("runtime.sourcemap",`SourceMap: mapping ${e} => ${o}, via sourceMapPathOverrides entry - ${n.toString()}`),Bi(o)}return e}};var R6=/\x00/,Wc=class{constructor(e,t){this.options=e;this.logger=t;this.sourceMapOverrides=new Qm(this.options.sourceMapOverrides,this.logger);this.resolvePatterns=this.options.resolveSourceMapLocations?.map(e=>{let t=e.startsWith("!")?"!":"",n=e.slice(t.length).replace(/(?<!\.)\.[^./\\]+$/,".*");if(!$t(n))return Oe(e);n=Oe(ir(n));let i=Mg(this.options.workspaceFolder),o=Mg(n),s=0;for(let a=0;a<i.length&&a<o.length&&o[a].toLowerCase()===i[a].toLowerCase();a++)s+=i[a].length+1;return n=n.slice(0,s).replace(/[\[\]\(\)\{\}\!\*]/g,"\\$&")+n.slice(s),t+n})}shouldResolveSourceMap({sourceMapUrl:e,compiledPath:t}){if(t.startsWith(en))return!1;if(!this.resolvePatterns||this.resolvePatterns.length===0)return!0;let n=We(e)||At(e)&&t||e;if(n.startsWith("webpack-internal:///"))return!0;let i=fd(e)?!1:uy(),o=this.rebaseRemoteToLocal(n);return(0,h1.default)((o!==n?[n,o]:[n]).map(Oe),this.resolvePatterns,{dot:!0,nocase:!i}).length>0}rebaseRemoteToLocal(e){if(!this.options.remoteRoot||!this.options.localRoot||!this.canMapPath(e))return Po.isAbsolute(e)?Po.resolve(e):e;let t=Su(this.options.remoteRoot,e);if(t.startsWith(".."))return"";let n=Bi(this.options.localRoot,t);return n=Rg(n),this.logger.verbose("runtime.sourcemap",`Mapped remoteToLocal: ${e} -> ${n}`),ir(n)}rebaseLocalToRemote(e){if(!this.options.remoteRoot||!this.options.localRoot||!this.canMapPath(e))return e;let t=Su(this.options.localRoot,e),n=Bi(this.options.remoteRoot,t);return n=Xe(n,!0),this.logger.verbose("runtime.sourcemap",`Mapped localToRemote: ${e} -> ${n}`),n}normalizeSourceMapUrl(e){e=e.replace(R6,"");let t=e.lastIndexOf("?");return t!==-1&&e.slice(t-4,t)!==".vue"&&(e=e.slice(0,t)),e}canMapPath(e){return Po.posix.isAbsolute(e)||Po.win32.isAbsolute(e)||Er(e)}};var b_="https?:\\/\\/[^\\/]+\\/",Lo=class extends Wc{constructor(t,n,i,o){super(i,o);this.vueMapper=t;this.fsUtils=n}absolutePathToUrlPath(t){t=$o.normalize(t);let{baseUrl:n,pathMapping:i}=this.options,o=["/",i["/"]],s=Object.entries(i).sort(([u,l],[p,d])=>d.length-l.length||p.length-u.length).find(([,u])=>HE(u,t))||o;if(!s)return{url:He(t),needsWildcard:!1};if(n&&Er(n))return{url:ya(t),needsWildcard:!1};let a=Vi($o.relative(s[1],t)),c=s[0].replace(/\/$|^\//g,"");return c&&(a=c+"/"+a),!n&&!jd(a)?{url:a,needsWildcard:!0}:{url:Wd(n,a),needsWildcard:!1}}async urlToAbsolutePath({url:t,map:n}){let i=t.indexOf("?");return i!==-1&&t.slice(i-4,i)!==".vue"&&(t=t.slice(0,i)),n?this.sourceMapSourceToAbsolute(t,n):this.simpleUrlToAbsolute(t)}async simpleUrlToAbsolute(t){if(!t)return;if(t=this.sourceMapOverrides.apply(t),Er(t)){let s=We(t);if(await this.fsUtils.exists(s))return s;let a=U0(t);return await this.fsUtils.exists(a)?a:s}let n;try{let s=new m1.URL(t);if(!s.pathname||s.pathname==="/"?n="index.html":n=s.pathname,s.protocol==="webpack-internal:")return}catch{n=t}let i=$o.extname(n),o=n.replace(/^\//,"").split(/[\/\\]/);for(;o.length>0;){let s="/"+o.join("/"),a=await op(s,this.options.pathMapping,this.logger);if(a){if(!i&&await this.fsUtils.exists(a+".html"))return a+".html";if(await this.fsUtils.exists(a))return a}o.shift()}}async sourceMapSourceToAbsolute(t,n){if(!this.shouldResolveSourceMap(n.metadata))return;switch(this.vueMapper.getVueHandling(t)){case 2:return;case 1:let a=await this.vueMapper.lookup(t);if(a)return Xe(a);break;default:}t=this.normalizeSourceMapUrl(t);let{pathMapping:i}=this.options,o=zm(n.sourceRoot,t),s=this.sourceMapOverrides.apply(o);if(s!==o){s=Xe(s);let a=ir(i["/"],"..","ClientApp",Su(i["/"],s));return this.options.clientID==="visualstudio"&&o.startsWith("webpack:///")&&!await this.fsUtils.exists(s)&&await this.fsUtils.exists(a)?a:s}return Er(t)?We(t):$o.isAbsolute(t)?Xe(t):ir(await Jm(n.sourceRoot,n.metadata.compiledPath,i,op,this.logger),t)}absolutePathToUrlRegexp(t){let n=this.absolutePathToUrlPath(t),i=n.url,o=i.length;i.endsWith("index.html")?(o=i.length-10-1,i=i.slice(0,o)+"\\/?($|index(\\.html)?)"):i.endsWith(".html")&&(o=i.length-5,i=i.slice(0,o)+"(\\.html)?");let s=0;n.needsWildcard&&(i=b_+i,s=b_.length,o+=b_.length);let a=Sr(i,[s,o]);return n.needsWildcard?`${Sr(He(t))}|${a}`:a}};Lo=E([(0,sp.injectable)(),g(0,(0,sp.inject)(Pc)),g(1,(0,sp.inject)(Jt))],Lo);var eH=class extends Lo{constructor(t,n,i,o){super(t,n,i,o);this.blazorInCodespacesRegexpSubstitution="$1:\\$2";if(this.options.remoteFilePrefix){let s=`\\${H1.default.sep}`,a=this.options.remoteFilePrefix.replace(new RegExp(s,"g"),s);this.blazorInCodespacesRegexp=new RegExp(`^${a}${s}([A-z])\\$${s}(.*)$`)}else this.blazorInCodespacesRegexp=new RegExp("")}absolutePathToUrlRegexp(t){if(this.options.remoteFilePrefix){let n=t.replace(this.blazorInCodespacesRegexp,this.blazorInCodespacesRegexpSubstitution),o=Vi(n).replace(/^(\w):(.*)$/,"$1$2"),s=Sr(o);if(s){let a=`dotnet://.*\\.dll/${s}`;return this.logger.verbose("runtime.breakpoints","absolutePathToUrlRegexp.blazor.remoteFs",{absolutePath:t,dotnetUrlRegexp:a}),a}}else{let n=He(t),i=Sr(n),o=super.absolutePathToUrlRegexp(t);return i.includes(o)?i:`${i}|${o}`}return super.absolutePathToUrlRegexp(t)}};var g1=H("url");function y1(r){if("file"in r&&r.file)return ya(r.file);if(r.url)try{let e=new g1.URL(r.url);return e.pathname="/",e.search="",e.hash="",e.protocol==="data:"?void 0:e.href}catch{}}var Os=_(H("path")),v1=H("url");var b1="node:",Ti=class r extends Wc{constructor(t,n,i,o){super(i,o);this.fsUtils=t;this.linkedBp=n;this.options=i;this.logger=o}static shouldWarnAboutSymlinks(t){return"runtimeArgs"in t&&!t.runtimeArgs?.includes("--preserve-symlinks")}static getOptions(t){return{workspaceFolder:t.__workspaceFolder,resolveSourceMapLocations:t.resolveSourceMapLocations,basePath:t.cwd,sourceMapOverrides:t.sourceMapPathOverrides,remoteRoot:t.remoteRoot,localRoot:t.localRoot}}derive(t){return new r(this.fsUtils,this.linkedBp,{...this.options,...t},this.logger)}get resolutionOptions(){return this.options}async urlToAbsolutePath({url:t,map:n}){if(t=this.normalizeSourceMapUrl(t),t.startsWith(b1)&&this.options.basePath)return t=Os.join(this.options.basePath,"lib",t.slice(b1.length)),t.endsWith(".js")||(t+=".js"),t;if(n)return this.sourceMapSourceToAbsolute(t,n);let i=We(t);if(i)return this.rebaseRemoteToLocal(i);if(jd(t)){let s=this.sourceMapOverrides.apply(t);t=s===t?new v1.URL(t).pathname.slice(1):s}else if(Os.isAbsolute(t))t=this.sourceMapOverrides.apply(t);else return`${di}/${t}`;let o=ir(this.options.basePath??"",t);return this.rebaseRemoteToLocal(o)}absolutePathToUrl(t){return He(this.rebaseLocalToRemote(Os.normalize(t)))}async absolutePathToUrlRegexp(t){let n=t;try{n=await this.fsUtils.realPath(t)}catch{}return Fd(n,t)?Sr(this.absolutePathToUrl(t)):(this.linkedBp?.warn(),Sr(this.absolutePathToUrl(t))+"|"+Sr(this.absolutePathToUrl(n)))}async sourceMapSourceToAbsolute(t,n){if(!this.shouldResolveSourceMap(n.metadata))return;let i=zm(n.sourceRoot,t),o=this.sourceMapOverrides.apply(i);return o!==i?Xe(o):Er(t)?We(t):!Os.isAbsolute(t)&&this.options.basePath?ir(await Jm(this.options.remoteRoot&&$t(n.sourceRoot)&&this.rebaseRemoteToLocal(n.sourceRoot)||n.sourceRoot,n.metadata.compiledPath,{"/":this.options.basePath},p1(this.fsUtils,n.metadata.compiledPath),this.logger),t):this.rebaseRemoteToLocal(t)||t}};var dn=Symbol("ISourcePathResolverFactory"),jc=class{constructor(e,t){this.fsUtils=e;this.linkedBp=t}create(e,t){if(e.type==="pwa-node"||e.type==="node-terminal"||e.type==="pwa-extensionHost")return new Ti(this.fsUtils,Ti.shouldWarnAboutSymlinks(e)?this.linkedBp:void 0,Ti.getOptions(e),t);throw new Error(`Not usable for type ${e.type}`)}};jc=E([(0,yr.injectable)(),g(0,(0,yr.inject)(Jt)),g(1,(0,yr.optional)()),g(1,(0,yr.inject)(g_))],jc);var Vc=class{constructor(e,t,n,i){this.initializeParams=e;this.vueMapper=t;this.fsUtils=n;this.linkedBp=i}create(e,t){if(e.type==="pwa-node"||e.type==="node-terminal"||e.type==="pwa-extensionHost")return new Ti(this.fsUtils,Ti.shouldWarnAboutSymlinks(e)?this.linkedBp:void 0,Ti.getOptions(e),t);{let n=!!e.inspectUri;return new(n?eH:Lo)(this.vueMapper,this.fsUtils,{workspaceFolder:e.__workspaceFolder,resolveSourceMapLocations:e.resolveSourceMapLocations,baseUrl:y1(e),localRoot:null,remoteRoot:null,pathMapping:{"/":e.webRoot,...e.pathMapping},sourceMapOverrides:e.sourceMapPathOverrides,clientID:this.initializeParams.clientID,remoteFilePrefix:e.__remoteFilePrefix},t)}}};Vc=E([(0,yr.injectable)(),g(0,(0,yr.inject)(Ct)),g(1,(0,yr.inject)(Pc)),g(2,(0,yr.inject)(Jt)),g(3,(0,yr.optional)()),g(3,(0,yr.inject)(g_))],Vc);var I1=H("url");var tH=class extends _o{constructor(){super(...arguments);this.baseFilter=qi(this.launchParams);this.filter=t=>{let{debugWebWorkerExtHost:n,debugWebviews:i}=this.launchParams;return!!(n&&(t.type==="worker"&&t.title.startsWith("DebugWorkerExtensionHost")||t.type==="page"&&t.title.includes("[Extension Development Host]"))||i&&t.type==="iframe"&&this.baseFilter(t))}}static async connectRenderer(t,n,i,o,s,a){let u=await t.rootSession().Target.attachToBrowserTarget({});if(!u)return;let l=t.createSession(u.sessionId);return new this(t,void 0,l,n,o,s,i,a)}waitForMainTarget(t){let n=this.launchParams;return n.debugWebWorkerExtHost&&this._browser.Target.on("targetCreated",this.enqueueLifecycleFn(async({targetInfo:i})=>{if(!i.url.includes(n.__sessionId))return;let o=await this._browser.Target.attachToTarget({targetId:i.targetId,flatten:!0});o&&this.attachedToTarget(i,o.sessionId,!1)})),super.waitForMainTarget(t)}attachedToTarget(t,n,i,o){let s=super.attachedToTarget(t,n,i||this.filter(t),o,!1);return t.type==="iframe"&&s.setComputeNameFn(k6),s}},k6=r=>{let e;try{e=new I1.URL(r.targetInfo.url)}catch{return}switch(e.searchParams.get("purpose")){case"customEditor":return`${e.searchParams.get("extensionId")} editor: ${e.host}`;case"notebookRenderer":return`Notebook Renderer: ${e.host}`;default:let t=e.searchParams.get("extensionId");return`Webview: ${t?t+" ":""} ${e.host}`}};var fn=class extends qr{constructor(t,n,i){super(t,n);this.pathResolverFactory=i}async launch(t,n){if(t.type!=="pwa-extensionHost"||t.request!=="attach")return{blockSessionTermination:!1};let i=fn.debugIdToRendererDebugPort.get(t.__sessionId);if(!i)return{blockSessionTermination:!1};let o=_a({name:"Webview",type:"pwa-chrome",request:"attach",port:i,__workspaceFolder:t.__workspaceFolder,urlFilter:"",resolveSourceMapLocations:t.resolveSourceMapLocations,...t.rendererDebugOptions});return o.__sessionId=t.__sessionId,o.debugWebWorkerExtHost=t.debugWebWorkerHost,o.debugWebviews=t.debugWebviews,super.launch(o,n).catch(s=>this.logger.error("runtime.exception","Error in webview attach",{err:s})),{blockSessionTermination:!1}}async acquireConnectionInner(t,n,i){let o=new Ae,s=await new Promise((a,c)=>{let u=(0,_1.createConnection)({port:n.port},()=>a(u));u.on("error",c),o.push(i.onCancellationRequested(()=>{u.destroy(),c(new Error("connection timed out"))}))}).finally(()=>o.dispose());return new it(new Vr(this.logger,s),this.logger,t)}async getTargetFilter(t){return t.filter}async createTargetManager(t,n,i){return new tH(t,void 0,t.rootSession(),this.pathResolverFactory.create(n,this.logger),this.logger,i.telemetryReporter,n,i.targetOrigin)}};fn.debugIdToRendererDebugPort=new Map,fn=E([(0,qc.injectable)(),g(0,(0,qc.inject)(U)),g(1,(0,qc.inject)(Se)),g(2,(0,qc.inject)(dn))],fn);var w1=_(q());var Gc=class r{constructor(){this.target={queue:[]}}connectTo(e){this.target={logger:e}}info(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:1})}verbose(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:0})}warn(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:2})}error(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:3})}fatal(e,t,n){this.log({tag:e,timestamp:Date.now(),message:t,metadata:n,level:4})}log(e){this.target&&("queue"in this.target?this.target.queue.push(e):this.target.logger.log(e))}getRecentLogs(){return this.target?"queue"in this.target?this.target.queue:this.target.logger.getRecentLogs():[]}assert(e,t){if(e===!1||e===void 0||e===null){if(this.error("runtime.assertion",t,{error:new Error("Assertion failed")}),process.env.JS_DEBUG_THROW_ASSERTIONS)throw new Error(t);debugger;return!1}return!0}setup(){throw new Error("A ProxyLogger cannot be setup()")}dispose(){this.target=void 0}forTarget(){return new r}};var A1=Symbol("ITargetOrigin"),rH=class{constructor(e){this.id=e}},nH=class{constructor(e){this.id=e}};var iH=class{constructor(e,t){this.parentList=e;this.logger=t;this.targets=new ti;this.onTerminatedEmitter=new C;this.onTerminated=this.onTerminatedEmitter.event;this.onTargetListChanged=this.targets.onChanged;e.onAdd(([,n])=>{n.parent&&this.targets.get(n.parent.id)&&this.targets.add(n.id,n.target)}),e.onRemove(([n])=>{this.targets.remove(n)&&!this.targets.size&&this.onTerminatedEmitter.fire({killed:!0,code:0})})}async launch(e,t){if(e.type!=="node-terminal"||e.request!=="attach")return{blockSessionTermination:!1};let n=this.parentList.get(e.delegateId);if(n===void 0)return setTimeout(()=>this.onTerminatedEmitter.fire({killed:!0,code:0}),1),{blockSessionTermination:!0};let i=n.target.targetOrigin();if(!(i instanceof nH))throw new Error("Expected delegate session to have a mutable target origin");let o=n.target.logger;if(!(o instanceof Gc))throw new Error("Expected delegate session to have a proxy logger");return i.id=t.targetOrigin.id,o.connectTo(this.logger),setTimeout(()=>{this.targets.add(e.delegateId,n.target),n.dap.connect(t.dap)},0),{blockSessionTermination:!0}}terminate(){for(let e of this.targets.value())e.stop();return Promise.resolve()}restart(){for(let e of this.targets.value())e.restart();return Promise.resolve()}targetList(){return[...this.targets.value()]}dispose(){this.terminate()}};var O6=0,Ns=class{constructor(){this.delegateSessions=new ti;this.refsByTarget=new WeakMap}createLauncher(e){return new iH(this.delegateSessions,e)}addDelegate(e,t,n){let i={id:O6++,target:e,dap:t,parent:n&&this.refsByTarget.get(n)};return this.refsByTarget.set(e,i),this.delegateSessions.add(i.id,i),i.id}removeDelegate(e){let t=this.refsByTarget.get(e);t&&this.delegateSessions.remove(t.id)}};Ns=E([(0,w1.injectable)()],Ns);var W1=_(q());var Ie=class r{constructor(e,t,n){this.major=e;this.minor=t;this.patch=n}static parse(e){let t=e.split(".").map(Number);if(t.length!==3||t.some(isNaN))throw new SyntaxError(`Input string '${e}' is not a semver`);return new r(t[0],t[1],t[2])}static min(e,t){return e.lt(t)?e:t}compare(e){return this.major-e.major||this.minor-e.minor||this.patch-e.patch}gt(e){return this.compare(e)>0}gte(e){return this.compare(e)>=0}lt(e){return this.compare(e)<0}lte(e){return this.compare(e)<=0}toString(){return`${this.major}.${this.minor}.${this.patch}`}};var N1=_(q());var k1=_(P1()),oi=_(H("fs")),Fs=_(q()),O1=_(H("net")),w_=_(H("os")),S_=_(H("path"));var aH=class{constructor(e,t){this.sessionId=e;this.sink=t;this.onMessageEmitter=new C;this.onEndEmitter=new C;this.disposables=new Ae;this.onMessage=this.onMessageEmitter.event;this.onEnd=this.onEndEmitter.event;this.disposables.push(t.NodeWorker.on("detachedFromWorker",n=>{n.sessionId===e&&(this.onEndEmitter.fire(),this.dispose())}),t.NodeWorker.on("receivedMessageFromWorker",n=>{n.sessionId===e&&this.onMessageEmitter.fire([n.message,new Rr])}))}send(e){this.sink.NodeWorker.sendMessageToWorker({message:e,sessionId:this.sessionId})}dispose(){this.disposables.isDisposed||(this.disposables.dispose(),this.onEndEmitter.fire())}};var L1=":::";var __=H("path"),gbe=(0,__.join)(__dirname,"watchdog.js"),$1=(0,__.join)(__dirname,"bootloader.js");var lp=_(je()),Gr=_(q()),er=H("path");var ap=_(q()),C1=H("path");var Bs=Symbol("IPackageJsonProvider");var Kc=class{constructor(e,t){this.fs=e;this.config=t;this.getPath=ne(async()=>{if(this.config.type!=="pwa-node"||this.config.request!=="launch")return;let e=await Ud(this.fs,this.config.cwd,"package.json");return e?(0,C1.join)(e,"package.json"):void 0});this.getContents=ne(async()=>{let e=await this.getPath();if(e)try{let t=await this.fs.readFile(e);return JSON.parse(t.toString())}catch{return}})}};Kc=E([(0,ap.injectable)(),g(0,(0,ap.inject)(Jt)),g(1,(0,ap.inject)(de))],Kc);var Co=Symbol("INodeBinaryProvider");function D1(r,e){return r.has(1)?e.addNodeOption("--inspect-publish-uid=http"):e}var eJ=new Set(["npm","yarn","pnpm","tnpm","cnpm"]),T1=r=>eJ.has((0,er.basename)(r,(0,er.extname)(r))),M1=(r,e)=>{if(!(!r||!T1(r)))return e.find(t=>!t.startsWith("-")&&t!=="run"&&t!=="run-script")},A_=new Ie(12,0,0),tJ=new Ie(8,0,0),rJ=[{inclusiveMin:new Ie(16,0,0),inclusiveMax:new Ie(16,3,99),message:lp.t("Some breakpoints might not work in your version of Node.js. We recommend upgrading for the latest bug, performance, and security fixes. Details: https://aka.ms/AAcsvqm")},{inclusiveMin:new Ie(7,0,0),inclusiveMax:new Ie(8,99,99),message:lp.t("You're running an outdated version of Node.js. We recommend upgrading for the latest bug, performance, and security fixes.")}],br=class{constructor(e,t){this.path=e;this.version=t;this.capabilities=new Set;t===void 0&&(t=A_),t.gte(new Ie(12,0,0))&&this.capabilities.add(0),t.gte(new Ie(12,6,0))&&this.capabilities.add(1)}get isPreciselyKnown(){return this.version!==void 0}get warning(){if(this.version){for(let e of rJ)if(e.inclusiveMax.gte(this.version)&&e.inclusiveMin.lte(this.version))return e}}has(e,t){return!this.isPreciselyKnown&&t!==void 0?t:this.capabilities.has(e)}},up=class extends T{constructor(t,n){super(hx(t.toString(),n));this.version=t;this.location=n}},nJ=["node","node64","electron"],iJ=new Map([[11,new Ie(12,0,0)],[10,new Ie(12,0,0)],[9,new Ie(12,0,0)],[8,new Ie(12,0,0)],[7,new Ie(12,0,0)],[6,new Ie(12,0,0)],[5,new Ie(10,0,0)],[4,new Ie(10,0,0)],[3,new Ie(10,0,0)],[2,new Ie(8,0,0)],[1,new Ie(8,0,0)]]),cp=class{constructor(e,t,n){this.logger=e;this.fs=t;this.packageJson=n;this.knownGoodMappings=new Map}async resolveAndValidate(e,t="node",n,i){try{return await this.resolveAndValidateInner(e,t,n,i)}catch(o){if(!(o instanceof up))throw o;if(await this.shouldTryDebuggingAnyway(o))return new br(o.location,o.version instanceof Ie?o.version:void 0);throw o}}shouldTryDebuggingAnyway(e){return Promise.resolve(!1)}async resolveNodeModulesLocation(e,t,n){if(!(!n||(0,er.isAbsolute)(t)||!(0,er.isAbsolute)(n)))return ly(n,i=>Tg(this.fs,(0,er.join)(i,"node_modules",".bin",t),e))}async resolveAndValidateInner(e,t,n,i){let o=await this.resolveBinaryLocation(t,e);if(o||(o=await this.resolveNodeModulesLocation(e,t,i)),this.logger.info("runtime.launch","Using binary at",{location:o,executable:t}),!o)throw new T(vy(t,lp.t("path does not exist")));if(n)return new br(o,new Ie(n,0,0));let s=B0(o);if(!nJ.includes(s)){if(T1(o)){let m=await this.packageJson.getPath();m&&(e=e.addToPath((0,er.resolve)((0,er.dirname)(m),"node_modules/.bin"),"prepend"))}try{let m=await this.resolveAndValidateInner(e,"node",void 0,i);return new br(o,m.version)}catch(m){if(_x(m,9230))throw m;return new br(o,void 0)}}if(o.startsWith("/snap/"))return new br(o,void 0);let a=this.knownGoodMappings.get(o);if(a)return a;let c=await this.getVersionText(o,i);if(!c)return new br(o,void 0);this.logger.info("runtime.launch","Discovered version",{version:c});let u=/v([0-9]+)\.([0-9]+)\.([0-9]+)/.exec(c);if(!u)throw new up(c,o);let[,l,p,d]=u.map(Number),f=new Ie(l,p,d);if(s==="electron"){let m=await this.resolveAndValidate(e);f=Ie.min(iJ.get(f.major)??A_,m.version??A_)}if(f.lt(tJ))throw new up(f,o);let h=new br(o,f);return this.knownGoodMappings.set(o,h),h}async resolveBinaryLocation(e,t){return e&&(0,er.isAbsolute)(e)?await Tg(this.fs,e,t):await dd(this.fs,e,t.value)}async getVersionText(e,t){try{let{stdout:n}=await Bm(e,["--version"],{env:yt.processEnv().defined(),cwd:t});return n.trim()}catch(n){throw t&&!(await Ni(this.fs,t))?.isDirectory()?new T(fx(t)):new T(vy(e,n.message))}}};cp=E([(0,Gr.injectable)(),g(0,(0,Gr.inject)(U)),g(1,(0,Gr.inject)($e)),g(2,(0,Gr.inject)(Bs))],cp);var Xc=class extends cp{constructor(t,n,i,o){super(t,n,i);this.vscode=o}async shouldTryDebuggingAnyway({message:t}){if(!this.vscode)return!1;let n=lp.t("Yes");return await this.vscode.window.showErrorMessage(t,n)===n}};Xc=E([g(0,(0,Gr.inject)(U)),g(1,(0,Gr.inject)($e)),g(2,(0,Gr.inject)(Bs)),g(3,(0,Gr.optional)()),g(3,(0,Gr.inject)(Fn))],Xc);var R1=H("path");var cH=class{constructor(e,t,n,i,o,s,a={},c){this.launchConfig=e;this.targetOriginValue=t;this.connection=n;this.targetInfo=o;this.logger=s;this.lifecycle=a;this._parent=c;this._serialize=Promise.resolve(void 0);this._attached=!1;this._onNameChangedEmitter=new C;this._onDisconnectEmitter=new C;this.entryBreakpoint=void 0;this.onDisconnect=this._onDisconnectEmitter.event;this.onNameChanged=this._onNameChangedEmitter.event;this.connection=n,this._cdp=i,i.pause(),this._waitingForDebugger=o.type==="waitingForDebugger",o.title?this._targetName=`${(0,R1.basename)(o.title)} [${o.processId}]`:this._targetName=`[${o.processId}]`,i.Target.on("targetDestroyed",()=>this.connection.close()),n.onDisconnected(()=>this._disconnected())}id(){return this.targetInfo.targetId}processId(){return this.targetInfo.processId}name(){return this._targetName}fileName(){return this.targetInfo.title}type(){return"node"}targetOrigin(){return this.targetOriginValue}parent(){return this._parent}async initialize(){this.lifecycle.initialized&&(this.entryBreakpoint=await this.lifecycle.initialized(this)||void 0)}waitingForDebugger(){return this._waitingForDebugger}scriptUrlToUrl(e){return e[0]==="/"||process.platform==="win32"&&e[1]===":"&&e[2]==="\\"?He(e):e}supportsCustomBreakpoints(){return!1}supportsXHRBreakpoints(){return!1}executionContextName(){return this._targetName}hasParent(){return!!this._parent}async runIfWaitingForDebugger(){await this._cdp.Runtime.runIfWaitingForDebugger({})}async _disconnected(){this._onDisconnectEmitter.fire()}canAttach(){return!this._attached}async attach(){return this._serialize=this._serialize.then(async()=>{if(!this._attached)return this._doAttach()}),this._serialize}async _doAttach(){this._waitingForDebugger=!1,this._attached=!0;let e=await this._cdp.Target.attachToTarget({targetId:this.targetInfo.targetId});if(!e){this.logger.info("runtime.launch","Failed to attach to target",{targetId:this.targetInfo.targetId});return}this._cdp.NodeWorker.enable({waitForDebuggerOnStart:!0}),e&&"__dynamicAttach"in e&&(await this._cdp.Runtime.enable({}),await this._cdp.Debugger.enable({}));let t;return this._cdp.Runtime.on("executionContextCreated",n=>{n.context.auxData&&n.context.auxData.isDefault&&(t=n.context.id)}),this._cdp.Runtime.on("executionContextDestroyed",n=>{n.executionContextId===t&&this.connection.close()}),this._cdp}async afterBind(){this._cdp.resume()}canDetach(){return this._attached}async detach(){this._serialize=this._serialize.then(async()=>{this._waitingForDebugger&&await(await this._doAttach())?.Runtime.runIfWaitingForDebugger({}),this._attached&&this._doDetach()})}async _doDetach(){await Promise.all([this._cdp.Target.detachFromTarget({targetId:this.targetInfo.targetId}),this._cdp.NodeWorker.disable({})]),this.connection.close(),this._attached=!1}canRestart(){return!1}restart(){}canStop(){return!0}stop(){try{this.lifecycle.close&&this.lifecycle.close(this)}finally{this.connection.close()}}};var ii=class{constructor(e,t,n,i){this.pathProvider=e;this.logger=t;this.portLeaseTracker=n;this.pathResolverFactory=i;this.serverConnections=new Set;this.targets=new ti;this.onTerminatedEmitter=new C;this.onTerminated=this.onTerminatedEmitter.event;this.onTargetListChanged=this.targets.onChanged;this.bootloaderFile=ne(this.getBootloaderFile.bind(this))}async launch(e,t){let n=this.resolveParams(e);if(!n)return{blockSessionTermination:!1};this._stopServer();let{server:i,pipe:o}=await this._startServer(t.telemetryReporter),s=this.logger.forTarget(),a=this.run={server:i,serverAddress:o,params:n,context:t,logger:s,pathResolver:this.pathResolverFactory.create(n,this.logger)};return await this.launchProgram(a),{blockSessionTermination:!0}}async terminate(){this.program?await this.program.stop():this.onProgramTerminated({code:0,killed:!0})}async restart(e){if(!this.run)return;let t=this.program;t&&(this.program=void 0,await t.stop(),await Promise.race([ue(2e3).then(()=>!1),Promise.all([...this.serverConnections].map(i=>new Promise(o=>i.onDisconnected(o))))])||(this.logger.warn("runtime.launch","Timeout waiting for server connections to close"),this.closeAllConnections())),await this.launchProgram({...this.run,params:e?this.resolveParams(e)??this.run.params:this.run.params,context:{...this.run.context,cancellationToken:this.run.params.timeout>0?ut.withTimeout(this.run.params.timeout).token:Vt}})}targetList(){return[...this.targets.value()]}dispose(){this._stopServer()}onProgramTerminated(e){this.onTerminatedEmitter.fire(e),this._stopServer(),this.program=void 0}resolveNodePath(e,t="node"){return this.pathProvider.resolveAndValidate(yt.merge(yt.processEnv(),this.getConfiguredEnvironment(e)),t,e.nodeVersionHint,e.cwd)}getConfiguredEnvironment(e){let t=yt.empty;if(e.envFile)try{t=t.merge(sJ(e.envFile))}catch(n){throw new T(dx(n.message))}return t.merge(e.env)}async resolveEnvironment({params:e,serverAddress:t},n,i){let o=this.getConfiguredEnvironment(e),s=await this.bootloaderFile(e.cwd,n),a={inspectorIpc:t,deferredMode:!1,waitForDebugger:"",execPath:await dd(oi.promises,"node",process.env),onlyEntrypoint:!e.autoAttachChildProcesses,verbose:e.trace===!0||typeof e.trace=="object"&&e.trace.stdio?!0:void 0,autoAttachMode:"always",mandatePortTracking:this.portLeaseTracker.isMandated?!0:void 0,...i},c={NODE_OPTIONS:` --require ${s.interpolatedPath} `,VSCODE_INSPECTOR_OPTIONS:L1+JSON.stringify(a),ELECTRON_RUN_AS_NODE:null},u=o.lookup("NODE_OPTIONS");u&&(c.NODE_OPTIONS+=` ${u} `);let l=yt.processEnv().lookup("NODE_OPTIONS");return l&&(c.NODE_OPTIONS+=` ${l}`),o.merge({...c})}createLifecycle(e,t,n){return{}}async _startServer(e){let t=dE(),n=await new Promise((i,o)=>{let s=O1.createServer(a=>this._startSession(a,e)).on("error",o).listen(t,()=>i(s))});return{pipe:t,server:n}}_stopServer(){this.run?.server.close(),this.run=void 0,this.bootloaderFile.value?.then(e=>e.dispose()),this.bootloaderFile.forget(),this.closeAllConnections()}closeAllConnections(){this.serverConnections.forEach(e=>e.close()),this.serverConnections.clear()}async _startSession(e,t){if(!this.run)return;let{connection:n,cdp:i,targetInfo:o}=await this.acquireTarget(e,t,this.run.logger);if(!this.run){e.destroy();return}o.processId===void 0&&(o.processId=Number(o.targetId));let s=new cH(this.run.params,this.run.context.targetOrigin,n,i,o,this.run.logger,this.createLifecycle(i,this.run,o),o.openerId?this.targets.get(o.openerId):void 0);this.listenToWorkerDomain(i,t,s),this.targets.add(o.targetId,s),s.onDisconnect(()=>this.targets.remove(o.targetId))}async listenToWorkerDomain(e,t,n){e.NodeWorker.on("attachedToWorker",i=>{let o=new aH(i.sessionId,e),s=new sc(n.launchConfig,{attached:!0,canAccessOpener:!1,type:"node-worker",targetId:`${n.id()}-${i.sessionId}`,title:i.workerInfo.title,url:i.workerInfo.url,openerId:n.id()},n,n.targetOrigin(),new it(o,n.logger,t).rootSession(),n.logger),a=new Ae;a.push(o),a.push(n.onDisconnect(()=>a.dispose())),a.push(o.onEnd(()=>a.dispose())),a.callback(()=>this.targets.remove(s.id())),this.targets.add(s.id(),s)})}async acquireTarget(e,t,n){let i=new it(new Vr(n,e),n,t);this.serverConnections.add(i),i.onDisconnected(()=>this.serverConnections.delete(i));let o=i.rootSession(),{targetInfo:s}=await new Promise(u=>o.Target.on("targetCreated",u)),a=s,c=this.portLeaseTracker.register(a.processInspectorPort);return i.onDisconnected(()=>c.dispose()),{targetInfo:a,cdp:o,connection:i,logger:n}}async getBootloaderFile(e,t){let n=Oe($1);if(!n.includes(" "))return{interpolatedPath:n,dispose:()=>{}};if(t.has(0))return{interpolatedPath:`"${n}"`,dispose:()=>{}};let i=`require(${JSON.stringify(n)})`;if(!w_.tmpdir().includes(" ")||!e){let a=S_.join(w_.tmpdir(),"vscode-js-debug-bootloader.js");return await oi.promises.writeFile(a,i),{interpolatedPath:a,dispose:()=>{}}}let o=".vscode-js-debug-bootloader.js",s=S_.join(e,o);return await oi.promises.writeFile(s,i),{interpolatedPath:`./${o}`,dispose:()=>oi.unlinkSync(s)}}async gatherTelemetryFromCdp(e,t){for(let n=0;n<8;n++){let i=await e.Runtime.evaluate({contextId:1,returnByValue:!0,expression:"typeof process === 'undefined' || process.pid === undefined ? 'process not defined' : ({ processId: process.pid, nodeVersion: process.version, architecture: process.arch })"+Ne()});if(!this.program)return;if(!i||!i.result.value){this.logger.error("runtime.target","Undefined result getting telemetry");return}if(typeof i.result.value!="object"){this.logger.info("runtime.target","Process not yet defined, will retry"),await ue(50*2**n);continue}let o=i.result.value;return t.context.telemetryReporter.report("nodeRuntime",{version:o.nodeVersion,arch:o.architecture}),this.program.gotTelemetery(o),o}}};ii=E([(0,Fs.injectable)(),g(0,(0,Fs.inject)(Co)),g(1,(0,Fs.inject)(U)),g(2,(0,Fs.inject)(Mr)),g(3,(0,Fs.inject)(dn))],ii);function sJ(r){if(!oi.existsSync(r))return{};let e=aJ(oi.readFileSync(r,"utf8"));return k1.parse(Buffer.from(e))}function aJ(r){return r&&r[0]==="\uFEFF"&&(r=r.substr(1)),r}var cJ=["NODE_OPTIONS","VSCODE_INSPECTOR_OPTIONS"],Do=class extends ii{async appendEnvironmentVariables(e,t){let n="typeof Deno==='object'?'deno':typeof process==='undefined'||process.pid===undefined?'process not defined':(()=>{"+Object.entries(t.defined()).map(([i,o])=>{let s=JSON.stringify(i);return cJ.includes(i)?`process.env[${s}]=(process.env[${s}]||'')+${JSON.stringify(o)}`:`process.env[${s}]=${JSON.stringify(o)}`}).join(";")+"})()"+Ne();for(let i=0;i<200;i++){let o=await e.Runtime.evaluate({contextId:1,returnByValue:!0,expression:n});if(!o){this.logger.error("runtime.target","Undefined result setting child environment vars");return}if(!o.exceptionDetails&&o.result.value!=="process not defined")return;this.logger.error("runtime.target","Error setting child environment vars",o),await ue(50)}}};Do=E([(0,N1.injectable)()],Do);var uH=class{constructor(e,t){this.a=e;this.b=t;this.stopped=Promise.race([this.a.stopped.then(async e=>await this.b.stop()&&e),this.b.stopped.then(async e=>await this.a.stop()&&e)])}gotTelemetery(e){this.a.gotTelemetery(e),this.b.gotTelemetery(e)}async stop(){return(await Promise.all([this.a.stop(),this.b.stop()]))[0]}},lH=class{constructor(e,t,n){this.child=e;this.logger=t;this.killBehavior=n;this.killed=!1;this.stopped=new Promise((i,o)=>{e.once("exit",s=>i({killed:this.killed,code:s||0})),e.once("error",s=>o({killed:this.killed,code:1,error:s}))})}gotTelemetery(){}stop(){return this.killed=!0,un(this.child.pid,this.logger,this.killBehavior),this.stopped}},Us=class{constructor(){this.stopped=new Promise(e=>this.stopDefer=e)}gotTelemetery(e){this.telemetry=e}stop(){return this.stopDefer({code:0,killed:!0}),this.stopped}},To=class extends Us{constructor(t){super();this.wd=t;t.onEnd(n=>{this.stopDefer(n),this.wd.dispose()})}stop(){return this.wd.dispose(),this.stopped}},zc=class r{constructor(e,t,n){this.terminalResult=e;this.logger=t;this.killBehavior=n;this.didStop=!1;this.stopped=new Promise(e=>this.onStopped=t=>{this.didStop=!0,e({code:0,killed:t})});e.processId&&this.startPollLoop(e.processId)}static{this.terminationPollInterval=1e3}static{this.killConfirmInterval=200}gotTelemetery({processId:e}){if(this.didStop){un(e,this.logger,this.killBehavior);return}this.loop||this.startPollLoop(e)}stop(){return this.didStop?this.stopped:(this.didStop=!0,this.loop?(un(this.loop.processId,this.logger,this.killBehavior),this.startPollLoop(this.loop.processId,r.killConfirmInterval)):this.terminalResult.shellProcessId?(un(this.terminalResult.shellProcessId,this.logger,this.killBehavior),this.startPollLoop(this.terminalResult.shellProcessId,r.killConfirmInterval)):this.onStopped(!0),this.stopped)}startPollLoop(e,t=r.terminationPollInterval){this.loop&&clearInterval(this.loop.timer);let n={processId:e,timer:setInterval(()=>{uJ(e)||(clearInterval(n.timer),this.onStopped(!0))},t)};this.loop=n}};function uJ(r){try{return process.kill(r,0),!0}catch{return!1}}var U1=_(H("net"));var B1=H("crypto"),F1=()=>(0,B1.randomBytes)(12).toString("hex");var si=class r{constructor(e,t){this.info=e;this.server=t;this.onEndEmitter=new C;this.cts=new ut;this.gracefulExit=!1;this.targetAlive=!1;this.targetInfo={targetId:this.info.ownId??F1(),processId:Number(this.info.pid)||0,type:this.info.waitForDebugger?"waitingForDebugger":"",title:this.info.scriptName,url:"file://"+this.info.scriptName,openerId:this.info.openerId,attached:!0,canAccessOpener:!1,processInspectorPort:Number(new URL(this.info.inspectorURL).port)};this.onEnd=this.onEndEmitter.event;this.listenToServer()}get isTargetAlive(){return this.targetAlive}static async attach(e){let t=await new Promise((i,o)=>{let s=U1.createConnection(e.ipcAddress,()=>i(s));s.on("error",o)}),n=new Vr(Wr.null,t);return new r(e,n)}listenToServer(){let{server:e,targetInfo:t}=this;e.send(JSON.stringify({method:"Target.targetCreated",params:{targetInfo:t}})),e.onMessage(async([n])=>{if(this.target&&!n.includes("Target.attachToTarget")&&!n.includes("Target.detachFromTarget")){this.target.send(n);return}let i=await this.execute(n);i&&e.send(JSON.stringify(i))}),e.onEnd(()=>{this.disposeTarget(),this.onEndEmitter.fire({killed:this.gracefulExit,code:this.gracefulExit?0:1})})}dispose(){this.gracefulExit=!0,this.cts.dispose(!0),this.disposeTarget(),this.server.dispose()}async execute(e){let t=JSON.parse(e);switch(t.method){case"Target.attachToTarget":return this.target&&this.disposeTarget(),this.target=await this.createTarget(),{id:t.id,result:{sessionId:this.targetInfo.targetId,__dynamicAttach:this.info.dynamicAttach?!0:void 0}};case"Target.detachFromTarget":return this.gracefulExit=!0,this.disposeTarget(),{id:t.id,result:{}};default:this.target?.send(t);return}}async createTarget(){this.gracefulExit=!1;let e=await gr.create(this.info.inspectorURL,this.cts.token,this.info.remoteHostHeader);return e.onMessage(([t])=>this.server.send(t)),e.onEnd(()=>{e&&this.server.send(JSON.stringify({method:"Target.targetDestroyed",params:{targetId:this.targetInfo.targetId,sessionId:this.targetInfo.targetId}})),this.targetAlive=!1,this.server.dispose()}),e}disposeTarget(){this.target&&(this.target.dispose(),this.target=void 0)}};var E_=class extends To{constructor(t,n){super(t);this.logger=n;this.stopped.then(()=>{this.telemetry&&un(this.telemetry.processId,this.logger,"polite")})}},Jc=class extends Do{constructor(){super(...arguments);this.restarting=!1}async restart(){this.restarting=!0,this.onProgramTerminated({code:0,killed:!0,restart:!0}),this.program?.stop()}resolveParams(t){return t.type==="pwa-extensionHost"&&t.request==="attach"?t:void 0}async launchProgram(t){let n=await kc(`http://localhost:${t.params.port}`,t.context.cancellationToken,this.logger),i=await si.attach({ipcAddress:t.serverAddress,scriptName:"Extension Host",inspectorURL:n,waitForDebugger:!0,dynamicAttach:!0}),o=this.program=new E_(i,this.logger);this.program.stopped.then(s=>{o===this.program&&this.onProgramTerminated(s)})}createLifecycle(t,n,i){return i.openerId?{}:{initialized:()=>this.onFirstInitialize(t,n,i)}}async onFirstInitialize(t,n,i){this.setEnvironmentVariables(t,n,i.targetId);let o=await this.gatherTelemetryFromCdp(t,n),s=this.program;if(o&&s){let a=new zc({processId:o.processId},this.logger,"forceful");a.stopped.then(()=>s.stop()),s.stopped.then(()=>{this.restarting||a.stop()})}}async setEnvironmentVariables(t,n,i){if(!n.params.autoAttachChildProcesses)return;let o=await this.resolveEnvironment(n,new br("node",Ie.parse(process.versions.node)),{openerId:i});return this.appendEnvironmentVariables(t,o.update("ELECTRON_RUN_AS_NODE",null))}};Jc=E([(0,W1.injectable)()],Jc);var pp=H("fs"),j1=_(q());var Yc=class extends ii{resolveParams(e){return e.type==="pwa-extensionHost"&&e.request==="launch"?e:void 0}async launchProgram(e){let t=e.params.port||await Wf(),n=await e.context.dap.launchVSCodeRequest({args:lJ(e.params,t),env:this.getConfiguredEnvironment(e.params).defined(),debugRenderer:e.params.debugWebviews||e.params.debugWebWorkerHost});n.rendererDebugPort&&fn.debugIdToRendererDebugPort.set(e.params.__sessionId,n.rendererDebugPort),this.program=new Us,this.program.stop()}};Yc=E([(0,j1.injectable)()],Yc);var lJ=(r,e)=>{let t=r.args.map(n=>{if(n.startsWith("-")){let i=n.split("=",2);return i.length===2&&((0,pp.existsSync)(i[1])||(0,pp.existsSync)(i[1]+".js"))?{prefix:i[0]+"=",path:i[1]}:{prefix:n}}else{try{let i=(0,pp.lstatSync)(n);if(i.isDirectory())return{prefix:"--folder-uri=",path:n};if(i.isFile())return{prefix:"--file-uri=",path:n}}catch{}return{path:n}}});return r.noDebug||t.unshift({prefix:`--inspect-brk-extensions=${e}`}),t.unshift({prefix:`--debugId=${r.__sessionId}`}),t};var rO=_(je()),Ws=_(q());var V1=H("crypto"),dp=H("fs"),q1=H("os"),G1=_(H("path")),pH=class r{constructor(){this.disposed=!1;this.path=G1.join((0,q1.tmpdir)(),`node-debug-callback-${(0,V1.randomBytes)(8).toString("hex")}`);this.file=dp.promises.open(this.path,"w")}static{this.updateInterval=1e3}static{this.recencyDeadline=2e3}static isValid(e){try{let t=(0,dp.readFileSync)(e);return t.length?t.readDoubleBE()>Date.now()-r.recencyDeadline:!1}catch{return!1}}async startTouchLoop(){await this.touch(),this.disposed||(this.updateInterval=setInterval(()=>this.touch(),r.updateInterval))}async touch(e=()=>Date.now()){let t=await this.file,n=Buffer.alloc(8);n.writeDoubleBE(e()),await t.write(n,0,n.length,0)}async dispose(){if(!this.disposed){this.disposed=!0,this.updateInterval&&clearInterval(this.updateInterval);try{await(await this.file).close(),await dp.promises.unlink(this.path)}catch{}}}};var Y1=H("fs");var X1=H("path");var K1=H("child_process");var Qc=class{constructor(e=K1.spawn){this.spawn=e}lookup(e,t){return new Promise((n,i)=>{let o=this.createProcess(),s=this.createParser();o.on("error",i),o.stderr.on("error",a=>i(`Error finding processes: ${a.toString()}`)),o.stdout.pipe(new wo(`
`)).on("data",a=>{let c=s(a.toString());c&&(t=e(c,t))}),o.on("close",(a,c)=>{a===0?n(t):c?i(new Error(`process terminated with signal: ${c}`)):a&&i(new Error(`process terminated with exit code: ${a}`))})})}};var Zc=class extends Qc{constructor(t){super();this.fsUtils=t}async getWorkingDirectory(t){try{let{stdout:n}=await Bm("lsof",["-a","-dcwd","-Fn",`-p${t}`]),i=n.trim().split(`
`).pop().slice(1);return i&&(0,X1.isAbsolute)(i)&&await this.fsUtils.exists(i)?i:void 0}catch(n){if(n instanceof tp)return;throw n}}createProcess(){return this.spawn("ps",["-xo",`pid=PID,ppid=PPID,comm=${"a".repeat(256)},command=COMMAND`])}createParser(){let t;return n=>{if(!t){t=n.indexOf("COMMAND");return}let i=/^\W*([0-9]+)\W*([0-9]+)\W*/.exec(n);if(i)return{pid:Number(i[1]),ppid:Number(i[2]),command:n.slice(i[0].length,t).trim(),args:n.slice(t).trim()}}}};var dH=class extends Zc{createProcess(){return this.spawn("ps",["-axo","pid=PID,ppid=PPID,comm:30,command=COMMAND"])}createParser(){let e=super.createParser();return t=>{let n=e(t);if(!n)return;let i=n.args.indexOf(n.command);if(i===-1)return n;for(i=i+n.command.length;i<n.args.length&&n.args[i]!==" ";)i++;return n.command=n.args.substr(0,i),n.args=n.args.substr(i+1),n}}};var z1=H("path");var fH=class extends Qc{async getWorkingDirectory(){}createProcess(){let e=(0,z1.join)(process.env.WINDIR||"C:\\Windows","System32","wbem","WMIC.exe");return this.spawn(e,["process","get","CommandLine,CreationDate,ParentProcessId,ProcessId"])}createParser(){let e=/^(.*)\s+([0-9]+)\.[0-9]+[+-][0-9]+\s+([0-9]+)\s+([0-9]+)$/;return t=>{let n=e.exec(t.trim());if(!n||n.length!==5)return;let i=Number(n[4]),o=Number(n[3]),s=Number(n[2]),a=n[1].trim();if(!isNaN(i)&&!isNaN(o)&&a){let c=a;if(a[0]==='"'){let u=a.indexOf('"',1);u>0&&(c=a.substr(1,u-1),a=a.substr(u+2))}else{let u=a.indexOf(" ");u>0?(c=a.substr(0,u),a=a.substr(u+1)):a=""}return{pid:i,ppid:o,command:c,args:a,date:s}}}}};var J1=new Qr(Y1.promises),Q1=process.platform==="win32"?new fH:process.platform==="darwin"?new Zc(J1):new dH(J1),pJ=ne(()=>{let r=["--inspect(?:-brk)?","(?:=",["(?:",["(?:","(?<address>\\[[0-9a-f:]*\\]|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+|(?:[a-z][a-z0-9\\.]*))","(?::(?<port1>\\d+))?",")"],"|",["(?:",":?","(?<port2>\\d+)?",")"],")"],")?"].flat(1/0).join("");return new RegExp(r,"i")});function Z1(r){let e=/--inspect-port=(\d+)/,t,n,i=pJ().exec(r);if(i?.groups){let o=i.groups.port1||i.groups.port2;n=o?Number(o):9229,t=i.groups.address??"127.0.0.1"}return i=e.exec(r),i&&i.length===2&&(t||="127.0.0.1",n=parseInt(i[1])),{address:t,port:n}}async function eO(r,e,t,n=Vt){let i=await dJ(r.pid,t);if(!i)return[];let o=[],s=i.children.slice();for(;s.length;){let a=s.pop();s=s.concat(a.children);let{port:c}=Z1(a.args);c&&o.push(m_(`http://${r.hostname}:${c}`,n,t,!0).then(u=>si.attach({ipcAddress:r.ipcAddress,scriptName:"Child Process",inspectorURL:u,waitForDebugger:!0,dynamicAttach:!0,pid:String(a.pid),openerId:e})).catch(u=>t.info("internal","Could not spawn WD for child process",{err:u,port:c,child:a})))}return(await Promise.all(o)).filter(a=>!!a)}async function dJ(r,e){let t=new Map;t.set(0,{children:[],pid:0,ppid:0,command:"",args:""});try{await Q1.lookup(({pid:i,ppid:o,command:s,args:a})=>(i!==o&&t.set(i,{pid:i,ppid:o,command:s,args:a,children:[]}),t),null)}catch(i){e.warn("internal","Error getting child process tree",i);return}let n=t.values();for(let i of n){let o=t.get(i.ppid);o&&o!==i&&o.children.push(i)}return!isNaN(r)&&r>0?t.get(r):t.get(0)}var tO=_(q());var ai=class{create(e){return e===!1?new x_:e===!0?new hH({maxAttempts:1/0,delay:1e3}):new hH({maxAttempts:e.maxAttempts??1/0,delay:e.delay??1e3})}};ai=E([(0,tO.injectable)()],ai);var hH=class r{constructor(e,t=0){this.options=e;this.attempt=t}get delay(){return this.options.delay}next(){return this.attempt===this.options.maxAttempts?void 0:new r(this.options,this.attempt+1)}reset(){return this.attempt?new r(this.options):this}},x_=class{constructor(){this.delay=-1}next(){}reset(){return this}};var eu=class extends Do{constructor(t,n,i,o,s=new ai){super(t,n,o,i);this.restarters=s}resolveParams(t){return t.type==="pwa-node"&&t.request==="attach"?t:void 0}async launchProgram(t){let n=async(o,s)=>{let a=this.program,c;try{t.params.websocketAddress?c=t.params.websocketAddress:c=await kc(`http://${t.params.address}:${t.params.port}`,s&&t.params.timeout>0?ut.withTimeout(t.params.timeout).token:t.context.cancellationToken,this.logger,t.params.remoteHostHeader)}catch(p){if(a&&a===s)return i(o,a,{killed:!1,code:1});throw p}let u=await si.attach({ipcAddress:t.serverAddress,scriptName:"Remote Process",inspectorURL:c,remoteHostHeader:t.params.remoteHostHeader,waitForDebugger:!0,dynamicAttach:!0}),l=this.program=new To(u);l.stopped.then(p=>i(o.reset(),l,p))},i=async(o,s,a)=>{if(this.program!==s)return;if(a.killed){this.onProgramTerminated(a);return}let c=o.next();if(!c){this.onProgramTerminated(a);return}t.context.dap.output({output:rO.t(`Lost connection to debugee, reconnecting in {0}ms\r
`,c.delay)});let u=new Us;this.program=u;let l=await Promise.race([ue(c.delay),u.stopped]);this.program===u&&(l?this.onProgramTerminated(a):n(c,u))};return n(this.restarters.create(t.params.restart))}async terminate(t){await super.terminate(),t&&this.telemetry&&un(this.telemetry.processId,this.logger)}createLifecycle(t,n,i){if(i.openerId)return{};let o;return{initialized:async()=>{o=this.onFirstInitialize(t,n,i),await o},close:()=>{this.targetList().length&&this.program?.stop(),o?.then(s=>s.dispose())}}}async onFirstInitialize(t,n,i){let o=new pH;await o.startTouchLoop();let s=new br("node",void 0);try{s=await this.resolveNodePath(n.params)}catch{}let[a]=await Promise.all([this.gatherTelemetryFromCdp(t,n),this.setEnvironmentVariables(t,n,o.path,i.targetId,s)]);return this.telemetry=a,a&&n.params.attachExistingChildren&&eO({pid:a.processId,nodePath:s.path,hostname:n.params.address,ipcAddress:n.serverAddress},i.targetId,this.logger).catch(c=>this.logger.warn("internal","Error watching child processes",{err:c})),o}async setEnvironmentVariables(t,n,i,o,s){if(!n.params.autoAttachChildProcesses)return;if(!await ga(n.params.address)){this.logger.warn("runtime.target","Cannot attach to children of remote process");return}let a=await this.resolveEnvironment(n,s,{requireLease:i,openerId:o});return this.appendEnvironmentVariables(t,a)}};eu=E([(0,Ws.injectable)(),g(0,(0,Ws.inject)(Co)),g(1,(0,Ws.inject)(U)),g(2,(0,Ws.inject)(dn)),g(3,(0,Ws.inject)(Mr))],eu);var vr=_(q()),nu=H("path");function nO(r){if(!r.runtimeArgs||r.attachSimplePort)return;let e=[];for(let t of r.runtimeArgs)/^--inspect-brk(=|$)/.test(t)?r.stopOnEntry=r.stopOnEntry||!0:e.push(t);r.runtimeArgs=e}var iO=H("crypto"),tu=H("fs"),oO=H("os"),sO=_(H("path")),mH=class r{constructor(){this.path=sO.join((0,oO.tmpdir)(),`node-debug-callback-${(0,iO.randomBytes)(8).toString("hex")}`);this.disposed=!1}static{this.pollInterval=200}read(e=r.pollInterval){return this.readPromise?this.readPromise:(this.readPromise=new Promise((t,n)=>{let i=setInterval(()=>{if(this.disposed){clearInterval(i),t(void 0);return}if((0,tu.existsSync)(this.path)){try{t(JSON.parse((0,tu.readFileSync)(this.path,"utf-8")))}catch(o){n(o)}finally{this.dispose()}clearInterval(i)}},e)}),this.readPromise)}dispose(){if(!this.disposed){this.disposed=!0;try{(0,tu.unlinkSync)(this.path)}catch{}}}};var js=_(H("path"));var fp=Symbol("IProgramLauncher"),HH=r=>{let e=r.program;if(e&&js.isAbsolute(e)){let t=js.relative(r.cwd,e);e=js.isAbsolute(t)?t:`.${js.sep}${t}`}return e?[...r.runtimeArgs,e,...Ou(r.args)]:[...r.runtimeArgs,...Ou(r.args)]};var fJ=async(r,e)=>{if(typeof e.stopOnEntry=="string")return(0,nu.resolve)(e.cwd,e.stopOnEntry);if(e.program)return(0,nu.resolve)(e.cwd,e.program);for(let t of Ou(e.args)){if(t.startsWith("-"))continue;let n=(0,nu.resolve)(e.cwd,t);if(await r.exists(n))return n}},ru=class extends ii{constructor(t,n,i,o,s,a,c,u,l){super(t,n,l,u);this.bpPredictor=i;this.launchers=o;this.restarters=s;this.fsUtils=a;this.packageJson=c}resolveParams(t){let n;if(t.type==="pwa-node"&&t.request==="launch"?n={...t}:"server"in t&&t.server&&"program"in t.server&&(n={...t.server}),!!n)return nO(n),n}async launchProgram(t){t.params.program&&(t.params.program=await this.tryGetCompiledFile(t.params.program)),this.attachSimplePort=await this.getSimpleAttachPortIfAny(t.params);let n=async i=>{this.program&&this.program.stop();let o=await this.resolveNodePath(t.params,t.params.runtimeExecutable||void 0),s=o.warning;s&&t.context.dap.output({category:"stderr",output:s.message});let a=new mH,c=await this.resolveEnvironment(t,o,{fileCallback:a.path});this.attachSimplePort?(t.params.attachSimplePort||t.context.dap.output({category:"stderr",output:"Using legacy attach mode for --inspect-brk in npm scripts. We recommend removing --inspect-brk, and using `stopOnEntry` in your launch.json if you need it."}),c=c.merge({NODE_OPTIONS:null})):c=D1(o,c);let u={...t.params,env:c.value},l="--experimental-network-inspection";t.params.experimentalNetworking==="off"||(o.has(2)||t.params.experimentalNetworking==="on")&&(u.runtimeArgs=[l,...u.runtimeArgs]);let p=this.launchers.find(f=>f.canLaunch(u));if(!p)throw new Error("Cannot find an appropriate launcher for the given set of options");let d=await p.launchProgram(o.path,u,t.context);if(this.attachSimplePort){let f=await si.attach({ipcAddress:t.serverAddress,scriptName:"Remote Process",inspectorURL:await kc(`http://127.0.0.1:${this.attachSimplePort}`,t.context.cancellationToken,this.logger),waitForDebugger:!0,dynamicAttach:!0});d=new uH(d,new To(f))}else a.read().then(f=>{f&&d.gotTelemetery(f)});this.program=d,d.stopped.then(async f=>{if(a.dispose(),this.program!==d)return;if(f.killed||f.code===0){this.onProgramTerminated(f);return}let h=i.next();if(!h){this.onProgramTerminated(f);return}await ue(h.delay),this.program===d&&n(h)})};return n(this.restarters.create(t.params.restart))}async getSimpleAttachPortIfAny(t){if(t.attachSimplePort)return t.attachSimplePort;let n=M1(t.runtimeExecutable,t.runtimeArgs);if(!(!n||!(await this.packageJson.getContents())?.scripts?.[n]?.includes("--inspect-brk")))return t.port??9229}createLifecycle(t,n,{targetId:i}){return{initialized:async()=>{if(this.attachSimplePort&&await this.gatherTelemetryFromCdp(t,n),!n.params.stopOnEntry)return;let o=await fJ(this.fsUtils,n.params);if(!o){this.logger.warn("runtime","Could not resolve program entrypointfrom args");return}let s="(?:entryBreakpoint){0}",a=He(o),c=Sr(a)+s,u=await t.Debugger.setBreakpointByUrl({urlRegex:c,lineNumber:0,columnNumber:0});return u?.breakpointId?{cdpId:u?.breakpointId,path:a}:void 0},close:()=>{let o=Number(i);if(o>0)try{process.kill(o)}catch{}}}}async tryGetCompiledFile(t){t=Xe(t);let n=(0,nu.extname)(t);if(!n||n===".js")return t;let i=await this.bpPredictor.getPredictionForSource(t);if(!i||i.size===0)return t;let o=ma(i.values());return o?(this.logger.info("runtime.launch","Updating entrypoint to compiled file",{from:t,to:o.compiledPath,candidates:i.size}),o.compiledPath):t}};ru=E([(0,vr.injectable)(),g(0,(0,vr.inject)(Co)),g(1,(0,vr.inject)(U)),g(2,(0,vr.inject)(ns)),g(3,(0,vr.multiInject)(fp)),g(4,(0,vr.inject)(ai)),g(5,(0,vr.inject)(Jt)),g(6,(0,vr.inject)(Bs)),g(7,(0,vr.inject)(dn)),g(8,(0,vr.inject)(Mr))],ru);var ou=_(H("fs")),aO=H("fs"),gH=_(q()),cO=_(H("os")),st=_(H("path"));var uO=Symbol("INvmResolver");var iu=class{constructor(e=new Qr(aO.promises),t=process.env,n=process.arch,i=process.platform,o=cO.homedir()){this.fsUtils=e;this.env=t;this.arch=n;this.platform=i;this.homedir=o}async resolveNvmVersionPath(e){let t,n=[],i=this.parseVersionString(e),o=this.env.NVS_HOME;if(!o){let s=this.platform==="win32"?st.join(this.env.LOCALAPPDATA||"","nvs"):st.join(this.env.HOME||"",".nvs");ou.existsSync(s)&&(o=s)}if(i.nvsFormat||o){if(t=await this.resolveNvs(o,i),!t&&i.nvsFormat)throw new T(by(e,"nvs"));n.push("nvs")}if(!t)if(this.platform==="win32")this.env.NVM_HOME&&(t=await this.resolveWindowsNvm(e),n.push("nvm-windows"));else{let s=this.env.NVM_DIR||st.join(this.homedir,".nvm");await this.fsUtils.exists(s)&&(t=await this.resolveUnixNvm(e),n.push("nvm"))}if(!t){let s=this.platform==="win32"?this.env.FNM_DIR||st.join(this.env.APPDATA||"","fnm"):this.env.FNM_DIR||st.join(this.homedir,".fnm");await this.fsUtils.exists(s)&&(t=await this.resolveFnm(e,s),n.push("fnm"))}if(!n.length)throw new T(yy());if(!t||!await this.fsUtils.exists(t))throw new T(by(e,n.join("/")));return{directory:t,binary:await this.getBinaryInFolder(t)}}async getBinaryInFolder(e){return await Qs(["node64.exe","node64"].map(t=>this.fsUtils.exists(st.join(e,t))))?"node64":"node"}async resolveNvs(e,{remoteName:t,semanticVersion:n,arch:i}){if(!e)throw new T(ux());let o=this.findBinFolderForVersion(st.join(e,t),n,s=>ou.existsSync(st.join(s,i)));if(o)return this.platform!=="win32"?st.join(o,i,"bin"):st.join(o,i)}async resolveUnixNvm(e){let t=this.env.NVM_DIR;if(!t){let i=st.join(this.env.HOME||"",".nvm");await this.fsUtils.exists(i)&&(t=i)}if(!t)throw new T(yy());let n=this.findBinFolderForVersion(st.join(t,"versions","node"),`v${e}`);return n?st.join(n,"bin"):void 0}async resolveWindowsNvm(e){let t=this.env.NVM_HOME;if(!t)throw new T(lx());return this.findBinFolderForVersion(t,`v${e}`)}async resolveFnm(e,t){let n=this.findBinFolderForVersion(st.join(t,"node-versions"),`v${e}`);if(n)return this.platform==="win32"?st.join(n,"installation"):st.join(n,"installation","bin")}findBinFolderForVersion(e,t,n){if(!ou.existsSync(e))return;let i=ou.readdirSync(e);if(i.includes(t))return st.join(e,t);let o=i.filter(s=>s.startsWith(`${t}.`)).sort(hJ).filter(s=>n?n(st.join(e,s)):!0).pop();return o?st.join(e,o):void 0}parseVersionString(e){let n=/^(([\w-]+)\/)?(v?(\d+(\.\d+(\.\d+)?)?))(\/((x86)|(32)|((x)?64)|(arm\w*)|(ppc\w*)))?$/i.exec(e);if(!n)throw new Error("Invalid version string: "+e);let i=!!(n[2]||n[8]),o=n[2]||"node",s=n[4]||"",a=mJ(n[8]||this.arch);return{nvsFormat:i,remoteName:o,semanticVersion:s,arch:a}}};iu=E([(0,gH.injectable)(),g(0,(0,gH.inject)(Jt))],iu);var hJ=(r,e)=>{let t=/([0-9]+)\.([0-9]+)\.([0-9]+)/.exec(r),n=/([0-9]+)\.([0-9]+)\.([0-9]+)/.exec(e);if(!t||!n)return(n?-1:0)+(t?1:0);let[,i,o,s]=t,[,a,c,u]=n;return Number(i)-Number(a)||Number(o)-Number(c)||Number(s)-Number(u)};function mJ(r){switch(r){case"32":case"x86":case"ia32":return"x86";case"64":case"x64":case"amd64":return"x64";case"arm":let e=process.config.variables.arm_version;return e?"armv"+e+"l":"arm";default:return r}}var lO=H("child_process"),bH=_(q());var su=class{constructor(e){this.logger=e}canLaunch(e){return e.console==="internalConsole"}async launchProgram(e,t,n){let{executable:i,args:o,shell:s,cwd:a}=rp(e,HH(t),t.cwd);n.dap.output({category:"console",output:[i,...o].join(" ")+`
`});let c=(0,lO.spawn)(i,o,{shell:s,cwd:a,env:yt.merge(yt.processEnv(),t.env).defined()});return t.outputCapture==="console"?this.discardStdio(n.dap,c):this.captureStdio(n.dap,c),new lH(c,this.logger,t.killBehavior)}captureStdio(e,t){t.stdout.pipe(new yH).on("data",n=>e.output({category:"stdout",output:n.toString()})).resume(),t.stderr.pipe(new yH).on("data",n=>e.output({category:"stderr",output:n.toString()})).resume()}discardStdio(e,t){let n=[],i=()=>{n&&e.output({category:"stderr",output:Buffer.concat(n).toString()})},o=Buffer.from("Debugger attached."),s=a=>{a.includes(o)?(n=void 0,t.stderr.removeListener("data",s)):n&&n.push(a)};t.stderr.on("data",s),t.on("error",a=>{i(),e.output({category:"stderr",output:a.stack||a.message})}),t.on("exit",a=>{a!==null&&a>0&&(i(),e.output({category:"stderr",output:`Process exited with code ${a}\r
`}))}),t.stdout.resume(),t.stderr.resume()}};su=E([(0,bH.injectable)(),g(0,(0,bH.inject)(U))],su);var yH=class extends wo{constructor(){super(3);this.etxSpotted=!1;this.splitSuffix=Buffer.from(`
`)}_transform(t,n,i){return!this.etxSpotted&&t.includes(3)&&(this.etxSpotted=!0),this.etxSpotted?super._transform(t,n,i):(this.push(t),i())}};var vH=_(q());var au=class{constructor(e){this.logger=e}canLaunch(e){return e.internalConsoleOptions,e.console!=="internalConsole"}async launchProgram(e,t,n){let i={kind:t.console==="integratedTerminal"?"integrated":"external",title:t.name,cwd:t.cwd,args:[e,...HH(t)],env:Js(t.env),argsCanBeInterpretedByShell:!Array.isArray(t.args)},o;try{o=await this.sendLaunchRequest(i,n)}catch(s){throw new T(px(s.message))}return new zc(o,this.logger,t.killBehavior)}sendLaunchRequest(e,t){return t.dap.runInTerminalRequest(e)}};au=E([(0,vH.injectable)(),g(0,(0,vH.inject)(U))],au);var pO=_(q());var cu=class{getTreatment(e,t){return Promise.resolve(t)}};cu=E([(0,pO.injectable)()],cu);var dO=_(q());var Vs=class{constructor(){this.flushEmitter=new C;this.onFlush=this.flushEmitter.event}report(){}reportOperation(){}attachDap(){}flush(){this.flushEmitter.fire()}dispose(){}};Vs=E([(0,dO.injectable)()],Vs);var fO=r=>{},hO=r=>{};var HO=(r,e,t,n)=>{let i=new AH.Container;return i.parent=r,i.bind(de).toConstantValue(e.launchConfig),i.bind(La).toConstantValue(i),i.bind(Yt).toConstantValue(t),i.bind(Be).toConstantValue(n),i.bind(Zn).toConstantValue(e),i.bind(A1).toConstantValue(e.targetOrigin()),i.bind(Jo).to(xs).inSingletonScope(),i.bind(Hl).to(ro).inSingletonScope(),i.bind(Nn).to(Yo).inSingletonScope(),i.bind(lf).to(Na).inSingletonScope(),i.bind(Yi).toSelf().inSingletonScope(),e.sourcePathResolver&&i.bind(Se).toConstantValue(e.sourcePathResolver),i.bind(bs).toSelf(),i.bind(Ih).toDynamicValue(o=>o.container.get(bs).create()).inSingletonScope(),e.parent()&&(i.bind(ns).to(rs).inSingletonScope(),i.bind(Wn).to(Ma).inSingletonScope()),i.bind(Dt).to(process.env.DA_TEST_DISABLE_TELEMETRY?Vs:Gn).inSingletonScope().onActivation(Ye),i.bind(Dr).toSelf().inSingletonScope(),i.bind(mt).toSelf().inSingletonScope(),i.bind(uo).toSelf().inSingletonScope(),i.bind(Qi).to(ei).inSingletonScope(),i.bind(oo).toSelf().inSingletonScope(),i.bind(pc).to(lc).inSingletonScope(),i.bind(Gf).to(rc).inSingletonScope(),i.bind(Pr).to(Ra).inSingletonScope(),i.bind(gh).to(mc).inSingletonScope(),i.bind(Ji).to($a).inSingletonScope(),i.bind(xf).to(Ka).inSingletonScope().onActivation(Ye),i.bind(gt).toSelf(),i.bind(fr).toSelf(),i.bind(hr).toSelf(),i.bind(Sh).to(wi).inSingletonScope(),i.bind(Eh).to(fc).inSingletonScope(),i.bind(qf).to(ec).inSingletonScope().onActivation(Ye),i},gO=r=>{let e=new AH.Container;e.parent=r,e.bind(La).toConstantValue(e),e.bind(U).to(Wr).inSingletonScope().onActivation(Ye),e.bind(Jo).to(xs).inSingletonScope(),e.bind(Dt).to(process.env.DA_TEST_DISABLE_TELEMETRY?Vs:Gn).inSingletonScope().onActivation(Ye),e.bind(Un).to(Un).inSingletonScope(),e.bind(gi).to(gi).inSingletonScope(),e.bind(Pc).to(xc).inSingletonScope(),e.bind(Da).to(Rc).inSingletonScope(),e.bind(Co).to(Xc),e.bind(ni).toSelf().inSingletonScope().onActivation(Ye),e.bind(ai).toSelf(),e.bind(qt).to(fn).onActivation(Ye),e.bind(qt).to(Jc).onActivation(Ye),e.bind(qt).to(Yc).onActivation(Ye),e.bind(qt).to(ru).onActivation(Ye),e.bind(fp).to(su),e.bind(fp).to(au),e.bind(Bs).to(Kc).inSingletonScope(),hO(e),e.bind(qt).to(eu).onActivation(Ye),e.bind(ks).toSelf().inSingletonScope().onActivation(Ye),e.bind(qt).toService(ks),e.bind(qt).to(Nc).inSingletonScope().onActivation(Ye),e.bind(qt).to(Fc).inSingletonScope().onActivation(Ye),e.bind(qt).to(Bc).inSingletonScope().onActivation(Ye),e.bind(qt).to(Uc).inSingletonScope().onActivation(Ye),e.bind(qt).to(qr).onActivation(Ye),e.bind(qt).toDynamicValue(()=>r.get(Ns).createLauncher(e.get(U))).inSingletonScope(),e.isBound(il)||e.bind(il).to(Hc).inSingletonScope(),e.bind(Qy).to(Ga).inSingletonScope().onActivation(Ye);let t=n=>i=>new n(i.container.get(Ey),i.container.get($e),i.container.get(xy));return e.bind(Zo).toDynamicValue(t(_H.ChromeBrowserFinder)).inSingletonScope().whenTargetTagged("browser","chrome"),e.bind(Zo).toDynamicValue(t(_H.EdgeBrowserFinder)).inSingletonScope().whenTargetTagged("browser","edge"),e},yO=r=>{let e=new AH.Container;return e.bind(La).toConstantValue(e),e.bind(Ns).toSelf().inSingletonScope(),e.bind(jc).toSelf().inSingletonScope(),e.bind(_f).to(cu).inSingletonScope(),e.bind(Ex).toConstantValue(new ti),e.bind(iR).to(Lc).inSingletonScope(),e.bind(Bn).toConstantValue(r.storagePath),e.bind(Qo).toConstantValue(r.isVsCode),e.bind(uO).to(iu),e.bind(Mr).to(Za).inSingletonScope(),e.bind(Ey).toConstantValue(process.env),e.bind(xy).toConstantValue(mO.default),e.bind($e).toConstantValue(IH.promises),e.bind(Jt).toConstantValue(new Qr(IH.promises)),e.bind(Hi).toConstantValue(r.isRemote?"remote":"local"),r.context&&e.bind(Sx).toConstantValue(r.context),fO(e),e},bO=(r,e,t)=>{r.bind(Pl).toConstantValue(jC(e)),r.bind(de).toService(Pl),r.bind(dn).to(Vc).inSingletonScope(),r.bind(Ea).toConstantValue(t),r.bind(Se).toDynamicValue(n=>n.container.get(dn).create(e,n.container.get(U))).inSingletonScope(),r.bind(Jt).toConstantValue(ed.create(e.__remoteFilePrefix,IH.promises,t)),r.bind(wy).to(Xi).inSingletonScope().onActivation(Ye),r.bind(zi).to(xa).inSingletonScope(),r.bind(Fe).toSelf().inSingletonScope().onActivation(Ye),r.bind(Nn).to(Yo).inSingletonScope(),r.bind(ts).toSelf().inSingletonScope(),r.bind(ns).to(rs).inSingletonScope(),r.bind(Wn).to(Ta).inSingletonScope()};var wH=_(H("path"));function IO(r,e,t){let n=vO(r,e,"uncaughtException",t),i=vO(r,e,"unhandledRejection",t);return process.addListener("uncaughtException",n),process.addListener("unhandledRejection",i),{dispose:()=>{process.removeListener("uncaughtException",n),process.removeListener("unhandledRejection",i)}}}var vO=(r,e,t,n=!0)=>i=>{yJ(i)&&(e.report("error",{"!error":i,error:n?void 0:i,exceptionType:t}),r.error("runtime.exception","Unhandled error in debug adapter",i))},HJ=r=>typeof r=="object"&&!!r&&"stack"in r,gJ=wH.dirname(wH.dirname(wH.dirname(__dirname)));function yJ(r){return!_O||HJ(r)&&!!r.stack?.includes(gJ)}var _O=!1;function AO(){_O=!0}var SH=class{constructor(e,t,n,i){this._delegate=e;this._rootServices=n;this._disposables=new Ae;this._serviceTree=new WeakMap;this._root=new qs(void 0);this.getLaunchers=ne(()=>{let e=new Set(this._rootServices.getAll(qt));for(let t of e)this._disposables.push(t.onTargetListChanged(()=>{let n=this.targetList();this._attachToNewTargets(n,t),this._terminateOrphanThreads(n)}));return e});this._dap=t.dap(),this._targetOrigin=i,this._disposables.callback(()=>ef(n)),this._disposables.push(IO(n.get(U),n.get(Dt),n.get(Qo))),t.attachTelemetry(n.get(Dt));let o=this._dap,s=0,a;o.on("initialize",async c=>{this._rootServices.bind(Ct).toConstantValue(c);let u=_s.capabilities();return c.clientID==="vscode"&&AO(),setTimeout(()=>o.initialized({}),0),u}),o.on("setExceptionBreakpoints",async()=>({})),o.on("setBreakpoints",async c=>(c.breakpoints?.length&&n.get(Fe).notifyHadBreakpoint(),{breakpoints:c.breakpoints?.map(()=>({id:++s,verified:!1,message:wO.t("Unbound breakpoint")}))??[]})),o.on("configurationDone",async()=>({})),o.on("threads",async()=>({threads:[]})),o.on("loadedSources",async()=>({sources:[]})),o.on("breakpointLocations",()=>Promise.resolve({breakpoints:[]})),o.on("attach",async c=>(await this.boot(c,o),{})),o.on("launch",async c=>(await this.boot(c,o),{})),o.on("pause",async()=>({})),o.on("terminate",()=>this._terminateRoot(!0)),o.on("disconnect",c=>this._disconnectRoot(c)),o.on("restart",async({arguments:c})=>(await this._restart(c),{})),o.on("startSelfProfile",async({file:c})=>(a?.dispose(),a=new xh(c),await a.start(),{})),o.on("stopSelfProfile",async()=>(a&&(await a.stop(),a.dispose(),a=void 0),{}))}async _terminateRoot(e){return this._root.state=1,await Promise.all([...this.getLaunchers()].map(t=>t.terminate(e))),await this._root.waitUntilChildrenAre(2),this._root.state=2,{}}async _disconnectRoot(e){return this._root.state<1&&await this._terminateRoot(e.terminateDebuggee),this._rootServices.get(Dt).flush(),await this._root.waitUntilChildrenAre(3),this._root.state=3,{}}async boot(e,t){return this._boot(_a(e,this._rootServices.get(Hi)),t)}async _boot(e,t){bJ(t),this.reportBootTelemetry(e),bO(this._rootServices,e,t),this._rootServices.get(U).setup(Q_(t,e.trace));let n=e.timeout>0?ut.withTimeout(e.timeout):new ut;e.rootPath&&(e.rootPath=on(e.rootPath)),this._launchParams=e;let i=await Promise.all([...this.getLaunchers()].map(o=>this._launch(o,e,n.token)));return Promise.all(i.map(o=>o.terminated)).then(o=>{let s=o.find(It);this._markTargetAsTerminated(this._root,{restart:!!s?.restart})}),{}}reportBootTelemetry(e){let t=_a({type:e.type,request:e.request,name:"<string>",__workspaceFolder:"<workspace>"}),n=(i,o)=>typeof i=="string"?o&&t[o]===i?i:"<string>":i instanceof Array?i.map(s=>n(s)):i&&typeof i=="object"?ci(i,s=>n(s)):i;this._rootServices.get(Dt).report("launch",{type:e.type,request:e.request,os:`${EH.platform()} ${EH.arch()}`,nodeVersion:process.version,adapterVersion:Vu,parameters:ci(e,n)})}async _restart(e){let t;if(e){let n=this._rootServices.get(Pl);t=_a({__workspaceFolder:n.__workspaceFolder,...e},this._rootServices.get(Hi)),n.update(t)}await Promise.all([...this.getLaunchers()].map(n=>n.restart(t)))}async _launch(e,t,n){return(await this.captureLaunch(e,t,n)).blockSessionTermination?{terminated:new Promise(o=>{let s=this._disposables.push(e.onTerminated(a=>{s.dispose(),o(a)}))})}:{terminated:Promise.resolve(void 0)}}async captureLaunch(e,t,n){let i=e.constructor.name,o;try{o=await e.launch(t,{telemetryReporter:this._rootServices.get(Dt),cancellationToken:n,targetOrigin:this._targetOrigin,dap:this._dap})}catch(s){throw this._rootServices.get(U).warn("runtime.launch","Launch returned error",{error:s,wasCancelled:n.isCancellationRequested,name:i}),s}return o.blockSessionTermination&&this._rootServices.get(U).info("runtime.launch","Launched successfully",{name:i}),o}dispose(){this._disposables.dispose(),this._terminateOrphanThreads([])}targetList(){let e=[];for(let t of this.getLaunchers())e.push(...t.targetList());return e}async attach(e,t){if(!this._launchParams)throw new Error("Cannot launch before params have been set");let n=e.value;if(!n.canAttach())return;let i=await n.attach();if(!i)return;let o=await this._delegate.acquireDap(n),s=o.dap(),a=this._launchParams;this._asyncStackPolicy||(this._asyncStackPolicy=FC(a.showAsyncStacks));let c=n.parent(),u=c&&this._serviceTree.get(c)||this._rootServices,l=HO(u,n,s,i);o.attachTelemetry(l.get(Dt)),this._serviceTree.set(n,u);let p=new _s(s,this._asyncStackPolicy,a,l),d=p.createThread(i,n);"inspectUri"in a&&!!a.inspectUri&&this.attachDotnetDebuggerEvent(i,this._rootServices.get(Dt),this._rootServices.get(Qo));let h=async()=>(await p.launchBlocker(),n.runIfWaitingForDebugger(),e.threadData.resolve({thread:d,debugAdapter:p}),{});s.on("disconnect",m=>this._disconnectTarget(e,m)),s.on("terminate",()=>this._terminateTarget(e)),s.on("restart",async()=>(n.canRestart()?n.restart():await this._restart(),Promise.resolve({}))),await this._delegate.initAdapter(p,n,t)?h():(s.on("attach",h),s.on("launch",h)),await n.afterBind()}attachDotnetDebuggerEvent(e,t,n){e.DotnetDebugger.on("reportBlazorDebugError",i=>{t.report("blazorDebugError",{exceptionType:i.exceptionType,"!error":i.error,error:n?void 0:i.error})})}_attachToNewTargets(e,t){for(let n of e.values()){if(!n.waitingForDebugger()||qs.targetNodes.has(n))continue;let i=n.parent(),o=i?qs.targetNodes.get(i):this._root;if(!o)throw new Error(`Got target with unknown parent: ${n.name()}`);let s=new qs(n);o.add(s),this.attach(s,t)}}async _terminateOrphanThreads(e,t){let n=[...this._root.all()].filter(i=>!e.includes(i.value));return Promise.all(n.map(i=>this._markTargetAsTerminated(i,t)))}async _markTargetAsTerminated(e,t={}){if(e.state>=1)return await e.waitUntil(2),{};if(e.state=1,SO(e)){let n=await e.threadData.promise;await n.thread.dispose(),n.debugAdapter.dap.terminated(t),n.debugAdapter.dispose()}else this._dap.terminated(t);return await e.waitUntilChildrenAre(2),e.state=2,{}}async _terminateTarget(e){return e.state>=3?{}:(e.value.canStop()?e.value.stop():this._terminateRoot(!0),await e.waitUntil(2),{})}async _disconnectTarget(e,t){if(e.state>=3)return{};e.state<1&&(t.terminateDebuggee!==!0&&e.value.canDetach()?await e.value.detach():e.value.canStop()?e.value.stop():this._terminateRoot(t.terminateDebuggee)),await e.waitUntil(2),await e.waitUntilChildrenAre(3),e.state=3,queueMicrotask(()=>this._delegate.releaseDap(e.value));let n=e.value.parent();return(n?qs.targetNodes.get(n):this._root)?.remove(e),{}}};function bJ(r){nx&&r.output({category:"console",output:`Note: Using the "preview" debug extension
`})}var SO=r=>!!r.value,qs=class r{constructor(e){this.value=e;this.threadData=ge();this._state=0;this._children=new Set;this._stateChangeEmitter=new C;e&&r.targetNodes.set(e,this)}static{this.targetNodes=new WeakMap}get state(){return this._state}set state(e){e>this._state&&(this._state=e,this._stateChangeEmitter.fire(e))}add(e){this._children.add(e)}remove(e){this._children.delete(e)}async waitUntil(e){return this._state>=e?Promise.resolve():new Promise(t=>{let n=this._stateChangeEmitter.event(i=>{i>=e&&(n.dispose(),t())})})}async waitUntilChildrenAre(e){await Promise.all([...this._children].map(t=>t.waitUntil(e)))}*all(){SO(this)&&(yield this);for(let e of this._children)yield*e.all()}};var EO=`\r
\r
`,vJ=0,xH=class{constructor(e,t,n){this.inputStream=e;this.outputStream=t;this._contentLength=-1;this._connectionId=vJ++;this.msgEmitter=new C;this.messageReceived=this.msgEmitter.event;this.endedEmitter=new C;this.closed=this.endedEmitter.event;this._handleData=e=>{let t=new Rr;for(this._rawData=Buffer.concat([this._rawData,e]);;){if(this._contentLength>=0){if(this._rawData.length>=this._contentLength){let n=this._rawData.toString("utf8",0,this._contentLength);if(this._rawData=this._rawData.slice(this._contentLength),this._contentLength=-1,n.length>0)try{let i=JSON.parse(n);this.logger?.verbose("dap.receive",void 0,{connectionId:this._connectionId,message:i}),this.msgEmitter.fire({message:i,receivedTime:t})}catch(i){console.error("Error handling data: "+(i&&i.message))}continue}}else{let n=this._rawData.indexOf(EO);if(n!==-1){let o=this._rawData.toString("utf8",0,n).split(`\r
`);for(let s=0;s<o.length;s++){let a=o[s].split(/: +/);a[0]==="Content-Length"&&(this._contentLength=+a[1])}this._rawData=this._rawData.slice(n+EO.length);continue}}break}};this.logger=n,this._rawData=Buffer.alloc(0),e.on("end",()=>this.endedEmitter.fire()),e.on("data",this._handleData)}send(e,t=!0,n){let i=JSON.stringify(e);if(t){let s=e;e.type==="response"&&e.command==="source"&&(s={...e,body:{...e.body,content:"<script source>"}}),this.logger?.verbose("dap.send",void 0,{connectionId:this._connectionId,message:s})}let o=`Content-Length: ${Buffer.byteLength(i,"utf8")}\r
\r
${i}`;if(this.outputStream.destroyed){this.logger?.warn("dap.send","Message not sent. Connection was closed."),n?.();return}this.outputStream.write(o,"utf8",s=>{n?.(),s&&(console.log(e),this.logger?.error("dap.send","Error while writing to output stream",s),this.close())})}close(){this.inputStream.destroy(),this.outputStream.destroy()}setLogger(e){return this.logger=e,this}};process.env.L10N_FSPATH_TO_BUNDLE&&PH.config({fsPath:process.env.L10N_FSPATH_TO_BUNDLE});var IJ=PO.mkdtempSync(LH.join($O.tmpdir(),"vscode-js-debug-"));function _J(r){let e,t=[],n=[],i=[],o=ge(),s=0,a;return r.on("setBreakpoints",async c=>{let u=c.breakpoints?.map(()=>++s)??[];return t.push({params:c,ids:u}),{breakpoints:u.map(p=>({id:p,verified:!1,message:PH.t("breakpoint.provisionalBreakpoint","Unbound breakpoint")}))}}),r.on("setExceptionBreakpoints",async c=>(e=c,{})),r.on("setCustomBreakpoints",async c=>(n=c.ids,i=c.xhr,{})),r.on("configurationDone",async()=>(o.resolve(),{})),r.on("threads",async()=>({threads:[]})),r.on("loadedSources",async()=>({sources:[]})),r.on("initialize",async c=>(a=c,setTimeout(()=>r.initialized({}),0),_s.capabilities())),new Promise(c=>{let u=async l=>{await o.promise;let p=ge();if(!a)throw new Error("cannot call launch/attach before initialize");return c({initializeParams:a,setExceptionBreakpointsParams:e,setBreakpointsParams:t,customBreakpoints:n,xhrBreakpoints:i,launchParams:l,deferred:p}),p.promise};r.on("launch",l=>u(l)),r.on("attach",u)})}var L_=class{constructor(e,t){this.dapRoot=e;this.services=t;this.sessions=new Map}async acquireDap(e){let t=this.sessions.get(e.id());if(t){let{connection:s}=await t.promise;return s}let n=e.parent(),i;if(n){let s=this.sessions.get(n.id())?.settledValue;if(!s)throw new Error("Expected parent session to have a settled value");i=s.connection.dap()}else i=this.dapRoot;let o=ge();return this.sessions.set(e.id(),o),i.startDebuggingRequest({request:e.launchConfig.request,configuration:{type:e.launchConfig.type,name:e.name(),__pendingTargetId:e.id()}}).catch(s=>o.reject(s)),o.promise.then(s=>s.connection)}async initAdapter(e,t){let n=this.sessions.get(t.id())?.settledValue;if(!n)throw new Error(`Expected to find pending init for target ${t.id()}`);n.setExceptionBreakpointsParams&&await e.setExceptionBreakpoints(n.setExceptionBreakpointsParams);for(let{params:i,ids:o}of n.setBreakpointsParams)await e.breakpointManager.setBreakpoints(i,o);return await e.setCustomBreakpoints({xhr:n.xhrBreakpoints,ids:n.customBreakpoints}),await e.onInitialize(n.initializeParams),await e.configurationDone(),await e.launchBlocker(),n.deferred.resolve({}),!0}releaseDap(e){this.sessions.delete(e.id())}hasPendingTarget(e){return this.sessions.get(e)?.hasSettled()===!1}handleConnection(e){if(!("__pendingTargetId"in e.launchParams)||!e.launchParams.__pendingTargetId)throw new Error("Incoming session is missing __pendingTargetId");let t=e.launchParams.__pendingTargetId,n=this.sessions.get(t);if(!n)throw new Error(`__pendingTargetId ${t} not found`);n.resolve(e)}};function xO(r){let e=yO({storagePath:IJ,isVsCode:!1}),t=new Set,n=LO.createServer(async i=>{try{let o=new Gc,s=new xH(i,i,o),a=new Ku(s,o),c=a.dap(),u=await _J(c);if("__pendingTargetId"in u.launchParams){let l=u.launchParams.__pendingTargetId,p=l&&[...t].find(d=>d.hasPendingTarget(l));if(!p)throw new Error(`Cannot find pending target for ${l}`);o.connectTo(p.services.get(U)),p.handleConnection({...u,connection:a})}else{let l=gO(e),p=new L_(c,l);t.add(p),l.bind(Ct).toConstantValue(u.initializeParams),o.connectTo(l.get(U));let d=new SH(p,a,l,new rH("targetOrigin"));s.closed(()=>{d.dispose(),t.delete(p)}),u.deferred.resolve(await d.boot(u.launchParams,c))}}catch(o){return console.error(o),i.destroy()}}).on("error",i=>{console.error(i),process.exit(1)}).listen(r,()=>{let i=n.address();console.log(`Debug server listening at ${typeof i=="string"?i:`${i.address}:${i.port}`}`)})}var[,AJ,P_="8123",wJ="localhost"]=process.argv;process.argv.includes("--help")?console.log(`Usage: ${LH.basename(AJ)} [port|socket path=8123] [host=localhost]`):isNaN(Number(P_))?xO({path:P_}):xO({port:Number(P_),host:wJ});})();
/*! Bundled license information:
reflect-metadata/Reflect.js:
(*! *****************************************************************************
Copyright (C) Microsoft. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** *)
is-number/index.js:
(*!
* is-number <https://github.com/jonschlinkert/is-number>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*)
to-regex-range/index.js:
(*!
* to-regex-range <https://github.com/micromatch/to-regex-range>
*
* Copyright (c) 2015-present, Jon Schlinkert.
* Released under the MIT License.
*)
fill-range/index.js:
(*!
* fill-range <https://github.com/jonschlinkert/fill-range>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Licensed under the MIT License.
*)
normalize-path/index.js:
(*!
* normalize-path <https://github.com/jonschlinkert/normalize-path>
*
* Copyright (c) 2014-2018, Jon Schlinkert.
* Released under the MIT License.
*)
is-extglob/index.js:
(*!
* is-extglob <https://github.com/jonschlinkert/is-extglob>
*
* Copyright (c) 2014-2016, Jon Schlinkert.
* Licensed under the MIT License.
*)
is-glob/index.js:
(*!
* is-glob <https://github.com/jonschlinkert/is-glob>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*)
is-windows/index.js:
(*!
* is-windows <https://github.com/jonschlinkert/is-windows>
*
* Copyright © 2015-2018, Jon Schlinkert.
* Released under the MIT License.
*)
*/