@cline/core 0.0.95 → 0.2.0-nightly.1793312794
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ClineCore.d.ts +6 -1
- package/dist/account/rpc.d.ts +3 -1
- package/dist/account/types.d.ts +2 -0
- package/dist/artifacts/cloud/fetch.d.ts +8 -0
- package/dist/artifacts/cloud/publish.d.ts +6 -0
- package/dist/artifacts/publish.d.ts +30 -0
- package/dist/cline-core/runtime-services.d.ts +4 -2
- package/dist/cloud/computer-use-prompt.d.ts +9 -0
- package/dist/cloud/controller.d.ts +26 -4
- package/dist/cloud/hub-client.d.ts +53 -0
- package/dist/cloud/hub-protocol.d.ts +32 -0
- package/dist/cloud/index.d.ts +5 -0
- package/dist/cloud/index.js +34 -17
- package/dist/cloud/types.d.ts +4 -1
- package/dist/extensions/context/compaction-shared.d.ts +1 -0
- package/dist/extensions/context/compaction.d.ts +7 -0
- package/dist/extensions/context/summarize-conversation.d.ts +7 -0
- package/dist/extensions/context/summary-generation.d.ts +14 -0
- package/dist/extensions/mcp/apps.d.ts +16 -0
- package/dist/extensions/mcp/client.d.ts +1 -0
- package/dist/extensions/mcp/index.d.ts +5 -1
- package/dist/extensions/mcp/manager.d.ts +2 -1
- package/dist/extensions/mcp/session-apps.d.ts +28 -0
- package/dist/extensions/mcp/types.d.ts +22 -0
- package/dist/extensions/plugin/plugin-command-origin.d.ts +8 -0
- package/dist/extensions/plugin/plugin-registry.d.ts +1 -0
- package/dist/extensions/plugin/plugin-runtime.d.ts +7 -0
- package/dist/hub/client/index.d.ts +6 -0
- package/dist/hub/client/managed-hub-build-watcher.d.ts +2 -0
- package/dist/hub/client/plugin-commands.d.ts +4 -0
- package/dist/hub/client/session-client.d.ts +2 -0
- package/dist/hub/daemon/entry.js +248 -229
- package/dist/hub/daemon/index.d.ts +2 -0
- package/dist/hub/index.d.ts +1 -0
- package/dist/hub/index.js +238 -219
- package/dist/hub/runtime-host/hub-runtime-host.d.ts +6 -0
- package/dist/hub/server/cloud-session-service.d.ts +52 -0
- package/dist/hub/server/handlers/capability-handlers.d.ts +18 -1
- package/dist/hub/server/handlers/context.d.ts +13 -2
- package/dist/hub/server/handlers/mcp-apps-handlers.d.ts +5 -0
- package/dist/hub/server/handlers/session-handlers.d.ts +4 -0
- package/dist/hub/server/hub-server-options.d.ts +3 -0
- package/dist/hub/server/hub-server-transport.d.ts +2 -0
- package/dist/index.d.ts +10 -5
- package/dist/index.js +284 -258
- package/dist/plugin-runtime/node_modules/@cline/agents/dist/index.js +76 -0
- package/dist/plugin-runtime/node_modules/@cline/agents/package.json +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/ai-sdk-bdvd54cj.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/anthropic-d88t4w67.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/bedrock-4rh6dw0e.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/cline-dex049wz.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/cloud/index.js +38 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/community-adrseffv.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/foundation-models-embedding-model-strategy-SAVQFBF4-vf44v1q1.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/foundation-models-language-model-strategy-BPQO66W7-np6pavev.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-bsd-1xg0n8py.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-bsd-2h2811k3.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-darwin-918h9zb6.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-darwin-9g9qz8kw.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-linux-8p52y0t4.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-linux-cr4wnstr.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-unsupported-aa72jh2v.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-unsupported-k2y10eep.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-win-1hvm2h6v.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-win-7nqbajdc.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/google-nqn5r579.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/hub/daemon/entry.js +1166 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/hub/index.js +1153 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-0ahmqye5.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-1jwj53tz.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-3qy7846d.js +14 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-418gvd4a.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-4etvmc8g.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-4pm9q9we.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-4tgv599k.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-5hwscy9s.js +15 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-6dpcn5cw.js +9 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-7ycwqbm0.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-8qjtgvqw.js +9 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-8zb5grad.js +1210 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-94jdgxt6.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-9g67p34k.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-a9d2sjh0.js +85 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-agemt17a.js +3 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-bhf7enwn.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-bnwxdgvg.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-brjxtvsh.js +4 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-bvb7f701.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-bwet95hr.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-cadyf2yp.js +14 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-cxfnnrmh.js +9 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-cyyvppz9.js +6 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-d4pbedxj.js +137 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-ddwn220p.js +12 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-edf1hmcw.js +62 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-ejyd73x5.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-f25bf131.js +4 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-f4rfmj6q.js +3 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-fet3kwk6.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-ffna8yzn.js +121 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-g2y6ptdc.js +213 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-ge184xvn.js +6 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-gevnedsc.js +13 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-hkmarmve.js +190 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-kqacxn3s.js +39 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-m3gtj35r.js +14 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-neczvge6.js +21 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-p5k5hnam.js +75 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-sdvqs19c.js +20 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-t75m2pgm.js +146 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-v4-qqb2kabr.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-v6mehmme.js +12 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-v80fh3x3.js +16 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-vd605jwp.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-vryppqt1.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-w55v4n1n.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-w9n2kgjk.js +140 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-yjbp9r76.js +142 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-ztb3cjfh.js +3 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/jiti-static-kj4rdeey.js +473 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/jiti-y9tt7gmq.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/langfuse-stream-telemetry-bg81k3qh.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/langfuse-telemetry-tkbfbx5w.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/mistral-mkw95amh.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/multipart-parser-9z19cm6q.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/ollama-sjp09b7p.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/openai-1eyn4hw0.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/openai-compatible-f99c7syq.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/orchestration-embedding-model-strategy-GT27AFII-19936r1a.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/orchestration-language-model-strategy-YEQPUCOT-eavx3zc3.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/services/feature-flags/posthog.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/services/telemetry/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/token-04d0mwe8.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/token-util-mt7pvm61.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/vertex-6armtc3s.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/package.json +1 -0
- package/dist/plugin-runtime/node_modules/@cline/llms/dist/index.browser.js +16 -0
- package/dist/plugin-runtime/node_modules/@cline/llms/dist/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/llms/package.json +1 -0
- package/dist/plugin-runtime/node_modules/@cline/sdk/dist/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/sdk/package.json +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/automation/index.js +57 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/db/index.js +127 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/index.browser.js +110 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/node.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/remote-config/index.js +68 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/storage/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/types/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/package.json +1 -0
- package/dist/plugin-runtime/package.json +1 -0
- package/dist/{extensions → plugin-runtime}/plugin-sandbox-bootstrap.js +129 -129
- package/dist/remote/remote-environments.d.ts +1 -0
- package/dist/runtime/config/agent-runtime-config-builder.d.ts +2 -0
- package/dist/runtime/host/local-runtime-host.d.ts +10 -0
- package/dist/runtime/host/runtime-host.d.ts +6 -0
- package/dist/runtime/orchestration/runtime-oauth-token-manager.d.ts +3 -0
- package/dist/runtime/orchestration/session-runtime-orchestrator.d.ts +10 -1
- package/dist/runtime/orchestration/session-runtime.d.ts +2 -0
- package/dist/runtime/tools/subprocess-sandbox.d.ts +22 -0
- package/dist/services/cloud-handoff/git-preparation.d.ts +22 -0
- package/dist/services/global-settings.d.ts +6 -0
- package/dist/services/llms/cline-recommended-models.d.ts +2 -0
- package/dist/services/local-runtime-bootstrap.d.ts +1 -0
- package/dist/services/plugin-command-api.d.ts +47 -0
- package/dist/services/plugin-commands.d.ts +25 -27
- package/dist/services/skills-cli.d.ts +2 -0
- package/dist/services/telemetry/core-events.d.ts +26 -0
- package/dist/services/telemetry/index.js +1 -1
- package/dist/services/telemetry/run-health.d.ts +40 -0
- package/dist/services/telemetry/stall-signals.d.ts +12 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/session.d.ts +7 -0
- package/package.json +6 -5
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{mo,ho,Qs,Kr}from"./index-g2y6ptdc.js";import{j2,Oc}from"./index-w55v4n1n.js";import{pt}from"./index-w9n2kgjk.js";import{createRequire as g}from"module";var I=g(import.meta.url),Yl=class{async doEmbed(e,r,d,a){let{abortSignal:i,values:o}=d;try{if(o.length>a)throw new pt({maxEmbeddingsPerCall:a,modelId:e.modelId,provider:e.provider,values:o});let t=e.parsedProviderOptions,m=mo(e.provider),l=t?.type??r.type??"text",n=[];this.resolveWarnings(r,n);let p=this.createClient(e,r,t),s=await this.executeCall(p,o,l,Oc(e.requestConfig,i,d.headers)),u=this.extractEmbeddings(s),c=this.extractTokenCount(s),{headers:h,requestId:v}=this.extractResponseMetadata(s);return j2({embeddings:u,modelId:e.modelId,providerName:m,requestId:v,responseHeaders:h,totalTokens:c,version:Kr,warnings:n})}catch(t){if(t instanceof pt)throw t;throw Qs(t,{modelId:e.modelId,modelType:"embeddingModel",operation:"doEmbed",requestBody:{values:o.length},url:this.getUrl()})}}extractResponseMetadata(e){return{headers:void 0,requestId:void 0}}mergeModelParams(e,r){return ho(e.modelParams??{},r?.modelParams??{})}resolveWarnings(e,r){return}};
|
|
2
|
+
export{Yl};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{ef}from"./index-6dpcn5cw.js";import{Ct}from"./index-ge184xvn.js";import{v,i,c}from"./index-edf1hmcw.js";var Zr=i(function(G){var ha=G&&G.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(G,"__esModule",{value:!0});var da=c("fs"),pa=ha(Ct()),xe=pa.default("@kwsites/file-exists");function ma(e,t,r){xe("checking %s",e);try{let s=da.statSync(e);if(s.isFile()&&t)return xe("[OK] path represents a file"),!0;if(s.isDirectory()&&r)return xe("[OK] path represents a directory"),!0;return xe("[FAIL] path represents something other than a file or directory"),!1}catch(s){if(s.code==="ENOENT")return xe("[FAIL] path is not accessible: %o",s),!1;throw xe("[FATAL] %o",s),s}}function ga(e,t=G.READABLE){return ma(e,(t&G.FILE)>0,(t&G.FOLDER)>0)}G.exists=ga;G.FILE=1;G.FOLDER=2;G.READABLE=G.FILE+G.FOLDER});var Jr=i(function(ut){function _a(e){for(var t in e)if(!ut.hasOwnProperty(t))ut[t]=e[t]}Object.defineProperty(ut,"__esModule",{value:!0});_a(Zr())});var zt=i(function(es){Object.defineProperty(es,"__esModule",{value:!0});es.createDeferred=es.deferred=void 0;function Vt(){let e,t,r="pending";return{promise:new Promise((n,o)=>{e=n,t=o}),done(n){if(r==="pending")r="resolved",e(n)},fail(n){if(r==="pending")r="rejected",t(n)},get fulfilled(){return r!=="pending"},get status(){return r}}}es.deferred=Vt;es.createDeferred=Vt;es.default=Vt});var ns=i(function(K){var uf=K&&K.__createBinding||(Object.create?function(e,t,r,s){if(s===void 0)s=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable))n={enumerable:!0,get:function(){return t[r]}};Object.defineProperty(e,s,n)}:function(e,t,r,s){if(s===void 0)s=r;e[s]=t[r]}),cf=K&&K.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Gi=K&&K.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))uf(t,e,r)}return cf(t,e),t},lf=K&&K.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(K,"__esModule",{value:!0});K.HttpProxyAgent=void 0;var ff=Gi(c("net")),hf=Gi(c("tls")),df=lf(Ct()),pf=c("events"),mf=ef(),$i=c("url"),Ne=(0,df.default)("http-proxy-agent");class Ir extends mf.Agent{constructor(e,t){super(t);this.proxy=typeof e==="string"?new $i.URL(e):e,this.proxyHeaders=t?.headers??{},Ne("Creating new HttpProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),s=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...t?gf(t,"headers"):null,host:r,port:s}}addRequest(e,t){e._header=null,this.setRequestProps(e,t),super.addRequest(e,t)}setRequestProps(e,t){let{proxy:r}=this,s=t.secureEndpoint?"https:":"http:",n=e.getHeader("host")||"localhost",o=`${s}//${n}`,a=new $i.URL(e.path,o);if(t.port!==80)a.port=String(t.port);e.path=String(a);let u=typeof this.proxyHeaders==="function"?this.proxyHeaders():{...this.proxyHeaders};if(r.username||r.password){let l=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;u["Proxy-Authorization"]=`Basic ${Buffer.from(l).toString("base64")}`}if(!u["Proxy-Connection"])u["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close";for(let l of Object.keys(u)){let m=u[l];if(m)e.setHeader(l,m)}}async connect(e,t){if(e._header=null,!e.path.includes("://"))this.setRequestProps(e,t);let r,s;if(Ne("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0)Ne("Patching connection write() output buffer with updated header"),r=e.outputData[0].data,s=r.indexOf(`\r
|
|
2
|
+
\r
|
|
3
|
+
`)+4,e.outputData[0].data=e._header+r.substring(s),Ne("Output buffer: %o",e.outputData[0].data);let n;if(this.proxy.protocol==="https:")Ne("Creating `tls.Socket`: %o",this.connectOpts),n=hf.connect(this.connectOpts);else Ne("Creating `net.Socket`: %o",this.connectOpts),n=ff.connect(this.connectOpts);return await pf.once(n,"connect"),n}}Ir.protocols=["http","https"];K.HttpProxyAgent=Ir;function gf(e,...t){let r={},s;for(s in e)if(!t.includes(s))r[s]=e[s];return r}});var se=i(function(Fd,Vi){var qi=["nodebuffer","arraybuffer","fragments"],Wi=typeof Blob<"u";if(Wi)qi.push("blob");Vi.exports={BINARY_TYPES:qi,CLOSE_TIMEOUT:30000,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Wi,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Ze=i(function(jd,Pt){var{EMPTY_BUFFER:bf}=se(),Ur=Buffer[Symbol.species];function wf(e,t){if(e.length===0)return bf;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),s=0;for(let n=0;n<e.length;n++){let o=e[n];r.set(o,s),s+=o.length}if(s<t)return new Ur(r.buffer,r.byteOffset,s);return r}function zi(e,t,r,s,n){for(let o=0;o<n;o++)r[s+o]=e[o]^t[o&3]}function Hi(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function Tf(e){if(e.length===e.buffer.byteLength)return e.buffer;return e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function Fr(e){if(Fr.readOnly=!0,Buffer.isBuffer(e))return e;let t;if(e instanceof ArrayBuffer)t=new Ur(e);else if(ArrayBuffer.isView(e))t=new Ur(e.buffer,e.byteOffset,e.byteLength);else t=Buffer.from(e),Fr.readOnly=!1;return t}Pt.exports={concat:wf,mask:zi,toArrayBuffer:Tf,toBuffer:Fr,unmask:Hi};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=(()=>{throw new Error("Cannot require module "+"bufferutil");})();Pt.exports.mask=function(t,r,s,n,o){if(o<48)zi(t,r,s,n,o);else e.mask(t,r,s,n,o)},Pt.exports.unmask=function(t,r){if(t.length<32)Hi(t,r);else e.unmask(t,r)}}catch(e){}});var Qi=i(function($d,Xi){var Yi=Symbol("kDone"),jr=Symbol("kRun");class Ki{constructor(e){this[Yi]=()=>{this.pending--,this[jr]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[jr]()}[jr](){if(this.pending===this.concurrency)return;if(this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[Yi])}}}Xi.exports=Ki});var Me=i(function(Gd,ro){var Je=c("zlib"),Zi=Ze(),xf=Qi(),{kStatusCode:Ji}=se(),kf=Buffer[Symbol.species],Sf=Buffer.from([0,0,255,255]),Lt=Symbol("permessage-deflate"),ne=Symbol("total-length"),Ae=Symbol("callback"),le=Symbol("buffers"),De=Symbol("error"),Rt;class eo{constructor(e){if(this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!Rt){let t=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Rt=new xf(t)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};if(this._options.serverNoContextTakeover)e.server_no_context_takeover=!0;if(this._options.clientNoContextTakeover)e.client_no_context_takeover=!0;if(this._options.serverMaxWindowBits)e.server_max_window_bits=this._options.serverMaxWindowBits;if(this._options.clientMaxWindowBits)e.client_max_window_bits=this._options.clientMaxWindowBits;else if(this._options.clientMaxWindowBits==null)e.client_max_window_bits=!0;return e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate)this._inflate.close(),this._inflate=null;if(this._deflate){let e=this._deflate[Ae];if(this._deflate.close(),this._deflate=null,e)e(Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,r=e.find((s)=>{if(t.serverNoContextTakeover===!1&&s.server_no_context_takeover||s.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits==="number"&&t.serverMaxWindowBits>s.server_max_window_bits)||typeof t.clientMaxWindowBits==="number"&&(typeof s.client_max_window_bits==="number"?t.clientMaxWindowBits>s.client_max_window_bits:!s.client_max_window_bits))return!1;return!0});if(!r)throw Error("None of the extension offers can be accepted");if(t.serverNoContextTakeover)r.server_no_context_takeover=!0;if(t.clientNoContextTakeover)r.client_no_context_takeover=!0;if(typeof t.serverMaxWindowBits==="number")r.server_max_window_bits=t.serverMaxWindowBits;if(typeof t.clientMaxWindowBits==="number")r.client_max_window_bits=t.clientMaxWindowBits;else if(r.client_max_window_bits===!0||t.clientMaxWindowBits===!1)delete r.client_max_window_bits;return r}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits){if(typeof this._options.clientMaxWindowBits==="number")t.client_max_window_bits=this._options.clientMaxWindowBits}else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits==="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach((t)=>{Object.keys(t).forEach((r)=>{let s=t[r];if(s.length>1)throw Error(`Parameter "${r}" must have only a single value`);if(s=s[0],r==="client_max_window_bits"){if(s!==!0){let n=+s;if(!Number.isInteger(n)||n<8||n>15)throw TypeError(`Invalid value for parameter "${r}": ${s}`);s=n}else if(!this._isServer)throw TypeError(`Invalid value for parameter "${r}": ${s}`)}else if(r==="server_max_window_bits"){let n=+s;if(!Number.isInteger(n)||n<8||n>15)throw TypeError(`Invalid value for parameter "${r}": ${s}`);s=n}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){if(s!==!0)throw TypeError(`Invalid value for parameter "${r}": ${s}`)}else throw Error(`Unknown parameter "${r}"`);t[r]=s})}),e}decompress(e,t,r){Rt.add((s)=>{this._decompress(e,t,(n,o)=>{s(),r(n,o)})})}compress(e,t,r){Rt.add((s)=>{this._compress(e,t,(n,o)=>{s(),r(n,o)})})}_decompress(e,t,r){let s=this._isServer?"client":"server";if(!this._inflate){let n=`${s}_max_window_bits`,o=typeof this.params[n]!=="number"?Je.Z_DEFAULT_WINDOWBITS:this.params[n];this._inflate=Je.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[Lt]=this,this._inflate[ne]=0,this._inflate[le]=[],this._inflate.on("error",Of),this._inflate.on("data",to)}if(this._inflate[Ae]=r,this._inflate.write(e),t)this._inflate.write(Sf);this._inflate.flush(()=>{let n=this._inflate[De];if(n){this._inflate.close(),this._inflate=null,r(n);return}let o=Zi.concat(this._inflate[le],this._inflate[ne]);if(this._inflate._readableState.endEmitted)this._inflate.close(),this._inflate=null;else if(this._inflate[ne]=0,this._inflate[le]=[],t&&this.params[`${s}_no_context_takeover`])this._inflate.reset();r(null,o)})}_compress(e,t,r){let s=this._isServer?"server":"client";if(!this._deflate){let n=`${s}_max_window_bits`,o=typeof this.params[n]!=="number"?Je.Z_DEFAULT_WINDOWBITS:this.params[n];this._deflate=Je.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[ne]=0,this._deflate[le]=[],this._deflate.on("data",Ef)}this._deflate[Ae]=r,this._deflate.write(e),this._deflate.flush(Je.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let n=Zi.concat(this._deflate[le],this._deflate[ne]);if(t)n=new kf(n.buffer,n.byteOffset,n.length-4);if(this._deflate[Ae]=null,this._deflate[ne]=0,this._deflate[le]=[],t&&this.params[`${s}_no_context_takeover`])this._deflate.reset();r(null,n)})}}ro.exports=eo;function Ef(e){this[le].push(e),this[ne]+=e.length}function to(e){if(this[ne]+=e.length,this[Lt]._maxPayload<1||this[ne]<=this[Lt]._maxPayload){this[le].push(e);return}this[De]=RangeError("Max payload size exceeded"),this[De].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[De][Ji]=1009,this.removeListener("data",to),this.reset()}function Of(e){if(this[Lt]._inflate=null,this[De]){this[Ae](this[De]);return}e[Ji]=1007,this[Ae](e)}});var Ie=i(function(qd,Nt){var{isUtf8:so}=c("buffer"),{hasBlob:Pf}=se(),Cf=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Rf(e){return e>=1000&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3000&&e<=4999}function $r(e){let t=e.length,r=0;while(r<t)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function Lf(e){return Pf&&typeof e==="object"&&typeof e.arrayBuffer==="function"&&typeof e.type==="string"&&typeof e.stream==="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}Nt.exports={isBlob:Lf,isValidStatusCode:Rf,isValidUTF8:$r,tokenChars:Cf};if(so)Nt.exports.isValidUTF8=function(e){return e.length<24?$r(e):so(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=(()=>{throw new Error("Cannot require module "+"utf-8-validate");})();Nt.exports.isValidUTF8=function(t){return t.length<32?$r(t):e(t)}}catch(e){}});var qr=i(function(Wd,uo){var{Writable:Nf}=c("stream"),no=Me(),{BINARY_TYPES:Af,EMPTY_BUFFER:io,kStatusCode:Df,kWebSocket:Mf}=se(),{concat:Gr,toArrayBuffer:If,unmask:Bf}=Ze(),{isValidStatusCode:Uf,isValidUTF8:oo}=Ie(),At=Buffer[Symbol.species];class ao extends Nf{constructor(e={}){super();this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||Af[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxBufferedChunks=e.maxBufferedChunks|0,this._maxFragments=e.maxFragments|0,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[Mf]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=0}_write(e,t,r){if(this._opcode===8&&this._state==0)return r();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){r(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(r)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let r=this._buffers[0];return this._buffers[0]=new At(r.buffer,r.byteOffset+e,r.length-e),new At(r.buffer,r.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let r=this._buffers[0],s=t.length-e;if(e>=r.length)t.set(this._buffers.shift(),s);else t.set(new Uint8Array(r.buffer,r.byteOffset,e),s),this._buffers[0]=new At(r.buffer,r.byteOffset+e,r.length-e);e-=r.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case 0:this.getInfo(e);break;case 1:this.getPayloadLength16(e);break;case 2:this.getPayloadLength64(e);break;case 3:this.getMask();break;case 4:this.getData(e);break;case 5:case 6:this._loop=!1;return}while(this._loop);if(!this._errored)e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let s=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(s);return}let r=(t[0]&64)===64;if(r&&!this._extensions[no.extensionName]){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(s);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(r){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(s);return}if(!this._fragmented){let s=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(s);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let s=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(s);return}this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let s=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(s);return}if(r){let s=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(s);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let s=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(s);return}}else{let s=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(s);return}if(!this._fin&&!this._fragmented)this._fragmented=this._opcode;if(this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let s=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(s);return}}else if(this._masked){let s=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(s);return}if(this._payloadLength===126)this._state=1;else if(this._payloadLength===127)this._state=2;else this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),r=t.readUInt32BE(0);if(r>Math.pow(2,21)-1){let s=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(s);return}this._payloadLength=r*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8){if(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}}if(this._masked)this._state=3;else this._state=4}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=4}getData(e){let t=io;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}if(t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0)Bf(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){let r=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");e(r);return}if(this._compressed){this._state=5,this.decompress(t,e);return}if(t.length)this._messageLength=this._totalPayloadLength,this._fragments.push(t);this.dataMessage(e)}decompress(e,t){this._extensions[no.extensionName].decompress(e,this._fin,(s,n)=>{if(s)return t(s);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._fragments.push(n)}if(this.dataMessage(t),this._state===0)this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=0;return}let t=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let s;if(this._binaryType==="nodebuffer")s=Gr(r,t);else if(this._binaryType==="arraybuffer")s=If(Gr(r,t));else if(this._binaryType==="blob")s=new Blob(r);else s=r;if(this._allowSynchronousEvents)this.emit("message",s,!0),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",s,!0),this._state=0,this.startLoop(e)})}else{let s=Gr(r,t);if(!this._skipUTF8Validation&&!oo(s)){let n=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(n);return}if(this._state===5||this._allowSynchronousEvents)this.emit("message",s,!1),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",s,!1),this._state=0,this.startLoop(e)})}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,io),this.end();else{let r=e.readUInt16BE(0);if(!Uf(r)){let n=this.createError(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(n);return}let s=new At(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!oo(s)){let n=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(n);return}this._loop=!1,this.emit("conclude",r,s),this.end()}this._state=0;return}if(this._allowSynchronousEvents)this.emit(this._opcode===9?"ping":"pong",e),this._state=0;else this._state=6,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=0,this.startLoop(t)})}createError(e,t,r,s,n){this._loop=!1,this._errored=!0;let o=new e(r?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=n,o[Df]=s,o}}uo.exports=ao});var Vr=i(function(zd,fo){var{Duplex:Vd}=c("stream"),{randomFillSync:Ff}=c("crypto"),{types:{isUint8Array:jf}}=c("util"),co=Me(),{EMPTY_BUFFER:$f,kWebSocket:Gf,NOOP:qf}=se(),{isBlob:Be,isValidStatusCode:Wf}=Ie(),{mask:lo,toBuffer:ve}=Ze(),X=Symbol("kByteLength"),Vf=Buffer.alloc(4),be,Ue=8192,Z=0,zf=1,Hf=2;class fe{constructor(e,t,r){if(this._extensions=t||{},r)this._generateMask=r,this._maskBuffer=Buffer.alloc(4);this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Z,this.onerror=qf,this[Gf]=void 0}static frame(e,t){let r,s=!1,n=2,o=!1;if(t.mask){if(r=t.maskBuffer||Vf,t.generateMask)t.generateMask(r);else{if(Ue===8192){if(be===void 0)be=Buffer.alloc(8192);Ff(be,0,8192),Ue=0}r[0]=be[Ue++],r[1]=be[Ue++],r[2]=be[Ue++],r[3]=be[Ue++]}o=(r[0]|r[1]|r[2]|r[3])===0,n=6}let a;if(typeof e==="string")if((!t.mask||o)&&t[X]!==void 0)a=t[X];else e=Buffer.from(e),a=e.length;else a=e.length,s=t.mask&&t.readOnly&&!o;let u=a;if(a>=65536)n+=8,u=127;else if(a>125)n+=2,u=126;let l=Buffer.allocUnsafe(s?a+n:n);if(l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1)l[0]|=64;if(l[1]=u,u===126)l.writeUInt16BE(a,2);else if(u===127)l[2]=l[3]=0,l.writeUIntBE(a,4,6);if(!t.mask)return[l,e];if(l[1]|=128,l[n-4]=r[0],l[n-3]=r[1],l[n-2]=r[2],l[n-1]=r[3],o)return[l,e];if(s)return lo(e,r,l,n,a),[l];return lo(e,r,e,0,a),[l,e]}close(e,t,r,s){let n;if(e===void 0)n=$f;else if(typeof e!=="number"||!Wf(e))throw TypeError("First argument must be a valid error code number");else if(t===void 0||!t.length)n=Buffer.allocUnsafe(2),n.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw RangeError("The message must not be greater than 123 bytes");if(n=Buffer.allocUnsafe(2+a),n.writeUInt16BE(e,0),typeof t==="string")n.write(t,2);else if(jf(t))n.set(t,2);else throw TypeError("Second argument must be a string or a Uint8Array")}let o={[X]:n.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};if(this._state!==Z)this.enqueue([this.dispatch,n,!1,o,s]);else this.sendFrame(fe.frame(n,o),s)}ping(e,t,r){let s,n;if(typeof e==="string")s=Buffer.byteLength(e),n=!1;else if(Be(e))s=e.size,n=!1;else e=ve(e),s=e.length,n=ve.readOnly;if(s>125)throw RangeError("The data size must not be greater than 125 bytes");let o={[X]:s,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:n,rsv1:!1};if(Be(e))if(this._state!==Z)this.enqueue([this.getBlobData,e,!1,o,r]);else this.getBlobData(e,!1,o,r);else if(this._state!==Z)this.enqueue([this.dispatch,e,!1,o,r]);else this.sendFrame(fe.frame(e,o),r)}pong(e,t,r){let s,n;if(typeof e==="string")s=Buffer.byteLength(e),n=!1;else if(Be(e))s=e.size,n=!1;else e=ve(e),s=e.length,n=ve.readOnly;if(s>125)throw RangeError("The data size must not be greater than 125 bytes");let o={[X]:s,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:n,rsv1:!1};if(Be(e))if(this._state!==Z)this.enqueue([this.getBlobData,e,!1,o,r]);else this.getBlobData(e,!1,o,r);else if(this._state!==Z)this.enqueue([this.dispatch,e,!1,o,r]);else this.sendFrame(fe.frame(e,o),r)}send(e,t,r){let s=this._extensions[co.extensionName],n=t.binary?2:1,o=t.compress,a,u;if(typeof e==="string")a=Buffer.byteLength(e),u=!1;else if(Be(e))a=e.size,u=!1;else e=ve(e),a=e.length,u=ve.readOnly;if(this._firstFragment){if(this._firstFragment=!1,o&&s&&s.params[s._isServer?"server_no_context_takeover":"client_no_context_takeover"])o=a>=s._threshold;this._compress=o}else o=!1,n=0;if(t.fin)this._firstFragment=!0;let l={[X]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:n,readOnly:u,rsv1:o};if(Be(e))if(this._state!==Z)this.enqueue([this.getBlobData,e,this._compress,l,r]);else this.getBlobData(e,this._compress,l,r);else if(this._state!==Z)this.enqueue([this.dispatch,e,this._compress,l,r]);else this.dispatch(e,this._compress,l,r)}getBlobData(e,t,r,s){this._bufferedBytes+=r[X],this._state=Hf,e.arrayBuffer().then((n)=>{if(this._socket.destroyed){let a=Error("The socket was closed while the blob was being read");process.nextTick(Wr,this,a,s);return}this._bufferedBytes-=r[X];let o=ve(n);if(!t)this._state=Z,this.sendFrame(fe.frame(o,r),s),this.dequeue();else this.dispatch(o,t,r,s)}).catch((n)=>{process.nextTick(Yf,this,n,s)})}dispatch(e,t,r,s){if(!t){this.sendFrame(fe.frame(e,r),s);return}let n=this._extensions[co.extensionName];this._bufferedBytes+=r[X],this._state=zf,n.compress(e,r.fin,(o,a)=>{if(this._socket.destroyed){let u=Error("The socket was closed while data was being compressed");Wr(this,u,s);return}this._bufferedBytes-=r[X],this._state=Z,r.readOnly=!1,this.sendFrame(fe.frame(a,r),s),this.dequeue()})}dequeue(){while(this._state===Z&&this._queue.length){let e=this._queue.shift();this._bufferedBytes-=e[3][X],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][X],this._queue.push(e)}sendFrame(e,t){if(e.length===2)this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork();else this._socket.write(e[0],t)}}fo.exports=fe;function Wr(e,t,r){if(typeof r==="function")r(t);for(let s=0;s<e._queue.length;s++){let n=e._queue[s],o=n[n.length-1];if(typeof o==="function")o(t)}}function Yf(e,t,r){Wr(e,t,r),e.onerror(t)}});var wo=i(function(Hd,bo){var{kForOnEventAttribute:et,kListener:zr}=se(),ho=Symbol("kCode"),po=Symbol("kData"),mo=Symbol("kError"),go=Symbol("kMessage"),_o=Symbol("kReason"),Fe=Symbol("kTarget"),yo=Symbol("kType"),vo=Symbol("kWasClean");class he{constructor(e){this[Fe]=null,this[yo]=e}get target(){return this[Fe]}get type(){return this[yo]}}Object.defineProperty(he.prototype,"target",{enumerable:!0});Object.defineProperty(he.prototype,"type",{enumerable:!0});class je extends he{constructor(e,t={}){super(e);this[ho]=t.code===void 0?0:t.code,this[_o]=t.reason===void 0?"":t.reason,this[vo]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[ho]}get reason(){return this[_o]}get wasClean(){return this[vo]}}Object.defineProperty(je.prototype,"code",{enumerable:!0});Object.defineProperty(je.prototype,"reason",{enumerable:!0});Object.defineProperty(je.prototype,"wasClean",{enumerable:!0});class tt extends he{constructor(e,t={}){super(e);this[mo]=t.error===void 0?null:t.error,this[go]=t.message===void 0?"":t.message}get error(){return this[mo]}get message(){return this[go]}}Object.defineProperty(tt.prototype,"error",{enumerable:!0});Object.defineProperty(tt.prototype,"message",{enumerable:!0});class Mt extends he{constructor(e,t={}){super(e);this[po]=t.data===void 0?null:t.data}get data(){return this[po]}}Object.defineProperty(Mt.prototype,"data",{enumerable:!0});var Kf={addEventListener(e,t,r={}){for(let n of this.listeners(e))if(!r[et]&&n[zr]===t&&!n[et])return;let s;if(e==="message")s=function(o,a){let u=new Mt("message",{data:a?o:o.toString()});u[Fe]=this,Dt(t,this,u)};else if(e==="close")s=function(o,a){let u=new je("close",{code:o,reason:a.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});u[Fe]=this,Dt(t,this,u)};else if(e==="error")s=function(o){let a=new tt("error",{error:o,message:o.message});a[Fe]=this,Dt(t,this,a)};else if(e==="open")s=function(){let o=new he("open");o[Fe]=this,Dt(t,this,o)};else return;if(s[et]=!!r[et],s[zr]=t,r.once)this.once(e,s);else this.on(e,s)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[zr]===t&&!r[et]){this.removeListener(e,r);break}}};bo.exports={CloseEvent:je,ErrorEvent:tt,Event:he,EventTarget:Kf,MessageEvent:Mt};function Dt(e,t,r){if(typeof e==="object"&&e.handleEvent)e.handleEvent.call(e,r);else e.call(t,r)}});var It=i(function(Yd,To){var{tokenChars:rt}=Ie();function te(e,t,r){if(e[t]===void 0)e[t]=[r];else e[t].push(r)}function Xf(e){let t=Object.create(null),r=Object.create(null),s=!1,n=!1,o=!1,a,u,l=-1,m=-1,h=-1,p=0;for(;p<e.length;p++)if(m=e.charCodeAt(p),a===void 0)if(h===-1&&rt[m]===1){if(l===-1)l=p}else if(p!==0&&(m===32||m===9)){if(h===-1&&l!==-1)h=p}else if(m===59||m===44){if(l===-1)throw SyntaxError(`Unexpected character at index ${p}`);if(h===-1)h=p;let k=e.slice(l,h);if(m===44)te(t,k,r),r=Object.create(null);else a=k;l=h=-1}else throw SyntaxError(`Unexpected character at index ${p}`);else if(u===void 0)if(h===-1&&rt[m]===1){if(l===-1)l=p}else if(m===32||m===9){if(h===-1&&l!==-1)h=p}else if(m===59||m===44){if(l===-1)throw SyntaxError(`Unexpected character at index ${p}`);if(h===-1)h=p;if(te(r,e.slice(l,h),!0),m===44)te(t,a,r),r=Object.create(null),a=void 0;l=h=-1}else if(m===61&&l!==-1&&h===-1)u=e.slice(l,p),l=h=-1;else throw SyntaxError(`Unexpected character at index ${p}`);else if(n){if(rt[m]!==1)throw SyntaxError(`Unexpected character at index ${p}`);if(l===-1)l=p;else if(!s)s=!0;n=!1}else if(o)if(rt[m]===1){if(l===-1)l=p}else if(m===34&&l!==-1)o=!1,h=p;else if(m===92)n=!0;else throw SyntaxError(`Unexpected character at index ${p}`);else if(m===34&&e.charCodeAt(p-1)===61)o=!0;else if(h===-1&&rt[m]===1){if(l===-1)l=p}else if(l!==-1&&(m===32||m===9)){if(h===-1)h=p}else if(m===59||m===44){if(l===-1)throw SyntaxError(`Unexpected character at index ${p}`);if(h===-1)h=p;let k=e.slice(l,h);if(s)k=k.replace(/\\/g,""),s=!1;if(te(r,u,k),m===44)te(t,a,r),r=Object.create(null),a=void 0;u=void 0,l=h=-1}else throw SyntaxError(`Unexpected character at index ${p}`);if(l===-1||o||m===32||m===9)throw SyntaxError("Unexpected end of input");if(h===-1)h=p;let w=e.slice(l,h);if(a===void 0)te(t,w,r);else{if(u===void 0)te(r,w,!0);else if(s)te(r,u,w.replace(/\\/g,""));else te(r,u,w);te(t,a,r)}return t}function Qf(e){return Object.keys(e).map((t)=>{let r=e[t];if(!Array.isArray(r))r=[r];return r.map((s)=>[t].concat(Object.keys(s).map((n)=>{let o=s[n];if(!Array.isArray(o))o=[o];return o.map((a)=>a===!0?n:`${n}=${a}`).join("; ")})).join("; ")).join(", ")}).join(", ")}To.exports={format:Qf,parse:Xf}});var jt=i(function(Qd,Do){var Zf=c("events"),Jf=c("https"),eh=c("http"),So=c("net"),th=c("tls"),{randomBytes:rh,createHash:sh}=c("crypto"),{Duplex:Kd,Readable:Xd}=c("stream"),{URL:Hr}=c("url"),de=Me(),nh=qr(),ih=Vr(),{isBlob:oh}=Ie(),{BINARY_TYPES:xo,CLOSE_TIMEOUT:ah,EMPTY_BUFFER:Bt,GUID:uh,kForOnEventAttribute:Yr,kListener:ch,kStatusCode:lh,kWebSocket:A,NOOP:Eo}=se(),{EventTarget:{addEventListener:fh,removeEventListener:hh}}=wo(),{format:dh,parse:ph}=It(),{toBuffer:mh}=Ze(),Oo=Symbol("kAborted"),Kr=[8,13],ie=["CONNECTING","OPEN","CLOSING","CLOSED"],gh=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class x extends Zf{constructor(e,t,r){super();if(this._binaryType=xo[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Bt,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=x.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null){if(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0)if(!r||r.protocols===void 0)t=[];else if(Array.isArray(r.protocols))t=r.protocols;else t=[r.protocols];else if(!Array.isArray(t))if(typeof t==="object"&&t!==null)if(r=t,r.protocols===void 0)t=[];else if(Array.isArray(r.protocols))t=r.protocols;else t=[r.protocols];else t=[t];Po(this,e,t,r)}else this._autoPong=r.autoPong,this._closeTimeout=r.closeTimeout,this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(e){if(!xo.includes(e))return;if(this._binaryType=e,this._receiver)this._receiver._binaryType=e}get bufferedAmount(){if(!this._socket)return this._bufferedAmount;return this._socket._writableState.length+this._sender._bufferedBytes}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,r){let s=new nh({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:r.maxBufferedChunks,maxFragments:r.maxFragments,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation}),n=new ih(e,this._extensions,r.generateMask);if(this._receiver=s,this._sender=n,this._socket=e,s[A]=this,n[A]=this,e[A]=this,s.on("conclude",vh),s.on("drain",bh),s.on("error",wh),s.on("message",Th),s.on("ping",xh),s.on("pong",kh),n.onerror=Sh,e.setTimeout)e.setTimeout(0);if(e.setNoDelay)e.setNoDelay();if(t.length>0)e.unshift(t);e.on("close",Lo),e.on("data",Ft),e.on("end",No),e.on("error",Ao),this._readyState=x.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=x.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}if(this._extensions[de.extensionName])this._extensions[de.extensionName].cleanup();this._receiver.removeAllListeners(),this._readyState=x.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState===x.CLOSED)return;if(this.readyState===x.CONNECTING){W(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===x.CLOSING){if(this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted))this._socket.end();return}this._sender.close(e,t,!this._isServer,(r)=>{if(r)return;if(this._closeFrameSent=!0,this._closeFrameReceived||this._receiver._writableState.errorEmitted)this._socket.end()}),this._readyState=x.CLOSING,Ro(this)}pause(){if(this.readyState===x.CONNECTING||this.readyState===x.CLOSED)return;this._paused=!0,this._socket.pause()}ping(e,t,r){if(this.readyState===x.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e==="function")r=e,e=t=void 0;else if(typeof t==="function")r=t,t=void 0;if(typeof e==="number")e=e.toString();if(this.readyState!==x.OPEN){Xr(this,e,r);return}if(t===void 0)t=!this._isServer;this._sender.ping(e||Bt,t,r)}pong(e,t,r){if(this.readyState===x.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e==="function")r=e,e=t=void 0;else if(typeof t==="function")r=t,t=void 0;if(typeof e==="number")e=e.toString();if(this.readyState!==x.OPEN){Xr(this,e,r);return}if(t===void 0)t=!this._isServer;this._sender.pong(e||Bt,t,r)}resume(){if(this.readyState===x.CONNECTING||this.readyState===x.CLOSED)return;if(this._paused=!1,!this._receiver._writableState.needDrain)this._socket.resume()}send(e,t,r){if(this.readyState===x.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t==="function")r=t,t={};if(typeof e==="number")e=e.toString();if(this.readyState!==x.OPEN){Xr(this,e,r);return}let s={binary:typeof e!=="string",mask:!this._isServer,compress:!0,fin:!0,...t};if(!this._extensions[de.extensionName])s.compress=!1;this._sender.send(e||Bt,s,r)}terminate(){if(this.readyState===x.CLOSED)return;if(this.readyState===x.CONNECTING){W(this,this._req,"WebSocket was closed before the connection was established");return}if(this._socket)this._readyState=x.CLOSING,this._socket.destroy()}}Object.defineProperty(x,"CONNECTING",{enumerable:!0,value:ie.indexOf("CONNECTING")});Object.defineProperty(x.prototype,"CONNECTING",{enumerable:!0,value:ie.indexOf("CONNECTING")});Object.defineProperty(x,"OPEN",{enumerable:!0,value:ie.indexOf("OPEN")});Object.defineProperty(x.prototype,"OPEN",{enumerable:!0,value:ie.indexOf("OPEN")});Object.defineProperty(x,"CLOSING",{enumerable:!0,value:ie.indexOf("CLOSING")});Object.defineProperty(x.prototype,"CLOSING",{enumerable:!0,value:ie.indexOf("CLOSING")});Object.defineProperty(x,"CLOSED",{enumerable:!0,value:ie.indexOf("CLOSED")});Object.defineProperty(x.prototype,"CLOSED",{enumerable:!0,value:ie.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach((e)=>{Object.defineProperty(x.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach((e)=>{Object.defineProperty(x.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[Yr])return t[ch];return null},set(t){for(let r of this.listeners(e))if(r[Yr]){this.removeListener(e,r);break}if(typeof t!=="function")return;this.addEventListener(e,t,{[Yr]:!0})}})});x.prototype.addEventListener=fh;x.prototype.removeEventListener=hh;Do.exports=x;function Po(e,t,r,s){let n={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:ah,protocolVersion:Kr[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...s,socketPath:void 0,hostname:void 0,protocol:void 0,protocols:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=n.autoPong,e._closeTimeout=n.closeTimeout,!Kr.includes(n.protocolVersion))throw RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${Kr.join(", ")})`);let o;if(t instanceof Hr)o=t;else try{o=new Hr(t)}catch{throw SyntaxError(`Invalid URL: ${t}`)}if(o.protocol==="http:")o.protocol="ws:";else if(o.protocol==="https:")o.protocol="wss:";e._url=o.href;let a=o.protocol==="wss:",u=o.protocol==="ws+unix:",l;if(o.protocol!=="ws:"&&!a&&!u)l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`;else if(u&&!o.pathname)l="The URL's pathname is empty";else if(o.hash)l="The URL contains a fragment identifier";if(l){let S=SyntaxError(l);if(e._redirects===0)throw S;else{Ut(e,S);return}}let m=a?443:80,h=rh(16).toString("base64"),p=a?Jf.request:eh.request,w=new Set,k;if(n.createConnection=n.createConnection||(a?yh:_h),n.defaultPort=n.defaultPort||m,n.port=o.port||m,n.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":h,Connection:"Upgrade",Upgrade:"websocket"},n.path=o.pathname+o.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate)k=new de({...n.perMessageDeflate,isServer:!1,maxPayload:n.maxPayload}),n.headers["Sec-WebSocket-Extensions"]=dh({[de.extensionName]:k.offer()});if(r.length){for(let S of r){if(typeof S!=="string"||!gh.test(S)||w.has(S))throw SyntaxError("An invalid or duplicated subprotocol was specified");w.add(S)}n.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(n.origin)if(n.protocolVersion<13)n.headers["Sec-WebSocket-Origin"]=n.origin;else n.headers.Origin=n.origin;if(o.username||o.password)n.auth=`${o.username}:${o.password}`;if(u){let S=n.path.split(":");n.socketPath=S[0],n.path=S[1]}let g;if(n.followRedirects){if(e._redirects===0){e._originalIpc=u,e._originalSecure=a,e._originalHostOrSocketPath=u?n.socketPath:o.host;let S=s&&s.headers;if(s={...s,headers:{}},S)for(let[D,oe]of Object.entries(S))s.headers[D.toLowerCase()]=oe}else if(e.listenerCount("redirect")===0){let S=u?e._originalIpc?n.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:o.host===e._originalHostOrSocketPath;if(!S||e._originalSecure&&!a){if(delete n.headers.authorization,delete n.headers.cookie,!S)delete n.headers.host;n.auth=void 0}}if(n.auth&&!s.headers.authorization)s.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64");if(g=e._req=p(n),e._redirects)e.emit("redirect",e.url,g)}else g=e._req=p(n);if(n.timeout)g.on("timeout",()=>{W(e,g,"Opening handshake has timed out")});if(g.on("error",(S)=>{if(g===null||g[Oo])return;g=e._req=null,Ut(e,S)}),g.on("response",(S)=>{let D=S.headers.location,oe=S.statusCode;if(D&&n.followRedirects&&oe>=300&&oe<400){if(++e._redirects>n.maxRedirects){W(e,g,"Maximum redirects exceeded");return}g.abort();let pe;try{pe=new Hr(D,t)}catch(it){let ae=SyntaxError(`Invalid URL: ${D}`);Ut(e,ae);return}Po(e,pe,r,s)}else if(!e.emit("unexpected-response",g,S))W(e,g,`Unexpected server response: ${S.statusCode}`)}),g.on("upgrade",(S,D,oe)=>{if(e.emit("upgrade",S),e.readyState!==x.CONNECTING)return;g=e._req=null;let pe=S.headers.upgrade;if(pe===void 0||pe.toLowerCase()!=="websocket"){W(e,D,"Invalid Upgrade header");return}let it=sh("sha1").update(h+uh).digest("base64");if(S.headers["sec-websocket-accept"]!==it){W(e,D,"Invalid Sec-WebSocket-Accept header");return}let ae=S.headers["sec-websocket-protocol"],me;if(ae!==void 0){if(!w.size)me="Server sent a subprotocol but none was requested";else if(!w.has(ae))me="Server sent an invalid subprotocol"}else if(w.size)me="Server sent no subprotocol";if(me){W(e,D,me);return}if(ae)e._protocol=ae;let ot=S.headers["sec-websocket-extensions"];if(ot!==void 0){if(!k){W(e,D,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let $e;try{$e=ph(ot)}catch(Ge){W(e,D,"Invalid Sec-WebSocket-Extensions header");return}let at=Object.keys($e);if(at.length!==1||at[0]!==de.extensionName){W(e,D,"Server indicated an extension that was not requested");return}try{k.accept($e[de.extensionName])}catch(Ge){W(e,D,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[de.extensionName]=k}e.setSocket(D,oe,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxBufferedChunks:n.maxBufferedChunks,maxFragments:n.maxFragments,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest)n.finishRequest(g,e);else g.end()}function Ut(e,t){e._readyState=x.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function _h(e){return e.path=e.socketPath,So.connect(e)}function yh(e){if(e.path=void 0,!e.servername&&e.servername!=="")e.servername=So.isIP(e.host)?"":e.host;return th.connect(e)}function W(e,t,r){e._readyState=x.CLOSING;let s=Error(r);if(Error.captureStackTrace(s,W),t.setHeader){if(t[Oo]=!0,t.abort(),t.socket&&!t.socket.destroyed)t.socket.destroy();process.nextTick(Ut,e,s)}else t.destroy(s),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e))}function Xr(e,t,r){if(t){let s=oh(t)?t.size:mh(t).length;if(e._socket)e._sender._bufferedBytes+=s;else e._bufferedAmount+=s}if(r){let s=Error(`WebSocket is not open: readyState ${e.readyState} (${ie[e.readyState]})`);process.nextTick(r,s)}}function vh(e,t){let r=this[A];if(r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[A]===void 0)return;if(r._socket.removeListener("data",Ft),process.nextTick(Co,r._socket),e===1005)r.close();else r.close(e,t)}function bh(){let e=this[A];if(!e.isPaused)e._socket.resume()}function wh(e){let t=this[A];if(t._socket[A]!==void 0)t._socket.removeListener("data",Ft),process.nextTick(Co,t._socket),t.close(e[lh]);if(!t._errorEmitted)t._errorEmitted=!0,t.emit("error",e)}function ko(){this[A].emitClose()}function Th(e,t){this[A].emit("message",e,t)}function xh(e){let t=this[A];if(t._autoPong)t.pong(e,!this._isServer,Eo);t.emit("ping",e)}function kh(e){this[A].emit("pong",e)}function Co(e){e.resume()}function Sh(e){let t=this[A];if(t.readyState===x.CLOSED)return;if(t.readyState===x.OPEN)t._readyState=x.CLOSING,Ro(t);if(this._socket.end(),!t._errorEmitted)t._errorEmitted=!0,t.emit("error",e)}function Ro(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function Lo(){let e=this[A];if(this.removeListener("close",Lo),this.removeListener("data",Ft),this.removeListener("end",No),e._readyState=x.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}if(e._receiver.end(),this[A]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted)e.emitClose();else e._receiver.on("error",ko),e._receiver.on("finish",ko)}function Ft(e){if(!this[A]._receiver.write(e))this.pause()}function No(){let e=this[A];e._readyState=x.CLOSING,e._receiver.end(),this.end()}function Ao(){let e=this[A];if(this.removeListener("error",Ao),this.on("error",Eo),e)e._readyState=x.CLOSING,this.destroy()}});var Uo=i(function(Jd,Bo){var Zd=jt(),{Duplex:Eh}=c("stream");function Mo(e){e.emit("close")}function Oh(){if(!this.destroyed&&this._writableState.finished)this.destroy()}function Io(e){if(this.removeListener("error",Io),this.destroy(),this.listenerCount("error")===0)this.emit("error",e)}function Ph(e,t){let r=!0,s=new Eh({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(o,a){let u=!a&&s._readableState.objectMode?o.toString():o;if(!s.push(u))e.pause()}),e.once("error",function(o){if(s.destroyed)return;r=!1,s.destroy(o)}),e.once("close",function(){if(s.destroyed)return;s.push(null)}),s._destroy=function(n,o){if(e.readyState===e.CLOSED){o(n),process.nextTick(Mo,s);return}let a=!1;if(e.once("error",function(l){a=!0,o(l)}),e.once("close",function(){if(!a)o(n);process.nextTick(Mo,s)}),r)e.terminate()},s._final=function(n){if(e.readyState===e.CONNECTING){e.once("open",function(){s._final(n)});return}if(e._socket===null)return;if(e._socket._writableState.finished){if(n(),s._readableState.endEmitted)s.destroy()}else e._socket.once("finish",function(){n()}),e.close()},s._read=function(){if(e.isPaused)e.resume()},s._write=function(n,o,a){if(e.readyState===e.CONNECTING){e.once("open",function(){s._write(n,o,a)});return}e.send(n,a)},s.on("end",Oh),s.on("error",Io),s}Bo.exports=Ph});var Qr=i(function(ep,Fo){var{tokenChars:Ch}=Ie();function Rh(e){let t=new Set,r=-1,s=-1,n=0;for(n;n<e.length;n++){let a=e.charCodeAt(n);if(s===-1&&Ch[a]===1){if(r===-1)r=n}else if(n!==0&&(a===32||a===9)){if(s===-1&&r!==-1)s=n}else if(a===44){if(r===-1)throw SyntaxError(`Unexpected character at index ${n}`);if(s===-1)s=n;let u=e.slice(r,s);if(t.has(u))throw SyntaxError(`The "${u}" subprotocol is duplicated`);t.add(u),r=s=-1}else throw SyntaxError(`Unexpected character at index ${n}`)}if(r===-1||s!==-1)throw SyntaxError("Unexpected end of input");let o=e.slice(r,n);if(t.has(o))throw SyntaxError(`The "${o}" subprotocol is duplicated`);return t.add(o),t}Fo.exports={parse:Rh}});var Wo=i(function(rp,qo){var Lh=c("events"),$t=c("http"),{Duplex:tp}=c("stream"),{createHash:Nh}=c("crypto"),$o=It(),we=Me(),Ah=Qr(),Dh=jt(),{CLOSE_TIMEOUT:Mh,GUID:Ih,kWebSocket:Bh}=se(),Uh=/^[+/0-9A-Za-z]{22}==$/;class Go extends Lh{constructor(e,t){super();if(e={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Mh,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Dh,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null)this._server=$t.createServer((r,s)=>{let n=$t.STATUS_CODES[426];s.writeHead(426,{"Content-Length":n.length,"Content-Type":"text/plain"}),s.end(n)}),this._server.listen(e.port,e.host,e.backlog,t);else if(e.server)this._server=e.server;if(this._server){let r=this.emit.bind(this,"connection");this._removeListeners=Fh(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(s,n,o)=>{this.handleUpgrade(s,n,o,r)}})}if(e.perMessageDeflate===!0)e.perMessageDeflate={};if(e.clientTracking)this.clients=new Set,this._shouldEmitClose=!1;this.options=e,this._state=0}address(){if(this.options.noServer)throw Error('The server is operating in "noServer" mode');if(!this._server)return null;return this._server.address()}close(e){if(this._state===2){if(e)this.once("close",()=>{e(Error("The server is not running"))});process.nextTick(st,this);return}if(e)this.once("close",e);if(this._state===1)return;if(this._state=1,this.options.noServer||this.options.server){if(this._server)this._removeListeners(),this._removeListeners=this._server=null;if(this.clients)if(!this.clients.size)process.nextTick(st,this);else this._shouldEmitClose=!0;else process.nextTick(st,this)}else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{st(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,r,s){t.on("error",jo);let n=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){Te(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){Te(this,e,t,400,"Invalid Upgrade header");return}if(n===void 0||!Uh.test(n)){Te(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Te(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){nt(t,400);return}let u=e.headers["sec-websocket-protocol"],l=new Set;if(u!==void 0)try{l=Ah.parse(u)}catch(p){Te(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let m=e.headers["sec-websocket-extensions"],h={};if(this.options.perMessageDeflate&&m!==void 0){let p=new we({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let w=$o.parse(m);if(w[we.extensionName])p.accept(w[we.extensionName]),h[we.extensionName]=p}catch(w){Te(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let p={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(p,(w,k,g,S)=>{if(!w)return nt(t,k||401,g,S);this.completeUpgrade(h,n,l,e,t,r,s)});return}if(!this.options.verifyClient(p))return nt(t,401)}this.completeUpgrade(h,n,l,e,t,r,s)}completeUpgrade(e,t,r,s,n,o,a){if(!n.readable||!n.writable)return n.destroy();if(n[Bh])throw Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return nt(n,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Nh("sha1").update(t+Ih).digest("base64")}`],m=new this.options.WebSocket(null,void 0,this.options);if(r.size){let h=this.options.handleProtocols?this.options.handleProtocols(r,s):r.values().next().value;if(h)l.push(`Sec-WebSocket-Protocol: ${h}`),m._protocol=h}if(e[we.extensionName]){let h=e[we.extensionName].params,p=$o.format({[we.extensionName]:[h]});l.push(`Sec-WebSocket-Extensions: ${p}`),m._extensions=e}if(this.emit("headers",l,s),n.write(l.concat(`\r
|
|
4
|
+
`).join(`\r
|
|
5
|
+
`)),n.removeListener("error",jo),m.setSocket(n,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients)this.clients.add(m),m.on("close",()=>{if(this.clients.delete(m),this._shouldEmitClose&&!this.clients.size)process.nextTick(st,this)});a(m,s)}}qo.exports=Go;function Fh(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let s of Object.keys(t))e.removeListener(s,t[s])}}function st(e){e._state=2,e.emit("close")}function jo(){this.destroy()}function nt(e,t,r,s){r=r||$t.STATUS_CODES[t],s={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...s},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${$t.STATUS_CODES[t]}\r
|
|
6
|
+
`+Object.keys(s).map((n)=>`${n}: ${s[n]}`).join(`\r
|
|
7
|
+
`)+`\r
|
|
8
|
+
\r
|
|
9
|
+
`+r)}function Te(e,t,r,s,n,o){if(e.listenerCount("wsClientError")){let a=Error(n);Error.captureStackTrace(a,Te),e.emit("wsClientError",a,r,t)}else nt(r,s,n,o)}});var yt=v(Jr(),1);var Wt=new WeakMap;function ke(...e){let t=new String(e);return Wt.set(t,e),t}function V(e){return e instanceof String&&Wt.has(e)}function Se(e){return Wt.get(e)??[]}var gt=v(Ct(),1);import{spawn as Bu}from"child_process";var mi=v(zt(),1);import{normalize as tl}from"node:path";function*rs(e,t){let r=t==="global";for(let s of e)s.isGlobal===r&&(yield s)}var wa=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),Ta=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),ka=new Set(["edit","remove-section","rename-section","set","unset"]),Sa=new Set(["get","get-color","get-colorbool","list"]);function Ea(e,t){for(let{name:s}of rs(e,"task")){if(wa.has(s))return Ee(!0,t);if(Ta.has(s))return Ee(!1,t)}let r=t.at(0)?.toLowerCase();return r===void 0?null:ka.has(r)?Ee(!0,t.slice(1)):Sa.has(r)?Ee(!1,t.slice(1)):t.length===1?Ee(!1,t):Ee(!0,t)}function Ee(e=!1,t=[]){let r=t.at(0)?.toLowerCase();return r===void 0?null:{isWrite:e,isRead:!e,key:r,value:t.at(1)}}function Oa(e,t){return t.isWrite&&t.value!==void 0?{key:t.key,value:t.value,scope:e}:{key:t.key,scope:e}}function Pa(e){let t=e?.indexOf("=")||-1;return!e||t<0?null:{key:e.slice(0,t).trim().toLowerCase(),value:e.slice(t+1)}}function Ca(e){for(let{name:t}of rs(e,"task"))switch(t){case"--global":return"global";case"--system":return"system";case"--worktree":return"worktree";case"--local":return"local";case"--file":case"-f":return"file"}return"local"}function Ra({name:e}){if(e==="-c"||e==="--config")return"inline";if(e==="--config-env")return"env"}function*La(e){for(let t of e){let r=Ra(t),s=r&&Pa(t.value);s&&(yield{...s,scope:r})}}function Na(e,t,r){let s={read:[],write:[...La(t)]};return e==="config"&&Aa(s,Ca(t),Ea(t,r)),s}function Aa(e,t,r){if(r===null)return;let s=Oa(t,r);r.isWrite?e.write.push(s):e.read.push(s)}var ss={short:new Map([["c",!0]])},Da={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...ss.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},Ma={clone:{short:new Map([["b",!0],["j",!0],["l",!1],["n",!1],["o",!0],["q",!1],["s",!1],["u",!0]]),long:new Set(["branch","config","jobs","origin","upload-pack","u","template"])},commit:{short:new Map([["C",!0],["F",!0],["c",!0],["m",!0],["t",!0]]),long:new Set(["file","message","reedit-message","reuse-message","template"])},config:{short:new Map([["e",!1],["f",!0],["l",!1]]),long:new Set(["blob","comment","default","file","type","value"])},fetch:{short:new Map,long:new Set(["upload-pack"])},init:{short:new Map,long:new Set(["template"])},pull:{short:new Map,long:new Set(["upload-pack"])},push:{short:new Map,long:new Set(["exec","receive-pack"])}},Ia={short:new Map,long:new Set};function Ba(e){let t=Ma[e??""]??Ia;return{short:new Map([...ss.short.entries(),...t.short.entries()]),long:t.long}}function is(e,t=Da){if(e.startsWith("--")){let r=e.indexOf("=");if(r>2)return[{name:e.slice(0,r),value:e.slice(r+1),needsNext:!1}];let s=e.slice(2);return[{name:e,needsNext:t.long.has(s)}]}if(e.length===2){let r=e.charAt(1),s=t.short.get(r);return[{name:e,needsNext:s===!0}]}return Ua(e,t.short)}function Ua(e,t){let r=e.slice(1).split(""),s=[];for(let n=0;n<r.length;n++){let o=r[n],a=t.get(o);if(a===void 0)return[{name:e,needsNext:!1}];if(a){let u=r.slice(n+1).join("");if(u&&![...u].every((l)=>t.has(l)))return s.push({name:`-${o}`,value:u,needsNext:!1}),s}s.push({name:`-${o}`,needsNext:a})}return s}function Fa(e,t=[]){let r=0;for(;r<e.length;){let s=String(e[r]);if(!s.startsWith("-")||s.length<2)break;let n=is(s),o=r+1;for(let a of n){let u={name:a.name,value:a.value,absorbedNext:!1,isGlobal:!0};a.needsNext&&u.value===void 0&&o<e.length&&(u.value=String(e[o]),u.absorbedNext=!0,o++),t.push(u)}r=o}return{flags:t,taskIndex:r}}function ja(e,t,r=[]){let s=Ba(t),n=[],o=[],a=0;for(;a<e.length;){let u=e[a];if(V(u)){o.push(...Se(u)),a++;continue}let l=String(u);if(l==="--"){for(let p=a+1;p<e.length;p++){let w=e[p];V(w)?o.push(...Se(w)):o.push(String(w))}break}if(!l.startsWith("-")||l.length<2){n.push(l),a++;continue}let m=is(l,s),h=a+1;for(let p of m){let w={name:p.name,value:p.value,absorbedNext:!1,isGlobal:!1};p.needsNext&&w.value===void 0&&h<e.length&&!V(e[h])&&(w.value=String(e[h]),w.absorbedNext=!0,h++),r.push(w)}a=h}return{flags:r,positionals:n,pathspecs:o}}function*$a({write:e}){for(let t of e)for(let r of Ga){let s=r(t.key);s&&(yield s)}}function H(e,t,r=String(e)){let s=typeof e=="string"?new RegExp(`\\s*${e.toLowerCase()}`):e;return function(n){if(s.test(n))return{category:t,message:`Configuring ${r} is not permitted without enabling ${t}`}}}function z(e,t){let r=new RegExp(`\\s*${e.toLowerCase().replace(/\./g,"(..+)?.")}`);return H(r,t,e)}var Ga=[H("alias","allowUnsafeAlias"),H("core.askPass","allowUnsafeAskPass"),H("core.editor","allowUnsafeEditor"),H("core.fsmonitor","allowUnsafeFsMonitor"),H("core.gitProxy","allowUnsafeGitProxy"),H("core.hooksPath","allowUnsafeHooksPath"),H("core.pager","allowUnsafePager"),H("core.sshCommand","allowUnsafeSshCommand"),z("credential.helper","allowUnsafeCredentialHelper"),z("diff.command","allowUnsafeDiffExternal"),H("diff.external","allowUnsafeDiffExternal"),z("diff.textconv","allowUnsafeDiffTextConv"),z("filter.clean","allowUnsafeFilter"),z("filter.smudge","allowUnsafeFilter"),z("gpg.program","allowUnsafeGpgProgram"),H("init.templateDir","allowUnsafeTemplateDir"),z("merge.driver","allowUnsafeMergeDriver"),z("mergetool.path","allowUnsafeMergeDriver"),z("mergetool.cmd","allowUnsafeMergeDriver"),z("protocol.allow","allowUnsafeProtocolOverride"),z("remote.receivepack","allowUnsafePack"),z("remote.uploadpack","allowUnsafePack"),H("sequence.editor","allowUnsafeEditor")];function*qa(e,t){for(let r of t)for(let s of Wa){let n=s(e,r.name);n&&(yield n)}}function qe(e,t,r,s=String(t)){let n=typeof t=="string"?new RegExp(`\\s*${t.toLowerCase()}`):t,o=`Use of ${e?`${e} with option `:""}${s} is not permitted without enabling ${r}`;return function(a,u){if((!e||a===e)&&n.test(u))return{category:r,message:o}}}var Wa=[qe(null,/--(upload|receive)-pack/,"allowUnsafePack","--upload-pack or --receive-pack"),qe("clone",/^-\w*u/,"allowUnsafePack"),qe("clone","--u","allowUnsafePack"),qe("push","--exec","allowUnsafePack"),qe(null,"--template","allowUnsafeTemplateDir")];function os(e,t,r){return[...qa(e,t),...$a(r)]}function Va(...e){let{flags:t,taskIndex:r}=Fa(e),s=r<e.length?String(e[r]).toLowerCase():null,n=s!==null?e.slice(r+1):[],{positionals:o,pathspecs:a}=ja(n,s,t),u=Na(s,t,o);return{task:s,flags:t.map(Ha),paths:a,config:u,vulnerabilities:za(os(s,t,u))}}function za(e){return Object.defineProperty(e,"vulnerabilities",{value:e})}function Ha({value:e,name:t}){return e!==void 0?{name:t,value:e}:{name:t}}var as={editor:"allowUnsafeEditor",git_askpass:"allowUnsafeAskPass",git_config_global:"allowUnsafeConfigPaths",git_config_system:"allowUnsafeConfigPaths",git_config_count:"allowUnsafeConfigEnvCount",git_config:"allowUnsafeConfigPaths",git_editor:"allowUnsafeEditor",git_exec_path:"allowUnsafeConfigPaths",git_external_diff:"allowUnsafeDiffExternal",git_pager:"allowUnsafePager",git_proxy_command:"allowUnsafeGitProxy",git_template_dir:"allowUnsafeTemplateDir",git_sequence_editor:"allowUnsafeEditor",git_ssh:"allowUnsafeSshCommand",git_ssh_command:"allowUnsafeSshCommand",pager:"allowUnsafePager",prefix:"allowUnsafeConfigPaths",ssh_askpass:"allowUnsafeAskPass"};function*Ya(e){let t=parseInt(e.git_config_count??"0",10);for(let r=0;r<t;r++){let s=e[`git_config_key_${r}`],n=e[`git_config_value_${r}`];s!==void 0&&(yield{key:s.toLowerCase().trim(),value:n,scope:"env"})}}function*Ka(e){for(let t of Object.keys(e))if(us(t)){let r=as[t];yield{category:r,message:`Use of "${t.toUpperCase()}" is not permitted without enabling ${r}`}}}function us(e){return Object.hasOwn(as,e)}function Xa(e){let t={};for(let[r,s]of Object.entries(e)){let n=r.toLowerCase().trim();(us(n)||n.startsWith("git"))&&(t[n]=String(s))}return t}function Qa(e){let t=Xa(e),r={read:[],write:[...Ya(t)]},s=[...Ka(t),...os(null,[],r)];return{config:r,vulnerabilities:s}}function cs(e,t){return[...Va(...e).vulnerabilities,...Qa(t).vulnerabilities]}var Oe=v(zt(),1);import{EventEmitter as Ql}from"node:events";var{defineProperty:dr,getOwnPropertyDescriptor:Za,getOwnPropertyNames:pr}=Object,Ja=Object.prototype.hasOwnProperty,d=(e,t)=>function(){return e&&(t=(0,e[pr(e)[0]])(e=0)),t},eu=(e,t)=>function(){return t||(0,e[pr(e)[0]])((t={exports:{}}).exports,t),t.exports},N=(e,t)=>{for(var r in t)dr(e,r,{get:t[r],enumerable:!0})},tu=(e,t,r,s)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let n of pr(t))if(!Ja.call(e,n)&&n!==r)dr(e,n,{get:()=>t[n],enumerable:!(s=Za(t,n))||s.enumerable})}return e},R=(e)=>tu(dr({},"__esModule",{value:!0}),e),re,ce=d({"src/lib/errors/git-error.ts"(){re=class extends Error{constructor(e,t){super(t);this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),He,Re=d({"src/lib/errors/git-response-error.ts"(){ce(),He=class extends re{constructor(e,t){super(void 0,t||String(e));this.git=e}}}}),$s,Gs=d({"src/lib/errors/task-configuration-error.ts"(){ce(),$s=class extends re{constructor(e){super(void 0,e)}}}});function qs(e){if(typeof e!=="function")return ye;return e}function Ws(e){return typeof e==="function"&&e!==ye}function Vs(e,t){let r=e.indexOf(t);if(r<=0)return[e,""];return[e.substr(0,r),e.substr(r+1)]}function zs(e,t=0){return Hs(e)&&e.length>t?e[t]:void 0}function _e(e,t=0){if(Hs(e)&&e.length>t)return e[e.length-1-t]}function Hs(e){return Tt(e)}function Ye(e="",t=!0,r=`
|
|
10
|
+
`){return e.split(r).reduce((s,n)=>{let o=t?n.trim():n;if(o)s.push(o);return s},[])}function mr(e,t){return Ye(e,!0).map((r)=>t(r))}function gr(e){return yt.exists(e,yt.FOLDER)}function Y(e,t){if(Array.isArray(e)){if(!e.includes(t))e.push(t)}else e.add(t);return t}function Ys(e,t){if(Array.isArray(e)&&!e.includes(t))e.push(t);return e}function vt(e,t){if(Array.isArray(e)){let r=e.indexOf(t);if(r>=0)e.splice(r,1)}else e.delete(t);return t}function ee(e){return Array.isArray(e)?e:[e]}function Ks(e){return e.replace(/[\s-]+(.)/g,(t,r)=>r.toUpperCase())}function Le(e){return ee(e).map((t)=>t instanceof String?t:String(t))}function E(e,t=0){if(e==null)return t;let r=parseInt(e,10);return Number.isNaN(r)?t:r}function Ve(e,t){let r=[];for(let s=0,n=e.length;s<n;s++)r.push(t,e[s]);return r}function ze(e){return(Array.isArray(e)?Buffer.concat(e):e).toString("utf-8")}function Xs(e,t){let r={};return t.forEach((s)=>{if(e[s]!==void 0)r[s]=e[s]}),r}function Jt(e=0){return new Promise((t)=>setTimeout(t,e))}function er(e){if(e===!1)return;return e}var Pe,ye,Ke,bt=d({"src/lib/utils/util.ts"(){_r(),Pe="\x00",ye=()=>{},Ke=Object.prototype.toString.call.bind(Object.prototype.toString)}});function M(e,t,r){if(t(e))return e;return arguments.length>2?r:void 0}function tr(e,t){let r=V(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function wt(e){return!!e&&Ke(e)==="[object Object]"}function Qs(e){return typeof e==="function"}var Xe,Zs,C,pt,Tt,_r=d({"src/lib/utils/argument-filters.ts"(){bt(),Xe=(e)=>Array.isArray(e),Zs=(e)=>typeof e==="number",C=(e)=>typeof e==="string"||V(e),pt=(e)=>C(e)||Array.isArray(e)&&e.every(C),Tt=(e)=>{if(e==null||"number|boolean|function".includes(typeof e))return!1;return typeof e.length==="number"}}}),rr,ru=d({"src/lib/utils/exit-codes.ts"(){rr=((e)=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(rr||{})}}),mt,su=d({"src/lib/utils/git-output-streams.ts"(){mt=class e{constructor(t,r){this.stdOut=t,this.stdErr=r}asStrings(){return new e(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function nu(){throw Error("LineParser:useMatches not implemented")}var T,ue,iu=d({"src/lib/utils/line-parser.ts"(){T=class{constructor(e,t){if(this.matches=[],this.useMatches=nu,this.parse=(r,s)=>{if(this.resetMatches(),!this._regExp.every((n,o)=>this.addMatch(n,o,r(o))))return!1;return this.useMatches(s,this.prepareMatches())!==!1},this._regExp=Array.isArray(e)?e:[e],t)this.useMatches=t}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,r){let s=r&&e.exec(r);if(s)this.pushMatch(t,s);return!!s}pushMatch(e,t){this.matches.push(...t.slice(1))}},ue=class extends T{addMatch(e,t,r){return/^remote:\s/.test(String(r))&&super.addMatch(e,t,r)}pushMatch(e,t){if(e>0||t.length>1)super.pushMatch(e,t)}}}});function Js(...e){let t=process.cwd(),r=Object.assign({baseDir:t,...en},...e.filter((s)=>typeof s==="object"&&s));return r.baseDir=r.baseDir||t,r.trimmed=r.trimmed===!0,r}var en,ou=d({"src/lib/utils/simple-git-options.ts"(){en={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function yr(e,t=[]){if(!wt(e))return t;return Object.keys(e).reduce((r,s)=>{let n=e[s];if(V(n))r.push(n);else if(tr(n,["boolean"]))r.push(s+"="+n);else if(Array.isArray(n)){for(let o of n)if(!tr(o,["string","number"]))r.push(s+"="+o)}else r.push(s);return r},t)}function I(e,t=0,r=!1){let s=[];for(let n=0,o=t<0?e.length:t;n<o;n++)if("string|number".includes(typeof e[n]))s.push(String(e[n]));if(yr(vr(e),s),!r)s.push(...au(e));return s}function au(e){let t=typeof _e(e)==="function";return Le(M(_e(e,t?1:0),Xe,[]))}function vr(e){let t=Qs(_e(e));return M(_e(e,t?1:0),wt)}function P(e,t=!0){let r=qs(_e(e));return t||Ws(r)?r:void 0}var uu=d({"src/lib/utils/task-options.ts"(){_r(),bt()}});function sr(e,t){return e(t.stdOut,t.stdErr)}function F(e,t,r,s=!0){return ee(r).forEach((n)=>{for(let o=Ye(n,s),a=0,u=o.length;a<u;a++){let l=(m=0)=>{if(a+m>=u)return;return o[a+m]};t.some(({parse:m})=>m(l,e))}}),e}var cu=d({"src/lib/utils/task-parser.ts"(){bt()}}),tn={};N(tn,{ExitCodes:()=>rr,GitOutputStreams:()=>mt,LineParser:()=>T,NOOP:()=>ye,NULL:()=>Pe,RemoteLineParser:()=>ue,append:()=>Y,appendTaskOptions:()=>yr,asArray:()=>ee,asCamelCase:()=>Ks,asFunction:()=>qs,asNumber:()=>E,asStringArray:()=>Le,bufferToString:()=>ze,callTaskParser:()=>sr,createInstanceConfig:()=>Js,delay:()=>Jt,filterArray:()=>Xe,filterFunction:()=>Qs,filterHasLength:()=>Tt,filterNumber:()=>Zs,filterPlainObject:()=>wt,filterPrimitives:()=>tr,filterString:()=>C,filterStringOrStringArray:()=>pt,filterType:()=>M,first:()=>zs,folderExists:()=>gr,forEachLineWithContent:()=>mr,getTrailingOptions:()=>I,including:()=>Ys,isUserFunction:()=>Ws,last:()=>_e,objectToString:()=>Ke,orVoid:()=>er,parseStringResponse:()=>F,pick:()=>Xs,prefixedArray:()=>Ve,remove:()=>vt,splitOn:()=>Vs,toLinesWithContent:()=>Ye,trailingFunctionArgument:()=>P,trailingOptionsArgument:()=>vr});var b=d({"src/lib/utils/index.ts"(){_r(),ru(),su(),iu(),ou(),uu(),cu(),bt()}}),rn={};N(rn,{CheckRepoActions:()=>nr,checkIsBareRepoTask:()=>nn,checkIsRepoRootTask:()=>sn,checkIsRepoTask:()=>lu});function lu(e){switch(e){case"bare":return nn();case"root":return sn()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:xt,parser:br}}function sn(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:xt,parser(t){return/^\.(git)?$/.test(t.trim())}}}function nn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:xt,parser:br}}function fu(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var nr,xt,br,on=d({"src/lib/tasks/check-is-repo.ts"(){b(),nr=((e)=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(nr||{}),xt=({exitCode:e},t,r,s)=>{if(e===128&&fu(t))return r(Buffer.from("false"));s(t)},br=(e)=>e.trim()==="true"}});function hu(e,t){let r=new an(e),s=e?cn:un;return Ye(t).forEach((n)=>{let o=n.replace(s,"");r.paths.push(o),(ln.test(o)?r.folders:r.files).push(o)}),r}var an,un,cn,ln,du=d({"src/lib/responses/CleanSummary.ts"(){b(),an=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},un=/^[a-z]+\s*/i,cn=/^[a-z]+\s+[a-z]+\s*/i,ln=/\/$/}}),ir={};N(ir,{EMPTY_COMMANDS:()=>kt,adhocExecTask:()=>fn,configurationErrorTask:()=>U,isBufferTask:()=>dn,isEmptyTask:()=>pn,straightThroughBufferTask:()=>hn,straightThroughStringTask:()=>B});function fn(e){return{commands:kt,format:"empty",parser:e}}function U(e){return{commands:kt,format:"empty",parser(){throw typeof e==="string"?new $s(e):e}}}function B(e,t=!1){return{commands:e,format:"utf-8",parser(r){return t?String(r).trim():r}}}function hn(e){return{commands:e,format:"buffer",parser(t){return t}}}function dn(e){return e.format==="buffer"}function pn(e){return e.format==="empty"||!e.commands.length}var kt,L=d({"src/lib/tasks/task.ts"(){Gs(),kt=[]}}),mn={};N(mn,{CONFIG_ERROR_INTERACTIVE_MODE:()=>wr,CONFIG_ERROR_MODE_REQUIRED:()=>Tr,CONFIG_ERROR_UNKNOWN_OPTION:()=>xr,CleanOptions:()=>lt,cleanTask:()=>gn,cleanWithOptionsTask:()=>pu,isCleanOptionsArray:()=>mu});function pu(e,t){let{cleanMode:r,options:s,valid:n}=gu(e);if(!r)return U(Tr);if(!n.options)return U(xr+JSON.stringify(e));if(s.push(...t),s.some(vu))return U(wr);return gn(r,s)}function gn(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(s){return hu(e==="n",s)}}}function mu(e){return Array.isArray(e)&&e.every((t)=>kr.has(t))}function gu(e){let t,r=[],s={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach((n)=>{if(_u(n))t=n,s.cleanMode=!0;else s.options=s.options&&yu(r[r.length]=`-${n}`)}),{cleanMode:t,options:r,valid:s}}function _u(e){return e==="f"||e==="n"}function yu(e){return/^-[a-z]$/i.test(e)&&kr.has(e.charAt(1))}function vu(e){if(/^-[^\-]/.test(e))return e.indexOf("i")>0;return e==="--interactive"}var wr,Tr,xr,lt,kr,_n=d({"src/lib/tasks/clean.ts"(){du(),b(),L(),wr="Git clean interactive mode is not supported",Tr='Git clean mode parameter ("n" or "f") is required',xr="Git clean unknown option found in: ",lt=((e)=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(lt||{}),kr=new Set(["i",...Le(Object.values(lt))])}});function bu(e){let t=new vn;for(let r of yn(e))t.addValue(r.file,String(r.key),r.value);return t}function wu(e,t){let r=null,s=[],n=new Map;for(let o of yn(e,t)){if(o.key!==t)continue;if(s.push(r=o.value),!n.has(o.file))n.set(o.file,[]);n.get(o.file).push(r)}return{key:t,paths:Array.from(n.keys()),scopes:n,value:r,values:s}}function Tu(e){return e.replace(/^(file):/,"")}function*yn(e,t=null){let r=e.split("\x00");for(let s=0,n=r.length-1;s<n;){let o=Tu(r[s++]),a=r[s++],u=t;if(a.includes(`
|
|
11
|
+
`)){let l=Vs(a,`
|
|
12
|
+
`);u=l[0],a=l[1]}yield{file:o,key:u,value:a}}}var vn,xu=d({"src/lib/responses/ConfigList.ts"(){b(),vn=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){if(!this._all)this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{});return this._all}addFile(e){if(!(e in this.values)){let t=_e(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,r){let s=this.addFile(e);if(!Object.hasOwn(s,t))s[t]=r;else if(Array.isArray(s[t]))s[t].push(r);else s[t]=[s[t],r];this._all=void 0}}}});function Ht(e,t){if(typeof e==="string"&&Object.hasOwn(or,e))return e;return t}function ku(e,t,r,s){let n=["config",`--${s}`];if(r)n.push("--add");return n.push(e,t),{commands:n,format:"utf-8",parser(o){return o}}}function Su(e,t){let r=["config","--null","--show-origin","--get-all",e];if(t)r.splice(1,0,`--${t}`);return{commands:r,format:"utf-8",parser(s){return wu(s,e)}}}function Eu(e){let t=["config","--list","--show-origin","--null"];if(e)t.push(`--${e}`);return{commands:t,format:"utf-8",parser(r){return bu(r)}}}function Ou(){return{addConfig(e,t,...r){return this._runTask(ku(e,t,r[0]===!0,Ht(r[1],"local")),P(arguments))},getConfig(e,t){return this._runTask(Su(e,Ht(t,void 0)),P(arguments))},listConfig(...e){return this._runTask(Eu(Ht(e[0],void 0)),P(arguments))}}}var or,bn=d({"src/lib/tasks/config.ts"(){xu(),b(),or=((e)=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(or||{})}});function Pu(e){return wn.has(e)}var Yt,wn,Tn=d({"src/lib/tasks/diff-name-status.ts"(){Yt=((e)=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(Yt||{}),wn=new Set(Object.values(Yt))}});function Cu(...e){return new kn().param(...e)}function Ru(e){let t=new Set,r={};return mr(e,(s)=>{let[n,o,a]=s.split(Pe);t.add(n),(r[n]=r[n]||[]).push({line:E(o),path:n,preview:a})}),{paths:t,results:r}}function Lu(){return{grep(e){let t=P(arguments),r=I(arguments);for(let n of xn)if(r.includes(n))return this._runTask(U(`git.grep: use of "${n}" is not supported.`),t);if(typeof e==="string")e=Cu().param(e);let s=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:s,format:"utf-8",parser(n){return Ru(n)}},t)}}}var xn,We,ls,kn,Sn=d({"src/lib/tasks/grep.ts"(){b(),L(),xn=["-h"],We=Symbol("grepQuery"),kn=class{constructor(){this[ls]=[]}*[(ls=We,Symbol.iterator)](){for(let e of this[We])yield e}and(...e){return e.length&&this[We].push("--and","(",...Ve(e,"-e"),")"),this}param(...e){return this[We].push(...Ve(e,"-e")),this}}}}),En={};N(En,{ResetMode:()=>ft,getResetMode:()=>Au,resetTask:()=>Nu});function Nu(e,t){let r=["reset"];if(On(e))r.push(`--${e}`);return r.push(...t),B(r)}function Au(e){if(On(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}return}function On(e){return typeof e==="string"&&Pn.includes(e)}var ft,Pn,Cn=d({"src/lib/tasks/reset.ts"(){b(),L(),ft=((e)=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(ft||{}),Pn=Le(Object.values(ft))}});function Du(){return gt.default("simple-git")}function fs(e,t,r){if(!t||!String(t).replace(/\s*/,""))return!r?e:(s,...n)=>{e(s,...n),r(s,...n)};return(s,...n)=>{if(e(`%s ${s}`,t,...n),r)r(s,...n)}}function Mu(e,t,{namespace:r}){if(typeof e==="string")return e;let s=t&&t.namespace||"";if(s.startsWith(r))return s.substr(r.length+1);return s||r}function Sr(e,t,r,s=Du()){let n=e&&`[${e}]`||"",o=[],a=typeof t==="string"?s.extend(t):t,u=Mu(M(t,C),a,s);return m(r);function l(h,p){return Y(o,Sr(e,u.replace(/^[^:]+/,h),p,s))}function m(h){let p=h&&`[${h}]`||"",w=a&&fs(a,p)||ye,k=fs(s,`${n} ${p}`,w);return Object.assign(a?w:k,{label:e,sibling:l,info:k,step:m})}}var Rn=d({"src/lib/git-logger.ts"(){b(),gt.default.formatters.L=(e)=>String(Tt(e)?e.length:"-"),gt.default.formatters.B=(e)=>{if(Buffer.isBuffer(e))return e.toString("utf8");return Ke(e)}}}),Ln,Iu=d({"src/lib/runners/tasks-pending-queue.ts"(){ce(),Rn(),Ln=class e{constructor(t="GitExecutor"){this.logLabel=t,this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(t){let r=e.getName(t.commands[0]),s=Sr(this.logLabel,r);return{task:t,logger:s,name:r}}push(t){let r=this.createProgress(t);return r.logger("Adding task to the queue, commands = %o",t.commands),this._queue.set(t,r),r}fatal(t){for(let[r,{logger:s}]of Array.from(this._queue.entries())){if(r===t.task)s.info("Failed %o",t),s("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted");else s.info("A fatal exception occurred in a previous task, the queue has been purged: %o",t.message);this.complete(r)}if(this._queue.size!==0)throw Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(t){if(this.withProgress(t))this._queue.delete(t)}attempt(t){let r=this.withProgress(t);if(!r)throw new re(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(t="empty"){return`task:${t}:${++e.counter}`}static{this.counter=0}}}});function ge(e,t){return{method:zs(e.commands)||"",commands:t}}function Uu(e,t){return(r)=>{t("[ERROR] child process exception %o",r),e.push(Buffer.from(String(r.stack),"ascii"))}}function hs(e,t,r,s){return(n)=>{r("%s received %L bytes",t,n),s("%B",n),e.push(n)}}var ar,Fu=d({"src/lib/runners/git-executor-chain.ts"(){ce(),L(),b(),Iu(),ar=class{constructor(e,t,r){this._executor=e,this._scheduler=t,this._plugins=r,this._chain=Promise.resolve(),this._queue=new Ln}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){let t=await this._scheduler.next(),r=()=>this._queue.complete(e);try{let{logger:s}=this._queue.attempt(e);return await(pn(e)?this.attemptEmptyTask(e,s):this.attemptRemoteTask(e,s))}catch(s){throw this.onFatalException(e,s)}finally{r(),t()}}onFatalException(e,t){let r=t instanceof re?Object.assign(t,{task:e}):new re(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(e,t){let r=this._plugins.exec("spawn.binary","",ge(e,e.commands)),s=this._plugins.exec("spawn.args",[...e.commands],{...ge(e,e.commands),env:{...this.env}}),n=await this.gitResponse(e,r,s,this.outputHandler,t.step("SPAWN")),o=await this.handleTaskData(e,s,n,t.step("HANDLE"));if(t("passing response to task's parser as a %s",e.format),dn(e))return sr(e.parser,o);return sr(e.parser,o.asStrings())}async attemptEmptyTask(e,t){return t("empty task bypassing child process to call to task's parser"),e.parser(this)}handleTaskData(e,t,r,s){let{exitCode:n,rejection:o,stdOut:a,stdErr:u}=r;return new Promise((l,m)=>{s("Preparing to handle process response exitCode=%d stdOut=",n);let{error:h}=this._plugins.exec("task.error",{error:o},{...ge(e,t),...r});if(h&&e.onError)return s.info("exitCode=%s handling with custom error handler"),e.onError(r,h,(p)=>{s.info("custom error handler treated as success"),s("custom error returned a %s",Ke(p)),l(new mt(Array.isArray(p)?Buffer.concat(p):p,Buffer.concat(u)))},m);if(h)return s.info("handling as error: exitCode=%s stdErr=%s rejection=%o",n,u.length,o),m(h);s.info("retrieving task output complete"),l(new mt(Buffer.concat(a),Buffer.concat(u)))})}async gitResponse(e,t,r,s,n){let o=n.sibling("output"),a=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},ge(e,e.commands));return new Promise((u)=>{let l=[],m=[];n.info("%s %o",t,r),n("%O",a);let h=this._beforeSpawn(e,r);if(h)return u({stdOut:l,stdErr:m,exitCode:9901,rejection:h});this._plugins.exec("spawn.before",void 0,{...ge(e,r),kill(w){h=w||h}});let p=Bu(t,r,a);if(p.stdout.on("data",hs(l,"stdOut",n,o.step("stdOut"))),p.stderr.on("data",hs(m,"stdErr",n,o.step("stdErr"))),p.on("error",Uu(m,n)),s)n("Passing child process stdOut/stdErr to custom outputHandler"),s(t,p.stdout,p.stderr,[...r]);this._plugins.exec("spawn.after",void 0,{...ge(e,r),spawned:p,close(w,k){u({stdOut:l,stdErr:m,exitCode:w,rejection:h||k})},kill(w){if(p.killed)return;h=w,p.kill("SIGINT")}})})}_beforeSpawn(e,t){let r;return this._plugins.exec("spawn.before",void 0,{...ge(e,t),kill(s){r=s||r}}),r}}}}),Nn={};N(Nn,{GitExecutor:()=>An});var An,ju=d({"src/lib/runners/git-executor.ts"(){Fu(),An=class{constructor(e,t,r){this.cwd=e,this._scheduler=t,this._plugins=r,this._chain=new ar(this,this._scheduler,this._plugins)}chain(){return new ar(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function $u(e,t,r=ye){let s=(o)=>{r(null,o)},n=(o)=>{if(o?.task===e)r(o instanceof He?Gu(o):o,void 0)};t.then(s,n)}function Gu(e){let t=(s)=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${s} should be GitResponseError.git.${s}, this will no longer be available in version 3`),t=ye};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(r,{}));function r(s,n){if(n in e)return s;return s[n]={enumerable:!1,configurable:!1,get(){return t(n),e.git[n]}},s}}var qu=d({"src/lib/task-callback.ts"(){Re(),b()}});function ds(e,t){return fn((r)=>{if(!gr(e))throw Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||r).cwd=e})}var Wu=d({"src/lib/tasks/change-working-directory.ts"(){b(),L()}});function Kt(e){let t=["checkout",...e];if(t[1]==="-b"&&t.includes("-B"))t[1]=vt(t,"-B");return B(t)}function Vu(){return{checkout(){return this._runTask(Kt(I(arguments,1)),P(arguments))},checkoutBranch(e,t){return this._runTask(Kt(["-b",e,t,...I(arguments)]),P(arguments))},checkoutLocalBranch(e){return this._runTask(Kt(["-b",e,...I(arguments)]),P(arguments))}}}var zu=d({"src/lib/tasks/checkout.ts"(){b(),L()}});function Hu(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function Yu(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return F(Hu(),[Dn],e)}})}}}var Dn,Ku=d({"src/lib/tasks/count-objects.ts"(){b(),Dn=new T(/([a-z-]+): (\d+)$/,(e,[t,r])=>{let s=Ks(t);if(Object.hasOwn(e,s))e[s]=E(r)})}});function Xu(e){return F({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},Mn,e)}var Mn,Qu=d({"src/lib/parsers/parse-commit.ts"(){b(),Mn=[new T(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,r,s])=>{e.branch=t,e.commit=s,e.root=!!r}),new T(/\s*Author:\s(.+)/i,(e,[t])=>{let r=t.split("<"),s=r.pop();if(!s||!s.includes("@"))return;e.author={email:s.substr(0,s.length-1),name:r.join("<").trim()}}),new T(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,r,s])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(r,10)||0,e.summary.deletions=parseInt(s,10)||0}),new T(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,r,s])=>{e.summary.changes=parseInt(t,10)||0;let n=parseInt(r,10)||0;if(s==="-")e.summary.deletions=n;else if(s==="+")e.summary.insertions=n})]}});function Zu(e,t,r){return{commands:["-c","core.abbrev=40","commit",...Ve(e,"-m"),...t,...r],format:"utf-8",parser:Xu}}function Ju(){return{commit(t,...r){let s=P(arguments),n=e(t)||Zu(ee(t),ee(M(r[0],pt,[])),[...Le(M(r[1],Xe,[])),...I(arguments,0,!0)]);return this._runTask(n,s)}};function e(t){return!pt(t)&&U("git.commit: requires the commit message to be supplied as a string/string[]")}}var ec=d({"src/lib/tasks/commit.ts"(){Qu(),b(),L()}});function tc(){return{firstCommit(){return this._runTask(B(["rev-list","--max-parents=0","HEAD"],!0),P(arguments))}}}var rc=d({"src/lib/tasks/first-commit.ts"(){b(),L()}});function sc(e,t){let r=["hash-object",e];if(t)r.push("-w");return B(r,!0)}var nc=d({"src/lib/tasks/hash-object.ts"(){L()}});function ic(e,t,r){let s=String(r).trim(),n;if(n=In.exec(s))return new ht(e,t,!1,n[1]);if(n=Bn.exec(s))return new ht(e,t,!0,n[1]);let o="",a=s.split(" ");while(a.length)if(a.shift()==="in"){o=a.join(" ");break}return new ht(e,t,/^re/i.test(s),o)}var ht,In,Bn,oc=d({"src/lib/responses/InitSummary.ts"(){ht=class{constructor(e,t,r,s){this.bare=e,this.path=t,this.existing=r,this.gitDir=s}},In=/^Init.+ repository in (.+)$/,Bn=/^Rein.+ in (.+)$/}});function ac(e){return e.includes(Er)}function uc(e=!1,t,r){let s=["init",...r];if(e&&!ac(s))s.splice(1,0,Er);return{commands:s,format:"utf-8",parser(n){return ic(s.includes("--bare"),t,n)}}}var Er,cc=d({"src/lib/tasks/init.ts"(){oc(),Er="--bare"}});function Or(e){for(let t=0;t<e.length;t++){let r=Pr.exec(e[t]);if(r)return`--${r[1]}`}return""}function lc(e){return Pr.test(e)}var Pr,Qe=d({"src/lib/args/log-format.ts"(){Pr=/^--(stat|numstat|name-only|name-status)(=|$)/}}),Un,fc=d({"src/lib/responses/DiffSummary.ts"(){Un=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function Fn(e=""){let t=jn[e];return(r)=>F(new Un,t,r,!1)}var Xt,ps,ms,gs,jn,$n=d({"src/lib/parsers/parse-diff-summary.ts"(){Qe(),fc(),Tn(),b(),Xt=[new T(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,r,s=""])=>{e.files.push({file:t.trim(),changes:E(r),insertions:s.replace(/[^+]/g,"").length,deletions:s.replace(/[^-]/g,"").length,binary:!1})}),new T(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,r,s])=>{e.files.push({file:t.trim(),before:E(r),after:E(s),binary:!0})}),new T(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,r])=>{let s=/(\d+) i/.exec(r),n=/(\d+) d/.exec(r);e.changed=E(t),e.insertions=E(s?.[1]),e.deletions=E(n?.[1])})],ps=[new T(/(\d+)\t(\d+)\t(.+)$/,(e,[t,r,s])=>{let n=E(t),o=E(r);e.changed++,e.insertions+=n,e.deletions+=o,e.files.push({file:s,changes:n+o,insertions:n,deletions:o,binary:!1})}),new T(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],ms=[new T(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],gs=[new T(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,r,s,n,o])=>{e.changed++,e.files.push({file:o??s,changes:0,insertions:0,deletions:0,binary:!1,status:er(Pu(t)&&t),from:er(!!o&&s!==o&&s),similarity:E(r)})})],jn={[""]:Xt,["--stat"]:Xt,["--numstat"]:ps,["--name-status"]:gs,["--name-only"]:ms}}});function hc(e,t){return t.reduce((r,s,n)=>(r[s]=e[n]||"",r),Object.create({diff:null}))}function Gn(e=Lr,t=qn,r=""){let s=Fn(r);return function(n){let o=Ye(n.trim(),!1,Cr).map(function(a){let u=a.split(Rr),l=hc(u[0].split(e),t);if(u.length>1&&!!u[1].trim())l.diff=s(u[1]);return l});return{all:o,latest:o.length&&o[0]||null,total:o.length}}}var Cr,Rr,Lr,qn,Wn=d({"src/lib/parsers/parse-list-log-summary.ts"(){b(),$n(),Qe(),Cr="òòòòòò ",Rr=" òò",Lr=" ò ",qn=["hash","date","message","refs","author_name","author_email"]}}),Vn={};N(Vn,{diffSummaryTask:()=>dc,validateLogFormatConfig:()=>St});function dc(e){let t=Or(e),r=["diff"];if(t==="")t="--stat",r.push("--stat=4096");return r.push(...e),St(r)||{commands:r,format:"utf-8",parser:Fn(t)}}function St(e){let t=e.filter(lc);if(t.length>1)return U(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`);if(t.length&&e.includes("-z"))return U(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var Nr=d({"src/lib/tasks/diff.ts"(){Qe(),$n(),L()}});function pc(e,t){let r=[],s=[];return Object.keys(e).forEach((n)=>{r.push(n),s.push(String(e[n]))}),[r,s.join(t)]}function mc(e){return Object.keys(e).reduce((t,r)=>{if(!(r in ur))t[r]=e[r];return t},{})}function zn(e={},t=[]){let r=M(e.splitter,C,Lr),s=wt(e.format)?e.format:{hash:"%H",date:e.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:e.mailMap!==!1?"%aN":"%an",author_email:e.mailMap!==!1?"%aE":"%ae"},[n,o]=pc(s,r),a=[],u=[`--pretty=format:${Cr}${o}${Rr}`,...t],l=e.n||e["max-count"]||e.maxCount;if(l)u.push(`--max-count=${l}`);if(e.from||e.to){let m=e.symmetric!==!1?"...":"..";a.push(`${e.from||""}${m}${e.to||""}`)}if(C(e.file))u.push("--follow",ke(e.file));return yr(mc(e),u),{fields:n,splitter:r,commands:[...u,...a]}}function gc(e,t,r){let s=Gn(e,t,Or(r));return{commands:["log",...r],format:"utf-8",parser:s}}function _c(){return{log(...r){let s=P(arguments),n=zn(vr(arguments),Le(M(arguments[0],Xe,[]))),o=t(...r)||St(n.commands)||e(n);return this._runTask(o,s)}};function e(r){return gc(r.splitter,r.fields,r.commands)}function t(r,s){return C(r)&&C(s)&&U("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var ur,Hn=d({"src/lib/tasks/log.ts"(){Qe(),Wn(),b(),L(),Nr(),ur=((e)=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))(ur||{})}}),dt,Yn,yc=d({"src/lib/responses/MergeSummary.ts"(){dt=class{constructor(e,t=null,r){this.reason=e,this.file=t,this.meta=r}toString(){return`${this.file}:${this.reason}`}},Yn=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){if(this.conflicts.length)return`CONFLICTS: ${this.conflicts.join(", ")}`;return"OK"}}}}),cr,Kn,vc=d({"src/lib/responses/PullSummary.ts"(){cr=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Kn=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function Qt(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function _s(e){let t=/^\s*(\d+)/.exec(e),r=/delta (\d+)/i.exec(e);return{count:E(t&&t[1]||"0"),delta:E(r&&r[1]||"0")}}var Xn,bc=d({"src/lib/parsers/parse-remote-objects.ts"(){b(),Xn=[new ue(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,r])=>{let s=t.toLowerCase(),n=Qt(e.remoteMessages);Object.assign(n,{[s]:E(r)})}),new ue(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,r])=>{let s=t.toLowerCase(),n=Qt(e.remoteMessages);Object.assign(n,{[s]:E(r)})}),new ue(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,r,s])=>{let n=Qt(e.remoteMessages);n.total=_s(t),n.reused=_s(r),n.packReused=E(s)})]}});function Qn(e,t){return F({remoteMessages:new Jn},Zn,t)}var Zn,Jn,ei=d({"src/lib/parsers/parse-remote-messages.ts"(){b(),bc(),Zn=[new ue(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Xn,new ue([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new ue([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,r,s])=>{e.remoteMessages.vulnerabilities={count:E(t),summary:r,url:s}})],Jn=class{constructor(){this.all=[]}}}});function wc(e,t){let r=F(new Kn,ti,[e,t]);return r.message&&r}var ys,vs,bs,ws,ti,Ts,Ar,ri=d({"src/lib/parsers/parse-pull.ts"(){vc(),b(),ei(),ys=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,vs=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,bs=/^(create|delete) mode \d+ (.+)/,ws=[new T(ys,(e,[t,r,s])=>{if(e.files.push(t),r)e.insertions[t]=r.length;if(s)e.deletions[t]=s.length}),new T(vs,(e,[t,,r,,s])=>{if(r!==void 0||s!==void 0)return e.summary.changes=+t||0,e.summary.insertions=+r||0,e.summary.deletions=+s||0,!0;return!1}),new T(bs,(e,[t,r])=>{Y(e.files,r),Y(t==="create"?e.created:e.deleted,r)})],ti=[new T(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new T(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new T(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,r,s,n])=>{e.branch.local=s,e.hash.local=t,e.branch.remote=n,e.hash.remote=r})],Ts=(e,t)=>F(new cr,ws,[e,t]),Ar=(e,t)=>Object.assign(new cr,Ts(e,t),Qn(e,t))}}),xs,si,ks,Tc=d({"src/lib/parsers/parse-merge.ts"(){yc(),b(),ri(),xs=[new T(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new T(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,r])=>{e.conflicts.push(new dt(t,r))}),new T(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,r,s])=>{e.conflicts.push(new dt(t,r,{deleteRef:s}))}),new T(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new dt(t,null))}),new T(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],si=(e,t)=>Object.assign(ks(e,t),Ar(e,t)),ks=(e)=>F(new Yn,xs,e)}});function Ss(e){if(!e.length)return U("Git.merge requires at least one option");return{commands:["merge",...e],format:"utf-8",parser(t,r){let s=si(t,r);if(s.failed)throw new He(s);return s}}}var xc=d({"src/lib/tasks/merge.ts"(){Re(),Tc(),L()}});function kc(e,t,r){let s=r.includes("deleted"),n=r.includes("tag")||/^refs\/tags/.test(e),o=!r.includes("new");return{deleted:s,tag:n,branch:!n,new:!o,alreadyUpdated:o,local:e,remote:t}}var Es,ni,Os,Sc=d({"src/lib/parsers/parse-push.ts"(){b(),ei(),Es=[new T(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new T(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new T(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,r,s])=>{e.pushed.push(kc(t,r,s))}),new T(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,r,s])=>{e.branch={...e.branch||{},local:t,remote:r,remoteName:s}}),new T(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,r,s,n])=>{e.update={head:{local:t,remote:r},hash:{from:s,to:n}}})],ni=(e,t)=>{let r=Os(e,t),s=Qn(e,t);return{...r,...s}},Os=(e,t)=>F({pushed:[]},Es,[e,t])}}),ii={};N(ii,{pushTagsTask:()=>Ec,pushTask:()=>Dr});function Ec(e={},t){return Y(t,"--tags"),Dr(e,t)}function Dr(e={},t){let r=["push",...t];if(e.branch)r.splice(1,0,e.branch);if(e.remote)r.splice(1,0,e.remote);return vt(r,"-v"),Y(r,"--verbose"),Y(r,"--porcelain"),{commands:r,format:"utf-8",parser:ni}}var oi=d({"src/lib/tasks/push.ts"(){Sc(),b()}});function Oc(){return{showBuffer(){let e=["show",...I(arguments,1)];if(!e.includes("--binary"))e.splice(1,0,"--binary");return this._runTask(hn(e),P(arguments))},show(){let e=["show",...I(arguments,1)];return this._runTask(B(e),P(arguments))}}}var Pc=d({"src/lib/tasks/show.ts"(){b(),L()}}),Ps,ai,Cc=d({"src/lib/responses/FileStatusSummary.ts"(){Ps=/^(.+)\0(.+)$/,ai=class{constructor(e,t,r){if(this.path=e,this.index=t,this.working_dir=r,t==="R"||r==="R"){let s=Ps.exec(e)||[null,e,e];this.from=s[2]||"",this.path=s[1]||""}}}}});function Cs(e){let[t,r]=e.split(Pe);return{from:r||t,to:t}}function q(e,t,r){return[`${e}${t}`,r]}function Zt(e,...t){return t.map((r)=>q(e,r,(s,n)=>s.conflicted.push(n)))}function Rc(e,t){let r=t.trim();switch(" "){case r.charAt(2):return s(r.charAt(0),r.charAt(1),r.slice(3));case r.charAt(1):return s(" ",r.charAt(0),r.slice(2));default:return}function s(n,o,a){let u=`${n}${o}`,l=ui.get(u);if(l)l(e,a);if(u!=="##"&&u!=="!!")e.files.push(new ai(a,n,o))}}var Rs,ui,ci,Lc=d({"src/lib/responses/StatusSummary.ts"(){b(),Cc(),Rs=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},ui=new Map([q(" ","A",(e,t)=>e.created.push(t)),q(" ","D",(e,t)=>e.deleted.push(t)),q(" ","M",(e,t)=>e.modified.push(t)),q("A"," ",(e,t)=>{e.created.push(t),e.staged.push(t)}),q("A","M",(e,t)=>{e.created.push(t),e.staged.push(t),e.modified.push(t)}),q("D"," ",(e,t)=>{e.deleted.push(t),e.staged.push(t)}),q("M"," ",(e,t)=>{e.modified.push(t),e.staged.push(t)}),q("M","M",(e,t)=>{e.modified.push(t),e.staged.push(t)}),q("R"," ",(e,t)=>{e.renamed.push(Cs(t))}),q("R","M",(e,t)=>{let r=Cs(t);e.renamed.push(r),e.modified.push(r.to)}),q("!","!",(e,t)=>{(e.ignored=e.ignored||[]).push(t)}),q("?","?",(e,t)=>e.not_added.push(t)),...Zt("A","A","U"),...Zt("D","D","U"),...Zt("U","A","D","U"),["##",(e,t)=>{let r=/ahead (\d+)/,s=/behind (\d+)/,n=/^(.+?(?=(?:\.{3}|\s|$)))/,o=/\.{3}(\S*)/,a=/\son\s(\S+?)(?=\.{3}|$)/,u=r.exec(t);if(e.ahead=u&&+u[1]||0,u=s.exec(t),e.behind=u&&+u[1]||0,u=n.exec(t),e.current=M(u?.[1],C,null),u=o.exec(t),e.tracking=M(u?.[1],C,null),u=a.exec(t),u)e.current=M(u?.[1],C,e.current);e.detached=/\(no branch\)/.test(t)}]]),ci=function(e){let t=e.split(Pe),r=new Rs;for(let s=0,n=t.length;s<n;){let o=t[s++].trim();if(!o)continue;if(o.charAt(0)==="R")o+=Pe+(t[s++]||"");Rc(r,o)}return r}}});function Nc(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter((r)=>!li.includes(r))],parser(r){return ci(r)}}}var li,Ac=d({"src/lib/tasks/status.ts"(){Lc(),li=["--null","-z"]}});function _t(e=0,t=0,r=0,s="",n=!0){return Object.defineProperty({major:e,minor:t,patch:r,agent:s,installed:n},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function Dc(){return _t(0,0,0,"",!1)}function Mc(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:Ic,onError(e,t,r,s){if(e.exitCode===-2)return r(Buffer.from(Mr));s(t)}})}}}function Ic(e){if(e===Mr)return Dc();return F(_t(0,0,0,e),fi,e)}var Mr,fi,Bc=d({"src/lib/tasks/version.ts"(){b(),Mr="installed=false",fi=[new T(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,r,s,n=""])=>{Object.assign(e,_t(E(t),E(r),E(s),n))}),new T(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,r,s,n=""])=>{Object.assign(e,_t(E(t),E(r),s,n))})]}});function Ls(e,t,r,...s){if(!C(r))return U(`git.${e}() requires a string 'repoPath'`);return t(r,M(s[0],C),I(arguments))}function Uc(){return{clone(e,...t){return this._runTask(Ls("clone",lr,M(e,C),...t),P(arguments))},mirror(e,...t){return this._runTask(Ls("mirror",hi,M(e,C),...t),P(arguments))}}}var lr,hi,Fc=d({"src/lib/tasks/clone.ts"(){L(),b(),lr=(e,t,r)=>{let s=["clone",...r];return C(e)&&s.push(ke(e)),C(t)&&s.push(ke(t)),B(s)},hi=(e,t,r)=>(Y(r,"--mirror"),lr(e,t,r))}}),di={};N(di,{SimpleGitApi:()=>fr});var fr,jc=d({"src/lib/simple-git-api.ts"(){qu(),Wu(),zu(),Ku(),ec(),bn(),rc(),Sn(),nc(),cc(),Hn(),xc(),oi(),Pc(),Ac(),L(),Bc(),b(),Fc(),fr=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),s=r.push(e);if(t)$u(e,s,t);return Object.create(this,{then:{value:s.then.bind(s)},catch:{value:s.catch.bind(s)},_executor:{value:r}})}add(e){return this._runTask(B(["add",...ee(e)]),P(arguments))}cwd(e){let t=P(arguments);if(typeof e==="string")return this._runTask(ds(e,this._executor),t);if(typeof e?.path==="string")return this._runTask(ds(e.path,e.root&&this._executor||void 0),t);return this._runTask(U("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(sc(e,t===!0),P(arguments))}init(e){return this._runTask(uc(e===!0,this._executor.cwd,I(arguments)),P(arguments))}merge(){return this._runTask(Ss(I(arguments)),P(arguments))}mergeFromTo(e,t){if(!(C(e)&&C(t)))return this._runTask(U("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"));return this._runTask(Ss([e,t,...I(arguments)]),P(arguments,!1))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=Dr({remote:M(arguments[0],C),branch:M(arguments[1],C)},I(arguments));return this._runTask(e,P(arguments))}stash(){return this._runTask(B(["stash",...I(arguments)]),P(arguments))}status(){return this._runTask(Nc(I(arguments)),P(arguments))}},Object.assign(fr.prototype,Vu(),Uc(),Ju(),Ou(),Yu(),tc(),Lu(),_c(),Oc(),Mc())}}),pi={};N(pi,{Scheduler:()=>gi});var Ns,gi,$c=d({"src/lib/runners/scheduler.ts"(){b(),Rn(),Ns=(()=>{let e=0;return()=>{e++;let{promise:t,done:r}=mi.createDeferred();return{promise:t,done:r,id:e}}})(),gi=class{constructor(e=2){this.concurrency=e,this.logger=Sr("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let e=Y(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),vt(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=Y(this.pending,Ns());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),_i={};N(_i,{applyPatchTask:()=>Gc});function Gc(e,t){return B(["apply",...t,...e])}var qc=d({"src/lib/tasks/apply-patch.ts"(){L()}});function Wc(e,t){return{branch:e,hash:t,success:!0}}function Vc(e){return{branch:e,hash:null,success:!1}}var yi,zc=d({"src/lib/responses/BranchDeleteSummary.ts"(){yi=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function vi(e,t){return t===1&&hr.test(e)}var As,hr,Ds,Et,Hc=d({"src/lib/parsers/parse-branch-delete.ts"(){zc(),b(),As=/(\S+)\s+\(\S+\s([^)]+)\)/,hr=/^error[^']+'([^']+)'/m,Ds=[new T(As,(e,[t,r])=>{let s=Wc(t,r);e.all.push(s),e.branches[t]=s}),new T(hr,(e,[t])=>{let r=Vc(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],Et=(e,t)=>F(new yi,Ds,[e,t])}}),bi,Yc=d({"src/lib/responses/BranchSummary.ts"(){bi=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,r,s,n){if(e==="*")this.detached=t,this.current=r;this.all.push(r),this.branches[r]={current:e==="*",linkedWorkTree:e==="+",name:r,commit:s,label:n}}}}});function Ms(e){return e?e.charAt(0):""}function Ti(e,t=!1){return F(new bi,t?[ki]:xi,e)}var xi,ki,Kc=d({"src/lib/parsers/parse-branch.ts"(){Yc(),b(),xi=[new T(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,r,s,n])=>{e.push(Ms(t),!0,r,s,n)}),new T(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,r,s,n])=>{e.push(Ms(t),!1,r,s,n)})],ki=new T(/^(\S+)$/s,(e,[t])=>{e.push("*",!1,t,"","")})}}),Si={};N(Si,{branchLocalTask:()=>Qc,branchTask:()=>Xc,containsDeleteBranchCommand:()=>Ei,deleteBranchTask:()=>Jc,deleteBranchesTask:()=>Zc});function Ei(e){let t=["-d","-D","--delete"];return e.some((r)=>t.includes(r))}function Xc(e){let t=Ei(e),r=e.includes("--show-current"),s=["branch",...e];if(s.length===1)s.push("-a");if(!s.includes("-v"))s.splice(1,0,"-v");return{format:"utf-8",commands:s,parser(n,o){if(t)return Et(n,o).all[0];return Ti(n,r)}}}function Qc(){return{format:"utf-8",commands:["branch","-v"],parser(e){return Ti(e)}}}function Zc(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser(r,s){return Et(r,s)},onError({exitCode:r,stdOut:s},n,o,a){if(!vi(String(n),r))return a(n);o(s)}}}function Jc(e,t=!1){let r={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser(s,n){return Et(s,n).branches[e]},onError({exitCode:s,stdErr:n,stdOut:o},a,u,l){if(!vi(String(a),s))return l(a);throw new He(r.parser(ze(o),ze(n)),String(a))}};return r}var el=d({"src/lib/tasks/branch.ts"(){Re(),Hc(),Kc(),b()}});function rl(e){let t=e.trim().replace(/^["']|["']$/g,"");return t&&tl(t)}var Oi,sl=d({"src/lib/responses/CheckIgnore.ts"(){Oi=(e)=>e.split(/\n/g).map(rl).filter(Boolean)}}),Pi={};N(Pi,{checkIgnoreTask:()=>nl});function nl(e){return{commands:["check-ignore",...e],format:"utf-8",parser:Oi}}var il=d({"src/lib/tasks/check-ignore.ts"(){sl()}});function ol(e,t){return F({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},Ci,[e,t])}var Ci,al=d({"src/lib/parsers/parse-fetch.ts"(){b(),Ci=[new T(/From (.+)$/,(e,[t])=>{e.remote=t}),new T(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.branches.push({name:t,tracking:r})}),new T(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.tags.push({name:t,tracking:r})}),new T(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new T(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,r,s,n])=>{e.updated.push({name:s,tracking:n,to:r,from:t})})]}}),Ri={};N(Ri,{fetchTask:()=>cl});function ul(e){return/^--upload-pack(=|$)/.test(e)}function cl(e,t,r){let s=["fetch",...r];if(e&&t)s.push(e,t);if(s.find(ul))return U("git.fetch: potential exploit argument blocked.");return{commands:s,format:"utf-8",parser:ol}}var ll=d({"src/lib/tasks/fetch.ts"(){al(),L()}});function fl(e){return F({moves:[]},Li,e)}var Li,hl=d({"src/lib/parsers/parse-move.ts"(){b(),Li=[new T(/^Renaming (.+) to (.+)$/,(e,[t,r])=>{e.moves.push({from:t,to:r})})]}}),Ni={};N(Ni,{moveTask:()=>dl});function dl(e,t){return{commands:["mv","-v",...ee(e),t],format:"utf-8",parser:fl}}var pl=d({"src/lib/tasks/move.ts"(){hl(),b()}}),Ai={};N(Ai,{pullTask:()=>ml});function ml(e,t,r){let s=["pull",...r];if(e&&t)s.splice(1,0,e,t);return{commands:s,format:"utf-8",parser(n,o){return Ar(n,o)},onError(n,o,a,u){let l=wc(ze(n.stdOut),ze(n.stdErr));if(l)return u(new He(l));u(o)}}}var gl=d({"src/lib/tasks/pull.ts"(){Re(),ri(),b()}});function _l(e){let t={};return Di(e,([r])=>t[r]={name:r}),Object.values(t)}function yl(e){let t={};return Di(e,([r,s,n])=>{if(!Object.hasOwn(t,r))t[r]={name:r,refs:{fetch:"",push:""}};if(n&&s)t[r].refs[n.replace(/[^a-z]/g,"")]=s}),Object.values(t)}function Di(e,t){mr(e,(r)=>t(r.split(/\s+/)))}var vl=d({"src/lib/responses/GetRemoteSummary.ts"(){b()}}),Mi={};N(Mi,{addRemoteTask:()=>bl,getRemotesTask:()=>wl,listRemotesTask:()=>Tl,remoteTask:()=>xl,removeRemoteTask:()=>kl});function bl(e,t,r){return B(["remote","add",...r,e,t])}function wl(e){let t=["remote"];if(e)t.push("-v");return{commands:t,format:"utf-8",parser:e?yl:_l}}function Tl(e){let t=[...e];if(t[0]!=="ls-remote")t.unshift("ls-remote");return B(t)}function xl(e){let t=[...e];if(t[0]!=="remote")t.unshift("remote");return B(t)}function kl(e){return B(["remote","remove",e])}var Sl=d({"src/lib/tasks/remote.ts"(){vl(),L()}}),Ii={};N(Ii,{stashListTask:()=>El});function El(e={},t){let r=zn(e),s=["stash","list",...r.commands,...t],n=Gn(r.splitter,r.fields,Or(s));return St(s)||{commands:s,format:"utf-8",parser:n}}var Ol=d({"src/lib/tasks/stash-list.ts"(){Qe(),Wn(),Nr(),Hn()}}),Bi={};N(Bi,{addSubModuleTask:()=>Pl,initSubModuleTask:()=>Cl,subModuleTask:()=>Ot,updateSubModuleTask:()=>Rl});function Pl(e,t){return Ot(["add",e,t])}function Cl(e){return Ot(["init",...e])}function Ot(e){let t=[...e];if(t[0]!=="submodule")t.unshift("submodule");return B(t)}function Rl(e){return Ot(["update",...e])}var Ll=d({"src/lib/tasks/sub-module.ts"(){L()}});function Nl(e,t){let r=Number.isNaN(e),s=Number.isNaN(t);if(r!==s)return r?1:-1;return r?Ui(e,t):0}function Ui(e,t){return e===t?0:e>t?1:-1}function Al(e){return e.trim()}function ct(e){if(typeof e==="string")return parseInt(e.replace(/^\D+/g,""),10)||0;return 0}var Is,Fi,Dl=d({"src/lib/responses/TagList.ts"(){Is=class{constructor(e,t){this.all=e,this.latest=t}},Fi=function(e,t=!1){let r=e.split(`
|
|
13
|
+
`).map(Al).filter(Boolean);if(!t)r.sort(function(n,o){let a=n.split("."),u=o.split(".");if(a.length===1||u.length===1)return Nl(ct(a[0]),ct(u[0]));for(let l=0,m=Math.max(a.length,u.length);l<m;l++){let h=Ui(ct(a[l]),ct(u[l]));if(h)return h}return 0});let s=t?r[0]:[...r].reverse().find((n)=>n.indexOf(".")>=0);return new Is(r,s)}}}),ji={};N(ji,{addAnnotatedTagTask:()=>Bl,addTagTask:()=>Il,tagListTask:()=>Ml});function Ml(e=[]){let t=e.some((r)=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return Fi(r,t)}}}function Il(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function Bl(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var Ul=d({"src/lib/tasks/tag.ts"(){Dl()}}),Fl=eu({"src/git.js"(e,t){var{GitExecutor:r}=(ju(),R(Nn)),{SimpleGitApi:s}=(jc(),R(di)),{Scheduler:n}=($c(),R(pi)),{adhocExecTask:o,configurationErrorTask:a}=(L(),R(ir)),{asArray:u,filterArray:l,filterPrimitives:m,filterString:h,filterStringOrStringArray:p,filterType:w,getTrailingOptions:k,trailingFunctionArgument:g,trailingOptionsArgument:S}=(b(),R(tn)),{applyPatchTask:D}=(qc(),R(_i)),{branchTask:oe,branchLocalTask:pe,deleteBranchesTask:it,deleteBranchTask:ae}=(el(),R(Si)),{checkIgnoreTask:me}=(il(),R(Pi)),{checkIsRepoTask:ot}=(on(),R(rn)),{cleanWithOptionsTask:$e,isCleanOptionsArray:at}=(_n(),R(mn)),{diffSummaryTask:Ge}=(Nr(),R(Vn)),{fetchTask:Gt}=(ll(),R(Ri)),{moveTask:zo}=(pl(),R(Ni)),{pullTask:Ho}=(gl(),R(Ai)),{pushTagsTask:Yo}=(oi(),R(ii)),{addRemoteTask:Ko,getRemotesTask:Xo,listRemotesTask:Qo,remoteTask:Zo,removeRemoteTask:ea}=(Sl(),R(Mi)),{getResetMode:ta,resetTask:ra}=(Cn(),R(En)),{stashListTask:sa}=(Ol(),R(Ii)),{addSubModuleTask:na,initSubModuleTask:ia,subModuleTask:oa,updateSubModuleTask:aa}=(Ll(),R(Bi)),{addAnnotatedTagTask:ua,addTagTask:ca,tagListTask:la}=(Ul(),R(ji)),{straightThroughBufferTask:fa,straightThroughStringTask:J}=(L(),R(ir));function y(f,_){this._plugins=_,this._executor=new r(f.baseDir,new n(f.maxConcurrentProcesses),_),this._trimmed=f.trimmed}(y.prototype=Object.create(s.prototype)).constructor=y,y.prototype.customBinary=function(f){return this._plugins.reconfigure("binary",f),this},y.prototype.env=function(f,_){if(arguments.length===1&&typeof f==="object")this._executor.env=f;else(this._executor.env=this._executor.env||{})[f]=_;return this},y.prototype.stashList=function(f){return this._runTask(sa(S(arguments)||{},l(f)&&f||[]),g(arguments))},y.prototype.mv=function(f,_){return this._runTask(zo(f,_),g(arguments))},y.prototype.checkoutLatestTag=function(f){var _=this;return this.pull(function(){_.tags(function(O,j){_.checkout(j.latest,f)})})},y.prototype.pull=function(f,_,O,j){return this._runTask(Ho(w(f,h),w(_,h),k(arguments)),g(arguments))},y.prototype.fetch=function(f,_){return this._runTask(Gt(w(f,h),w(_,h),k(arguments)),g(arguments))},y.prototype.silent=function(f){return this._runTask(o(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},y.prototype.tags=function(f,_){return this._runTask(la(k(arguments)),g(arguments))},y.prototype.rebase=function(){return this._runTask(J(["rebase",...k(arguments)]),g(arguments))},y.prototype.reset=function(f){return this._runTask(ra(ta(f),k(arguments)),g(arguments))},y.prototype.revert=function(f){let _=g(arguments);if(typeof f!=="string")return this._runTask(a("Commit must be a string"),_);return this._runTask(J(["revert",...k(arguments,0,!0),f]),_)},y.prototype.addTag=function(f){let _=typeof f==="string"?ca(f):a("Git.addTag requires a tag name");return this._runTask(_,g(arguments))},y.prototype.addAnnotatedTag=function(f,_){return this._runTask(ua(f,_),g(arguments))},y.prototype.deleteLocalBranch=function(f,_,O){return this._runTask(ae(f,typeof _==="boolean"?_:!1),g(arguments))},y.prototype.deleteLocalBranches=function(f,_,O){return this._runTask(it(f,typeof _==="boolean"?_:!1),g(arguments))},y.prototype.branch=function(f,_){return this._runTask(oe(k(arguments)),g(arguments))},y.prototype.branchLocal=function(f){return this._runTask(pe(),g(arguments))},y.prototype.raw=function(f){let _=!Array.isArray(f),O=[].slice.call(_?arguments:f,0);for(let Q=0;Q<O.length&&_;Q++)if(!m(O[Q])){O.splice(Q,O.length-Q);break}O.push(...k(arguments,0,!0));var j=g(arguments);if(!O.length)return this._runTask(a("Raw: must supply one or more command to execute"),j);return this._runTask(J(O,this._trimmed),j)},y.prototype.submoduleAdd=function(f,_,O){return this._runTask(na(f,_),g(arguments))},y.prototype.submoduleUpdate=function(f,_){return this._runTask(aa(k(arguments,!0)),g(arguments))},y.prototype.submoduleInit=function(f,_){return this._runTask(ia(k(arguments,!0)),g(arguments))},y.prototype.subModule=function(f,_){return this._runTask(oa(k(arguments)),g(arguments))},y.prototype.listRemote=function(){return this._runTask(Qo(k(arguments)),g(arguments))},y.prototype.addRemote=function(f,_,O){return this._runTask(Ko(f,_,k(arguments)),g(arguments))},y.prototype.removeRemote=function(f,_){return this._runTask(ea(f),g(arguments))},y.prototype.getRemotes=function(f,_){return this._runTask(Xo(f===!0),g(arguments))},y.prototype.remote=function(f,_){return this._runTask(Zo(k(arguments)),g(arguments))},y.prototype.tag=function(f,_){let O=k(arguments);if(O[0]!=="tag")O.unshift("tag");return this._runTask(J(O),g(arguments))},y.prototype.updateServerInfo=function(f){return this._runTask(J(["update-server-info"]),g(arguments))},y.prototype.pushTags=function(f,_){let O=Yo({remote:w(f,h)},k(arguments));return this._runTask(O,g(arguments))},y.prototype.rm=function(f){return this._runTask(J(["rm","-f",...u(f)]),g(arguments))},y.prototype.rmKeepLocal=function(f){return this._runTask(J(["rm","--cached",...u(f)]),g(arguments))},y.prototype.catFile=function(f,_){return this._catFile("utf-8",arguments)},y.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},y.prototype._catFile=function(f,_){var O=g(_),j=["cat-file"],Q=_[0];if(typeof Q==="string")return this._runTask(a("Git.catFile: options must be supplied as an array of strings"),O);if(Array.isArray(Q))j.push.apply(j,Q);let qt=f==="buffer"?fa(j):J(j);return this._runTask(qt,O)},y.prototype.diff=function(f,_){let O=h(f)?a("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):J(["diff",...k(arguments)]);return this._runTask(O,g(arguments))},y.prototype.diffSummary=function(){return this._runTask(Ge(k(arguments,1)),g(arguments))},y.prototype.applyPatch=function(f){let _=!p(f)?a("git.applyPatch requires one or more string patches as the first argument"):D(u(f),k([].slice.call(arguments,1)));return this._runTask(_,g(arguments))},y.prototype.revparse=function(){let f=["rev-parse",...k(arguments,!0)];return this._runTask(J(f,!0),g(arguments))},y.prototype.clean=function(f,_,O){let j=at(f),Q=j&&f.join("")||w(f,h)||"",qt=k([].slice.call(arguments,j?1:0));return this._runTask($e(Q,qt),g(arguments))},y.prototype.exec=function(f){let _={commands:[],format:"utf-8",parser(){if(typeof f==="function")f()}};return this._runTask(_)},y.prototype.clearQueue=function(){return this._runTask(o(()=>console.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},y.prototype.checkIgnore=function(f,_){return this._runTask(me(u(w(f,p,[]))),g(arguments))},y.prototype.checkIsRepo=function(f,_){return this._runTask(ot(w(f,h)),g(arguments))},t.exports=y}});ce();var jl=class extends re{constructor(e,t){super(void 0,t);this.config=e}};ce();ce();var Ce=class extends re{constructor(e,t,r){super(e,r);this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};Re();Gs();on();_n();bn();Tn();Sn();Cn();function $l(e){if(!e)return;return[{type:"spawn.before",action(s,n){if(e.aborted)n.kill(new Ce(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(s,n){function o(){n.kill(new Ce(void 0,"abort","Abort signal received"))}e.addEventListener("abort",o),n.spawned.on("close",()=>e.removeEventListener("abort",o))}}]}function Gl(e={}){return{type:"spawn.args",action(t,{env:r}){for(let s of cs(t,r))if(e[s.category]!==!0)throw new Ce(void 0,"unsafe",s.message);return t}}}b();function ql(e){let t=Ve(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}b();var Bs=Oe.deferred().promise;function Wl({onClose:e=!0,onExit:t=50}={}){function r(){let n=-1,o={close:Oe.deferred(),closeTimeout:Oe.deferred(),exit:Oe.deferred(),exitTimeout:Oe.deferred()},a=Promise.race([e===!1?Bs:o.closeTimeout.promise,t===!1?Bs:o.exitTimeout.promise]);return s(e,o.close,o.closeTimeout),s(t,o.exit,o.exitTimeout),{close(u){n=u,o.close.done()},exit(u){n=u,o.exit.done()},get exitCode(){return n},result:a}}function s(n,o,a){if(n===!1)return;(n===!0?o.promise:o.promise.then(()=>Jt(n))).then(a.done)}return{type:"spawn.after",async action(n,{spawned:o,close:a}){let u=r(),l=!0,m=()=>void(l=!1);o.stdout?.on("data",m),o.stderr?.on("data",m),o.on("error",m),o.on("close",(h)=>u.close(h)),o.on("exit",(h)=>u.exit(h));try{if(await u.result,l)await Jt(50);a(u.exitCode)}catch(h){a(u.exitCode,h)}}}}b();var Vl="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",Us="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function zl(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(e)}function Fs(e,t){if(e.length<1||e.length>2)throw new Ce(void 0,"binary",Vl);if(e.some(zl))if(t)console.warn(Us);else throw new Ce(void 0,"binary",Us);let[s,n]=e;return{binary:s,prefix:n}}function Hl(e,t=["git"],r=!1){let s=Fs(ee(t),r);e.on("binary",(n)=>{s=Fs(ee(n),r)}),e.append("spawn.binary",()=>s.binary),e.append("spawn.args",(n)=>s.prefix?[s.prefix,...n]:n)}ce();function Yl(e){return!!(e.exitCode&&e.stdErr.length)}function Kl(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Xl(e=!1,t=Yl,r=Kl){return(s,n)=>{if(!e&&s||!t(n))return s;return r(n)}}function js(e){return{type:"task.error",action(t,r){let s=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});if(Buffer.isBuffer(s))return{error:new re(void 0,s.toString("utf-8"))};return{error:s}}}}b();var Zl=class{constructor(){this.plugins=new Set,this.events=new Ql}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=Y(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return ee(e).forEach((r)=>r&&this.plugins.add(Y(t,r))),()=>{t.forEach((r)=>this.plugins.delete(r))}}exec(e,t,r){let s=t,n=Object.freeze(Object.create(r));for(let o of this.plugins)if(o.type===e)s=o.action(s,n);return s}};b();function Jl(e){let r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(o,a){if(!r.includes(a.method))return o;return Ys(o,"--progress")}},{type:"spawn.after",action(o,a){if(!a.commands.includes("--progress"))return;a.spawned.stderr?.on("data",(u)=>{let l=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(u.toString("utf8"));if(!l)return;e({method:a.method,stage:tf(l[1]),progress:E(l[2]),processed:E(l[3]),total:E(l[4])})})}}]}function tf(e){return String(e.toLowerCase().split(" ",1))||"unknown"}b();function rf(e){let t=Xs(e,["uid","gid"]);return{type:"spawn.options",action(r){return{...t,...r}}}}function sf({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(s,n){let o;function a(){o&&clearTimeout(o),o=setTimeout(l,e)}function u(){n.spawned.stdout?.off("data",a),n.spawned.stderr?.off("data",a),n.spawned.off("exit",u),n.spawned.off("close",u),o&&clearTimeout(o)}function l(){u(),n.kill(new Ce(void 0,"timeout","block timeout reached"))}r&&n.spawned.stdout?.on("data",a),t&&n.spawned.stderr?.on("data",a),n.spawned.on("exit",u),n.spawned.on("close",u),a()}}}function nf(){return{type:"spawn.args",action(e){let t=[],r;function s(n){(r=r||[]).push(...n)}for(let n=0;n<e.length;n++){let o=e[n];if(V(o)){s(Se(o));continue}if(o==="--"){s(e.slice(n+1).flatMap((a)=>V(a)&&Se(a)||a));break}t.push(o)}return!r?t:[...t,"--",...r.map(String)]}}}b();var of=Fl();function af(e,t){let r=new Zl,s=Js(e&&(typeof e==="string"?{baseDir:e}:e)||{},t);if(!gr(s.baseDir))throw new jl(s,"Cannot use simple-git on a directory that does not exist");if(Array.isArray(s.config))r.add(ql(s.config));return r.add(Gl(s.unsafe)),r.add(Wl(s.completion)),s.abort&&r.add($l(s.abort)),s.progress&&r.add(Jl(s.progress)),s.timeout&&r.add(sf(s.timeout)),s.spawnOptions&&r.add(rf(s.spawnOptions)),r.add(nf()),r.add(js(Xl(!0))),s.errors&&r.add(js(s.errors)),Hl(r,s.binary,s.unsafe?.allowUnsafeCustomBinary),new of(s,r)}Re();var wi=af;var _f={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function yf(e){try{return new URL(e)}catch{return null}}function xa(e){var t=(typeof e==="string"?yf(e):e)||{},{protocol:r,host:s,port:n}=t;if(typeof s!=="string"||!s||typeof r!=="string")return"";if(r=r.split(":",1)[0],s=s.replace(/:\d*$/,""),n=parseInt(n)||_f[r]||0,!vf(s,n))return"";var o=Br(r+"_proxy")||Br("all_proxy");if(o&&o.indexOf("://")===-1)o=r+"://"+o;return o}function vf(e,t){var r=Br("no_proxy").toLowerCase();if(!r)return!0;if(r==="*")return!1;return r.split(/[,\s]/).every(function(s){if(!s)return!0;var n=s.match(/^(.+):(\d+)$/),o=n?n[1]:s,a=n?parseInt(n[2]):0;if(a&&a!==t)return!0;if(!/^[.*]/.test(o))return e!==o;if(o.charAt(0)==="*")o=o.slice(1);return!e.endsWith(o)})}function Br(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var jh=v(Uo(),1),$h=v(It(),1),Gh=v(Me(),1),qh=v(qr(),1),Wh=v(Vr(),1),Vh=v(Qr(),1),Vo=v(jt(),1),Jo=v(Wo(),1);var ba=Vo.default;
|
|
14
|
+
export{wi,ns,xa,Jo,ba};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{A}from"./index-4etvmc8g.js";import{i,c}from"./index-edf1hmcw.js";var h=i(function(d){Object.defineProperty(d,"__esModule",{value:!0});d.AbstractAsyncHooksContextManager=void 0;var S=c("events"),m=["addListener","on","once","prependListener","prependOnceListener"];class p{bind(e,t){if(t instanceof S.EventEmitter)return this._bindEventEmitter(e,t);if(typeof t==="function")return this._bindFunction(e,t);return t}_bindFunction(e,t){let s=this,n=function(...r){return s.with(e,()=>t.apply(this,r))};return Object.defineProperty(n,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),n}_bindEventEmitter(e,t){if(this._getPatchMap(t)!==void 0)return t;if(this._createPatchMap(t),m.forEach((n)=>{if(t[n]===void 0)return;t[n]=this._patchAddListener(t,t[n],e)}),typeof t.removeListener==="function")t.removeListener=this._patchRemoveListener(t,t.removeListener);if(typeof t.off==="function")t.off=this._patchRemoveListener(t,t.off);if(typeof t.removeAllListeners==="function")t.removeAllListeners=this._patchRemoveAllListeners(t,t.removeAllListeners);return t}_patchRemoveListener(e,t){let s=this;return function(n,r){let o=s._getPatchMap(e)?.[n];if(o===void 0)return t.call(this,n,r);let a=o.get(r);return t.call(this,n,a||r)}}_patchRemoveAllListeners(e,t){let s=this;return function(n){let r=s._getPatchMap(e);if(r!==void 0){if(arguments.length===0)s._createPatchMap(e);else if(r[n]!==void 0)delete r[n]}return t.apply(this,arguments)}}_patchAddListener(e,t,s){let n=this;return function(r,o){if(n._wrapped)return t.call(this,r,o);let a=n._getPatchMap(e);if(a===void 0)a=n._createPatchMap(e);let _=a[r];if(_===void 0)_=new WeakMap,a[r]=_;let l=n.bind(s,o);_.set(o,l),n._wrapped=!0;try{return t.call(this,r,l)}finally{n._wrapped=!1}}}_createPatchMap(e){let t=Object.create(null);return e[this._kOtListeners]=t,t}_getPatchMap(e){return e[this._kOtListeners]}_kOtListeners=Symbol("OtListeners");_wrapped=!1}d.AbstractAsyncHooksContextManager=p});var b=i(function(g){Object.defineProperty(g,"__esModule",{value:!0});g.AsyncHooksContextManager=void 0;var H=A(),O=c("async_hooks"),P=h();class y extends P.AbstractAsyncHooksContextManager{_asyncHook;_contexts=new Map;_stack=[];constructor(){super();this._asyncHook=O.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){return this._stack[this._stack.length-1]??H.ROOT_CONTEXT}with(e,t,s,...n){this._enterContext(e);try{return t.call(s,...n)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(e,t){if(t==="TIMERWRAP")return;let s=this._stack[this._stack.length-1];if(s!==void 0)this._contexts.set(e,s)}_destroy(e){this._contexts.delete(e)}_before(e){let t=this._contexts.get(e);if(t!==void 0)this._enterContext(t)}_after(){this._exitContext()}_enterContext(e){this._stack.push(e)}_exitContext(){this._stack.pop()}}g.AsyncHooksContextManager=y});var v=i(function(k){Object.defineProperty(k,"__esModule",{value:!0});k.AsyncLocalStorageContextManager=void 0;var w=A(),E=c("async_hooks"),R=h();class L{_isDisposed=!1;_previousContext;_asyncLocalStorage;constructor(e,t){this._previousContext=e,this._asyncLocalStorage=t}dispose(){if(this._isDisposed)return;this._asyncLocalStorage.enterWith(this._previousContext),this._isDisposed=!0}}class M extends R.AbstractAsyncHooksContextManager{_asyncLocalStorage;constructor(){super();this._asyncLocalStorage=new E.AsyncLocalStorage}active(){return this._asyncLocalStorage.getStore()??w.ROOT_CONTEXT}with(e,t,s,...n){let r=s==null?t:t.bind(s);return this._asyncLocalStorage.run(e,r,...n)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}attach(e){let t=this._asyncLocalStorage.withScope;if(t)return t.call(this._asyncLocalStorage,e);let s=this.active();return this._asyncLocalStorage.enterWith(e),new L(s,this._asyncLocalStorage)}}k.AsyncLocalStorageContextManager=M});var Zg=i(function(u){Object.defineProperty(u,"__esModule",{value:!0});u.AsyncLocalStorageContextManager=u.AsyncHooksContextManager=void 0;var q=b();Object.defineProperty(u,"AsyncHooksContextManager",{enumerable:!0,get:function(){return q.AsyncHooksContextManager}});var T=v();Object.defineProperty(u,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return T.AsyncLocalStorageContextManager}})});
|
|
2
|
+
export{Zg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i}from"./index-edf1hmcw.js";var f=i(function(Sr){var Lr=function(e){return e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL",e}({});Sr.DiagLogLevel=Lr});var w=i(function(wr){wr.VERSION="1.10.0"});var ie=i(function(yr){var mr=w(),ne=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function ae(e){let r=new Set([e]),t=new Set,o=e.match(ne);if(!o)return()=>!1;let n={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(n.prerelease!=null)return function(c){return c===e};function a(u){return t.add(u),!1}function s(u){return r.add(u),!0}return function(c){if(r.has(c))return!0;if(t.has(c))return!1;let _=c.match(ne);if(!_)return a(c);let g={major:+_[1],minor:+_[2],patch:+_[3],prerelease:_[4]};if(g.prerelease!=null)return a(c);if(n.major!==g.major)return a(c);if(n.major===0){if(n.minor===g.minor&&n.patch<=g.patch)return s(c);return a(c)}if(n.minor<=g.minor)return s(c);return a(c)}}var Vr=ae(mr.VERSION);yr._makeCompatibilityCheck=ae;yr.isCompatible=Vr});var l=i(function(Wr){var q=w(),Fr=ie(),$r=q.VERSION.split(".")[0],h=Symbol.for(`opentelemetry.js.api.${$r}`),I=typeof globalThis==="object"?globalThis:typeof self==="object"?self:typeof window==="object"?window:typeof global==="object"?global:{};function kr(){return Object.defineProperty({},"version",{value:q.VERSION,enumerable:!0,writable:!1,configurable:!1})}function jr(e,r,t,o=!1){var n;let a=I[h]=(n=I[h])!==null&&n!==void 0?n:kr();if(!o&&a[e]){let s=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return t.error(s.stack||s.message),!1}if(a.version!=="1.10.0"){let s=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${q.VERSION}`);return t.error(s.stack||s.message),!1}return a[e]=r,t.debug(`@opentelemetry/api: Registered a global for ${e} v${q.VERSION}.`),!0}var se;function Xr(e){let r=I[h];if(r==null)return;if(r!==se){if(!r.version||!Fr.isCompatible(r.version))return;se=r}return r[e]}function Kr(e,r){r.debug(`@opentelemetry/api: Unregistering a global for ${e} v${q.VERSION}.`);let t=I[h];if(t)delete t[e]}Wr.getGlobal=Xr;Wr.registerGlobal=jr;Wr.unregisterGlobal=Kr});var ce=i(function(Zr){var Qr=l(),Jr=class{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return E("debug",this._namespace,e)}error(...e){return E("error",this._namespace,e)}info(...e){return E("info",this._namespace,e)}warn(...e){return E("warn",this._namespace,e)}verbose(...e){return E("verbose",this._namespace,e)}};function E(e,r,t){let o=Qr.getGlobal("diag");if(!o)return;return o[e](r,...t)}Zr.DiagComponentLogger=Jr});var ue=i(function(tt){f();function rt(e,r){if(e<0)e=0;else if(e>9999)e=9999;r=r||{};function t(o,n){let a=r[o];if(typeof a==="function"&&e>=n)return a.bind(r);return function(){}}return{error:t("error",30),warn:t("warn",50),info:t("info",60),debug:t("debug",70),verbose:t("verbose",80)}}tt.createLogLevelDiagLogger=rt});var p=i(function(ct){var N=l(),nt=ce();f();var at=ue(),it="diag",st=class e{static instance(){if(!this._instance)this._instance=new e;return this._instance}constructor(){function r(n){return function(...a){let s=N.getGlobal("diag");if(!s)return;return s[n](...a)}}let t=this,o=(n,a={logLevel:60})=>{var s;if(n===t){var u;let x=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error((u=x.stack)!==null&&u!==void 0?u:x.message),!1}if(typeof a==="number")a={logLevel:a};let c=N.getGlobal("diag"),_=at.createLogLevelDiagLogger((s=a.logLevel)!==null&&s!==void 0?s:60,n);if(c&&!a.suppressOverrideMessage){var g;let x=(g=Error().stack)!==null&&g!==void 0?g:"<failed to generate stacktrace>";c.warn(`Current logger will be overwritten from ${x}`),_.warn(`Current logger will overwrite one already registered from ${x}`)}return N.registerGlobal("diag",_,t,!0)};t.setLogger=o,t.disable=()=>{N.unregisterGlobal(it,t)},t.createComponentLogger=(n)=>new nt.DiagComponentLogger(n),t.verbose=r("verbose"),t.debug=r("debug"),t.info=r("info"),t.warn=r("warn"),t.error=r("error")}};ct.DiagAPI=st});var _e=i(function(gt){var _t=class e{constructor(r){this._entries=r?new Map(r):new Map}getEntry(r){let t=this._entries.get(r);if(!t)return;return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(r,t){let o=new e(this._entries);return o._entries.set(r,t),o}removeEntry(r){let t=new e(this._entries);return t._entries.delete(r),t}removeEntries(...r){let t=new e(this._entries);for(let o of r)t._entries.delete(o);return t}clear(){return new e}};gt.BaggageImpl=_t});var ge=i(function(dt){var pt=Symbol("BaggageEntryMetadata");dt.baggageEntryMetadataSymbol=pt});var G=i(function(ft){var qt=p(),Et=_e(),At=ge(),Pt=qt.DiagAPI.instance();function Tt(e={}){return new Et.BaggageImpl(new Map(Object.entries(e)))}function Rt(e){if(typeof e!=="string")Pt.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e="";return{__TYPE__:At.baggageEntryMetadataSymbol,toString(){return e}}}ft.baggageEntryMetadataFromString=Rt;ft.createBaggage=Tt});var P=i(function(Mt){function Nt(e){return Symbol.for(e)}var Ot=new class e{constructor(r){let t=this;t._currentContext=r?new Map(r):new Map,t.getValue=(o)=>t._currentContext.get(o),t.setValue=(o,n)=>{let a=new e(t._currentContext);return a._currentContext.set(o,n),a},t.deleteValue=(o)=>{let n=new e(t._currentContext);return n._currentContext.delete(o),n}}};Mt.ROOT_CONTEXT=Ot;Mt.createContextKey=Nt});var le=i(function(Lt){var m=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],O={};if(typeof console<"u"){for(let e of["error","warn","info","debug","trace","log"])if(typeof console[e]==="function")O[e]=console[e]}var bt=class{constructor(){function e(r){return function(...t){let o=O[r];if(typeof o!=="function")o=O.log;if(typeof o!=="function"&&console){if(o=console[r],typeof o!=="function")o=console.log}if(typeof o==="function")return o.apply(console,t)}}for(let r=0;r<m.length;r++)this[m[r].n]=e(m[r].c)}};Lt.DiagConsoleLogger=bt;Lt._originalConsoleMethods=O});var V=i(function(Gt){var pe=class{constructor(){}createGauge(e,r){return he}createHistogram(e,r){return Ie}createCounter(e,r){return fe}createUpDownCounter(e,r){return Ne}createObservableGauge(e,r){return Me}createObservableCounter(e,r){return Oe}createObservableUpDownCounter(e,r){return Ce}addBatchObservableCallback(e,r){}removeBatchObservableCallback(e){}},T=class{},de=class extends T{add(e,r){}},xe=class extends T{add(e,r){}},qe=class extends T{record(e,r){}},Ee=class extends T{record(e,r){}},M=class{addCallback(e){}removeCallback(e){}},Ae=class extends M{},Pe=class extends M{},Te=class extends M{},Re=new pe,fe=new de,he=new qe,Ie=new Ee,Ne=new xe,Oe=new Ae,Me=new Pe,Ce=new Te;function wt(){return Re}Gt.NOOP_COUNTER_METRIC=fe;Gt.NOOP_GAUGE_METRIC=he;Gt.NOOP_HISTOGRAM_METRIC=Ie;Gt.NOOP_METER=Re;Gt.NOOP_OBSERVABLE_COUNTER_METRIC=Oe;Gt.NOOP_OBSERVABLE_GAUGE_METRIC=Me;Gt.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=Ce;Gt.NOOP_UP_DOWN_COUNTER_METRIC=Ne;Gt.NoopCounterMetric=de;Gt.NoopGaugeMetric=qe;Gt.NoopHistogramMetric=Ee;Gt.NoopMeter=pe;Gt.NoopMetric=T;Gt.NoopObservableCounterMetric=Ae;Gt.NoopObservableGaugeMetric=Pe;Gt.NoopObservableMetric=M;Gt.NoopObservableUpDownCounterMetric=Te;Gt.NoopUpDownCounterMetric=xe;Gt.createNoopMeter=wt});var ve=i(function(to){var ro=function(e){return e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE",e}({});to.ValueType=ro});var C=i(function(ao){var be=class{emit(e){}enabled(){return!1}},Le=new be;function no(){return Le}ao.NOOP_LOGGER=Le;ao.NoopLogger=be;ao.createNoopLogger=no});var Se=i(function(_o){var uo=function(e){return e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4",e}({});_o.SeverityNumber=uo});var y=i(function(xo){var lo={get(e,r){if(e==null)return;return e[r]},keys(e){if(e==null)return[];return Object.keys(e)}},po={set(e,r,t){if(e==null)return;e[r]=t}};xo.defaultTextMapGetter=lo;xo.defaultTextMapSetter=po});var B=i(function(Po){var Ao=function(e){return e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED",e}({});Po.TraceFlags=Ao});var v=i(function(fo){B();var De="0000000000000000",we="00000000000000000000000000000000",Ro={traceId:we,spanId:De,traceFlags:0};fo.INVALID_SPANID=De;fo.INVALID_SPAN_CONTEXT=Ro;fo.INVALID_TRACEID=we});var b=i(function(Co){var Oo=v(),Mo=class{constructor(e=Oo.INVALID_SPAN_CONTEXT){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,r){return this}setAttributes(e){return this}addEvent(e,r){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,r){}};Co.NonRecordingSpan=Mo});var S=i(function(Do){v();var bo=b(),L=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function Ge(e,r){if(typeof e!=="string"||e.length!==r)return!1;let t=0;for(let o=0;o<e.length;o+=4)t+=(L[e.charCodeAt(o)]|0)+(L[e.charCodeAt(o+1)]|0)+(L[e.charCodeAt(o+2)]|0)+(L[e.charCodeAt(o+3)]|0);return t===r}function me(e){return Ge(e,32)&&e!=="00000000000000000000000000000000"}function Ve(e){return Ge(e,16)&&e!=="0000000000000000"}function Lo(e){return me(e.traceId)&&Ve(e.spanId)}function So(e){return new bo.NonRecordingSpan(e)}Do.isSpanContextValid=Lo;Do.isValidSpanId=Ve;Do.isValidTraceId=me;Do.wrapSpanContext=So});var ye=i(function(Uo){var yo=P(),Bo=class{active(){return yo.ROOT_CONTEXT}with(e,r,t,...o){return r.call(t,...o)}bind(e,r){return r}enable(){return this}disable(){return this}attach(e){return{dispose(){}}}};Uo.NoopContextManager=Bo});var R=i(function(Ko){var F=l(),U=p(),$o=ye(),ko=new $o.NoopContextManager,jo=Object.freeze({dispose:()=>{}}),Xo=class e{constructor(){this._attachUnsupportedWarned=!1}static getInstance(){if(!this._instance)this._instance=new e;return this._instance}setGlobalContextManager(r){return F.registerGlobal("context",r,U.DiagAPI.instance())}active(){return this._getContextManager().active()}with(r,t,o,...n){return this._getContextManager().with(r,t,o,...n)}bind(r,t){return this._getContextManager().bind(r,t)}attach(r){let t=this._getContextManager();if(t.attach)return t.attach(r);if(!this._attachUnsupportedWarned)this._attachUnsupportedWarned=!0,U.DiagAPI.instance().warn("The current ContextManager does not implement attach(). The context will not be attached. Use a ContextManager that supports attach() (e.g. AsyncLocalStorageContextManager) or use with()/bind() instead.");return jo}_getContextManager(){return F.getGlobal("context")||ko}disable(){this._getContextManager().disable(),F.unregisterGlobal("context",U.DiagAPI.instance())}};Ko.ContextAPI=Xo});var X=i(function(rn){var Yo=P(),Ho=R(),zo=b(),k=Yo.createContextKey("OpenTelemetry Context Key SPAN");function j(e){return e.getValue(k)||void 0}function Qo(){return j(Ho.ContextAPI.getInstance().active())}function Be(e,r){return e.setValue(k,r)}function Jo(e){return e.deleteValue(k)}function Zo(e,r){return Be(e,new zo.NonRecordingSpan(r))}function en(e){var r;return(r=j(e))===null||r===void 0?void 0:r.spanContext()}rn.deleteSpan=Jo;rn.getActiveSpan=Qo;rn.getSpan=j;rn.getSpanContext=en;rn.setSpan=Be;rn.setSpanContext=Zo});var Y=i(function(pn){var un=R(),K=b(),Ue=X(),_n=S(),W=un.ContextAPI.getInstance(),gn=class{startSpan(e,r,t=W.active()){if(Boolean(r===null||r===void 0?void 0:r.root))return new K.NonRecordingSpan;let o=t&&Ue.getSpanContext(t);if(ln(o)&&_n.isSpanContextValid(o))return new K.NonRecordingSpan(o);else return new K.NonRecordingSpan}startActiveSpan(e,r,t,o){var n;let a,s,u;if(arguments.length<2)return;else if(arguments.length===2)u=r;else if(arguments.length===3)a=r,u=t;else a=r,s=t,u=o;let c=(n=s)!==null&&n!==void 0?n:W.active(),_=this.startSpan(e,a,c),g=Ue.setSpan(c,_);return W.with(g,u,void 0,_)}};function ln(e){return e!==null&&typeof e==="object"&&"spanId"in e&&typeof e.spanId==="string"&&"traceId"in e&&typeof e.traceId==="string"&&"traceFlags"in e&&typeof e.traceFlags==="number"}pn.NoopTracer=gn});var H=i(function(En){var xn=new(Y()).NoopTracer,qn=class{constructor(e,r,t,o){this._provider=e,this.name=r,this.version=t,this.options=o}startSpan(e,r,t){return this._getTracer().startSpan(e,r,t)}startActiveSpan(e,r,t,o){let n=this._getTracer();return Reflect.apply(n.startActiveSpan,n,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);if(!e)return xn;return this._delegate=e,this._delegate}};En.ProxyTracer=qn});var Fe=i(function(Tn){var Pn=function(e){return e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER",e}({});Tn.SpanKind=Pn});var $e=i(function(hn){var fn=function(e){return e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR",e}({});hn.SpanStatusCode=fn});var ke=i(function(bn){var Nn=new RegExp("^(?:[a-z][_0-9a-z-*/]{0,255}|[a-z0-9][_0-9a-z-*/]{0,240}@[a-z][_0-9a-z-*/]{0,13})$"),On=/^[ -~]{0,255}[!-~]$/,Mn=/,|=/;function Cn(e){return Nn.test(e)}function vn(e){return On.test(e)&&!Mn.test(e)}bn.validateKey=Cn;bn.validateValue=vn});var Xe=i(function(wn){var je=ke(),Dn=class e{constructor(r){if(this._internalState=new Map,r)this._parse(r)}set(r,t){let o=this._internalState.get(r),n=this.serialize().length;if(typeof o==="string")n+=t.length-o.length;else{if(this._internalState.size>=32)return this;n+=r.length+t.length+(this._internalState.size>0?2:1)}if(n>512)return this;let a=this._clone();if(a._internalState.has(r))a._internalState.delete(r);return a._internalState.set(r,t),a}unset(r){let t=this._clone();return t._internalState.delete(r),t}get(r){return this._internalState.get(r)}serialize(){return Array.from(this._internalState.keys()).reduceRight((r,t)=>(r.push(t+"="+this.get(t)),r),[]).join(",")}_parse(r){if(r.length>512)return;if(this._internalState=r.split(",").reduceRight((t,o)=>{let n=o.trim(),a=n.indexOf("=");if(a!==-1){let s=n.slice(0,a),u=n.slice(a+1,o.length);if(je.validateKey(s)&&je.validateValue(u))t.set(s,u)}return t},new Map),this._internalState.size>32)this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let r=new e;return r._internalState=new Map(this._internalState),r}};wn.TraceStateImpl=Dn});var Ke=i(function(yn){var mn=Xe();function Vn(e){return new mn.TraceStateImpl(e)}yn.createTraceState=Vn});var We=i(function($n){var Un=Y(),Fn=class{getTracer(e,r,t){return new Un.NoopTracer}};$n.NoopTracerProvider=Fn});var z=i(function(Wn){var jn=H(),Xn=new(We()).NoopTracerProvider,Kn=class{getTracer(e,r,t){var o;return(o=this.getDelegateTracer(e,r,t))!==null&&o!==void 0?o:new jn.ProxyTracer(this,e,r,t)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Xn}setDelegate(e){this._delegate=e}getDelegateTracer(e,r,t){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(e,r,t)}};Wn.ProxyTracerProvider=Kn});var Ye=i(function(zn){var Hn=function(e){return e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED",e}({});zn.SamplingDecision=Hn});var He=i(function(Zn){var Jn=R().ContextAPI.getInstance();Zn.context=Jn});var ze=i(function(ta){var ra=p().DiagAPI.instance();ta.diag=ra});var Je=i(function(ia){var na=C(),Qe=class{getLogger(e,r,t){return new na.NoopLogger}},aa=new Qe;ia.NOOP_LOGGER_PROVIDER=aa;ia.NoopLoggerProvider=Qe});var Ze=i(function(ga){var ua=C(),_a=class{constructor(e,r,t,o){this._provider=e,this.name=r,this.version=t,this.options=o}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);if(!e)return ua.NOOP_LOGGER;return this._delegate=e,this._delegate}};ga.ProxyLogger=_a});var er=i(function(qa){var pa=Je(),da=Ze(),xa=class{getLogger(e,r,t){var o;return(o=this._getDelegateLogger(e,r,t))!==null&&o!==void 0?o:new da.ProxyLogger(this,e,r,t)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:pa.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,r,t){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,r,t)}};qa.ProxyLoggerProvider=xa});var or=i(function(Pa){var Q=l(),rr=p(),tr=er(),Aa=class e{constructor(){this._proxyLoggerProvider=new tr.ProxyLoggerProvider}static getInstance(){if(!this._instance)this._instance=new e;return this._instance}setGlobalLoggerProvider(r){let t=Q.registerGlobal("logs",r,rr.DiagAPI.instance());if(t)this._proxyLoggerProvider._setDelegate(r);return t}getLoggerProvider(){return Q.getGlobal("logs")||this._proxyLoggerProvider}getLogger(r,t,o){return this.getLoggerProvider().getLogger(r,t,o)}disable(){Q.unregisterGlobal("logs",rr.DiagAPI.instance()),this._proxyLoggerProvider=new tr.ProxyLoggerProvider}};Pa.LogsAPI=Aa});var nr=i(function(fa){var Ra=or().LogsAPI.getInstance();fa.logs=Ra});var ir=i(function(Oa){var Ia=V(),ar=class{getMeter(e,r,t){return Ia.NOOP_METER}},Na=new ar;Oa.NOOP_METER_PROVIDER=Na;Oa.NoopMeterProvider=ar});var cr=i(function(La){var J=l(),sr=p(),va=ir(),ba=class e{constructor(){}static getInstance(){if(!this._instance)this._instance=new e;return this._instance}setGlobalMeterProvider(r){return J.registerGlobal("metrics",r,sr.DiagAPI.instance())}getMeterProvider(){return J.getGlobal("metrics")||va.NOOP_METER_PROVIDER}getMeter(r,t,o){return this.getMeterProvider().getMeter(r,t,o)}disable(){J.unregisterGlobal("metrics",sr.DiagAPI.instance())}};La.MetricsAPI=ba});var ur=i(function(wa){var Da=cr().MetricsAPI.getInstance();wa.metrics=Da});var _r=i(function(Va){var ma=class{inject(e,r){}extract(e,r){return e}fields(){return[]}};Va.NoopTextMapPropagator=ma});var lr=i(function(ja){var Ba=P(),Ua=R(),Z=Ba.createContextKey("OpenTelemetry Baggage Key");function gr(e){return e.getValue(Z)||void 0}function Fa(){return gr(Ua.ContextAPI.getInstance().active())}function $a(e,r){return e.setValue(Z,r)}function ka(e){return e.deleteValue(Z)}ja.deleteBaggage=ka;ja.getActiveBaggage=Fa;ja.getBaggage=gr;ja.setBaggage=$a});var xr=i(function(Za){var ee=l(),pr=p(),Ha=G(),dr=y(),za=_r(),D=lr(),Qa=new za.NoopTextMapPropagator,Ja=class e{constructor(){this.createBaggage=Ha.createBaggage,this.getBaggage=D.getBaggage,this.getActiveBaggage=D.getActiveBaggage,this.setBaggage=D.setBaggage,this.deleteBaggage=D.deleteBaggage}static getInstance(){if(!this._instance)this._instance=new e;return this._instance}setGlobalPropagator(r){return ee.registerGlobal("propagation",r,pr.DiagAPI.instance())}inject(r,t,o=dr.defaultTextMapSetter){return this._getGlobalPropagator().inject(r,t,o)}extract(r,t,o=dr.defaultTextMapGetter){return this._getGlobalPropagator().extract(r,t,o)}fields(){return this._getGlobalPropagator().fields()}disable(){ee.unregisterGlobal("propagation",pr.DiagAPI.instance())}_getGlobalPropagator(){return ee.getGlobal("propagation")||Qa}};Za.PropagationAPI=Ja});var qr=i(function(ti){var ri=xr().PropagationAPI.getInstance();ti.propagation=ri});var Tr=i(function(ai){var re=l(),Er=p(),d=X(),Pr=S(),Ar=z(),ni=class e{constructor(){this._proxyTracerProvider=new Ar.ProxyTracerProvider,this.wrapSpanContext=Pr.wrapSpanContext,this.isSpanContextValid=Pr.isSpanContextValid,this.deleteSpan=d.deleteSpan,this.getSpan=d.getSpan,this.getActiveSpan=d.getActiveSpan,this.getSpanContext=d.getSpanContext,this.setSpan=d.setSpan,this.setSpanContext=d.setSpanContext}static getInstance(){if(!this._instance)this._instance=new e;return this._instance}setGlobalTracerProvider(r){let t=re.registerGlobal("trace",this._proxyTracerProvider,Er.DiagAPI.instance());if(t)this._proxyTracerProvider.setDelegate(r);return t}getTracerProvider(){return re.getGlobal("trace")||this._proxyTracerProvider}getTracer(r,t){return this.getTracerProvider().getTracer(r,t)}disable(){re.unregisterGlobal("trace",Er.DiagAPI.instance()),this._proxyTracerProvider=new Ar.ProxyTracerProvider}};ai.TraceAPI=ni});var Rr=i(function(ci){var si=Tr().TraceAPI.getInstance();ci.trace=si});var A=i(function(br){Object.defineProperties(br,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var _i=f(),gi=G(),fr=P(),li=le(),pi=V(),di=ve(),xi=C(),qi=Se(),hr=y(),Ei=B(),te=v(),oe=S(),Ai=H(),Pi=Fe(),Ti=$e(),Ri=Ke(),fi=z(),hi=Ye(),Ir=He(),Nr=ze(),Or=nr(),Mr=ur(),Cr=qr(),vr=Rr(),Ii={context:Ir.context,diag:Nr.diag,logs:Or.logs,metrics:Mr.metrics,propagation:Cr.propagation,trace:vr.trace};br.DiagConsoleLogger=li.DiagConsoleLogger;br.DiagLogLevel=_i.DiagLogLevel;br.INVALID_SPANID=te.INVALID_SPANID;br.INVALID_SPAN_CONTEXT=te.INVALID_SPAN_CONTEXT;br.INVALID_TRACEID=te.INVALID_TRACEID;br.ProxyTracer=Ai.ProxyTracer;br.ProxyTracerProvider=fi.ProxyTracerProvider;br.ROOT_CONTEXT=fr.ROOT_CONTEXT;br.SamplingDecision=hi.SamplingDecision;br.SeverityNumber=qi.SeverityNumber;br.SpanKind=Pi.SpanKind;br.SpanStatusCode=Ti.SpanStatusCode;br.TraceFlags=Ei.TraceFlags;br.ValueType=di.ValueType;br.baggageEntryMetadataFromString=gi.baggageEntryMetadataFromString;br.context=Ir.context;br.createContextKey=fr.createContextKey;br.createNoopLogger=xi.createNoopLogger;br.createNoopMeter=pi.createNoopMeter;br.createTraceState=Ri.createTraceState;br.default=Ii;br.defaultTextMapGetter=hr.defaultTextMapGetter;br.defaultTextMapSetter=hr.defaultTextMapSetter;br.diag=Nr.diag;br.isSpanContextValid=oe.isSpanContextValid;br.isValidSpanId=oe.isValidSpanId;br.isValidTraceId=oe.isValidTraceId;br.logs=Or.logs;br.metrics=Mr.metrics;br.propagation=Cr.propagation;br.trace=vr.trace});
|
|
2
|
+
export{A};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Zg}from"./index-418gvd4a.js";export default Zg();
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{mo,Qs,Ys,Kr,H2}from"./index-g2y6ptdc.js";import{Nh,$2,q2,ed,z2,Vr,td,Lh,G2,Oc,Uh}from"./index-w55v4n1n.js";import{createRequire as B}from"module";var Q=B(import.meta.url),W=class{generateResponseId(){return crypto.randomUUID()}generateTextBlockId(){return crypto.randomUUID()}generateToolCallId(){return crypto.randomUUID()}};function S(a){let t=Error("The operation was aborted.",{cause:a});return t.name="AbortError",t}function H(){return{activeText:!1,finishReason:{raw:void 0,unified:"other"},isFirstChunk:!0,usage:{inputTokens:{cacheRead:void 0,cacheWrite:void 0,noCache:void 0,total:void 0},outputTokens:{reasoning:void 0,text:void 0,total:void 0}}}}function z(a){let{cancel:t,convertToAISDKError:e,extractChunkMetadata:s,idGenerator:n,includeRawChunks:o,modelId:d,options:i,providerName:p,requestId:I,responseMetadata:R,sdkStream:q,streamResponseGetCitations:N,streamResponseGetFinishReason:D,streamResponseGetIntermediateFailures:F,url:M,version:O,warnings:U}=a,h=null,u=H(),w=new Map,y={...R},T=I,v,_;function b(r){if(!r?.length)return;_??=new Map;for(let l of r)_.set(String(l.ref_id??l.url),l)}function G(r){if(!r)return;let l=v?.prompt_tokens_details,c=r.prompt_tokens_details,m=v?.completion_tokens_details,f=r.completion_tokens_details,g=l?.cache_creation_token_details,C=c?.cache_creation_token_details;v={...v,...r,...l||c?{prompt_tokens_details:{...l,...c,...g||C?{cache_creation_token_details:{...g,...C}}:{}}}:{},...m||f?{completion_tokens_details:{...m,...f}}:{}}}function P(r,l){if(r.didEmitInputStart||r.id==null)return;if(r.didEmitInputStart=!0,l.enqueue({id:r.id,toolName:r.toolName??"",type:"tool-input-start"}),r.arguments.length>0)l.enqueue({delta:r.arguments,id:r.id,type:"tool-input-delta"})}let x=J(q,i.abortSignal)[Symbol.asyncIterator](),E=!1;return new ReadableStream({async cancel(){E=!0,t(),await x.return(void 0)},async pull(r){let{done:l,value:c}=await x.next();if(E)return;if(l)r.close();else r.enqueue(c)}}).pipeThrough(new TransformStream({flush(r){if(i.abortSignal?.aborted){A(S(i.abortSignal.reason),r,e,i,d,M);return}let l=k(r,w,n,P);if(u.activeText&&h)r.enqueue({id:h,type:"text-end"});let c=D();if(c)u.finishReason=td(c);else if(l)u.finishReason={raw:void 0,unified:"tool-calls"};if(u.usage=Lh(v),b(N?.()),_)for(let f of _.values())r.enqueue({id:String(f.ref_id??f.url),sourceType:"url",title:f.title,type:"source",url:f.url});let m=F?.();r.enqueue({finishReason:u.finishReason,providerMetadata:{[p]:{...Nh(v),finishReason:u.finishReason.raw??"unknown",finishReasonMapped:u.finishReason,...m?.length?{intermediateFailures:Uh(m)}:{},...T?{requestId:T}:{},responseId:y.id,version:O}},type:"finish",usage:u.usage})},start(r){r.enqueue({type:"stream-start",warnings:[...U]})},transform(r,l){if(i.abortSignal?.aborted&&!(r instanceof Error))r=S(i.abortSignal.reason);if(r instanceof Error){A(r,l,e,i,d,M);return}if(o)l.enqueue({rawValue:r._data??r,type:"raw"});let c=s(r);if(c.requestId)T=c.requestId;let m=c.responseMetadata,f=m.id!==void 0&&m.id!==y.id||m.modelId!==void 0&&m.modelId!==y.modelId||m.timestamp!==void 0&&m.timestamp.getTime()!==y.timestamp?.getTime();if(Object.assign(y,m),G(r.getTokenUsage?.()),b(r.getCitations?.()),u.isFirstChunk||f)u.isFirstChunk=!1,l.enqueue({...y,type:"response-metadata"});let g=r.getDeltaToolCalls();if(Array.isArray(g)&&g.length>0)u.finishReason={raw:void 0,unified:"tool-calls"};let C=r.getDeltaContent();if(typeof C==="string"&&C.length>0)h=V(C,l,u,h,n);if(Array.isArray(g)&&g.length>0)j(g,l,w,P);let K=r.getFinishReason();if(K){if(u.finishReason=td(K),u.finishReason.unified==="tool-calls"){if(k(l,w,n,P),u.activeText&&h)l.enqueue({id:h,type:"text-end"}),u.activeText=!1}}}}))}function k(a,t,e,s){let n=!1;for(let o of t.values()){if(o.didEmitCall)continue;o.id??=e.generateToolCallId(),s(o,a),n=!0,o.didEmitCall=!0,a.enqueue({id:o.id,type:"tool-input-end"}),a.enqueue({input:o.arguments,toolCallId:o.id,toolName:o.toolName??"",type:"tool-call"})}return n}function A(a,t,e,s,n,o){let d=e(a,{modelId:n,modelType:"languageModel",operation:"doStream",requestBody:ed(s),url:o});t.enqueue({error:d instanceof Error?d:Error(String(d)),type:"error"}),t.terminate()}function V(a,t,e,s,n){let o=s;if(!e.activeText)o=n.generateTextBlockId(),t.enqueue({id:o,type:"text-start"}),e.activeText=!0;if(o)return t.enqueue({delta:a,id:o,type:"text-delta"}),o;return s??n.generateTextBlockId()}function j(a,t,e,s){for(let n of a){let o=n.index;if(typeof o!=="number"||!Number.isFinite(o))continue;if(!e.has(o))e.set(o,{arguments:"",didEmitCall:!1,didEmitInputStart:!1,id:typeof n.id==="string"&&n.id.length>0?n.id:void 0,toolName:n.function?.name});let d=e.get(o);if(!d)continue;if(typeof n.id==="string"&&n.id.length>0&&d.id===void 0)d.id=n.id;let i=n.function?.name;if(typeof i==="string"&&i.length>0)d.toolName=i;if(!d.didEmitInputStart&&d.toolName!=null&&d.id!=null)s(d,t);let p=n.function?.arguments;if(typeof p==="string"&&p.length>0){if(d.arguments+=p,d.didEmitInputStart&&d.id!=null)t.enqueue({delta:p,id:d.id,type:"tool-input-delta"})}}}async function*J(a,t){try{for await(let e of a)t?.throwIfAborted(),yield e;t?.throwIfAborted()}catch(e){if(t?.aborted)yield S(t.reason);else yield e instanceof Error?e:Error(String(e))}}var Ks=class{static COMMON_PARAM_MAPPINGS=[{camelCaseKey:"maxTokens",optionKey:"maxOutputTokens",outputKey:"max_completion_tokens"},{camelCaseKey:"temperature",optionKey:"temperature",outputKey:"temperature"},{camelCaseKey:"topP",optionKey:"topP",outputKey:"top_p"},{camelCaseKey:"frequencyPenalty",optionKey:"frequencyPenalty",outputKey:"frequency_penalty"},{camelCaseKey:"presencePenalty",optionKey:"presencePenalty",outputKey:"presence_penalty"},{camelCaseKey:"seed",optionKey:"seed",outputKey:"seed"},{optionKey:"reasoning",outputKey:"reasoning_effort"},{camelCaseKey:"parallel_tool_calls",outputKey:"parallel_tool_calls"}];async doGenerate(a,t,e){try{if(e.abortSignal?.aborted)throw S(e.abortSignal.reason);let s=this.buildCommonParts(a,t,e),{request:n,warnings:o}=this.buildRequest(a,t,e,s),d=this.createClient(a,t,s),i=await this.executeApiCall(d,n,Oc(a.requestConfig,e.abortSignal,e.headers));return $2({providerName:s.providerName,requestBody:n,requestId:i.requestId,response:i,responseHeaders:Ys(i.rawResponse.headers),version:Kr,warnings:[...s.warnings,...o]})}catch(s){throw Qs(s,{modelId:a.modelId,modelType:"languageModel",operation:"doGenerate",requestBody:ed(e),url:this.getUrl()})}}async doStream(a,t,e){try{if(e.abortSignal?.aborted)throw S(e.abortSignal.reason);let s=this.buildCommonParts(a,t,e),{request:n,warnings:o}=this.buildRequest(a,t,e,s),d=this.createClient(a,t,s),i=await this.executeStreamCall(d,n,e.abortSignal??void 0,t,Oc(a.requestConfig,void 0,e.headers),s),p=new W,I=this.collectStreamWarnings(t,s.sapOptions),R=z({cancel:i.cancel,convertToAISDKError:Qs,extractChunkMetadata:(q)=>this.extractMetadata(q),idGenerator:p,includeRawChunks:e.includeRawChunks??!1,modelId:a.modelId,options:e,providerName:s.providerName,requestId:i.requestId,responseMetadata:{...i.responseMetadata,id:i.responseMetadata?.id??p.generateResponseId()},sdkStream:i.stream,streamResponseGetCitations:i.getCitations,streamResponseGetFinishReason:i.getFinishReason,streamResponseGetIntermediateFailures:i.getIntermediateFailures,url:this.getUrl(),version:Kr,warnings:[...s.warnings,...o,...I]});return{request:{body:n},response:{headers:i.responseHeaders},stream:R}}catch(s){throw Qs(s,{modelId:a.modelId,modelType:"languageModel",operation:"doStream",requestBody:ed(e),url:this.getUrl()})}}buildCommonParts(a,t,e){let s=mo(a.provider),n=a.parsedProviderOptions,o=[],d=this.resolveAdditionalState(a,t,n,e,o),i=H2(e.prompt,{escapeTemplatePlaceholders:this.getEscapeTemplatePlaceholders(n,t),includeReasoning:this.getIncludeReasoning(n,t),parsePartProviderOptions:this.getPartProviderOptionsParser(),warnings:o}),{modelParams:p,warnings:I}=q2({options:e,paramMappings:this.getParamMappings(),providerModelParams:n?.modelParams,settingsModelParams:t.modelParams});o.push(...I);let R=G2(e.toolChoice);return{messages:i,modelParams:p,providerName:s,resolvedState:d,sapOptions:n,toolChoice:R,warnings:o}}collectStreamWarnings(a,t){return[]}extractMetadata(a){let t=z2(a,this.getCompletionDataPath()),{headers:e,requestId:s}=Vr(a,"rawResponse");return{requestId:s,responseHeaders:e,responseMetadata:t}}getEscapeTemplatePlaceholders(a,t){return!1}getIncludeReasoning(a,t){return a?.includeReasoning??t.includeReasoning??!1}getPartProviderOptionsParser(){return}resolveAdditionalState(a,t,e,s,n){return}};
|
|
2
|
+
export{Ks};
|