sliccy 1.22.2 → 1.22.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{g as aI,K as kQ,L as MQ,A as GQ}from"./index-Xfgq0sxD.js";import{h as NQ,c as mQ,s as UQ}from"./stream-lEC9OYG2.js";import{r as rA}from"./___vite-browser-external_commonjs-proxy-BaP7fEvT.js";function LQ(h,d){for(var w=0;w<d.length;w++){const s=d[w];if(typeof s!="string"&&!Array.isArray(s)){for(const F in s)if(F!=="default"&&!(F in h)){const C=Object.getOwnPropertyDescriptor(s,F);C&&Object.defineProperty(h,F,C.get?C:{enumerable:!0,get:()=>s[F]})}}}return Object.freeze(Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}))}var XA={};const De=aI(NQ),ce=aI(mQ);var lI,CC;function JQ(){if(CC)return lI;CC=1;const h=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,w=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new C}abort(o=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||o,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},s=typeof AbortSignal=="function",F=typeof w.AbortSignal=="function",C=s?AbortSignal:F?w.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(o){o.type==="abort"&&(this.aborted=!0,this.onabort(o),this._listeners.forEach(u=>u(o),this))}onabort(){}addEventListener(o,u){o==="abort"&&this._listeners.push(u)}removeEventListener(o,u){o==="abort"&&(this._listeners=this._listeners.filter(D=>D!==u))}},n=new Set,c=(a,o)=>{const u=`LRU_CACHE_OPTION_${a}`;I(u)&&g(u,`${a} option`,`options.${o}`,r)},E=(a,o)=>{const u=`LRU_CACHE_METHOD_${a}`;if(I(u)){const{prototype:D}=r,{get:f}=Object.getOwnPropertyDescriptor(D,a);g(u,`${a} method`,`cache.${o}()`,f)}},A=(a,o)=>{const u=`LRU_CACHE_PROPERTY_${a}`;if(I(u)){const{prototype:D}=r,{get:f}=Object.getOwnPropertyDescriptor(D,a);g(u,`${a} property`,`cache.${o}`,f)}},e=(...a)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...a):console.error(...a)},I=a=>!n.has(a),g=(a,o,u,D)=>{n.add(a);const f=`The ${o} is deprecated. Please use ${u} instead.`;e(f,"DeprecationWarning",a,D)},i=a=>a&&a===Math.floor(a)&&a>0&&isFinite(a),Q=a=>i(a)?a<=Math.pow(2,8)?Uint8Array:a<=Math.pow(2,16)?Uint16Array:a<=Math.pow(2,32)?Uint32Array:a<=Number.MAX_SAFE_INTEGER?B:null:null;class B extends Array{constructor(o){super(o),this.fill(0)}}class t{constructor(o){if(o===0)return[];const u=Q(o);this.heap=new u(o),this.length=0}push(o){this.heap[this.length++]=o}pop(){return this.heap[--this.length]}}class r{constructor(o={}){const{max:u=0,ttl:D,ttlResolution:f=1,ttlAutopurge:y,updateAgeOnGet:p,updateAgeOnHas:S,allowStale:R,dispose:N,disposeAfter:U,noDisposeOnSet:J,noUpdateTTL:x,maxSize:X=0,maxEntrySize:CA=0,sizeCalculation:z,fetchMethod:_,fetchContext:iA,noDeleteOnFetchRejection:uA,noDeleteOnStaleGet:DA,allowStaleOnFetchRejection:Z,allowStaleOnFetchAbort:RA,ignoreFetchAbort:UA}=o,{length:pA,maxAge:tA,stale:FA}=o instanceof r?{}:o;if(u!==0&&!i(u))throw new TypeError("max option must be a nonnegative integer");const HA=u?Q(u):Array;if(!HA)throw new Error("invalid max value: "+u);if(this.max=u,this.maxSize=X,this.maxEntrySize=CA||this.maxSize,this.sizeCalculation=z||pA,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=_||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=iA,!this.fetchMethod&&iA!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(u).fill(null),this.valList=new Array(u).fill(null),this.next=new HA(u),this.prev=new HA(u),this.head=0,this.tail=0,this.free=new t(u),this.initialFill=1,this.size=0,typeof N=="function"&&(this.dispose=N),typeof U=="function"?(this.disposeAfter=U,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!J,this.noUpdateTTL=!!x,this.noDeleteOnFetchRejection=!!uA,this.allowStaleOnFetchRejection=!!Z,this.allowStaleOnFetchAbort=!!RA,this.ignoreFetchAbort=!!UA,this.maxEntrySize!==0){if(this.maxSize!==0&&!i(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!i(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!R||!!FA,this.noDeleteOnStaleGet=!!DA,this.updateAgeOnGet=!!p,this.updateAgeOnHas=!!S,this.ttlResolution=i(f)||f===0?f:1,this.ttlAutopurge=!!y,this.ttl=D||tA||0,this.ttl){if(!i(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const ZA="LRU_CACHE_UNBOUNDED";I(ZA)&&(n.add(ZA),e("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ZA,r))}FA&&c("stale","allowStale"),tA&&c("maxAge","ttl"),pA&&c("length","sizeCalculation")}getRemainingTTL(o){return this.has(o,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new B(this.max),this.starts=new B(this.max),this.setItemTTL=(D,f,y=h.now())=>{if(this.starts[D]=f!==0?y:0,this.ttls[D]=f,f!==0&&this.ttlAutopurge){const p=setTimeout(()=>{this.isStale(D)&&this.delete(this.keyList[D])},f+1);p.unref&&p.unref()}},this.updateItemAge=D=>{this.starts[D]=this.ttls[D]!==0?h.now():0},this.statusTTL=(D,f)=>{D&&(D.ttl=this.ttls[f],D.start=this.starts[f],D.now=o||u(),D.remainingTTL=D.now+D.ttl-D.start)};let o=0;const u=()=>{const D=h.now();if(this.ttlResolution>0){o=D;const f=setTimeout(()=>o=0,this.ttlResolution);f.unref&&f.unref()}return D};this.getRemainingTTL=D=>{const f=this.keyMap.get(D);return f===void 0?0:this.ttls[f]===0||this.starts[f]===0?1/0:this.starts[f]+this.ttls[f]-(o||u())},this.isStale=D=>this.ttls[D]!==0&&this.starts[D]!==0&&(o||u())-this.starts[D]>this.ttls[D]}updateItemAge(o){}statusTTL(o,u){}setItemTTL(o,u,D){}isStale(o){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new B(this.max),this.removeItemSize=o=>{this.calculatedSize-=this.sizes[o],this.sizes[o]=0},this.requireSize=(o,u,D,f)=>{if(this.isBackgroundFetch(u))return 0;if(!i(D))if(f){if(typeof f!="function")throw new TypeError("sizeCalculation must be a function");if(D=f(u,o),!i(D))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return D},this.addItemSize=(o,u,D)=>{if(this.sizes[o]=u,this.maxSize){const f=this.maxSize-this.sizes[o];for(;this.calculatedSize>f;)this.evict(!0)}this.calculatedSize+=this.sizes[o],D&&(D.entrySize=u,D.totalCalculatedSize=this.calculatedSize)}}removeItemSize(o){}addItemSize(o,u){}requireSize(o,u,D,f){if(D||f)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:o=this.allowStale}={}){if(this.size)for(let u=this.tail;!(!this.isValidIndex(u)||((o||!this.isStale(u))&&(yield u),u===this.head));)u=this.prev[u]}*rindexes({allowStale:o=this.allowStale}={}){if(this.size)for(let u=this.head;!(!this.isValidIndex(u)||((o||!this.isStale(u))&&(yield u),u===this.tail));)u=this.next[u]}isValidIndex(o){return o!==void 0&&this.keyMap.get(this.keyList[o])===o}*entries(){for(const o of this.indexes())this.valList[o]!==void 0&&this.keyList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield[this.keyList[o],this.valList[o]])}*rentries(){for(const o of this.rindexes())this.valList[o]!==void 0&&this.keyList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield[this.keyList[o],this.valList[o]])}*keys(){for(const o of this.indexes())this.keyList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield this.keyList[o])}*rkeys(){for(const o of this.rindexes())this.keyList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield this.keyList[o])}*values(){for(const o of this.indexes())this.valList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield this.valList[o])}*rvalues(){for(const o of this.rindexes())this.valList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield this.valList[o])}[Symbol.iterator](){return this.entries()}find(o,u){for(const D of this.indexes()){const f=this.valList[D],y=this.isBackgroundFetch(f)?f.__staleWhileFetching:f;if(y!==void 0&&o(y,this.keyList[D],this))return this.get(this.keyList[D],u)}}forEach(o,u=this){for(const D of this.indexes()){const f=this.valList[D],y=this.isBackgroundFetch(f)?f.__staleWhileFetching:f;y!==void 0&&o.call(u,y,this.keyList[D],this)}}rforEach(o,u=this){for(const D of this.rindexes()){const f=this.valList[D],y=this.isBackgroundFetch(f)?f.__staleWhileFetching:f;y!==void 0&&o.call(u,y,this.keyList[D],this)}}get prune(){return E("prune","purgeStale"),this.purgeStale}purgeStale(){let o=!1;for(const u of this.rindexes({allowStale:!0}))this.isStale(u)&&(this.delete(this.keyList[u]),o=!0);return o}dump(){const o=[];for(const u of this.indexes({allowStale:!0})){const D=this.keyList[u],f=this.valList[u],y=this.isBackgroundFetch(f)?f.__staleWhileFetching:f;if(y===void 0)continue;const p={value:y};if(this.ttls){p.ttl=this.ttls[u];const S=h.now()-this.starts[u];p.start=Math.floor(Date.now()-S)}this.sizes&&(p.size=this.sizes[u]),o.unshift([D,p])}return o}load(o){this.clear();for(const[u,D]of o){if(D.start){const f=Date.now()-D.start;D.start=h.now()-f}this.set(u,D.value,D)}}dispose(o,u,D){}set(o,u,{ttl:D=this.ttl,start:f,noDisposeOnSet:y=this.noDisposeOnSet,size:p=0,sizeCalculation:S=this.sizeCalculation,noUpdateTTL:R=this.noUpdateTTL,status:N}={}){if(p=this.requireSize(o,u,p,S),this.maxEntrySize&&p>this.maxEntrySize)return N&&(N.set="miss",N.maxEntrySizeExceeded=!0),this.delete(o),this;let U=this.size===0?void 0:this.keyMap.get(o);if(U===void 0)U=this.newIndex(),this.keyList[U]=o,this.valList[U]=u,this.keyMap.set(o,U),this.next[this.tail]=U,this.prev[U]=this.tail,this.tail=U,this.size++,this.addItemSize(U,p,N),N&&(N.set="add"),R=!1;else{this.moveToTail(U);const J=this.valList[U];if(u!==J){if(this.isBackgroundFetch(J)?J.__abortController.abort(new Error("replaced")):y||(this.dispose(J,o,"set"),this.disposeAfter&&this.disposed.push([J,o,"set"])),this.removeItemSize(U),this.valList[U]=u,this.addItemSize(U,p,N),N){N.set="replace";const x=J&&this.isBackgroundFetch(J)?J.__staleWhileFetching:J;x!==void 0&&(N.oldValue=x)}}else N&&(N.set="update")}if(D!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),R||this.setItemTTL(U,D,f),this.statusTTL(N,U),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const o=this.valList[this.head];return this.evict(!0),o}}evict(o){const u=this.head,D=this.keyList[u],f=this.valList[u];return this.isBackgroundFetch(f)?f.__abortController.abort(new Error("evicted")):(this.dispose(f,D,"evict"),this.disposeAfter&&this.disposed.push([f,D,"evict"])),this.removeItemSize(u),o&&(this.keyList[u]=null,this.valList[u]=null,this.free.push(u)),this.head=this.next[u],this.keyMap.delete(D),this.size--,u}has(o,{updateAgeOnHas:u=this.updateAgeOnHas,status:D}={}){const f=this.keyMap.get(o);if(f!==void 0)if(this.isStale(f))D&&(D.has="stale",this.statusTTL(D,f));else return u&&this.updateItemAge(f),D&&(D.has="hit"),this.statusTTL(D,f),!0;else D&&(D.has="miss");return!1}peek(o,{allowStale:u=this.allowStale}={}){const D=this.keyMap.get(o);if(D!==void 0&&(u||!this.isStale(D))){const f=this.valList[D];return this.isBackgroundFetch(f)?f.__staleWhileFetching:f}}backgroundFetch(o,u,D,f){const y=u===void 0?void 0:this.valList[u];if(this.isBackgroundFetch(y))return y;const p=new w;D.signal&&D.signal.addEventListener("abort",()=>p.abort(D.signal.reason));const S={signal:p.signal,options:D,context:f},R=(X,CA=!1)=>{const{aborted:z}=p.signal,_=D.ignoreFetchAbort&&X!==void 0;return D.status&&(z&&!CA?(D.status.fetchAborted=!0,D.status.fetchError=p.signal.reason,_&&(D.status.fetchAbortIgnored=!0)):D.status.fetchResolved=!0),z&&!_&&!CA?U(p.signal.reason):(this.valList[u]===x&&(X===void 0?x.__staleWhileFetching?this.valList[u]=x.__staleWhileFetching:this.delete(o):(D.status&&(D.status.fetchUpdated=!0),this.set(o,X,S.options))),X)},N=X=>(D.status&&(D.status.fetchRejected=!0,D.status.fetchError=X),U(X)),U=X=>{const{aborted:CA}=p.signal,z=CA&&D.allowStaleOnFetchAbort,_=z||D.allowStaleOnFetchRejection,iA=_||D.noDeleteOnFetchRejection;if(this.valList[u]===x&&(!iA||x.__staleWhileFetching===void 0?this.delete(o):z||(this.valList[u]=x.__staleWhileFetching)),_)return D.status&&x.__staleWhileFetching!==void 0&&(D.status.returnedStale=!0),x.__staleWhileFetching;if(x.__returned===x)throw X},J=(X,CA)=>{this.fetchMethod(o,y,S).then(z=>X(z),CA),p.signal.addEventListener("abort",()=>{(!D.ignoreFetchAbort||D.allowStaleOnFetchAbort)&&(X(),D.allowStaleOnFetchAbort&&(X=z=>R(z,!0)))})};D.status&&(D.status.fetchDispatched=!0);const x=new Promise(J).then(R,N);return x.__abortController=p,x.__staleWhileFetching=y,x.__returned=null,u===void 0?(this.set(o,x,{...S.options,status:void 0}),u=this.keyMap.get(o)):this.valList[u]=x,x}isBackgroundFetch(o){return o&&typeof o=="object"&&typeof o.then=="function"&&Object.prototype.hasOwnProperty.call(o,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(o,"__returned")&&(o.__returned===o||o.__returned===null)}async fetch(o,{allowStale:u=this.allowStale,updateAgeOnGet:D=this.updateAgeOnGet,noDeleteOnStaleGet:f=this.noDeleteOnStaleGet,ttl:y=this.ttl,noDisposeOnSet:p=this.noDisposeOnSet,size:S=0,sizeCalculation:R=this.sizeCalculation,noUpdateTTL:N=this.noUpdateTTL,noDeleteOnFetchRejection:U=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:J=this.allowStaleOnFetchRejection,ignoreFetchAbort:x=this.ignoreFetchAbort,allowStaleOnFetchAbort:X=this.allowStaleOnFetchAbort,fetchContext:CA=this.fetchContext,forceRefresh:z=!1,status:_,signal:iA}={}){if(!this.fetchMethod)return _&&(_.fetch="get"),this.get(o,{allowStale:u,updateAgeOnGet:D,noDeleteOnStaleGet:f,status:_});const uA={allowStale:u,updateAgeOnGet:D,noDeleteOnStaleGet:f,ttl:y,noDisposeOnSet:p,size:S,sizeCalculation:R,noUpdateTTL:N,noDeleteOnFetchRejection:U,allowStaleOnFetchRejection:J,allowStaleOnFetchAbort:X,ignoreFetchAbort:x,status:_,signal:iA};let DA=this.keyMap.get(o);if(DA===void 0){_&&(_.fetch="miss");const Z=this.backgroundFetch(o,DA,uA,CA);return Z.__returned=Z}else{const Z=this.valList[DA];if(this.isBackgroundFetch(Z)){const FA=u&&Z.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",FA&&(_.returnedStale=!0)),FA?Z.__staleWhileFetching:Z.__returned=Z}const RA=this.isStale(DA);if(!z&&!RA)return _&&(_.fetch="hit"),this.moveToTail(DA),D&&this.updateItemAge(DA),this.statusTTL(_,DA),Z;const UA=this.backgroundFetch(o,DA,uA,CA),pA=UA.__staleWhileFetching!==void 0,tA=pA&&u;return _&&(_.fetch=pA&&RA?"stale":"refresh",tA&&RA&&(_.returnedStale=!0)),tA?UA.__staleWhileFetching:UA.__returned=UA}}get(o,{allowStale:u=this.allowStale,updateAgeOnGet:D=this.updateAgeOnGet,noDeleteOnStaleGet:f=this.noDeleteOnStaleGet,status:y}={}){const p=this.keyMap.get(o);if(p!==void 0){const S=this.valList[p],R=this.isBackgroundFetch(S);return this.statusTTL(y,p),this.isStale(p)?(y&&(y.get="stale"),R?(y&&(y.returnedStale=u&&S.__staleWhileFetching!==void 0),u?S.__staleWhileFetching:void 0):(f||this.delete(o),y&&(y.returnedStale=u),u?S:void 0)):(y&&(y.get="hit"),R?S.__staleWhileFetching:(this.moveToTail(p),D&&this.updateItemAge(p),S))}else y&&(y.get="miss")}connect(o,u){this.prev[u]=o,this.next[o]=u}moveToTail(o){o!==this.tail&&(o===this.head?this.head=this.next[o]:this.connect(this.prev[o],this.next[o]),this.connect(this.tail,o),this.tail=o)}get del(){return E("del","delete"),this.delete}delete(o){let u=!1;if(this.size!==0){const D=this.keyMap.get(o);if(D!==void 0)if(u=!0,this.size===1)this.clear();else{this.removeItemSize(D);const f=this.valList[D];this.isBackgroundFetch(f)?f.__abortController.abort(new Error("deleted")):(this.dispose(f,o,"delete"),this.disposeAfter&&this.disposed.push([f,o,"delete"])),this.keyMap.delete(o),this.keyList[D]=null,this.valList[D]=null,D===this.tail?this.tail=this.prev[D]:D===this.head?this.head=this.next[D]:(this.next[this.prev[D]]=this.next[D],this.prev[this.next[D]]=this.prev[D]),this.size--,this.free.push(D)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return u}clear(){for(const o of this.rindexes({allowStale:!0})){const u=this.valList[o];if(this.isBackgroundFetch(u))u.__abortController.abort(new Error("deleted"));else{const D=this.keyList[o];this.dispose(u,D,"delete"),this.disposeAfter&&this.disposed.push([u,D,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return E("reset","clear"),this.clear}get length(){return A("length","size"),this.size}static get AbortController(){return w}static get AbortSignal(){return C}}return lI=r,lI}var jA={},vA={},BC;function KQ(){if(BC)return vA;BC=1;var h=vA&&vA.__createBinding||(Object.create?(function(E,A,e,I){I===void 0&&(I=e);var g=Object.getOwnPropertyDescriptor(A,e);(!g||("get"in g?!A.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return A[e]}}),Object.defineProperty(E,I,g)}):(function(E,A,e,I){I===void 0&&(I=e),E[I]=A[e]})),d=vA&&vA.__setModuleDefault||(Object.create?(function(E,A){Object.defineProperty(E,"default",{enumerable:!0,value:A})}):function(E,A){E.default=A}),w=vA&&vA.__importStar||function(E){if(E&&E.__esModule)return E;var A={};if(E!=null)for(var e in E)e!=="default"&&Object.prototype.hasOwnProperty.call(E,e)&&h(A,E,e);return d(A,E),A};Object.defineProperty(vA,"__esModule",{value:!0}),vA.req=vA.json=vA.toBuffer=void 0;const s=w(De),F=w(ce);async function C(E){let A=0;const e=[];for await(const I of E)A+=I.length,e.push(I);return Buffer.concat(e,A)}vA.toBuffer=C;async function n(E){const e=(await C(E)).toString("utf8");try{return JSON.parse(e)}catch(I){const g=I;throw g.message+=` (input: ${e})`,g}}vA.json=n;function c(E,A={}){const I=((typeof E=="string"?E:E.href).startsWith("https:")?F:s).request(E,A),g=new Promise((i,Q)=>{I.once("response",i).once("error",Q).end()});return I.then=g.then.bind(g),I}return vA.req=c,vA}var tC;function he(){return tC||(tC=1,(function(h){var d=jA&&jA.__createBinding||(Object.create?(function(e,I,g,i){i===void 0&&(i=g);var Q=Object.getOwnPropertyDescriptor(I,g);(!Q||("get"in Q?!I.__esModule:Q.writable||Q.configurable))&&(Q={enumerable:!0,get:function(){return I[g]}}),Object.defineProperty(e,i,Q)}):(function(e,I,g,i){i===void 0&&(i=g),e[i]=I[g]})),w=jA&&jA.__setModuleDefault||(Object.create?(function(e,I){Object.defineProperty(e,"default",{enumerable:!0,value:I})}):function(e,I){e.default=I}),s=jA&&jA.__importStar||function(e){if(e&&e.__esModule)return e;var I={};if(e!=null)for(var g in e)g!=="default"&&Object.prototype.hasOwnProperty.call(e,g)&&d(I,e,g);return w(I,e),I},F=jA&&jA.__exportStar||function(e,I){for(var g in e)g!=="default"&&!Object.prototype.hasOwnProperty.call(I,g)&&d(I,e,g)};Object.defineProperty(h,"__esModule",{value:!0}),h.Agent=void 0;const C=s(rA),n=s(De),c=ce;F(KQ(),h);const E=Symbol("AgentBaseInternalState");class A extends n.Agent{constructor(I){super(I),this[E]={}}isSecureEndpoint(I){if(I){if(typeof I.secureEndpoint=="boolean")return I.secureEndpoint;if(typeof I.protocol=="string")return I.protocol==="https:"}const{stack:g}=new Error;return typeof g!="string"?!1:g.split(`
1
+ import{g as aI,K as kQ,L as MQ,A as GQ}from"./index-B0F7PxWn.js";import{h as NQ,c as mQ,s as UQ}from"./stream-lEC9OYG2.js";import{r as rA}from"./___vite-browser-external_commonjs-proxy-HEKiI6EW.js";function LQ(h,d){for(var w=0;w<d.length;w++){const s=d[w];if(typeof s!="string"&&!Array.isArray(s)){for(const F in s)if(F!=="default"&&!(F in h)){const C=Object.getOwnPropertyDescriptor(s,F);C&&Object.defineProperty(h,F,C.get?C:{enumerable:!0,get:()=>s[F]})}}}return Object.freeze(Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}))}var XA={};const De=aI(NQ),ce=aI(mQ);var lI,CC;function JQ(){if(CC)return lI;CC=1;const h=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,w=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new C}abort(o=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||o,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},s=typeof AbortSignal=="function",F=typeof w.AbortSignal=="function",C=s?AbortSignal:F?w.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(o){o.type==="abort"&&(this.aborted=!0,this.onabort(o),this._listeners.forEach(u=>u(o),this))}onabort(){}addEventListener(o,u){o==="abort"&&this._listeners.push(u)}removeEventListener(o,u){o==="abort"&&(this._listeners=this._listeners.filter(D=>D!==u))}},n=new Set,c=(a,o)=>{const u=`LRU_CACHE_OPTION_${a}`;I(u)&&g(u,`${a} option`,`options.${o}`,r)},E=(a,o)=>{const u=`LRU_CACHE_METHOD_${a}`;if(I(u)){const{prototype:D}=r,{get:f}=Object.getOwnPropertyDescriptor(D,a);g(u,`${a} method`,`cache.${o}()`,f)}},A=(a,o)=>{const u=`LRU_CACHE_PROPERTY_${a}`;if(I(u)){const{prototype:D}=r,{get:f}=Object.getOwnPropertyDescriptor(D,a);g(u,`${a} property`,`cache.${o}`,f)}},e=(...a)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...a):console.error(...a)},I=a=>!n.has(a),g=(a,o,u,D)=>{n.add(a);const f=`The ${o} is deprecated. Please use ${u} instead.`;e(f,"DeprecationWarning",a,D)},i=a=>a&&a===Math.floor(a)&&a>0&&isFinite(a),Q=a=>i(a)?a<=Math.pow(2,8)?Uint8Array:a<=Math.pow(2,16)?Uint16Array:a<=Math.pow(2,32)?Uint32Array:a<=Number.MAX_SAFE_INTEGER?B:null:null;class B extends Array{constructor(o){super(o),this.fill(0)}}class t{constructor(o){if(o===0)return[];const u=Q(o);this.heap=new u(o),this.length=0}push(o){this.heap[this.length++]=o}pop(){return this.heap[--this.length]}}class r{constructor(o={}){const{max:u=0,ttl:D,ttlResolution:f=1,ttlAutopurge:y,updateAgeOnGet:p,updateAgeOnHas:S,allowStale:R,dispose:N,disposeAfter:U,noDisposeOnSet:J,noUpdateTTL:x,maxSize:X=0,maxEntrySize:CA=0,sizeCalculation:z,fetchMethod:_,fetchContext:iA,noDeleteOnFetchRejection:uA,noDeleteOnStaleGet:DA,allowStaleOnFetchRejection:Z,allowStaleOnFetchAbort:RA,ignoreFetchAbort:UA}=o,{length:pA,maxAge:tA,stale:FA}=o instanceof r?{}:o;if(u!==0&&!i(u))throw new TypeError("max option must be a nonnegative integer");const HA=u?Q(u):Array;if(!HA)throw new Error("invalid max value: "+u);if(this.max=u,this.maxSize=X,this.maxEntrySize=CA||this.maxSize,this.sizeCalculation=z||pA,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=_||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=iA,!this.fetchMethod&&iA!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(u).fill(null),this.valList=new Array(u).fill(null),this.next=new HA(u),this.prev=new HA(u),this.head=0,this.tail=0,this.free=new t(u),this.initialFill=1,this.size=0,typeof N=="function"&&(this.dispose=N),typeof U=="function"?(this.disposeAfter=U,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!J,this.noUpdateTTL=!!x,this.noDeleteOnFetchRejection=!!uA,this.allowStaleOnFetchRejection=!!Z,this.allowStaleOnFetchAbort=!!RA,this.ignoreFetchAbort=!!UA,this.maxEntrySize!==0){if(this.maxSize!==0&&!i(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!i(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!R||!!FA,this.noDeleteOnStaleGet=!!DA,this.updateAgeOnGet=!!p,this.updateAgeOnHas=!!S,this.ttlResolution=i(f)||f===0?f:1,this.ttlAutopurge=!!y,this.ttl=D||tA||0,this.ttl){if(!i(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const ZA="LRU_CACHE_UNBOUNDED";I(ZA)&&(n.add(ZA),e("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ZA,r))}FA&&c("stale","allowStale"),tA&&c("maxAge","ttl"),pA&&c("length","sizeCalculation")}getRemainingTTL(o){return this.has(o,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new B(this.max),this.starts=new B(this.max),this.setItemTTL=(D,f,y=h.now())=>{if(this.starts[D]=f!==0?y:0,this.ttls[D]=f,f!==0&&this.ttlAutopurge){const p=setTimeout(()=>{this.isStale(D)&&this.delete(this.keyList[D])},f+1);p.unref&&p.unref()}},this.updateItemAge=D=>{this.starts[D]=this.ttls[D]!==0?h.now():0},this.statusTTL=(D,f)=>{D&&(D.ttl=this.ttls[f],D.start=this.starts[f],D.now=o||u(),D.remainingTTL=D.now+D.ttl-D.start)};let o=0;const u=()=>{const D=h.now();if(this.ttlResolution>0){o=D;const f=setTimeout(()=>o=0,this.ttlResolution);f.unref&&f.unref()}return D};this.getRemainingTTL=D=>{const f=this.keyMap.get(D);return f===void 0?0:this.ttls[f]===0||this.starts[f]===0?1/0:this.starts[f]+this.ttls[f]-(o||u())},this.isStale=D=>this.ttls[D]!==0&&this.starts[D]!==0&&(o||u())-this.starts[D]>this.ttls[D]}updateItemAge(o){}statusTTL(o,u){}setItemTTL(o,u,D){}isStale(o){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new B(this.max),this.removeItemSize=o=>{this.calculatedSize-=this.sizes[o],this.sizes[o]=0},this.requireSize=(o,u,D,f)=>{if(this.isBackgroundFetch(u))return 0;if(!i(D))if(f){if(typeof f!="function")throw new TypeError("sizeCalculation must be a function");if(D=f(u,o),!i(D))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return D},this.addItemSize=(o,u,D)=>{if(this.sizes[o]=u,this.maxSize){const f=this.maxSize-this.sizes[o];for(;this.calculatedSize>f;)this.evict(!0)}this.calculatedSize+=this.sizes[o],D&&(D.entrySize=u,D.totalCalculatedSize=this.calculatedSize)}}removeItemSize(o){}addItemSize(o,u){}requireSize(o,u,D,f){if(D||f)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:o=this.allowStale}={}){if(this.size)for(let u=this.tail;!(!this.isValidIndex(u)||((o||!this.isStale(u))&&(yield u),u===this.head));)u=this.prev[u]}*rindexes({allowStale:o=this.allowStale}={}){if(this.size)for(let u=this.head;!(!this.isValidIndex(u)||((o||!this.isStale(u))&&(yield u),u===this.tail));)u=this.next[u]}isValidIndex(o){return o!==void 0&&this.keyMap.get(this.keyList[o])===o}*entries(){for(const o of this.indexes())this.valList[o]!==void 0&&this.keyList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield[this.keyList[o],this.valList[o]])}*rentries(){for(const o of this.rindexes())this.valList[o]!==void 0&&this.keyList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield[this.keyList[o],this.valList[o]])}*keys(){for(const o of this.indexes())this.keyList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield this.keyList[o])}*rkeys(){for(const o of this.rindexes())this.keyList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield this.keyList[o])}*values(){for(const o of this.indexes())this.valList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield this.valList[o])}*rvalues(){for(const o of this.rindexes())this.valList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield this.valList[o])}[Symbol.iterator](){return this.entries()}find(o,u){for(const D of this.indexes()){const f=this.valList[D],y=this.isBackgroundFetch(f)?f.__staleWhileFetching:f;if(y!==void 0&&o(y,this.keyList[D],this))return this.get(this.keyList[D],u)}}forEach(o,u=this){for(const D of this.indexes()){const f=this.valList[D],y=this.isBackgroundFetch(f)?f.__staleWhileFetching:f;y!==void 0&&o.call(u,y,this.keyList[D],this)}}rforEach(o,u=this){for(const D of this.rindexes()){const f=this.valList[D],y=this.isBackgroundFetch(f)?f.__staleWhileFetching:f;y!==void 0&&o.call(u,y,this.keyList[D],this)}}get prune(){return E("prune","purgeStale"),this.purgeStale}purgeStale(){let o=!1;for(const u of this.rindexes({allowStale:!0}))this.isStale(u)&&(this.delete(this.keyList[u]),o=!0);return o}dump(){const o=[];for(const u of this.indexes({allowStale:!0})){const D=this.keyList[u],f=this.valList[u],y=this.isBackgroundFetch(f)?f.__staleWhileFetching:f;if(y===void 0)continue;const p={value:y};if(this.ttls){p.ttl=this.ttls[u];const S=h.now()-this.starts[u];p.start=Math.floor(Date.now()-S)}this.sizes&&(p.size=this.sizes[u]),o.unshift([D,p])}return o}load(o){this.clear();for(const[u,D]of o){if(D.start){const f=Date.now()-D.start;D.start=h.now()-f}this.set(u,D.value,D)}}dispose(o,u,D){}set(o,u,{ttl:D=this.ttl,start:f,noDisposeOnSet:y=this.noDisposeOnSet,size:p=0,sizeCalculation:S=this.sizeCalculation,noUpdateTTL:R=this.noUpdateTTL,status:N}={}){if(p=this.requireSize(o,u,p,S),this.maxEntrySize&&p>this.maxEntrySize)return N&&(N.set="miss",N.maxEntrySizeExceeded=!0),this.delete(o),this;let U=this.size===0?void 0:this.keyMap.get(o);if(U===void 0)U=this.newIndex(),this.keyList[U]=o,this.valList[U]=u,this.keyMap.set(o,U),this.next[this.tail]=U,this.prev[U]=this.tail,this.tail=U,this.size++,this.addItemSize(U,p,N),N&&(N.set="add"),R=!1;else{this.moveToTail(U);const J=this.valList[U];if(u!==J){if(this.isBackgroundFetch(J)?J.__abortController.abort(new Error("replaced")):y||(this.dispose(J,o,"set"),this.disposeAfter&&this.disposed.push([J,o,"set"])),this.removeItemSize(U),this.valList[U]=u,this.addItemSize(U,p,N),N){N.set="replace";const x=J&&this.isBackgroundFetch(J)?J.__staleWhileFetching:J;x!==void 0&&(N.oldValue=x)}}else N&&(N.set="update")}if(D!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),R||this.setItemTTL(U,D,f),this.statusTTL(N,U),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const o=this.valList[this.head];return this.evict(!0),o}}evict(o){const u=this.head,D=this.keyList[u],f=this.valList[u];return this.isBackgroundFetch(f)?f.__abortController.abort(new Error("evicted")):(this.dispose(f,D,"evict"),this.disposeAfter&&this.disposed.push([f,D,"evict"])),this.removeItemSize(u),o&&(this.keyList[u]=null,this.valList[u]=null,this.free.push(u)),this.head=this.next[u],this.keyMap.delete(D),this.size--,u}has(o,{updateAgeOnHas:u=this.updateAgeOnHas,status:D}={}){const f=this.keyMap.get(o);if(f!==void 0)if(this.isStale(f))D&&(D.has="stale",this.statusTTL(D,f));else return u&&this.updateItemAge(f),D&&(D.has="hit"),this.statusTTL(D,f),!0;else D&&(D.has="miss");return!1}peek(o,{allowStale:u=this.allowStale}={}){const D=this.keyMap.get(o);if(D!==void 0&&(u||!this.isStale(D))){const f=this.valList[D];return this.isBackgroundFetch(f)?f.__staleWhileFetching:f}}backgroundFetch(o,u,D,f){const y=u===void 0?void 0:this.valList[u];if(this.isBackgroundFetch(y))return y;const p=new w;D.signal&&D.signal.addEventListener("abort",()=>p.abort(D.signal.reason));const S={signal:p.signal,options:D,context:f},R=(X,CA=!1)=>{const{aborted:z}=p.signal,_=D.ignoreFetchAbort&&X!==void 0;return D.status&&(z&&!CA?(D.status.fetchAborted=!0,D.status.fetchError=p.signal.reason,_&&(D.status.fetchAbortIgnored=!0)):D.status.fetchResolved=!0),z&&!_&&!CA?U(p.signal.reason):(this.valList[u]===x&&(X===void 0?x.__staleWhileFetching?this.valList[u]=x.__staleWhileFetching:this.delete(o):(D.status&&(D.status.fetchUpdated=!0),this.set(o,X,S.options))),X)},N=X=>(D.status&&(D.status.fetchRejected=!0,D.status.fetchError=X),U(X)),U=X=>{const{aborted:CA}=p.signal,z=CA&&D.allowStaleOnFetchAbort,_=z||D.allowStaleOnFetchRejection,iA=_||D.noDeleteOnFetchRejection;if(this.valList[u]===x&&(!iA||x.__staleWhileFetching===void 0?this.delete(o):z||(this.valList[u]=x.__staleWhileFetching)),_)return D.status&&x.__staleWhileFetching!==void 0&&(D.status.returnedStale=!0),x.__staleWhileFetching;if(x.__returned===x)throw X},J=(X,CA)=>{this.fetchMethod(o,y,S).then(z=>X(z),CA),p.signal.addEventListener("abort",()=>{(!D.ignoreFetchAbort||D.allowStaleOnFetchAbort)&&(X(),D.allowStaleOnFetchAbort&&(X=z=>R(z,!0)))})};D.status&&(D.status.fetchDispatched=!0);const x=new Promise(J).then(R,N);return x.__abortController=p,x.__staleWhileFetching=y,x.__returned=null,u===void 0?(this.set(o,x,{...S.options,status:void 0}),u=this.keyMap.get(o)):this.valList[u]=x,x}isBackgroundFetch(o){return o&&typeof o=="object"&&typeof o.then=="function"&&Object.prototype.hasOwnProperty.call(o,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(o,"__returned")&&(o.__returned===o||o.__returned===null)}async fetch(o,{allowStale:u=this.allowStale,updateAgeOnGet:D=this.updateAgeOnGet,noDeleteOnStaleGet:f=this.noDeleteOnStaleGet,ttl:y=this.ttl,noDisposeOnSet:p=this.noDisposeOnSet,size:S=0,sizeCalculation:R=this.sizeCalculation,noUpdateTTL:N=this.noUpdateTTL,noDeleteOnFetchRejection:U=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:J=this.allowStaleOnFetchRejection,ignoreFetchAbort:x=this.ignoreFetchAbort,allowStaleOnFetchAbort:X=this.allowStaleOnFetchAbort,fetchContext:CA=this.fetchContext,forceRefresh:z=!1,status:_,signal:iA}={}){if(!this.fetchMethod)return _&&(_.fetch="get"),this.get(o,{allowStale:u,updateAgeOnGet:D,noDeleteOnStaleGet:f,status:_});const uA={allowStale:u,updateAgeOnGet:D,noDeleteOnStaleGet:f,ttl:y,noDisposeOnSet:p,size:S,sizeCalculation:R,noUpdateTTL:N,noDeleteOnFetchRejection:U,allowStaleOnFetchRejection:J,allowStaleOnFetchAbort:X,ignoreFetchAbort:x,status:_,signal:iA};let DA=this.keyMap.get(o);if(DA===void 0){_&&(_.fetch="miss");const Z=this.backgroundFetch(o,DA,uA,CA);return Z.__returned=Z}else{const Z=this.valList[DA];if(this.isBackgroundFetch(Z)){const FA=u&&Z.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",FA&&(_.returnedStale=!0)),FA?Z.__staleWhileFetching:Z.__returned=Z}const RA=this.isStale(DA);if(!z&&!RA)return _&&(_.fetch="hit"),this.moveToTail(DA),D&&this.updateItemAge(DA),this.statusTTL(_,DA),Z;const UA=this.backgroundFetch(o,DA,uA,CA),pA=UA.__staleWhileFetching!==void 0,tA=pA&&u;return _&&(_.fetch=pA&&RA?"stale":"refresh",tA&&RA&&(_.returnedStale=!0)),tA?UA.__staleWhileFetching:UA.__returned=UA}}get(o,{allowStale:u=this.allowStale,updateAgeOnGet:D=this.updateAgeOnGet,noDeleteOnStaleGet:f=this.noDeleteOnStaleGet,status:y}={}){const p=this.keyMap.get(o);if(p!==void 0){const S=this.valList[p],R=this.isBackgroundFetch(S);return this.statusTTL(y,p),this.isStale(p)?(y&&(y.get="stale"),R?(y&&(y.returnedStale=u&&S.__staleWhileFetching!==void 0),u?S.__staleWhileFetching:void 0):(f||this.delete(o),y&&(y.returnedStale=u),u?S:void 0)):(y&&(y.get="hit"),R?S.__staleWhileFetching:(this.moveToTail(p),D&&this.updateItemAge(p),S))}else y&&(y.get="miss")}connect(o,u){this.prev[u]=o,this.next[o]=u}moveToTail(o){o!==this.tail&&(o===this.head?this.head=this.next[o]:this.connect(this.prev[o],this.next[o]),this.connect(this.tail,o),this.tail=o)}get del(){return E("del","delete"),this.delete}delete(o){let u=!1;if(this.size!==0){const D=this.keyMap.get(o);if(D!==void 0)if(u=!0,this.size===1)this.clear();else{this.removeItemSize(D);const f=this.valList[D];this.isBackgroundFetch(f)?f.__abortController.abort(new Error("deleted")):(this.dispose(f,o,"delete"),this.disposeAfter&&this.disposed.push([f,o,"delete"])),this.keyMap.delete(o),this.keyList[D]=null,this.valList[D]=null,D===this.tail?this.tail=this.prev[D]:D===this.head?this.head=this.next[D]:(this.next[this.prev[D]]=this.next[D],this.prev[this.next[D]]=this.prev[D]),this.size--,this.free.push(D)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return u}clear(){for(const o of this.rindexes({allowStale:!0})){const u=this.valList[o];if(this.isBackgroundFetch(u))u.__abortController.abort(new Error("deleted"));else{const D=this.keyList[o];this.dispose(u,D,"delete"),this.disposeAfter&&this.disposed.push([u,D,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return E("reset","clear"),this.clear}get length(){return A("length","size"),this.size}static get AbortController(){return w}static get AbortSignal(){return C}}return lI=r,lI}var jA={},vA={},BC;function KQ(){if(BC)return vA;BC=1;var h=vA&&vA.__createBinding||(Object.create?(function(E,A,e,I){I===void 0&&(I=e);var g=Object.getOwnPropertyDescriptor(A,e);(!g||("get"in g?!A.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return A[e]}}),Object.defineProperty(E,I,g)}):(function(E,A,e,I){I===void 0&&(I=e),E[I]=A[e]})),d=vA&&vA.__setModuleDefault||(Object.create?(function(E,A){Object.defineProperty(E,"default",{enumerable:!0,value:A})}):function(E,A){E.default=A}),w=vA&&vA.__importStar||function(E){if(E&&E.__esModule)return E;var A={};if(E!=null)for(var e in E)e!=="default"&&Object.prototype.hasOwnProperty.call(E,e)&&h(A,E,e);return d(A,E),A};Object.defineProperty(vA,"__esModule",{value:!0}),vA.req=vA.json=vA.toBuffer=void 0;const s=w(De),F=w(ce);async function C(E){let A=0;const e=[];for await(const I of E)A+=I.length,e.push(I);return Buffer.concat(e,A)}vA.toBuffer=C;async function n(E){const e=(await C(E)).toString("utf8");try{return JSON.parse(e)}catch(I){const g=I;throw g.message+=` (input: ${e})`,g}}vA.json=n;function c(E,A={}){const I=((typeof E=="string"?E:E.href).startsWith("https:")?F:s).request(E,A),g=new Promise((i,Q)=>{I.once("response",i).once("error",Q).end()});return I.then=g.then.bind(g),I}return vA.req=c,vA}var tC;function he(){return tC||(tC=1,(function(h){var d=jA&&jA.__createBinding||(Object.create?(function(e,I,g,i){i===void 0&&(i=g);var Q=Object.getOwnPropertyDescriptor(I,g);(!Q||("get"in Q?!I.__esModule:Q.writable||Q.configurable))&&(Q={enumerable:!0,get:function(){return I[g]}}),Object.defineProperty(e,i,Q)}):(function(e,I,g,i){i===void 0&&(i=g),e[i]=I[g]})),w=jA&&jA.__setModuleDefault||(Object.create?(function(e,I){Object.defineProperty(e,"default",{enumerable:!0,value:I})}):function(e,I){e.default=I}),s=jA&&jA.__importStar||function(e){if(e&&e.__esModule)return e;var I={};if(e!=null)for(var g in e)g!=="default"&&Object.prototype.hasOwnProperty.call(e,g)&&d(I,e,g);return w(I,e),I},F=jA&&jA.__exportStar||function(e,I){for(var g in e)g!=="default"&&!Object.prototype.hasOwnProperty.call(I,g)&&d(I,e,g)};Object.defineProperty(h,"__esModule",{value:!0}),h.Agent=void 0;const C=s(rA),n=s(De),c=ce;F(KQ(),h);const E=Symbol("AgentBaseInternalState");class A extends n.Agent{constructor(I){super(I),this[E]={}}isSecureEndpoint(I){if(I){if(typeof I.secureEndpoint=="boolean")return I.secureEndpoint;if(typeof I.protocol=="string")return I.protocol==="https:"}const{stack:g}=new Error;return typeof g!="string"?!1:g.split(`
2
2
  `).some(i=>i.indexOf("(https.js:")!==-1||i.indexOf("node:https:")!==-1)}incrementSockets(I){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[I]||(this.sockets[I]=[]);const g=new C.Socket({writable:!1});return this.sockets[I].push(g),this.totalSocketCount++,g}decrementSockets(I,g){if(!this.sockets[I]||g===null)return;const i=this.sockets[I],Q=i.indexOf(g);Q!==-1&&(i.splice(Q,1),this.totalSocketCount--,i.length===0&&delete this.sockets[I])}getName(I){return this.isSecureEndpoint(I)?c.Agent.prototype.getName.call(this,I):super.getName(I)}createSocket(I,g,i){const Q={...g,secureEndpoint:this.isSecureEndpoint(g)},B=this.getName(Q),t=this.incrementSockets(B);Promise.resolve().then(()=>this.connect(I,Q)).then(r=>{if(this.decrementSockets(B,t),r instanceof n.Agent)try{return r.addRequest(I,Q)}catch(a){return i(a)}this[E].currentSocket=r,super.createSocket(I,g,i)},r=>{this.decrementSockets(B,t),i(r)})}createConnection(){const I=this[E].currentSocket;if(this[E].currentSocket=void 0,!I)throw new Error("No socket was returned in the `connect()` function");return I}get defaultPort(){return this[E].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(I){this[E]&&(this[E].defaultPort=I)}get protocol(){return this[E].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(I){this[E]&&(this[E].protocol=I)}}h.Agent=A})(jA)),jA}var ye={exports:{}},wI,QC;function HQ(){if(QC)return wI;QC=1;var h=1e3,d=h*60,w=d*60,s=w*24,F=s*7,C=s*365.25;wI=function(e,I){I=I||{};var g=typeof e;if(g==="string"&&e.length>0)return n(e);if(g==="number"&&isFinite(e))return I.long?E(e):c(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function n(e){if(e=String(e),!(e.length>100)){var I=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(I){var g=parseFloat(I[1]),i=(I[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return g*C;case"weeks":case"week":case"w":return g*F;case"days":case"day":case"d":return g*s;case"hours":case"hour":case"hrs":case"hr":case"h":return g*w;case"minutes":case"minute":case"mins":case"min":case"m":return g*d;case"seconds":case"second":case"secs":case"sec":case"s":return g*h;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function c(e){var I=Math.abs(e);return I>=s?Math.round(e/s)+"d":I>=w?Math.round(e/w)+"h":I>=d?Math.round(e/d)+"m":I>=h?Math.round(e/h)+"s":e+"ms"}function E(e){var I=Math.abs(e);return I>=s?A(e,I,s,"day"):I>=w?A(e,I,w,"hour"):I>=d?A(e,I,d,"minute"):I>=h?A(e,I,h,"second"):e+" ms"}function A(e,I,g,i){var Q=I>=g*1.5;return Math.round(e/g)+" "+i+(Q?"s":"")}return wI}var fI,iC;function YQ(){if(iC)return fI;iC=1;function h(d){s.debug=s,s.default=s,s.coerce=A,s.disable=c,s.enable=C,s.enabled=E,s.humanize=HQ(),s.destroy=e,Object.keys(d).forEach(I=>{s[I]=d[I]}),s.names=[],s.skips=[],s.formatters={};function w(I){let g=0;for(let i=0;i<I.length;i++)g=(g<<5)-g+I.charCodeAt(i),g|=0;return s.colors[Math.abs(g)%s.colors.length]}s.selectColor=w;function s(I){let g,i=null,Q,B;function t(...r){if(!t.enabled)return;const a=t,o=Number(new Date),u=o-(g||o);a.diff=u,a.prev=g,a.curr=o,g=o,r[0]=s.coerce(r[0]),typeof r[0]!="string"&&r.unshift("%O");let D=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,(y,p)=>{if(y==="%%")return"%";D++;const S=s.formatters[p];if(typeof S=="function"){const R=r[D];y=S.call(a,R),r.splice(D,1),D--}return y}),s.formatArgs.call(a,r),(a.log||s.log).apply(a,r)}return t.namespace=I,t.useColors=s.useColors(),t.color=s.selectColor(I),t.extend=F,t.destroy=s.destroy,Object.defineProperty(t,"enabled",{enumerable:!0,configurable:!1,get:()=>i!==null?i:(Q!==s.namespaces&&(Q=s.namespaces,B=s.enabled(I)),B),set:r=>{i=r}}),typeof s.init=="function"&&s.init(t),t}function F(I,g){const i=s(this.namespace+(typeof g>"u"?":":g)+I);return i.log=this.log,i}function C(I){s.save(I),s.namespaces=I,s.names=[],s.skips=[];const g=(typeof I=="string"?I:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const i of g)i[0]==="-"?s.skips.push(i.slice(1)):s.names.push(i)}function n(I,g){let i=0,Q=0,B=-1,t=0;for(;i<I.length;)if(Q<g.length&&(g[Q]===I[i]||g[Q]==="*"))g[Q]==="*"?(B=Q,t=i,Q++):(i++,Q++);else if(B!==-1)Q=B+1,t++,i=t;else return!1;for(;Q<g.length&&g[Q]==="*";)Q++;return Q===g.length}function c(){const I=[...s.names,...s.skips.map(g=>"-"+g)].join(",");return s.enable(""),I}function E(I){for(const g of s.skips)if(n(I,g))return!1;for(const g of s.names)if(n(I,g))return!0;return!1}function A(I){return I instanceof Error?I.stack||I.message:I}function e(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return s.enable(s.load()),s}return fI=h,fI}var EC;function vQ(){return EC||(EC=1,(function(h,d){var w={};d.formatArgs=F,d.save=C,d.load=n,d.useColors=s,d.storage=c(),d.destroy=(()=>{let A=!1;return()=>{A||(A=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),d.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function s(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let A;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(A=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(A[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function F(A){if(A[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+A[0]+(this.useColors?"%c ":" ")+"+"+h.exports.humanize(this.diff),!this.useColors)return;const e="color: "+this.color;A.splice(1,0,e,"color: inherit");let I=0,g=0;A[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(I++,i==="%c"&&(g=I))}),A.splice(g,0,e)}d.log=console.debug||console.log||(()=>{});function C(A){try{A?d.storage.setItem("debug",A):d.storage.removeItem("debug")}catch{}}function n(){let A;try{A=d.storage.getItem("debug")||d.storage.getItem("DEBUG")}catch{}return!A&&typeof process<"u"&&"env"in process&&(A=w.DEBUG),A}function c(){try{return localStorage}catch{}}h.exports=YQ()(d);const{formatters:E}=h.exports;E.j=function(A){try{return JSON.stringify(A)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}})(ye,ye.exports)),ye.exports}var dI={},rC;function bQ(){if(rC)return dI;rC=1;var h={},d=rA.parse,w={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},s=String.prototype.endsWith||function(c){return c.length<=this.length&&this.indexOf(c,this.length-c.length)!==-1};function F(c){var E=typeof c=="string"?d(c):c||{},A=E.protocol,e=E.host,I=E.port;if(typeof e!="string"||!e||typeof A!="string"||(A=A.split(":",1)[0],e=e.replace(/:\d*$/,""),I=parseInt(I)||w[A]||0,!C(e,I)))return"";var g=n("npm_config_"+A+"_proxy")||n(A+"_proxy")||n("npm_config_proxy")||n("all_proxy");return g&&g.indexOf("://")===-1&&(g=A+"://"+g),g}function C(c,E){var A=(n("npm_config_no_proxy")||n("no_proxy")).toLowerCase();return A?A==="*"?!1:A.split(/[,\s]/).every(function(e){if(!e)return!0;var I=e.match(/^(.+):(\d+)$/),g=I?I[1]:e,i=I?parseInt(I[2]):0;return i&&i!==E?!0:/^[.*]/.test(g)?(g.charAt(0)==="*"&&(g=g.slice(1)),!s.call(c,g)):c!==g}):!0}function n(c){return h[c.toLowerCase()]||h[c.toUpperCase()]||""}return dI.getProxyForUrl=F,dI}var PA={},pe={exports:{}},FI,sC;function xQ(){if(sC)return FI;sC=1;var h=1e3,d=h*60,w=d*60,s=w*24,F=s*7,C=s*365.25;FI=function(e,I){I=I||{};var g=typeof e;if(g==="string"&&e.length>0)return n(e);if(g==="number"&&isFinite(e))return I.long?E(e):c(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function n(e){if(e=String(e),!(e.length>100)){var I=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(I){var g=parseFloat(I[1]),i=(I[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return g*C;case"weeks":case"week":case"w":return g*F;case"days":case"day":case"d":return g*s;case"hours":case"hour":case"hrs":case"hr":case"h":return g*w;case"minutes":case"minute":case"mins":case"min":case"m":return g*d;case"seconds":case"second":case"secs":case"sec":case"s":return g*h;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function c(e){var I=Math.abs(e);return I>=s?Math.round(e/s)+"d":I>=w?Math.round(e/w)+"h":I>=d?Math.round(e/d)+"m":I>=h?Math.round(e/h)+"s":e+"ms"}function E(e){var I=Math.abs(e);return I>=s?A(e,I,s,"day"):I>=w?A(e,I,w,"hour"):I>=d?A(e,I,d,"minute"):I>=h?A(e,I,h,"second"):e+" ms"}function A(e,I,g,i){var Q=I>=g*1.5;return Math.round(e/g)+" "+i+(Q?"s":"")}return FI}var yI,nC;function TQ(){if(nC)return yI;nC=1;function h(d){s.debug=s,s.default=s,s.coerce=A,s.disable=c,s.enable=C,s.enabled=E,s.humanize=xQ(),s.destroy=e,Object.keys(d).forEach(I=>{s[I]=d[I]}),s.names=[],s.skips=[],s.formatters={};function w(I){let g=0;for(let i=0;i<I.length;i++)g=(g<<5)-g+I.charCodeAt(i),g|=0;return s.colors[Math.abs(g)%s.colors.length]}s.selectColor=w;function s(I){let g,i=null,Q,B;function t(...r){if(!t.enabled)return;const a=t,o=Number(new Date),u=o-(g||o);a.diff=u,a.prev=g,a.curr=o,g=o,r[0]=s.coerce(r[0]),typeof r[0]!="string"&&r.unshift("%O");let D=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,(y,p)=>{if(y==="%%")return"%";D++;const S=s.formatters[p];if(typeof S=="function"){const R=r[D];y=S.call(a,R),r.splice(D,1),D--}return y}),s.formatArgs.call(a,r),(a.log||s.log).apply(a,r)}return t.namespace=I,t.useColors=s.useColors(),t.color=s.selectColor(I),t.extend=F,t.destroy=s.destroy,Object.defineProperty(t,"enabled",{enumerable:!0,configurable:!1,get:()=>i!==null?i:(Q!==s.namespaces&&(Q=s.namespaces,B=s.enabled(I)),B),set:r=>{i=r}}),typeof s.init=="function"&&s.init(t),t}function F(I,g){const i=s(this.namespace+(typeof g>"u"?":":g)+I);return i.log=this.log,i}function C(I){s.save(I),s.namespaces=I,s.names=[],s.skips=[];const g=(typeof I=="string"?I:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const i of g)i[0]==="-"?s.skips.push(i.slice(1)):s.names.push(i)}function n(I,g){let i=0,Q=0,B=-1,t=0;for(;i<I.length;)if(Q<g.length&&(g[Q]===I[i]||g[Q]==="*"))g[Q]==="*"?(B=Q,t=i,Q++):(i++,Q++);else if(B!==-1)Q=B+1,t++,i=t;else return!1;for(;Q<g.length&&g[Q]==="*";)Q++;return Q===g.length}function c(){const I=[...s.names,...s.skips.map(g=>"-"+g)].join(",");return s.enable(""),I}function E(I){for(const g of s.skips)if(n(I,g))return!1;for(const g of s.names)if(n(I,g))return!0;return!1}function A(I){return I instanceof Error?I.stack||I.message:I}function e(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return s.enable(s.load()),s}return yI=h,yI}var oC;function PQ(){return oC||(oC=1,(function(h,d){var w={};d.formatArgs=F,d.save=C,d.load=n,d.useColors=s,d.storage=c(),d.destroy=(()=>{let A=!1;return()=>{A||(A=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),d.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function s(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let A;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(A=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(A[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function F(A){if(A[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+A[0]+(this.useColors?"%c ":" ")+"+"+h.exports.humanize(this.diff),!this.useColors)return;const e="color: "+this.color;A.splice(1,0,e,"color: inherit");let I=0,g=0;A[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(I++,i==="%c"&&(g=I))}),A.splice(g,0,e)}d.log=console.debug||console.log||(()=>{});function C(A){try{A?d.storage.setItem("debug",A):d.storage.removeItem("debug")}catch{}}function n(){let A;try{A=d.storage.getItem("debug")||d.storage.getItem("DEBUG")}catch{}return!A&&typeof process<"u"&&"env"in process&&(A=w.DEBUG),A}function c(){try{return localStorage}catch{}}h.exports=TQ()(d);const{formatters:E}=h.exports;E.j=function(A){try{return JSON.stringify(A)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}})(pe,pe.exports)),pe.exports}var Se={exports:{}},aC;function uI(){if(aC)return Se.exports;aC=1;var h=typeof Reflect=="object"?Reflect:null,d=h&&typeof h.apply=="function"?h.apply:function(D,f,y){return Function.prototype.apply.call(D,f,y)},w;h&&typeof h.ownKeys=="function"?w=h.ownKeys:Object.getOwnPropertySymbols?w=function(D){return Object.getOwnPropertyNames(D).concat(Object.getOwnPropertySymbols(D))}:w=function(D){return Object.getOwnPropertyNames(D)};function s(u){console&&console.warn&&console.warn(u)}var F=Number.isNaN||function(D){return D!==D};function C(){C.init.call(this)}Se.exports=C,Se.exports.once=r,C.EventEmitter=C,C.prototype._events=void 0,C.prototype._eventsCount=0,C.prototype._maxListeners=void 0;var n=10;function c(u){if(typeof u!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof u)}Object.defineProperty(C,"defaultMaxListeners",{enumerable:!0,get:function(){return n},set:function(u){if(typeof u!="number"||u<0||F(u))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+u+".");n=u}}),C.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},C.prototype.setMaxListeners=function(D){if(typeof D!="number"||D<0||F(D))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+D+".");return this._maxListeners=D,this};function E(u){return u._maxListeners===void 0?C.defaultMaxListeners:u._maxListeners}C.prototype.getMaxListeners=function(){return E(this)},C.prototype.emit=function(D){for(var f=[],y=1;y<arguments.length;y++)f.push(arguments[y]);var p=D==="error",S=this._events;if(S!==void 0)p=p&&S.error===void 0;else if(!p)return!1;if(p){var R;if(f.length>0&&(R=f[0]),R instanceof Error)throw R;var N=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw N.context=R,N}var U=S[D];if(U===void 0)return!1;if(typeof U=="function")d(U,this,f);else for(var J=U.length,x=Q(U,J),y=0;y<J;++y)d(x[y],this,f);return!0};function A(u,D,f,y){var p,S,R;if(c(f),S=u._events,S===void 0?(S=u._events=Object.create(null),u._eventsCount=0):(S.newListener!==void 0&&(u.emit("newListener",D,f.listener?f.listener:f),S=u._events),R=S[D]),R===void 0)R=S[D]=f,++u._eventsCount;else if(typeof R=="function"?R=S[D]=y?[f,R]:[R,f]:y?R.unshift(f):R.push(f),p=E(u),p>0&&R.length>p&&!R.warned){R.warned=!0;var N=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(D)+" listeners added. Use emitter.setMaxListeners() to increase limit");N.name="MaxListenersExceededWarning",N.emitter=u,N.type=D,N.count=R.length,s(N)}return u}C.prototype.addListener=function(D,f){return A(this,D,f,!1)},C.prototype.on=C.prototype.addListener,C.prototype.prependListener=function(D,f){return A(this,D,f,!0)};function e(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function I(u,D,f){var y={fired:!1,wrapFn:void 0,target:u,type:D,listener:f},p=e.bind(y);return p.listener=f,y.wrapFn=p,p}C.prototype.once=function(D,f){return c(f),this.on(D,I(this,D,f)),this},C.prototype.prependOnceListener=function(D,f){return c(f),this.prependListener(D,I(this,D,f)),this},C.prototype.removeListener=function(D,f){var y,p,S,R,N;if(c(f),p=this._events,p===void 0)return this;if(y=p[D],y===void 0)return this;if(y===f||y.listener===f)--this._eventsCount===0?this._events=Object.create(null):(delete p[D],p.removeListener&&this.emit("removeListener",D,y.listener||f));else if(typeof y!="function"){for(S=-1,R=y.length-1;R>=0;R--)if(y[R]===f||y[R].listener===f){N=y[R].listener,S=R;break}if(S<0)return this;S===0?y.shift():B(y,S),y.length===1&&(p[D]=y[0]),p.removeListener!==void 0&&this.emit("removeListener",D,N||f)}return this},C.prototype.off=C.prototype.removeListener,C.prototype.removeAllListeners=function(D){var f,y,p;if(y=this._events,y===void 0)return this;if(y.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):y[D]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete y[D]),this;if(arguments.length===0){var S=Object.keys(y),R;for(p=0;p<S.length;++p)R=S[p],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(f=y[D],typeof f=="function")this.removeListener(D,f);else if(f!==void 0)for(p=f.length-1;p>=0;p--)this.removeListener(D,f[p]);return this};function g(u,D,f){var y=u._events;if(y===void 0)return[];var p=y[D];return p===void 0?[]:typeof p=="function"?f?[p.listener||p]:[p]:f?t(p):Q(p,p.length)}C.prototype.listeners=function(D){return g(this,D,!0)},C.prototype.rawListeners=function(D){return g(this,D,!1)},C.listenerCount=function(u,D){return typeof u.listenerCount=="function"?u.listenerCount(D):i.call(u,D)},C.prototype.listenerCount=i;function i(u){var D=this._events;if(D!==void 0){var f=D[u];if(typeof f=="function")return 1;if(f!==void 0)return f.length}return 0}C.prototype.eventNames=function(){return this._eventsCount>0?w(this._events):[]};function Q(u,D){for(var f=new Array(D),y=0;y<D;++y)f[y]=u[y];return f}function B(u,D){for(;D+1<u.length;D++)u[D]=u[D+1];u.pop()}function t(u){for(var D=new Array(u.length),f=0;f<D.length;++f)D[f]=u[f].listener||u[f];return D}function r(u,D){return new Promise(function(f,y){function p(R){u.removeListener(D,S),y(R)}function S(){typeof u.removeListener=="function"&&u.removeListener("error",p),f([].slice.call(arguments))}o(u,D,S,{once:!0}),D!=="error"&&a(u,p,{once:!0})})}function a(u,D,f){typeof u.on=="function"&&o(u,"error",D,f)}function o(u,D,f,y){if(typeof u.on=="function")y.once?u.once(D,f):u.on(D,f);else if(typeof u.addEventListener=="function")u.addEventListener(D,function p(S){y.once&&u.removeEventListener(D,p),f(S)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof u)}return Se.exports}var uC;function Vt(){if(uC)return PA;uC=1;var h=PA&&PA.__createBinding||(Object.create?(function(i,Q,B,t){t===void 0&&(t=B);var r=Object.getOwnPropertyDescriptor(Q,B);(!r||("get"in r?!Q.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return Q[B]}}),Object.defineProperty(i,t,r)}):(function(i,Q,B,t){t===void 0&&(t=B),i[t]=Q[B]})),d=PA&&PA.__setModuleDefault||(Object.create?(function(i,Q){Object.defineProperty(i,"default",{enumerable:!0,value:Q})}):function(i,Q){i.default=Q}),w=PA&&PA.__importStar||function(i){if(i&&i.__esModule)return i;var Q={};if(i!=null)for(var B in i)B!=="default"&&Object.prototype.hasOwnProperty.call(i,B)&&h(Q,i,B);return d(Q,i),Q},s=PA&&PA.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(PA,"__esModule",{value:!0}),PA.HttpProxyAgent=void 0;const F=w(rA),C=w(rA),n=s(PQ()),c=uI(),E=he(),A=rA,e=(0,n.default)("http-proxy-agent");class I extends E.Agent{constructor(Q,B){super(B),this.proxy=typeof Q=="string"?new A.URL(Q):Q,this.proxyHeaders=B?.headers??{},e("Creating new HttpProxyAgent instance: %o",this.proxy.href);const t=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...B?g(B,"headers"):null,host:t,port:r}}addRequest(Q,B){Q._header=null,this.setRequestProps(Q,B),super.addRequest(Q,B)}setRequestProps(Q,B){const{proxy:t}=this,r=B.secureEndpoint?"https:":"http:",a=Q.getHeader("host")||"localhost",o=`${r}//${a}`,u=new A.URL(Q.path,o);B.port!==80&&(u.port=String(B.port)),Q.path=String(u);const D=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(t.username||t.password){const f=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;D["Proxy-Authorization"]=`Basic ${Buffer.from(f).toString("base64")}`}D["Proxy-Connection"]||(D["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const f of Object.keys(D)){const y=D[f];y&&Q.setHeader(f,y)}}async connect(Q,B){Q._header=null,Q.path.includes("://")||this.setRequestProps(Q,B);let t,r;e("Regenerating stored HTTP header string for request"),Q._implicitHeader(),Q.outputData&&Q.outputData.length>0&&(e("Patching connection write() output buffer with updated header"),t=Q.outputData[0].data,r=t.indexOf(`\r
3
3
  \r
4
4
  `)+4,Q.outputData[0].data=Q._header+t.substring(r),e("Output buffer: %o",Q.outputData[0].data));let a;return this.proxy.protocol==="https:"?(e("Creating `tls.Socket`: %o",this.connectOpts),a=C.connect(this.connectOpts)):(e("Creating `net.Socket`: %o",this.connectOpts),a=F.connect(this.connectOpts)),await(0,c.once)(a,"connect"),a}}I.protocols=["http","https"],PA.HttpProxyAgent=I;function g(i,...Q){const B={};let t;for(t in i)Q.includes(t)||(B[t]=i[t]);return B}return PA}var qA={},Re={exports:{}},pI,DC;function qQ(){if(DC)return pI;DC=1;var h=1e3,d=h*60,w=d*60,s=w*24,F=s*7,C=s*365.25;pI=function(e,I){I=I||{};var g=typeof e;if(g==="string"&&e.length>0)return n(e);if(g==="number"&&isFinite(e))return I.long?E(e):c(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function n(e){if(e=String(e),!(e.length>100)){var I=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(I){var g=parseFloat(I[1]),i=(I[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return g*C;case"weeks":case"week":case"w":return g*F;case"days":case"day":case"d":return g*s;case"hours":case"hour":case"hrs":case"hr":case"h":return g*w;case"minutes":case"minute":case"mins":case"min":case"m":return g*d;case"seconds":case"second":case"secs":case"sec":case"s":return g*h;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function c(e){var I=Math.abs(e);return I>=s?Math.round(e/s)+"d":I>=w?Math.round(e/w)+"h":I>=d?Math.round(e/d)+"m":I>=h?Math.round(e/h)+"s":e+"ms"}function E(e){var I=Math.abs(e);return I>=s?A(e,I,s,"day"):I>=w?A(e,I,w,"hour"):I>=d?A(e,I,d,"minute"):I>=h?A(e,I,h,"second"):e+" ms"}function A(e,I,g,i){var Q=I>=g*1.5;return Math.round(e/g)+" "+i+(Q?"s":"")}return pI}var SI,cC;function OQ(){if(cC)return SI;cC=1;function h(d){s.debug=s,s.default=s,s.coerce=A,s.disable=c,s.enable=C,s.enabled=E,s.humanize=qQ(),s.destroy=e,Object.keys(d).forEach(I=>{s[I]=d[I]}),s.names=[],s.skips=[],s.formatters={};function w(I){let g=0;for(let i=0;i<I.length;i++)g=(g<<5)-g+I.charCodeAt(i),g|=0;return s.colors[Math.abs(g)%s.colors.length]}s.selectColor=w;function s(I){let g,i=null,Q,B;function t(...r){if(!t.enabled)return;const a=t,o=Number(new Date),u=o-(g||o);a.diff=u,a.prev=g,a.curr=o,g=o,r[0]=s.coerce(r[0]),typeof r[0]!="string"&&r.unshift("%O");let D=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,(y,p)=>{if(y==="%%")return"%";D++;const S=s.formatters[p];if(typeof S=="function"){const R=r[D];y=S.call(a,R),r.splice(D,1),D--}return y}),s.formatArgs.call(a,r),(a.log||s.log).apply(a,r)}return t.namespace=I,t.useColors=s.useColors(),t.color=s.selectColor(I),t.extend=F,t.destroy=s.destroy,Object.defineProperty(t,"enabled",{enumerable:!0,configurable:!1,get:()=>i!==null?i:(Q!==s.namespaces&&(Q=s.namespaces,B=s.enabled(I)),B),set:r=>{i=r}}),typeof s.init=="function"&&s.init(t),t}function F(I,g){const i=s(this.namespace+(typeof g>"u"?":":g)+I);return i.log=this.log,i}function C(I){s.save(I),s.namespaces=I,s.names=[],s.skips=[];const g=(typeof I=="string"?I:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const i of g)i[0]==="-"?s.skips.push(i.slice(1)):s.names.push(i)}function n(I,g){let i=0,Q=0,B=-1,t=0;for(;i<I.length;)if(Q<g.length&&(g[Q]===I[i]||g[Q]==="*"))g[Q]==="*"?(B=Q,t=i,Q++):(i++,Q++);else if(B!==-1)Q=B+1,t++,i=t;else return!1;for(;Q<g.length&&g[Q]==="*";)Q++;return Q===g.length}function c(){const I=[...s.names,...s.skips.map(g=>"-"+g)].join(",");return s.enable(""),I}function E(I){for(const g of s.skips)if(n(I,g))return!1;for(const g of s.names)if(n(I,g))return!0;return!1}function A(I){return I instanceof Error?I.stack||I.message:I}function e(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return s.enable(s.load()),s}return SI=h,SI}var hC;function Zt(){return hC||(hC=1,(function(h,d){var w={};d.formatArgs=F,d.save=C,d.load=n,d.useColors=s,d.storage=c(),d.destroy=(()=>{let A=!1;return()=>{A||(A=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),d.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function s(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let A;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(A=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(A[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function F(A){if(A[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+A[0]+(this.useColors?"%c ":" ")+"+"+h.exports.humanize(this.diff),!this.useColors)return;const e="color: "+this.color;A.splice(1,0,e,"color: inherit");let I=0,g=0;A[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(I++,i==="%c"&&(g=I))}),A.splice(g,0,e)}d.log=console.debug||console.log||(()=>{});function C(A){try{A?d.storage.setItem("debug",A):d.storage.removeItem("debug")}catch{}}function n(){let A;try{A=d.storage.getItem("debug")||d.storage.getItem("DEBUG")}catch{}return!A&&typeof process<"u"&&"env"in process&&(A=w.DEBUG),A}function c(){try{return localStorage}catch{}}h.exports=OQ()(d);const{formatters:E}=h.exports;E.j=function(A){try{return JSON.stringify(A)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}})(Re,Re.exports)),Re.exports}var cg={},lC;function WQ(){if(lC)return cg;lC=1;var h=cg&&cg.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(cg,"__esModule",{value:!0}),cg.parseProxyResponse=void 0;const w=(0,h(Zt()).default)("https-proxy-agent:parse-proxy-response");function s(F){return new Promise((C,n)=>{let c=0;const E=[];function A(){const Q=F.read();Q?i(Q):F.once("readable",A)}function e(){F.removeListener("end",I),F.removeListener("error",g),F.removeListener("readable",A)}function I(){e(),w("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function g(Q){e(),w("onerror %o",Q),n(Q)}function i(Q){E.push(Q),c+=Q.length;const B=Buffer.concat(E,c),t=B.indexOf(`\r
@@ -1,3 +1,3 @@
1
- import{D as B,E as W}from"./index-Xfgq0sxD.js";import{R as j,A as P,a as D,r as $,b as F,W as K}from"./stream-lEC9OYG2.js";const V=["ECONNRESET","EPIPE","ETIMEDOUT"],z=r=>{const e={};for(const t of Object.keys(r)){const n=r[t];e[t]=Array.isArray(n)?n.join(","):n}return e},l={setTimeout:(r,e)=>setTimeout(r,e),clearTimeout:r=>clearTimeout(r)},H=1e3,q=(r,e,t=0)=>{if(!t)return-1;const n=s=>{const i=l.setTimeout(()=>{r.destroy(),e(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${t} ms.`),{name:"TimeoutError"}))},t-s),o=a=>{a?.connecting?a.on("connect",()=>{l.clearTimeout(i)}):l.clearTimeout(i)};r.socket?o(r.socket):r.on("socket",o)};return t<2e3?(n(0),0):l.setTimeout(n.bind(null,H),H)},Q=(r,e,t=0,n,s)=>t?l.setTimeout(()=>{let i=`@smithy/node-http-handler - [${n?"ERROR":"WARN"}] a request has exceeded the configured ${t} ms requestTimeout.`;if(n){const o=Object.assign(new Error(i),{name:"TimeoutError",code:"ETIMEDOUT"});r.destroy(o),e(o)}else i+=" Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.",s?.warn?.(i)},t):-1,J=3e3,G=(r,{keepAlive:e,keepAliveMsecs:t},n=J)=>{if(e!==!0)return-1;const s=()=>{r.socket?r.socket.setKeepAlive(e,t||0):r.on("socket",i=>{i.setKeepAlive(e,t||0)})};return n===0?(s(),0):l.setTimeout(s,n)},U=3e3,X=(r,e,t=0)=>{const n=s=>{const i=t-s,o=()=>{r.destroy(),e(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${t} ms of inactivity (configured by client requestHandler).`),{name:"TimeoutError"}))};r.socket?(r.socket.setTimeout(i,o),r.on("close",()=>r.socket?.removeListener("timeout",o))):r.setTimeout(i,o)};return 0<t&&t<6e3?(n(0),0):l.setTimeout(n.bind(null,t===0?0:U),U)},N=6e3;async function I(r,e,t=N,n=!1){const s=e.headers??{},i=s.Expect||s.expect;let o=-1,a=!0;!n&&i==="100-continue"&&(a=await Promise.race([new Promise(c=>{o=Number(l.setTimeout(()=>c(!0),Math.max(N,t)))}),new Promise(c=>{r.on("continue",()=>{l.clearTimeout(o),c(!0)}),r.on("response",()=>{l.clearTimeout(o),c(!1)}),r.on("error",()=>{l.clearTimeout(o),c(!1)})})])),a&&Y(r,e.body)}function Y(r,e){if(e instanceof j){e.pipe(r);return}if(e){const t=Buffer.isBuffer(e);if(t||typeof e=="string"){t&&e.byteLength===0?r.end():r.end(e);return}const s=e;if(typeof s=="object"&&s.buffer&&typeof s.byteOffset=="number"&&typeof s.byteLength=="number"){r.end(Buffer.from(s.buffer,s.byteOffset,s.byteLength));return}r.end(Buffer.from(e));return}r.end()}const fe=0;class L{config;configProvider;socketWarningTimestamp=0;externalAgent=!1;metadata={handlerProtocol:"http/1.1"};static create(e){return typeof e?.handle=="function"?e:new L(e)}static checkSocketUsage(e,t,n=console){const{sockets:s,requests:i,maxSockets:o}=e;if(typeof o!="number"||o===1/0||Date.now()-15e3<t)return t;if(s&&i)for(const c in s){const h=s[c]?.length??0,d=i[c]?.length??0;if(h>=o&&d>=2*o)return n?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${h} and ${d} additional requests are enqueued.
1
+ import{D as B,E as W}from"./index-B0F7PxWn.js";import{R as j,A as P,a as D,r as $,b as F,W as K}from"./stream-lEC9OYG2.js";const V=["ECONNRESET","EPIPE","ETIMEDOUT"],z=r=>{const e={};for(const t of Object.keys(r)){const n=r[t];e[t]=Array.isArray(n)?n.join(","):n}return e},l={setTimeout:(r,e)=>setTimeout(r,e),clearTimeout:r=>clearTimeout(r)},H=1e3,q=(r,e,t=0)=>{if(!t)return-1;const n=s=>{const i=l.setTimeout(()=>{r.destroy(),e(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${t} ms.`),{name:"TimeoutError"}))},t-s),o=a=>{a?.connecting?a.on("connect",()=>{l.clearTimeout(i)}):l.clearTimeout(i)};r.socket?o(r.socket):r.on("socket",o)};return t<2e3?(n(0),0):l.setTimeout(n.bind(null,H),H)},Q=(r,e,t=0,n,s)=>t?l.setTimeout(()=>{let i=`@smithy/node-http-handler - [${n?"ERROR":"WARN"}] a request has exceeded the configured ${t} ms requestTimeout.`;if(n){const o=Object.assign(new Error(i),{name:"TimeoutError",code:"ETIMEDOUT"});r.destroy(o),e(o)}else i+=" Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.",s?.warn?.(i)},t):-1,J=3e3,G=(r,{keepAlive:e,keepAliveMsecs:t},n=J)=>{if(e!==!0)return-1;const s=()=>{r.socket?r.socket.setKeepAlive(e,t||0):r.on("socket",i=>{i.setKeepAlive(e,t||0)})};return n===0?(s(),0):l.setTimeout(s,n)},U=3e3,X=(r,e,t=0)=>{const n=s=>{const i=t-s,o=()=>{r.destroy(),e(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${t} ms of inactivity (configured by client requestHandler).`),{name:"TimeoutError"}))};r.socket?(r.socket.setTimeout(i,o),r.on("close",()=>r.socket?.removeListener("timeout",o))):r.setTimeout(i,o)};return 0<t&&t<6e3?(n(0),0):l.setTimeout(n.bind(null,t===0?0:U),U)},N=6e3;async function I(r,e,t=N,n=!1){const s=e.headers??{},i=s.Expect||s.expect;let o=-1,a=!0;!n&&i==="100-continue"&&(a=await Promise.race([new Promise(c=>{o=Number(l.setTimeout(()=>c(!0),Math.max(N,t)))}),new Promise(c=>{r.on("continue",()=>{l.clearTimeout(o),c(!0)}),r.on("response",()=>{l.clearTimeout(o),c(!1)}),r.on("error",()=>{l.clearTimeout(o),c(!1)})})])),a&&Y(r,e.body)}function Y(r,e){if(e instanceof j){e.pipe(r);return}if(e){const t=Buffer.isBuffer(e);if(t||typeof e=="string"){t&&e.byteLength===0?r.end():r.end(e);return}const s=e;if(typeof s=="object"&&s.buffer&&typeof s.byteOffset=="number"&&typeof s.byteLength=="number"){r.end(Buffer.from(s.buffer,s.byteOffset,s.byteLength));return}r.end(Buffer.from(e));return}r.end()}const fe=0;class L{config;configProvider;socketWarningTimestamp=0;externalAgent=!1;metadata={handlerProtocol:"http/1.1"};static create(e){return typeof e?.handle=="function"?e:new L(e)}static checkSocketUsage(e,t,n=console){const{sockets:s,requests:i,maxSockets:o}=e;if(typeof o!="number"||o===1/0||Date.now()-15e3<t)return t;if(s&&i)for(const c in s){const h=s[c]?.length??0,d=i[c]?.length??0;if(h>=o&&d>=2*o)return n?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${h} and ${d} additional requests are enqueued.
2
2
  See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
3
3
  or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}constructor(e){this.configProvider=new Promise((t,n)=>{typeof e=="function"?e().then(s=>{t(this.resolveDefaultConfig(s))}).catch(n):t(this.resolveDefaultConfig(e))})}resolveDefaultConfig(e){const{requestTimeout:t,connectionTimeout:n,socketTimeout:s,socketAcquisitionWarningTimeout:i,httpAgent:o,httpsAgent:a,throwOnRequestTimeout:c,logger:h}=e||{},d=!0,T=50;return{connectionTimeout:n,requestTimeout:t,socketTimeout:s,socketAcquisitionWarningTimeout:i,throwOnRequestTimeout:c,httpAgent:o instanceof D||typeof o?.destroy=="function"?(this.externalAgent=!0,o):new D({keepAlive:d,maxSockets:T,...o}),httpsAgent:a instanceof P||typeof a?.destroy=="function"?(this.externalAgent=!0,a):new P({keepAlive:d,maxSockets:T,...a}),logger:h}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:t,requestTimeout:n}={}){return this.config||(this.config=await this.configProvider),new Promise((s,i)=>{const o=this.config;let a;const c=[],h=async u=>{await a,c.forEach(l.clearTimeout),i(u)};if(t?.aborted){const u=new Error("Request aborted");u.name="AbortError",h(u);return}const d=e.protocol==="https:",T=e.headers??{},S=(T.Expect??T.expect)==="100-continue";let b=d?o.httpsAgent:o.httpAgent;S&&!this.externalAgent&&(b=new(d?P:D)({keepAlive:!1,maxSockets:1/0})),c.push(l.setTimeout(()=>{this.socketWarningTimestamp=L.checkSocketUsage(b,this.socketWarningTimestamp,o.logger)},o.socketAcquisitionWarningTimeout??(o.requestTimeout??2e3)+(o.connectionTimeout??1e3)));const v=B(e.query||{});(e.username!=null||e.password!=null)&&(e.username,e.password);let C=e.path;v&&(C+=`?${v}`),e.fragment&&(C+=`#${e.fragment}`);let w=e.hostname??"";w[0]==="["&&w.endsWith("]")?w=e.hostname.slice(1,-1):w=e.hostname;const k={headers:e.headers,method:e.method,port:e.port,agent:b},y=(d?$:F)();if(y.on("error",u=>{V.includes(u.code)?h(Object.assign(u,{name:"TimeoutError"})):h(u)}),t){const u=()=>{y.destroy();const p=new Error("Request aborted");p.name="AbortError",h(p)};if(typeof t.addEventListener=="function"){const p=t;p.addEventListener("abort",u,{once:!0}),y.once("close",()=>p.removeEventListener("abort",u))}else t.onabort=u}const A=n??o.requestTimeout;c.push(q(y,h,o.connectionTimeout)),c.push(Q(y,h,A,o.throwOnRequestTimeout,o.logger??console)),c.push(X(y,h,o.socketTimeout));const m=k.agent;typeof m=="object"&&"keepAlive"in m&&c.push(G(y,{keepAlive:m.keepAlive,keepAliveMsecs:m.keepAliveMsecs})),a=I(y,e,A,this.externalAgent).catch(u=>(c.forEach(l.clearTimeout),i(u)))})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>({...n,[e]:t}))}httpHandlerConfigs(){return this.config??{}}}const _={};function Z(){throw new Error("http2.createServer is not available in the browser")}function ee(){throw new Error("http2.connect is not available in the browser")}const te={constants:_,createServer:Z,connect:ee};class ne{sessions=[];constructor(e){this.sessions=e??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(e){this.sessions.push(e)}contains(e){return this.sessions.includes(e)}remove(e){this.sessions=this.sessions.filter(t=>t!==e)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(e){for(const t of this.sessions)t===e&&(t.destroyed||t.destroy())}}class oe{constructor(e){if(this.config=e,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}config;sessionCache=new Map;lease(e,t){const n=this.getUrlString(e),s=this.sessionCache.get(n);if(s){const c=s.poll();if(c&&!this.config.disableConcurrency)return c}const i=te.connect(n);this.config.maxConcurrency&&i.settings({maxConcurrentStreams:this.config.maxConcurrency},c=>{if(c)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+e.destination.toString())}),i.unref();const o=()=>{i.destroy(),this.deleteSession(n,i)};i.on("goaway",o),i.on("error",o),i.on("frameError",o),i.on("close",()=>this.deleteSession(n,i)),t.requestTimeout&&i.setTimeout(t.requestTimeout,o);const a=this.sessionCache.get(n)||new ne;return a.offerLast(i),this.sessionCache.set(n,a),i}deleteSession(e,t){const n=this.sessionCache.get(e);n&&n.contains(t)&&(n.remove(t),this.sessionCache.set(e,n))}release(e,t){const n=this.getUrlString(e);this.sessionCache.get(n)?.offerLast(t)}destroy(){for(const[e,t]of this.sessionCache){for(const n of t)n.destroyed||n.destroy(),t.remove(n);this.sessionCache.delete(e)}}setMaxConcurrentStreams(e){if(e&&e<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=e}setDisableConcurrentStreams(e){this.config.disableConcurrency=e}getUrlString(e){return e.destination.toString()}}class M{config;configProvider;metadata={handlerProtocol:"h2"};connectionManager=new oe({});static create(e){return typeof e?.handle=="function"?e:new M(e)}constructor(e){this.configProvider=new Promise((t,n)=>{typeof e=="function"?e().then(s=>{t(s||{})}).catch(n):t(e||{})})}destroy(){this.connectionManager.destroy()}async handle(e,{abortSignal:t,requestTimeout:n}={}){this.config||(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams&&this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams));const{requestTimeout:s,disableConcurrentStreams:i}=this.config,o=n??s;return new Promise((a,c)=>{let h=!1,d;const T=async f=>{await d,a(f)},S=async f=>{await d,c(f)};if(t?.aborted){h=!0;const f=new Error("Request aborted");f.name="AbortError",S(f);return}const{hostname:b,method:v,port:C,protocol:w,query:k}=e;let x="";if(e.username!=null||e.password!=null){const f=e.username??"",E=e.password??"";x=`${f}:${E}@`}const y=`${w}//${x}${b}${C?`:${C}`:""}`,A={destination:new URL(y)},m=this.connectionManager.lease(A,{requestTimeout:this.config?.sessionTimeout,disableConcurrentStreams:i||!1}),u=f=>{i&&this.destroySession(m),h=!0,S(f)},p=B(k||{});let R=e.path;p&&(R+=`?${p}`),e.fragment&&(R+=`#${e.fragment}`);const g=m.request({...e.headers,[_.HTTP2_HEADER_PATH]:R,[_.HTTP2_HEADER_METHOD]:v});if(m.ref(),g.on("response",f=>{const E=new W({statusCode:f[":status"]||-1,headers:z(f),body:g});h=!0,T({response:E}),i&&(m.close(),this.connectionManager.deleteSession(y,m))}),o&&g.setTimeout(o,()=>{g.close();const f=new Error(`Stream timed out because of no activity for ${o} ms`);f.name="TimeoutError",u(f)}),t){const f=()=>{g.close();const E=new Error("Request aborted");E.name="AbortError",u(E)};if(typeof t.addEventListener=="function"){const E=t;E.addEventListener("abort",f,{once:!0}),g.once("close",()=>E.removeEventListener("abort",f))}else t.onabort=f}g.on("frameError",(f,E,O)=>{u(new Error(`Frame type id ${f} in stream id ${O} has failed with code ${E}.`))}),g.on("error",u),g.on("aborted",()=>{u(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${g.rstCode}.`))}),g.on("close",()=>{m.unref(),i&&m.destroy(),h||u(new Error("Unexpected error: http2 request did not get a response"))}),d=I(g,e,o)})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>({...n,[e]:t}))}httpHandlerConfigs(){return this.config??{}}destroySession(e){e.destroyed||e.destroy()}}class re extends K{bufferedBytes=[];_write(e,t,n){this.bufferedBytes.push(e),n()}}const ue=r=>se(r)?ie(r):new Promise((e,t)=>{const n=new re;r.pipe(n),r.on("error",s=>{n.end(),t(s)}),n.on("error",t),n.on("finish",function(){const s=new Uint8Array(Buffer.concat(this.bufferedBytes));e(s)})}),se=r=>typeof ReadableStream=="function"&&r instanceof ReadableStream;async function ie(r){const e=[],t=r.getReader();let n=!1,s=0;for(;!n;){const{done:a,value:c}=await t.read();c&&(e.push(c),s+=c.length),n=a}const i=new Uint8Array(s);let o=0;for(const a of e)i.set(a,o),o+=a.length;return i}export{fe as DEFAULT_REQUEST_TIMEOUT,M as NodeHttp2Handler,L as NodeHttpHandler,ue as streamCollector};
@@ -1,4 +1,4 @@
1
- import{_ as M}from"./index-Xfgq0sxD.js";let w;const _=globalThis.process?.release?.name==="node",E=typeof window<"u";async function g(t,e={}){const{getDocument:a}=await p();return await a({data:t,isEvalSupported:!1,useSystemFonts:!0,...e}).promise}async function p(){return w||await f(),w}async function f(t,{reload:e=!1}={}){if(!(w&&!e)){if(t)try{w=await D(t());return}catch(a){throw new Error(`PDF.js could not be resolved: ${a}`)}try{w=await M(()=>import("./pdfjs-uyZuKmOq.js"),[])}catch(a){throw new Error(`Serverless PDF.js bundle could not be resolved: ${a}`)}}}function h(t){return typeof t=="object"&&t!==null&&"_pdfInfo"in t}async function D(t){const e=await t;return e.default||e}let d;/**
1
+ import{_ as M}from"./index-B0F7PxWn.js";let w;const _=globalThis.process?.release?.name==="node",E=typeof window<"u";async function g(t,e={}){const{getDocument:a}=await p();return await a({data:t,isEvalSupported:!1,useSystemFonts:!0,...e}).promise}async function p(){return w||await f(),w}async function f(t,{reload:e=!1}={}){if(!(w&&!e)){if(t)try{w=await D(t());return}catch(a){throw new Error(`PDF.js could not be resolved: ${a}`)}try{w=await M(()=>import("./pdfjs-uyZuKmOq.js"),[])}catch(a){throw new Error(`Serverless PDF.js bundle could not be resolved: ${a}`)}}}function h(t){return typeof t=="object"&&t!==null&&"_pdfInfo"in t}async function D(t){const e=await t;return e.default||e}let d;/**
2
2
  * Derived from the PDF.js project by the Mozilla Foundation.
3
3
  * @see https://github.com/mozilla/pdf.js/blob/b8de9a372f9bbf7e33adb362eeae5ef1919dba73/src/display/canvas_factory.js#L18
4
4
  * @license Apache-2.0
@@ -1 +1 @@
1
- import{c as f,B as C}from"./index-Xfgq0sxD.js";import{C as P,H as v,R as H}from"./index-Xfgq0sxD.js";const u="[slicc-tab-group]";let g=null;async function p(o){try{if(g!==null)try{await chrome.tabs.group({tabIds:o,groupId:g});return}catch(e){console.info(u,"Tab group removed by user, recreating",{tabId:o,previousGroupId:g,error:e instanceof Error?e.message:String(e)}),g=null}g=await chrome.tabs.group({tabIds:o}),await chrome.tabGroups.update(g,{title:"slicc",color:"pink",collapsed:!1})}catch(e){console.warn(u,"Tab grouping failed (best-effort, continuing without group)",{tabId:o,error:e instanceof Error?e.message:String(e)})}}const h=f("cdp:debugger");class y{_state="disconnected";listeners=new Map;sessionToTab=new Map;attachedTabs=new Set;onEventHandler=(e,s,t)=>{if(!this.attachedTabs.has(e.tabId))return;let n;for(const[a,i]of this.sessionToTab)if(i===e.tabId){n=a;break}h.debug("Event",{tabId:e.tabId,method:s,sessionId:n});const r=this.listeners.get(s);if(r){const a=n?{...t,sessionId:n}:t??{};for(const i of r)try{i(a)}catch(d){h.error("CDP event listener error",{method:s,error:d instanceof Error?d.message:String(d)})}}};onDetachHandler=(e,s)=>{h.warn("Debugger detached",{tabId:e.tabId,reason:s}),this.attachedTabs.delete(e.tabId);for(const[t,n]of this.sessionToTab)n===e.tabId&&this.sessionToTab.delete(t);this.attachedTabs.size===0&&(this._state="disconnected")};get state(){return this._state}async connect(e){if(this._state!=="disconnected")throw new Error(`Cannot connect: state is ${this._state}`);chrome.debugger.onEvent.addListener(this.onEventHandler),chrome.debugger.onDetach.addListener(this.onDetachHandler),this._state="connected",h.info("DebuggerClient connected (extension mode)")}disconnect(){for(const e of this.attachedTabs)chrome.debugger.detach({tabId:e}).catch(s=>{h.debug("Detach during disconnect",{tabId:e,error:s instanceof Error?s.message:String(s)})});chrome.debugger.onEvent.removeListener(this.onEventHandler),chrome.debugger.onDetach.removeListener(this.onDetachHandler),this.attachedTabs.clear(),this.sessionToTab.clear(),this._state="disconnected",h.info("DebuggerClient disconnected")}async send(e,s,t,n){if(this._state!=="connected")throw new Error("DebuggerClient is not connected");switch(e){case"Target.getTargets":return this.handleGetTargets();case"Target.attachToTarget":return this.handleAttachToTarget(s);case"Target.detachFromTarget":return this.handleDetachFromTarget(s);case"Target.createTarget":return this.handleCreateTarget(s);case"Target.closeTarget":return this.handleCloseTarget(s);default:return this.sendCdpCommand(e,s,t)}}on(e,s){let t=this.listeners.get(e);t||(t=new Set,this.listeners.set(e,t)),t.add(s)}off(e,s){const t=this.listeners.get(e);t&&(t.delete(s),t.size===0&&this.listeners.delete(e))}once(e,s=3e4){return new Promise((t,n)=>{const r=setTimeout(()=>{this.off(e,a),n(new Error(`Timed out waiting for event: ${e}`))},s),a=i=>{clearTimeout(r),this.off(e,a),t(i)};this.on(e,a)})}async handleGetTargets(){const[e,s]=await Promise.all([chrome.tabs.query({}),chrome.tabs.query({active:!0,currentWindow:!0})]),t=new Set(s.map(r=>r.id));return{targetInfos:e.map(r=>({targetId:String(r.id),type:"page",title:r.title??"",url:r.url??"",attached:this.attachedTabs.has(r.id),active:t.has(r.id)}))}}async handleAttachToTarget(e){const s=e.targetId,t=parseInt(s,10);if(!Number.isFinite(t)||t<=0)throw new Error(`Invalid targetId: ${s}`);this.attachedTabs.has(t)||(await chrome.debugger.attach({tabId:t},"1.3"),this.attachedTabs.add(t));const n=s;return this.sessionToTab.set(n,t),{sessionId:n}}async handleDetachFromTarget(e){const s=e.sessionId,t=this.sessionToTab.get(s);return t!==void 0&&(this.sessionToTab.delete(s),[...this.sessionToTab.values()].includes(t)||(this.attachedTabs.delete(t),await chrome.debugger.detach({tabId:t}).catch(r=>{h.debug("Detach failed (tab may be closed)",{tabId:t,error:r instanceof Error?r.message:String(r)})}))),{}}async handleCreateTarget(e){const s=e.url??"about:blank",t=await chrome.tabs.create({url:s,active:!1});return await p(t.id),{targetId:String(t.id)}}async handleCloseTarget(e){const s=e.targetId,t=parseInt(s,10);if(!Number.isFinite(t)||t<=0)throw new Error(`Invalid targetId: ${s}`);for(const[n,r]of this.sessionToTab)r===t&&this.sessionToTab.delete(n);return this.attachedTabs.has(t)&&(this.attachedTabs.delete(t),await chrome.debugger.detach({tabId:t}).catch(n=>{h.debug("Detach before close failed",{tabId:t,error:n instanceof Error?n.message:String(n)})})),await chrome.tabs.remove(t),{success:!0}}async sendCdpCommand(e,s,t){const n=t?this.sessionToTab.get(t):void 0;if(n===void 0)throw new Error(`No tab attached for sessionId: ${t??"(none)"}. Attach to a target first.`);return h.debug("Send",{method:e,tabId:n,sessionId:t}),await chrome.debugger.sendCommand({tabId:n},e,s)??{}}}class I{_state="disconnected";nextCommandId=1;listeners=new Map;pendingCommands=new Map;messageHandler=null;get state(){return this._state}async connect(e){if(this._state!=="disconnected")throw new Error(`Cannot connect: state is ${this._state}`);this.messageHandler=s=>{if(!T(s))return;const t=s;if(t.source!=="service-worker")return;const n=t.payload;n.type==="cdp-response"?this.handleCdpResponse(n):n.type==="cdp-event"&&this.handleCdpEvent(n)},chrome.runtime.onMessage.addListener(this.messageHandler),this._state="connected"}disconnect(){this.messageHandler&&(chrome.runtime.onMessage.removeListener(this.messageHandler),this.messageHandler=null);for(const[,e]of this.pendingCommands)clearTimeout(e.timer),e.reject(new Error("CDP proxy disconnected"));this.pendingCommands.clear(),this.listeners.clear(),this._state="disconnected"}async send(e,s,t,n=3e4){if(this._state!=="connected")throw new Error("OffscreenCdpProxy is not connected");const r=this.nextCommandId++,a={type:"cdp-command",id:r,method:e,params:s,sessionId:t};return new Promise((i,d)=>{let c=!1;const m=setTimeout(()=>{c||(c=!0,this.pendingCommands.delete(r),d(new Error(`CDP command timed out after ${n}ms: ${e}`)))},n);this.pendingCommands.set(r,{resolve:i,reject:d,timer:m}),chrome.runtime.sendMessage({source:"offscreen",payload:a}).catch(l=>{c||(c=!0,this.pendingCommands.delete(r),clearTimeout(m),d(new Error(`Failed to send CDP command: ${l instanceof Error?l.message:String(l)}`)))})})}on(e,s){let t=this.listeners.get(e);t||(t=new Set,this.listeners.set(e,t)),t.add(s)}off(e,s){const t=this.listeners.get(e);t&&(t.delete(s),t.size===0&&this.listeners.delete(e))}once(e,s=3e4){return new Promise((t,n)=>{const r=setTimeout(()=>{this.off(e,a),n(new Error(`Timed out waiting for event: ${e}`))},s),a=i=>{clearTimeout(r),this.off(e,a),t(i)};this.on(e,a)})}handleCdpResponse(e){const s=this.pendingCommands.get(e.id);s&&(this.pendingCommands.delete(e.id),clearTimeout(s.timer),e.error?s.reject(new Error(e.error)):s.resolve(e.result??{}))}handleCdpEvent(e){const s=this.listeners.get(e.method);if(s)for(const t of s)try{t(e.params??{})}catch{}}}function T(o){return typeof o=="object"&&o!==null&&"source"in o&&"payload"in o}class E{_state="disconnected";nextCommandId=1;listeners=new Map;pendingCommands=new Map;messageHandler=null;get state(){return this._state}async connect(e){if(this._state!=="disconnected")throw new Error(`Cannot connect: state is ${this._state}`);this.messageHandler=s=>{try{if(!b(s))return;const t=s;t.source==="offscreen"&&t.payload.type==="panel-cdp-response"&&this.handleCdpResponse(t.payload),t.source==="service-worker"&&t.payload.type==="cdp-event"&&this.handleCdpEvent(t.payload)}catch(t){console.error("[panel-cdp-proxy] Error in message handler:",t)}},chrome.runtime.onMessage.addListener(this.messageHandler),this._state="connected"}disconnect(){this.messageHandler&&(chrome.runtime.onMessage.removeListener(this.messageHandler),this.messageHandler=null);for(const[,e]of this.pendingCommands)clearTimeout(e.timer),e.reject(new Error("Panel CDP proxy disconnected"));this.pendingCommands.clear(),this.listeners.clear(),this._state="disconnected"}async send(e,s,t,n=3e4){if(this._state!=="connected")throw new Error("PanelCdpProxy is not connected");const r=this.nextCommandId++,a={type:"panel-cdp-command",id:r,method:e,params:s,sessionId:t};return new Promise((i,d)=>{let c=!1;const m=setTimeout(()=>{c||(c=!0,this.pendingCommands.delete(r),d(new Error(`CDP command timed out after ${n}ms: ${e}`)))},n);this.pendingCommands.set(r,{resolve:i,reject:d,timer:m}),chrome.runtime.sendMessage({source:"panel",payload:a}).catch(l=>{c||(c=!0,this.pendingCommands.delete(r),clearTimeout(m),d(new Error(`Failed to send CDP command: ${l instanceof Error?l.message:String(l)}`)))})})}on(e,s){let t=this.listeners.get(e);t||(t=new Set,this.listeners.set(e,t)),t.add(s)}off(e,s){const t=this.listeners.get(e);t&&(t.delete(s),t.size===0&&this.listeners.delete(e))}once(e,s=3e4){return new Promise((t,n)=>{const r=setTimeout(()=>{this.off(e,a),n(new Error(`Timed out waiting for event: ${e}`))},s),a=i=>{clearTimeout(r),this.off(e,a),t(i)};this.on(e,a)})}handleCdpResponse(e){const s=this.pendingCommands.get(e.id);if(!s){console.warn(`[panel-cdp-proxy] Ignoring CDP response with unknown id ${e.id}`);return}this.pendingCommands.delete(e.id),clearTimeout(s.timer),e.error?s.reject(new Error(e.error)):s.resolve(e.result??{})}handleCdpEvent(e){const s=this.listeners.get(e.method);if(s)for(const t of s)try{t(e.params??{})}catch(n){console.error(`[panel-cdp-proxy] Listener error for event "${e.method}":`,n)}}}function b(o){return typeof o=="object"&&o!==null&&"source"in o&&"payload"in o}export{C as BrowserAPI,P as CDPClient,y as DebuggerClient,v as HarRecorder,I as OffscreenCdpProxy,E as PanelCdpProxy,H as RemoteCDPTransport};
1
+ import{c as f,B as C}from"./index-B0F7PxWn.js";import{C as P,H as v,R as H}from"./index-B0F7PxWn.js";const u="[slicc-tab-group]";let g=null;async function p(o){try{if(g!==null)try{await chrome.tabs.group({tabIds:o,groupId:g});return}catch(e){console.info(u,"Tab group removed by user, recreating",{tabId:o,previousGroupId:g,error:e instanceof Error?e.message:String(e)}),g=null}g=await chrome.tabs.group({tabIds:o}),await chrome.tabGroups.update(g,{title:"slicc",color:"pink",collapsed:!1})}catch(e){console.warn(u,"Tab grouping failed (best-effort, continuing without group)",{tabId:o,error:e instanceof Error?e.message:String(e)})}}const h=f("cdp:debugger");class y{_state="disconnected";listeners=new Map;sessionToTab=new Map;attachedTabs=new Set;onEventHandler=(e,s,t)=>{if(!this.attachedTabs.has(e.tabId))return;let n;for(const[a,i]of this.sessionToTab)if(i===e.tabId){n=a;break}h.debug("Event",{tabId:e.tabId,method:s,sessionId:n});const r=this.listeners.get(s);if(r){const a=n?{...t,sessionId:n}:t??{};for(const i of r)try{i(a)}catch(d){h.error("CDP event listener error",{method:s,error:d instanceof Error?d.message:String(d)})}}};onDetachHandler=(e,s)=>{h.warn("Debugger detached",{tabId:e.tabId,reason:s}),this.attachedTabs.delete(e.tabId);for(const[t,n]of this.sessionToTab)n===e.tabId&&this.sessionToTab.delete(t);this.attachedTabs.size===0&&(this._state="disconnected")};get state(){return this._state}async connect(e){if(this._state!=="disconnected")throw new Error(`Cannot connect: state is ${this._state}`);chrome.debugger.onEvent.addListener(this.onEventHandler),chrome.debugger.onDetach.addListener(this.onDetachHandler),this._state="connected",h.info("DebuggerClient connected (extension mode)")}disconnect(){for(const e of this.attachedTabs)chrome.debugger.detach({tabId:e}).catch(s=>{h.debug("Detach during disconnect",{tabId:e,error:s instanceof Error?s.message:String(s)})});chrome.debugger.onEvent.removeListener(this.onEventHandler),chrome.debugger.onDetach.removeListener(this.onDetachHandler),this.attachedTabs.clear(),this.sessionToTab.clear(),this._state="disconnected",h.info("DebuggerClient disconnected")}async send(e,s,t,n){if(this._state!=="connected")throw new Error("DebuggerClient is not connected");switch(e){case"Target.getTargets":return this.handleGetTargets();case"Target.attachToTarget":return this.handleAttachToTarget(s);case"Target.detachFromTarget":return this.handleDetachFromTarget(s);case"Target.createTarget":return this.handleCreateTarget(s);case"Target.closeTarget":return this.handleCloseTarget(s);default:return this.sendCdpCommand(e,s,t)}}on(e,s){let t=this.listeners.get(e);t||(t=new Set,this.listeners.set(e,t)),t.add(s)}off(e,s){const t=this.listeners.get(e);t&&(t.delete(s),t.size===0&&this.listeners.delete(e))}once(e,s=3e4){return new Promise((t,n)=>{const r=setTimeout(()=>{this.off(e,a),n(new Error(`Timed out waiting for event: ${e}`))},s),a=i=>{clearTimeout(r),this.off(e,a),t(i)};this.on(e,a)})}async handleGetTargets(){const[e,s]=await Promise.all([chrome.tabs.query({}),chrome.tabs.query({active:!0,currentWindow:!0})]),t=new Set(s.map(r=>r.id));return{targetInfos:e.map(r=>({targetId:String(r.id),type:"page",title:r.title??"",url:r.url??"",attached:this.attachedTabs.has(r.id),active:t.has(r.id)}))}}async handleAttachToTarget(e){const s=e.targetId,t=parseInt(s,10);if(!Number.isFinite(t)||t<=0)throw new Error(`Invalid targetId: ${s}`);this.attachedTabs.has(t)||(await chrome.debugger.attach({tabId:t},"1.3"),this.attachedTabs.add(t));const n=s;return this.sessionToTab.set(n,t),{sessionId:n}}async handleDetachFromTarget(e){const s=e.sessionId,t=this.sessionToTab.get(s);return t!==void 0&&(this.sessionToTab.delete(s),[...this.sessionToTab.values()].includes(t)||(this.attachedTabs.delete(t),await chrome.debugger.detach({tabId:t}).catch(r=>{h.debug("Detach failed (tab may be closed)",{tabId:t,error:r instanceof Error?r.message:String(r)})}))),{}}async handleCreateTarget(e){const s=e.url??"about:blank",t=await chrome.tabs.create({url:s,active:!1});return await p(t.id),{targetId:String(t.id)}}async handleCloseTarget(e){const s=e.targetId,t=parseInt(s,10);if(!Number.isFinite(t)||t<=0)throw new Error(`Invalid targetId: ${s}`);for(const[n,r]of this.sessionToTab)r===t&&this.sessionToTab.delete(n);return this.attachedTabs.has(t)&&(this.attachedTabs.delete(t),await chrome.debugger.detach({tabId:t}).catch(n=>{h.debug("Detach before close failed",{tabId:t,error:n instanceof Error?n.message:String(n)})})),await chrome.tabs.remove(t),{success:!0}}async sendCdpCommand(e,s,t){const n=t?this.sessionToTab.get(t):void 0;if(n===void 0)throw new Error(`No tab attached for sessionId: ${t??"(none)"}. Attach to a target first.`);return h.debug("Send",{method:e,tabId:n,sessionId:t}),await chrome.debugger.sendCommand({tabId:n},e,s)??{}}}class I{_state="disconnected";nextCommandId=1;listeners=new Map;pendingCommands=new Map;messageHandler=null;get state(){return this._state}async connect(e){if(this._state!=="disconnected")throw new Error(`Cannot connect: state is ${this._state}`);this.messageHandler=s=>{if(!T(s))return;const t=s;if(t.source!=="service-worker")return;const n=t.payload;n.type==="cdp-response"?this.handleCdpResponse(n):n.type==="cdp-event"&&this.handleCdpEvent(n)},chrome.runtime.onMessage.addListener(this.messageHandler),this._state="connected"}disconnect(){this.messageHandler&&(chrome.runtime.onMessage.removeListener(this.messageHandler),this.messageHandler=null);for(const[,e]of this.pendingCommands)clearTimeout(e.timer),e.reject(new Error("CDP proxy disconnected"));this.pendingCommands.clear(),this.listeners.clear(),this._state="disconnected"}async send(e,s,t,n=3e4){if(this._state!=="connected")throw new Error("OffscreenCdpProxy is not connected");const r=this.nextCommandId++,a={type:"cdp-command",id:r,method:e,params:s,sessionId:t};return new Promise((i,d)=>{let c=!1;const m=setTimeout(()=>{c||(c=!0,this.pendingCommands.delete(r),d(new Error(`CDP command timed out after ${n}ms: ${e}`)))},n);this.pendingCommands.set(r,{resolve:i,reject:d,timer:m}),chrome.runtime.sendMessage({source:"offscreen",payload:a}).catch(l=>{c||(c=!0,this.pendingCommands.delete(r),clearTimeout(m),d(new Error(`Failed to send CDP command: ${l instanceof Error?l.message:String(l)}`)))})})}on(e,s){let t=this.listeners.get(e);t||(t=new Set,this.listeners.set(e,t)),t.add(s)}off(e,s){const t=this.listeners.get(e);t&&(t.delete(s),t.size===0&&this.listeners.delete(e))}once(e,s=3e4){return new Promise((t,n)=>{const r=setTimeout(()=>{this.off(e,a),n(new Error(`Timed out waiting for event: ${e}`))},s),a=i=>{clearTimeout(r),this.off(e,a),t(i)};this.on(e,a)})}handleCdpResponse(e){const s=this.pendingCommands.get(e.id);s&&(this.pendingCommands.delete(e.id),clearTimeout(s.timer),e.error?s.reject(new Error(e.error)):s.resolve(e.result??{}))}handleCdpEvent(e){const s=this.listeners.get(e.method);if(s)for(const t of s)try{t(e.params??{})}catch{}}}function T(o){return typeof o=="object"&&o!==null&&"source"in o&&"payload"in o}class E{_state="disconnected";nextCommandId=1;listeners=new Map;pendingCommands=new Map;messageHandler=null;get state(){return this._state}async connect(e){if(this._state!=="disconnected")throw new Error(`Cannot connect: state is ${this._state}`);this.messageHandler=s=>{try{if(!b(s))return;const t=s;t.source==="offscreen"&&t.payload.type==="panel-cdp-response"&&this.handleCdpResponse(t.payload),t.source==="service-worker"&&t.payload.type==="cdp-event"&&this.handleCdpEvent(t.payload)}catch(t){console.error("[panel-cdp-proxy] Error in message handler:",t)}},chrome.runtime.onMessage.addListener(this.messageHandler),this._state="connected"}disconnect(){this.messageHandler&&(chrome.runtime.onMessage.removeListener(this.messageHandler),this.messageHandler=null);for(const[,e]of this.pendingCommands)clearTimeout(e.timer),e.reject(new Error("Panel CDP proxy disconnected"));this.pendingCommands.clear(),this.listeners.clear(),this._state="disconnected"}async send(e,s,t,n=3e4){if(this._state!=="connected")throw new Error("PanelCdpProxy is not connected");const r=this.nextCommandId++,a={type:"panel-cdp-command",id:r,method:e,params:s,sessionId:t};return new Promise((i,d)=>{let c=!1;const m=setTimeout(()=>{c||(c=!0,this.pendingCommands.delete(r),d(new Error(`CDP command timed out after ${n}ms: ${e}`)))},n);this.pendingCommands.set(r,{resolve:i,reject:d,timer:m}),chrome.runtime.sendMessage({source:"panel",payload:a}).catch(l=>{c||(c=!0,this.pendingCommands.delete(r),clearTimeout(m),d(new Error(`Failed to send CDP command: ${l instanceof Error?l.message:String(l)}`)))})})}on(e,s){let t=this.listeners.get(e);t||(t=new Set,this.listeners.set(e,t)),t.add(s)}off(e,s){const t=this.listeners.get(e);t&&(t.delete(s),t.size===0&&this.listeners.delete(e))}once(e,s=3e4){return new Promise((t,n)=>{const r=setTimeout(()=>{this.off(e,a),n(new Error(`Timed out waiting for event: ${e}`))},s),a=i=>{clearTimeout(r),this.off(e,a),t(i)};this.on(e,a)})}handleCdpResponse(e){const s=this.pendingCommands.get(e.id);if(!s){console.warn(`[panel-cdp-proxy] Ignoring CDP response with unknown id ${e.id}`);return}this.pendingCommands.delete(e.id),clearTimeout(s.timer),e.error?s.reject(new Error(e.error)):s.resolve(e.result??{})}handleCdpEvent(e){const s=this.listeners.get(e.method);if(s)for(const t of s)try{t(e.params??{})}catch(n){console.error(`[panel-cdp-proxy] Listener error for event "${e.method}":`,n)}}}function b(o){return typeof o=="object"&&o!==null&&"source"in o&&"payload"in o}export{C as BrowserAPI,P as CDPClient,y as DebuggerClient,v as HarRecorder,I as OffscreenCdpProxy,E as PanelCdpProxy,H as RemoteCDPTransport};
@@ -1 +1 @@
1
- import{c as d}from"./index-Xfgq0sxD.js";const i=d("offscreen-client");class h{eventListeners=new Set;callbacks;scoops=[];scoopStatuses=new Map;currentMessageId=new Map;ready=!1;stateRetryTimer=null;localFs=null;selectedScoopJid=null;constructor(e){this.callbacks=e,this.setupMessageListener()}setLocalFS(e){this.localFs=e}createAgentHandle(){return{sendMessage:(e,s)=>{if(!this.selectedScoopJid){this.emitToUI({type:"error",error:"No scoop selected"});return}this.send({type:"user-message",scoopJid:this.selectedScoopJid,text:e,messageId:s??`msg-${Date.now()}-${Math.random().toString(36).slice(2,8)}`})},onEvent:e=>(this.eventListeners.add(e),()=>this.eventListeners.delete(e)),stop:()=>{this.selectedScoopJid&&this.send({type:"abort",scoopJid:this.selectedScoopJid})}}}getScoops(){return this.scoops}getScoop(e){return this.scoops.find(s=>s.jid===e)}isProcessing(e){return this.scoopStatuses.get(e)==="processing"}async registerScoop(e){this.scoops.find(s=>s.name===e.name)||(this.scoops.push(e),this.scoopStatuses.set(e.jid,"initializing")),this.send({type:"scoop-create",name:e.name,isCone:e.isCone})}async unregisterScoop(e){this.send({type:"scoop-drop",scoopJid:e}),this.scoops=this.scoops.filter(s=>s.jid!==e),this.scoopStatuses.delete(e)}createScoopTab(e){}async getGlobalMemory(){if(!this.localFs)return"";try{const e=await this.localFs.readFile("/shared/CLAUDE.md",{encoding:"utf-8"});return typeof e=="string"?e:new TextDecoder().decode(e)}catch{return""}}getScoopContext(e){if(this.localFs)return{getFS:()=>this.localFs}}getSharedFS(){return this.localFs}stopScoop(e){this.send({type:"abort",scoopJid:e})}async clearQueuedMessages(e){}async deleteQueuedMessage(e,s){}updateModel(){this.send({type:"refresh-model"})}async clearAllMessages(){this.send({type:"clear-chat"})}clearFilesystem(){this.send({type:"clear-filesystem"})}requestState(){this.send({type:"request-state"});let e=0;this.stateRetryTimer=setInterval(()=>{if(e++,this.ready||e>20){this.stateRetryTimer&&(clearInterval(this.stateRetryTimer),this.stateRetryTimer=null);return}i.debug("Retrying request-state",{attempt:e}),this.send({type:"request-state"})},500)}isReady(){return this.ready}sprinkleOpHandler=null;sendSprinkleLick(e,s){this.send({type:"sprinkle-lick",sprinkleName:e,body:s})}setSprinkleOpHandler(e){this.sprinkleOpHandler=e}setupMessageListener(){chrome.runtime.onMessage.addListener((e,s,t)=>{if(!p(e))return!1;const a=e;if(a.source==="offscreen"){const r=a.payload;if(r?.type==="debug-tabs"){const c=window.__slicc_debug_tabs;c?.(!!r.show)}else r?.type==="sprinkle-op"&&this.sprinkleOpHandler?this.sprinkleOpHandler(r):this.handleOffscreenMessage(a.payload)}return!1})}handleOffscreenMessage(e){switch(e.type){case"offscreen-ready":i.info("Offscreen engine ready"),this.ready||this.send({type:"request-state"});break;case"agent-event":this.handleAgentEvent(e);break;case"scoop-status":this.handleScoopStatus(e);break;case"scoop-created":this.handleScoopCreated(e);break;case"scoop-list":this.handleScoopList(e);break;case"state-snapshot":this.handleStateSnapshot(e);break;case"error":this.handleError(e);break;case"incoming-message":this.handleIncomingMessage(e);break}}handleAgentEvent(e){if(e.scoopJid===this.selectedScoopJid)switch(e.eventType){case"text_delta":{let s=this.currentMessageId.get(e.scoopJid);s||(s=`scoop-${e.scoopJid}-${n()}`,this.currentMessageId.set(e.scoopJid,s),this.emitToUI({type:"message_start",messageId:s})),this.emitToUI({type:"content_delta",messageId:s,text:e.text??""});break}case"tool_start":{let s=this.currentMessageId.get(e.scoopJid);s||(s=`scoop-${e.scoopJid}-${n()}`,this.currentMessageId.set(e.scoopJid,s),this.emitToUI({type:"message_start",messageId:s})),this.emitToUI({type:"tool_use_start",messageId:s,toolName:e.toolName??"",toolInput:e.toolInput});break}case"tool_end":{const s=this.currentMessageId.get(e.scoopJid);s&&this.emitToUI({type:"tool_result",messageId:s,toolName:e.toolName??"",result:e.toolResult??"",isError:e.isError});break}case"response_done":{const s=this.currentMessageId.get(e.scoopJid);s&&(this.emitToUI({type:"content_done",messageId:s}),this.currentMessageId.delete(e.scoopJid));break}case"turn_end":{const s=this.currentMessageId.get(e.scoopJid)??`done-${e.scoopJid}-${n()}`;this.currentMessageId.delete(e.scoopJid),this.emitToUI({type:"turn_end",messageId:s});break}}}handleScoopStatus(e){this.scoopStatuses.set(e.scoopJid,e.status),this.callbacks.onStatusChange(e.scoopJid,e.status)}handleScoopCreated(e){const s=this.msgScoopToRegistered(e.scoop);this.scoops=this.scoops.filter(t=>t.name!==s.name||t.jid===s.jid),this.scoops.find(t=>t.jid===s.jid)||this.scoops.push(s),this.scoopStatuses.set(s.jid,e.scoop.status),this.callbacks.onScoopCreated(s)}handleScoopList(e){this.scoops=e.scoops.map(s=>this.msgScoopToRegistered(s));for(const s of e.scoops)this.scoopStatuses.set(s.jid,s.status);this.callbacks.onScoopListUpdate(e.scoops)}handleStateSnapshot(e){i.info("Received state snapshot",{scoopCount:e.scoops.length}),this.scoops=e.scoops.map(t=>this.msgScoopToRegistered(t));for(const t of e.scoops)this.scoopStatuses.set(t.jid,t.status);const s=!this.ready;s&&(this.ready=!0,this.stateRetryTimer&&(clearInterval(this.stateRetryTimer),this.stateRetryTimer=null)),this.callbacks.onScoopListUpdate(e.scoops),s&&this.callbacks.onReady?.()}handleError(e){e.scoopJid===this.selectedScoopJid&&this.emitToUI({type:"error",error:e.error})}handleIncomingMessage(e){this.callbacks.onIncomingMessage(e.scoopJid,e.message)}msgScoopToRegistered(e){return{jid:e.jid,name:e.name,folder:e.folder,isCone:e.isCone,type:e.isCone?"cone":"scoop",requiresTrigger:!e.isCone,assistantLabel:e.assistantLabel,addedAt:new Date().toISOString()}}emitToUI(e){for(const s of this.eventListeners)try{s(e)}catch(t){i.error("Listener error",{error:t instanceof Error?t.message:String(t)})}}send(e){chrome.runtime.sendMessage({source:"panel",payload:e}).catch(s=>{i.error("Failed to send to offscreen",{error:s instanceof Error?s.message:String(s)})})}}function n(){return Date.now().toString(36)+Math.random().toString(36).slice(2,8)}function p(o){return typeof o=="object"&&o!==null&&"source"in o&&"payload"in o}export{h as OffscreenClient};
1
+ import{c as d}from"./index-B0F7PxWn.js";const i=d("offscreen-client");class h{eventListeners=new Set;callbacks;scoops=[];scoopStatuses=new Map;currentMessageId=new Map;ready=!1;stateRetryTimer=null;localFs=null;selectedScoopJid=null;constructor(e){this.callbacks=e,this.setupMessageListener()}setLocalFS(e){this.localFs=e}createAgentHandle(){return{sendMessage:(e,s)=>{if(!this.selectedScoopJid){this.emitToUI({type:"error",error:"No scoop selected"});return}this.send({type:"user-message",scoopJid:this.selectedScoopJid,text:e,messageId:s??`msg-${Date.now()}-${Math.random().toString(36).slice(2,8)}`})},onEvent:e=>(this.eventListeners.add(e),()=>this.eventListeners.delete(e)),stop:()=>{this.selectedScoopJid&&this.send({type:"abort",scoopJid:this.selectedScoopJid})}}}getScoops(){return this.scoops}getScoop(e){return this.scoops.find(s=>s.jid===e)}isProcessing(e){return this.scoopStatuses.get(e)==="processing"}async registerScoop(e){this.scoops.find(s=>s.name===e.name)||(this.scoops.push(e),this.scoopStatuses.set(e.jid,"initializing")),this.send({type:"scoop-create",name:e.name,isCone:e.isCone})}async unregisterScoop(e){this.send({type:"scoop-drop",scoopJid:e}),this.scoops=this.scoops.filter(s=>s.jid!==e),this.scoopStatuses.delete(e)}createScoopTab(e){}async getGlobalMemory(){if(!this.localFs)return"";try{const e=await this.localFs.readFile("/shared/CLAUDE.md",{encoding:"utf-8"});return typeof e=="string"?e:new TextDecoder().decode(e)}catch{return""}}getScoopContext(e){if(this.localFs)return{getFS:()=>this.localFs}}getSharedFS(){return this.localFs}stopScoop(e){this.send({type:"abort",scoopJid:e})}async clearQueuedMessages(e){}async deleteQueuedMessage(e,s){}updateModel(){this.send({type:"refresh-model"})}async clearAllMessages(){this.send({type:"clear-chat"})}clearFilesystem(){this.send({type:"clear-filesystem"})}requestState(){this.send({type:"request-state"});let e=0;this.stateRetryTimer=setInterval(()=>{if(e++,this.ready||e>20){this.stateRetryTimer&&(clearInterval(this.stateRetryTimer),this.stateRetryTimer=null);return}i.debug("Retrying request-state",{attempt:e}),this.send({type:"request-state"})},500)}isReady(){return this.ready}sprinkleOpHandler=null;sendSprinkleLick(e,s){this.send({type:"sprinkle-lick",sprinkleName:e,body:s})}setSprinkleOpHandler(e){this.sprinkleOpHandler=e}setupMessageListener(){chrome.runtime.onMessage.addListener((e,s,t)=>{if(!p(e))return!1;const a=e;if(a.source==="offscreen"){const r=a.payload;if(r?.type==="debug-tabs"){const c=window.__slicc_debug_tabs;c?.(!!r.show)}else r?.type==="sprinkle-op"&&this.sprinkleOpHandler?this.sprinkleOpHandler(r):this.handleOffscreenMessage(a.payload)}return!1})}handleOffscreenMessage(e){switch(e.type){case"offscreen-ready":i.info("Offscreen engine ready"),this.ready||this.send({type:"request-state"});break;case"agent-event":this.handleAgentEvent(e);break;case"scoop-status":this.handleScoopStatus(e);break;case"scoop-created":this.handleScoopCreated(e);break;case"scoop-list":this.handleScoopList(e);break;case"state-snapshot":this.handleStateSnapshot(e);break;case"error":this.handleError(e);break;case"incoming-message":this.handleIncomingMessage(e);break}}handleAgentEvent(e){if(e.scoopJid===this.selectedScoopJid)switch(e.eventType){case"text_delta":{let s=this.currentMessageId.get(e.scoopJid);s||(s=`scoop-${e.scoopJid}-${n()}`,this.currentMessageId.set(e.scoopJid,s),this.emitToUI({type:"message_start",messageId:s})),this.emitToUI({type:"content_delta",messageId:s,text:e.text??""});break}case"tool_start":{let s=this.currentMessageId.get(e.scoopJid);s||(s=`scoop-${e.scoopJid}-${n()}`,this.currentMessageId.set(e.scoopJid,s),this.emitToUI({type:"message_start",messageId:s})),this.emitToUI({type:"tool_use_start",messageId:s,toolName:e.toolName??"",toolInput:e.toolInput});break}case"tool_end":{const s=this.currentMessageId.get(e.scoopJid);s&&this.emitToUI({type:"tool_result",messageId:s,toolName:e.toolName??"",result:e.toolResult??"",isError:e.isError});break}case"response_done":{const s=this.currentMessageId.get(e.scoopJid);s&&(this.emitToUI({type:"content_done",messageId:s}),this.currentMessageId.delete(e.scoopJid));break}case"turn_end":{const s=this.currentMessageId.get(e.scoopJid)??`done-${e.scoopJid}-${n()}`;this.currentMessageId.delete(e.scoopJid),this.emitToUI({type:"turn_end",messageId:s});break}}}handleScoopStatus(e){this.scoopStatuses.set(e.scoopJid,e.status),this.callbacks.onStatusChange(e.scoopJid,e.status)}handleScoopCreated(e){const s=this.msgScoopToRegistered(e.scoop);this.scoops=this.scoops.filter(t=>t.name!==s.name||t.jid===s.jid),this.scoops.find(t=>t.jid===s.jid)||this.scoops.push(s),this.scoopStatuses.set(s.jid,e.scoop.status),this.callbacks.onScoopCreated(s)}handleScoopList(e){this.scoops=e.scoops.map(s=>this.msgScoopToRegistered(s));for(const s of e.scoops)this.scoopStatuses.set(s.jid,s.status);this.callbacks.onScoopListUpdate(e.scoops)}handleStateSnapshot(e){i.info("Received state snapshot",{scoopCount:e.scoops.length}),this.scoops=e.scoops.map(t=>this.msgScoopToRegistered(t));for(const t of e.scoops)this.scoopStatuses.set(t.jid,t.status);const s=!this.ready;s&&(this.ready=!0,this.stateRetryTimer&&(clearInterval(this.stateRetryTimer),this.stateRetryTimer=null)),this.callbacks.onScoopListUpdate(e.scoops),s&&this.callbacks.onReady?.()}handleError(e){e.scoopJid===this.selectedScoopJid&&this.emitToUI({type:"error",error:e.error})}handleIncomingMessage(e){this.callbacks.onIncomingMessage(e.scoopJid,e.message)}msgScoopToRegistered(e){return{jid:e.jid,name:e.name,folder:e.folder,isCone:e.isCone,type:e.isCone?"cone":"scoop",requiresTrigger:!e.isCone,assistantLabel:e.assistantLabel,addedAt:new Date().toISOString()}}emitToUI(e){for(const s of this.eventListeners)try{s(e)}catch(t){i.error("Listener error",{error:t instanceof Error?t.message:String(t)})}}send(e){chrome.runtime.sendMessage({source:"panel",payload:e}).catch(s=>{i.error("Failed to send to offscreen",{error:s instanceof Error?s.message:String(s)})})}}function n(){return Date.now().toString(36)+Math.random().toString(36).slice(2,8)}function p(o){return typeof o=="object"&&o!==null&&"source"in o&&"payload"in o}export{h as OffscreenClient};
@@ -1,2 +1,2 @@
1
- import{A as nn}from"./index-Xfgq0sxD.js";import{r as nt}from"./___vite-browser-external_commonjs-proxy-BaP7fEvT.js";function on(j,De){for(var z=0;z<De.length;z++){const Q=De[z];if(typeof Q!="string"&&!Array.isArray(Q)){for(const F in Q)if(F!=="default"&&!(F in j)){const ie=Object.getOwnPropertyDescriptor(Q,F);ie&&Object.defineProperty(j,F,ie.get?ie:{enumerable:!0,get:()=>Q[F]})}}}return Object.freeze(Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}))}var hr={exports:{}},it;function an(){return it||(it=1,(function(j,De){var z=void 0,Q=function(F){return z||(z=new Promise(function(ie,at){var I=typeof F<"u"?F:{},mr=I.onAbort;I.onAbort=function(e){at(new Error(e)),mr&&mr(e)},I.postRun=I.postRun||[],I.postRun.push(function(){ie(I)}),j=void 0;var s;s||=typeof I<"u"?I:{};var ut=!!globalThis.window,Ie=!!globalThis.WorkerGlobalScope,de=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";s.onRuntimeInitialized=function(){function e(o,l){switch(typeof l){case"boolean":rn(o,l?1:0);break;case"number":Ht(o,l);break;case"string":Kt(o,l,-1,-1);break;case"object":if(l===null)Kr(o);else if(l.length!=null){var h=Le(l.length);q.set(l,h),en(o,h,l.length,-1),ce(h)}else Ue(o,"Wrong API use : tried to return a value of an unknown type ("+l+").",-1);break;default:Kr(o)}}function r(o,l){for(var h=[],m=0;m<o;m+=1){var w=W(l+4*m,"i32"),y=Yt(w);if(y===1||y===2)w=Jt(w);else if(y===3)w=Gt(w);else if(y===4){y=w,w=Ct(y),y=Zt(y);for(var T=new Uint8Array(w),L=0;L<w;L+=1)T[L]=q[y+L];w=T}else w=null;h.push(w)}return h}function t(o,l){this.Qa=o,this.db=l,this.Oa=1,this.lb=[]}function n(o,l){if(this.db=l,this.eb=Oe(o),this.eb===null)throw Error("Unable to allocate memory for the SQL string");this.kb=this.eb,this.Za=this.qb=null}function i(o){if(this.filename="dbfile_"+(4294967295*Math.random()>>>0),o!=null){var l=this.filename,h="/",m=l;if(h&&(h=typeof h=="string"?h:Je(h),m=l?Ce(h+"/"+l):h),l=qr(!0,!0),m=kt(m,l),o){if(typeof o=="string"){h=Array(o.length);for(var w=0,y=o.length;w<y;++w)h[w]=o.charCodeAt(w);o=h}Ne(m,l|146),h=ne(m,577),Qr(h,o,0,o.length,0),nr(h),Ne(m,l)}}this.handleError(c(this.filename,a)),this.db=W(a,"i32"),rt(this.db),this.fb={},this.Sa={}}var a=H(4),u=s.cwrap,c=u("sqlite3_open","number",["string","number"]),b=u("sqlite3_close_v2","number",["number"]),p=u("sqlite3_exec","number",["number","string","number","number","number"]),g=u("sqlite3_changes","number",["number"]),M=u("sqlite3_prepare_v2","number",["number","string","number","number","number"]),Cr=u("sqlite3_sql","string",["number"]),Ot=u("sqlite3_normalized_sql","string",["number"]),Gr=u("sqlite3_prepare_v2","number",["number","number","number","number","number"]),Lt=u("sqlite3_bind_text","number",["number","number","number","number","number"]),Zr=u("sqlite3_bind_blob","number",["number","number","number","number","number"]),xt=u("sqlite3_bind_double","number",["number","number","number"]),Tt=u("sqlite3_bind_int","number",["number","number","number"]),Pt=u("sqlite3_bind_parameter_index","number",["number","string"]),Ut=u("sqlite3_step","number",["number"]),Dt=u("sqlite3_errmsg","string",["number"]),It=u("sqlite3_column_count","number",["number"]),Wt=u("sqlite3_data_count","number",["number"]),jt=u("sqlite3_column_double","number",["number","number"]),Jr=u("sqlite3_column_text","string",["number","number"]),zt=u("sqlite3_column_blob","number",["number","number"]),Qt=u("sqlite3_column_bytes","number",["number","number"]),Ft=u("sqlite3_column_type","number",["number","number"]),$t=u("sqlite3_column_name","string",["number","number"]),Bt=u("sqlite3_reset","number",["number"]),Vt=u("sqlite3_clear_bindings","number",["number"]),Xt=u("sqlite3_finalize","number",["number"]),Hr=u("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),Yt=u("sqlite3_value_type","number",["number"]),Ct=u("sqlite3_value_bytes","number",["number"]),Gt=u("sqlite3_value_text","string",["number"]),Zt=u("sqlite3_value_blob","number",["number"]),Jt=u("sqlite3_value_double","number",["number"]),Ht=u("sqlite3_result_double","",["number","number"]),Kr=u("sqlite3_result_null","",["number"]),Kt=u("sqlite3_result_text","",["number","string","number","number"]),en=u("sqlite3_result_blob","",["number","number","number","number"]),rn=u("sqlite3_result_int","",["number","number"]),Ue=u("sqlite3_result_error","",["number","string","number"]),et=u("sqlite3_aggregate_context","number",["number","number"]),rt=u("RegisterExtensionFunctions","number",["number"]),tt=u("sqlite3_update_hook","number",["number","number","number"]);t.prototype.bind=function(o){if(!this.Qa)throw"Statement closed";return this.reset(),Array.isArray(o)?this.Cb(o):o!=null&&typeof o=="object"?this.Db(o):!0},t.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Oa=1;var o=Ut(this.Qa);switch(o){case 100:return!0;case 101:return!1;default:throw this.db.handleError(o)}},t.prototype.wb=function(o){return o==null&&(o=this.Oa,this.Oa+=1),jt(this.Qa,o)},t.prototype.Gb=function(o){if(o==null&&(o=this.Oa,this.Oa+=1),o=Jr(this.Qa,o),typeof BigInt!="function")throw Error("BigInt is not supported");return BigInt(o)},t.prototype.Hb=function(o){return o==null&&(o=this.Oa,this.Oa+=1),Jr(this.Qa,o)},t.prototype.getBlob=function(o){o==null&&(o=this.Oa,this.Oa+=1);var l=Qt(this.Qa,o);o=zt(this.Qa,o);for(var h=new Uint8Array(l),m=0;m<l;m+=1)h[m]=q[o+m];return h},t.prototype.get=function(o,l){l=l||{},o!=null&&this.bind(o)&&this.step(),o=[];for(var h=Wt(this.Qa),m=0;m<h;m+=1)switch(Ft(this.Qa,m)){case 1:var w=l.useBigInt?this.Gb(m):this.wb(m);o.push(w);break;case 2:o.push(this.wb(m));break;case 3:o.push(this.Hb(m));break;case 4:o.push(this.getBlob(m));break;default:o.push(null)}return o},t.prototype.getColumnNames=function(){for(var o=[],l=It(this.Qa),h=0;h<l;h+=1)o.push($t(this.Qa,h));return o},t.prototype.getAsObject=function(o,l){o=this.get(o,l),l=this.getColumnNames();for(var h={},m=0;m<l.length;m+=1)h[l[m]]=o[m];return h},t.prototype.getSQL=function(){return Cr(this.Qa)},t.prototype.getNormalizedSQL=function(){return Ot(this.Qa)},t.prototype.run=function(o){return o!=null&&this.bind(o),this.step(),this.reset()},t.prototype.tb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1),o=Oe(o),this.lb.push(o),this.db.handleError(Lt(this.Qa,l,o,-1,0))},t.prototype.Bb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1);var h=Le(o.length);q.set(o,h),this.lb.push(h),this.db.handleError(Zr(this.Qa,l,h,o.length,0))},t.prototype.sb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1),this.db.handleError((o===(o|0)?Tt:xt)(this.Qa,l,o))},t.prototype.Eb=function(o){o==null&&(o=this.Oa,this.Oa+=1),Zr(this.Qa,o,0,0,0)},t.prototype.ub=function(o,l){switch(l==null&&(l=this.Oa,this.Oa+=1),typeof o){case"string":this.tb(o,l);return;case"number":this.sb(o,l);return;case"bigint":this.tb(o.toString(),l);return;case"boolean":this.sb(o+0,l);return;case"object":if(o===null){this.Eb(l);return}if(o.length!=null){this.Bb(o,l);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+o+")."},t.prototype.Db=function(o){var l=this;return Object.keys(o).forEach(function(h){var m=Pt(l.Qa,h);m!==0&&l.ub(o[h],m)}),!0},t.prototype.Cb=function(o){for(var l=0;l<o.length;l+=1)this.ub(o[l],l+1);return!0},t.prototype.reset=function(){return this.freemem(),Vt(this.Qa)===0&&Bt(this.Qa)===0},t.prototype.freemem=function(){for(var o;(o=this.lb.pop())!==void 0;)ce(o)},t.prototype.free=function(){this.freemem();var o=Xt(this.Qa)===0;return delete this.db.fb[this.Qa],this.Qa=0,o},n.prototype.next=function(){if(this.eb===null)return{done:!0};if(this.Za!==null&&(this.Za.free(),this.Za=null),!this.db.db)throw this.nb(),Error("Database closed");var o=Te(),l=H(4);le(a),le(l);try{this.db.handleError(Gr(this.db.db,this.kb,-1,a,l)),this.kb=W(l,"i32");var h=W(a,"i32");return h===0?(this.nb(),{done:!0}):(this.Za=new t(h,this.db),this.db.fb[h]=this.Za,{value:this.Za,done:!1})}catch(m){throw this.qb=E(this.kb),this.nb(),m}finally{xe(o)}},n.prototype.nb=function(){ce(this.eb),this.eb=null},n.prototype.getRemainingSQL=function(){return this.qb!==null?this.qb:E(this.kb)},typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"&&(n.prototype[Symbol.iterator]=function(){return this}),i.prototype.run=function(o,l){if(!this.db)throw"Database closed";if(l){o=this.prepare(o,l);try{o.step()}finally{o.free()}}else this.handleError(p(this.db,o,0,0,a));return this},i.prototype.exec=function(o,l,h){if(!this.db)throw"Database closed";var m=null,w=null,y=null;try{y=w=Oe(o);var T=H(4);for(o=[];W(y,"i8")!==0;){le(a),le(T),this.handleError(Gr(this.db,y,-1,a,T));var L=W(a,"i32");if(y=W(T,"i32"),L!==0){var R=null;for(m=new t(L,this),l!=null&&m.bind(l);m.step();)R===null&&(R={columns:m.getColumnNames(),values:[]},o.push(R)),R.values.push(m.get(null,h));m.free()}}return o}catch(P){throw m&&m.free(),P}finally{w&&ce(w)}},i.prototype.each=function(o,l,h,m,w){typeof l=="function"&&(m=h,h=l,l=void 0),o=this.prepare(o,l);try{for(;o.step();)h(o.getAsObject(null,w))}finally{o.free()}if(typeof m=="function")return m()},i.prototype.prepare=function(o,l){if(le(a),this.handleError(M(this.db,o,-1,a,0)),o=W(a,"i32"),o===0)throw"Nothing to prepare";var h=new t(o,this);return l!=null&&h.bind(l),this.fb[o]=h},i.prototype.iterateStatements=function(o){return new n(o,this)},i.prototype.export=function(){Object.values(this.fb).forEach(function(l){l.free()}),Object.values(this.Sa).forEach(V),this.Sa={},this.handleError(b(this.db));var o=Et(this.filename);return this.handleError(c(this.filename,a)),this.db=W(a,"i32"),rt(this.db),o},i.prototype.close=function(){this.db!==null&&(Object.values(this.fb).forEach(function(o){o.free()}),Object.values(this.Sa).forEach(V),this.Sa={},this.Ya&&(V(this.Ya),this.Ya=void 0),this.handleError(b(this.db)),Dr("/"+this.filename),this.db=null)},i.prototype.handleError=function(o){if(o===0)return null;throw o=Dt(this.db),Error(o)},i.prototype.getRowsModified=function(){return g(this.db)},i.prototype.create_function=function(o,l){Object.prototype.hasOwnProperty.call(this.Sa,o)&&(V(this.Sa[o]),delete this.Sa[o]);var h=me(function(m,w,y){w=r(w,y);try{var T=l.apply(null,w)}catch(L){Ue(m,L,-1);return}e(m,T)},"viii");return this.Sa[o]=h,this.handleError(Hr(this.db,o,l.length,1,0,h,0,0,0)),this},i.prototype.create_aggregate=function(o,l){var h=l.init||function(){return null},m=l.finalize||function(R){return R},w=l.step;if(!w)throw"An aggregate function must have a step function in "+o;var y={};Object.hasOwnProperty.call(this.Sa,o)&&(V(this.Sa[o]),delete this.Sa[o]),l=o+"__finalize",Object.hasOwnProperty.call(this.Sa,l)&&(V(this.Sa[l]),delete this.Sa[l]);var T=me(function(R,P,fr){var K=et(R,1);Object.hasOwnProperty.call(y,K)||(y[K]=h()),P=r(P,fr),P=[y[K]].concat(P);try{y[K]=w.apply(null,P)}catch(tn){delete y[K],Ue(R,tn,-1)}},"viii"),L=me(function(R){var P=et(R,1);try{var fr=m(y[P])}catch(K){delete y[P],Ue(R,K,-1);return}e(R,fr),delete y[P]},"vi");return this.Sa[o]=T,this.Sa[l]=L,this.handleError(Hr(this.db,o,w.length-1,1,0,0,T,L,0)),this},i.prototype.updateHook=function(o){return this.Ya&&(tt(this.db,0,0),V(this.Ya),this.Ya=void 0),o?(this.Ya=me(function(l,h,m,w,y){switch(h){case 18:l="insert";break;case 23:l="update";break;case 9:l="delete";break;default:throw"unknown operationCode in updateHook callback: "+h}if(m=E(m),w=E(w),y>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";o(l,m,w,Number(y))},"viiiij"),tt(this.db,this.Ya,0),this):this},s.Database=i};var We="./this.program",pe=(e,r)=>{throw r},je=globalThis.document?.currentScript?.src;typeof __filename<"u"?je=__filename:Ie&&(je=self.location.href);var we="",ze,be;if(de){var Qe=nt;we=__dirname+"/",be=e=>(e=ve(e)?new URL(e):e,Qe.readFileSync(e)),ze=async e=>(e=ve(e)?new URL(e):e,Qe.readFileSync(e,void 0)),1<process.argv.length&&(We=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),j.exports=s,pe=(e,r)=>{throw process.exitCode=e,r}}else if(ut||Ie){try{we=new URL(".",je).href}catch{}Ie&&(be=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),ze=async e=>{if(ve(e))return new Promise((t,n)=>{var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=()=>{i.status==200||i.status==0&&i.response?t(i.response):n(i.status)},i.onerror=n,i.send(null)});var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw Error(r.status+" : "+r.url)}}var Fe=console.log.bind(console),Y=console.error.bind(console),oe,ye=!1,$e,ve=e=>e.startsWith("file://"),q,N,ae,k,v,Be,Ve,x;function cr(){var e=Pe.buffer;q=new Int8Array(e),ae=new Int16Array(e),N=new Uint8Array(e),k=new Int32Array(e),v=new Uint32Array(e),Be=new Float32Array(e),Ve=new Float64Array(e),x=new BigInt64Array(e),new BigUint64Array(e)}function ue(e){throw s.onAbort?.(e),e="Aborted("+e+")",Y(e),ye=!0,new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info.")}var Xe;async function st(e){if(!oe)try{var r=await ze(e);return new Uint8Array(r)}catch{}if(e==Xe&&oe)e=new Uint8Array(oe);else if(be)e=be(e);else throw"both async and sync fetching of the wasm failed";return e}async function lt(e,r){try{var t=await st(e);return await WebAssembly.instantiate(t,r)}catch(n){Y(`failed to asynchronously prepare wasm: ${n}`),ue(n)}}async function ft(e){var r=Xe;if(!oe&&!ve(r)&&!de)try{var t=fetch(r,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(t,e)}catch(n){Y(`wasm streaming compile failed: ${n}`),Y("falling back to ArrayBuffer instantiation")}return lt(r,e)}class Ye{name="ExitStatus";constructor(r){this.message=`Program terminated with exit(${r})`,this.status=r}}var dr=e=>{for(;0<e.length;)e.shift()(s)},pr=[],wr=[],ht=()=>{var e=s.preRun.shift();wr.push(e)},C=0,se=null;function W(e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":return q[e];case"i8":return q[e];case"i16":return ae[e>>1];case"i32":return k[e>>2];case"i64":return x[e>>3];case"float":return Be[e>>2];case"double":return Ve[e>>3];case"*":return v[e>>2];default:ue(`invalid type for getValue: ${r}`)}}var _e=!0;function le(e){var r="i32";switch(r.endsWith("*")&&(r="*"),r){case"i1":q[e]=0;break;case"i8":q[e]=0;break;case"i16":ae[e>>1]=0;break;case"i32":k[e>>2]=0;break;case"i64":x[e>>3]=BigInt(0);break;case"float":Be[e>>2]=0;break;case"double":Ve[e>>3]=0;break;case"*":v[e>>2]=0;break;default:ue(`invalid type for setValue: ${r}`)}}var br=new TextDecoder,yr=(e,r,t,n)=>{if(t=r+t,n)return t;for(;e[r]&&!(r>=t);)++r;return r},E=(e,r,t)=>e?br.decode(N.subarray(e,yr(N,e,r,t))):"",vr=(e,r)=>{for(var t=0,n=e.length-1;0<=n;n--){var i=e[n];i==="."?e.splice(n,1):i===".."?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},Ce=e=>{var r=e.charAt(0)==="/",t=e.slice(-1)==="/";return(e=vr(e.split("/").filter(n=>!!n),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},_r=e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=r[0],r=r[1],!e&&!r?".":(r&&=r.slice(0,-1),e+r)},ge=e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],mt=()=>{if(de){var e=nt;return r=>e.randomFillSync(r)}return r=>crypto.getRandomValues(r)},gr=e=>{(gr=mt())(e)},ct=(...e)=>{for(var r="",t=!1,n=e.length-1;-1<=n&&!t;n--){if(t=0<=n?e[n]:"/",typeof t!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";r=t+"/"+r,t=t.charAt(0)==="/"}return r=vr(r.split("/").filter(i=>!!i),!t).join("/"),(t?"/":"")+r||"."},ke=e=>{var r=yr(e,0);return br.decode(e.buffer?e.subarray(0,r):new Uint8Array(e.slice(0,r)))},Ge=[],ee=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);127>=n?r++:2047>=n?r+=2:55296<=n&&57343>=n?(r+=4,++t):r+=3}return r},U=(e,r,t,n)=>{if(!(0<n))return 0;var i=t;n=t+n-1;for(var a=0;a<e.length;++a){var u=e.codePointAt(a);if(127>=u){if(t>=n)break;r[t++]=u}else if(2047>=u){if(t+1>=n)break;r[t++]=192|u>>6,r[t++]=128|u&63}else if(65535>=u){if(t+2>=n)break;r[t++]=224|u>>12,r[t++]=128|u>>6&63,r[t++]=128|u&63}else{if(t+3>=n)break;r[t++]=240|u>>18,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|u&63,a++}}return r[t]=0,t-i},kr=[];function Er(e,r){kr[e]={input:[],output:[],cb:r},rr(e,dt)}var dt={open(e){var r=kr[e.node.rdev];if(!r)throw new f(43);e.tty=r,e.seekable=!1},close(e){e.tty.cb.fsync(e.tty)},fsync(e){e.tty.cb.fsync(e.tty)},read(e,r,t,n){if(!e.tty||!e.tty.cb.xb)throw new f(60);for(var i=0,a=0;a<n;a++){try{var u=e.tty.cb.xb(e.tty)}catch{throw new f(29)}if(u===void 0&&i===0)throw new f(6);if(u==null)break;i++,r[t+a]=u}return i&&(e.node.atime=Date.now()),i},write(e,r,t,n){if(!e.tty||!e.tty.cb.rb)throw new f(60);try{for(var i=0;i<n;i++)e.tty.cb.rb(e.tty,r[t+i])}catch{throw new f(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),i}},pt={xb(){e:{if(!Ge.length){var e=null;if(de){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=Qe.readSync(n,r,0,256)}catch(i){if(i.toString().includes("EOF"))t=0;else throw i}0<t&&(e=r.slice(0,t).toString("utf-8"))}else globalThis.window?.prompt&&(e=window.prompt("Input: "),e!==null&&(e+=`
1
+ import{A as nn}from"./index-B0F7PxWn.js";import{r as nt}from"./___vite-browser-external_commonjs-proxy-HEKiI6EW.js";function on(j,De){for(var z=0;z<De.length;z++){const Q=De[z];if(typeof Q!="string"&&!Array.isArray(Q)){for(const F in Q)if(F!=="default"&&!(F in j)){const ie=Object.getOwnPropertyDescriptor(Q,F);ie&&Object.defineProperty(j,F,ie.get?ie:{enumerable:!0,get:()=>Q[F]})}}}return Object.freeze(Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}))}var hr={exports:{}},it;function an(){return it||(it=1,(function(j,De){var z=void 0,Q=function(F){return z||(z=new Promise(function(ie,at){var I=typeof F<"u"?F:{},mr=I.onAbort;I.onAbort=function(e){at(new Error(e)),mr&&mr(e)},I.postRun=I.postRun||[],I.postRun.push(function(){ie(I)}),j=void 0;var s;s||=typeof I<"u"?I:{};var ut=!!globalThis.window,Ie=!!globalThis.WorkerGlobalScope,de=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";s.onRuntimeInitialized=function(){function e(o,l){switch(typeof l){case"boolean":rn(o,l?1:0);break;case"number":Ht(o,l);break;case"string":Kt(o,l,-1,-1);break;case"object":if(l===null)Kr(o);else if(l.length!=null){var h=Le(l.length);q.set(l,h),en(o,h,l.length,-1),ce(h)}else Ue(o,"Wrong API use : tried to return a value of an unknown type ("+l+").",-1);break;default:Kr(o)}}function r(o,l){for(var h=[],m=0;m<o;m+=1){var w=W(l+4*m,"i32"),y=Yt(w);if(y===1||y===2)w=Jt(w);else if(y===3)w=Gt(w);else if(y===4){y=w,w=Ct(y),y=Zt(y);for(var T=new Uint8Array(w),L=0;L<w;L+=1)T[L]=q[y+L];w=T}else w=null;h.push(w)}return h}function t(o,l){this.Qa=o,this.db=l,this.Oa=1,this.lb=[]}function n(o,l){if(this.db=l,this.eb=Oe(o),this.eb===null)throw Error("Unable to allocate memory for the SQL string");this.kb=this.eb,this.Za=this.qb=null}function i(o){if(this.filename="dbfile_"+(4294967295*Math.random()>>>0),o!=null){var l=this.filename,h="/",m=l;if(h&&(h=typeof h=="string"?h:Je(h),m=l?Ce(h+"/"+l):h),l=qr(!0,!0),m=kt(m,l),o){if(typeof o=="string"){h=Array(o.length);for(var w=0,y=o.length;w<y;++w)h[w]=o.charCodeAt(w);o=h}Ne(m,l|146),h=ne(m,577),Qr(h,o,0,o.length,0),nr(h),Ne(m,l)}}this.handleError(c(this.filename,a)),this.db=W(a,"i32"),rt(this.db),this.fb={},this.Sa={}}var a=H(4),u=s.cwrap,c=u("sqlite3_open","number",["string","number"]),b=u("sqlite3_close_v2","number",["number"]),p=u("sqlite3_exec","number",["number","string","number","number","number"]),g=u("sqlite3_changes","number",["number"]),M=u("sqlite3_prepare_v2","number",["number","string","number","number","number"]),Cr=u("sqlite3_sql","string",["number"]),Ot=u("sqlite3_normalized_sql","string",["number"]),Gr=u("sqlite3_prepare_v2","number",["number","number","number","number","number"]),Lt=u("sqlite3_bind_text","number",["number","number","number","number","number"]),Zr=u("sqlite3_bind_blob","number",["number","number","number","number","number"]),xt=u("sqlite3_bind_double","number",["number","number","number"]),Tt=u("sqlite3_bind_int","number",["number","number","number"]),Pt=u("sqlite3_bind_parameter_index","number",["number","string"]),Ut=u("sqlite3_step","number",["number"]),Dt=u("sqlite3_errmsg","string",["number"]),It=u("sqlite3_column_count","number",["number"]),Wt=u("sqlite3_data_count","number",["number"]),jt=u("sqlite3_column_double","number",["number","number"]),Jr=u("sqlite3_column_text","string",["number","number"]),zt=u("sqlite3_column_blob","number",["number","number"]),Qt=u("sqlite3_column_bytes","number",["number","number"]),Ft=u("sqlite3_column_type","number",["number","number"]),$t=u("sqlite3_column_name","string",["number","number"]),Bt=u("sqlite3_reset","number",["number"]),Vt=u("sqlite3_clear_bindings","number",["number"]),Xt=u("sqlite3_finalize","number",["number"]),Hr=u("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),Yt=u("sqlite3_value_type","number",["number"]),Ct=u("sqlite3_value_bytes","number",["number"]),Gt=u("sqlite3_value_text","string",["number"]),Zt=u("sqlite3_value_blob","number",["number"]),Jt=u("sqlite3_value_double","number",["number"]),Ht=u("sqlite3_result_double","",["number","number"]),Kr=u("sqlite3_result_null","",["number"]),Kt=u("sqlite3_result_text","",["number","string","number","number"]),en=u("sqlite3_result_blob","",["number","number","number","number"]),rn=u("sqlite3_result_int","",["number","number"]),Ue=u("sqlite3_result_error","",["number","string","number"]),et=u("sqlite3_aggregate_context","number",["number","number"]),rt=u("RegisterExtensionFunctions","number",["number"]),tt=u("sqlite3_update_hook","number",["number","number","number"]);t.prototype.bind=function(o){if(!this.Qa)throw"Statement closed";return this.reset(),Array.isArray(o)?this.Cb(o):o!=null&&typeof o=="object"?this.Db(o):!0},t.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Oa=1;var o=Ut(this.Qa);switch(o){case 100:return!0;case 101:return!1;default:throw this.db.handleError(o)}},t.prototype.wb=function(o){return o==null&&(o=this.Oa,this.Oa+=1),jt(this.Qa,o)},t.prototype.Gb=function(o){if(o==null&&(o=this.Oa,this.Oa+=1),o=Jr(this.Qa,o),typeof BigInt!="function")throw Error("BigInt is not supported");return BigInt(o)},t.prototype.Hb=function(o){return o==null&&(o=this.Oa,this.Oa+=1),Jr(this.Qa,o)},t.prototype.getBlob=function(o){o==null&&(o=this.Oa,this.Oa+=1);var l=Qt(this.Qa,o);o=zt(this.Qa,o);for(var h=new Uint8Array(l),m=0;m<l;m+=1)h[m]=q[o+m];return h},t.prototype.get=function(o,l){l=l||{},o!=null&&this.bind(o)&&this.step(),o=[];for(var h=Wt(this.Qa),m=0;m<h;m+=1)switch(Ft(this.Qa,m)){case 1:var w=l.useBigInt?this.Gb(m):this.wb(m);o.push(w);break;case 2:o.push(this.wb(m));break;case 3:o.push(this.Hb(m));break;case 4:o.push(this.getBlob(m));break;default:o.push(null)}return o},t.prototype.getColumnNames=function(){for(var o=[],l=It(this.Qa),h=0;h<l;h+=1)o.push($t(this.Qa,h));return o},t.prototype.getAsObject=function(o,l){o=this.get(o,l),l=this.getColumnNames();for(var h={},m=0;m<l.length;m+=1)h[l[m]]=o[m];return h},t.prototype.getSQL=function(){return Cr(this.Qa)},t.prototype.getNormalizedSQL=function(){return Ot(this.Qa)},t.prototype.run=function(o){return o!=null&&this.bind(o),this.step(),this.reset()},t.prototype.tb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1),o=Oe(o),this.lb.push(o),this.db.handleError(Lt(this.Qa,l,o,-1,0))},t.prototype.Bb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1);var h=Le(o.length);q.set(o,h),this.lb.push(h),this.db.handleError(Zr(this.Qa,l,h,o.length,0))},t.prototype.sb=function(o,l){l==null&&(l=this.Oa,this.Oa+=1),this.db.handleError((o===(o|0)?Tt:xt)(this.Qa,l,o))},t.prototype.Eb=function(o){o==null&&(o=this.Oa,this.Oa+=1),Zr(this.Qa,o,0,0,0)},t.prototype.ub=function(o,l){switch(l==null&&(l=this.Oa,this.Oa+=1),typeof o){case"string":this.tb(o,l);return;case"number":this.sb(o,l);return;case"bigint":this.tb(o.toString(),l);return;case"boolean":this.sb(o+0,l);return;case"object":if(o===null){this.Eb(l);return}if(o.length!=null){this.Bb(o,l);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+o+")."},t.prototype.Db=function(o){var l=this;return Object.keys(o).forEach(function(h){var m=Pt(l.Qa,h);m!==0&&l.ub(o[h],m)}),!0},t.prototype.Cb=function(o){for(var l=0;l<o.length;l+=1)this.ub(o[l],l+1);return!0},t.prototype.reset=function(){return this.freemem(),Vt(this.Qa)===0&&Bt(this.Qa)===0},t.prototype.freemem=function(){for(var o;(o=this.lb.pop())!==void 0;)ce(o)},t.prototype.free=function(){this.freemem();var o=Xt(this.Qa)===0;return delete this.db.fb[this.Qa],this.Qa=0,o},n.prototype.next=function(){if(this.eb===null)return{done:!0};if(this.Za!==null&&(this.Za.free(),this.Za=null),!this.db.db)throw this.nb(),Error("Database closed");var o=Te(),l=H(4);le(a),le(l);try{this.db.handleError(Gr(this.db.db,this.kb,-1,a,l)),this.kb=W(l,"i32");var h=W(a,"i32");return h===0?(this.nb(),{done:!0}):(this.Za=new t(h,this.db),this.db.fb[h]=this.Za,{value:this.Za,done:!1})}catch(m){throw this.qb=E(this.kb),this.nb(),m}finally{xe(o)}},n.prototype.nb=function(){ce(this.eb),this.eb=null},n.prototype.getRemainingSQL=function(){return this.qb!==null?this.qb:E(this.kb)},typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"&&(n.prototype[Symbol.iterator]=function(){return this}),i.prototype.run=function(o,l){if(!this.db)throw"Database closed";if(l){o=this.prepare(o,l);try{o.step()}finally{o.free()}}else this.handleError(p(this.db,o,0,0,a));return this},i.prototype.exec=function(o,l,h){if(!this.db)throw"Database closed";var m=null,w=null,y=null;try{y=w=Oe(o);var T=H(4);for(o=[];W(y,"i8")!==0;){le(a),le(T),this.handleError(Gr(this.db,y,-1,a,T));var L=W(a,"i32");if(y=W(T,"i32"),L!==0){var R=null;for(m=new t(L,this),l!=null&&m.bind(l);m.step();)R===null&&(R={columns:m.getColumnNames(),values:[]},o.push(R)),R.values.push(m.get(null,h));m.free()}}return o}catch(P){throw m&&m.free(),P}finally{w&&ce(w)}},i.prototype.each=function(o,l,h,m,w){typeof l=="function"&&(m=h,h=l,l=void 0),o=this.prepare(o,l);try{for(;o.step();)h(o.getAsObject(null,w))}finally{o.free()}if(typeof m=="function")return m()},i.prototype.prepare=function(o,l){if(le(a),this.handleError(M(this.db,o,-1,a,0)),o=W(a,"i32"),o===0)throw"Nothing to prepare";var h=new t(o,this);return l!=null&&h.bind(l),this.fb[o]=h},i.prototype.iterateStatements=function(o){return new n(o,this)},i.prototype.export=function(){Object.values(this.fb).forEach(function(l){l.free()}),Object.values(this.Sa).forEach(V),this.Sa={},this.handleError(b(this.db));var o=Et(this.filename);return this.handleError(c(this.filename,a)),this.db=W(a,"i32"),rt(this.db),o},i.prototype.close=function(){this.db!==null&&(Object.values(this.fb).forEach(function(o){o.free()}),Object.values(this.Sa).forEach(V),this.Sa={},this.Ya&&(V(this.Ya),this.Ya=void 0),this.handleError(b(this.db)),Dr("/"+this.filename),this.db=null)},i.prototype.handleError=function(o){if(o===0)return null;throw o=Dt(this.db),Error(o)},i.prototype.getRowsModified=function(){return g(this.db)},i.prototype.create_function=function(o,l){Object.prototype.hasOwnProperty.call(this.Sa,o)&&(V(this.Sa[o]),delete this.Sa[o]);var h=me(function(m,w,y){w=r(w,y);try{var T=l.apply(null,w)}catch(L){Ue(m,L,-1);return}e(m,T)},"viii");return this.Sa[o]=h,this.handleError(Hr(this.db,o,l.length,1,0,h,0,0,0)),this},i.prototype.create_aggregate=function(o,l){var h=l.init||function(){return null},m=l.finalize||function(R){return R},w=l.step;if(!w)throw"An aggregate function must have a step function in "+o;var y={};Object.hasOwnProperty.call(this.Sa,o)&&(V(this.Sa[o]),delete this.Sa[o]),l=o+"__finalize",Object.hasOwnProperty.call(this.Sa,l)&&(V(this.Sa[l]),delete this.Sa[l]);var T=me(function(R,P,fr){var K=et(R,1);Object.hasOwnProperty.call(y,K)||(y[K]=h()),P=r(P,fr),P=[y[K]].concat(P);try{y[K]=w.apply(null,P)}catch(tn){delete y[K],Ue(R,tn,-1)}},"viii"),L=me(function(R){var P=et(R,1);try{var fr=m(y[P])}catch(K){delete y[P],Ue(R,K,-1);return}e(R,fr),delete y[P]},"vi");return this.Sa[o]=T,this.Sa[l]=L,this.handleError(Hr(this.db,o,w.length-1,1,0,0,T,L,0)),this},i.prototype.updateHook=function(o){return this.Ya&&(tt(this.db,0,0),V(this.Ya),this.Ya=void 0),o?(this.Ya=me(function(l,h,m,w,y){switch(h){case 18:l="insert";break;case 23:l="update";break;case 9:l="delete";break;default:throw"unknown operationCode in updateHook callback: "+h}if(m=E(m),w=E(w),y>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";o(l,m,w,Number(y))},"viiiij"),tt(this.db,this.Ya,0),this):this},s.Database=i};var We="./this.program",pe=(e,r)=>{throw r},je=globalThis.document?.currentScript?.src;typeof __filename<"u"?je=__filename:Ie&&(je=self.location.href);var we="",ze,be;if(de){var Qe=nt;we=__dirname+"/",be=e=>(e=ve(e)?new URL(e):e,Qe.readFileSync(e)),ze=async e=>(e=ve(e)?new URL(e):e,Qe.readFileSync(e,void 0)),1<process.argv.length&&(We=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),j.exports=s,pe=(e,r)=>{throw process.exitCode=e,r}}else if(ut||Ie){try{we=new URL(".",je).href}catch{}Ie&&(be=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),ze=async e=>{if(ve(e))return new Promise((t,n)=>{var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=()=>{i.status==200||i.status==0&&i.response?t(i.response):n(i.status)},i.onerror=n,i.send(null)});var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw Error(r.status+" : "+r.url)}}var Fe=console.log.bind(console),Y=console.error.bind(console),oe,ye=!1,$e,ve=e=>e.startsWith("file://"),q,N,ae,k,v,Be,Ve,x;function cr(){var e=Pe.buffer;q=new Int8Array(e),ae=new Int16Array(e),N=new Uint8Array(e),k=new Int32Array(e),v=new Uint32Array(e),Be=new Float32Array(e),Ve=new Float64Array(e),x=new BigInt64Array(e),new BigUint64Array(e)}function ue(e){throw s.onAbort?.(e),e="Aborted("+e+")",Y(e),ye=!0,new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info.")}var Xe;async function st(e){if(!oe)try{var r=await ze(e);return new Uint8Array(r)}catch{}if(e==Xe&&oe)e=new Uint8Array(oe);else if(be)e=be(e);else throw"both async and sync fetching of the wasm failed";return e}async function lt(e,r){try{var t=await st(e);return await WebAssembly.instantiate(t,r)}catch(n){Y(`failed to asynchronously prepare wasm: ${n}`),ue(n)}}async function ft(e){var r=Xe;if(!oe&&!ve(r)&&!de)try{var t=fetch(r,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(t,e)}catch(n){Y(`wasm streaming compile failed: ${n}`),Y("falling back to ArrayBuffer instantiation")}return lt(r,e)}class Ye{name="ExitStatus";constructor(r){this.message=`Program terminated with exit(${r})`,this.status=r}}var dr=e=>{for(;0<e.length;)e.shift()(s)},pr=[],wr=[],ht=()=>{var e=s.preRun.shift();wr.push(e)},C=0,se=null;function W(e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":return q[e];case"i8":return q[e];case"i16":return ae[e>>1];case"i32":return k[e>>2];case"i64":return x[e>>3];case"float":return Be[e>>2];case"double":return Ve[e>>3];case"*":return v[e>>2];default:ue(`invalid type for getValue: ${r}`)}}var _e=!0;function le(e){var r="i32";switch(r.endsWith("*")&&(r="*"),r){case"i1":q[e]=0;break;case"i8":q[e]=0;break;case"i16":ae[e>>1]=0;break;case"i32":k[e>>2]=0;break;case"i64":x[e>>3]=BigInt(0);break;case"float":Be[e>>2]=0;break;case"double":Ve[e>>3]=0;break;case"*":v[e>>2]=0;break;default:ue(`invalid type for setValue: ${r}`)}}var br=new TextDecoder,yr=(e,r,t,n)=>{if(t=r+t,n)return t;for(;e[r]&&!(r>=t);)++r;return r},E=(e,r,t)=>e?br.decode(N.subarray(e,yr(N,e,r,t))):"",vr=(e,r)=>{for(var t=0,n=e.length-1;0<=n;n--){var i=e[n];i==="."?e.splice(n,1):i===".."?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},Ce=e=>{var r=e.charAt(0)==="/",t=e.slice(-1)==="/";return(e=vr(e.split("/").filter(n=>!!n),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},_r=e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=r[0],r=r[1],!e&&!r?".":(r&&=r.slice(0,-1),e+r)},ge=e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],mt=()=>{if(de){var e=nt;return r=>e.randomFillSync(r)}return r=>crypto.getRandomValues(r)},gr=e=>{(gr=mt())(e)},ct=(...e)=>{for(var r="",t=!1,n=e.length-1;-1<=n&&!t;n--){if(t=0<=n?e[n]:"/",typeof t!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";r=t+"/"+r,t=t.charAt(0)==="/"}return r=vr(r.split("/").filter(i=>!!i),!t).join("/"),(t?"/":"")+r||"."},ke=e=>{var r=yr(e,0);return br.decode(e.buffer?e.subarray(0,r):new Uint8Array(e.slice(0,r)))},Ge=[],ee=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);127>=n?r++:2047>=n?r+=2:55296<=n&&57343>=n?(r+=4,++t):r+=3}return r},U=(e,r,t,n)=>{if(!(0<n))return 0;var i=t;n=t+n-1;for(var a=0;a<e.length;++a){var u=e.codePointAt(a);if(127>=u){if(t>=n)break;r[t++]=u}else if(2047>=u){if(t+1>=n)break;r[t++]=192|u>>6,r[t++]=128|u&63}else if(65535>=u){if(t+2>=n)break;r[t++]=224|u>>12,r[t++]=128|u>>6&63,r[t++]=128|u&63}else{if(t+3>=n)break;r[t++]=240|u>>18,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|u&63,a++}}return r[t]=0,t-i},kr=[];function Er(e,r){kr[e]={input:[],output:[],cb:r},rr(e,dt)}var dt={open(e){var r=kr[e.node.rdev];if(!r)throw new f(43);e.tty=r,e.seekable=!1},close(e){e.tty.cb.fsync(e.tty)},fsync(e){e.tty.cb.fsync(e.tty)},read(e,r,t,n){if(!e.tty||!e.tty.cb.xb)throw new f(60);for(var i=0,a=0;a<n;a++){try{var u=e.tty.cb.xb(e.tty)}catch{throw new f(29)}if(u===void 0&&i===0)throw new f(6);if(u==null)break;i++,r[t+a]=u}return i&&(e.node.atime=Date.now()),i},write(e,r,t,n){if(!e.tty||!e.tty.cb.rb)throw new f(60);try{for(var i=0;i<n;i++)e.tty.cb.rb(e.tty,r[t+i])}catch{throw new f(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),i}},pt={xb(){e:{if(!Ge.length){var e=null;if(de){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=Qe.readSync(n,r,0,256)}catch(i){if(i.toString().includes("EOF"))t=0;else throw i}0<t&&(e=r.slice(0,t).toString("utf-8"))}else globalThis.window?.prompt&&(e=window.prompt("Input: "),e!==null&&(e+=`
2
2
  `));if(!e){e=null;break e}r=Array(ee(e)+1),e=U(e,r,0,r.length),r.length=e,Ge=r}e=Ge.shift()}return e},rb(e,r){r===null||r===10?(Fe(ke(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){0<e.output?.length&&(Fe(ke(e.output)),e.output=[])},Tb(){return{Ob:25856,Qb:5,Nb:191,Pb:35387,Mb:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},Ub(){return 0},Vb(){return[24,80]}},wt={rb(e,r){r===null||r===10?(Y(ke(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){0<e.output?.length&&(Y(ke(e.output)),e.output=[])}},d={Wa:null,Xa(){return d.createNode(null,"/",16895,0)},createNode(e,r,t,n){if((t&61440)===24576||(t&61440)===4096)throw new f(63);return d.Wa||(d.Wa={dir:{node:{Ta:d.La.Ta,Ua:d.La.Ua,lookup:d.La.lookup,hb:d.La.hb,rename:d.La.rename,unlink:d.La.unlink,rmdir:d.La.rmdir,readdir:d.La.readdir,symlink:d.La.symlink},stream:{Va:d.Ma.Va}},file:{node:{Ta:d.La.Ta,Ua:d.La.Ua},stream:{Va:d.Ma.Va,read:d.Ma.read,write:d.Ma.write,ib:d.Ma.ib,jb:d.Ma.jb}},link:{node:{Ta:d.La.Ta,Ua:d.La.Ua,readlink:d.La.readlink},stream:{}},vb:{node:{Ta:d.La.Ta,Ua:d.La.Ua},stream:gt}}),t=Rr(e,r,t,n),S(t.mode)?(t.La=d.Wa.dir.node,t.Ma=d.Wa.dir.stream,t.Na={}):(t.mode&61440)===32768?(t.La=d.Wa.file.node,t.Ma=d.Wa.file.stream,t.Ra=0,t.Na=null):(t.mode&61440)===40960?(t.La=d.Wa.link.node,t.Ma=d.Wa.link.stream):(t.mode&61440)===8192&&(t.La=d.Wa.vb.node,t.Ma=d.Wa.vb.stream),t.atime=t.mtime=t.ctime=Date.now(),e&&(e.Na[r]=t,e.atime=e.mtime=e.ctime=t.atime),t},Sb(e){return e.Na?e.Na.subarray?e.Na.subarray(0,e.Ra):new Uint8Array(e.Na):new Uint8Array(0)},La:{Ta(e){var r={};return r.dev=(e.mode&61440)===8192?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,S(e.mode)?r.size=4096:(e.mode&61440)===32768?r.size=e.Ra:(e.mode&61440)===40960?r.size=e.link.length:r.size=0,r.atime=new Date(e.atime),r.mtime=new Date(e.mtime),r.ctime=new Date(e.ctime),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},Ua(e,r){for(var t of["mode","atime","mtime","ctime"])r[t]!=null&&(e[t]=r[t]);r.size!==void 0&&(r=r.size,e.Ra!=r&&(r==0?(e.Na=null,e.Ra=0):(t=e.Na,e.Na=new Uint8Array(r),t&&e.Na.set(t.subarray(0,Math.min(r,e.Ra))),e.Ra=r)))},lookup(){throw d.mb||(d.mb=new f(44),d.mb.stack="<generic error, no stack>"),d.mb},hb(e,r,t,n){return d.createNode(e,r,t,n)},rename(e,r,t){try{var n=G(r,t)}catch{}if(n){if(S(e.mode))for(var i in n.Na)throw new f(55);Ke(n)}delete e.parent.Na[e.name],r.Na[t]=e,e.name=t,r.ctime=r.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,r){delete e.Na[r],e.ctime=e.mtime=Date.now()},rmdir(e,r){var t=G(e,r),n;for(n in t.Na)throw new f(55);delete e.Na[r],e.ctime=e.mtime=Date.now()},readdir(e){return[".","..",...Object.keys(e.Na)]},symlink(e,r,t){return e=d.createNode(e,r,41471,0),e.link=t,e},readlink(e){if((e.mode&61440)!==40960)throw new f(28);return e.link}},Ma:{read(e,r,t,n,i){var a=e.node.Na;if(i>=e.node.Ra)return 0;if(e=Math.min(e.node.Ra-i,n),8<e&&a.subarray)r.set(a.subarray(i,i+e),t);else for(n=0;n<e;n++)r[t+n]=a[i+n];return e},write(e,r,t,n,i,a){if(r.buffer===q.buffer&&(a=!1),!n)return 0;if(e=e.node,e.mtime=e.ctime=Date.now(),r.subarray&&(!e.Na||e.Na.subarray)){if(a)return e.Na=r.subarray(t,t+n),e.Ra=n;if(e.Ra===0&&i===0)return e.Na=r.slice(t,t+n),e.Ra=n;if(i+n<=e.Ra)return e.Na.set(r.subarray(t,t+n),i),n}a=i+n;var u=e.Na?e.Na.length:0;if(u>=a||(a=Math.max(a,u*(1048576>u?2:1.125)>>>0),u!=0&&(a=Math.max(a,256)),u=e.Na,e.Na=new Uint8Array(a),0<e.Ra&&e.Na.set(u.subarray(0,e.Ra),0)),e.Na.subarray&&r.subarray)e.Na.set(r.subarray(t,t+n),i);else for(a=0;a<n;a++)e.Na[i+a]=r[t+a];return e.Ra=Math.max(e.Ra,i+n),n},Va(e,r,t){if(t===1?r+=e.position:t===2&&(e.node.mode&61440)===32768&&(r+=e.node.Ra),0>r)throw new f(28);return r},ib(e,r,t,n,i){if((e.node.mode&61440)!==32768)throw new f(43);if(e=e.node.Na,i&2||!e||e.buffer!==q.buffer){i=!0,n=65536*Math.ceil(r/65536);var a=Xr(65536,n);if(a&&N.fill(0,a,a+n),n=a,!n)throw new f(48);e&&((0<t||t+r<e.length)&&(e.subarray?e=e.subarray(t,t+r):e=Array.prototype.slice.call(e,t,t+r)),q.set(e,n))}else i=!1,n=e.byteOffset;return{Kb:n,Ab:i}},jb(e,r,t,n){return d.Ma.write(e,r,0,n,t,!1),0}}},qr=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},Ze=null,Mr={},re=[],bt=1,$=null,Nr=!1,Ar=!0,Sr={},f=class{name="ErrnoError";constructor(e){this.Pa=e}},yt=class{gb={};node=null;get flags(){return this.gb.flags}set flags(e){this.gb.flags=e}get position(){return this.gb.position}set position(e){this.gb.position=e}},vt=class{La={};Ma={};ab=null;constructor(e,r,t,n){e||=this,this.parent=e,this.Xa=e.Xa,this.id=bt++,this.name=r,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&365)===365}set read(e){e?this.mode|=365:this.mode&=-366}get write(){return(this.mode&146)===146}set write(e){e?this.mode|=146:this.mode&=-147}};function O(e,r={}){if(!e)throw new f(44);r.ob??(r.ob=!0),e.charAt(0)==="/"||(e="//"+e);var t=0;e:for(;40>t;t++){e=e.split("/").filter(c=>!!c);for(var n=Ze,i="/",a=0;a<e.length;a++){var u=a===e.length-1;if(u&&r.parent)break;if(e[a]!==".")if(e[a]==="..")if(i=_r(i),n===n.parent){e=i+"/"+e.slice(a+1).join("/"),t--;continue e}else n=n.parent;else{i=Ce(i+"/"+e[a]);try{n=G(n,e[a])}catch(c){if(c?.Pa===44&&u&&r.Jb)return{path:i};throw c}if(!n.ab||u&&!r.ob||(n=n.ab.root),(n.mode&61440)===40960&&(!u||r.$a)){if(!n.La.readlink)throw new f(52);n=n.La.readlink(n),n.charAt(0)==="/"||(n=_r(i)+"/"+n),e=n+"/"+e.slice(a+1).join("/");continue e}}}return{path:i,node:n}}throw new f(32)}function Je(e){for(var r;;){if(e===e.parent)return e=e.Xa.zb,r?e[e.length-1]!=="/"?`${e}/${r}`:e+r:e;r=r?`${e.name}/${r}`:e.name,e=e.parent}}function He(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%$.length}function Ke(e){var r=He(e.parent.id,e.name);if($[r]===e)$[r]=e.bb;else for(r=$[r];r;){if(r.bb===e){r.bb=e.bb;break}r=r.bb}}function G(e,r){var t=S(e.mode)?(t=te(e,"x"))?t:e.La.lookup?0:2:54;if(t)throw new f(t);for(t=$[He(e.id,r)];t;t=t.bb){var n=t.name;if(t.parent.id===e.id&&n===r)return t}return e.La.lookup(e,r)}function Rr(e,r,t,n){return e=new vt(e,r,t,n),r=He(e.parent.id,e.name),e.bb=$[r],$[r]=e}function S(e){return(e&61440)===16384}function Or(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r}function te(e,r){if(Ar)return 0;if(!r.includes("r")||e.mode&292){if(r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73))return 2}else return 2;return 0}function Lr(e,r){if(!S(e.mode))return 54;try{return G(e,r),20}catch{}return te(e,"wx")}function xr(e,r,t){try{var n=G(e,r)}catch(i){return i.Pa}if(e=te(e,"wx"))return e;if(t){if(!S(n.mode))return 54;if(n===n.parent||Je(n)==="/")return 10}else if(S(n.mode))return 31;return 0}function Ee(e){if(!e)throw new f(63);return e}function A(e){if(e=re[e],!e)throw new f(8);return e}function Tr(e,r=-1){if(e=Object.assign(new yt,e),r==-1)e:{for(r=0;4096>=r;r++)if(!re[r])break e;throw new f(33)}return e.fd=r,re[r]=e}function _t(e,r=-1){return e=Tr(e,r),e.Ma?.Rb?.(e),e}function er(e,r,t){var n=e?.Ma.Ua;e=n?e:r,n??=r.La.Ua,Ee(n),n(e,t)}var gt={open(e){e.Ma=Mr[e.node.rdev].Ma,e.Ma.open?.(e)},Va(){throw new f(70)}};function rr(e,r){Mr[e]={Ma:r}}function Pr(e,r){var t=r==="/";if(t&&Ze)throw new f(10);if(!t&&r){var n=O(r,{ob:!1});if(r=n.path,n=n.node,n.ab)throw new f(10);if(!S(n.mode))throw new f(54)}r={type:e,Wb:{},zb:r,Ib:[]},e=e.Xa(r),e.Xa=r,r.root=e,t?Ze=e:n&&(n.ab=r,n.Xa&&n.Xa.Ib.push(r))}function qe(e,r,t){var n=O(e,{parent:!0}).node;if(e=ge(e),!e)throw new f(28);if(e==="."||e==="..")throw new f(20);var i=Lr(n,e);if(i)throw new f(i);if(!n.La.hb)throw new f(63);return n.La.hb(n,e,r,t)}function kt(e,r=438){return qe(e,r&4095|32768,0)}function D(e,r=511){return qe(e,r&1023|16384,0)}function Me(e,r,t){typeof t>"u"&&(t=r,r=438),qe(e,r|8192,t)}function tr(e,r){if(!ct(e))throw new f(44);var t=O(r,{parent:!0}).node;if(!t)throw new f(44);r=ge(r);var n=Lr(t,r);if(n)throw new f(n);if(!t.La.symlink)throw new f(63);t.La.symlink(t,r,e)}function Ur(e){var r=O(e,{parent:!0}).node;e=ge(e);var t=G(r,e),n=xr(r,e,!0);if(n)throw new f(n);if(!r.La.rmdir)throw new f(63);if(t.ab)throw new f(10);r.La.rmdir(r,e),Ke(t)}function Dr(e){var r=O(e,{parent:!0}).node;if(!r)throw new f(44);e=ge(e);var t=G(r,e),n=xr(r,e,!1);if(n)throw new f(n);if(!r.La.unlink)throw new f(63);if(t.ab)throw new f(10);r.La.unlink(r,e),Ke(t)}function fe(e,r){return e=O(e,{$a:!r}).node,Ee(e.La.Ta)(e)}function Ir(e,r,t,n){er(e,r,{mode:t&4095|r.mode&-4096,ctime:Date.now(),Fb:n})}function Ne(e,r){e=typeof e=="string"?O(e,{$a:!0}).node:e,Ir(null,e,r)}function Wr(e,r,t){if(S(r.mode))throw new f(31);if((r.mode&61440)!==32768)throw new f(28);var n=te(r,"w");if(n)throw new f(n);er(e,r,{size:t,timestamp:Date.now()})}function ne(e,r,t=438){if(e==="")throw new f(44);if(typeof r=="string"){var n={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[r];if(typeof n>"u")throw Error(`Unknown file open mode: ${r}`);r=n}if(t=r&64?t&4095|32768:0,typeof e=="object")n=e;else{var i=e.endsWith("/");e=O(e,{$a:!(r&131072),Jb:!0}),n=e.node,e=e.path}var a=!1;if(r&64)if(n){if(r&128)throw new f(20)}else{if(i)throw new f(31);n=qe(e,t|511,0),a=!0}if(!n)throw new f(44);if((n.mode&61440)===8192&&(r&=-513),r&65536&&!S(n.mode))throw new f(54);if(!a&&(i=n?(n.mode&61440)===40960?32:S(n.mode)&&(Or(r)!=="r"||r&576)?31:te(n,Or(r)):44))throw new f(i);return r&512&&!a&&(i=n,i=typeof i=="string"?O(i,{$a:!0}).node:i,Wr(null,i,0)),r&=-131713,i=Tr({node:n,path:Je(n),flags:r,seekable:!0,position:0,Ma:n.Ma,Lb:[],error:!1}),i.Ma.open&&i.Ma.open(i),a&&Ne(n,t&511),!s.logReadFiles||r&1||e in Sr||(Sr[e]=1),i}function nr(e){if(e.fd===null)throw new f(8);e.pb&&(e.pb=null);try{e.Ma.close&&e.Ma.close(e)}catch(r){throw r}finally{re[e.fd]=null}e.fd=null}function jr(e,r,t){if(e.fd===null)throw new f(8);if(!e.seekable||!e.Ma.Va)throw new f(70);if(t!=0&&t!=1&&t!=2)throw new f(28);e.position=e.Ma.Va(e,r,t),e.Lb=[]}function zr(e,r,t,n,i){if(0>n||0>i)throw new f(28);if(e.fd===null)throw new f(8);if((e.flags&2097155)===1)throw new f(8);if(S(e.node.mode))throw new f(31);if(!e.Ma.read)throw new f(28);var a=typeof i<"u";if(!a)i=e.position;else if(!e.seekable)throw new f(70);return r=e.Ma.read(e,r,t,n,i),a||(e.position+=r),r}function Qr(e,r,t,n,i){if(0>n||0>i)throw new f(28);if(e.fd===null)throw new f(8);if((e.flags&2097155)===0)throw new f(8);if(S(e.node.mode))throw new f(31);if(!e.Ma.write)throw new f(28);e.seekable&&e.flags&1024&&jr(e,0,2);var a=typeof i<"u";if(!a)i=e.position;else if(!e.seekable)throw new f(70);return r=e.Ma.write(e,r,t,n,i,void 0),a||(e.position+=r),r}function Et(e){var r=r||0;r=ne(e,r),e=fe(e).size;var t=new Uint8Array(e);return zr(r,t,0,e,0),nr(r),t}function B(e,r,t){e=Ce("/dev/"+e);var n=qr(!!r,!!t);B.yb??(B.yb=64);var i=B.yb++<<8|0;rr(i,{open(a){a.seekable=!1},close(){t?.buffer?.length&&t(10)},read(a,u,c,b){for(var p=0,g=0;g<b;g++){try{var M=r()}catch{throw new f(29)}if(M===void 0&&p===0)throw new f(6);if(M==null)break;p++,u[c+g]=M}return p&&(a.node.atime=Date.now()),p},write(a,u,c,b){for(var p=0;p<b;p++)try{t(u[c+p])}catch{throw new f(29)}return b&&(a.node.mtime=a.node.ctime=Date.now()),p}}),Me(e,n,i)}var _={};function Z(e,r,t){if(r.charAt(0)==="/")return r;if(e=e===-100?"/":A(e).path,r.length==0){if(!t)throw new f(44);return e}return e+"/"+r}function Ae(e,r){v[e>>2]=r.dev,v[e+4>>2]=r.mode,v[e+8>>2]=r.nlink,v[e+12>>2]=r.uid,v[e+16>>2]=r.gid,v[e+20>>2]=r.rdev,x[e+24>>3]=BigInt(r.size),k[e+32>>2]=4096,k[e+36>>2]=r.blocks;var t=r.atime.getTime(),n=r.mtime.getTime(),i=r.ctime.getTime();return x[e+40>>3]=BigInt(Math.floor(t/1e3)),v[e+48>>2]=t%1e3*1e6,x[e+56>>3]=BigInt(Math.floor(n/1e3)),v[e+64>>2]=n%1e3*1e6,x[e+72>>3]=BigInt(Math.floor(i/1e3)),v[e+80>>2]=i%1e3*1e6,x[e+88>>3]=BigInt(r.ino),0}var Se=void 0,Re=()=>{var e=k[+Se>>2];return Se+=4,e},ir=0,qt=[0,31,60,91,121,152,182,213,244,274,305,335],Mt=[0,31,59,90,120,151,181,212,243,273,304,334],he={},Fr=e=>{$e=e,_e||0<ir||(s.onExit?.(e),ye=!0),pe(e,new Ye(e))},Nt=e=>{if(!ye)try{e()}catch(r){r instanceof Ye||r=="unwind"||pe(1,r)}finally{if(!(_e||0<ir))try{$e=e=$e,Fr(e)}catch(r){r instanceof Ye||r=="unwind"||pe(1,r)}}},or={},$r=()=>{if(!ar){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:We||"./this.program"},r;for(r in or)or[r]===void 0?delete e[r]:e[r]=or[r];var t=[];for(r in e)t.push(`${r}=${e[r]}`);ar=t}return ar},ar,At=(e,r,t,n)=>{var i={string:p=>{var g=0;if(p!=null&&p!==0){g=ee(p)+1;var M=H(g);U(p,N,M,g),g=M}return g},array:p=>{var g=H(p.length);return q.set(p,g),g}};e=s["_"+e];var a=[],u=0;if(n)for(var c=0;c<n.length;c++){var b=i[t[c]];b?(u===0&&(u=Te()),a[c]=b(n[c])):a[c]=n[c]}return t=e(...a),t=(function(p){return u!==0&&xe(u),r==="string"?E(p):r==="boolean"?!!p:p})(t)},Oe=e=>{var r=ee(e)+1,t=Le(r);return t&&U(e,N,t,r),t},J,ur=[],V=e=>{J.delete(X.get(e)),X.set(e,null),ur.push(e)},Br=e=>{const r=e.length;return[r%128|128,r>>7,...e]},St={i:127,p:127,j:126,f:125,d:124,e:111},Vr=e=>Br(Array.from(e,r=>St[r])),me=(e,r)=>{if(!J){J=new WeakMap;var t=X.length;if(J)for(var n=0;n<0+t;n++){var i=X.get(n);i&&J.set(i,n)}}if(t=J.get(e)||0)return t;t=ur.length?ur.pop():X.grow(1);try{X.set(t,e)}catch(a){if(!(a instanceof TypeError))throw a;r=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Br([1,96,...Vr(r.slice(1)),...Vr(r[0]==="v"?"":r[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),r=new WebAssembly.Module(r),r=new WebAssembly.Instance(r,{e:{f:e}}).exports.f,X.set(t,r)}return J.set(e,t),t};if($=Array(4096),Pr(d,"/"),D("/tmp"),D("/home"),D("/home/web_user"),(function(){D("/dev"),rr(259,{read:()=>0,write:(n,i,a,u)=>u,Va:()=>0}),Me("/dev/null",259),Er(1280,pt),Er(1536,wt),Me("/dev/tty",1280),Me("/dev/tty1",1536);var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(gr(e),r=e.byteLength),e[--r]);B("random",t),B("urandom",t),D("/dev/shm"),D("/dev/shm/tmp")})(),(function(){D("/proc");var e=D("/proc/self");D("/proc/self/fd"),Pr({Xa(){var r=Rr(e,"fd",16895,73);return r.Ma={Va:d.Ma.Va},r.La={lookup(t,n){t=+n;var i=A(t);return t={parent:null,Xa:{zb:"fake"},La:{readlink:()=>i.path},id:t+1},t.parent=t},readdir(){return Array.from(re.entries()).filter(([,t])=>t).map(([t])=>t.toString())}},r}},"/proc/self/fd")})(),s.noExitRuntime&&(_e=s.noExitRuntime),s.print&&(Fe=s.print),s.printErr&&(Y=s.printErr),s.wasmBinary&&(oe=s.wasmBinary),s.thisProgram&&(We=s.thisProgram),s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);0<s.preInit.length;)s.preInit.shift()();s.stackSave=()=>Te(),s.stackRestore=e=>xe(e),s.stackAlloc=e=>H(e),s.cwrap=(e,r,t,n)=>{var i=!t||t.every(a=>a==="number"||a==="boolean");return r!=="string"&&i&&!n?s["_"+e]:(...a)=>At(e,r,t,a)},s.addFunction=me,s.removeFunction=V,s.UTF8ToString=E,s.stringToNewUTF8=Oe,s.writeArrayToMemory=(e,r)=>{q.set(e,r)};var Le,ce,Xr,Yr,xe,H,Te,Pe,X,Rt={a:(e,r,t,n)=>ue(`Assertion failed: ${E(e)}, at: `+[r?E(r):"unknown filename",t,n?E(n):"unknown function"]),i:function(e,r){try{return e=E(e),Ne(e,r),0}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return-t.Pa}},L:function(e,r,t){try{if(r=E(r),r=Z(e,r),t&-8)return-28;var n=O(r,{$a:!0}).node;return n?(e="",t&4&&(e+="r"),t&2&&(e+="w"),t&1&&(e+="x"),e&&te(n,e)?-2:0):-44}catch(i){if(typeof _>"u"||i.name!=="ErrnoError")throw i;return-i.Pa}},j:function(e,r){try{var t=A(e);return Ir(t,t.node,r,!1),0}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return-n.Pa}},h:function(e){try{var r=A(e);return er(r,r.node,{timestamp:Date.now(),Fb:!1}),0}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return-t.Pa}},b:function(e,r,t){Se=t;try{var n=A(e);switch(r){case 0:var i=Re();if(0>i)break;for(;re[i];)i++;return _t(n,i).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:return i=Re(),n.flags|=i,0;case 12:return i=Re(),ae[i+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(a){if(typeof _>"u"||a.name!=="ErrnoError")throw a;return-a.Pa}},g:function(e,r){try{var t=A(e),n=t.node,i=t.Ma.Ta;e=i?t:n,i??=n.La.Ta,Ee(i);var a=i(e);return Ae(r,a)}catch(u){if(typeof _>"u"||u.name!=="ErrnoError")throw u;return-u.Pa}},H:function(e,r){r=-9007199254740992>r||9007199254740992<r?NaN:Number(r);try{if(isNaN(r))return-61;var t=A(e);if(0>r||(t.flags&2097155)===0)throw new f(28);return Wr(t,t.node,r),0}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return-n.Pa}},G:function(e,r){try{if(r===0)return-28;var t=ee("/")+1;return r<t?-68:(U("/",N,e,r),t)}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return-n.Pa}},K:function(e,r){try{return e=E(e),Ae(r,fe(e,!0))}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return-t.Pa}},C:function(e,r,t){try{return r=E(r),r=Z(e,r),D(r,t),0}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return-n.Pa}},J:function(e,r,t,n){try{r=E(r);var i=n&256;return r=Z(e,r,n&4096),Ae(t,i?fe(r,!0):fe(r))}catch(a){if(typeof _>"u"||a.name!=="ErrnoError")throw a;return-a.Pa}},x:function(e,r,t,n){Se=n;try{r=E(r),r=Z(e,r);var i=n?Re():0;return ne(r,t,i).fd}catch(a){if(typeof _>"u"||a.name!=="ErrnoError")throw a;return-a.Pa}},v:function(e,r,t,n){try{if(r=E(r),r=Z(e,r),0>=n)return-28;var i=O(r).node;if(!i)throw new f(44);if(!i.La.readlink)throw new f(28);var a=i.La.readlink(i),u=Math.min(n,ee(a)),c=q[t+u];return U(a,N,t,n+1),q[t+u]=c,u}catch(b){if(typeof _>"u"||b.name!=="ErrnoError")throw b;return-b.Pa}},u:function(e){try{return e=E(e),Ur(e),0}catch(r){if(typeof _>"u"||r.name!=="ErrnoError")throw r;return-r.Pa}},f:function(e,r){try{return e=E(e),Ae(r,fe(e))}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return-t.Pa}},r:function(e,r,t){try{if(r=E(r),r=Z(e,r),t)if(t===512)Ur(r);else return-28;else Dr(r);return 0}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return-n.Pa}},q:function(e,r,t){try{r=E(r),r=Z(e,r,!0);var n=Date.now(),i,a;if(t){var u=v[t>>2]+4294967296*k[t+4>>2],c=k[t+8>>2];c==1073741823?i=n:c==1073741822?i=null:i=1e3*u+c/1e6,t+=16,u=v[t>>2]+4294967296*k[t+4>>2],c=k[t+8>>2],c==1073741823?a=n:c==1073741822?a=null:a=1e3*u+c/1e6}else a=i=n;if((a??i)!==null){e=i;var b=O(r,{$a:!0}).node;Ee(b.La.Ua)(b,{atime:e,mtime:a})}return 0}catch(p){if(typeof _>"u"||p.name!=="ErrnoError")throw p;return-p.Pa}},m:()=>ue(""),l:()=>{_e=!1,ir=0},A:function(e,r){e=-9007199254740992>e||9007199254740992<e?NaN:Number(e),e=new Date(1e3*e),k[r>>2]=e.getSeconds(),k[r+4>>2]=e.getMinutes(),k[r+8>>2]=e.getHours(),k[r+12>>2]=e.getDate(),k[r+16>>2]=e.getMonth(),k[r+20>>2]=e.getFullYear()-1900,k[r+24>>2]=e.getDay();var t=e.getFullYear();k[r+28>>2]=(t%4!==0||t%100===0&&t%400!==0?Mt:qt)[e.getMonth()]+e.getDate()-1|0,k[r+36>>2]=-(60*e.getTimezoneOffset()),t=new Date(e.getFullYear(),6,1).getTimezoneOffset();var n=new Date(e.getFullYear(),0,1).getTimezoneOffset();k[r+32>>2]=(t!=n&&e.getTimezoneOffset()==Math.min(n,t))|0},y:function(e,r,t,n,i,a,u){i=-9007199254740992>i||9007199254740992<i?NaN:Number(i);try{var c=A(n);if((r&2)!==0&&(t&2)===0&&(c.flags&2097155)!==2)throw new f(2);if((c.flags&2097155)===1)throw new f(2);if(!c.Ma.ib)throw new f(43);if(!e)throw new f(28);var b=c.Ma.ib(c,e,i,r,t),p=b.Kb;return k[a>>2]=b.Ab,v[u>>2]=p,0}catch(g){if(typeof _>"u"||g.name!=="ErrnoError")throw g;return-g.Pa}},z:function(e,r,t,n,i,a){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);try{var u=A(i);if(t&2){if(t=a,(u.node.mode&61440)!==32768)throw new f(43);if(!(n&2)){var c=N.slice(e,e+r);u.Ma.jb&&u.Ma.jb(u,c,t,r,n)}}}catch(b){if(typeof _>"u"||b.name!=="ErrnoError")throw b;return-b.Pa}},n:(e,r)=>{if(he[e]&&(clearTimeout(he[e].id),delete he[e]),!r)return 0;var t=setTimeout(()=>{delete he[e],Nt(()=>Yr(e,performance.now()))},r);return he[e]={id:t,Xb:r},0},B:(e,r,t,n)=>{var i=new Date().getFullYear(),a=new Date(i,0,1).getTimezoneOffset();i=new Date(i,6,1).getTimezoneOffset(),v[e>>2]=60*Math.max(a,i),k[r>>2]=+(a!=i),r=u=>{var c=Math.abs(u);return`UTC${0<=u?"-":"+"}${String(Math.floor(c/60)).padStart(2,"0")}${String(c%60).padStart(2,"0")}`},e=r(a),r=r(i),i<a?(U(e,N,t,17),U(r,N,n,17)):(U(e,N,n,17),U(r,N,t,17))},d:()=>Date.now(),s:()=>2147483648,c:()=>performance.now(),o:e=>{var r=N.length;if(e>>>=0,2147483648<e)return!1;for(var t=1;4>=t;t*=2){var n=r*(1+.2/t);n=Math.min(n,e+100663296);e:{n=(Math.min(2147483648,65536*Math.ceil(Math.max(e,n)/65536))-Pe.buffer.byteLength+65535)/65536|0;try{Pe.grow(n),cr();var i=1;break e}catch{}i=void 0}if(i)return!0}return!1},E:(e,r)=>{var t=0,n=0,i;for(i of $r()){var a=r+t;v[e+n>>2]=a,t+=U(i,N,a,1/0)+1,n+=4}return 0},F:(e,r)=>{var t=$r();v[e>>2]=t.length,e=0;for(var n of t)e+=ee(n)+1;return v[r>>2]=e,0},e:function(e){try{var r=A(e);return nr(r),0}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return t.Pa}},p:function(e,r){try{var t=A(e);return q[r]=t.tty?2:S(t.mode)?3:(t.mode&61440)===40960?7:4,ae[r+2>>1]=0,x[r+8>>3]=BigInt(0),x[r+16>>3]=BigInt(0),0}catch(n){if(typeof _>"u"||n.name!=="ErrnoError")throw n;return n.Pa}},w:function(e,r,t,n){try{e:{var i=A(e);e=r;for(var a,u=r=0;u<t;u++){var c=v[e>>2],b=v[e+4>>2];e+=8;var p=zr(i,q,c,b,a);if(0>p){var g=-1;break e}if(r+=p,p<b)break;typeof a<"u"&&(a+=p)}g=r}return v[n>>2]=g,0}catch(M){if(typeof _>"u"||M.name!=="ErrnoError")throw M;return M.Pa}},D:function(e,r,t,n){r=-9007199254740992>r||9007199254740992<r?NaN:Number(r);try{if(isNaN(r))return 61;var i=A(e);return jr(i,r,t),x[n>>3]=BigInt(i.position),i.pb&&r===0&&t===0&&(i.pb=null),0}catch(a){if(typeof _>"u"||a.name!=="ErrnoError")throw a;return a.Pa}},I:function(e){try{var r=A(e);return r.Ma?.fsync?.(r)}catch(t){if(typeof _>"u"||t.name!=="ErrnoError")throw t;return t.Pa}},t:function(e,r,t,n){try{e:{var i=A(e);e=r;for(var a,u=r=0;u<t;u++){var c=v[e>>2],b=v[e+4>>2];e+=8;var p=Qr(i,q,c,b,a);if(0>p){var g=-1;break e}if(r+=p,p<b)break;typeof a<"u"&&(a+=p)}g=r}return v[n>>2]=g,0}catch(M){if(typeof _>"u"||M.name!=="ErrnoError")throw M;return M.Pa}},k:Fr};function sr(){function e(){if(s.calledRun=!0,!ye){if(!s.noFSInit&&!Nr){var r,t;Nr=!0,r??=s.stdin,t??=s.stdout,n??=s.stderr,r?B("stdin",r):tr("/dev/tty","/dev/stdin"),t?B("stdout",null,t):tr("/dev/tty","/dev/stdout"),n?B("stderr",null,n):tr("/dev/tty1","/dev/stderr"),ne("/dev/stdin",0),ne("/dev/stdout",1),ne("/dev/stderr",1)}if(lr.N(),Ar=!1,s.onRuntimeInitialized?.(),s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;){var n=s.postRun.shift();pr.push(n)}dr(pr)}}if(0<C)se=sr;else{if(s.preRun)for(typeof s.preRun=="function"&&(s.preRun=[s.preRun]);s.preRun.length;)ht();dr(wr),0<C?se=sr:s.setStatus?(s.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>s.setStatus(""),1),e()},1)):e()}}var lr;return(async function(){function e(t){return t=lr=t.exports,s._sqlite3_free=t.P,s._sqlite3_value_text=t.Q,s._sqlite3_prepare_v2=t.R,s._sqlite3_step=t.S,s._sqlite3_reset=t.T,s._sqlite3_exec=t.U,s._sqlite3_finalize=t.V,s._sqlite3_column_name=t.W,s._sqlite3_column_text=t.X,s._sqlite3_column_type=t.Y,s._sqlite3_errmsg=t.Z,s._sqlite3_clear_bindings=t._,s._sqlite3_value_blob=t.$,s._sqlite3_value_bytes=t.aa,s._sqlite3_value_double=t.ba,s._sqlite3_value_int=t.ca,s._sqlite3_value_type=t.da,s._sqlite3_result_blob=t.ea,s._sqlite3_result_double=t.fa,s._sqlite3_result_error=t.ga,s._sqlite3_result_int=t.ha,s._sqlite3_result_int64=t.ia,s._sqlite3_result_null=t.ja,s._sqlite3_result_text=t.ka,s._sqlite3_aggregate_context=t.la,s._sqlite3_column_count=t.ma,s._sqlite3_data_count=t.na,s._sqlite3_column_blob=t.oa,s._sqlite3_column_bytes=t.pa,s._sqlite3_column_double=t.qa,s._sqlite3_bind_blob=t.ra,s._sqlite3_bind_double=t.sa,s._sqlite3_bind_int=t.ta,s._sqlite3_bind_text=t.ua,s._sqlite3_bind_parameter_index=t.va,s._sqlite3_sql=t.wa,s._sqlite3_normalized_sql=t.xa,s._sqlite3_changes=t.ya,s._sqlite3_close_v2=t.za,s._sqlite3_create_function_v2=t.Aa,s._sqlite3_update_hook=t.Ba,s._sqlite3_open=t.Ca,Le=s._malloc=t.Da,ce=s._free=t.Ea,s._RegisterExtensionFunctions=t.Fa,Xr=t.Ga,Yr=t.Ha,xe=t.Ia,H=t.Ja,Te=t.Ka,Pe=t.M,X=t.O,cr(),C--,s.monitorRunDependencies?.(C),C==0&&se&&(t=se,se=null,t()),lr}C++,s.monitorRunDependencies?.(C);var r={a:Rt};return s.instantiateWasm?new Promise(t=>{s.instantiateWasm(r,(n,i)=>{t(e(n))})}):(Xe??=s.locateFile?s.locateFile("sql-wasm.wasm",we):we+"sql-wasm.wasm",e((await ft(r)).instance))})(),sr(),I}),z)};j.exports=Q,j.exports.default=Q})(hr)),hr.exports}var ot=an();const un=nn(ot),fn=on({__proto__:null,default:un},[ot]);export{fn as s};
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>slicc</title>
7
7
  <link rel="icon" type="image/png" href="/logos/sliccy-color-1scoops-32x32.png" />
8
- <script type="module" crossorigin src="/assets/index-Xfgq0sxD.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-D2mLc9tI.css">
8
+ <script type="module" crossorigin src="/assets/index-B0F7PxWn.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-B15Vjr8J.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="app"></div>
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>slicc</title>
7
7
  <link rel="icon" type="image/png" href="/logos/sliccy-color-1scoops-32x32.png" />
8
- <script type="module" crossorigin src="/assets/index-Xfgq0sxD.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-D2mLc9tI.css">
8
+ <script type="module" crossorigin src="/assets/index-B0F7PxWn.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-B15Vjr8J.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="app"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sliccy",
3
- "version": "1.22.2",
3
+ "version": "1.22.3",
4
4
  "description": "Browser-based coding agent with thin CLI server",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",